This manual describes devices and parameters for structured programs used in the MELSEC-F FX Series.
Please read this manual and manuals of relevant products before use, sufficiently understand the
specifications, and use the unit correctly and safely.
See to it that this manual is supplied 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 described in this manual.
• This manual provides information for the use of the FX Series Programmable Controllers. The manual has
been written to be used by trained and competent personnel. 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 representative
• 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
representative.
Registration
•Microsoft®, Windows® and Excel® are either registered trademarks or trademarks of Microsoft Corporation
in the United States and/or other countries.
• CompactFlash is a trademark of SanDisk Corporation in the United States and other countries.
• Ethernet is a trademark of Xerox Corporation.
•MODBUS
• The company name and the product name to be described in this manual are the registered trademarks or
trademarks of each company.
2
®
is a registered trademark of Schneider Electric SA.
Page 5
FXCPU Structured Programming Manual
[Device & Common]
Table of Contents
Positioning of This Manual....................................................................................................... 6
Related Manuals........................................................................................................................ 9
Generic Names and Abbreviations Used in Manuals .......................................................... 12
This manual explains devices and parameters for structured programs provided by GX Works2. Refer to
other manuals for sequence instructions and application functions.
Refer to each corresponding manual for analog, communication, positioning control and special units and
blocks.
This manual explains application functions for structured programs provided
by GX Works2.
FX3S/FX3G/FX
3GC
/FX3U/FX
3UC
User's Manual- Analog Control Edition
(Additional Manual)
This manual explains details of analog special function blocks and analog special
adapters for FX
Explanation of instructions and instructions used in program examples are expressed
for GX Developer.
FX Series User's Manual -Data Communication Edition
This manual explains details of simple N:N link, parallel link, computer link, no-protocol
communication (RS and RS2 instructions), programming communication and inverter
communication for FX PLCs.
Explanation of instructions and instructions used in program examples are expressed
for GX Developer.
3S
/FX3G/FX
3GC
/FX3U/FX
3UC
PLCs and PID instruction.
(Additional Manual)
FX
3S
FX
3G
FX
3GC
FX
3U
FX
3UC
Special
unit/block
FX3S/FX3G/FX
This manual explains details of wiring, instructions and operations of the positioning
function built in FX
Explanation of instructions and instructions used in program examples are expressed
for GX Developer.
Individual manuals
This manual explains details of each special unit/block.
Explanation of instructions and instructions used in program examples are expressed
for GX Developer.
*1. Detailed explanation may be provided by a separate manual in some products.
3GC
/FX3U/FX
3S
/FX3G/FX
3UC
Series User's Manual -Positioning Edition
3GC
/FX3U/FX
3UC
PLC main units.
(Manual supplied with product or additional Manual )
This manual explains application functions for structured programs provided
Structured
by GX Works2.
(Additional Manual)
(Additional Manual)
(Additional Manual)
(Additional Manual)
FX
Special
unit/block
FX Series User's Manual -Data Communication Edition
This manual explains details of simple N:N link, parallel link, computer link, no-protocol
communication (RS instruction), programming communication and inverter communication
for FX PLCs.
Explanation of instructions and instructions used in program examples are expressed for
GX Developer and FX-PCS/WIN.
Individual manuals
This manual explains details of each special unit/block.
Explanation of instructions and instructions used in program examples are expressed
for GX Developer and FX-PCS/WIN.
*1. Detailed explanation may be provided by a separate manual in some products.
(Manual supplied with product or additional Manual )
This manual explains application functions for structured programs provided
Structured
by GX Works2.
(Additional Manual)
(Additional Manual)
(Additional Manual)
FX
Special
unit/block
FX Series User's Manual -Data Communication Edition
This manual explains details of parallel link, computer link, no-protocol communication
(RS instruction) and programming communication for FX PLCs.
Explanation of instructions and instructions used in program examples are expressed for
GX Developer and FX-PCS/WIN.
Individual manuals
This manual explains details of each special unit/block.
Explanation of instructions and instructions used in program examples are expressed
for GX Developer and FX-PCS/WIN.
*1. Detailed explanation may be provided by a separate manual in some products.
(Manual supplied with product or additional Manual )
(Additional Manual)
*1
8
Page 11
FXCPU Structured Programming Manual
[Device & Common]
Related Manuals
This manual explains devices and parameters for structured programs provided by GX Works2.
Refer to other manuals for sequence instructions and applied functions.
This chapter introduces only reference manuals for this manual and manuals which describe the hardware
information of PLC main units.
Manuals not introduced here may be required in some applications.
Refer to the manual of the used PLC main unit and manuals supplied together with used products.
Contact the representative for acquiring required manuals.
Programming methods, specifications, functions,
etc. required to create structured programs
Devices, parameters, etc. provided in structured
projects of GX Works2
Sequence instructions provided in structured
projects of GX Works2
Application functions provided in structured
projects of GX Works2
Model
name code
13JW06
09R925
09R926
09R927
FX
3S/FX3G/FX3GC/FX3U/FX3UC PLCs
Manual nameManual number
PLC main unit
FX3U Series Hardware ManualJY997D18801Supplied with product
FX3U Series User's Manual- Hardware
Edition
FX3UC (D, DS, DSS) Series Hardware
Manual
FX3UC-32MT-LT-2 Hardware ManualJY997D31601Supplied with product
FX3UC Series User's Manual Hardware Edition
FX3G Series Hardware ManualJY997D46001Supplied with product
3G Series User's Manual- Hardware
FX
Edition
FX3GC Series Hardware ManualJY997D45201Supplied with product
FX3GC Series User's ManualHardware Edition
JY997D16501Additional Manual
JY997D28601Supplied with product
JY997D28701Additional Manual
JY997D31301Additional Manual
JY997D45401Additional Manual
Supplied with product
or Additional Manual
Contents
I/O specifications, wiring and installation of the
PLC main unit FX3U extracted from the FX3U
Series User’s Manual - Hardware Edition. For
detailed explanation, refer to the FX3U Series
User’s Manual - Hardware Edition.
Details about the hardware including I/O
specifications, wiring, installation and
maintenance of the FX3U PLC main unit.
I/O specifications, wiring and installation of the
PLC main unit FX3UC (D, DS, DSS) extracted
from the FX3UC Series User’s Manual - Hardware
Edition. For detailed explanation, refer to the
FX3UC Series User’s Manual - Hardware Edition.
I/O specifications, wiring and installation of the
PLC main unit FX3UC-32MT-LT-2 extracted from
the FX3UC Series User’s Manual - Hardware
Edition. For detailed explanation, refer to the
FX3UC Series User’s Manual - Hardware Edition.
Details about the hardware including I/O
specifications, wiring, installation and
maintenance of the FX3UC PLC main unit.
I/O specifications, wiring and installation of the
PLC main unit FX3G extracted from the FX3G
Series User’s Manual - Hardware Edition. For
detailed explanation, refer to the FX3G Series
User’s Manual - Hardware Edition.
Details about the hardware including I/O
specifications, wiring, installation and
maintenance of the FX
I/O specifications, wiring and installation of the
PLC main unit FX3GC extracted from the FX3GC
Series User's Manual - Hardware Edition. For
detailed explanation, refer to the FX3GC Series
User's Manual - Hardware Edition.
Details about the hardware including I/O
specifications, wiring, installation and
maintenance of the FX3GC PLC main unit.
3G PLC main unit.
Model
name code
-
09R516
-
-
09R519
-
09R521
-
09R533
9
Page 12
FXCPU Structured Programming Manual
[Device & Common]
Related Manuals
Manual nameManual number
PLC main unit
FX3S Series Hardware ManualJY997D48301Supplied with product
FX3S Series User's Manual Hardware Edition
Programming
FX3S/FX3G/FX3GC/FX3U/FX3UC User's
Manual- Analog Control Edition
FX Series User's Manual -Data
Communication Edition
FX3S/FX3G/FX3GC/FX3U/FX3UC Series
User's Manual - MODBUS Serial
Communication Edition
FX3S/FX3G/FX3GC/FX3U/FX3UC Series
User's Manual -Positioning Edition
I/O specifications, wiring and installation of the
PLC main unit FX3S extracted from the FX3S
Series User's Manual - Hardware Edition. For
detailed explanation, refer to the FX3S Series
User's Manual - Hardware Edition.
Details about the hardware including I/O
specifications, wiring, installation and
maintenance of the FX3S PLC main unit.
Details about the analog special function block
(FX3U-4AD, FX3U-4DA, FX3UC-4AD) and analog
special adapter (FX3U-****-ADP).
Details about simple N : N link, parallel link,
computer link and no-protocol communication
(RS instruction and FX2N-232IF).
Explains the MODBUS serial communication
network in FX3S/FX3G/FX3GC/FX3U/FX3UC PLCs.
Details about the positioning function built in the
FX3S/FX3G/FX3GC/FX3U/FX3UC Series.
Describes details of the FX3U-CF-ADP CF card
special adapter.
Model
name code
-
09R535
09R619
09R715
09R626
09R620
09R720
Manual nameManual number
PLC main unit
FX1S HARDWARE MANUALJY992D83901Additional Manual
FX1N HARDWARE MANUALJY992D89301Additional Manual
FX2N HARDWARE MANUALJY992D66301Additional Manual
1NC HARDWARE MANUALJY992D92101Additional Manual
FX
FX2NC HARDWARE MANUALJY992D76401Additional Manual
Programming
FX Series User's Manual -Data
Communication Edition
JY997D16901Additional Manual
Supplied with product
or Additional Manual
Contents
Details about the hardware including I/O
specifications, wiring, installation and
maintenance of the FX1S PLC main unit.
Details about the hardware including I/O
specifications, wiring, installation and
maintenance of the FX1N PLC main unit.
Details about the hardware including I/O
specifications, wiring, installation and
maintenance of the FX2N PLC main unit.
Details about the hardware including I/O
specifications, wiring, installation and
maintenance of the FX
(Japanese only)
Details about the hardware including I/O
specifications, wiring, installation and
maintenance of the FX2NC PLC main unit.
Details about simple N : N link, parallel link,
computer link and no-protocol communication
(RS instruction and FX2N-232IF).
1NC PLC main unit.
Model
name code
-
-
09R508
09R505
09R509
09R715
10
Page 13
FXCPU Structured Programming Manual
[Device & Common]
FX0S/FX0/FX0N/FXU/FX2C PLCs [whose production is finished]
Related Manuals
Manual nameManual number
PLC main unit
FX0/FX0N HARDWARE MANUALJY992D47501Supplied with product
FX0S HARDWARE MANUALJY992D55301Supplied with product
FX/FX2C HARDWARE MANUALJY992D47401Supplied with product
Programming
FX Series User's Manual -Data
Communication Edition
JY997D16901Additional Manual
Supplied with product
or Additional Manual
Manuals of models whose production is finished
Production is finished for FX
0S/FX0/FX0N/FXU/FX2C/FX2N/FX2NC PLCs.
Contents
Details about the hardware including I/O
specifications, wiring, installation and
maintenance of the FX0/FX0N PLC main unit.
Details about the hardware including I/O
specifications, wiring, installation and
maintenance of the FX0S PLC main unit.
Details about the hardware including I/O
specifications, wiring, installation and
maintenance of the FXU/FX2C PLC main unit.
Details about simple N : N link, parallel link,
computer link and no-protocol communication
(RS instruction and FX2N-232IF).
Model
name code
-
-
-
09R715
11
Page 14
FXCPU Structured Programming Manual
[Device & Common]
Generic Names and Abbreviations Used in Manuals
Generic Names and Abbreviations Used in Manuals
Abbreviation/generic nameName
PLCs
FX3U Series or FX3U PLCGeneric name of FX3U Series PLCs
FX3UC Series or FX3UC PLCGeneric name of FX3UC Series PLCs
FX3G Series or FX3G PLCGeneric name of FX3G Series PLCs
FX3GC Series or FX3GC PLCGeneric name of FX3GC Series PLCs
FX3S Series or FX3S PLCGeneric name of FX3S Series PLCs
FX2N Series or FX2N PLCGeneric name of FX2N Series PLCs
FX2NC Series or FX2NC PLCGeneric name of FX2NC Series PLCs
FX1N Series or FX1N PLCGeneric name of FX1N Series PLCs
FX1NC Series or FX1NC PLC
FX1S Series or FX1S PLCGeneric name of FX1S Series PLCs
FXU Series or FXU PLCGeneric name of FXU(FX,FX2) Series PLCs
FX2C Series or FX2C PLCGeneric name of FX2C Series PLCs
FX0N Series or FX0N PLCGeneric name of FX0N Series PLCs
FX0S Series or FX0S PLCGeneric name of FX0S Series PLCs
FX0 Series or FX0 PLCGeneric name of FX0 Series PLCs
Special adapters
CF card special adapterGeneric name of CF card special adapters
CF-ADPFX3U-CF-ADP
Ethernet adapterAbbreviated name for FX3U-ENET-ADP
Programming language
STAbbreviation of structured text language
Structured ladderAbbreviation of ladder diagram language
FBDAbbreviation of function block diagram language
FX Structured Programming Manual
[Device & Common]
FX Structured Programming Manual
[Basic & Applied Instruction]
FX Structured Programming Manual
[Application Functions]
COMMUNICATION CONTROL
EDITION
ANALOG CONTROL EDITION
POSITIONING CONTROL EDITION
Generic name of FX1NC Series PLCs
These products can only used in Japan.
Abbreviation of MELSEC-Q/L/F Structured Programming Manual (Fundamentals)
Abbreviation of FXCPU Structured Programming Manual [Device & Common]
Abbreviation of FXCPU Structured Programming Manual [Basic & Applied Instruction]
Abbreviation of FXCPU Structured Programming Manual [Application Functions]
Abbreviation of FX Series User's Manual-DATA COMMUNICATION CONTROL EDITION
Abbreviation of FX3S/FX3G/FX3GC/FX3U/FX3UC Series User's Manual-ANALOG CONTROL
EDITION
Abbreviation of FX3S/FX3G/FX3GC/FX3U/FX3UC Series User's Manual-POSITIONING CONTROL
EDITION
12
Page 15
FXCPU Structured Programming Manual
[Device & Common]
1.Device Outline
1 Device Outline
1.1 Devices Constructing PLC
1
Device Outline
This chapter explains basic contents of devices.
1.1Devices Constructing PLC
Each PLC has many built-in relays, timers, counters, etc.
Each of which has many normally-open contacts and normally-closed contacts.
Connect these contacts and coils to construct a program.
Each PLC also has built-in memory devices including data registers (D) and extension registers (R) to store
numeric data.
Constant
2
Devices in
Detail
3
Specified the
Device &
4
Special Device
5
Errors
6
Types and
Setting of
Parameters
7
Other Functions
13
Page 16
FXCPU Structured Programming Manual
[Device & Common]
1.1.1Relation among devices
Arrow indicates signal transfer.
Input relay: X
The PLC receives signals from external input switches via input relays.
The symbol of input relay is "X".
The PLC has built-in input relays in accordance with its scale.
1 Device Outline
1.1 Devices Constructing PLC
Input terminal or
input connector
Auxiliary relay: M
The PLC has many
built-in auxiliary
relays.
The symbol of
auxiliary relay is "M".
State relay: S
The PLC has many
built-in state relays.
The symbol of state
relay is "S".
Timer: T
The PLC has many
built-in timers.
The symbol of timer
is "T".
4123
Counter: C
The PLC has many
built-in counters.
The symbol of
counter is "C".
Output relay: Y
The PLC drives
external loads via
output relays.
The PLC has many
built-in output relays.
The symbol of
output relay is "Y".
14
Contact (one normally-open contact) for external output of output relay
The PLC has built-in output contacts in accordance with its scale.
Output terminal or
output connector
Page 17
FXCPU Structured Programming Manual
[Device & Common]
1.1.2Device function list
1. Input relay (X) and output relay (Y)
• In the PLC main unit, input relays and output relays are assigned with serial octal numbers such as "X000
to X007", "X010 to X017", "Y000 to Y007" and "Y010 to Y017".
In extension units and extension blocks, input relays and output relays are also assigned with serial octal
numbers in the connection order from the PLC main unit.
• Digital filters are used in specified input relays, and the filter value can be changed in programs.
Accordingly, assign input relay numbers having input filter for applications requiring high-speed receiving.
(Refer to explanation of filter adjustment, input interrupt, high speed counter and various instructions.)
2. Auxiliary relay (M)
• Auxiliary relays are built in the PLC. Different from input relays and output relays, auxiliary relays cannot
receive external inputs or cannot drive external loads directly.
Auxiliary relays are available only in programs.
• In some auxiliary relays, the ON/OFF status is backed up against interruption of the PLC power.
3. State relay (S)
• State relays are used as process numbers in the step ladder.
• If state relays are not used as process numbers, they can be programmed as general contacts/coils in the
same way as auxiliary relays.
• State relays can be used as annunciators for external failure diagnosis.
1 Device Outline
1.1 Devices Constructing PLC
→ Refer to Section 2.2.
→ Refer to Section 2.3.
→ Refer to Section 2.4.
Constant
1
Device Outline
2
Devices in
Detail
3
Specified the
Device &
4
Special Device
5
Errors
4. Timer (T)
→ Refer to Section 2.5.
• Timers count clock pulses (1 ms, 10 ms, 100 ms, etc.) inside the PLC.
When the count value reaches the set value, output contacts are activated.
Timers can measure 0.001 to 3276.7 seconds in accordance with the base clock pulse.
5. Counter (C)
Counters are classified into the following types, and can be used for suitable purposes and applications.
1) Counter (latched type)
→ Refer to Section 2.6.
Counters are used for signals inside the PLC. The response speed is several tens of Hz or less usually.
- 16-bit counter: For up-counting, counting range: 1 to 32767
- 32-bit counter: For up/down-counting, counting range: -2,147,483,648 to +2,147,483,647
2) High speed counter (latched type backed up against power interruption)
→ Refer to Section 2.7.
High speed counters can count several kHz without regard to operations in the PLC.
- 32-bit counter: For up/down-counting, counting range: -2,147,483,648 to +2,147,483,647
(1-phase 1-counting, 1-phase 2 counting or 2-phase 2 counting) assigned to specific input relays
6. Data register (D)
→ Refer to Section 2.8.
Data registers store numeric data.
FX PLCs have only 16-bit data registers (whose most significant bit indicates the positive or negative sign),
but two combined data registers can handle 32-bit numeric value (whose most significant bit indicates the
positive or negative sign). (Refer to "5. Counter" for the available numeric range.)
Data registers are classified into the general type and the latched type (backed up against power interruption)
in the same way as other devices.
6
Types and
Setting of
Parameters
7
Other Functions
15
Page 18
FXCPU Structured Programming Manual
[Device & Common]
7. Extension register (R) and extension file register (ER)
Only FX
Extension registers(R) are extended type of data registers (D), and backed up against power interruption by
battery in FX
In FX
is connected.
FX
(ER). However, FX
attached.
8. Index register (V and Z)
Registers (V) (Z) are available for indexing.
Add index registers (V) (Z) to other devices as follows:
[In the case of "V0 = 5, Z0 = 5]
D100V0 = D105, C20Z0 = C25 ← Device number + Value of V
Data registers and index registers are used to indirectly specify set values of timers and counters, or used in
instructions.
9. Pointer (P and I)
Pointers are classified into the branch type and the interrupt type.
• Branch pointers (P) specify the jump destination of the CJ (FNC 00: Conditional jump) and CALL
• Interrupt pointers (I) specify the interrupt routine for input interrupt, timer interrupt or counter interrupt.
3G/FX3GC/FX3U/FX3UC PLCs support extension registers (R) and extension file registers (ER).
3U/FX3UC PLCs.
3G/FX3GC PLCs, general type devices can be backed up against power interruption if an optional battery
3G/FX3GC/FX3U/FX3UC PLCs can store the contents of extension registers (R) in extension file registers
3U/FX3UC PLCs can use extension file registers (ER) only while a memory cassette is
(subroutine call) instructions.
1 Device Outline
1.1 Devices Constructing PLC
→ Refer to Section 2.9.
→ Refer to Section 2.10.
or Z
→ Refer to Section 2.11.
10.Constant (K, H and E)
→ Refer to Chapter 3.
Among various numeric values used in PLCs, "K" indicates "decimal integer", "H" indicates "hexadecimal
value", and "E" indicates "real number (floating point data)".
Constants are used for set values and current values of timers and counters as well as input variables of
instructions.
16
Page 19
FXCPU Structured Programming Manual
[Device & Common]
1.2Program Memory and Devices
1.2.1Memory structure
1 Device Outline
1.2 Program Memory and Devices
1
Device Outline
1. FX3U and FX3UC PLCs
CPUSystem ROM
Built-in device memory(RAM)
[Bit device memory]
Contact image memory
Input relay (X) Output relay (Y)
Auxiliary relay (M) State relay (S)
Timer contact, time counting coil,
counter contact, counting coil and reset coil
Built-in program memory(RAM)
Parameter
Sequence program
Comment
File register (D)
Special setting
Symbolic information
2
Devices in
Detail
3
Specified the
Device &
[Data memory]
Data register (D)
Timer current value register (T)
Counter current value register (C)
Index register (V and Z)
Extension register (R)
Optional memory
(Flash memory)
Parameter
Sequence program
Comment
File register (D)
Special setting
*1
Symbolic information
*1
Transfer/initialization by instruction
Constant
Parameters
4
Special Device
5
Errors
6
Types and
Setting of
*1. Supported in Ver. 3.00 or later.
Extension file register (ER)
The PLC automatically recognizes attachment of
an optional memory (when the power is turned ON),
and isolates the built-in program memory.
(The PLC gives the priority to the optional memory.)
7
Other Functions
17
Page 20
FXCPU Structured Programming Manual
[Device & Common]
2. FX3G and FX3GC PLCs
CPUSystem ROM
Built-in device memory(RAM, EEPROM)
[Bit device memory][Data memory]
Contact image memory
Input relay (X) Output relay (Y)
Auxiliary relay (M) State relay (S)
Timer contact, time counting coil, reset coil (T),
counter contact, counting coil and reset coil (C)
Built-in program memory(EEPROM)
Parameter
Sequence program
Comment
File register (D)
Special setting
Extension file register (ER)
Data register (D)
Timer current value register (T)
Counter current value register (C)
Index register (V and Z)
Extension register (R)
Transfer/initialization
by instruction
1.2 Program Memory and Devices
Optional memory
(EEPROM)
Parameter
Sequence program
Comment
File register (D)
Special setting
Extension file register (ER)
*1
1 Device Outline
Transfer/initialization by instruction
The PLC automatically recognizes attachment of
an optional memory
and isolates the built-in program memory.
(The PLC gives the priority to the optional memory.)
*1
(when the power is turned ON),
*1.Optional memory cannot be connected to FX3GC PLCs.
18
Page 21
FXCPU Structured Programming Manual
[Device & Common]
3. FX3S PLCs
CPUSystem ROM
1 Device Outline
1.2 Program Memory and Devices
1
Device Outline
Built-in device memory(RAM, EEPROM)
[Bit device memory][Data memory]
Contact image memory
Input relay (X) Output relay (Y)
Auxiliary relay (M) State relay (S)
Timer contact, time counting coil, reset coil (T),
counter contact, counting coil and reset coil (C)
Built-in program memory(EEPROM)
Parameter
Sequence program
Comment
File register (D)
The PLC automatically recognizes attachment of
an optional memory (when the power is turned ON),
and isolates the built-in program memory.
(The PLC gives the priority to the optional memory.)
Data register (D)
Timer current value register (T)
Counter current value register (C)
Index register (V and Z)
Optional memory
(EEPROM)
Parameter
Sequence program
Comment
File register (D)
Constant
2
Devices in
Detail
3
Specified the
Device &
4
Special Device
5
Errors
6
Types and
Setting of
Parameters
7
Other Functions
19
Page 22
FXCPU Structured Programming Manual
[Device & Common]
4. FX1S/FX1N/FX2N/FX1NC/FX2NC PLCs
CPUSystem ROM
Built-in device memory(RAM, EEPROM)
[Bit device memory][Data memory]
1 Device Outline
1.2 Program Memory and Devices
Contact image memory
Input relay (X) Output relay (Y)
Auxiliary relay (M) State relay (S)
Timer contact, time counting coil, reset coil (T),
counter contact, counting coil and reset coil (C)
Built-in program memory
(RAM, EEPROM)
Parameter
Sequence program
Comment
File register (D)
The PLC automatically recognizes attachment of
an optional memory
and isolates the built-in program memory.
(The PLC gives the priority to the optional memory.)
*1
(when the power is turned ON),
Data register (D)
Timer current value register (T)
Counter current value register (C)
Index register (V and Z)
Optional memory
(RAM,EEPROM,EPROM)
Parameter
Sequence program
Comment
File register (D)
Clock function
2NC-EEPROM16C)
(FX
Extension function
2N-ROM-E1)
(FX
Clock function + Extension function
(FX2NC-ROM-CE1)
*1
*1.Optional memory cannot be connected to FX1NC PLCs.
20
Page 23
FXCPU Structured Programming Manual
[Device & Common]
5. FX0S/FX0/FX0N/FXU/FX2C PLCs
CPUSystem ROM
1 Device Outline
1.2 Program Memory and Devices
1
Device Outline
Built-in device memory(RAM, EEPROM)
[Bit device memory][Data memory]
Contact image memory
Input relay (X) Output relay (Y)
Auxiliary relay (M) State relay (S)
Timer contact, time counting coil, reset coil (T),
counter contact, counting coil and reset coil (C)
Built-in program memory
(RAM, EEPROM)
Parameter
Sequence program
Comment
File register (D)
The PLC automatically recognizes attachment of
an optional memory
and isolates the built-in program memory.
(The PLC gives the priority to the optional memory.)
*2
*1
(when the power is turned ON),
Data register (D)
Timer current value register (T)
Counter current value register (C)
Index register (V and Z)
Optional memory
(RAM,EEPROM,EPROM)
Parameter
Sequence program
Comment
File register (D)
2
Devices in
Detail
3
Specified the
Device &
Constant
*1
4
Special Device
*2
5
Errors
6
Types and
Setting of
Parameters
*1.Optional memory cannot be connected to FX0S/FX0 PLCs.
*2.FX
0S/FX0 PLCs do not support file registers.
7
Other Functions
21
Page 24
FXCPU Structured Programming Manual
[Device & Common]
1.2 Program Memory and Devices
1 Device Outline
1.2.2Memory operations and backup against power interruption (power ON/OFF and
RUN/STOP)
1. FX3U/FX3UC PLCs
1) Types of program memory
ItemPower OFFPower OFF→ONSTOP→RUNRUN→STOP
Parameter
Sequence program
Comment
File register
Special setting
Symbolic information
Can be secured by
parameter setting.
*1
Does not change.
Does not change.
Does not change.
Does not change.
Does not change.
Does not change.
2) Types of word device memory
ItemPower OFFPower OFF→ONSTOP→RUNRUN→STOP
General typeCleared.
Data register (D)
Extension register (R)Latched (backed-up) type
Extension file register
*5
(ER)
Index register (V and Z)V, ZCleared.Does not change.
Timer current value
register (T)
Counter current value
register (C)
Clock dataCurrent value
Latched (backed-up) type
File type
Special typeCleared.
File typeDoes not change.
For 100 msCleared.
For 10 msCleared.
Retentive type for 100 ms
Retentive type for 1 ms
General typeCleared.
Latched (backed-up) type
High speed type
Does not change.
Does not change.
Set to initial
*4
value.
Does not change.
Does not change.
Does not change.
Does not change.
Does not change.
Does not change.
*2
*2
*2
*2
*2
*2
Does not change.Cleared.
Does not change while M8033 is ON.
*3
*2
Does not change.
*3
Does not change.Cleared.
Does not change while M8033 is ON.
Does not change.Cleared.
Does not change while M8033 is ON.
*3
*3
Does not change.Cleared.
Does not change while M8033 is ON.
*3
*3
*3
*4
22
*1.Available in Ver. 3.00 or later.
*2.The program memory contents or device status is not held correctly when the battery voltage
becomes lower than the holding voltage if a memory cassette is not attached.
*3.The device status is not held correctly when the battery voltage becomes lower than the holding
voltage.
*4.Some devices are cleared when the PLC mode switches from STOP to RUN.
→ For special data registers, refer to Chapter 4.
*5.An optional memory cassette is required.
Page 25
FXCPU Structured Programming Manual
[Device & Common]
• Caution
When the battery voltage becomes low due to expiration of the battery life or another reason, programs
(not stored in a memory cassette), latched (backed-up) type devices and clock data are not held correctly.
Clear latched type devices, and transfer programs (not stored in a memory cassette) again. In addition, set
the initial values and clock data if necessary.
→ For rough guide to the life and replacement timing of the battery, refer to the User's Manual
→ For the latched type device clear method, refer to Subsection 1.2.5.
3) Types of bit device memory
ItemPower OFFPower OFF→ONSTOP→RUNRUN→STOP
Input relay (X)Cleared.
Output relay (Y)Cleared.
General type auxiliary
relay (M)
Latched (backed-up) type
Contact image memory
(X, Y, M, S)
Timer contact
Time counting coil
Reset coil (T)
Counter contact
Counting coil
Reset coil (C)
*1.Some devices are cleared when the PLC mode switches from STOP to RUN.
*2.When the battery voltage becomes lower than the holding voltage, the device status is not held
correctly.
auxiliary relay (M)
Special auxiliary relay (M)Cleared.
General type state relay
(S)
Latched (backed-up) type
state relay (S)
Annunciator (S)Cleared.
For 100 msCleared.
For 10 msCleared.
Retentive type for 100 msDoes not change.
Retentive type for 1 msDoes not change.
General typeCleared.
Latched (backed-up) typeDoes not change.
High speed typeDoes not change.
1 Device Outline
1.2 Program Memory and Devices
[Hardware Edition] of each PLC.
Does not change.
Does not change while M8033 is ON.
Does not change.Cleared.
Does not change while M8033 is ON.
Cleared.
Does not change.
Set to initial
value.
Cleared.
Does not change.
Does not change.Cleared.
Does not change while M8033 is ON.
*1
Does not change.
Does not change.Cleared.
Does not change while M8033 is ON.
Does not change.Cleared.
Does not change while M8033 is ON.
Does not change.Cleared.
Does not change while M8033 is ON.
Does not change.Cleared.
Does not change while M8033 is ON.
Does not change.Cleared.
Does not change while M8033 is ON.
*1
→ For special auxiliary relays, refer to Chapter 4.
1
Device Outline
2
Devices in
Detail
3
Specified the
Device &
Constant
4
Special Device
5
Errors
6
Types and
Setting of
Parameters
7
Other Functions
23
Page 26
FXCPU Structured Programming Manual
[Device & Common]
2. FX3G/FX3GCPLCs
1) Types of program memory
ItemPower OFFPower OFF→ONSTOP→RUNRUN→STOP
Parameter
Sequence program
Comment
File register
2) Types of word device memory
Data register (D)
Extension register (R)General type
Extension file register
(ER)
Index register (V and Z)V, ZCleared.Does not change.
Timer current value
register (T)
Counter current value
register (C)
Clock dataCurrent value
Can be secured by
parameter setting.
ItemPower OFFPower OFF→ONSTOP→RUNRUN→STOP
General type
Latched (backed-up) type
File type
Special typeCleared.
File typeDoes not change.
For 100 msCleared.
For 10 msCleared.
For 1 msCleared.
Retentive type for 100 ms
Retentive type for 1 ms
General typeCleared.
Latched (backed-up) type
High speed typeDoes not change.
Cleared.
Cleared.
Does not change.
Does not change.
Does not change.
Does not change.
*1
Does not change.
Does not change.
Set to initial
*2
value.
*1
Does not change.
Does not change.
Does not change.
Does not change.
1 Device Outline
1.2 Program Memory and Devices
Does not change.Cleared.
Does not change while M8033 is ON.
Does not change.
Does not change.
Does not change.Cleared.
Does not change while M8033 is ON.
Does not change.Cleared.
Does not change while M8033 is ON.
Does not change.Cleared.
Does not change while M8033 is ON.
Does not change.Cleared.
Does not change while M8033 is ON.
*3
*2
24
*1.General type devices can be changed to the latched type by parameter setting if an optional battery is
attached.
*2.Some devices are cleared when the PLC mode switches from STOP to RUN.
→ For special data registers, refer to Chapter 4.
*3.The clock data is held by the power accumulated in the large-capacity capacitor built in the PLC.
The clock data is not held correctly if the voltage of the built-in large-capacity capacitor becomes low.
The large-capacity capacitor can hold the clock data for 10 days (when the ambient temperature is
25°C) if it is charged fully (by turning ON the PLC for 30 minutes or more).
The clock data is backed up by the battery when an optional battery is attached and the battery mode
is selected by parameter setting.
Page 27
FXCPU Structured Programming Manual
[Device & Common]
3) Types of bit device memory
ItemPower OFFPower OFF→ONSTOP→RUNRUN→STOP
Input relay (X)Cleared.
Output relay (Y)Cleared.
General type auxiliary
relay (M)
Contact image memory
(X, Y, M, S)
Timer contact
Time counting coil
Reset coil (T)
Counter contact
Counting coil
Reset coil (C)
*1.General type devices can be changed to the latched type by parameter setting if an optional battery is
attached.
*2.Some devices are cleared when the PLC mode switches from STOP to RUN.
Latched (backed-up) type
auxiliary relay (M)
Special auxiliary relay (M)Cleared.
General type state relay
(S)
Latched (backed-up) type
state relay (S)
Annunciator (S)Does not change.
For 100 msCleared.
For 10 msCleared.
For 1 msCleared.
Retentive type for 100 msDoes not change.
Retentive type for 1 msDoes not change.
General typeCleared.
Latched (backed-up) typeDoes not change.
High speed typeDoes not change.
1 Device Outline
1.2 Program Memory and Devices
Does not change.Cleared.
Does not change while M8033 is ON.
Does not change.Cleared.
Does not change while M8033 is ON.
Cleared.
Cleared.
*1
Does not change.
Set to initial
value.
*1
Does not change.
Does not change.Cleared.
Does not change while M8033 is ON.
*2
Does not change.
Does not change.
Does not change.Cleared.
Does not change while M8033 is ON.
Does not change.Cleared.
Does not change while M8033 is ON.
Does not change.Cleared.
Does not change while M8033 is ON.
Does not change.Cleared.
Does not change while M8033 is ON.
*2
→ For special auxiliary relays, refer to Chapter 4.
Constant
Parameters
1
Device Outline
2
Devices in
Detail
3
Specified the
Device &
4
Special Device
5
Errors
6
Types and
Setting of
7
Other Functions
25
Page 28
FXCPU Structured Programming Manual
[Device & Common]
3. FX3S PLC
1) Types of program memory
ItemPower OFFPower OFF→ONSTOP→RUNRUN→STOP
ParameterDoes not change.
Sequence programDoes not change.
Comment
File registerDoes not change.
2) Types of word device memory
Data register (D)
Index register (V and Z)V, ZCleared.Does not change.
Timer current value
register (T)
Counter current value
register (C)
Clock dataCurrent value
Can be secured by
parameter setting.
ItemPower OFFPower OFF→ONSTOP→RUNRUN→STOP
General typeCleared.
Latched (backed-up) typeDoes not change.
File typeDoes not change.
Special typeCleared.
For 100 msCleared.
For 10 msCleared.
For 1 msCleared.
Retentive type for 100 msDoes not change.
Retentive type for 1 msDoes not change.
General typeCleared.
Latched (backed-up) typeDoes not change.
High speed typeDoes not change.
Does not change.
Set to initial
*1
value.
Does not change.
1 Device Outline
1.2 Program Memory and Devices
Does not change.Cleared.
Does not change while M8033 is ON.
Does not change.
Does not change.Cleared.
Does not change while M8033 is ON.
Does not change.Cleared.
Does not change while M8033 is ON.
Does not change.Cleared.
Does not change while M8033 is ON.
Does not change.Cleared.
Does not change while M8033 is ON.
*2
*1
*1.Some devices are cleared when the PLC mode switches from STOP to RUN.
→ For special data registers, refer to Chapter 4.
*2.The clock data is held by the power accumulated in the large-capacity capacitor built in the PLC.
The clock data is not held correctly if the voltage of the built-in large-capacity capacitor becomes low.
The large-capacity capacitor can hold the clock data for 10 days (when the ambient temperature is
25°C) if it is charged fully (by turning ON the PLC for 30 minutes or more).
26
Page 29
FXCPU Structured Programming Manual
[Device & Common]
3) Types of bit device memory
ItemPower OFFPower OFF→ONSTOP→RUNRUN→STOP
Input relay (X)Cleared.
Output relay (Y)Cleared.
General type auxiliary
relay (M)
Contact image memory
(X, Y, M, S)
Timer contact
Time counting coil
Reset coil (T)
Counter contact
Counting coil
Reset coil (C)
Latched (backed-up) type
auxiliary relay (M)
Special auxiliary relay (M)Cleared.
General type state relay
(S)
Latched (backed-up) type
state relay (S)
For 100 msCleared.
For 10 msCleared.
For 1 msCleared.
Retentive type for 100 msDoes not change.
Retentive type for 1 msDoes not change.
General typeCleared.
Latched (backed-up) typeDoes not change.
1 Device Outline
1.2 Program Memory and Devices
Does not change.Cleared.
Does not change while M8033 is ON.
Does not change.Cleared.
Does not change while M8033 is ON.
Cleared.
Does not change.
Set to initial
*1
value.
Cleared.Does not change.
Does not change.
Does not change.Cleared.
Does not change while M8033 is ON.
Does not change.
Does not change.Cleared.
Does not change while M8033 is ON.
Does not change.Cleared.
Does not change while M8033 is ON.
Does not change.Cleared.
Does not change while M8033 is ON.
Does not change. Cleared.
Does not change while M8033 is ON.
1
Device Outline
2
Devices in
Detail
*1
Constant
3
Specified the
Device &
4
Special Device
5
Errors
*1.Some devices are cleared when the PLC mode switches from STOP to RUN.
→ For special data registers, refer to Chapter 4.
6
Types and
Setting of
Parameters
7
Other Functions
27
Page 30
FXCPU Structured Programming Manual
[Device & Common]
4. FX1S/FX1N/FX2N/FX1NC/FX2NC PLCs
The memory type varies depending on the PLC, and is classified as follows by the device initialization timing.
*1.Some devices are cleared when the PLC mode switches from STOP to RUN.
1) Types of program memory
ParameterA2A2
Sequence programA2A2
Comment
File registerA2A2
A2: Backed up by EEPROMDoes not change.
A3: Backed up by capacitor
ItemFX1SFX1NFX2NFX1NCFX2NC
Can be secured by
parameter setting.
1 Device Outline
1.2 Program Memory and Devices
(The device status is not held correctly when the battery voltage becomes
(The device status is held correctly for 10 days (when the ambient tempera-
ture is 25°C) after the capacitor is fully charged, but the device status is not
held correctly after the capacitor is discharged.)
A2A2
Does not change.
lower than the holding voltage.)
Does not change.
Set to initial
*1
value.
A1
A1
A1
A1
Does not change.
Does not change.Cleared.
Does not change while M8033 is ON.
*1
*1
*1
*1
A2
A2
A2
A2
*1
*1
A1
*1
A1
*1
A1
*1
A1
*1.The battery is not used when an optional EEPROM or EPROM memory is attached.
2) Types of word device memory
ItemFX1SFX1NFX2NFX1NCFX2NC
General typeCCCCC
Data register (D)
Index register (V and Z)V, ZBBBBB
Timer current value
register (T)
Counter current value
register (C)
Clock dataCurrent valueA3A3A1A3
*1.Attach a memory board having the clock function when the clock function is required in the FX
Latched (backed-up) typeA2A2/A3A1A2/A3A1
*1
File type
Special typeBBBBB
For 100 msCCCCC
For 10 msCCCCC
Retentive type for 100 ms-A3A1A3A1
Retentive type for 1 ms-A3A1A3A1
General typeCCCCC
Latched (backed-up) typeA2A2/A3A1A2/A3A1
High speed typeA2A2A1A2A1
A2A2A1A2A1
A1
2NC
Series.
*1
28
Page 31
FXCPU Structured Programming Manual
[Device & Common]
3) Types of bit device memory
ItemFX1SFX1NFX2NFX1NCFX2NC
Input relay (X)CCCCC
Output relay (Y)CCCCC
General type auxiliary
relay (M)
Latched (backed-up) type
Contact image memory
(X, Y, M, S)
Timer contact
Time counting coil
Reset coil (T)
Counter contact
Counting coil
Reset coil (C)
auxiliary relay (M)
Special auxiliary relay (M)BBBBB
General type state relay
(S)
Latched (backed-up) type
state relay (S)
Annunciator (S)--A1-A1
For 100 msCCCCC
For 10 msCCCCC
Retentive type for 100 ms-A3A1A3A1
Retentive type for 1 ms-A3A1A3A1
General typeCCCCC
Latched (backed-up) typeA2A2/A3A1A2/A3A1
High speed typeA2A2A1A2A1
1 Device Outline
1.2 Program Memory and Devices
CCCCC
A2A2/A3A1A2/A3A1
A2A2/A3CA2/A3C
A2A2/A3A1A2/A3A1
Constant
1
Device Outline
2
Devices in
Detail
3
Specified the
Device &
4
Special Device
5
Errors
6
Types and
Setting of
Parameters
7
Other Functions
29
Page 32
FXCPU Structured Programming Manual
[Device & Common]
5. FX0S/FX0/FX0N/FXU/FX2C PLCs
1) Types of program memory
ItemPower OFFPower OFF→ONSTOP→RUNRUN→STOP
Parameter
Sequence program
Comment
File register
2) Types of word device memory
Data register (D)
Index register (V and Z)V, ZCleared.
Timer current value
register (T)
Counter current value
register (C)
Clock dataCurrent value
Can be secured by
parameter setting.
ItemPower OFFPower OFF→ONSTOP→RUNRUN→STOP
General type
Latched (backed-up) type
File type
Special typeCleared.
For 100 msCleared.
For 10 msCleared.
Retentive type for 100 ms
Retentive type for 1 ms
General typeCleared.
Latched (backed-up) type
High speed type
Cleared.
Does not change.
Does not change.
Does not change.
Does not change.
Does not change.
Does not change*2.
Set to initial
*1
value.
Set to initial
*1
value.
Does not change.
Does not change.
Does not change.
Does not change.
Does not change.
1 Device Outline
1.2 Program Memory and Devices
*2
*2
*2
*2
Does not change.Cleared.
Does not change while M8033 is ON.
*2
Does not change.
Does not change.
Does not change.Cleared.
Does not change while M8033 is ON.
Does not change.Cleared.
Does not change while M8033 is ON.
*2
*2
Does not change.Cleared.
Does not change while M8033 is ON.
*2
*2
*2
*1
*1
*1.Some devices are cleared when the PLC mode switches from STOP to RUN.
M8074 is backed up against power interruption.
*2.The device status is not held correctly when the battery voltage becomes lower than the holding
voltage.
U/FX2C PLCs)
(FX
30
Page 33
FXCPU Structured Programming Manual
[Device & Common]
3) Types of bit device memory
ItemPower OFFPower OFF→ONSTOP→RUNRUN→STOP
Input relay (X)Cleared.
Output relay (Y)Cleared.
General type auxiliary
relay (M)
Contact image memory
(X, Y, M, S)
Timer contact
Time counting coil
Reset coil (T)
Counter contact
Counting coil
Reset coil (C)
Latched (backed-up) type
auxiliary relay (M)
Special auxiliary relay (M)Cleared.
General type state relay
(S)
Latched (backed-up) type
state relay (S)
Annunciator (S)
For 100 msCleared.
For 10 msCleared.
Retentive type for 100 ms
Retentive type for 1 ms
General typeCleared.
Latched (backed-up) type
High speed type
Cleared.
Cleared.
Does not change.
Set to initial
*1
value.
Does not change.
Does not change.
Does not change.
Does not change.
Does not change.
Does not change.
1 Device Outline
1.2 Program Memory and Devices
Does not change.Cleared.
Does not change while M8033 is ON.
Does not change.Cleared.
Does not change while M8033 is ON.
Does not change.Cleared.
Does not change while M8033 is ON.
*2
Does not change.
Does not change.Cleared.
Does not change while M8033 is ON.
*2
*2
Does not change.Cleared.
Does not change while M8033 is ON.
Does not change.Cleared.
Does not change while M8033 is ON.
*2
*2
Does not change.Cleared.
Does not change while M8033 is ON.
*2
*2
*1
Constant
1
Device Outline
2
Devices in
Detail
3
Specified the
Device &
4
Special Device
5
Errors
*1.Some devices are cleared when the PLC mode switches from STOP to RUN.
M8074 is backed up against power interruption.
*2.The device status is not held correctly when the battery voltage becomes lower than the holding
voltage.
U/FX2C PLCs)
(FX
6
Types and
Setting of
Parameters
7
Other Functions
31
Page 34
FXCPU Structured Programming Manual
[Device & Common]
1.2.3Types of backup methods against power interruption
There are following types of latch (backup) of the program memory and built-in devices in PLCs.
1. Battery backup method
FX
U/FX2C/FX2N/FX2NC/FX3G/FX3GC/FX3U/FX3UC PLCs
ItemDescription
Latched (backed-up) contentsA battery backs up the built-in RAM memory, latched type devices and clock data.
Maintenance
Cautions
2. Flash memory backup method
3U/FX3UC PLCs
FX
ItemDescription
Latched (backed-up) contents
MaintenanceMaintenance is not required.
Cautions
Periodical replacement is required.
For rough guide to the replacement frequency, refer to the User's Manual [Hardware Edition] of each
PLC.
1) When the battery voltage becomes low, sequence programs and other latched (backed-up)
contents are lost.
2) When an optional memory cassette (flash memory) is attached, it is not necessary to back up
sequence programs using the battery (in FX3U/FX3UC PLCs).
1) The flash memory built in a memory cassette holds sequence programs.
2) A battery is used also to hold latched (backed-up) type devices and clock data.
The upper limit is set for the number of times of overwriting.
(Refer to the User's Manual [Hardware Edition] of each PLC.)
1) The EEPROM built in the PLC holds sequence programs and latched (backed-up) type devices.
2) A capacitor is used also to hold the clock data.
1) The upper limit is set for the number of times of overwriting.
(Refer to the User's Manual [Hardware Edition] of each PLC.)
2) For secure backup, it is necessary to keep the PLC power ON for 5 minutes or more, and then turn
OFF the power.
4. Capacitor backup method
1N/FX1NC PLCs
FX
ItemDescription
1) The large-capacity capacitor built in the PLC holds latched (backed-up) type devices and clock
Latched (backed-up) contents
MaintenanceMaintenance is not required.
Cautions
data.
2) The capacitor holds data for 10 days (when the ambient temperature is 25°C) if it is fully charged
as described below.
1) The large-capacity capacitor is charged while the PLC is ON, and fully charged after the PLC is
ON for 30 minutes or more.
2) When the voltage of the large-capacity capacitor becomes low, latched (backed-up) type devices
are not held correctly.
When using the PLC for the first time after purchase, or when using the PLC after power OFF for a
long time (10 days [when the ambient temperature is 25°C] in the fully charged status), clear
latched (backed-up) type devices.
32
Page 35
FXCPU Structured Programming Manual
[Device & Common]
1.2 Program Memory and Devices
1.2.4Change of devices between general type and latched (backed-up) type
FX0S/FX0/FX0N/FX1S/FX1N/FX1NC/FX3S/FX3G*1/FX3GC*1 PLCs do not support the type change of latched
(backed-up) type devices.
1 Device Outline
1
Device Outline
1. When using latched (backed-up) type devices as non-latched type devices
Some latched (backed-up) type devices can be changed into the non-latched type by parameter setting.
Devices dedicated to the latched type cannot be changed into the non-latched type.
Such devices can be handled as non-latched type devices by clearing all latched type devices using the initial
pulse (M8002) in a program.
2. When using non-latched type devices as latched (backed-up) type devices
Non-latched type devices can be changed into the latched (backed-up) type by parameter setting.
*1.In FX
3G/FX3GC PLCs, non-latched type devices can be changed into the latched (backed-up) type by
selecting the battery mode using a parameter if an optional battery is attached.
1.2.5How to initialize latched (backed-up) type devices
Latched (backed-up) type devices can be initialized by clearing the whole PLC memory using peripheral
equipment, clearing all latched type memories using the special auxiliary relay M8032, or executing the ZRST
instruction.
This subsection describes two major methods.
1. M8032 (latched type memory all clear)
When M8032 is set to ON, all latched (backed-up) devices*1 (including reset coils of timers and counters) are
cleared.
M8032 can be set to ON and OFF using the forced ON/OFF operation from peripheral equipment or in a
sequence program. Note that latched type devices cannot be set to ON while M8032 is ON.
When M8032 is set to ON in a program, note that latched type devices are cleared during execution of the
END instruction after M8032 turns ON.
Program example:
This program clears all latched type devices.
Constant
Parameters
2
Devices in
Detail
3
Specified the
Device &
4
Special Device
5
Errors
6
Types and
Setting of
M8002
M8032
Initial pulse
→ For details, refer to Subsection 4.2.11.
*1.General type devices which have been changed into the latched type in the FX
an optional battery attached are also cleared.
3G/FX3GC PLCs using
7
Other Functions
33
Page 36
FXCPU Structured Programming Manual
[Device & Common]
2. ZRST instruction (zone reset)
The ZRST instruction can clear multiple devices all at once.
(Because only a limited device range can be specified for the ZRST instruction, only a part of latched type
devices can be cleared at a time.)
Program example:
This program clears latched (battery backed-up) type devices in the ranges shown in the table below in the
FX
3U and FX3UC PLCs.
Clear input
ZRST
ENENO
d1
d2
ZRST
ENENO
d1
d2
ZRST
ENENO
d1
d2
M500
M7679
S500
S4095
T246
T255
1.2 Program Memory and Devices
Latched (backed-up) device range
Auxiliary relayM500 to M7679
State relayS500 to S4095
TimerT246 to T255
Counter
Data registerD200 to D7999
C100 to C199,
C220 to C255
1 Device Outline
ZRST
ENENO
d1
C100
d2
C199
ZRST
ENENO
d1
C220
d2
C255
ZRST
ENENO
d1
D200
d2
D7999
→ For details on latched (backed-up) type devices, refer to Subsection 1.2.2
34
Page 37
FXCPU Structured Programming Manual
[Device & Common]
2.Devices in Detail
2 Devices in Detail
2.1 Device Number List
1
Device Outline
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 contents provide a basis for handling the PLC.
2.1Device Number List
Device numbers are assigned in the FX3U and FX3UC PLCs as shown below.
The assignment varies depending on each PLC. For details, refer to the reference section.
For input relay numbers and output relay numbers when I/O extension equipment and special extension
equipment are connected to the PLC main unit, refer to the User's Manual [Hardware Edition] of each PLC.
Device nameDescriptionReference
I/O relay
Input relayX000 to X367248 points
Output relayY000 to Y367248 points
Auxiliary relay
General type [changeable]M0 to M499500 points
Latched (backed-up) type
[changeable]
Latched (backed-up) type [fixed]M1024 to M7679 6656 points
Special type
State relay
Initial state
(General type [changeable])
General type [changeable]S10 to S499490 points
Latched (backed-up) type
[changeable]
Annunciator
(Latched (backed-up) type
[changeable])
Latched (backed-up) type [fixed]S1000 to S40953096 points
Timer (on-delay timer)
100 msT0 to T191192 points0.1 to 3276.7 sec
100 ms
[for subroutine or interrupt routine]
10 msT200 to T24546 points0.01 to 327.67 sec
Retentive type for 1 msT246 to T2494 points0.001 to 32.767 sec
Retentive type for 100 msT250 to T2556 points0.1 to 3276.7 sec
1 msT256 to T511256 points0.001 to 32.767 sec
Counter
General type up-counter (16 bits)
[changeable]
Latched (backed-up) type upcounter (16 bits) [changeable]
General type bidirectional counter
(32 bits) [changeable]
Latched (backed-up) type
bidirectional counter (32 bits)
[changeable]
*2
Device numbers are octal.
The total number of inputs and outputs is 256.
Devices can be changed between the latched
M500 to M1023524 points
M8000 to M8511 512 pointsChapter 4
S0 to S910 points
S500 to S899400 points
S900 to S999100 points
T192 to T1998 points0.1 to 3276.7 sec
C0 to C99100 points
C100 to C199100 points
C200 to C21920 points
C220 to C23415 points
(backed-up) type and the non-latched type using
parameters.
Devices can be changed between the latched
(backed-up) type and the non-latched type using
parameters.
0 to 32767 counts
Devices can be changed between the latched
(backed-up) type and the non-latched type using
parameters.
-2147483648 to +2147483647 counts
Devices can be changed between the latched
(backed-up) type and the non-latched type using
parameters.
Section 2.2
Section 2.3
Section 2.4
Section 2.5
Section 2.6
2
Devices in
Detail
3
Specified the
Device &
Constant
4
Special Device
5
Errors
6
Types and
Setting of
Parameters
7
Other Functions
35
Page 38
FXCPU Structured Programming Manual
[Device & Common]
Device nameDescriptionReference
High speed counter
1-phase 1-counting input
Bidirectional (32 bits)
1-phase 2-counting input
Bidirectional (32 bits)
2-phase 2-counting input
Bidirectional (32 bits)
Data register (32 bits when used in pair form)
General type (16 bits)
[changeable]
Latched (backed-up) type
(16 bits) [changeable]
Latched (backed-up) type
(16 bits) [fixed] <file register>
Special type (16 bits)
Index type (16 bits)
Extension register/Extension file register
Extension register (16 bits)R0 to R3276732768 points
Extension file register (16 bits)ER0 to ER3276732768 points
Pointer
For JUMP or CALL branchP0 to P40954096 pointsFor CJ and CALL instructions
Input interrupt
Input delay interrupt
Timer interrupt
Counter interruptI010 to I0606 pointsFor HSCS instruction
Nesting
For master controlN0 to N78 pointsFor MC instruction
Constant
Decimal (K)
Hexadecimal (H)
Real number (E)32 bits
Character string ("")Character string
*2
C235 to C245
C246 to C250
C251 to C255
D0 to D199200 points
D200 to D511312 points
D512 to D7999
<D1000 to D7999>
D8000 to D8511512 pointsChapter 4
V0 to V7, Z0 to Z7
I0 to I5
I6 to I8
16 bits-32,768 to +32,767
32 bits-2,147,483,648 to +2,147,483,647
16 bits0 to FFFF
32 bits0 to FFFFFFFF
2 Devices in Detail
2.1 Device Number List
Up to 8 points can be used among C235 to C255 [latched
(backed-up) type]
The setting can be changed between the latched (backed-up) type
and the non-latched type using parameters.
For handling of the latched (backed-up) area, refer to Section 1.2.
Page 39
FXCPU Structured Programming Manual
[Device & Common]
2.2Input/Output Relays [X and Y]
Some input relay and output relay numbers are secured in the main unit, and others are assigned to
extension equipment according to the connection order.
Because input/output relays are numbered in octal, numeric values such as "8" and "9" do not exist.
2.2.1Numbers of input/output relays
The tables below show input relay (X) and output relay (Y) numbers. (Numbers are assigned in octal.)
1. FX3S/FX3G/FX3GC/FX3U/FX3UC PLCs
2 Devices in Detail
2.2 Input/Output Relays [X and Y]
1
Device Outline
2
Devices in
Detail
Model name FX3U-16MFX3U-32MFX3U-48M FX3U-64M FX3U-80M FX3U-128M When extended
FX3U PLC
FX3UC (D, DS, DSS)
PLC
FX3UC-32MTLT(-2) PLC
FX3G PLC
FX3GC PLC
Input
Output
Model name FX3UC-32MT-LT(-2)When extended
Model nameFX3G-14MFX3G-24MFX3G-40MFX3G-60MWhen extended
Input
Output
Model name FX
X000 to X007
8 points
Y000 to Y007
8 points
Model name FX3UC-16M FX3UC-32M FX3UC-64M FX3UC-96MWhen extended
Input
Output
Input
Output
X000 to X007
8 points
Y000 to Y005
6 points (8)
Input
Output
X000 to X017
16 points
Y000 to Y017
16 points
X000 to X007
8 points
Y000 to Y007
8 points
X000 to X017
16 points
Y000 to Y017
16 points
X000 to X015
14
Y000 to Y011
*1
10
3GC-32MT/D(DSS) When extended
X000 to X017
16 points
Y000 to Y017
16 points
points
points
X000 to X027
24 points
Y000 to Y027
24 points
X000 to X017
16 points
Y000 to Y017
16 points
X000 to X357
240 points
Y000 to Y357
240 points
X000 to X027
*1
(16)
(16)
24 points
Y000 to Y017
*1
16 points
X000 to X177
128 points
Y000 to Y177
128 points
X000 to X037
32 points
Y000 to Y037
32 points
X000 to X037
32 points
Y000 to Y037
32 points
X000 to X047
40 points
Y000 to Y047
40 points
X000 to X057
48 points
Y000 to Y057
48 points
256
points
in total
X000 to X043
36
points
Y000 to Y027
24 points
128
points
in total
(40)
X000 to X177
*1
128 points
Y000 to Y177
128 points
X000 to X077
64 points
Y000 to Y077
64 points
X000 to X367
248 points
Y000 to Y367
248 points
X000 to X367
248 points
Y000 to Y367
248 points
256
points
in total
128
points
in total
256
points
in total
3
Specified the
Device &
Constant
4
Special Device
5
Errors
6
Types and
Setting of
Parameters
7
Other Functions
Model nameFX3S-10MFX3S-14MFX3S-20MFX3S-30M
FX3S PLC
Input
Output
X000 to X005
6 points
Y000 to Y003
4 points
X000 to X007
8 points
Y000 to Y005
6 points
X000 to X013
12 points
Y000 to Y007
8 points
X000 to X017
16 points
Y000 to Y015
14 points
*1.A number inside ( ) indicates the number of occupied points.
The difference from the number of effective points indicates unused numbers.
No
extension
37
Page 40
FXCPU Structured Programming Manual
[Device & Common]
2. FX1S/FX1N/FX1NC/FX2N/FX2NC PLCs
Model name FX1S-10MFX1S-14MFX1S-20MFX1S-30M
FX1S PLC
FX1N PLC
FX2N PLC
FX1NC
PLC
Input
Output
Model name FX1N-24MFX1N-40MFX1N-60M When extended
Input
Output
Model name FX2N-16MFX2N-32M FX2N-48MFX2N-64M FX2N-80M FX2N-128M When extended
Input
Output
Model name FX1NC-16M FX1NC-32M When extended
Input
Output
X00 to X05
6 points
Y00 to Y03
4 points
X000 to X015
14 points
Y000 to Y011
10 points
X000 to X007
8 points
Y000 to Y007
8 points
X000 to X007
8 points
Y000 to Y007
8 points
X000 to X017
16 points
Y000 to Y017
16 points
X000 to X017
16 points
Y000 to Y017
16 points
X00 to X07
8 points
Y00 to Y05
6 points
X000 to X027
24 points
Y000 to Y017
16 points
X000 to X027
24 points
Y000 to Y027
24 points
X00 to X013
12 points
Y00 to Y07
8 points
X000 to X043
36 points
Y000 to Y027
24 points
X000 to X037
32 points
Y000 to Y037
32 points
X000 to X177
128 points
Y000 to Y177
128 points
X00 to X17
16 points
Y00 to Y15
14 points
X000 to X177
128 points
Y000 to Y177
128 points
X000 to X047
40 points
Y000 to Y077
40 points
128
points
in total
2 Devices in Detail
2.2 Input/Output Relays [X and Y]
No
extension
128
points
in total
X000 to X077
64 points
Y000 to Y077
64 points
X000 to X267
184 points
Y000 to Y267
184 points
256
points
in total
Model name FX2NC-16M FX2NC-32MFX2NC-64MFX2NC-96M When extended
FX2NC
PLC
0S/FX0/FX0N/FXU/FX2C PLCs
3. FX
FX0S/FX0
PLC
FX0N PLC
FXU PLC
Input
Output
Model nameFX0S-10MFX0/FX0S-14M FX0/FX0S-20M FX0/FX0S-30M
Input
Output
Model nameFX
Input
Output
Model nameFXU-16MFXU-24MFXU-32MFXU-48MFXU-64MFXU-80MFXU-128M
Input
Output
X000 to X007
8 points
Y000 to Y007
8 points
X000 to X005
6 points
Y000 toY003
4 points
0N-24MFX0N-40MFX0N-60MWhen extended
X000 to X015
14 points
Y000 to Y011
10 points
X000 to X007
8 points
Y000 to Y007
8 points
X000 to X017
16 points
Y000 to Y017
16 points
X000 to X007
8 points
Y000 to Y005
6 points
X000 to X027
24 points
Y000 to Y017
16 points
X000 to X013
12 points
Y000 to Y013
12 points
X000 to X037
32 points
Y000 to Y037
32 points
X000 to X013
Y000 to Y007
X000 to X043
Y000 to Y027
X000 to X017
16 points
Y000 to Y017
16 points
X000 to X057
48 points
Y000 to Y057
48 points
12 points
8 points
36 points
24 points
X000 to X027
Y000 to Y027
24 points
24 points
X000 to X267
184 points
Y000 to Y267
184 points
X000 to X017
16 points
Y000 to Y015
14 points
X000 to X127
84 points
Y000 to Y77
64 points
X000 to X037
32 points
Y000 to Y037
32 points
points
in total
No
extension
128
points
in total
X000 to X047
Y000 to Y047
256
40 points
40 points
X000 to X077
64 points
Y000 to Y077
64 points
38
FXU PLC
FX2C PLC
Model name When extended
Input
Output
X000 to X267
184 points
Y000 to Y267
184 points
2C-64MFX2C-96MFX2C-128MFX2C-160M When extended
X000 to X037
32 points
Y000 to Y037
32 points
Input
Output
Model nameFX
256
points
in total
X000 to X057
48 points
Y000 to Y057
48 points
X000 to X077
64 points
Y000 to Y077
64 points
X000 to X117
80 points
Y000 to Y117
80 points
X000 to X267
184 points
Y000 to Y267
184 points
256
points
in total
Page 41
FXCPU Structured Programming Manual
[Device & Common]
2.2.2Functions and roles
Examples of terminal names and wiring (sink input) are for the FX3U Series PLC.
2 Devices in Detail
2.2 Input/Output Relays [X and Y]
1
Device Outline
0V
24V
S/S
Input
X000
signal
Input terminal
The PLC receives signals from external switches
through input terminals.
An input relay (X) connected to an input terminal
inside the PLC is an electronic relay isolated
optically, and has many normally-open (NO)
contacts and normally-closed (NC) contacts.
These contacts can be arbitrarily used inside the PLC.
These input relays cannot be driven by programs.
X000
X000
X000
Program example
X000
Y000
PLC
X001
External power supply
COM1
Y000
Y000
NO contact
Y000
NC contact
The PLC outputs signals to external loads through
output terminals. Contacts for external output
(output devices such as relay contacts, TRIACs and
transistors) of output relays are connected to output
terminals inside the PLC.
An output relay has many NO contacts and NC
contacts.
These contacts can be arbitrarily used inside the PLC.
Differences in operations between external output
contacts (output devices) and internal contacts
are explained on the next page.
Y000
Load
Output terminal
Constant
2
Devices in
Detail
3
Specified the
Device &
4
Special Device
5
Errors
6
Types and
Setting of
Parameters
7
Other Functions
39
Page 42
FXCPU Structured Programming Manual
[Device & Common]
2.2.3Operation timing of I/O relays
The PLC executes sequence control by repeatedly executing the following processing procedure.
In this batch I/O method, not only are there driving times of input filters and output devices but also response
delays caused by operation cycles.
2 Devices in Detail
2.2 Input/Output Relays [X and Y]
Input processing
X000
X001
X002
X000
Y000
1)
Read-in
Input terminal
2) Read-out
Y000
M 0
Auxiliary relay
Input
image
memory
Program processing
3) Write
4) Read
-out
5) Write
Device
image
memory
1) 2) 3)...6) indicate the processing order.
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 PLC is executing
the program, 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 the digital type, its value
can be overwritten by a sequence program.)
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 the step 0,
and then writes the operation result to the image memory
at each time.
Accordingly, the contents of the image memory of 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.
Repeated
operation
[The time
required for a
cyclic operation
is called
operation cycle
(scan time).]
The above method is called the batch I/O method (or refresh method).
6) Output
Output
latch
memory
Output processing
Output terminal
40
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 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.
Page 43
FXCPU Structured Programming Manual
[Device & Common]
2.3Auxiliary relay [M]
There are many auxiliary relays inside the PLC. Coils of auxiliary relays are driven by contacts of various
devices inside the PLC in the same way as output relays.
Auxiliary relays have many electronically normally-open contacts and normally-closed contacts which can be
used arbitrarily inside the PLC.
However, external loads cannot be driven directly by these contacts. External loads should be driven by
output relays.
2.3.1Numbers of auxiliary relays
2 Devices in Detail
2.3 Auxiliary relay [M]
1
Device Outline
2
Devices in
Detail
The table below shows auxiliary relay (M) numbers. (Numbers are assigned in decimal.)
1. FX3S/FX3G/FX3GC/FX3U/FX3UC PLCs
Latched (battery
backed-up) type
M500 to M1023
524 points
Fixed latched (EEPROM
backed-up) type
M384 to M1535
1152 points
Fixed latched (EEPROM
backed-up) type
M384 to M511
128 points
*2
FX3U/FX3UC
PLC
FX3G/FX3GC
PLC
FX3S PLC
General type
M0 to M499
500 points
General type
M0 to M383
384 points
General type
M0 to M383
384 points
*1
*1.This area is not latched (backed up). It can be changed to the latched (backed-up) area by parameter
setting.
*2.This area is latched (backed up). It can be changed to the non-latched (non-backed-up) area by
parameter setting.
*3.The characteristics of latch (backup) cannot be changed using parameters.
*4.They can be changed to the latched (battery backed-up) type using parameters while an optional
battery is attached. However, the latched area cannot be set.
When simple N:N link or parallel link is used, some auxiliary relays are occupied for the link.
*1.This area is not latched (backed up). It can be changed to the latched (backed-up) area by parameter
setting.
*2.This area is latched (backed up). It can be changed to the non-latched (non-backed-up) area by
parameter setting.
*3.The characteristics of latch (backup) cannot be changed using parameters.
256 points
256 points
256 points
41
Page 44
FXCPU Structured Programming Manual
[Device & Common]
3. FX0S/FX0/FX0N/FXU/FX2C PLCs
2 Devices in Detail
2.3 Auxiliary relay [M]
General typeLatched (backed-up) type
FX0S/FX0
PLC
FX0NPLC
FXU/FX2C
PLC
FXU PLC (Ver.
2.30 or earlier)
(Reference)
M0 to M495
496 points
M0 to M383
384 points
M0 to M499
500 points
*4
*4
M500 to M1023
524 points
*1
For link
Parent → Child:M800 to M899
Child → Parent:M900 to M999
*1.This area is not latched (backed up). It can be changed to the latched (backed-up) area by parameter
setting.
*2.This area is latched (backed up). It can be changed to the non-latched (non-backed-up) area by
parameter setting.
*3.This area is fixed to the latched (backed-up) type. (The contents can be cleared by the RST and ZRST
instructions.)
*4.This area is fixed to the non-latched (non-backed-up) type. The characteristics of latch (backup)
cannot be changed.
2.3.2Functions and operation examples
1. General type
All of general type auxiliary relays turn OFF when the PLC is turned
M100
M100
NO contact
OFF.
When the ON/OFF status of auxiliary relays just before power
interruption is required for control, use latched (backed-up) type
auxiliary relays.
Fixed latched
(backed-up) type
-
-
*2
M496 to M511
16 points
M384 to M511
128 points
M1024 to M1535
512 points
*3
*3
*3
-
Special type
M8000 to M8254
57 points
M8000 to M8254
67 points
M8000 to M8255
173 points
M8000 to M8255
169 point
M100
NC contact
Auxiliary relay circuit
42
Page 45
FXCPU Structured Programming Manual
[Device & Common]
2. Latched (backed-up) type
When the power is turned OFF while the PLC is operating, all of output relays and general type auxiliary
relays turn OFF.
Even when the power is restored after that, all of 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 interruption should be stored and then replicated when the power is restored,
depending on control targets. In such a case, use latched (backed-up) type auxiliary relays.
Latched (backed-up) type devices are backed up by a battery, EEPROM, etc. built in the PLC.
→ For details on the backup method against power interruption, refer to Section 1.2.
2 Devices in Detail
2.3 Auxiliary relay [M]
1
Device Outline
2
Devices in
Detail
X000
M600
X001
M600
The left figure shows an operation example of M600
(latched type device) in a self-holding circuit.
When X000 turns ON and M600 turns ON in this circuit,
M600 holds its operation by itself even if X000 turns OFF.
Because M600 is a latched (backed-up) type device, it
Backup against power interruption
PLC
(self-holding circuit)
remains activated even when the operation is restarted
after X000 has turned OFF due to power interruption. If a
normally-closed contact of X001 is opened when the
operation is restarted, however, M600 is deactivated.
X000
ENENO
X001
ENENO
PLC
Backup against power interruption
(set/reset circuit)
SET
d
RST
d
The left figure shows a circuit using the SET and RST
instructions.
M600
M600
1) Application example of latched (backed-up) type auxiliary relays
Left
limit
Limit switch
LS 1(X000)
Right
limit
Limit switch
LS 2(X001)
In some cases, the table should be restarted in the same
direction as the direction selected just before power
interruption.
Constant
Parameters
3
Specified the
Device &
4
Special Device
5
Errors
6
Types and
Setting of
Table in reciprocating motion
X000
M600
X001
M600
Rightward
drive command
Motor
with brake
X000 = ON (at the left limit) → M600 = ON → The table is
driven rightward. → The power is turned OFF. → The table
stops in an intermediate position. → The table is restarted
(M600 = ON). → X001 = ON (at the right limit) → M600 =
OFF, M601 = ON → The table is driven leftward.
X001
M601
X000
M601
Leftward
drive command
2) Method to use a fixed latched (backed-up) type auxiliary relay as a general type auxiliary relay
When using a fixed latched (backed-up) 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.
M8002
Initial pulse
ZRST
ENENO
d1
d2
M1024
M1999
7
Other Functions
43
Page 46
FXCPU Structured Programming Manual
[Device & Common]
2.4State Relay [S]
State relays (S) are important devices to simply program stepping type process control, and are combined
with the step ladder instruction STL.
2.4.1Numbers of state relays
The table below shows state relay (S) numbers. (Numbers are assigned in decimal.)
1. FX3S/FX3G/FX3GC/FX3U/FX3UC PLCs
2 Devices in Detail
2.4 State Relay [S]
FX3U/FX3UC
PLC
FX3G/FX3GC
PLC
FX3S PLC
Initial state typeGeneral type
S0 to S9
*1
10 points
Initial state (EEPROM
backed-up) type
S0 to S9
10 points
Initial state (EEPROM
backed-up) type
S0 to S9
10 points
S0 to S499
500 points
(S0 to S9 are provided
for the initial state.)
Latched (EEPROM
backed-up) type
S10 to S899
890 points
Fixed latched (EEPROM
backed-up) type
S10 to S127
118 points
*1
Latched (battery
backed-up) type
S500 to S899
400 points
Annunciator (EEPROM
*2
backed-up) type
S900 to S999
100 points
General type
S128 to S255
128 points
Fixed latched (battery
backed-up) type
S1000 to S4095
3096 points
*3
General type
S1000 to S4095
3096 points
Annunciator type
S900 to S999
100 points
*4
*1.This area is not latched (backed up). It can be changed to the latched (backed-up) area by parameter
setting.
*2.This area is latched (backed up). It can be changed to the non-latched (non-backed-up) area by
parameter setting.
*3.The characteristics of latch (backup) cannot be changed using parameters.
*4.They can be changed to the latched (battery backed-up) type using parameters while an optional
battery is attached. However, the latched area cannot be set.
2. FX1S/FX1N/FX1NC/FX2N/FX2NC PLCs
*2
44
General type
FX1SPLC--
FX1N/FX1NC
PLC
FX2N/FX2NC
PLC
(S0 to S9 are provided
--
S0 to S499
500 points
for the initial state.)
*1
Latched (battery
backed-up) type
S500 to S899
400 points
*2
Fixed latched (backed-up) type
EEPROM backed-up Capacitor backed-up
S0 to S127
128 points
(S0 to S9 are provided
for the initial state.)
S0 to S127
128 points
(S0 to S9 are provided
for the initial state.)
*3
*3
--
--
S128 to S999
872 points
*3
Annunciator type
-
S900 to S999
100 points
*2
*1.This area is not latched (backed up). It can be changed to the latched (backed-up) area by parameter
setting.
*2.This area is latched (backed up). It can be changed to the non-latched (non-backed-up) area by
parameter setting.
*3.The characteristics of latch (backup) cannot be changed using parameters.
Page 47
FXCPU Structured Programming Manual
[Device & Common]
3. FX0S/FX0/FX0N/FXU/FX2C PLCs
2 Devices in Detail
2.4 State Relay [S]
1
Device Outline
General typeLatched (backed-up) type
S0 to S63
FX0S/FX0
PLC
FX0NPLC--
FXU/FX2C
PLC
(S0 to S9 are provided for the
(S0 to S9 are provided for the
64 points
initial state.)
S0 to S499
500 points
initial state.)
(S10 to S19 are provided for
zero return.)
*4
*1
S500 to S899
400 points
---
*2
Fixed latched (backed-up)
(S0 to S9 are provided for the
type
S0 to S127
128 points
initial state.)
-
*3
Annunciator type
-
S900 to S999
100 points
*2
*1.This area is not latched (backed up). It can be changed to the latched (backed-up) area by parameter
setting.
*2.This area is latched (backed up). It can be changed to the non-latched (non-backed-up) area by
parameter setting.
*3.This area is fixed to the latched (backed-up) type. (The contents can be cleared by the RST and ZRST
instructions.)
*4.This area is fixed to the non-latched (non-backed-up) type. The characteristics of latch (backup)
cannot be changed.
Constant
2
Devices in
Detail
3
Specified the
Device &
4
Special Device
5
Errors
6
Types and
Setting of
Parameters
7
Other Functions
45
Page 48
FXCPU Structured Programming Manual
[Device & Common]
2.4.2Functions and operation examples
1. General type
M8002
S2
Start
X000
S20
Lower limit
X001
SET
ENENO
STL
ENENO
s
SET
ENENO
STL
ENENO
s
Moving down
Y000
SET
ENENO
d
S2
d
S20
d
S21
S2 process
S20 process
2 Devices in Detail
2.4 State Relay [S]
In the stepping type process control shown in the
left figure, when the start signal X000 turns ON,
the state relay S20 is set (turned ON) and the
solenoid valve Y000 for moving down is
activated.
When the lower limit switch X001 turns ON, the
state relay S21 is set (turned ON) and the
solenoid valve Y001 for clamping is activated.
When the clamp confirmation limit switch X002
turns ON, the state relay S22 is set (turned ON).
When the operation proceeds to the next step,
the state relay in the preceding step is
automatically reset (turned OFF).
When the PLC is turned OFF, all of general type
state relays are turned OFF.
When the ON/OFF status just before power
interruption is required for restart, use latched
(backed-up) type state relays.
STL
ENENO
s
S21
Clamping
S21 process
S22
S22 process
Clamping
X002
Upper limit
X003
S22
Y001
SET
ENENO
d
STL
ENENO
s
Moving up
Y002
SET
ENENO
d
State relays have many normally-open contacts and normally-closed
contacts in the same way as auxiliary relays, and these 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 right figure).
X001
S10
S10
M30
Y005
46
Page 49
FXCPU Structured Programming Manual
[Device & Common]
2. Latched (backed-up) type
• Latched (backed-up) 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 after shutdown from the previous last point in the
process.
Latched (backed-up) type state relays are backed up by a battery, EEPROM, etc. built in the PLC.
• When using latched (backed-up) type state relays as
general type state relays, provide a reset circuit shown in
the right figure around the head step in the program.
3. Annunciator type
Annunciator type state relays can be also used as outputs for external fault diagnosis.
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 displayed.
If two or more faults have occurred, the smallest state relay number having a fault is displayed at first. When
the displayed fault is cleared, the next smallest state relay number having a fault is stored in D8049 and
displayed.
M8000
T0
M8049
EN
s
m
ANS
ENO
d
RUN monitor
X000Y000
K10
2 Devices in Detail
2.4 State Relay [S]
→ For details on each backup method, refer to Section 1.2.
ZRST
ENENO
S1000 to S1200
are initialized.
S900
M8002
Initial pulse
·
When the special auxiliary relay M8049 is driven, monitoring
becomes valid.
·
If the forward end detection input X000 is not activated within
1 second after the forward output Y000 is driven, S900 is
activated.
d1
d2
S1000
S1200
Constant
1
Device Outline
2
Devices in
Detail
3
Specified the
Device &
4
Special Device
5
Errors
X002X001
T1
K20
X004X003
T2
K100
M8048
X005
ANS
EN
s
m
EN
s
m
ENENO
ENO
ANS
ENO
Y010
ANRP
·
If both the upper limit detection input X001 and the lower limit
d
S901
d
S902
detection input X002 are deactivated at the same time for 2
seconds or more, S901 is activated.
·
In a machine whose takt time is less than 10 seconds,if the
switch X004 which is designed to be activated during one-cycle
operation of the machine is not activated while the continuous
operation mode input X003 is ON, S902 is activated.
·
When any of annunciator type state relays S900 to S999 turns
ON, the special auxiliary relay M8048 is activated and the fault
display output Y010 is activated.
·
The state relays activated by the external fault diagnosis program
can be turned OFF by the reset button X005.
Every time X005 is set to ON, the active annunciator type state
relay having the smallest number is reset in turn.
While the special auxiliary relay M8049 is not driven, annunciator type state relays can be used as latched
(backed-up) type state relays in sequence programs in the same way as general type state relays.
6
Types and
Setting of
Parameters
7
Other Functions
47
Page 50
FXCPU Structured Programming Manual
[Device & Common]
2.5Timer [T]
Timers add and count clock pulses of 1 ms, 10 ms, 100 ms, etc. inside the PLC. When the count 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).
In timers, "TS" indicates a contact, "TC" indicates a coil, and "TN" indicates the current value.
→ Refer to the Q/L/F Structured Programming Manual (Fundamentals).
2.5.1Numbers of timers
The table below shows timer (T) numbers. (Numbers are assigned in decimal.)
1. FX3S/FX3G/FX3GC/FX3U/FX3UC PLCs
2 Devices in Detail
2.5 Timer [T]
FX3U/
FX3UC
PLC
FX3G/
FX3GC
PLC
FX3S PLC
For 100 ms pulses
0.1 to 3276.7 sec
T0 to T199
200 points
----------------------------
Routine program type
T192 to T199
For 100 ms pulses
0.1 to 3276.7 sec
T0 to T199
200 points
----------------------Routine program
type T192 to T199
For 100 ms pulses
0.1 to 3276.7 sec
T0 to T62
63 points
For 10 ms pulses
0.01 to 327.67 sec
T200 to T245
46 points
For 10 ms pulses
0.01 to 327.67 sec
T200 to T245
46 points
For 100/10 ms
pulses
0.1 to 3276.7 sec
0.01 to 327.67 sec
T32 to T62
31 points
*3
Retentive type for
1 ms pulses
0.001 to 32.767 sec
T246 to T249
4 points
Interrupt execution
latched (backed-up)
type*
Retentive type for
1 ms pulses
0.001 to 32.767
sec
T246 to T249
Interrupt execution
latched (backed-
For 1 ms pulses
0.001 to 32.767
T63 to T127
4 points*
up) type
sec
65 points
2
Retentive type for 100
*1
0.1 to 3276.7 sec
Latched (backed-up)
1
Retentive type for
100 ms pulses
0.1 to 3276.7 sec
T250 to T255
Latched (backed-
Retentive type for
1 ms pulses
0.001 to 32.767
T128 to T131
Interrupt execution
latched (backed-
6 points
up) type
sec
4 points
up) type
*2
*2
ms pulses
T250 to T255
*1
6 points
*1
type
For 1 ms pulses
0.001 to 32.767
T256 to T319
64 points
Retentive type for
100 ms pulses
0.1 to 3276.7 sec
T132 to T137
6 points
Latched (backed-
up) type
0.001 to 32.767 sec
sec
*2
For 1 ms pulses
T256 to T511
256 points
Variable
potentiometer
type
Numeric value
from 0 to 255
2 built-in points
(Only in FX3G
PLC)
Variable
potentiometer
type
Numeric value
from 0 to 255
2 built-in points
*4
48
Timer numbers not used for timers can be used as data registers for storing numeric values.
*1.Retentive type timers are backed up by the battery in FX
*2.Retentive type timers are backed up by the EEPROM memory (built in PLC) in FX
3U/FX3UC PLCs.
3S/FX3G/FX3GC
PLCs.
*3.100 ms timers are changed to 10 ms timers when the special auxiliary relay M8028 is driven.
*4.This function is not supported in the FX
3S-30M/E-2AD PLC.
Page 51
FXCPU Structured Programming Manual
[Device & Common]
2. FX1S/FX1N/FX1NC/FX2N/FX2NC PLCs
2 Devices in Detail
2.5 Timer [T]
1
Device Outline
FX1SPLC
FX1N/
FX1NC
PLC
FX2N/
FX2NC
PLC
For 100 ms pulses
0.1 to 3276.7 sec
T0 to T31
32 points
T0 to T199
200 points
T0 to T199
200 points
----------------------Routine program
type T192 to T199
For 100/10 ms
pulses
0.1 to 3276.7 sec
0.01 to 327.67 sec
T32 to T62
31 points
*1
-
-
For 10 ms pulses
0.01 to 327.67 sec
-
T200 to T245
46 points
T200 to T245
46 points
For 1 ms pulses
0.001 to 32.767 sec
T63
1 point
T246 to T249
4 points
Capacitor latched
(backed-up) type
(Retentive type)
T246 to T249
4 points
Interrupt execution
latched (backed-up)
type
(Retentive type)
Retentive type
for 100 ms
pulses
0.1 to 3276.7 sec
-
T250 to T255
6 points
Capacitor latched
(backed-up) type
T250 to T255
6 points
Capacitor latched
(backed-up) type
Timer numbers not used for timers can be used as data registers for storing numeric values.
*1.100 ms timers are changed to 10 ms timers when the special auxiliary relay M8028 is driven.
3. FX0S/FX0/FX0N/FXU/FX2C PLCs
Retentive type for
100 ms pulses
0.1 to 3276.7 sec
*2
T250 to T255
6 points
Variable potentiometer type
Numeric value from 0 to 255
*2
8 points for function board
FX0S/FX0
PLC
FX0NPLC
FXU/FX2C
PLC
For 100 ms pulses
0.1 to 3276.7 sec
T0 to T55
56 points
T0 to T62
63 points
Routine program
type T192 to T199
For 10 ms pulses
0.01 to 327.67 sec
(T32 to T55)
(24 points)
(T32 to T62)
(31 points)
T200 to T245
46 points
*1
*1
For 1 ms pulses
0.001 to 32.767 sec
--1 built-in point
T63-2 built-in points
T246 to T249
4 points
Retentive type
Interrupt execution
Variable
potentiometer
type
Numeric value
from 0 to 255
2 built-in points
8 points for
function board
(Only in FX1S/
FX1N PLCs)
8 points for
function board
(Only in FX2N
PLC)
Constant
Parameters
2
Devices in
Detail
3
Specified the
Device &
4
Special Device
5
Errors
6
Types and
Setting of
Timer numbers not used for timers can be used as data registers for storing numeric values.
*1.100 ms timers are changed to 10 ms timers when the special auxiliary relay M8028 is driven.
In FX
0 PLCs, this function is available in Ver. 1.01 and later.
*2.They are backed up against power interruption.
7
Other Functions
49
Page 52
FXCPU Structured Programming Manual
[Device & Common]
2.5.2Functions and operation examples
1. General type
X000
TC200
K123
TS200
1.23 sec
X000
Current
value
Y000
OUT_T
ENENO
TCoil
TValue
Y000
Set value
Set value (constant)
A data register can
be specified instead.
2 Devices in Detail
2.5 Timer [T]
When the drive input X000 of the timer T200
turns ON, the current value counter for T200
adds and counts clock pulses of 10 ms. When
the count 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 turns OFF.
• The program of 100 ms/10 ms type timer of the FX
0S, FX0, FX0N, FX1S and FX3S PLCs.
100 ms timers are changed to timers which operate based on the 10 ms base clock when the special
auxiliary relay M8028 is driven in the program.
M8000M8028
RUN monitor
X003
TC32
K100
1-second timer
OUT_T
ENENO
TCoil
TValue
2. Retentive type
X000
TS250
X002
X001
Current
value
Y001
X002
t1
Retentive
time
ENENO
TC250
K345
t2
Retentive time
TCoil
TValue
t1 + t2 = 34.5 sec
OUT_T
Y001
RST
ENENO
Set value
Set value (constant)
A data register can
be specified instead.
d
TC250
When the drive input X001 of the timer T250
turns ON, the current value counter for T250
adds and counts clock pulses of 100 ms. When
the count 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 if 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 turns OFF.
50
Page 53
FXCPU Structured Programming Manual
[Device & Common]
3. Variable potentiometer type
• Program for built-in analog variable potentiometers
Program values for built-in analog variable potentiometers are stored in the following special data registers
as numeric data within the range from 0 to 255 in accordance with the scale position.
Values received as numeric values can be specified as the indirectly specified value for a timer to provide
variable potentiometer type analog timers.
[Special data registers]
2 Devices in Detail
2.5 Timer [T]
1
Device Outline
2
Devices in
Detail
•FX1S, FX1N, FX3S*1, FX3G PLC
VR1→D8030
VR2→D8031
[Example of basic circuit][Example of applied circuit]
X003
TC10
D8030
Data register which stores
an analog variable potentiometer
value (integer in range from 0 to 255)
*1.FX
3S-30M/E-2AD are not applicable to built-in analog variable potentiometers.
OUT_T
ENENO
TCoil
TValue
•FX0S, FX0 PLC
D8013
(0 to 25.5 sec)
M8000
RUN monitor
X003
The set value range can be changed
(to "32,767" maximum) by multiplying the contents of the
data register by "n".
Do not use D1 in other programs.
D8031
TC10
K2
D0
•FX0N PLC
VR1→D8013(D8030)
VR2→D8031
MUL_E
EN
_IN
_IN
ENENO
TCoil
TValue
(0 to 51 sec)
ENO
OUT_T
D0
[Value of D8031 (VR2)] 2
Transferred to (D1, D0)
• Program for analog variable potentiometers on function board
Values of analog variable potentiometers which can be built in the PLC as a function board can be
received as numeric data in the range from 0 to 255 in accordance with the scale position.
Values received as numeric values can be specified as timer function values to provide variable
potentiometer type analog timers.
Use the VRRD function to put analog variable potentiometer values into the PLC.
X000
VRRD
ENsENO
d
The analog value of the variable potentiometer No. 0 is
converted into 8-bit binary value, and the value in the range
from 0 to 255 is transferred to D0.
D0K0
In this example, D0 is used as the timer set value.
X001
TC0
D0
OUT_T
ENENO
TCoil
TValue
3
Specified the
Device &
Constant
4
Special Device
5
Errors
6
Types and
Setting of
Parameters
7
Other Functions
Use the VRSC instruction to put the value of an analog variable potentiometer as a numeric value in the
range from 0 to 10 in accordance with the scale position.
51
Page 54
FXCPU Structured Programming Manual
[Device & Common]
2.5.3Set value specification method
1. Specification using a constant (K)
X003
TC10
K100
2. Indirect specification using a data register
X001
K100
X003
TC10
D5
OUT_T
ENENO
TCoil
TValue
Constant (decimal integer)
10-sec timer
MOV
ENsENO
d
OUT_T
ENENO
TCoil
TValue
D5
2 Devices in Detail
2.5 Timer [T]
T10 is a timer for 100 ms (0.1 s) pulses.
When the constant "100" is specified, T10 works as a
10-second timer (0.1 sec × 100 = 10 sec).
Write in advance a value to the data register used for
indirect specification in a program, or set such a value in
advance using a digital switch.
Note that the set value of a latched (backed-up) type
register can be indefinite when the battery voltage
becomes low.
D5=K100
10-sec timer
2.5.4Cautions on use
1) Use timers T192 to T199 in subroutines and interrupt routines. These timers execute counting when a coil
instruction or END instruction is executed.
Once the count value of such a timer has reached the set value, the timer 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 "2.5.5
Details of timer operations and timer accuracy" below), they 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.
2) If a retentive type timer for 1 ms pulses is used in a subroutine or interrupt routine, its output contact turns
ON when the first coil instruction is executed after its count value has reached the set value.
3) For writing the symbolic information and changing the set values of timers and counters using a
peripheral equipment, it is recommended to create programs with the set values specified indirectly.
If the set values are specified directly, programs cannot be restored from the symbolic information after
the set values are changed.
2.5.5Details of timer operations and timer accuracy
A timer (except interrupt execution type) starts counting when the coil is driven, and its output contact turns
ON when the first coil instruction is executed after the timer has reached timeout.
Counting operation (If the operation cycle is long,
it automatically counts two or more clocks.)
X010
TS0
TC0
K12
Input processing
OUT_T
ENENO
TCoil
TValue
Y010
X010=OFF ON
Timer starts counting.
1st cycle
Contact is not
activated at this point.
T 0
1.2
sec
timeout
2nd cycle"n"th cycle"n+1"th cycle
Contact is
activated.
Y010
ON
52
Page 55
FXCPU Structured Programming Manual
[Device & Common]
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 expression:
:0.001 sec (timer for 1 ms), 0.01 sec (timer for 10 ms) or 0.1 sec (timer for 100 ms)
+T
0
-
T
If the contact is programmed before the timer coil, "+2T0" results 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.
T :Timer set value (sec)
:Operation cycle (sec)
T
0
2 Devices in Detail
2.5 Timer [T]
1
Device Outline
2
Devices in
Detail
2.5.6Program examples [Off-delay timer and flicker timer]
Off-delay timer
X001
TS5
X001Y000
TC5
K200
Y000
OUT_T
ENENO
TCoil
TValue
X001
Y000
Flicker timer
X001TS2
TC1
K20
TS1
TC2
K10
OUT_T
ENENO
TCoil
TValue
OUT_T
ENENO
TCoil
TValue
Y000
In addition, the flicker operation can be performed by the ALT instruction.
X001
2 sec 1 sec
T1T2T1
Y000
T 2
( )
T5(20 sec)
2 sec
One operation cycle
3
Specified the
Device &
Constant
4
Special Device
5
Errors
6
Types and
Setting of
Parameters
7
Other Functions
Multi-timer using the STMR instruction
Off-delay timers, one-shot timers and flicker timers can be easily created using this instruction.
Off-delay timer and one-shot timer
EN
s
m
STMR
ENO
10 sec10 sec
•
The value specified in "m" is handled as
d
the set value of a timer specified in input
variable .
The set value is "10 sec." in this example.
•
M0 is an off-delay timer.
•
M1 is a one-shot timer which operates after
the input turns OFF from ON.
•
M2 and M3 are flicker timers, and connected
as shown in the program example below for flicker.
s
X000
M 0
M 1
M 2
M 3
X000
T10M0
K100
10 sec10 sec
10 sec
53
Page 56
FXCPU Structured Programming Manual
r
[Device & Common]
Flicker timer
2 Devices in Detail
2.5 Timer [T]
X000M3
T10M0
K100
X000
M 2
M 1
EN
s
m
STMR
ENO
d
In addition, the timer time can be set according to the switch input time using the teaching timer instruction
TTMR.
2.5.7Handling timers as numeric devices
In timers, the output contact operating in accordance with the set value is used in some cases, and the
current value is used as numeric data for control in other cases.
The figures below show the structure of timer current value registers. When a timer number is specified in an
input variable of an instruction, the timer is handled as a device which stores 16-bit or 32-bit data in the same
way as data registers.
1. Structure of timer current value registers
1) 16-bit
•
When M3 is connected as shown in the
left figure, M2 and M1 become flicker outputs.
•
When X000 is set to OFF, M0, M1 and M3 turn
OFF and T10 is reset after the set time.
•
Do not use the timers used here in other
general circuits again.
2,048
4,096
16 bit
512
1,024
256
128
64
32
16
1010101010101010
b0
1
2
4
8
Available numeric value range
16-bit:0 to 32,767
32-bit:-2,147,483,648 to +2,147,483,647
High orderLow order
b15
*1
Sign
0 : Positive
1 : Negative
*1.The sign is valid only when a timer is handled as a substitute for a data register.
8,192
16,384
2) 32-bit
262,144
524,288
32 bit
1010101010101010
32,768
65,536
131,072
8,192
16,384
2,048
4,096
512
1,024
256
128
64
32
16
0000111100001111
1
2
4
8
High orderLow orde
b31b0
Sign
0 : Positive
1 : Negative
67,108,864
134,217,728
268,435,456
536,870,912
1,073,741,824
8,388,608
16,777,216
33,554,432
1,048,576
2,097,152
4,194,304
2. Use examples
For the full use of timers as numeric devices, refer to the instruction explanation manual offered separately.
→ FX Structured Programming Manual [Basic & Applied Instruction]
54
Page 57
FXCPU Structured Programming Manual
[Device & Common]
2.6Counter [C]
In counters, "CS" indicates a contact, "CC" indicates a coil, and "CN" indicates the current value.
→ Refer to the Q/L/F Structured Programming Manual (Fundamentals).
2 Devices in Detail
2.6 Counter [C]
1
Device Outline
2.6.1Numbers of counters
The tables below show counter (C) numbers. (Numbers are assigned in decimal.)
1. In FX3S/FX3G/FX3GC/FX3U/FX3UC PLCs
Counting range: 0 to 32767
General type
FX3U/FX3UC
PLC
FX3G/FX3GC
PLC
FX3S PLC
*1.This area is not latched (backed up). It can be changed to the latched (backed-up) area by parameter
setting.
*2.This area is latched (backed up). It can be changed to the non-latched (non-backed-up) area by
parameter setting.
C0 to C99
100 points
General type
C0 to C15
General type
C0 to C15
*1
Counting range: 0 to 32767
16 points
Counting range: 0 to 32767
16 points
16-bit up-counter
Latched (battery backed-
16-bit up-counter
Fixed latched (EEPROM
16-bit up-counter
Fixed latched (EEPROM
up) type
C100 to C199
100 points
keep) type
C16 to C199
184 points
keep) type
C16 to C31
*2
16 points
→ For high speed counters, refer to Section 2.7.
32-bit bi-directional counter
-2,147,483,648 to +2,147,483,647
General type
C200 to C219
General type
C200 to C219
*1
20 points
32-bit bi-directional counter
-2,147,483,648 to +2,147,483,647
20 points
32-bit bi-directional counter
-2,147,483,648 to +2,147,483,64732
Latched (battery backed-
C220 to C234
Fixed latched (EEPROM
C220 to C234
General type
C200 to C234
35 points
up) type
15 points
keep) type
15 points
*2
Constant
Parameters
2
Devices in
Detail
3
Specified the
Device &
4
Special Device
5
Errors
6
Types and
Setting of
2. In FX1S/FX1N/FX1NC/FX2N/FX2NC PLCs
16-bit up-counter
Counting range: 0 to 32767
FX1S
PLC
FX1N/FX1NC
PLC
FX2N/FX2NC
PLC
General type
C0 to 15
16 points
16 points
100 points
*3
C0 to C15
*3
C0 to C99
*1
Latched
(backed-up)
type
Battery
backed-up
-
-
C100 to C199
100 points
Fixed latched (backed-up) type
*2
EEPROM
backed-up
C16 to C31
16 points
C16 to C31
16 points
--
*3
*3
Capacitor
backed-up
C32 to C199
168 points
General type
--- -
C200 to C219
*3
C200 to C219
*1.This area is not latched (backed up). It can be changed to the latched (backed-up) area by parameter
setting.
*2.This area is latched (backed up). It can be changed to the non-latched (non-backed-up) area by
parameter setting.
*3.The characteristics of latch (backup) cannot be changed using parameters.
Counter numbers not used as counters can be used as data registers to store numeric values.
32-bit bi-directional counter
-2,147,483,648 to +2,147,483,647
Latched
(backed-up)
type
Battery
backed-up
20 points
20 points
*3
*1
-
C220 to C234
15 points
Fixed latched
(backed-up)
C220 to C234
*2
type
Capacitor
backed-up
15 points
-
7
Other Functions
*3
55
Page 58
FXCPU Structured Programming Manual
[Device & Common]
3. In FX0S/FX0/FX0N/FXU/FX2C PLCs
2 Devices in Detail
2.6 Counter [C]
General type
FX0S/FX0
PLC
FX0N
PLC
FXU/FX2C
PLC
C0 to 13
14 points
C0 to C15
16 points
C0 to C99
100 points
*4
*4
*1.This area is not latched (backed up). It can be changed to the latched (backed-up) area by parameter
setting.
*2.This area is latched (backed up). It can be changed to the non-latched (non-backed-up) area by
parameter setting.
*3.This area is fixed to the latched (backed-up) type. (The contents can be cleared by the RST and ZRST
instructions.)
*4.This area is fixed to the non-latched (non-backed-up) type. The characteristics of latch (backup)
cannot be changed.
Counter numbers not used as counters can be used as data registers to store numeric values.
2.6.2Features of counters
The table below shows the features of 16-bit counters and 32-bit counters.
These counters can be used in accordance with the operating condition such as counting direction switching
and counting range.
Item16-bit counter32-bit counter
Counting directionUp-counting
Set value1 to 32767-2,147,483,648 to +2,147,483,647
Set value
specification
Current value
change
Output contactLatches the operation status after counting up.
Reset operationWhen the RST instruction is executed, the current value of counter is reset to "0" and the output contact turns OFF.
Current value
register
Constant (K) or data registerConstant (K) or a pair of data registers
Does not change after counting up.Changes even after counting up (ring counter).
16-bit32-bit
16-bit up-counter
Counting range: 0 to 32767
Latched (backed-up)
type
-
-
*1
C100 to C199
100 points
32-bit bi-directional counter
-2,147,483,648 to +2,147,483,647
Fixed latched
(backed-up) type
C14 to C15
*3
2 points
C16 to C31
16 points
*2
*3
-
Up-counting and down-counting can be switched (refer
to Subsection 2.6.3).
Latches the operation status (in up-counting), or is reset
(in down-counting).
FX0S/FX0/FX0N PLCs do not support 32-bit counters.
When an auxiliary relay for switching the counting direction is set to ON, the counter executes down-counting.
When the auxiliary relay is set to OFF, the counter executes up-counting.
56
Counting
Counter No.
C200M8200C210M8210C220M8220C230M8230
C201M8201C211M8211C221M8221C231M8231
C202M8202C212M8212C222M8222C232M8232
C203M8203C213M8213C223M8223C233M8233
C204M8204C214M8214C224M8224C234M8234
C205M8205C215M8215C225M8225
C206M8206C216M8216C226M8226
C207M8207C217M8217C227M8227
C208M8208C218M8218C228M8228
C209M8209C219M8219C229M8229
direction
switching
relay
Counter No.
Counting
direction
switching
relay
Counter No.
Counting
direction
switching
relay
Counter No.
Counting
direction
switching
relay
Page 59
FXCPU Structured Programming Manual
[Device & Common]
2.6.4Functions and operation examples
1. General type and latched (backed-up) type 16-bit counters
• The valid setting rage of 16-bit binary up-counter is from K1 to K32767 (decimal constant).
K0 causes the same operation as K1, and the output contact turns ON at the first counting.
• In general type counters, the count value is cleared when the PLC is turned OFF.
In latched (backed-up) type counters, the count value just before power interruption is stored. The count
value in the subsequent operation can be added to the previous last count value.
• 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.
When the reset input X010 turns ON and then the RST instruction is executed, the current value of the
counter is reset to "0" and the output contact turns OFF.
2 Devices in Detail
2.6 Counter [C]
Constant
1
Device Outline
2
Devices in
Detail
3
Specified the
Device &
X010
X011
CS0
ENENO
OUT_C
ENENO
CC0
CCoil
K10
CValue
Set value (constant)
The set value can be
indirectly specified instead.
Y000
RST
d
C0
X010
X011
Current
value
Y000
10
9
8
7
6
5
4
3
2
1
0
• The counter set value can be set directly by a constant (K) as shown above, or specified indirectly by a
data register number.
For example, when D10 is specified and the contents of D10 are "123", it is equivalent to "K123".
• If data beyond the set value is written to the current value register by the MOV instruction, etc., the OUT
coil turns ON and the current value register becomes the set value when the next counting input is
received.
• In a latched (backed-up) type counter, the current value, output contact operation status and reset status of
the counter are latched (backed up) by a battery, EEPROM, etc. built in the PLC.
→ For details on backup methods against power interruption, refer to Section 2.6.
2. General type and latched (backed-up) type 32-bit bidirectional counters
The valid setting range of 32-bit binary bidirectional 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 the counter CUUU, the counter executes down-counting.
When M8UUU is not driven for the counter CUUU, the counter executes up-counting. (Refer to the
previous page.)
• The (positive or negative) set value can be specified by a constant (K) or the contents of data registers (D).
When data registers are used, 32-bit data composed of a pair of serial data registers is handled as the set
value.
However, when handling 32-bit data in structured programs, it is not allowed to specify 16-bit data registers
directly, different from simple projects. (Because 32-bit counters have 32-bit length, it is allowed to specify
32-bit data directly.) Use a label when handling 32-bit data.
For example, when specifying 32-bit data using two data registers D1 and D0, define D0 using a global
label.
4
Special Device
5
Errors
6
Types and
Setting of
Parameters
7
Other Functions
57
Page 60
FXCPU Structured Programming Manual
[Device & Common]
• When the coil C200 is driven by the counting input X014, the counter starts up-counting or down-counting.
When the current value of the counter increases from "-6" to "-5", the output contact turns ON. When the
current value decreases from "-5" to "-6", the output contact turns OFF.
X012
M8200
X013
X014
CC200
CS200
ENENO
CCoil
K-5
CValue
Set value (constant)
The set value can be
indirectly specified instead.
• The current value increases or decreases without regard to the operation of the output contact.
When the counter executes up-counting from "2,147,483,647", the count value becomes "-2,147,483,648".
In the same way, when the counter executes down-counting from "-2,147,483,648", the count value
becomes "2,147,483,647". (This type of counter is called ring counter.)
• When the reset input X013 turns ON and then the RST instruction is executed, the current value of the
counter is reset to "0" and the output contact turns OFF.
• In a latched type counter, the current value, output contact operation status and reset status of the counter
are latched (backed up) by a battery, etc. in the PLC.
→ For details on backup methods against power interruption, refer to Section 1.2.
• 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 the DMOV instruction, etc., the
counter continues counting and the contact does not change when the next counting input is received.
RST
ENENO
d
OUT_C_32
Y001
C200
Up-counting
X012
X013
X014
Current
value
0
When output contact has
been already turned ON.
Y001
454
3
2
1
Down-counting
3
2
1
0
2 Devices in Detail
2.6 Counter [C]
Up-counting
0
-1
-2
-3
-4
-5
-6
-7
-7
-8
-3
-4
-5
-6
2.6.5Set value specification method
1. 16-bit counter
1) Direct specification using a constant (K)
X003
CC0
K100
2) Indirect specification using a data register (D)
X001
X003
CC0
D5
OUT_C
ENENO
CCoil
CValue
Constant (decimal constant)1 to 32,767
100 counts
MOV
ENsENO
K100
OUT_C
ENENO
CCoil
CValue
D5:100
100 counts
Write in advance a value to the data register used
for indirect specification in a program, or set such
a value in advance using a digital switch.
d
D5
Note that the set value of a latched (backed-up) type
register can be indefinite when the battery voltage
becomes low.
58
Page 61
FXCPU Structured Programming Manual
[Device & Common]
2. 32-bit counter
1) Direct specification using a constant (K)
2 Devices in Detail
2.6 Counter [C]
1
Device Outline
X003
CC200
K43210
2) Indirect specification using a data register (D)
X001
K43210
X003
CC200
D5
*1 Make sure data registers used for indirect specification are not used in other programs.
2.6.6Cautions on use
For writing the symbolic information and changing the set values of timers and counters using a peripheral
equipment, it is recommended to create programs with the set values specified indirectly.
If the set values are specified directly, programs cannot be restored from the symbolic information after the
set values are changed.
OUT_C_32
ENENO
CCoil
CValue
Constant (decimal constant)-2,147,483,648 to +2,147,483,647
43210 counts
DMOV
OUT_C_32
ENENO
CCoil
*1
CValue
ENsENO
*1
d
D5
Constant
2
Devices in
Detail
3
Specified the
Device &
4
Special Device
5
Errors
2.6.7Response speed of counters
Counters execute counting by cyclic operation for contact operations of signals X, Y, M, S, C, etc. inside the
PLC.
For example, when X011 is used for counting input, its ON duration and OFF duration should be longer than
the scan time of the PLC (which is several tens 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 several kHz without regard to the scan time.
2.6.8Counters handled as numeric devices
Counters use output contacts which operate in accordance with the set value, or use the count value (current
value) as numeric data for control.
The figures below show the structure of current value registers of counters.
When a counter number is specified in an input variable of an instruction, the counter is handled as a device
which stores 16-bit or 32-bit data in the same way as data registers.
A 32-bit counter is handled as 32-bit data.
→ For high speed counters, refer to Section 2.7.
6
Types and
Setting of
Parameters
7
Other Functions
59
Page 62
FXCPU Structured Programming Manual
r
[Device & Common]
1. Structure of the current value register of a counter
1) 16-bit
2 Devices in Detail
2.6 Counter [C]
2,048
4,096
16-bit
512
1,024
256
128
64
32
16
Available numeric value range
1010101010101010
b0
1
2
4
8
16-bit:0 to 32,767
32-bit:-2,147,483,648 to +2,147,483,647
High orderLow order
b15
*1
Sign
0 : Positive
1 : Negative
*1.The sign is valid only when a timer is handled as a substitute for a data register.
8,192
16,384
2) 32-bit
131,072
262,144
524,288
32-bit
1010101010101010
65,536
16,384
32,768
4,096
8,192
1,024
2,048
512
256
128
64
32
16
Low orde
0000111100001111
1
2
4
8
High order
b31b0
Sign
0 : Positive
1 : Negative
67,108,864
134,217,728
268,435,456
536,870,912
1,073,741,824
16,777,216
33,554,432
2,097,152
4,194,304
8,388,608
1,048,576
2. Use examples in applied instructions
For the full use of counters as numeric devices, refer to the instruction explanation manual offered separately.
→ FX Structured Programming Manual [Basic & Applied Instruction]
MOV
CN20
K100
CN30
ENsENO
CMP
EN
s1
s2
ENO
d
D10
d
M0
CN20 (current value) is transferred to D10.
A decimal integer "100" is compared with CN30
(current value), and the comparison result is
output to M0 to M2.
CN10
CN5
K2
CN200
K100
K20000
CN200
BCD
ENsENO
MUL_E
EN
_IN
_IN
DMOV
ENsENO
DZCP
EN
s1
s2
s3
ENO
ENO
The contents of CN10 (current value) are converted
into BCD, and output to Y000 to Y007
d
K2Y000
D4
d
D0
d
M10
(to control the 7-segment display unit).
CN5 (current value) is multiplied by "2", and the
obtained value is transferred to (D5, D4).
CN200 (current value) is transferred to (D1, D0).
CN200 (current value) is compared with a decimal
integer zone "100 to 20000", and the comparison
result is output to M10 to M12.
60
Page 63
FXCPU Structured Programming Manual
[Device & Common]
3. Caution on simultaneous instances of the ZRST instruction and a counter
The ZRST instruction resets also the last stage and reset state of T and C coils.
Accordingly, if the drive contact of X000 is ON in the following program, the counter executes counting after
the ZRST instruction is executed.
Structured ladder/FBD
M0
X000
CC0
K10
ZRST
ENENO
d1
d2
RST
ENENO
OUT_C
ENENO
CCoil
CValue
C0
C100
M0
d
Program in the following way to disable counting after execution of the ZRST instruction.
Timing chart
X000
M0
Current
value of C0
one operation
cycle
3
OUT_C instruction
execution
ZRST instruction
execution
one operation
cycle
4
0
OUT_C instruction
execution
one operation
cycle
1
2 Devices in Detail
2.6 Counter [C]
one operation
cycle
2
OUT_C instruction
execution
Counting is executed
when X000 is ON.
Constant
1
Device Outline
2
Devices in
Detail
3
Specified the
Device &
4
Special Device
M0
X000
ZRST
ENENO
d1
d2
RST
ENENO
MEP
ENENO
C0
C100
M0
d
OUT_C
ENENO
CC0
CCoil
K10
CValue
5
Errors
6
Types and
Setting of
Parameters
7
Other Functions
61
Page 64
FXCPU Structured Programming Manual
[Device & Common]
2.7High Speed Counter [C]
2.7.1Types and device numbers of high speed counters
1. Types of high speed counters
The PLC main unit has built-in 32-bit high speed bidirectional counters (1-phase 1-counting, 1-phase 2counting and 2-phase 2-counting). These high speed counters are classified into the hardware type and the
software type according to the counting method.
Some high speed counters can be used together with an external reset input terminal and external start input
terminal (for counting start).
2. Classification of high speed counters according to the counting method
• Hardware counters :These types of counters execute counting using hardware, but are switched to
software counters depending on the operation condition.
→ For the condition handled as software counters, refer to Subsection 2.7.9.
• Software counters : These types of counters execute counting through CPU interrupt processing.
It is necessary to use each software counter within restrictions of both the maximum
response frequency and the total frequency.
→ For restriction of the response frequency depending on the total frequency, refer to Subsection
2 Devices in Detail
2.7 High Speed Counter [C]
2.7.10.
3. Types of high speed counters and input signal forms
The table below shows the types (1-phase 1-counting, 1-phase 2-counting and 2-phase 2-counting) and input
signals (waveforms) of high speed counters.
Input signal formCounting direction
The ON/OFF status of M8235 to M8245
1-phase 1-counting input
1-phase 2-counting input
2-phase 2-counting
input
UP/DOWN
1-edge counting
4-edge counting
UP
DOWN
Phase A
Phase B
Phase A
Phase B
+1+1+1
+1
+1
Up-counting
+1 +1 +1 +1 +1
+1 +1 +1 +1
Up-counting
-1-1-1
Phase A
Phase B
Phase A
Phase B
-1
-1
Down-counting
-1 -1 -1 -1 -1
-1 -1 -1 -1
Down-counting
specifies down-counting or up-counting.
ON: Down-counting
OFF: Up-counting
A counter executes up-counting or downcounting as shown on the left.
The counting direction can be checked in
M8246 to M8250.
ON: Down-counting
OFF: Up-counting
A counter automatically executes upcounting or down-counting according to
changes in the input status of the phase
A or B as shown on the left.
The counting direction can be checked in
M8251 to M8255.
ON: Down-counting
OFF: Up-counting
62
Page 65
FXCPU Structured Programming Manual
[Device & Common]
4. Cautions on counterpart equipment connected to high speed counter inputs
General-purpose inputs X000 to X007 (X003) are used for high speed counter inputs. An encoder*1 adopting
the output type shown in the table below can be connected depending on the connected terminal.
Encoders adopting the voltage output type and absolute encoders cannot be connected to high speed
counter inputs.
→ For the wiring, refer to the manual (Hardware Edition) of the PLC main unit.
2 Devices in Detail
2.7 High Speed Counter [C]
1
Device Outline
2
Devices in
Detail
Output type which can be directly connected to input terminal of
main unit
Output type which can be directly connected to input terminal of
FX3U-4HSX-ADP
*1.A rotary encoder adopting the output type shown above may not operate correctly depending on the
electrical compatibility. Check the specifications before connecting an encoder.
*2.This product is the adaptor for high speed input dedicated to FX
*2
Open collector transistor output type compatible with 24 VDC
Differential line driver output type (Output voltage: 5 VDC or less)
3U PLCs.
Constant
Parameters
3
Specified the
Device &
4
Special Device
5
Errors
6
Types and
Setting of
7
Other Functions
63
Page 66
FXCPU Structured Programming Manual
[Device & Common]
5. High speed counter list
1) In FX3U/FX3UC PLCs
2 Devices in Detail
2.7 High Speed Counter [C]
ClassificationCounter No.
Hardware
*1
counters
C244(OP)
C245(OP)
1-phase 1-counting input
Software
counters
Hardware
*1
1-phase 2-counting input
2-phase 2-counting input
counters
Software
counters
Hardware
counters
Software
counters
C248(OP)
*1
C253(OP)
C235
C236
C237
C238
C239
C240
C241
C242
C243
C244
C245
C246
C247
C248
C249
C250
C251
C253
C252
C254
C255
1-edge counting/
4-edge counting
*2
*2
*2
*2
*2
*2
*3
*3
*3
*3
*2
*2*3
*3
*2
*2
*6
-
-
-
-
-
-
-
1-edge counting
4-edge counting
1-edge counting
4-edge counting
1-edge counting
4-edge counting
1-edge counting
4-edge counting
1-edge counting
4-edge counting
*4
*4
*4
*4
*4
*4
*4
*4
*4
*4
Data length
32-bit
bidirectional
counter
32-bit
bidirectional
counter
32-bit
bidirectional
counter
External reset input
terminal
Not providedNot provided
*5
Provided
*5
Provided
Not providedNot provided
*5
Provided
*5
Provided
Not provided
*5
Provided
*5
Provided
Not provided
*5
Provided
External start input
Not provided
Provided
Not provided
Provided
Not provided
Not provided
Provided
terminal
64
*1.They are handled as software counters depending on the operating condition. When they are handled
as software counters, they get restrictions of both the maximum response frequency and the total
frequency.
→ For the condition handled as software counters, refer to Subsection 2.7.9.
→ For the total frequency, refer to Subsection 2.7.10.
*2.Cautions on wiring should be considered for these high speed counters.
→ For the wiring, refer to the manual (Hardware Edition) of the PLC main unit.
*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 special auxiliary relays (M8388 and one among
M8390 to M8392).
→ For the method to switch the counter function, refer to Subsection 2.7.7.
*4.2-phase 2-input counters usually execute 1-edge counting, but can be used for 4-edge counting by
combining special auxiliary relays (M8388 and one between M8198 and M8199).
→ For the method to use a 2-phase 2-input counter for 4-edge counting, refer to Subsection 2.7.8.
*5.The external reset input usually causes reset at turning ON, but can cause reset at turning OFF by
combining special auxiliary relays (M8388 and M8389).
→ For the method to change the logic for external reset input, refer to Subsection 2.7.6.
*6.C253 is usually used as a hardware counter, but can be used as a counter C253 (OP) not having
reset input by combining special auxiliary relays (M8388 and M8392).
In this case, C253 (OP) is handled as a software counter.
Page 67
FXCPU Structured Programming Manual
[Device & Common]
Notation of high speed counters
2 Devices in Detail
2.7 High Speed Counter [C]
1
Device Outline
For some high speed counters in FX
3U/FX3UC PLCs, the assignment of input terminals switches when special
auxiliary relays are combined.
(For input terminal numbers, refer to Subsection 2.7.2.)
Such high speed counters are described as follows in this section. Note that "(OP)" is not available in
programming.
Standard device numberSwitched device numberStandard device numberSwitched device number
C244C244(OP)C248C248(OP)
C245C245(OP)C253C253(OP)
2) In FX
3G/FX3GC PLCs
ClassificationCounter No.
Software
counters
1-phase 1-counting input
C248(OP)
Software
counters
1-phase 2-counting input
C253(OP)
C254(OP)
Software
counters
2-phase 2-counting input
C235
C236
C237
C238
C239
C240
C241
C242
C243
C244
C245
C246
C247
C248
C249
C250
C251
C252
C253
C254
C255
1-edge counting/
4-edge counting
-
-ProvidedNot provided
-ProvidedProvided
*1
*1
*2
-
-ProvidedNot provided
-ProvidedProvided
1-edge counting
1-edge countingProvidedNot provided
1-edge countingProvidedProvided
Data length
32-bit
bidirectional
counter
32-bit
bidirectional
counter
32-bit
bidirectional
counter
External reset input
terminal
Not providedNot provided
Not providedNot provided
Not providedNot provided
External start input
terminal
2
Devices in
Detail
3
Specified the
Device &
Constant
4
Special Device
5
Errors
6
Types and
Setting of
Parameters
7
Other Functions
*1.C248 and C253 are usually used as counters having reset input, but can be used as counters C248
(OP) and C253 (OP) not having reset input when used together with special auxiliary relays M8388
and M8392.
*2.C254 is usually used as a counter having reset input and start input, but can be used as a counter
C254 (OP) not having reset input or start input when used together with special auxiliary relays M8388
and M8395.
Notation of high speed counters
For some high speed counters in FX
3G/FX3GC PLCs, the assignment of input terminals switches when
special auxiliary relays are combined.
Such high speed counters are described as follows in this section. Note that "(OP)" is not available in
programming.
Standard device numberSwitched device number
C248C248(OP)
C253C253(OP)
C254C254(OP)
65
Page 68
FXCPU Structured Programming Manual
[Device & Common]
3) In FX3S PLC
ClassificationCounter No.
C235
C236
C237
C238
Software
counters
1-phase 1-counting input
Software
counters
1-phase 2-counting input
Software
counters
2-phase 2-counting input
C239
C240
C241
C242
C243
C244
C245
C246
C248(OP)
C247
C248
C249
C250
C251
C253(OP)
C252
C253
C254
C255
*1
*1
2 Devices in Detail
2.7 High Speed Counter [C]
1-edge counting/
4-edge counting
-
-ProvidedNot provided
-ProvidedProvided
-
-ProvidedNot provided
-ProvidedProvided
1-edge counting
1-edge countingProvidedNot provided
1-edge countingProvidedProvided
Data length
32-bit
bidirectional
counter
32-bit
bidirectional
counter
32-bit
bidirectional
counter
External reset input
terminal
Not providedNot provided
Not providedNot provided
Not providedNot provided
External start input
terminal
*1.C248 and C253 are usually used as counters having reset input, but can be used as counters C248
(OP) and C253 (OP) not having reset input when used together with special auxiliary relays M8388
and M8392.
Notation of high speed counters
For some high speed counters in FX
3S PLC, the assignment of input terminals switches when special
auxiliary relays are combined.
Such high speed counters are described as follows in this section. Note that "(OP)" is not available in
programming.
Standard device numberSwitched device number
C248C248(OP)
C253C253(OP)
66
Page 69
FXCPU Structured Programming Manual
[Device & Common]
4) In FX1S/FX1N/FX1NC PLCs
2 Devices in Detail
2.7 High Speed Counter [C]
1
Device Outline
ClassificationCounter No.
Software
counters
1-phase 1-counting input
Software
counters
1-phase 2-counting input
Software
counters
2-phase 2-counting input
1-edge counting/
4-edge counting
C235
C236
C237
C238
C239
C240
C242
C243
C244
C245
C246-
C247
C248
C249
C250
C251
C252
C253
C254
C255
1-edge counting
Data length
-
32-bit
bidirectional
-C241
-Provided
counter
32-bit
bidirectional
counter
32-bit
bidirectional
counter
External reset input
terminal
Not provided
Provided
Not provided
Not provided
Provided
External start input
terminal
Not provided
Provided
Not provided
Provided
Not provided
Provided
Constant
2
Devices in
Detail
3
Specified the
Device &
4
Special Device
5
Errors
5) In FX
2N/FX2NC PLCs
ClassificationCounter No.
counters
1-phase 1-counting input
counters
1-phase 2-counting input
counters
2-phase 2-counting input
Hardware
Software
counters
Hardware
Software
counters
Hardware
Software
counters
1-edge counting/
4-edge counting
*1
*1
*1
C235
C236
C237
C238
C239
C240
C242
C243
C244
C245
C246-
C247
C248
C249
C250
C251
C252
C253
C254
C255
-
-C241
-Provided
1-edge counting
Data length
32-bit
bidirectional
counter
32-bit
bidirectional
counter
32-bit
bidirectional
counter
External reset input
terminal
Not provided
Provided
Not provided
Not provided
Provided
External start input
terminal
Not provided
Provided
Not provided
Provided
Not provided
Provided
6
Types and
Setting of
Parameters
7
Other Functions
*1.They are handled as software counters depending on the operating condition. When they are handled
as software counters, they get restrictions of both the maximum response frequency and the total
frequency.
67
Page 70
FXCPU Structured Programming Manual
[Device & Common]
6) In FX0S/FX0/FX0N PLCs
2 Devices in Detail
2.7 High Speed Counter [C]
ClassificationCounter No.
Software
counters
1-phase 1-counting input
Software
counters
1-phase 2-counting input
Software
counters
2-phase 2-counting input
1-edge counting/
4-edge counting
C235
C236
C237
C238
C241
C242
C244Provided
C246
C247
C249Provided
C251
C252
C254Provided
-
-
1-edge counting
Data length
32-bit
bidirectional
counter
32-bit
bidirectional
counter
32-bit
bidirectional
counter
External reset input
terminal
Not provided
Provided
Not provided
Provided
Not provided
Provided
External start input
terminal
Not provided
Not provided
Not provided
7) In FX
1-phase 1-counting input
1-phase 2-counting input
2-phase 2-counting input
U/FX2C PLCs
ClassificationCounter No.
C235
C236
C237
C238
Software
counters
Software
counters
Software
counters
C239
C240
C241
C242
C243
C244
C245
C246
C247
C248
C249
C250
C251
C252
C253
C254
C255
1-edge counting/
4-edge counting
-
-
1-edge counting
Data length
32-bit
bidirectional
counter
32-bit
bidirectional
counter
32-bit
bidirectional
counter
External reset input
terminal
Not provided
Provided
Not provided
Provided
Not provided
Provided
External start input
terminal
Not provided
Provided
Not provided
Provided
Not provided
Provided
68
Page 71
FXCPU Structured Programming Manual
[Device & Common]
2.7.2Input assignment for high speed counters
Inputs X000 to X007 (X003) are assigned as shown in the tables below according to each high speed counter
number.
When a high speed counter is used, the filer constant of a corresponding input number in the PLC main unit
automatically changes.
Input terminals not used for high speed counters, however, can be used as general inputs.
→ For the input specifications of the PLC main unit, refer to the hardware manual of the PLC main
FX
3U/FX3UC PLCs : (X000 to X005:5μS, X006, X007:50μS)
3G/FX3GC PLCs : (X000, X001, X003, X004:10μS, X002, X005 to X007:50μS)
FX
3S PLC : (X000, X001:10μS, X002 to X007:50μS)
FX
1S/FX1N/FX1NC/FX2N/FX2NC PLCs : (X000, X001:20μS, X002 to X005:50μS)
FX
0S/FX0/FX0N/FXU/FX2C PLCs : (X000 to X003/X005:50μS)
FX
• Prohibition on redundant use of input terminals
Inputs X000 to X007(X003) are used for high speed counters, input interrupt, pulse catch, SPD/DSZR/
DVIT/ZRN instructions and general-purpose inputs.
Make sure to use each input terminal only once.
2 Devices in Detail
2.7 High Speed Counter [C]
unit.
Constant
1
Device Outline
2
Devices in
Detail
3
Specified the
Device &
4
Special Device
5
Errors
6
Types and
Setting of
Parameters
7
Other Functions
69
Page 72
FXCPU Structured Programming Manual
[Device & Common]
1. In FX3U/FX3UC PLCs
When FX3U-4HSX-ADP units are connected to an FX3U PLC, input terminals inside heavy-line frames in the
table below are assigned to the first FX
second FX
Same input numbers are assigned to input terminals of the FX
PLC main unit. Use only either input terminal.
If both input terminals are used, intended operations are not achieved because inputs of the FX
and inputs of the FX
1-phase
1-counting
1-phase
2-counting
2-phase
2-counting
H/W : Hardware countersS/W : Software countersU : Up-counting inputD : Down-counting input
A : Phase A inputB : Phase B inputR : External reset input S : External start input
*1.Cautions on wiring should be considered for these high speed counters.
*2.Hardware counters are switched to software counters when a comparison set/reset instruction for high
*3.When a special auxiliary relay is driven in a program, used input terminals and their functions are
*4.2-phase 2-input counters usually execute 1-edge counting, but can be used for 4-edge counting by
3U-4HSX-ADP unit.
3U PLC operate under the "OR" relationship.
→ For the input specifications of the FX
Counter No.Classification
*1
input
input
input
C235
*1
C236
*1
C237
*1
C238
*1
C239
*1
C240
C241S/W
C242S/W
C243S/WU/DR
C244S/WU/DRS
C244(OP)
C245(OP)
C248(OP)
C253(OP)
*3
C245S/WU/DRS
*3
*1
C246
C247S/WUDR
C248S/WUDR
*1*3
C249S/WUDRS
C250S/WUDRS
*1
C251
C252S/WABR
*1
C253
*3
C254S/WABRS
C255S/WABRS
H/W
H/W
H/W
H/W
H/W
H/W
H/W
H/W
H/W
H/W
H/W
H/W
S/WAB
→ For the wiring, refer to the hardware manual of the PLC main unit.
speed counter (DHSCS, DHSCR, DHSZ or DHSCT) is used.
C253 is switched to a software counter when the logic for external reset input is reversed.
→ For the condition under which hardware counters are handled as software counters, refer to
switched.
→ For the method to use software counters as hardware counters, refer to Subsection 2.7.7.
combining special auxiliary relays.
→ For the method to use a 2-phase 2-input counter for 4-edge counting, refer to Subsection 2.7.8.
2 Devices in Detail
2.7 High Speed Counter [C]
3U-4HSX-ADP unit, and other input terminals are assigned to the
3U-4HSX-ADP and input terminals of the FX3U
3U-4HSXADP
3U-4HSX-ADP, refer to the FX3U hardware manual.
Input terminal assignment
X000X001X002X003X004X005X006X007
*2
*2
*2
*2
*2
*2
*2
*2
*2
*2
*2
*2
U/D
U/D
U/D
U/D
U/D
U/D
U/DR
U/DR
U/D
U/D
UD
UD
AB
ABR
Subsection 2.7.9.
70
Page 73
FXCPU Structured Programming Manual
[Device & Common]
2. In FX3G/FX3GC PLCs
Counter No.Classification
C235S/WU/D
C236S/WU/D
C237S/WU/D
C238S/WU/D
1-phase
1-counting
input
1-phase
2-counting
input
2-phase
2-counting
input
H/W : Hardware countersS/W : Software countersU : Up-counting inputD : Down-counting input
A : Phase A inputB : Phase B inputR : External reset input S : External start input
C239S/WU/D
C240S/WU/D
C241S/WU/DR
C242S/WU/DR
C243S/WU/DR
C244S/WU/DRS
C245S/WU/DRS
C246S/WUD
C247S/WUDR
C248S/WUDR
C248(OP)S/WUD
C249S/WUDRS
C250S/WUDRS
C251S/WAB
C252S/WABR
C253S/WABR
C253(OP)S/WAB
C254S/WABRS
C254(OP)S/WAB
C255S/WABRS
2 Devices in Detail
2.7 High Speed Counter [C]
Input terminal assignment
X000X001X002X003X004X005X006X007
Constant
1
Device Outline
2
Devices in
Detail
3
Specified the
Device &
4
Special Device
5
Errors
3. In FX3S PLC
Input terminal assignment
1-phase
1-counting
input
1-phase
2-counting
input
2-phase
2-counting
input
Counter No.Classification
C235S/WU/D
C236S/WU/D
C237S/WU/D
C238S/WU/D
C239S/WU/D
C240S/WU/D
C241S/WU/DR
C242S/WU/DR
C243S/WU/DR
C244S/WU/DRS
C245S/WU/DRS
C246S/WUD
C247S/WUDR
C248S/WUDR
C248(OP)S/WUD
C249S/WUDRS
C250S/WUDRS
C251S/WAB
C252S/WABR
C253S/WABR
C253(OP)S/WAB
C254S/WABRS
C255S/WABRS
X000X001X002X003X004X005X006X007
H/W : Hardware countersS/W : Software countersU : Up-counting inputD : Down-counting input
A : Phase A inputB : Phase B inputR : External reset input S : External start input
6
Types and
Setting of
Parameters
7
Other Functions
71
Page 74
FXCPU Structured Programming Manual
[Device & Common]
4. In FX1S/FX1N/FX1NC PLCs
Counter No.Classification
C235S/WU/D
C236S/WU/D
C237S/WU/D
C238S/WU/D
1-phase
1-counting
input
1-phase
2-counting
input
2-phase
2-counting
input
H/W : Hardware countersS/W : Software countersU : Up-counting inputD : Down-counting input
A : Phase A inputB : Phase B inputR : External reset input S : External start input
C239S/WU/D
C240S/WU/D
C241S/WU/DR
C242S/WU/DR
C243S/WU/DR
C244S/WU/DRS
C245S/WU/DRS
C246S/WUD
C247S/WUDR
C248S/WUDR
C249S/WUDRS
C250S/WUDRS
C251S/WAB
C252S/WABR
C253S/WABR
C254S/WABRS
C255S/WABRS
2 Devices in Detail
2.7 High Speed Counter [C]
Input terminal assignment
X000X001X002X003X004X005X006X007
5. In FX2N/FX2NC PLCs
Input terminal assignment
Subsection 2.7.9.
1-phase
1-counting
input
1-phase
2-counting
input
2-phase
2-counting
input
Counter No.Classification
C235
C236
C237S/WU/D
C238S/WU/D
C239S/WU/D
C240S/WU/D
C241S/WU/DR
C242S/WU/DR
C243S/WU/DR
C244S/WU/DRS
C245S/WU/DRS
C246
C247S/WUDR
C248S/WUDR
C249S/WUDRS
C250S/WUDRS
C251
C252S/WABR
C253S/WABR
C254S/WABRS
C255S/WABRS
H/W
H/W
H/W
H/W
*1
*1
*1
*1
X000X001X002X003X004X005X006X007
U/D
U/D
UD
AB
H/W : Hardware countersS/W : Software countersU : Up-counting inputD : Down-counting input
A : Phase A inputB : Phase B inputR : External reset input S : External start input
*1.Hardware counters are switched to software counters when a comparison set/reset instruction for high
speed counter (DHSCS, DHSCR or DHSZ) is used.
→ For the condition under which hardware counters are handled as software counters, refer to
72
Page 75
FXCPU Structured Programming Manual
[Device & Common]
6. In FXU/FX2C PLCs
Counter No.Classification
C235S/WU/D
C236S/WU/D
C237S/WU/D
C238S/WU/D
1-phase
1-counting
input
1-phase
2-counting
input
2-phase
2-counting
input
H/W : Hardware countersS/W : Software countersU : Up-counting inputD : Down-counting input
A : Phase A inputB : Phase B inputR : External reset input S : External start input
C239S/WU/D
C240S/WU/D
C241S/WU/DR
C242S/WU/DR
C243S/WU/DR
C244S/WU/DRS
C245S/WU/DRS
C246S/WUD
C247S/WUDR
C248S/WUDR
C249S/WUDRS
C250S/WUDRS
C251S/WAB
C252S/WABR
C253S/WABR
C254S/WABRS
C255S/WABRS
2 Devices in Detail
2.7 High Speed Counter [C]
Input terminal assignment
X000X001X002X003X004X005X006X007
Constant
1
Device Outline
2
Devices in
Detail
3
Specified the
Device &
4
Special Device
5
Errors
7. In FX0S/FX0/FX0N PLCs
Counter No.Classification
C235S/WU/D
C236S/WU/D
1-phase
1-counting
input
1-phase
2-counting
input
2-phase
2-counting
input
C237S/WU/D
C238S/WU/D
C241S/WU/DR
C242S/WU/DR
C244S/WU/DRS
C246S/WUD
C247S/WUDR
C249S/WUDRS
C251S/WAB
C252S/WABR
C254S/WABRS
H/W : Hardware countersS/W : Software countersU : Up-counting inputD : Down-counting input
A : Phase A inputB : Phase B inputR : External reset input S : External start input
Input terminal assignment
X000X001X002X003
6
Types and
Setting of
Parameters
7
Other Functions
73
Page 76
FXCPU Structured Programming Manual
[Device & Common]
2.7.3Handling of high speed counters
1. 1-phase 1-counting input
X010
M8235
X011
Down-counting
or up-counting
RST
ENENO
d
CC235
2 Devices in Detail
2.7 High Speed Counter [C]
·
While X012 is ON, C235 counts "OFF ON"
of the input X000.
·
When X011 turns ON and then the RST instruction
is executed, C235 is reset.
X012
CC235
K-5
X010
X011
X012
CC244
D0
OUT_C_32
ENENO
CCoil
CValue
M8244
OUT_C_32
ENENO
CCoil
CValue
Down-counting
or up-counting
RST
ENENO
d
CC244
Operation example
The counter C235 shown above operates as follows:
X010
X011
X012
X000
Counting
input
C235
Current
value
Up-counting
Reset input
Start input
3
2
1
0
454
3
2
1
Down-counting
0
Up-counting
The counting direction of counters C235 to C245
·
is switched to down-counting or up-counting
when M8235 to M8245 turns ON or OFF.
·
While X012 is ON, C244 immediately starts counting
when the input X006 turns ON. The counting input
is X000.
In this example, the set value is indirectly
specified as the contents of data registers (D1, D0).
The high speed counter C244 can be reset using X011
·
in a sequence as shown in the figure, but it is
immediately reset without any program when X001
is closed.In this case, any program including X011
is not necessary.
The counting direction of counters C235 to C245
·
is switched to down-counting or up-counting
when M8235 to M8245 turns ON or OFF.
0
74
-1
-2
When output has been
already turned ON
C235 output contact
-3
-4
-5
-6
-7
-7
-8
-3
-4
-5
-6
When the counting input X000 is given, C235 executes up-counting or down-counting as interrupt processing.
• When the current value of the counter increases from "-6" to "-5", the output contact is set (turned ON).
When the current value decreases from "-5" to "-6", the output contact is reset (turned OFF).
• The current value increases or decreases without regard to the operation of the output contact.
When the counter executes up-counting from "+2,147,483,647", the count value becomes "2,147,483,648". In the same way, when the counter executes down-counting from "-2,147,483,648", the
count value becomes "+2,147,483,647". (This type of operation is called ring counter.)
• When the reset input X011 turns ON and then the RST instruction is executed, the current value of the
counter is reset to "0" and the output contact is turned OFF.
• In a latched type high speed counter, the current value, output contact operation status and reset status of
the counter are latched (backed up) even if the power is interrupted.
Page 77
FXCPU Structured Programming Manual
[Device & Common]
2. 1-phase 2-counting input
These counters are 32-bit bidirectional counters. The operation of the output contact caused by the current
value is equivalent to that in 1-phase 1-counting input type high speed counters described above.
X011
RST
ENENO
d
CC246
2 Devices in Detail
2.7 High Speed Counter [C]
·
While X012 is ON, C246 executes up-counting when
the input X000 turns ON from OFF, and executes
down-counting when the input X001 turns ON from OFF.
1
Device Outline
2
Devices in
Detail
X012
X011
X012
CC246
D2
CC249
K1234
OUT_C_32
ENENO
CCoil
CValue
RST
ENENO
OUT_C_32
ENENO
CCoil
CValue
d
CC249
·
The up/down-counting operation of C246 to C250 is
indicated by the ON/OFF status of M8246 to M8250.
ON: Down-counting
OFF: Up-counting
·
While X012 is ON, C249 immediately starts counting
when the input X006 (X003) turns ON.
The up-counting input is X000, and the down-counting
input is X001.
·
The high speed counter C244 can be reset using X011
in a sequence as shown in the figure, but it is
immediately reset without any program when X002 is
closed. In this case, any program including X011
is not necessary.
·
The up/down-counting operation of C246 to C250 is
indicated by the ON/OFF status of M8246 to M8250.
ON: Down-counting
OFF: Up-counting
These counters are 32-bit bidirectional counters. The operation of the output contact caused by the current
value is equivalent to that in 1-phase type high speed counters described above.
→ Refer to "2.7.2 Input assignment for high speed counters".
·
X011
X012
CS251
M8251
CC251
K1234
RST
ENENO
OUT_C_32
ENENO
CCoil
CValue
Y002
Y003
d
CC251
While X012 is ON, C251 counts operations of inputs
X000 (phase A) and X001 (phase B) as interrupt
processing.
When X011 turns ON and then the RST instruction is
execute, C251 is reset.
·
When the current value becomes equivalent to or
larger than the set value, Y002 turns ON. When the
current value becomes equivalent to or smaller than
the set value, Y002 turns OFF.
·
Y003 turns ON (for down-counting) or OFF
(for up-counting) according to the counting direction.
3
Specified the
Device &
Constant
4
Special Device
5
Errors
6
Types and
Setting of
Parameters
7
Other Functions
X011
X012
CS254
M8254
CC254
D0
RST
ENENO
OUT_C_32
ENENO
CCoil
CValue
Y004
Y005
·
While X012 is ON, C254 immediately starts counting
d
CC254
when the input X006 turns ON. Its counting inputs
are X000 (phase A) and X001 (phase B).
·
In addition to reset by X011 in a sequence, C254 is
immediately reset when X002 turns ON.
·
When the current value becomes equivalent to or larger
than the set value (D1, D0), Y004 turns ON. When the
current value becomes equivalent to or smaller than
the set value, Y004 turns OFF.
·
Y005 turns ON (for down-counting) or OFF
(for up-counting) according to the counting direction.
75
Page 78
FXCPU Structured Programming Manual
[Device & Common]
• 2-phase encoder generates outputs for the phase A and phase B with a phase difference of 90°. With
these outputs, a high speed counter automatically executes up-counting and down-counting as shown in
the figure below.
- When a counter is executing 1-edge counting
2 Devices in Detail
2.7 High Speed Counter [C]
Phase A
+1
Phase B
Up-counting
+1
Phase A
Phase B
-1
-1
Down-counting
- When a counter is executing 4-edge counting
Phase A
Phase B
+1 +1 +1 +1 +1
Phase A
Phase B
+1 +1 +1 +1
Up-counting
-1 -1 -1 -1 -1
-1 -1 -1 -1
Down-counting
• The up/down-counting operation of C251 to C255 is indicated by the ON/OFF status of M8251 to M8255.
ON: Down-counting
OFF: Up-counting
76
Page 79
FXCPU Structured Programming Manual
[Device & Common]
2.7.4Current value update timing and comparison of current value
1. Current value update timing
A high speed counter executes up-counting or down-counting when a pulse is input to its input terminal, but
the current value of the high speed counter is updated at the timing shown in the table below.
When the current value of a high speed counter is used as it is in the MOV instruction, CMP instruction or
applied instruction for data comparison, etc., the current value update timing is affected by scans as shown in
the table.
Current value update timing
Hardware counterWhen OUT or HCMOV instruction is executed for counter
Software counterWhen counting input is given
2. Comparison of the current value
The following two methods are available to compare and output the current value of a high speed counter.
Some instructions are not supported in some PLCs.
→ Refer to the FX Structured Programming Manual [Basic & Applied Instruction].
1) Using the comparison instruction (CMP), zone comparison instruction (ZCP) or data comparison
instruction
When the comparison result is not necessary during counting operation, comparison may be smoothly
executed in the main program
(CMP or ZCP) or data comparison instruction.
*1.If it is necessary to execute comparison and update an output contact (Y) at the timing at which the
current value of a high speed counter changes, use a comparison instruction for high speed counter
(DHSCS, DHSCR, DHSZ or DHSCT).
2) Using a comparison instruction for high speed counter (DHSCS, DHSCR, DHSZ or DHSCT)
A comparison instruction for high speed counter (DHSCS, DHSCR, DHSZ or DHSCT) executes
comparison and outputs the comparison result while the target high speed counter is counting.
The number of times of using these instructions is restricted as shown in the table below.
When an output relay (Y) is specified for the comparison result, the comparison result is directly reflected
on the ON/OFF status of the output without regard to output refresh executed by the END instruction.
Mechanical operation delay (about 10 ms) cannot be avoided in a relay output type PLC.
Use a transistor output type PLC.
InstructionRestriction of number of times of using instruction
*1
DHSCS
DHSCR
DHSZ
DHSCT
FX3U/FX3UC PLCs: These instructions can be used up to 32 times including the DHSCT instruction.
FX
0S/FX0/FX0N/FX1S/FX1N/FX1NC/FXU/FX2C/FX2N/FX2NC/FX3S/FX3G/FX3GC PLCs: These instructions can be
*1
used up to 6 times.
*1
*1
0S/FX0/FX0N/FX1S/FX1N/FX1NC PLCs do not support the DHSZ instruction.)
(FX
This instruction can be used only once.
(FX
0S/FX0/FX0N/FX1S/FX1N/FX1NC/FXU/FX2C/FX2N/FX2NC/FX3S/FX3G/FX3GC PLCs do not support the DHSCT
instruction.)
*1
if the DHCMOV instruction is used just before the comparison instruction
2 Devices in Detail
2.7 High Speed Counter [C]
1
Device Outline
2
Devices in
Detail
3
Specified the
Device &
Constant
4
Special Device
5
Errors
6
Types and
Setting of
Parameters
7
Other Functions
*1.When a comparison instruction for high speed counter is used, the maximum response frequency and
total frequency of software counters may be restricted.
→ For the maximum response frequency and total frequency of software counters, refer to
Subsection 2.7.10.
77
Page 80
FXCPU Structured Programming Manual
[Device & Common]
2 Devices in Detail
2.7 High Speed Counter [C]
2.7.5Related devices
1. Devices used to switch the counting direction of 1-phase 1-counting input counters
2. Devices used to monitor the counting direction of 1-phase 1-counting input counters and 2phase 2-counting input counters
TypeCounter No.Monitoring deviceOFFON
C246M8246
C247M8247
1-phase 1-counting input
2-phase 2-counting input
C248M8248
C249M8249
C250M8250
C251M8251
C252M8252
C253M8253
C254M8254
C255M8255
OFFON
Up-countingDown-counting
3. Devices used to switch the high speed counter function
FX0S/FX0/FX0N/FX1S/FX1N/FX1NC/FXU/FX2C/FX2N/FX2NC PLCs do not support this function.
Device numberNameDescription
M8388
M8389
M8390
M8391
M8392Switches the function of C248 and C253. (For details, refer to Subsection 2.7.7.)
M8395
M8198
M8199
Contact for switching function
of high speed counter
Function switching device
Switches the function of high speed counter.
Switches the logic of the external reset input.
(For details, refer to Subsection 2.7.6.)
(FX3S/FX3G/FX3GC PLCs do not support this device.)
Switches the function of C244. (For details, refer to Subsection 2.7.7.)
3S/FX3G/FX3GC PLCs do not support this device.)
(FX
Switches the function of C245. (For details, refer to Subsection 2.7.7.)
(FX
3S/FX3G/FX3GC PLCs do not support this device.)
Switches the function of C254. (For details, refer to Subsection 2.7.7.)
(FX3S/FX3U/FX3UC PLCs do not support this device.)
Switches the edge counting type (between 1 and 4) of C251, C252 and C254.
(For details, refer to Subsection 2.7.8.)
(FX3S/FX3G/FX3GC PLCs do not support this device.)
Switches the edge counting type (between 1 and 4) of C253, C255 and C253
(OP). (For details, refer to Subsection 2.7.8.)
(FX3S/FX3G/FX3GC PLCs do not support this device.)
78
Page 81
FXCPU Structured Programming Manual
[Device & Common]
4. Operation status of hardware counters and software counters
FX0S/FX0/FX0N/FX1S/FX1N/FX1NC/FXU/FX2C/FX2N/FX2NC/FX3S/FX3G/FX3GC PLCs do not support this
function.
Device numberNameDescriptionONOFF
*1
M8380
*1
M8381
*1
M8382
*1
M8383
M8384
M8385
M8386
M8387
*1
*1
*1
*1
Operation status
*1.Cleared when the PLC mode switches from STOP to RUN.
Indicates the operation status of C235, C241, C244,
C246, C247, C249, C251, C252 and C254.
Indicates the operation status of C236.
Indicates the operation status of C237, C242 and C245.
Indicates the operation status of C238, C248, C248
(OP), C250, C253 and C255.
Indicates the operation status of C239 and C243.
Indicates the operation status of C240.
Indicates the operation status of C244 (OP).
Indicates the operation status of C245 (OP).
2 Devices in Detail
2.7 High Speed Counter [C]
Software counter Hardware counter
Constant
1
Device Outline
2
Devices in
Detail
3
Specified the
Device &
2.7.6Change of logic of external reset input signal
Counters C241 to C245, C247 to C250 and C252 to C255 are usually reset when the external reset input
signal turns ON.
By using the program shown below, the logic can be reversed so that these counters are reset when the
external reset input signal turns OFF.
FX
0S/FX0/FX0N/FX1S/FX1N/FX1NC/FXU/FX2C/FX2N/FX2NC/FX3S/FX3G/FX3GC PLCs do not support this
function.
Counter No.Program to reverse logic of external reset input signalDescription
M8388
M8389
C241 to C245
C247 to C250
C252 to C255
CC2
K
Caution
When the logic of the external reset input signal is reversed, C253 switches to a software counter.
OUT_C_32
ENENO
CCoil
CValue
The logic of the external reset input signal is reversed
so that the counters are reset when the external reset
input signal turns OFF.
(The logic is reversed for all target counters.)
4
Special Device
5
Errors
6
Types and
Setting of
Parameters
7
Other Functions
79
Page 82
FXCPU Structured Programming Manual
[Device & Common]
2.7.7Assignment of counter input terminal and switching of function
The assignment of input terminal and the function of software counters change as shown below when the
following special auxiliary relays are combined.
In a program, put a special auxiliary relay just before a target counter.
FX
0S/FX0/FX0N/FX1S/FX1N/FX1NC/FXU/FX2C/FX2N/FX2NC PLCs do not support this function.
1. In FX3U/FX3UC PLCs
Counter No.When using software counter as hardware counterDescription
M8388
M8390
• The counting input changes from X000 to X006.
C244(OP)
C245(OP)
M8388
CC244
K
CC245
K
OUT_C_32
ENENO
CCoil
CValue
M8391
OUT_C_32
ENENO
CCoil
CValue
• The reset input is not provided.
• The start input is not provided.
• It operates as a hardware counter.
• The counting input changes from X002 to X007.
• The reset input is not provided.
• The start input is not provided.
• It operates as a hardware counter.
2 Devices in Detail
2.7 High Speed Counter [C]
C248(OP)
C253(OP)
M8388
M8388
CC248
K
CC253
K
M8392
OUT_C_32
ENENO
CCoil
CValue
M8392
OUT_C_32
ENENO
CCoil
CValue
• The reset input is not provided.
• It operates as a hardware counter.
• The reset input is not provided.
• It operates as a software counter.
80
Page 83
FXCPU Structured Programming Manual
[Device & Common]
2. In FX3G/FX3GC PLCs
Counter No.
C248(OP)• The reset input is not provided.
When using assignment of counter input terminal and
switching of function
M8388
CC248
K
M8392
OUT_C_32
ENENO
CCoil
CValue
2 Devices in Detail
2.7 High Speed Counter [C]
Description
1
Device Outline
2
Devices in
Detail
C253(OP)• The reset input is not provided.
C254(OP)
3. In FX
Counter No.
C248(OP)• The reset input is not provided.
3S PLCs
M8388
M8392
OUT_C_32
ENENO
CC253
K
M8388
CC254
K
When using assignment of counter input terminal and
switching of function
M8388
CC248
K
CCoil
CValue
M8395
OUT_C_32
ENENO
CCoil
CValue
M8392
OUT_C_32
ENENO
CCoil
CValue
• The input counting (2-phase 2-counting) changes
as follows:
Phase A: Changes from X000 to X006.
Phase B: Changes from X001 to X007.
• The reset input is not provided.
• The start input is not provided.
Description
3
Specified the
Device &
Constant
4
Special Device
5
Errors
6
Types and
Setting of
Parameters
7
Other Functions
M8388
M8392
C253(OP)• The reset input is not provided.
CC253
K
OUT_C_32
ENENO
CCoil
CValue
81
Page 84
FXCPU Structured Programming Manual
[Device & Common]
2 Devices in Detail
2.7 High Speed Counter [C]
2.7.8How to use 2-phase 2-counting input counters C251 to C255 for 4-edge counting
2-phase 2-counting input counters C251 to C255 usually executes 1-edge counting, but can be used for 4edge counting by the programs shown in the table below.
FX
0S/FX0/FX0N/FX1S/FX1N/FX1NC/FXU/FX2C/FX2N/FX2NC/FX3S/FX3G/FX3GC PLCs do not support this
function.
Counter No.When using 2-phase 2-counting input counter for 4-edge countingDescription
M8000
M8198
C251
C252
C253
C253(OP)
C254
M8000
M8000
M8000
M8388
M8000
CC251
K
CC252
K
CC253
K
CC253
K
CC254
K
OUT_C_32
ENENO
CCoil
CValue
M8198
OUT_C_32
ENENO
CCoil
CValue
M8199
OUT_C_32
ENENO
CCoil
CValue
M8199
M8392
OUT_C_32
ENENO
CCoil
CValue
M8198
OUT_C_32
ENENO
CCoil
CValue
1-edge counting (before change)
Phase A
+1
+1
Phase B
Up-counting
Phase A
-1
-1
Phase B
Down-counting
4-edge counting (after change)
+1 +1 +1 +1 +1
Phase A
Phase B
+1 +1 +1 +1
Up-counting
-1 -1 -1 -1 -1
Phase A
Phase B
-1 -1 -1 -1
Down-counting
82
C255
M8000
CC255
K
M8199
OUT_C_32
ENENO
CCoil
CValue
Page 85
FXCPU Structured Programming Manual
[Device & Common]
2 Devices in Detail
2.7 High Speed Counter [C]
2.7.9Condition under which hardware counters are handled as software counters
High speed counters are classified into hardware counters and software counters. Under some conditions,
however, hardware counters are handled as software counters.
In this case, use such counters within the range of maximum response frequency and total frequency
determined for software counters.
Conditions under which hardware counters are handled as software counters
Counter No.Conditions under which hardware counters are handled as software counters
Because hardware counters execute counting at the hardware level of the PLC, they can execute counting
without regard to the total frequency.
However, they are handled as software counters in the following conditions.In this case, the maximum
response frequency and total frequency are restricted in the same way as other software counters.
Use M8380 to M8387 to know whether high speed counters are handled as hardware counters or software
counters (only in FX3U/FX3UC PLCs).
• When the DHSCS, DHSCR, DHSZ or DHSCT instruction is used for a hardware counter number, the
corresponding hardware counter is handled as a software counter.
(FX2N/FX2NC PLCs do not support the DHSCT instruction.)
Example: C235
In this case, C235 is handled as a software counter.
• When an index register is used for a counter number specified in the DHSCS, DHSCR, DHSZ or DHSCT
instruction, all hardware counters are handled as software counters (only in FX3U/FX3UC PLCs).
Example: C235Z0
CN235Z0
• C253 (hardware counter) is handled as a software counter when the logic is reversed using the external
reset input signal logic change function (only in FX
Example: When the logic of the external reset input signal is reversed for C253
→ For reverse of the logic of the external reset input signal, refer to Subsection 2.7.6.
1
Device Outline
2
Devices in
Detail
3
Specified the
Device &
Constant
4
Special Device
5
Errors
6
Types and
Setting of
Parameters
7
Other Functions
M8388
CC253
K
M8389
OUT_C_32
ENENO
CCoil
CValue
83
Page 86
FXCPU Structured Programming Manual
[Device & Common]
2.7.10 Response frequency of high speed counters
1. Response frequency of hardware counters
The tables below show the maximum response frequency of hardware counters.
When hardware counters are handled as software counters in some operating conditions, their maximum
response frequency becomes equivalent to that of software counters, and they are subject to restriction of the
total frequency.
→ For conditions under which hardware counters are handled as software counters, refer to the
1) In FX
2-phase 2-counting input
3U/FX3UC PLCs
Counter No.
1-phase 1-counting input
1-phase 2-counting inputC246, C248(OP)100kHz
1-edge counting
4-edge counting50kHz100kHz
C235, C236, C237, C238, C239, C240100kHz
C251, C253
2 Devices in Detail
2.7 High Speed Counter [C]
previous page.
Maximum response frequency
Main unitFX3U-4HSX-ADP
200kHzC244(OP), C245(OP)10kHz
50kHz100kHz
2) In FX
2N/FX2NC PLCs
Counter No.
1-phase 1-counting inputC235, C23660kHz
1-phase 2-counting inputC24660kHz
2-phase 2-counting inputC25130kHz
2. Response frequency and total frequency of software counters
The tables below show the maximum response frequency and total frequency of software counters.
When the DHSZ or DHSCT instruction is used in a program, both the maximum response frequency and the
total frequency are restricted for all software counters without regard to operands of the instruction.
While examining a system or creating a program, consider the restrictions, and use software counters within
the allowable range of maximum response frequency and total frequency.
→ For conditions under which hardware counters are handled as software counters, refer to the
3U/FX3UC PLCs
3U/3UC Series special function blocks/units are not connected
Counter type
Software
counter
-
,
,
,
Following
software
counter
combined with
DHSCS, DHSCR,
DHSZ or DHSCT
instruction
C235, C236
C237, C238
C239, C240
C244(OP)
C245(OP)
C246, C248(OP)×14030
C251
,
C253
*1
,
,
,
Maximum
frequency
Magnification for
calculating total frequency
×140
×11010
×14030
×4107.5
Response frequency and total frequency according to instructions used
When DHSZ and
DHSCT instructions
are not used
response
(kHz)
Total
frequency
(kHz)
When only DHSCT
instruction is used
Maximum
response
frequency
(kHz)
30
80
DHSCT instruction, all hardware counters switch to software counters.
1-phase
1-counting
input
1-phase
2-counting
input
2-
count-
phase
2-
count-
ing
input
count-
1) In FX
• When special analog adapters and FX
C241, C242,
C243, C244,
C245
C247, C248,
C249, C250
1-
edge
C252
ing
C253(OP)
C254
4-
C255
edge
ing
*1.When index registers are added to a counter number specified by the DHSCS, DHSCR, DHSZ or
*2.High speed counters C244 (OP) and C245 (OP) can count at up to 10 kHz.
Total
frequency
(kHz)
60
Maximum response frequency
When only DHSZ
instruction is used
Maximum
response
frequency
(kHz)
40 - (Num-
ber of times
of using
instruc-
tions)
(40 - Num-
ber of times
of using
instruc-
tions) / 4
*2
frequency
(kHz)
80 - 1.5 ×
(Number of
times of
instruc-
tions)
Total
using
Main unit
previous page.
When both DHSZ and
DHSCT instructions
are used
Maximum
response
frequency
(kHz)
30 - (Num-
ber of times
of using
instruc-
tions)
(30 - Num-
ber of times
of using
instruc-
tions) / 4
*2
Total
frequency
(kHz)
60 - 1.5 ×
(Number
of times of
using
instruc-
tions)
84
Page 87
FXCPU Structured Programming Manual
[Device & Common]
• When special analog adapters and FX3U/3UC Series special function blocks/units are connected
Counter type
When DHSZ and
DHSCT instructions
are not used
Maximum
response
frequency
Magnification for
(kHz)
calculating total frequency
×130
×11010
×13025
×47.56.2
1-phase
1-counting
input
1-phase
2-counting
input
2-
count-
phase
2-
count-
ing
input
count-
Following
software
counter
combined with
DHSCS, DHSCR,
DHSZ or DHSCT
instruction
C235, C236
C237, C238
C239, C240
C244(OP)
C245(OP)
C246, C248(OP)×13025
,
C251, C253
*1
,
,
,
1-
edge
ing
4-
edge
ing
Software
counter
C241, C242,
C243, C244,
C245
-
C247, C248,
C249, C250
C252
,
C253(OP)
C254
,
C255
*1.When index registers are added to a counter number specified by the DHSCS, DHSCR, DHSZ or
DHSCT instruction, all hardware counters switch to software counters.
*2.High speed counters C244 (OP) and C245 (OP) can count at up to 10 kHz.
2 Devices in Detail
2.7 High Speed Counter [C]
Response frequency and total frequency according to instructions used
When both DHSZ and
DHSCT instructions
are used
Maximum
response
frequency
(kHz)
25 - (Num-
ber of times
of using
instruc-
*2
tions)
(25 - Num-
ber of times
of using
instruc-
tions) / 4
Total
frequency
(kHz)
60
When only DHSCT
instruction is used
Maximum
response
frequency
(kHz)
25
Total
frequency
(kHz)
50
When only DHSZ
instruction is used
Maximum
response
frequency
(kHz)
30 - (Num-
ber of times
of using
instruc-
tions)
(30 - Num-
ber of times
of using
instruc-
tions) / 4
*2
frequency
(kHz)
50 - 1.5 ×
(Number of
times of
instruc-
tions)
Total
using
Total
frequency
(kHz)
50 - 1.5 ×
(Number
of times of
using
instruc-
tions)
Constant
1
Device Outline
2
Devices in
Detail
3
Specified the
Device &
4
Special Device
5
Errors
• Calculation of the total frequency
Total frequency ≥ Sum of "Response frequency of high speed counter × Magnification for calculating total
frequency"
• Calculation example
When only the DHSZ instruction is used 6 times in a program, the total frequency is calculated as follows in
accordance with the columns for "When only DHSZ instruction is used" shown in the table above.
This calculation example is provided for a system configuration not including special analog adapters and
FX
3U/FX3UC Series special function blocks/units.
Used high speed counter No.
C237
C241
C253(OP)
[4-edge counting]
Operates as software
counter.
Software counter
Input
frequency
30kHz40 - 6 (times) = 34 kHz×1
20kHz40 - 6 (times) = 34 kHz×1
4kHz{40 - 6 (times)} / 4 = 8.5 kHz×4
Maximum response
frequency calculation
Magnification for
calculating total
frequency
Used
instruction
DHSZ instruc-
tion × 6 times
1) The total frequency is calculated as follows because the DHSZ instruction is used 6 times:
Total frequency = 80 - 1.5 × 6 = 71 kHz
2) The sum of the response frequency of used high speed counters is
calculated as follows:
<Counter No.> <Contents of use>
C235 (1-phase 1-counting) : 50 kHz is input.
C236 (1-phase 1-counting) : 50 kHz is input.
C237 (1-phase 1-counting) : 10 kHz is input.
C253 (2-phase 2-counting) : 5 kHz is input.
Total 115 kHz 120 kHz (Overall frequency)
5
Errors
6
Types and
Setting of
Parameters
7
Other Functions
87
Page 90
FXCPU Structured Programming Manual
[Device & Common]
4) In FX1S/FX1N/FX1NC PLCs
2 Devices in Detail
2.7 High Speed Counter [C]
Counter type
1-phase
1-counting
input
1-phase
2-counting
input
2-phase
2-counting
input
Response frequency and total frequency according to instructions used
When DHSCS and DHSCR instructions are not usedWhen DHSCS and DHSCR instructions are used
Software
counter
C235 to C245 ×1
C246 to C250 ×1
C251 to C255 ×2
Maximum response frequency (kHz)
Magnification for
calculating total frequency
C235, C236, C246(1-phase)
C251(2-phase):30
C237 to C245, C247 to C250(1-phase) :10
C252 to 255(2-phase):5
*1
Total
frequency
(kHz)
60
Maximum response frequency (kHz)
C235, C236, C246(1-phase)
C251(2-phase):30
C237 to C245, C247 to C250(1-phase) :10
C252 to 255(2-phase):5
*1
*1.The maximum response frequency is 60 kHz.
When using two or more high speed counters or when combining a high speed counter and the SPD,
PLSY or PLSR instruction, make sure that the sum of the processing frequency does not exceed the total
frequency shown above.
Calculation example (When the DHSCS and DHSCR instructions are not used)
Total frequency = 60 kHz
Sum of processing frequency = 30 kHz + 10 kHz + 10 kHz = 50 kHz
Sum of processing frequency (50 kHz) ≤ Total frequency (60 kHz)
88
Page 91
FXCPU Structured Programming Manual
[Device & Common]
5) In FX2N/FX2NC PLCs
2 Devices in Detail
2.7 High Speed Counter [C]
1
Device Outline
1-phase
1-counting
input
1-phase
2-counting
input
2-phase
2-counting
input
Counter type
Following
Software
counter
C237 to C245 C235, C236×110
C247 to C250 C246×110 105.5
C252 to C255 C251×25
software counter
combined with
DHSCS, DHSCR
or DHSCZ
instruction
Magnification
for calculating
total frequency
Response frequency and total frequency according to instructions used
When DHSCS, DHSCR
and DHSCZ
instructions are not
used
Maximum
response
frequency
(kHz)
Total
frequency
(kHz)
20
When only DHSCS and
DHSCR instructions are
frequency (kHz)
C252 to C255:4
Maximum
response
10
C251:5
used
Total
frequency
(kHz)
11
When only DHSCZ
instruction is used
Maximum
response
frequency
(kHz)
5.5
4
frequency
Total
(kHz)
5.5
When using two or more high speed counters or when combining a high speed counter and the SPD,
PLSY or PLSR instruction, make sure that the sum of the processing frequency does not exceed the total
frequency shown above.
Calculation example (When the DHSCS, DHSCR and DHSZ instructions are not used)
(Not required to be added
because C235 is handled as
hardware counter)
Calculated value
(Not required to be added
because C235 is handled as
hardware counter)
Constant
Parameters
2
Devices in
Detail
3
Specified the
Device &
4
Special Device
5
Errors
6
Types and
Setting of
Total frequency = 20 kHz
Sum of processing frequency = 3 kHz + 4 kHz + 7 kHz + 4 kHz = 18 kHz
Sum of processing frequency (18 kHz) ≤ Total frequency (20 kHz)
7
Other Functions
89
Page 92
FXCPU Structured Programming Manual
[Device & Common]
6) In FXU/FX2C PLCs
The maximum response frequency of high speed counters C235 to C255 is generally as follows (when
the DHSCS and DHSCR instructions are not used or not driven):
Sum of frequency of 1-phase counters + (Sum of frequency of 2-phase counters) × 4 ≤ 20 kHz
maximum
However, the actual maximum response frequency varies depending on used counters and DHSCS,
DHSCR and DHSZ instructions.
The table below shows the maximum response frequency of each counter. Do not exceed the values
shown below.
(Each value indicates the maximum response frequency of one high speed counter.)
2 Devices in Detail
2.7 High Speed Counter [C]
Combination of
high speed
counters
Counter No. when up to three 1-phase counters are
When only 1phase counters
are used
When one 2phase counter (1
kHz or less) and
one to four 1phase counters
are used
When only 2phase counters
are used
Number of 1-
phase counters
driven
simultaneously
1-107.07.05.05.04.0
2-10[A]3.54.0[B]2.52.51.5
3- 6.62.52.52.02.51.5
4-2.51.51.5
5-2.51.51.5
6-2.51.51.0
115.04.03.0
214.02.01.0
313.02.01.0
412.01.01.0
-12.02.02.0
-22.01.51.3
Number of 2-
phase counters
simultaneously
driven simultaneously→
driven
When DHSCS, DHSCR and
DHSZ instructions are not
used or not driven
Maximum response frequency of 1-phase counters
C235, C237,
C238
C236, C239,
C240
Maximum response frequency of 2-phase counters (kHz)
DHSCS, DHSCR
C235, C237,
C238
C236, C239,
C240
When one or two DHSZ
instructions are driven
C235, C237,
C238
C236, C239,
C240
1) The maximum response frequency of counters changes when the DHSCS, DHSCR and DHSZ
instructions are used.
For example, the maximum response frequency of C235 and C237 driven at the same time is 10
kHz (part A), but decreases to 4 kHz (part B) respectively when the DHSCS and DHSCR
instructions are driven at the same time.
2) When the DHSCS, DHSCR and DHSZ instructions are driven at the same time, the maximum
response frequency is equivalent to the maximum response frequency when the DHSZ instruction
is driven.
90
Page 93
FXCPU Structured Programming Manual
[Device & Common]
7) In FX0/FX0N PLCs
2 Devices in Detail
2.7 High Speed Counter [C]
1
Device Outline
Counter type
1-phase
1-counting
input
1-phase
2-counting
input
2-phase
2-counting
input
Software
counter
C235 to C238,
C241 to C242,
C244
C246 to C247,
C249
C251 to C252,
C254
Magnification for
calculating total
frequency
×15
×15
×12
Maximum
response
frequency (kHz)
Total frequency
(kHz)
5
It is not allowed to use 1-phase counters and 2-phase counters together.
Total frequency = 14 kHz
Sum of processing frequency = 3 kHz + 3 kHz + 4 kHz = 10 kHz
Sum of processing frequency (10 kHz) ≤ Total frequency (14 kHz)
6
Types and
Setting of
7
Other Functions
91
Page 94
FXCPU Structured Programming Manual
[Device & Common]
2.7.11 Cautions on use
• For a contact to drive the coil of a high speed counter, use a contact which is normally ON during high
speed counting.
Example : M8000(RUN monitor)
OUT_C_32
ENENO
CC235
K
Program a contact which is
normally ON during counting.
• If the operation of a high speed counter is triggered by a device equipped with a contact such as simulation
switch, the counter may malfunction due to noise generated by chattering of the switch.
• The input filter of input terminals in the PLC main unit used for high speed counters are automatically set
as follows:
3U/FX3UC PLCs: 5 µs (X000 to X005) or 50 µs (X006 and X007)
FX
3G/FX3GC PLCs: 10 µs (X000, X001, X003 and X004) or 50 µs (X002 and X005 to X007)
FX
3S PLC: 10 µs (X000 and X001) or 50 µs (X002 to X007)
FX
1S/FX1N/FX1NC/FX2N/FX2NC PLCs: 20 µs (X000 and X001) or 50 µs (X002 to X005)
FX
0S/FX0/FX0N/FXU/FX2C PLCs: 50 µs (X000 to X003 or X005)
FX
Accordingly, it is not necessary to use the REFF instruction or special data register D8020 (input filter
adjustment).
The input filter of input relays not used for high speed counters remain 10 ms (initial value).
• Inputs X000 to X007 (X003) are used for high speed counters, input interrupt, pulse catch, SPD/DSZR/
DVIT/ZRN instructions and general-purpose inputs.
Make sure to use each input terminal only once.
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 input pulse is not provided, none of high speed counter output contacts does not turn ON
even if the PLC executes an instruction in the status "Current value = Set value".
• Counting can be started or stopped in 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 circuit, subroutine or interrupt routine, counting cannot be
started or stopped until the step ladder or routine is executed.
Make sure that the signal input to a high speed counter does not exceed the response frequency described
•
above.
If an input signal exceeds the response frequency, a WDT error or parallel link (communication)
malfunction may occur.
• The response frequency changes depending on number of used counters, but the input filter value is fixed.
Note that noise above the response frequency may be counted depending on the filter value of the used input.
• When a high speed counter is reset by the RST instruction, it cannot execute counting until driving of the
RST instruction is set to OFF.
1) Program example
X010
CCoil
CValue
RST
ENENO
2 Devices in Detail
2.7 High Speed Counter [C]
Input number corresponding to C235
X000
CC235
K
d
CC235
OUT_C_32
ENENO
CCoil
CValue
92
2) Timing chart
X000
Current value
of C235
X010
RST
C235
The current value does not change even
3
2
1
if pulses are input because the C235
reset instruction is valid.
C235 remains reset.
Driving of "RST C235" is set to ON
because the contact turns ON.
1
Driving of "RST C235" is set to OFF
because the contact turns OFF.
3
2
Page 95
FXCPU Structured Programming Manual
[Device & Common]
• Write the following program "to reset only the current value of a high speed counter (and not to turn OFF
the contact)".
1) Program example
*1
LDP
ENENO
X010
ssd
*1.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.
2) Timing chart
X000
ENENO
K0CN235
The current value of C235 is cleared (to "0").
DMOV
2 Devices in Detail
2.7 High Speed Counter [C]
Constant
1
Device Outline
2
Devices in
Detail
3
Specified the
Device &
4
3
Current value
of C235
X010
Because X010 turns ON,
"FNC12 DMOV" is executed.
The current value of C235
is reset to "0".
1
3
2
2
1
Because the driving contact is the pulse execution type,
C235 executes counting normally after that.
• Write the following program "to turn OFF the contact and reset the current value of a high speed counter".
1) Program example
*1
X010
LDP
ENENO
sd
M8001
RUN monitor
(Normally OFF)
RST
ENENO
RST
ENENO
- - - - - A)
CN235
d
- - - - - B)
CN235
*1.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.
2) Timing chart
4
Special Device
5
Errors
6
Types and
Setting of
Parameters
7
Other Functions
X000
4
3
Because the reset status is
cleared, C235 executes counting.
Current value
of C235
X010
RST
C235
Counter is reset (part A)
in above program).
1
3
2
2
1
Driving of counter reset is set to OFF
(part B) in above program).
• For writing the symbolic information and changing the set values of timers and counters using a peripheral
equipment, it is recommended to create programs with the set values specified indirectly.
If the set values are specified directly, programs cannot be restored from the symbolic information after the
set values are changed.
93
Page 96
FXCPU Structured Programming Manual
[Device & Common]
2.8Data Register and File Register [D]
Data registers store numeric values. File registers are handled as initial values of data registers.
FX
0S and FX0 are not applicable to file registers.
Each data register or file register stores 16-bit data (whose most significant bit specifies the positive or
negative sign). Two data registers or file registers combined can store 32-bit data (whose most significant bit
specifies the positive or negative sign).
→ For the functions and operations of file registers, refer to Subsection 2.8.4.
2.8.1Numbers of data registers and file registers
The tables below show data register and file register [D] numbers. (Numbers are assigned in decimal.)
1. In FX3S/FX3G/FX3GC/FX3U/FX3UC PLCs
Data registers
Fixed latched
(battery backed-up)
type
D512 to D7999
7488 points
*3*4
FX3U/FX3UC
PLCs
General type
D0 to D199
200 points
*1
Latched (battery
backed-up) type
D200 to D511
312 points
*2
Special type
D8000 to D8511
512 points
*3
2 Devices in Detail
2.8 Data Register and File Register [D]
File registers (latched (battery
backed-up) type)
D1000*4 and later
7000 points maximum
Data registers
File registers (latched (EEPROM
backed-up) type)
D1000*4 and later
7000 points maximum
File registers (latched (EEPROM
backed-up) type)
D1000*4 and later
2000 points maximum
FX3G/FX3GC
PLCs
FX3S PLC
General type
D0 to D127
128 points
General type
D0 to D127
128 points
*3
Fixed latched
(EEPROM backed-
up) type
D128 to D1099
972 points
Fixed latched
(EEPROM backed-
up) type)
D128 to D255
128 points
*3
Data registers
General typeSpecial type
D1100 to D7999
6900 points
General typeSpecial type
D256 to D2999
2744 points
*5
D8000 to D8511
512 points
D8000 to D8511
512 points
*3
*1.This area is not latched, but can be changed to the latched (backed-up) area by parameter setting.
*2.This area is latched, but can be changed to the non-latched (non-backed-up) area by parameter
setting.
*3.The characteristics about latch (battery backup) cannot be changed using parameters.
*4.Data registers D1000 and later can be used as file registers in units of 500 points by parameter
setting.
*5.This area can be changed to the latched (battery backed-up) area by parameter setting while an
optional battery is attached, but the latched (battery backed-up) range cannot be specified.
When simple N:N link or parallel link is used, some data registers are occupied for the link.
→ Refer to the data communication manual.
94
Page 97
FXCPU Structured Programming Manual
[Device & Common]
2. In FX1S/FX1N/FX1NC/FX2N/FX2NC PLCs
Latched
General type
FX1S PLCs
FX1N/FX1NC
PLCs
FX2N/FX2NC
PLCs
D0 to D127
128 points
D0 to D127
128 points
D0 to D199
200 points
*1.This area is not latched, but can be changed to the latched (backed-up) area by parameter setting.
*2.This area is latched, but can be changed to the non-latched (non-backed-up) area by parameter
setting.
*3.The characteristics about latch (backup) cannot be changed using parameters.
*4.Data registers D1000 and later can be used as file registers in units of 500 points by parameter
setting.
When simple N:N link or parallel link is used, some data registers are occupied for the link.
(battery
backed-up)
*3
*3
D200 to D511
*1
312 points
type
--
--
D512 to D7999
*2
7488 points
Data registers
Fixed latched (battery backed-up) type
Battery
backed-up
EEPROM
backed-up
D128 to D255
128 points
D128 to D255
128 points
*3
Capacitor
backed-up
*3
D256 to D7999
*3
7744 points
--
→ Refer to the data communication manual.
2 Devices in Detail
2.8 Data Register and File Register [D]
1
Device Outline
File registers
Special type
-
D8000 to D8255
256 points
D8000 to D8255
*3
256 points
D8000 to D8255
256 points
(latched (battery
backed-up) type)
D1000*4 and later
1500 points maximum
D1000*4 and later
7000 points maximum
D1000*4 and later
7000 points maximum
Constant
2
Devices in
Detail
3
Specified the
Device &
4
Special Device
3. FX0S/FX0/FX0N/FXU/FX2C PLCs
Data registers
Fixed latched
(backed-up) type
D30, 31
*3
2 points
D128 to D255
128 points
D512 to D999
488 points
*3
*3
-
Special type
D8000 to D8069
27 points
D8000 to D8129
38 points
D8000 to D8137
85 points
D8000 to D8135
69 points
FX0/FX0S
PLCs
FX0N
PLCs
FXU/FX2C
PLCs
FXU PLCs
(Ver. 2.30 or
earlier)
(Reference)
General type Latched (backed-up) type
D0 to D29
30 points
D0 to D127
128 points
D0 to D199
200 points
*4
*4
*1
Master→Slave:D490 to D499
Slave→Master:D500 to D509
-
-
D200 to D511
312 points
*2
For link
*1.This area is not latched, but can be changed to the latched (backed-up) area by parameter setting.
*2.This area is latched, but can be changed to the non-latched (non-backed-up) area by parameter
setting.
*3.This area is fixed to the latched (backed-up) type (, and the contents can be cleared by the RST and
ZRST instructions).
*4.This area is fixed to the non-latched (non-backed-up) type (, and the characteristics about latch
(backup) cannot be changed).
*5.Data registers D1000 and later can be used as file registers in units of 500 points by parameter
setting.
*6.Data registers D6000 to D7999 can be used as file registers by driving the special auxiliary relay
M8074 and prohibiting sampling trace.
Different from file registers secured inside the program memory, D6000 to D7999 are secured inside
the system memory of the PLC, and may be called "RAM file registers" (to notify that they are the
latched type).
File registers
-
D1000*5 and later
1500 points maximum
D1000*5 and later
2000 points maximum
D6000 to D7999
2000 points(RAM file)
-
5
Errors
6
Types and
Setting of
Parameters
*6
7
Other Functions
95
Page 98
FXCPU Structured Programming Manual
r
r
[Device & Common]
2.8.2Structure of data registers and file registers
1) 16-bit type
One (16-bit) data register or file register can store a numeric value within the range from -32768 to
+32767.
2 Devices in Detail
2.8 Data Register and File Register [D]
4,096
8,192
2,048
D 0(16-bit type)
64
128
256
512
1,024
32
16
1010101010101010
b0
1
2
4
8
High orderLow orde
b15
Sign
0 : Positive
1 : Negative
16,384
A numeric value can be read from or written to a data register by an 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.
2) 32-bit type
Two serial data registers or file registers can express 32-bit data.
- A data register having a larger device number handles high-order 16 bits, and a data register having a
smaller device number handles low-order 16 bits.
- In the index type, V handles high-order 16 bits, and Z handles low-order 16 bits.
- Two serial data registers or file registers can store a numeric value within the range from -2,147,483,648
to +2,147,483,647.
High orderLow orde
b31b0
Sign
0 : Positive
1 : Negative
D 1(High-order 16 bits)D 0(Low-order 16 bits)
1010101010101010
1,024
2,048
4,096
8,192
16,384
32,768
65,536
131,072
262,144
524,288
1,048,576
2,097,152
4,194,304
8,388,608
16,777,216
33,554,432
67,108,864
134,217,728
268,435,456
536,870,912
1,073,741,824
512
256
128
64
32
16
0000111100001111
1
2
4
8
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.
2.8.3Functions and operation examples of data registers
Data registers store numeric data.
Each data register stores 16-bit data (whose most significant bit specifies the positive or negative sign). Two
data registers combined can store 32-bit data (whose most significant bit specifies the positive or negative
sign).
1. General type and latched (backed-up) type data registers
• Once data is written to a data register, it does not change unless other data overwrites it.
When the PLC mode switches from "RUN" to "STOP" or when the power is interrupted, however, all data
stored in general type data registers are cleared to "0".
If the special auxiliary relay M8033 has been driven in advance, data are held even when the PLC mode
switches from "RUN" to "STOP".
• Latched (backed-up) type data registers hold their contents even when the PLC mode switches from
"RUN" to "STOP" or when the power is interrupted.
• The contents of data registers are latched (backed up) by a battery, EEPROM, etc. built in the PLC.
→ For details on each backup method, refer to Section 2.6.
• When using fixed latched (backed-up) type data registers as general type registers, provide the following
reset circuit using the RST or ZRST instruction at the head step in a program.
M8002
Initial pulse
ZRST
ENENO
d1
d2
Data stored in D512 to D999 are cleared to "0".
D512
D999
→ For file registers, refer to Subsection 2.8.4.
96
Page 99
FXCPU Structured Programming Manual
[Device & Common]
2. Special type data registers
• Special type data registers store specific data in advance, or receive data for special purpose.
The contents of special data registers are set to their initial values when the power is turned ON.
(Generally, these data registers are cleared to "0" first, and then initial values (if there are any) are written
by the system ROM.)
• For example, the watchdog timer time is set initially to D8000 by the system ROM. To change the contents,
write desired time to D8000 using the transfer instruction MOV.
2 Devices in Detail
2.8 Data Register and File Register [D]
1
Device Outline
2
Devices in
Detail
M8002
Initial pulse
K250
MOV
ENsENO
WDT
ENENO
The watchdog timer is set to 250 ms.
d
D8000
The watchdog timer is refreshed.
→ For the backup characteristics of special data registers, refer to Section 1.2 and Chapter 4.
→ For types and functions of special data registers, refer to Chapter 4.
3. Operation examples
Data registers can be used in various controls handling numeric data.
This paragraph explains representative operation examples among various applications.
For the full use of data registers, refer to the explanation on applied instructions provided later.
1) Specifying the set value of a timer or counter
OUT_T
ENENO
TCoil
TC2
D0
TValue
OUT_C
ENENO
D20
CCoil
CValue
CC10
2) Operation examples using the MOV instruction
a) Changing the current value of a counter
MOV
ENsENO
D5CN2
d
A counter or timer operates while regarding the
contents of a specified data register as its set
value.
The current value of the counter C2 is changed to
the contents of D5.
3
Specified the
Device &
Constant
4
Special Device
5
Errors
6
Types and
Setting of
Parameters
7
Other Functions
b) Reading the current value of a timer or counter
MOV
ENsENO
CN10D4
d
c) Storing a numeric value in data registers
16-bit type
MOV
ENsENO
K200D10
d
32-bit type
DMOV
ENsENO
K80000D10
d
The current value of the counter C10 is transferred
to D4.
"200 (decimal value)" is transferred to D10.
"80000 (decimal value)" is transferred to D10 and
D11.
Because a numeric value larger than "32767" is
32-bit data, a 32-bit operation is required.
When a data register on the low-order side (D10)
is specified, a data register on the high-order side
(D11) is automatically occupied.
97
Page 100
FXCPU Structured Programming Manual
[Device & Common]
d) Transferring the contents of a data register to another data register
MOV
ENsENO
D10D20
3) Using unoccupied timers and counters as data registers
Operation example using the MOV instruction
Timers and counters not used in a program can be used as devices for storing 16-bit or 32-bit numeric
values (data registers).
MOV
ENsENO
K300
MOV
ENsENO
TN10
With regard to 32-bit data, two 16-bit timers or counters (such as C1 and C0) can express 32-bit data in
the same way as data registers.
Each 32-bit counter (such as C200) can handle 32-bit data individually.
2 Devices in Detail
2.8 Data Register and File Register [D]
The contents of D10 are transferred to D20.
d
"300 (decimal value)" is transferred to T10.
d
TN10
The contents of T10 are transferred to the current
d
CN20
value register of C20.
In this case, T10 is not working as a timer, but is
working as a data register.
98
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.