User'S Manual: CP2E CPU Unit Software
User'S Manual: CP2E CPU Unit Software
W614-E1-01
SYSMAC CP Series
CP2E-E
D
-
CP2E-S
D
-
CP2E-N
D
-
CP2E CPU Unit Software
USER’S MANUAL
NOTE
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in
any form, or by any means, mechanical, electronic, photocopying, recording, or otherwise, without the prior
written permission of OMRON.
No patent liability is assumed with respect to the use of the information contained herein. Moreover, because
OMRON is constantly striving to improve its high-quality products, the information contained in this manual is
subject to change without notice. Every precaution has been taken in the preparation of this manual. Neverthe-
less, OMRON assumes no responsibility for errors or omissions. Neither is any liability assumed for damages
resulting from the use of the information contained in this publication.
Trademarks
• Microsoft, Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States
and other countries.
Other company names and product names in this document are the trademarks or registered trademarks of their
respective companies.
Copyrights
Microsoft product screen shots reprinted with permission from Microsoft Corporation.
SYSMAC CP Series
CP2E-E
D
-
CP2E-S
D
-
CP2E-N
D
-
CP2E CPU Unit Software
User’s Manual
Produced September 2019
Introduction
Thank you for purchasing a SYSMAC CP-series CP2E Programmable Controller.
This manual contains information required to use the CP2E. Read this manual completely and be sure
you understand the contents before attempting to use the CP2E.
Intended Audience
This manual is intended for the following personnel, who must also have knowledge of electrical sys-
tems (an electrical engineer or the equivalent).
• Personnel in charge of installing FA systems
• Personnel in charge of designing FA systems
• Personnel in charge of managing FA systems and facilities
Applicable Products
This Manual
CP2E CPU Unit Hardware CP2E CPU Unit Software CP1E/CP2E CPU Unit Instructions
User’s Manual(Cat. No. W613) User’s Manual(Cat. No. W614) Reference Manual(Cat. No. W483)
Mounting and
1 Setting Hardware
· Names and specifications of the parts of all Units
· Basic system configuration for each CPU Unit
· Connection methods for Expansion I/O Units
and Expansion Units
2 Wiring
Connecting
3 Online to the PLC
4 Software Setup
Software setting methods for the CPU
Units (PLC Setup)
Checking and
6 Debugging Operation
· Checking I/O wiring, setting the Auxiliary Area
settings, and performing trial operation
· Monitoring and debugging with the
CX-Programmer
Maintenance and
7 Troubleshooting
The following page structure and icons are used in this manual.
Step in a procedure 1
5-2 Installation
Use a screwdriver to pull down the DIN Track mounting pins from the back of the Units to release
them, and mount the Units to the DIN Track.
Indicates a step in a
procedure.
DIN Track mounting pins
5 Page tab
Release Gives the number
DIN Track
3 Press in all of the DIN Track mounting pins to securely lock the Units in place.
Special Information
(See below.)
Icons are used to indicate
precautions and
additional information. DIN Track mounting pins
This illustration is provided only as a sample and may not literally appear in this manual.
Special Information
Special information in this manual is classified as follows:
Precautions for Safe Use
Precautions on what to do and what not to do to ensure using the product safely.
Additional Information
Additional information to increase understanding or make operation easier.
1 11
2 12
1 Overview 11 High-speed Counters
3 13
Internal Memory
2 in the CPU Unit 12 Pulse Outputs
4 14
Understanding Serial
4 Programming 14 Communications 6 16
7 17
5 I/O Memory 15 Ethernet
8 18
6 I/O Allocation 16 Other Functions
APP
9
Analog
7 PLC Setup 17 Option Board
10
Overview of Built-in
Programming
8 Functions and
Allocations
18 Device Operations
Quick-response
9 Inputs A Appendices
10 Interrupts
Section 1 Overview
1-1 CP2E Overview ........................................................................................................................ 1-2
1-1-1 Overview of Features .................................................................................................................. 1-2
1-2 Basic Operating Procedure .................................................................................................... 1-3
Section 10 Interrupts
10-1 Interrupts ................................................................................................................................ 10-2
10-1-1 Overview ................................................................................................................................... 10-2
10-2 Input Interrupts ...................................................................................................................... 10-3
10-2-1 Overview ................................................................................................................................... 10-3
10-2-2 Flow of Operation...................................................................................................................... 10-4
10-2-3 Application Example.................................................................................................................. 10-8
10-3 Scheduled Interrupts........................................................................................................... 10-10
10-3-1 Overview ................................................................................................................................. 10-10
10-3-2 Flow of Operation.................................................................................................................... 10-11
10-4 Precautions for Using Interrupts........................................................................................ 10-13
10-4-1 Interrupt Task Priority and Order of Execution ........................................................................ 10-13
10-4-2 Related Auxiliary Area Words and Bits ................................................................................... 10-13
10-4-3 Duplicate Processing in each Task ......................................................................................... 10-13
Section 15 Ethernet
15-1 System Configuration and Features .................................................................................... 15-3
15-1-1 Connecting the CX-Programmer to PLCs Online via Ethernet ................................................. 15-4
15-1-2 Exchanging Data between OMRON PLCs using Ethernet ....................................................... 15-5
15-1-3 Creating an Original Communications Procedure Using TCP/IP(UDP/IP) for the Host
Application or Communicating with PLCs from Another Manufacturer ..................................... 15-6
15-1-4 Automatically Adjusting the PLC’s Internal Clock at Regular Intervals ..................................... 15-6
15-2 Specifications ........................................................................................................................ 15-7
15-2-1 General Specifications (Ethernet) ............................................................................................. 15-7
15-2-2 Comparison with Previous Models (Ethernet Related) ............................................................. 15-8
15-3 Basic Setting for Ethernet................................................................................................... 15-10
15-3-1 Overview of Startup Procedure............................................................................................... 15-10
15-3-2 PLC Setup Procedure ............................................................................................................. 15-11
15-3-3 Basic Settings ......................................................................................................................... 15-13
15-3-4 Communications Test.............................................................................................................. 15-15
15-4 FINS Communications ........................................................................................................ 15-16
15-4-1 FINS Communications Service Specifications ........................................................................ 15-16
15-4-2 FINS Communications Service ............................................................................................... 15-17
15-4-3 Procedure for Using FINS/UDP, FINS/TCP............................................................................. 15-17
15-4-4 PLC Setup for FINS/UDP and FINS/TCP Applications .......................................................... 15-18
15-4-5 Auxiliary Area Allocations........................................................................................................ 15-22
15-4-6 New FINS Commands ............................................................................................................ 15-22
15-4-7 CMND/SEND/RECV Instructions ............................................................................................ 15-34
15-4-8 Restrictions When Using FINS Communication Services....................................................... 15-35
15-5 Socket Services ................................................................................................................... 15-36
15-5-1 Overview of Socket Service .................................................................................................... 15-36
15-5-2 Procedure for Using Socket Service Functions....................................................................... 15-36
15-5-3 Socket Services and Socket Status ........................................................................................ 15-37
15-5-4 PLC Setup for Socket Services .............................................................................................. 15-38
15-5-5 Auxiliary Area Allocations........................................................................................................ 15-39
15-5-6 Data Memory Area Allocations ............................................................................................... 15-42
15-5-7 Socket/TCP Programming Example........................................................................................ 15-50
Section A Appendices
A-1 Instruction Functions ..............................................................................................................A-2
A-1-1 Sequence Input Instructions .......................................................................................................A-2
A-1-2 Sequence Output Instructions.....................................................................................................A-3
A-1-3 Sequence Control Instructions ....................................................................................................A-5
A-1-4 Timer and Counter Instructions...................................................................................................A-7
A-1-5 Comparison Instructions ...........................................................................................................A-10
A-1-6 Data Movement Instructions .....................................................................................................A-12
A-1-7 Data Shift Instructions...............................................................................................................A-15
A-1-8 Increment/Decrement Instructions ............................................................................................A-18
A-1-9 Symbol Math Instructions..........................................................................................................A-19
A-1-10 Conversion Instructions.............................................................................................................A-24
A-1-11 Logic Instructions ......................................................................................................................A-28
A-1-12 Special Math Instructions..........................................................................................................A-29
A-1-13 Floating-point Math Instructions ................................................................................................A-29
A-1-14 Table Data Processing Instructions...........................................................................................A-32
A-1-15 Data Control Instructions ..........................................................................................................A-33
A-1-16 Subroutine Instructions .............................................................................................................A-37
A-1-17 Interrupt Control Instructions.....................................................................................................A-38
A-1-18 High-speed Counter/Pulse Output Instructions.........................................................................A-39
A-1-19 Step Instructions .......................................................................................................................A-50
A-1-20 Basic I/O Unit Instructions.........................................................................................................A-50
A-1-21 Serial Communications Instructions..........................................................................................A-54
A-1-22 Network Instructions .................................................................................................................A-55
A-1-23 Clock Instructions......................................................................................................................A-56
A-1-24 Failure Diagnosis Instructions ...................................................................................................A-57
A-1-25 Other Instructions......................................................................................................................A-57
A-2 Auxiliary Area Allocations by Address................................................................................A-58
A-2-1 Read-only Words ......................................................................................................................A-58
A-2-2 Read/Write Words.....................................................................................................................A-82
A-3 Response Performance.........................................................................................................A-99
A-3-1 I/O Response Time ...................................................................................................................A-99
A-3-2 Interrupt Response Time ........................................................................................................A-101
A-3-3 Serial PLC Link Response Performance.................................................................................A-102
A-3-4 Pulse Output Start Time..........................................................................................................A-103
A-3-5 Pulse Output Change Response Time....................................................................................A-103
A-4 PLC Operation for Power Interruptions .............................................................................A-104
A-5 Memory Map ........................................................................................................................A-107
A-6 Ethernet Functions ..............................................................................................................A-109
A-6-1 TCP Status Transitions............................................................................................................A-109
A-6-2 Ethernet Network Parameters.................................................................................................A-110
A-6-3 Buffer Configuration ................................................................................................................A-110
Index ......................................................................................................................................... 1-1
Revision History ......................................................................................................... Revision-1
Warranties
z Exclusive Warranty
Omron’s exclusive warranty is that the Products will be free from defects in materials and workman-
ship for a period of twelve months from the date of sale by Omron (or such other period expressed in
writing by Omron). Omron disclaims all other warranties, express or implied.
z Limitations
OMRON MAKES NO WARRANTY OR REPRESENTATION, EXPRESS OR IMPLIED, ABOUT
NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OF
THE PRODUCTS. BUYER ACKNOWLEDGES THAT IT ALONE HAS DETERMINED THAT THE
PRODUCTS WILL SUITABLY MEET THE REQUIREMENTS OF THEIR INTENDED USE.
Omron further disclaims all warranties and responsibility of any type for claims or expenses based
on infringement by the Products or otherwise of any intellectual property right.
z Buyer Remedy
Omron’s sole obligation hereunder shall be, at Omron’s election, to (i) replace (in the form originally
shipped with Buyer responsible for labor charges for removal or replacement thereof) the non-com-
plying Product, (ii) repair the non-complying Product, or (iii) repay or credit Buyer an amount equal
to the purchase price of the non-complying Product; provided that in no event shall Omron be
responsible for warranty, repair, indemnity or any other claims or expenses regarding the Products
unless Omron’s analysis confirms that the Products were properly handled, stored, installed and
maintained and not subject to contamination, abuse, misuse or inappropriate modification. Return of
any Products by Buyer must be approved in writing by Omron before shipment. Omron Companies
shall not be liable for the suitability or unsuitability or the results from the use of Products in combi-
nation with any electrical or electronic components, circuits, system assemblies or any other materi-
als or substances or environments. Any advice, recommendations or information given orally or in
writing, are not to be construed as an amendment or addition to the above warranty.
Suitability of Use
Omron Companies shall not be responsible for conformity with any standards, codes or regulations
which apply to the combination of the Product in the Buyer’s application or use of the Product. At
Buyer’s request, Omron will provide applicable third party certification documents identifying ratings
and limitations of use which apply to the Product. This information by itself is not sufficient for a com-
plete determination of the suitability of the Product in combination with the end product, machine, sys-
tem, or other application or use. Buyer shall be solely responsible for determining appropriateness of
the particular Product with respect to Buyer’s application, product or system. Buyer shall take applica-
tion responsibility in all cases.
NEVER USE THE PRODUCT FOR AN APPLICATION INVOLVING SERIOUS RISK TO LIFE OR
PROPERTY OR IN LARGE QUANTITIES WITHOUT ENSURING THAT THE SYSTEM AS A WHOLE
HAS BEEN DESIGNED TO ADDRESS THE RISKS, AND THAT THE OMRON PRODUCT(S) IS
PROPERLY RATED AND INSTALLED FOR THE INTENDED USE WITHIN THE OVERALL EQUIP-
MENT OR SYSTEM.
Programmable Products
Omron Companies shall not be responsible for the user’s programming of a programmable Product, or
any consequence thereof.
Disclaimers
Performance Data
Data presented in Omron Company websites, catalogs and other materials is provided as a guide for
the user in determining suitability and does not constitute a warranty. It may represent the result of
Omron’s test conditions, and the user must correlate it to actual application requirements. Actual perfor-
mance is subject to the Omron’s Warranty and Limitations of Liability.
Change in Specifications
Product specifications and accessories may be changed at any time based on improvements and other
reasons. It is our practice to change part numbers when published ratings or features are changed, or
when significant construction changes are made. However, some specifications of the Product may be
changed without any notice. When in doubt, special part numbers may be assigned to fix or establish
key specifications for your application. Please consult with your Omron’s representative at any time to
confirm actual specifications of purchased Product.
The following notation is used in this manual to provide precautions required to ensure safe usage of a
CP-series PLC. The safety precautions that are provided are extremely important to safety. Always read
and heed the information provided in all safety precautions.
Symbols
The triangle symbol indicates precautions (including
warnings). The specific operation is shown in the triangle
and explained in text. This example indicates a precau-
tion for electric shock.
Be sure to sufficiently confirm the safety at the destination when you transfer
the program or I/O memory or perform procedures to change the I/O memory.
Devices connected to PLC outputs may incorrectly operate regardless of the operat-
ing mode of the CPU Unit.
Execute online edit only after confirming that no adverse effects will be caused
by extending the cycle time.
Otherwise, the input signals may not be readable.
Sufficiently check safety if I/O bit status or present values are monitored in the
Ladder Section Pane or present values are monitored in the Watch Pane.
If bits are set, reset, force-set, or force-reset by inadvertently pressing a shortcut key,
devices connected to PLC outputs may operate incorrectly regardless of the operat-
ing mode.
Program so that the memory area of the start address is not exceeded when
using a word address or symbol for the offset.
For example, write the program so that processing is executed only when the indirect
specification does not cause the final address to exceed the memory area by using
an input comparison instruction or other instruction.
If an indirect specification causes the address to exceed the area of the start address,
the system will access data in other area, and unexpected operation may occur.
Set the temperature range according to the type of temperature sensor con-
nected to the Unit.
Temperature data will not be converted correctly if the temperature range does not
match the sensor.
Do not set the temperature range to any values other than those for which tem-
perature ranges are given in the following table.
An incorrect setting may cause operating errors.
z Handling
• Set the Unit properly as specified in the operation manual. Improper setting of the Unit may result
in malfunction.
• Check that the DIP switches and data memory (DM) are properly set before starting operation.
• To initialize the DM Area, back up the initial contents for the DM Area to the built-in Flash Memory
using one of the following methods.
• Set the number of words of the DM Area to be backed up starting with D0 in the Number of CH
of DM for backup Box in the Startup Data Read Area.
• Include programming to back up specified words in the DM Area to the built-in Flash Memory
by turning ON A751.15 (DM Backup Save Start Bit).
• Check the ladder program for proper execution before actually running it on the Unit. Not checking
the program may result in an unexpected operation.
• Transfer a routing table to the CPU Unit only after confirming that no adverse effects will be
caused by restarting CPU Bus Units, which is automatically done to make the new tables effec-
tive.
• The ladder program and parameter area data in the CP2E CPU Units are backed up in the built-in
Flash Memory. The BKUP indicator will light on the front of the CPU Unit when the backup opera-
tion is in progress. Do not turn OFF the power supply to the CPU Unit when the BKUP indicator is
lit. The data will not be backed up if power is turned OFF and a memory error will occur the next
time the power supply is turned ON.
• With a CP2E CPU Unit, data memory can be backed up to the built-in Flash Memory. The BKUP
indicator will light on the front of the CPU Unit when backup is in progress. Do not turn OFF the
power supply to the CPU Unit when the BKUP indicator is lit. If the power is turned OFF during a
backup, the data will not be backed up and will not be transferred to the DM Area in RAM the next
time the power supply is turned ON.
• Install a battery (sold separately), if you are using clock data for the program. If the battery is not
installed, the clock data will be initialized when the power is turned off, and the program may
cause malfunction.
• When using a battery, set it to “Detect Low Battery” in PLC settings. If the setting is not changed,
a program that uses clock data may cause malfunction, when the battery is exhausted.
• Before replacing the battery, supply power to the CPU Unit for at least 30 minutes and then com-
plete battery replacement within 5 minutes. Memory data may be corrupted if this precaution is
not observed.
• The equipment may operate unexpectedly if inappropriate parameters are set. Even if the appro-
priate parameters are set, confirm that equipment will not be adversely affected before transfer-
ring the parameters to the CPU Unit.
• Before starting operation, confirm that the contents of the DM Area is correct.
• After replacing the CPU Unit, make sure that the required data for the DM Area, Holding Area, and
other memory areas has been transferred to the new CPU Unit before restarting operation.
• Do not attempt to disassemble, repair, or modify any Units. Any attempt to do so may result in mal-
function, fire, or electric shock.
• Confirm that no adverse effect will occur in the system before attempting any of the following. Not
doing so may result in an unexpected operation.
• Changing the operating mode of the PLC (including the setting of the startup operating mode).
• Force-setting/force-resetting any bit in memory.
• Changing the present value of any word or any set value in memory.
Redistribution and use in source and binary forms, with or without modification, are permitted provided
that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the
following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
the following disclaimer in the documentation and / or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIEDWAR-
RANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABIL-
ITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTI-
TUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUP-
TION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAM-
AGE.
CX-One FA Integrated W463 CXONE-AL
D-V4 To install the soft- Describes the overview of the CX-One FA Inte-
Tool Package Setup ware provided in the grated Tool Package, and how to install and
CX-One uninstall the CX-One.
Manual
CX-Programmer W446 To learn the opera- Describes the operation procedures for the CX-
Operation Manual tion procedures for Programmer.
the CX-Program-
CX-Programmer W447 mer, the Program-
Operation Manual ming Device for
(Function Blocks/ Windows computers
Structured Text)
CX-Simulator Operation W366 To learn the opera- Describes the operation procedures for the CX-
Manual tion procedures for Simulator.
the CX-Simulator,
the Simulation
Device for Windows
computers
CX-Integrator Operation W464 To set up and moni- Describes the operation procedures for the CX-
Manual tor networks Integrator.
Overview
This section gives an overview of the CP2E and describes its specifications.
The SYSMAC CP2E Programmable Controller is a package-type PLC made by OMRON that is designed
for easy application. The CP2E includes E
-type CPU Units (essential models) that support connec-
tions to Programmable Terminals and basic control applications using basic, movement, arithmetic, and
comparison instructions, S
-type CPU Units (standard models) that support connections to Inverters
and Servo Drives and N
-type CPU Units (network models) that support Ethernet connection and
enhanced positioning functions such as 4-axis linear interpolation and pulse.
Essential Models Standard Models Network Models
E
-type CPU Units S
-type CPU Units N
-type CPU Units
CPU Unit with CPU Unit with 30, CPU Unit with 30, CPU Unit with CPU Unit with 30,
14, 20 I/O Points 40 or 60 I/O Points 40 or 60 I/O Points 14, 20 I/O Points 40 or 60 I/O Points
Appearance
1
1. Setting Devices and Hardware
Connect the CPU Unit, Expansion I/O Units, and Expansion Units.
2. Wiring
Wire the power supply, I/O, and communications.
Refer to Section 5 Installation and Wiring in the CP2E CPU Unit Hardware User’s Manual (Cat. No. W613).
4. I/O Allocations
Allocations for built-in I/O on the CPU Unit are predetermined and memory is allocated automatically
to Expansion I/O Units and Expansion Units, so the user does not have to do anything.
Refer to Section 6 I/O Allocation in the CP2E CPU Unit Software User’s Manual (Cat. No. W614).
5. Software Setup
Make the PLC software settings.
With a CP2E CPU Unit, all you have to do is set the PLC Setup.
Refer to Section 7 PLC Setup in the CP2E CPU Unit Software User’s Manual (Cat. No. W614).
7. Checking Operation
Check the I/O wiring and the Auxiliary Area settings, and perform trial operation.
The CX-Programmer can be used for monitoring and debugging.
Refer to Section 8 Overview and Allocation of Built-in Functions in the CP2E CPU Unit Software User’s
Manual (Cat. No. W614).
The internal memory in the CPU Unit consists of built-in RAM, built-in non-volatile RAM and built-in
Flash Memory. The built-in RAM and built-in non-volatile RAM are used as execution memory and the
built-in Flash Memory is used as backup memory.
CPU Unit
Built-in RAM
The built-in RAM is the execution memory for the CPU Unit.
The user program and parameters are stored in the built-in RAM.
Data is unstable when the power supply is interrupted.
User-created Programs
User Program Area
Function Block
Symbol Table
Symbol Table
PLC Setup
Comments and
IP Router Table Program Index
PLC Setup
I/OMemory
IP Router Table
IP Address Table
CX-Integrator
Routing Table
2-1-4 Backup
The CPU Unit will access the backup memory in the following process.
• The program, parameters, comments, program index or symbol table are transferred from the CX-
Programmer and CX-Integrator.
• The program is changed during online editing.
• DM backup is operated by the Auxiliary Area.
During these processes, BKUP LED will light, indicating that the CPU Unit is being backed up.
Overhead processing
(self-diagnosis)
Change in status
after all instructions
I/O memory have been executed Inputs
Program execution
Access 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 0 Exchange
0 0 0 0 0 0 0 0 0 1 1 0 1 0 1 0
CPU Unit 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0
processing 0 0 1 1 1 0 1 0 1 0 1 1 1 0 1 1
cycle 1 0 1 0 1 0 0 1 1 0 0 0 1 1 0 1
Outputs
I/O refreshing
Refreshes external devices at this timing
Peripheral servicing
I/O Refresh
Data to and from external devices, such as sensors and switches, directly connected to the built-in I/O
terminals and expansion I/O terminals, is exchanged with data in the I/O memory of the PLC. This pro-
cess of data exchange is called the I/O refresh.
Peripheral Servicing
Peripheral servicing is used to communicate with devices connected to the communications port or for
exchanging data with the CX-Programmer.
Cycle Time
The cycle time is the time between one I/O refresh and the next.
Additional Information
The average cycle time during operation will be displayed in the status bar on the bottom right of
the Ladder Program Window on the CX-Programmer.
3
3-1-2 CPU Unit Operating Modes
PROGRAM mode: The programs are not executed in PROGRAM mode.This mode is used for the initial
settings in PLC Setup, transferring ladder programs, checking ladder programs, and
making prepartions for executing ladder programs such as force-setting/resetting bits.
MONITOR mode: In this mode, it is possible to perform online editing, force-set/reset bits, and change
I/O memory present values while the ladder programs are being executed. Adjust-
ments during trial operation are also made in this mode.
RUN mode: This is the mode in which the ladder program is executed. Some operations are dis-
abled during this mode. It is the startup mode at initial value when the CPU Unit is
turned ON.
z Other Areas in the I/O Memory (Including Holding Area Data, Counter PVs,
Changing program
PLC Setup
PLC Setup changed
Parameter Area Routing Table
IP Router Table
Built-in Non-volatile RAM
IP Address Table I/O Memory Areas
PLC power turned ON
· I/O Area
· Work Area
Operation using control
· Holding Area
bits in Auxiliary Area
· Auxiliary Area
· Timer Area
Part of DM Area · Counter Area
· DM Area
Clock
Clock data is backed up with battery.
(CP2W-BAT02 sold separately)
z Backing Up Memory
Ladder programs and parameter area are backed up to the built-in Flash Memory by transferring
them from the CX-Programmer or writing them using online editing.
z Restoring Memory
Ladder programs and parameter area are automatically transferred from the built-in Flash Memory
to the RAM memory when power is turned ON again or at startup.
* These areas will be cleared when the power supply is turned ON if the Clear retained memory area (HR/DM/CNT)
Check Box is selected in the PLC Settings.
4-1 Programming
Programming Languages
Programs can be written using only ladder programs.
4-1 Programming
It is possible to check the program size by selecting Program - Memory View in the CX-Programmer.
The size of a ladder instruction depends on the specific instruction and operands that are used.
E
C E
R2
• There is no limit to the number of input conditions that can be connected in series or in parallel on
the rungs.
0.00 0.05
TIM
0000
#100
102.00
102.00
102.00
• A rung error will occur if the instruction shown below is made to directly connect to the bus bar
without an input condition.
OUT instructions, timers, counters, and other output instructions cannot be connected directly to
the left bus bar.
If one of these instructions is connected directly to the left bus bar, a rung error will occur and pro-
gram transfer will be impossible.
MOV
• A location error will occur if an instruction is not connected directly to the right bus bar.
An input condition cannot be inserted after an OUT instruction or other output instruction. The
input condition must be inserted before an OUT instruction or other output instruction. If it is
inserted after an output instruction, then a location error will occur during the program check in the
CX-Programmer.
0.01 102.01
4-1 Programming
• A warning will occur if the same output bit is used more than once in an OUT instruction.
One output bit can be used in one instruction only. Instructions in a ladder program are executed
in order from the top rung in each cycle. The result of an OUT instruction in a lower rung will be
eventually saved in the output bit. The results of any previous instructions controlling the same bit
will be overwritten and not output.
Output bit CIO 100.00
4
Output bit CIO 100.00
Symbols
I/O memory area addresses or constants can be specified by using character strings registered as symbols.
The symbols are registered in the symbol table of the CX-Programmer.
Programming with symbols enables programming with names without being aware of the addresses.
The symbol table is saved in the CX-Programmer project file (.CXP) along with other parameters, such
as the user programs.
Symbol Types
There are two types of symbols that can be used in programs.
z Global Symbols
Global symbols can be accessed from all ladder programs in the PLC.
z Local Symbols
Local symbols can be accessed from only one task. They are assigned to individual tasks.
4
Note “Global” and “local” indicate only the applicable scope of the symbol.
Additional Information
In programs in the CX-Programmer, global symbols and local symbols can be identified by the
following character colors and symbol icons.
Classification Display color Example (default color)
Global symbols Black (default) Start
3.00
W0.00
Select Tools - Options, and select Local Symbols or Global Symbols in Appearance to change
the color.
Program 2
Copy of function block A
Standard program
section written
with variables
Function block A Program 1
aa cc Variable Output
Copy of function block A
bb
MOV
#0000
Input Variable Variable Output
dd
Define in advance.
Insert in program. Setting Setting
Function
block A
To another PLC program
Reuse
Structured Programming
Structured programs created with function blocks have better design quality and required less devel-
opment time.
Creating Libraries
Processes that are independent and reusable (such as processes for individual steps, machinery,
equipment, or control systems) can be saved as function block definitions and converted to library
functions.
The function blocks are created with local variable names that are not tied to physical addresses, so
new programs can be developed easily just by reading the definitions from the file and placing them
in a new program.
Call (Nesting)
Function block (ST language)
For details on using function blocks, refer to the CX-Programmer Ver. 7.0 Operation Manual: Func-
tion Blocks (Cat. No. W447).
4-3-4 ST Language
CP2E can use the ST (Structured Text) language within function blocks.
The standard control statements, operators, and functions make the ST language ideal for mathemati-
cal processing that is difficult to write in ladder programming.
Additional Information
For details on ST programming specifications, notation, and input procedures, refer to the CX-
Programmer Operation Manual: Function Blocks and Structured Text (Cat. No. W447).
z Features of ST Programming
• There are many control statements available, such as loop statements and IF-THEN-ELSE state-
ments, many operators such as arithmetic operators, comparison operators, and AND/OR opera-
tors, as well as many mathematical functions, string extract and merge functions, Memory Card
processing functions, string transfer functions, and trigonometric functions.
• Programs can be written like high-level languages such as C, and comments can be included to
make the program easy to read.
• ST programs can be uploaded and downloaded just like ordinary programs, but ST program can
only be used in function blocks.
• One-dimensional array variables are supported for easier data handling in applications.
z Control Statements
Control statements Availability in CP2E
IF, THEN, ELSEIF, ELSE, END_IF Yes
CASE, ELSE, END_CASE Yes
FOR, TO, BY, DO, END_FOR Yes
WHILE, DO, END_WHILE Yes
REPEAT, UNTIL, END_REPEAT Yes
EXIT Yes
RETURN Yes
z Operators
Operators Symbol Availability in CP2E
Parentheses and brackets (expression), array[index] Yes
Function evaluation identifier Yes
Exponential ** No
Complement NOT Yes
Multiplication * Yes
Division / Yes
Addition + Yes
z Standard Functions
4-3-4 ST Language
Function type Availability in CP2E
Numerical Functions No*
Arithmetic Functions No
Data Type Conversion Functions Yes
Number-String Conversion Functions No
Data Shift Functions Yes
Data Control Functions Yes
Data Selection Functions Yes
Structure of Instructions
Programs consist of instructions. The conceptual structure of the inputs to and outputs from an instruc-
tion is shown in the following diagram.
Power flow (P.F., execution condition) Power flow (P.F., execution condition)*1
Instruction condition Instruction Instruction condition*2
Flags Flag
*1: Input instructions only.
*2: Not output for all instructions.
Operands Operands
(sources) (destinations)
I/O memory
z Power Flow
The power flow is the execution condition that is used to control the execution and instructions when
programs are executing normally. In a ladder program, power flow represents the status of the exe-
cution condition.
Input Instructions
• Load instructions indicate a logical start and outputs the execution condition.
Outputs the execution
condition.
• Intermediate instructions input the power flow as an execution condition and output the power flow
to an intermediate or output instruction.
Outputs the execution
condition.
=
D0
#1215
Output Instructions
Output instructions execute all functions, using the power flow as an execution condition.
LD power flow
Power flow for
output instruction
4-4-2 Operands
Operands specify preset instruction parameters that are used to specify I/O memory area contents or
constants. Operands are given in boxes in the ladder programs.
Addresses and constants are entered for the operands to enable executing the instructions.
Operands are classified as source, destination, or number operands.
MOV SBS
Operand
Operand type Description
symbol
Source oper- Specifies the address of S Source oper- Source operand other than control
and the data to be read or a and data (C) 4
constant. C Control data Compound data in a source operand
that has different meanings depend-
4-4-2 Operands
ing on bit status.
Destination Specifies the address D −
operand where data will be writ-
(results) ten.
Number Specifies a particular N With numbers, it is not possible to specify an address
number used in the for indirect specification (except for jump instruction
instruction, such as a numbers).
subroutine number.
Operands are also called the first operand, second operand, and so on, starting from the top of the
instruction.
MOV
#0 First operand
D0 Second operand
Example:
! @ MOV
Instruction (mnemonic)
Differentiation variation
Non-differentiated Instructions
Non-differentiated Example:
Output instructions MOV
executed every cycle
Input-differentiated Instructions
Example: 1.02
@ Upwardly
differentiated @MOV
instruction
Example: 1.02
% Downwardly
differentiated %SET
instruction
Specifying Addresses
Application
Operand Description Example
examples
Specifying The word address and bit number are speci- 1 . 02 1.02
bit fied directly to specify a bit.
addresses Bit number 02
.
Bit number Word address CIO 1
(00 to 15)
Word address
Application
Operand Description Example
examples
Specifying An offset from the beginning of the DM Area @D300
MOV #0001 @D300
indirect DM is specified. The contents of the address will
addresses in be treated as binary data (E
-type CPU
&256 decimal Contents
Binary Mode Unit 0000 to 4095, S
-type CPU Unit
0000 to 8191, N
-type CPU Unit 0000 to (#0100 hexadecimal)
16383) to specify the word address in DM
Area.
Specify D00256
Specifying An offset from the beginning of the DM Area * D200 MOV #0001 *D200
indirect DM is specified. The contents of the address will
Addresses be treated as BCD data (E
-type CPU Contents
#0100
in BCD Unit 0000 to 4095, S
-type CPU Unit
Mode 0000 to 8191, N
-type CPU Unit 0000 to
16383) to specify the word address in the Specify D100
DM Area.
Add an asterisk (*) at the front to specify an
indirect address in BCD Mode. Add *
4
Note For Timer Completion Flags and Counter Completion Flags, there is no distinction between word addresses and bit
Signed 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Negative: Negative:
binary -1 to #8000 to
Binary: → 215 214 213 212 211 210 29 28 27 26 25 24 23 22 21 20
- 32768 #FFFF
Hexadecimal: → 23 22 21 20 23 22 21 20 23 22 21 20 23 22 21 20
Decimal: → -32768 16384 8192 4096 2048 1024 512 256 128 64 32 16 8 4 2 1 Positive: Positive:
0 to 32767 #0000 to
Sign bit: #7FFF
1:Negative, 0:Non-negative
The data is treated as 16-bit signed binary data using the leftmost bit as the
sign bit. The value is expressed in 4-digit hexadecimal.
Positive numbers: If the leftmost bit is OFF, it indicates a non-negative value.
For 4-digit hexadecimal, the value will be 0000 to 7FFF hex.
Negative numbers: If the leftmost bit is ON, it indicates a negative value. For 4-
digit hexadecimal, the value be 8000 to FFFF hex. It will be expressed as the
2’s complement of the absolute value of the negative value (decimal).
4-digit
Decimal
Type Data format hexadeci-
equivalent
mal
BCD (binary 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
#0 to #9999 #0000 to
coded deci- #9999
mal) BCD → 23 22 21 20 23 22 21 20 23 22 21 20 23 22 21 20
Decimal → 0 to 9 0 to 9 0 to 9 0 to 9
sign Exponent
Value = (-1) ×1.[Mantissa] × 2
· Sign bit (bit 31): 1: Negative, 0: Positive
· Mantissa: The 23 bits from bit 00 to bit 22 contain the mantissa, i.e., the portion
below the decimal point in 1. .....,in binary.
4
Indicates this value.
· The 8 bits from bit 23 to bit 30 contain the exponent. The exponent
n n-127
This format conforms to the IEEE 754 standard for single-precision floating-
point data. It is used only with instructions that convert or calculate floating-
point data.
• Input using operands in the CX-Programmer as signed decimal or 32-bit
hexadecimal with the # symbol.
• When inputting operands in the I/O Memory Edit/Monitor Window of the CX-
Programmer as signed decimal values with seven digits or less, the value will
be automatically converted to scientific notation (mantissa× 10Exponent) for
setting and monitoring. Inputs must be made using scientific notation for val-
ues with eight or more digits.
Example: When -1234.00 is input, it will become -1.234000e+003 in scientific
notation. For the mantissa×10Exponent, the value before the e is the man-
tissa and the value after the e is the signed exponent.
* Data range for single-precision floating-point decimal: -3.402823 × 1038 ≤ Value ≤ -1.175494 × 10-38, 0, +1.175494 ×
10-38 ≤ Value ≤ 3.402823 × 1038
Cyclic Refreshing
I/O is all refreshed after ladder programs are executed.
Start
15 0
LD1.01 CIO 0001
16-bit increments
15 0
OUT2.09 CIO 0002
END
All actual I/O data
Cyclic refreshing
(batch)
I/O refresh
Execute an instruction with the immediate refresh variation or an IORF instruction to perform I/O
refreshing while ladder programming is being executed.
Immediate Refresh
The method of specifying immediate refreshing depends on whether the object to be refreshed is built-
in I/O or an Expansion Unit.
• To specify immediate refreshing for the CPU Unit’s built-in I/O, specify the immediate refresh variation
(!) of the instruction.
• To specify immediate refreshing for Expansion I/O or an Expansion Unit, use the IORF instruction.
z Instructions with Refresh Variation (!)
Add an exclamation mark (!) in front of the instruction to specify immediate refreshing.
I/O will be refreshed as shown below when an instruction is executing if a real I/O bit in the CPU
Unit’s built-in I/O is specified as an operand.
• Bit Operands: I/O refreshing for the bit will be performed.
• Word Operands: I/O refreshing for the 16 specified bits will be performed.
• Input or Source Operands: Inputs are refreshed immediately before the instruction is executed.
• Output or Destination Operands: Outputs are refreshed immediately after the instruction is executed.
z IORF(097) Instruction
An I/O refresh (IORF) instruction is supported as a special instruction to refresh actual I/O data in
the specified word range. By using this instruction, it is possible to refresh all data or data in a spec-
ified range of actual I/O in CP-series Expansion I/O and Expansion Unit during the cycle.
4-5 Constants
Overview
Constants are numeric values expressed in 16 or 32 bits and can be specified as instruction operands.
The following types of constants are supported.
• Bit Strings or Numeric Values (Integers)
Decimal values (with & symbol), hexadecimal values (with # symbol), BCD values (with # symbol), or
signed decimal values (with + or - symbol)
• Operands Specifying Numbers
4-5 Constants
Decimal Notation (No Symbol)
• Floating Point (Real Number) Notation
Signed decimal notation (with + or - symbol and decimal point)
Unsigned Binary
Signed Binary
Data type Decimal values Hexadecimal values
Notation Signed + or - With # symbol
- 10 # FFF6
Unsigned BCD
Data type Decimal values BCD values
Notation None # 0010
Decimal value using
0 to 9
BCD symbol
Application +B #0010 D0 D1
example Adds #0010 and the contents of D0 as BCD data
and stores the result in D1.
Precautions for The input will be treated as an address in the CIO
correct use Area and the contents of that address will be
specified if a decimal value without # is input from
the CX-Programmer.
Range 16 bits None #0000 to #9999
32 bits #0000 0000 to #99999999
Application SBS 0
example Jumps to subroutine 0.
Precautions for An error will occur and the left bus bar
correct use will be displayed in red if a decimal
value is input with & from the CX-Pro-
grammer.
4-5 Constants
z Using Floating-point (Real Number) Notation for Operands
Data type Decimal values Hexadecimal values
Notation With + or - With # symbol
(for single-precision data)
+ 0.10
Decimal value # 3DCCCCCD 4
(real number) Hexadecimal value
+ or - sign using 0 to F
Additional Information
MOVR(560)
IR
Index Register
Instruction Indirect
addressing
,IR0
IR0
Basically, Index Registers are used with the following steps:
1 Use MOVR to store the PLC memory address of the desired bit or word in an Index Register.
2 Specify the Index Register as the operand in almost any instruction to indirectly address the
desired bit or word.
3 Offset or increment the original PLC memory address (see below) to redirect the pointer to
another address.
Note Use any of the following methods to offset or increment an Index Register.
• Indirect Addressing of Index Registers:
Indirect addressing with auto-incrementing (,IR@+ or ,IR@++), indirect addressing with
auto-decrementing (,−IR@ or ,−−IR@), indirect referencing with a constant offset (con-
stant,IR@), indirect addressing with a DR offset (DR@,IR@)
Instruction A m+1
Repeats the process
Instruction A ,IR0+ in a loop such as
FOR-NEXT.
Instruction A m+n
The following ladder programming examples show how the index registers are treated.
Example 1
Ladder Program:
LD P_Off
OUT, IR0+
Operation: When the PLC memory address CIO 0.13 is stored in IR0.
The input condition is OFF (P_Off is the Always OFF Flag), so the OUT instruction sets CIO 0.13,
which is indirectly addressed by IR0, to OFF. The OUT instruction is executed, so IR0 is incre-
mented. As a result, the PLC memory address CIO 0.14, which was incremented by +1 in the
IR0, is stored. Therefore, in the following cycle the OUT instruction turns OFF CIO 0.14.
Example 2
Ladder Program:
LD P_Off
SET, IR0+
Operation: When the PLC memory address CIO 0.13 is stored in IR0.
The input condition is OFF (P_Off is the Always OFF Flag), so the SET instruction is not exe-
cuted. Therefore, IR0 is not incremented and the value stored in IR0 remains PLC memory
address CIO 0.13.
• The following instructions are executed even when the interlock is active. Therefore, when indi-
rect memory addresses are specified using auto-incrementing or auto-decrementing (,IR+ or
,IR-) in an operand of any of these instructions, the value in the Index Register (IR) is
refreshed each cycle regardless of the input condition (increases or decreases one every
cycle). This must be considered when writing a program.
Instruction group Instructions
Sequence output instructions OUT, OUT NOT
Timer and counter instructions TIM/TIMX, TIMH/TIMHX, TMHH/TMHHX, and
TIML/TIMLX
2. Use IR.
Value B
IR0
• Always set the value before using Index Registers. Operation will not be stable if Index Regis-
ters are used without the values being set.
MOVR(560) sets the PLC memory addresses of D0, D100, and D200 in
index registers IR0, IR1, and IR2.
Execution condition 4
a
MOVR When execution condition “a” goes ON
(upwardly differentiated condition), the
MOVR
D200
IR2
JMP
&50
Additional Information
Index Registers can be directly addressed only in the instructions shown in the following table.
z Example
Note Be sure to use PLC memory addresses in Index Registers.
IR storage words
for task 1
D1000
Task 1
D1001
IR0
a
MOVL
D1001 and D1000 stored
or
D1000 in IR0
0000C000Hex
IR0
IR0
a or
MOVL
Contents of IR0 stored in
IR0 D1001 and D1000
D1000
4
IR storage words
for task 2
MOVL
IR0 Contents of IR0 stored in
D2001 and D2000
D2000
4-7-1 Overview
When an address is specified for an instruction operand, it is possible to change the specified address
by specifying in brackets an offset for the specified address.
0.00[W0]
MOV
z Bit Addresses
The bit address is offset by the amount specified by n (number of bits) from A (start bit address).
A [n]
Offset
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Word
Starting bit address A
Offset
The offset can be specified as a decimal constant, word address (but CIO Area addresses cannot
be specified), or a one-word symbol (i.e., symbols with the following data types: INT, UINT, WORD,
CHANNEL).
Words in the Auxiliary Area (A) can only be specified as a decimal constant.
If a word address is specified, the contents of the specified word is used as the offset.
If the offset exceeds bit 15 in the specified word, offsetting will continue from bit 00 in the next word.
If the offset is specified indirectly, make sure that the final bit address does not exceed the upper
limit of the memory area by using input comparison or other instruction.
Examples:
z Word Addresses
The word address is offset by the amount specified by n (number of offset words) from A (start word
address).
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
A [n] Word
Start word address A
Offset +n
4
4-7-1 Overview
It is possible to specify the start word address with a word address or with a symbol (except the
NUMBER data type cannot be used).
Offsetting is possible only for addresses in the Holding, Word, and DM Areas.
The I/O comment for the start bit address is displayed.
When specifying symbols, make the symbol table setting as the array variation. The number of
arrays will be the maximum number of offset + 1 word at least.
Offset
The offset can be specified as a decimal constant, word address (but CIO Area addresses cannot
be specified), or one-word symbol (i.e., symbols with the following data types: INT, UINT, WORD,
CHANNEL).
If a word address or symbol is specified, the contents of the specified word is used as the offset.
If the offset exceeds bit 15 in the specified word, offsetting will continue from bit 00 in the next word.
If the offset is specified indirectly, make sure that the final bit address does not exceed the upper
limit of the memory area by using input comparison or other instruction.
Examples:
D0[2] D2 a [2] D2
Caution
Program so that the memory area of the start address is not exceeded when using a
word address or symbol for the offset.
For example, write the program so that processing is executed only when the indirect
specification does not cause the final address to exceed the memory area by using
an input comparison instruction or other instruction.
If an indirect specification causes the address to exceed the area of the start address,
the system will access data in other area, and unexpected operation may occur.
Set the value of W0 to the offset word (W1) using the MOV instruction.
Use the operand of the addition instruction to specify and execute D0[W1] +
D100[W1] = D200[W1]. Repeat this process
Increment W1 to increase the offset. 100 times.
Each process is performed with an input comparison instruction (<) as the execution condition so
that W1 does not exceed &100 to make sure that the upper limit of the indirect addressing range is
not exceeded.
Execution condition
a
Subroutines
Place all the subroutines together just after all of the main program and before the END instruction.
A subroutine cannot be placed in a step ladder, block program, or FOR-NEXT section.
If instructions other than those in a subroutine are placed after a subroutine (SBN to RET), those
instructions will not be executed.
Program
Subroutines
Note A step ladder program section can be used in an interlock section (between IL and ILC).
The step ladder section will be completely reset when the interlock condition is ON.
System Areas
Clock Pulses
User Areas
These areas can be used freely by the user.
System Areas
System Areas contain bits and words with preassigned functions.
z Condition Flags
The Condition Flags include the flags that indicate the results of instruction execution, as well as the
Always ON and Always OFF Flags.
The Condition Flags are specified with global symbols rather than with addresses. For example: P_on
z Clock Pulses
The Clock Pulses are turned ON and OFF by the CPU Unit’s internal timer.
The Clock Pulses are specified with global symbols rather than with addresses. For example: P_0_02
z Word Addresses
Specifies a16-bit word.
W 1 0 0
z Bit Addresses
A bit addresses specifies one of the 16 bits in a word.
The word number and bit number are separated with a period.
W 1 0 0 . 0 2 5
I/O memory Word number Period Bit number
area designator (00 to 15)
0 . 0 3
IN C 1 3 5 7 9 11
CIO 0 0 2 4 6 8 10
Inputs begin from CIO 0 Period Bit number
Outputs begin from CIO 100 (00 to 15)
Overview
These words are allocated to built-in I/O terminals of CP2E CPU Units, CP-series Expansion Units and
Expansion I/O Units.
Notation
0 . 02
Bit number: 02
Word number: 0
Range
Input bits: CIO 0.00 to CIO 99.15 (100 words) 5
Output bits: CIO 100.00 to CIO 199.15 (100 words)
Applications
Built-in inputs can be used as basic inputs, interrupt inputs, quick-response inputs or high-speed
counters.
Built-in outputs can only be used as basic outputs.
Refer to Section 8 Overview of Built-in Functions and Allocations for details.
Details
• Bits in the CIO Area can be force-set and force-reset.
• The contents of the CIO Area will be cleared in the following cases:
• When the operating mode is changed between PROGRAM or MONITOR mode and RUN mode
• When the PLC power is reset
• When the CIO Area is cleared from the CX-Programmer
• When PLC operation is stopped due to a fatal error other than an FALS error occurs. (The con-
tents of the CIO Area will be retained when FALS is executed.)
Additional Information
Words that are not allocated to the built-in I/O terminals of the CPU Units, the Expansion Units
and Expansion I/O Units can only be used in programming. It is the same as the Work Area.
Notation
W 20 . 02
Bit number: 02
Word number: 20
Range
The Work Area contains 128 words with addresses ranging from W0 to W127.
Applications
It is sometimes necessary to use the same set of input conditions many times in the same program. In
this case a work bit can be used to store the final condition to simplify programming work and program
design.
W10.0
W10.0
NO bit
W10.0
NC bit
Details
• Bits in the Work Area can be force-set and force-reset.
• The contents of the Work Area will be cleared in the following cases:
• When the operating mode is changed between PROGRAM or MONITOR mode and RUN mode
• When the PLC power is reset
• When the Work Area is cleared from the CX-Programmer
• When PLC operation is stopped due to a fatal error other than an FALS error occurs. (The con-
tents of the Work Area will be retained when FALS is executed.)
Notation
Bit number: 02
Word number: 20
Range
The Holding area contains 128 words with addresses ranging from H0 to H127.
The Holding Area words from H512 to H1535 can be set for use with function blocks. These words can-
not be specified as instruction operands in the user program.
Applications
The Holding Area is used when you want to resume operation after a power interruption using the same
status as before the power interruption.
Details
• Bits in the Holding Area can be force-set and force-reset.
• When a self-maintaining bit is programmed with a Holding Area bit, the self-maintaining bit will not be
cleared even when the power is reset.
• If a Holding Area bit is not used for the self-maintaining bit, the bit will be turned OFF and the self-
maintaining bit will be cleared when the power is reset.
H0.00
H0.00
• If a Holding Area bit is used but not programmed as a self-maintaining bit, the bit will be turned OFF
by execution condition A when the power is reset.
A H0.00
A B
Set
KEEP
Input Unit
H1.00
Bad ~ A
Reset
A B
Set
KEEP
H1.00
Input Unit
OK ~ A
Reset
Overview
The DM area is used for general data storage and manipulation and is accessible only by word (16
bits).
These words retain their contents when the PLC is turned ON or the operating mode is switched
between PROGRAM mode and RUN or MONITOR mode.
Some words in the DM Area can be saved to the built-in Flash Memory using Auxiliary Area bits. These
words are specifically referred to as the backed up words in the DM Area.
Notation
D 200
5
I/O memory area designator: D
Range
• E
-type CPU Units have DM Area addresses ranging from D0 to D4095.
Of these, D0 to D1499 can be backed up in backup memory (built-in Flash Memory).
• S
-type CPU Units have DM Area addresses ranging from D0 to D8191.
Of these, D0 to D6999 can be backed up in backup memory (built-in Flash Memory).
• N
-type CPU Units have DM Area addresses ranging from D0 to D16383.
Of these, D0 to D14999 can be backed up in backup memory (built-in Flash Memory).
Applications
The DM Area is for storing numeric data. It can be used for data exchange with Programmable Termi-
nals, serial communications devices, such as Inverters, and Analog I/O Units or Temperature I/O Units.
Details
Bits in the DM Area cannot be addressed individually.
z Backing Up to the Built-in Flash Memory
• The number of words set in the PLC Setup can be saved to the built-in Flash Memory during oper-
ation by turning ON the DM Backup Start bit (A751.15).
• Specify in the PLC Setup whether to read the data in the DM Area words to the RAM as the initial
values when the power supply is turned ON.
Refer to 16-3 DM Backup Function for how to use DM Area words and bits.
Overview
The Timer Area contains Timer Completion Flags (1 bit each) and timer PVs (16 bits each). The Com-
pletion Flag is turned ON when a decrementing timer PV reaches 0 (counting out) or an increment-
ing/decrementing timer PV reaches the set value or 0.
Notation
T 002
Range
Timer numbers range from T0 to T255.
5
Details
z Types of Timers
The following table shows which instructions are used to refresh timer PVs in BCD and binary mode.
Timer instruction BCD mode Binary mode
HUNDRED-MS TIMER TIM TIMX
TEN-MS TIMER TIMH TIMHX
ONE-MS TIMER TMHH TMHHX
ACCUMULATIVE TIMER TTIM TTIMX
#10
· Binary mode
#A or &10
*1 If the IOM Hold Bit (A500.12) is ON, the PV and Completion Flag will be retained when a fatal error occurs
(including execution of FALS instructions) or the operating mode is changed from PROGRAM mode to
RUN or MONITOR mode or vice-versa. (The PV and Completion Flag will be cleared when power is
cycled.)
*2 Since the TIML/TIMLX instructions do not use timer numbers, they are reset under different conditions.
The PV for a TIML/TIMLX instruction is reset to the SV.
Refer to the descriptions of these instructions for details.
Overview
The Counter Area contains Completion Flags (1 bit each) and counter PVs (16 bits each). A Comple-
tion Flag is turned ON when the counter PV reaches the set value (counting out).
Completion Flags and counter PVs are automatically retained in the built-in non-volatile RAM even if
the power supply is interrupted.
Notation
Range
5
Counter numbers range from C0 to C255.
.
Details
z Types of Counters
The following table shows which instructions are used to refresh counter PVs in BCD and binary
mode.
Counter instruction BCD mode Binary mode
COUNTER CNT CNTX
REVERSIBLE COUNTER CNTR CNTRX
· Binary mode
Overview
The sixteen Index Registers (IR0 to IR15) are used for indirect addressing. Each Index Register can
hold a single PLC memory address, which is the absolute memory address of a word in I/O memory.
These are different from the I/O memory area addresses in the CIO Area, DM Area, etc. They are the
continuous RAM addresses.
The user cannot directly input PLC memory addresses in the Index Registers. Use MOVR to convert a
regular data area address to its equivalent PLC memory address and write that value to the specified
Index Register. (Use MOVRW to set the PLC memory address of a timer/counter PV in an Index Regis-
Notation
IR 13
Range
Index register numbers range from IR0 to IR15.
Details
z Indirect Addressing
When an Index Register is used as an operand with a “,” prefix, the instruction will operate on the
word indicated by the PLC memory address in the Index Register, not the Index Register itself. Basi-
cally, the Index Registers are I/O memory pointers.
• All addresses in I/O memory (except Index Registers, Data Registers, and Condition Flags) can
be specified seamlessly with PLC memory addresses. It isn’t necessary to specify the data area.
I/O memory addresses for IR, DR, and Condition Flags, however, cannot be held.
• In addition to basic indirect addressing, the PLC memory address in an Index Register can be off-
set with a constant or Data Register, auto-incremented, or auto-decremented. These functions
can be used in loops to read or write data while incrementing or decrementing the address by one
each time that the instruction is executed.
With the offset and increment/decrement variations, the Index Registers can be set to base values
with MOVR or MOVRW and then modified as pointers in each instruction.
For pointer operation, either special instructions that can directly specify Index Registers (MOVR,
MOVRW, increment instructions, decrement instructions, or math instructions) are used, or indirect
offsets, auto-incrementing, or auto-decremented is used.
I/O Memory
Example
This example shows how to store the PLC memory address of a word (CIO 2) in an Index Register
(IR0), use the Index Register in an instruction, and use the auto-increment variation.
MOVR 2 IR0 Stores the PLC memory address of CIO 2 in IR0.
MOV #0001 ,IR0 Writes #0001 to the PLC memory address contained in IR0.
MOV #0020 +1,IR0 Reads the content of IR0, adds 1, and writes #0020 to that PLC
memory address.
MOV #0001 ,IR0
Regular PLC memory
data area address MOVE TO REGISTER
address I/O memory instruction MOVR(560) 0002 IR0
0000 01B80Hex
0001 01B81Hex Pointer IR0
0289 01CA1Hex
H000 01CC0Hex
H127 01D3FHex
W000 W000
022C0Hex
W127 0233FHex
5
Note The PLC memory addresses are listed in the diagram above, but it isn’t necessary to know the
PLC memory addresses when using Index Registers.
Since some operands are treated as word data and others are treated as bit data, the meaning of the
data in an Index Register will differ depending on the operand in which it is used.
• Word Operand:
MOVR 0000 IR2
MOV D0 ,IR2
When the operand is treated as a word, the contents of the Index Register are used “as is” as the
PLC memory address of a word.
In this example MOVR sets the PLC memory address of CIO 2 in IR2 and the MOV instruction copies
the contents of D0 to CIO 2.
• Bit Operand:
MOVR 000013 ,IR2
SET +5 , IR2
When the operand is treated as a bit, the leftmost 7 digits of the Index Register specify the word
address and the rightmost digit specifies the bit number. In this example, MOVR sets the PLC mem-
ory address of CIO 13 (0C00D hex) in IR2. The SET instruction adds +5 from bit 13 (D hex) to this
PLC memory address, so it turns ON bit CIO 1.02.
Additional Information
When MOVR is used to set a word address in an index register, the address is stored as follows:
31 0
Index register PLC memory address
When MOVR is used to set a bit address in an index register, the address is stored as follows:
31 4 3 0
Index register PLC memory address Bit number
Additional Information
• When an Index Register is used as an operand without a “,” prefix, the instruction will operate
on the contents of the Index Register itself (a two-word or “double” value). Index Registers can
be directly addressed only in the instructions shown in the following table. Use these instruc-
tions to operate on the Index Registers as pointers.
• The Index Registers cannot be directly addressed in any other instructions, although they can
usually be used for indirect addressing.
z Direct Addressing
Instruction group Instruction name Mnemonic
Data Movement MOVE TO REGISTER MOVR(560)
Instructions MOVE TIMER/COUNTER PV TO REGISTER MOVRW(561)
DOUBLE MOVE MOVL(498)
Increment/Decrement DOUBLE INCREMENT BINARY ++L(591)
Instructions DOUBLE DECREMENT BINARY – –L(593)
Comparison Instructions DOUBLE EQUAL =L(301)
DOUBLE NOT EQUAL < >L(306)
DOUBLE LESS THAN < L(311)
DOUBLE LESS THAN OR EQUAL < =L(316)
DOUBLE GREATER THAN > L(321)
DOUBLE GREATER THAN OR EQUAL > =L(326)
DOUBLE COMPARE CMPL(060)
Symbol Math Instructions DOUBLE SIGNED BINARY ADD WITHOUT CARRY +L(401)
DOUBLE SIGNED BINARY SUBTRACT WITHOUT CARRY –L(411)
z Precautions
It is possible to read the Index Register for only the last task executed within the cycle from the CX-
Programmer. If using Index Registers with the same number to perform multiple tasks, it is only pos-
sible with the CX-Programmer to read the Index Register value for the last task performed within the
cycle from the multiple tasks. Nor is it possible to write the Index Register value from the CX-Pro-
grammer.
Additional Information
The contents of an index register used inside a function block may be corrupted when the func-
tion block is called. Always save the contents of the index register before calling the function
block and then restore the contents after leaving the function block. Set the required contents in
the index register inside the function block.
P_On Save
Instructions using the index [MOVL IR0 Temporary internal address]
register
P_On Restore
Instructions using the index [MOVL Temporary internal address IR0]
register
Overview
The sixteen Data Registers (DR0 to DR15) are used to offset the PLC memory addresses in Index Reg-
isters when addressing words indirectly. The Data Registers can be used to specify an offset to add to
an Index Register when addressing words indirectly.
The content of Data Registers cannot be accessed (read or written) from the CX-Programmer.
Notation
Range
5
Index register numbers range from DR0 to DR15.
Details
Example
The following examples show how Data Registers are used to offset the PLC memory addresses in
Index Registers.
LD DR0 ,IR0 Adds the contents of DR0 to the contents of IR0 and
loads the bit at that PLC memory address.
MOV #0001 DR0 ,IR1 Adds the contents of DR0 to the contents of IR1 and
writes #0001 to that PLC memory address.
z Range of Values
The contents of Data Registers are treated as signed binary data and thus have a range of –32,768
to 32,767.
Hexadecimal content Decimal equivalent
8000 to FFFF –32,768 to –1
0000 to 7FFF 0 to 32,767
The content of Data Registers cannot be accessed (read or written) from the CX-Programmer.
Overview
Notation
A 20. 02
Bit number: 02
Word number: 20
Range
The Auxiliary Area contains 960 words with addresses ranging from A0 to A959.
Applications
Applications of the bits and words in the Auxiliary Area are predefined. Ladder programs can be simpli-
fied and controllability can be improved by effectively using the bits and words in this area.
Details
• Some words or bits are set automatically by the system and others are set and manipulated by the
user.
The Auxiliary Area includes error flags set by self-diagnosis, initial settings, control bits, and status
data.
• Words and bits in this area can be read and written from the program or the CX-Programmer.
• The Auxiliary Area contains words that are read-only (A0 to A447) and words that can be read and
written (A448 to A959).
• Even the read/write bits in the Auxiliary Area cannot be force-set and force-reset continuously.
Overview
These flags include the flags that indicate the results of instruction execution, as well as the Always ON
and Always OFF Flags. These bits are specified with symbols rather than addresses.
The CX-Programmer treats condition flags as system-defined symbols (global symbols) beginning with P_.
Notation
Details
The Condition Flags are read-only; they cannot be written from instructions or from the CX-Program-
mer. 5
The Condition Flags cannot be force-set and force-reset.
Name in CX-
Name Function
Programmer
Less Than Flag P_LT Turned ON when the first operand of a Comparison Instruction is less
than the second or a value is below a specified range.
Negative Flag P_N Turned ON when the most significant bit of a result is ON.
Overflow Flag P_OF Turned ON when the result of calculation overflows the capacity of the
result word(s).
Underflow Flag P_UF Turned ON when the result of calculation underflows the capacity of
the result word(s).
Greater Than or P_GE Turned ON when the first operand of a Comparison Instruction is
Equals Flag greater than or equal to the second.
Not Equal Flag P_NE Turned ON when the two operands of a Comparison Instruction are
not equal.
Less than or Equals P_LE Turned ON when the first operand of a Comparison Instruction is less
Flag than or equal to the second.
Instruction B
Overview
The Clock Pulses are turned ON and OFF by the CPU Unit’s internal timer. These bits are specified
with symbols rather than addresses.
The CX-Programmer treats condition flags as system-defined symbols (global symbols) beginning with P_.
Notation
P_ 0_02s
Details
The Clock Pulses are read-only; they cannot be written from instructions or from the CX-Programmer. 5
z Clock Pulses
0.01s
0.05s
0.1s
0.5s
30s
Allocated 12 bits
Allocated 12 bits in the next word
00 to 11 00 to 11
00 to 07 00 to 07
C 1 3 5 7 9 11 C 1 3 5 7 9 11
Inputs
0 2 4 6 8 10 0 2 4 6 8 10
0 1 2 4 5 7 0 1 2 4 5 7
Outputs
C C C 3 c 6 C C C 3 c 6
Bit 02 in CIO 101
100CH (CIO 100) Bit 03 in CIO 100 101CH
(CIO 101)
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
Input Bits CIO 0 Input bits: 24
Cannot be used
CIO 1
CIO 100
Output Bits Cannot be used Output bits: 16
CIO 101
For a CPU Unit with 40 I/O points, a total of 24 input bits are allocated to the input terminal block. The
bits that are allocated are input bits CIO 0.00 to CIO 0.11 (i.e., bits 00 to 11 in CIO 0) and input bits CIO
1.00 to CIO 1.11 (i.e., bits 00 to 11 in CIO 1).
In addition, a total of 16 output bits are allocated to the output terminal block. The bits that are allocated
are output bits CIO 100.00 to CIO 100.07 (i.e., bits 00 to 07 in CIO 0) and output bits CIO 101.00 to CIO
101.07 (i.e., bits 00 to 07 in CIO 1).
bit 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
Input bits CIO m
Cannot be used
CIO m+1
CIO n
Two input words (24 bits) and two output words (16 bits) are allocated to a 40-point I/O Unit.
Allocation Example: CPU Unit with 40 I/O Points + Temperature Senser Unit
(TS002) + Analog Output Unit (DA041) + Expansion I/O Unit with 40 I/O points
1st Unit: 2nd Unit: 3rd Unit:
CPU Unit with 40 I/O Points CP1W-TS002 CP1W-DA041 Expansion I/O Unit with 40
Temperature Sensor Unit Analog Output Unit I/O Points
Input bits CIO 0.00 to CIO 0.11 CIO 6.00 to CIO 6.11
CIO 2 to CIO 5 None
CIO 1.00 to CIO 1.11 CIO 7.00 to CIO 7.11
24 inputs 24 inputs
TS002 DA041
16 outputs 16 outputs
Output bits CIO 100.00 to CIO 100.07 CIO 106.00 to CIO 106.07
None CIO 102 to CIO 105
CIO 101.00 to CIO 101.07 CIO 107.00 to CIO 107.07
CIO 100
Cannot be used CPU Unit with 40 I/O Points
CIO 101
CIO 102
Output bits CIO 103
Analog Output Unit
CIO 104
CIO 105 6
CIO 106
Cannot be used Expansion I/O Unit with 40 I/O Points
CIO 107
PLC Setup
Input Constants
When setting is read by
Name Default Possible settings
CPU Unit
1 0CH: CIO 0 8 ms No filter (0 ms) When power is turned ON
1 ms
2 ms
4 ms
8 ms
16 ms
32 ms
2 1CH: CIO 1 Same as above. Same as above. Same as above.
3 2CH: CIO 2
4 3CH: CIO 3
5 4CH: CIO 4
6 5CH: CIO 5
7 6CH: CIO 6
8 7CH: CIO 7
9 8CH: CIO 8
10 9CH: CIO 9
11 10CH: CIO 10
12 11CH: CIO 11
13 12CH: CIO 12
14 13CH: CIO 13
15 14CH: CIO 14
16 15CH: CIO 15
17 16CH: CIO 16
18 17CH: CIO 17
Note The input constants of CP1W-40EDR/EDT/EDT1 are always 16ms regardless of the settings.
Communications Settings
When setting is read by
Name Default Possible settings
CPU Unit
1 Communications Settings Standard (9,600; Standard When power is turned ON
1, 7, 2, E) Baud rate: 9,600 bps
(Default settings) Start bits: 1 bit
Data length: 7 bits
Parity: Even
Stop bits: 2 bits
Custom
2 Mode Host Link Host Link When power is turned ON
(When custom settings have been selected.)
NT Link (1:N)
RS-232C (No-protocol)
PC Link (Slave)
Port
bits, parity)
7 bits, 2 bits, odd
7 bits, 2 bits, no parity
7 bits, 1 bit, even
7 bits, 1 bit, odd
7 bits, 1 bit, no parity
8 bits, 2 bits, even
8 bits, 2 bits, odd
8 bits, 2 bits, no parity
8 bits, 1 bit, even
8 bits, 1 bit, odd
8 bits, 1 bit, no parity
2-1-3 Unit Number 0 0 When power is turned ON
:
31
2-2 NT Link (1:N) Settings
2-2-1 Baud 115,200 bps 38,400 bps (standard) When power is turned ON
115,200 bps (high speed)
2-2-2 No.NT/PC Link Max. 1 0 When power is turned ON
(Highest unit number of PT
:
that can be connected to
the PLC) 7
Port
9,600 bps
19,200 bps
38,400 bps
57,600 bps
115,200 bps
2-7-2 Link Words 10 Words 1 word When power is turned ON
:
10 words
2-7-3 PC Link Mode ALL ALL When power is turned ON
Masters
2-7-4 No.NT/PC Link Max. 0 0 When power is turned ON
(Highest unit number of PT
:
that can be connected to
the PLC) 7
2-8-2 Format 8 bits, 1 bit, even 8 bits, 1 bit, even When power is turned ON
(data length, stop bits, 8 bits, 2 bits, no parity
parity) 8 bits, 1 bit, odd
Communications Settings
When setting is read by
Name Default Possible settings
CPU Unit
1 Communications Settings Standard (9600; Standard When power is turned ON
1, 7, 2, E) Baud rate: 9,600 bps
(Default settings) Start bits: 1 bit
Data length: 7 bits
Parity: Even
Stop bits: 2 bits
Custom
2 Mode Host Link Host Link When power is turned ON
NT Link (1:N)
RS-232C (No-protocol)
PC Link (Slave)
2-8-2 Format 8 bits, 1 bit, even 8 bits, 1 bit, even When power is turned ON
(data length, stop bits, 8 bits, 2 bits, no parity
parity) 8 bits, 1 bit, odd
Communications Settings
When setting is read by
Name Default Possible settings
CPU Unit
1 Communications Settings Standard (9600; Standard When power is turned ON
1, 7, 2, E) Baud rate: 9,600 bps
(Default settings) Start bits: 1 bit
Data length: 7 bits
Parity: Even
Stop bits: 2 bits
Custom
2 Mode RS-232C (No-protocol) RS-232C (No-protocol) When power is turned ON
(When custom settings have been
PC Link (Slave)
selected.)
PC Link (Master)
Base Settings
When setting is read by
Name Default Possible settings
CPU Unit
1 Undefined Origin (operation for limit signal Hold Hold At start of operation
turning ON)
Undefined
2 Limit Input Signal Operation Search Only Search Only When power is turned ON
Always
3 Limit Input Signal NC NC At start of operation
NO
4 Search/Return Initial Speed 0 pps 0 pps At start of operation
:
100,000 pps
Base Settings
When setting is read by
Name Default Possible settings
CPU Unit
1 Undefined Origin Hold Hold At start of operation
(operation for limit signal turning ON) Undefined
2 Limit Input Signal Operation Search Only Search Only When power is turned ON
Always
3 Limit Input Signal NC NC At start of operation
NO
4 Search/Return Initial Speed 0 pps 0 pps At start of operation
:
100,000 pps
Base Settings
Base Settings
When setting is read by
Name Default Possible settings
CPU Unit
1 Undefined Origin Hold Hold At start of operation
(operation for limit signal turning ON) Undefined
2 Limit Input Signal Operation Search Only Search Only When power is turned ON
Always
3 Limit Input Signal NC NC At start of operation
NO
4 Search/Return Initial Speed 0 pps 0 pps At start of operation
:
100,000 pps
FINS/TCP Settings
When Setting is read by
Name Default Possible Settings
CPU Unit
6 FINS/TCP Port Number Mode 9600 Default (9600) When power is turned ON or
when Ethernet is reset
User
65,535
255.255.255.255
8-3 Auto FINS Node Allocation Address 251 0 (251) When power is turned ON or
(Only valid for FINS/TCP Server (Default value: 0) when Ethernet is reset
:
mode)
253
8-7 Auto FINS Node Allocation Address 252 0 (252) When power is turned ON or
(Only valid for FINS/TCP Server (Default value: 0) when Ethernet is reset
:
mode)
253
8-11 Auto FINS Node Allocation Address 253 0 (253) When power is turned ON or
(Only valid for FINS/TCP Server (Default value: 0) when Ethernet is reset
:
mode)
253
FINS/UDP Settings
When Setting is read by
Name Default Possible Settings
CPU Unit
9 FINS/UDP Port Number Mode 9600 Default (9600) When power is turned ON or
when Ethernet is reset
User
255.255.255.255
SNTP Server
When setting is read by
Name Default Possible Settings
CPU Unit
15 Auto Adjust Time Mode Disable Disable When power is turned ON or
when Ethernet is reset
Enable
15-1 Auto Adjust Time 0h0m0s 0h0m0s When power is turned ON or
when Ethernet is reset
:
23h59m59s
15-2 SNTP Server Specify Method IP Address IP Address When power is turned ON or
when Ethernet is reset
Host Name
SNTP Server IP Address 0.0.0.0 0.0.0.0 When power is turned ON or
when Ethernet is reset
:
255.255.255.255
SNTP Server Host Name (46 ASCII) Blank Any String When power is turned ON or
when Ethernet is reset
6 Start Operation
Start the CP2E CPU Unit operation.
A CP2E CPU Unit uses the same built-in I/O terminals for different functions. Allocate the I/O terminals
in advance, making sure that each terminal is used for only one function.
Specify the input functions in the PLC Setup from the CX-Programmer, and specify the output functions
in PLC Setup and programming instructions.
• The input and output terminals used by the origin search function can be enabled by selecting the
Use define origin operation Check Box on a Pulse Output Tab Page.
Input terminals are allocated functions by setting parameters in the PLC Setup. Set the PLC Setup so
that each terminal is used for only one function.
Note 1 The same pulse inputs must be used for high-speed counter 0 and high-speed counter 1.
2 High-speed counter 2 cannot be used if the input setting of high-speed counter 0 or high-speed counter 1
is set for differential phase inputs (4×), pulse + direction inputs, or up/down pulse inputs.
Variable-duty-fac-
Terminal Terminal Fixed duty ratio pulse output
Normal outputs tor output
block label number
Pulse + Direction Mode Use PWM output
CIO 100 00 Normal output 0 Pulse output 0, pulse − −
01 Normal output 1 Pulse output 1, pulse − PWM output 0
02 Normal output 2 Pulse output 0, direction − −
03 Normal output 3 Pulse output 1, direction − −
04 Normal output 4 − Pulse 0, Error counter reset −
output
05 Normal output 5 − Pulse 1, Error counter reset −
output
Normal output 6 − Pulse 2, Error counter reset −
06
output (Note)
Normal output 7 − Pulse 3, Error counter reset −
07
output (Note)
CIO 101 00 Normal output 8 Pulse output 2, pulse (Note) − −
01 Normal output 9 Pulse output 3, pulse (Note) − −
02 Normal output 10 Pulse output 2, direction (Note) − −
03 Normal output 11 Pulse output 3, direction (Note) − −
04 to 07 Normal output 12 to 15 − − −
CIO 102 00 to 07 Normal output 16 to 23 − − −
9-1-1 Overview
The quick-response inputs can read pulses with an ON time as short as 50 µs even if they are shorter
than the cycle time. Use the quick-response inputs to read signals shorter than the cycle time, such as
inputs from photomicrosensors.
I/O refresh
Cycle time
Built-in input
Input bit
Input bit
ON for one scan
in the next cycle
Cyclic tasks
(ladder programs)
Cycle time
Can read ON signals
shorter than this time.
END
I/O refresh
The pulse widths of quick-response input signals must meet the following conditions.
50μs min. 50μs min.
1 PLC Setup
• Set IN2 to IN9 for quick-response inputs on the Built-in Input
Tab Page of the PLC Setup using the CX-Programmer.
• The terminals 02 to 09 of CIO 0 can be used for quick-
response inputs. Bits CIO 0.02 to CIO 0.09 correspond to ter-
minals 02 to 09.
2 Create ladder Cyclic task or
Read the status of CIO 0.02 to CIO 0.09 using the LD instruction
or other instructions.
program interrupt task
PLC Setup
Click the Built-in Input Tab and select Quick in the interrupt input settings.
Select Quick
Note 1 The power supply must be restarted after the PLC Setup is transferred in order to validate the quick-
response input settings.
2 IN8 and IN9 are only supported by N20/30/40/60 CPU Units.
Quick-response input IN5: CIO 0.05 Quick-response input IN7: CIO 0.07
Quick-response input IN3: CIO 0.03 Quick-response input IN9: CIO 0.09
L1 L2/N COM 01 03 05 07 09 11
NC 00 02 04 06 08 10
CIO 0
DC Power Supply
+ - COM
NC
Quick-response input IN4: CIO 0.04 Quick-response input IN6: CIO 0.06
0.02
• The minimum pulse width (ON time) that can be read for a quick-response input is 50 µs.
• The status of the input that is stored in the I/O memory for a short input will be cleared during the next
I/O refresh period.
10
10-1 Interrupts
10-1-1 Overview
CP2E CPU Units normally repeat processes in the following order: overseeing processes, program exe-
cution, I/O refreshing, peripheral servicing. During the program execution stage, cyclic tasks (ladder
programs) are executed.
The interrupt function, on the other hand, allows a specified condition to interrupt a cycle and execute a
specified program.
Interrupts can thus be used to perform high-speed processing that is not restricted by the cycle time.
The CP2E performs the following processing when an interrupt occurs.
(1)When an interrupt occurs, execution of the ladder programs in cyclic tasks is interrupted.
(2)The ladder program in the interrupt task is executed.
(3)When the interrupt task is finished, the ladder program that was being executed is returned to.
Cycle END
10-2-1 Overview
A corresponding interrupt task can be executed when a built-in input on the CPU Unit turns ON or turns
OFF.
Interrupt input
Built-in input
Interrupt task
Cyclic tasks
(ladder programs) Ladder program
Interrupt occurs
Cycle
END
END
I/O refreshing
Condition for
Interrupt task
10
Interrupt task
2 executed
2 executed
10-2-1 Overview
The pulse widths of interrupt input signals must meet the following conditions.
1 PLC Setup
• Set IN2 to IN9 for interrupt inputs on the Built-in Input
Tab Page of the PLC Setup using the CX-Programmer.
• Terminals 02 to 09 on the CIO 0 terminal block can be
used for interrupt inputs. Bits CIO 0.02 to CIO 0.09 cor-
respond to terminals 02 to 09.
2 Interrupt task
Write the program in the interrupt task. Interrupt tasks 2 to
9 correspond to interrupt inputs 2 to 9.
Create
• Specify whether the interrupt is executed when the input
ladder
turns ON or when it turns OFF in the MSKS instruction.
program Execute MSKS
Set N to 112 to 119 in the MSKS instruction.
instruction in a
cyclic task • Enable input interrupts in the MSKS instruction. Set N to
102 to 109 in the MSKS instruction.
PLC Setup
Click the Built-in Input Tab and select Interrupt in the interrupt intput settings.
Select Interrupt
Note 1 The power supply must be restarted after the PLC Setup is transferred in order to enable the interrupt
input settings.
2 IN8 and IN9 are only supported by N20/30/40/60 CPU Units.
Interrupt input IN5: CIO 0.05 Interrupt input IN7: CIO 0.07
Interrupt input IN3: CIO 0.03 Interrupt input IN9: CIO 0.09
+ - COM NC 00 02 04 06 08 10
CIO 0
NC
Interrupt input IN2: CIO 0.02 Interrupt input IN8: CIO 0.08
Execution condition
@MSKS (1)Specifies creating an interrupt when
N the input turns OFF or when it turns
C ON.
@MSKS (2)Enables input interrupts.
N
C
The MSKS instruction must be executed only once to make the settings, so in general execute
MSKS in just one cycle using the upwardly differentiated variation of the instruction.
The first MSKS instruction can be omitted. If it is omitted, an interrupt will be created when the input
turns ON by default.
END
10
10-2-2 Flow of Operation
Sensor input
Sensor input 3 Sensor input 1 CIO 0.01
Sensor input 2 Sensor input
CIO 0.03
Reset input
CIO 0.04
OK output
CIO 100.00
NG output 1
CIO 100.01
NG output 2
CIO 100.02
NG output 3
CIO 100.03
NG output 4
CIO 100.04
1 PLC Setup
Set IN2 to Interrupt in the interrupt input settings on the Built-in Input Tab Page.
z Programming Example
Cyclic Task
P_First_Cycle
0.04
Reset input
Interrupt Task 2 10
10-2-3 Application Example
OK output
Sensor input 1 Sensor input 2 Sensor input 3
NG output 2
Sensor input 1
Sensor input 1
NG output 3
Sensor input 2
Sensor input 2
NG output 4
Sensor input 3
Sensor input 3
10-3-1 Overview
Scheduled interrupts can be used to execute interrupt tasks at fixed time intervals measured by the
CPU Unit’s internal timer.
Minimum interval: 1 ms
Specified interval
Interrupt task
Cyclic tasks
(ladder programs) Interrupt occurs Ladder program
Cycle
END
END
I/O refresh
Condition for
accepting interrupts
MSKS instruction executed Scheduled Interrupt Interval =
to set the scheduled 0.5 ms (example)
interrupt interval
1ms 1ms 1ms
Internal timer
Interrupt task Write the program for the corresponding interrupt task 1 (fixed).
Create
ladder Execute MSKS Use MSKS to specify the scheduled interrupt interval.
program instruction in a cyclic The setting can be 1 ms or longer.
task Set N to 4 or 14 in the MSKS instruction.
Execution condition
10
@MSKS
N Specifies scheduled interrupt (interrupt task 1)
10-3-2 Flow of Operation
The MSKS instruction must be executed only once to make the settings, so in general execute
MSKS in just one cycle using the upwardly differentiated variation of the instruction.
* Either is reset.
Example
In intervals of 1 ms
Interrupt
Interrupt task 1
END
END
The priority of interrupt tasks is the same order for input interrupts, scheduled interrupts and high-speed
counter interrupts. Therefore, if interrupt task A (an input interrupt, for example) is being executed when
interrupt task B (a scheduled interrupt, for example) occurs, task A execution will not be interrupted.
Task B execution will be started when task A had been completed.
For example, if an interrupt task is being executed for another interrupt (input interrupt or high-speed
counter interrupt) when a scheduled interrupt occurs, the scheduled interrupt will not be executed until
execution of the other interrupt task had been completed. Even in this case, internal timer is continually
measured in parallel, so the execution of the scheduled interrupt task will not be delayed.
just before and after the instructions, using the DI or EI instruction before the instructions to disable
interrupts and the DI or EI instruction after the instructions to enable interrupts again.
Additional Information
Normally, if an interrupt occurs, execution of the cyclic task will be interrupted immediately, even
during execution of an instruction in the cyclic task, and the partially processed data is saved.
After the interrupt task had been completed, the cyclic task restarts with the data saved before
the interrupt processing.
High-speed Counters
This section describes the high-speed counter inputs, high-speed counter interrupts,
and the frequency measurement function.
11-1 Overview
High-speed counters can be used with any model of CP2E CPU Unit.
11-1-1 Overview
High-speed counters are used to measure high-speed pulse input signals that cannot be measured by
counter (CNT) instructions.
z Applications
• Detecting the position or length of a workpiece with an input from an incremental rotary encoder.
• Measuring the speed of a workpiece from its position data using frequency measurement and
rotational speed conversion.
• High-speed processing according to the workpiece’s position data.
The present value of the high-speed counter is stored in the Auxiliary Area and can be used as posi-
tion data. When it reaches preset values, interrupts can be generated. The count can be started and
stopped. Depending on the instruction, the frequency (speed) can be read from the present value of
the high-speed counter.
Changes to PV
Settings
CTBL
11-1 Overview
1 PLC Setup
• Enable the required high-speed counters.
• Select the Use high speed counter Check Box for high-
speed counters 0 to 5. Set the input setting, counting
mode and reset method on the Built-in Input Tab Page of
the PLC Setup using the CX-Programmer.
• Terminals 00 to 06 on the CIO 0 terminal block can be 11
used for high-speed counters. High-speed counters 0 to
5 correspond to terminals 00 to 06.
2
PLC Setup
Click the Built-in Input Tab and select the Use high speed counter Check Box for high-speed counters
0 to 5. Set the counting mode, reset method, and input setting.
Note The power supply must be restarted after the PLC Setup is transferred in order to enable the high-speed
counter settings.
Input terminal block Pulse input method (Counting mode) Other functions that cannot be used at the same time
11-1 Overview
label pulse input input input input input puts 0 to 3
CIO 0 09 − − − Normal input 9 Interrupt input 9 Quick-response Pulse 3, Origin
(Note 1) input 9 (Note 1) input signal
(Note 2)
10 − − − Normal input 10 − − Pulse 0, Origin
proximity input
signal
11 − − − − −
Normal input 11 Pulse 1, Origin
proximity input 11
signal
CIO 1 00 − − − Normal input 12 − − Pulse 2, Origin
proximity input
Origin
Terminal Increment Differential phase Pulse/ Interrupt Quick- searches for
block Terminal
pulse input ×4 or up/down direction Normal input
input response pulse outputs 0
label input input input
and 1
CIO 0 00 High-speed High-speed High-speed Normal input 0 − − −
Counter 0, Counter 0, phase A Counter 0,
increment or up input pulse input
input
01 High-speed High-speed High-speed Normal input 1 − − −
Counter 1, Counter 0, phase B Counter 1,
increment or down input pulse input
input
02 High-speed High-speed High-speed Normal input 2 Interrupt input 2 Quick-response −
Counter 2, Counter 1, phase A Counter 0, input 2
increment or up input direction
input
03 − High-speed High-speed Normal input 3 Interrupt input 3 Quick-response Pulse 0, Origin
Counter 1, phase B Counter 1, input 3 proximity input
or down input direction signal
04 High-speed High-speed High-speed Normal input 4 Interrupt input 4 Quick-response −
Counter 3, Counter 0, phase Z Counter 0, input 4
increment or reset input reset input
input
05 High-speed High-speed High-speed Normal input 5 Interrupt input 5 Quick-response Pulse 1, Origin
Counter 4, Counter 1, phase Z Counter 1, input 5 proximity input
increment or reset input reset input signal
input
06 High-speed − − Normal input 6 Interrupt input 6 Quick-response Pulse 0, Origin
Counter 5, input 6 input signal
increment
input
07 − − − Normal input 7 Interrupt input 7 Quick-response Pulse 1, Origin
input 7 input signal
Note 1 The same pulse input must be used for high-speed counter 0 and high-speed counter 1.
2 High-speed counter 2 cannot be used if the input setting of high-speed counter 0 or high-speed counter 1
is set for differential phase inputs (4x), pulse + direction inputs, or up/down pulse inputs.
3 CIO 0.07 does not overlap with the high-speed counter function, so it can also be used for high-speed
counter.
Example: E6B2-CWZ6C
Brown+Vcc COM
NPN open-collector output (COM 24V)
Blue 0V(COM)
(Do not use the same I/O power supply as other equipment.)
Power provided 0V Power supply
Encoder 24V 0V
Shielded twisted-pair cable
CP2E CPU Unit
IA
Phase A 0.00
IB 0.01
Phase B
IZ
Phase Z 0.04
COM
11-1-3 Specifications
11-1 Overview
Item Description
Pulse input method Increment pulse Differential phase Up/down pulse Pulse + direction
(Counting mode) inputs inputs (×4) inputs inputs
Input signal Increment Phase-A Up pulse Pulse
− Phase-B Down pulse Direction 11
− Phase-Z Reset Reset
11-1-3 Specifications
Frequency E/S
-type 100 kHz: 50 kHz: 1 counter 100 kHz: 1 counter 100 kHz:
and number CPU Unit 2 counters 5 kHz: 1 counter 10 kHz: 1 counter 2 counters
of high- 10 kHz: 4 counters
speed N14/20 CPU 100 kHz: 50 kHz: 1 counter 100 kHz: 1 counter 100 kHz:
counters Unit 2 counters 2 counters
5 kHz: 1 counter 10 kHz: 1 counter
10 kHz: 4 counters
N30/40/60 100 kHz: 50 kHz: 2 counters 100 kHz: 2 counters 100 kHz:
CPU Unit 3 counters 2 counters
10 kHz: 3 counters
Counting mode Linear mode or circular (ring) mode
Count values Linear mode: 8000 0000 to 7FFF FFFF hex
Ring Mode: 0000 0000 to Ring SV
High-speed counter PV High-speed counter 0: A271 (upper 4 digits) and A270 (lower 4 digits)
storage locations High-speed counter 1: A273 (upper 4 digits) and A272 (lower 4 digits)
High-speed counter 2: A317 (upper 4 digits) and A316 (lower 4 digits)
High-speed counter 3: A319 (upper 4 digits) and A318 (lower 4 digits)
High-speed counter 4: A323 (upper 4 digits) and A322 (lower 4 digits)
High-speed counter 5: A325 (upper 4 digits) and A324 (lower 4 digits)
The PVs are refreshed in the overseeing processes at the start of each cycle. Use
PRV to read the most recent PVs.
Data format: 8 digit hexadecimal
• Range in linear mode: 8000 0000 to 7FFF FFFF hex
• Range in Ring Mode: 0000 0000 to Ring SV (Circular Max. Count)
Control Target value Up to 6 target values and corresponding interrupt task numbers can be registered.
method comparison
Range Up to 6 ranges can be registered, with a separate upper limit, lower limit, and inter-
comparison rupt task number for each range.
Counter reset method • Phase-Z + Software reset
The high-speed counter is reset when the phase-Z signal goes ON while the
Reset Bit (A531.00 to A531.05) is ON. (Phase Z cannot be used for the incre-
ment pulse.)
• Software reset
The high-speed counter is reset when the Reset Bit (A531.00 to A531.05) is
turned ON.
Operation can be set to stop or continue the comparison operation when the high-
speed counter is reset.
Direction
OFF→ON OFF No change 11
ON OFF→ON Increment
ON→OFF ON No change
0 1 2 3 4 5 6 7 8 7 6 5 4 3 2 1 0 OFF ON→OFF No change
500µs min.
Direction
Pulse
Direction
500µs min.
Additional Information
The count of a high-speed counter can be monitored to see if it is currently being incremented or
decremented. The count in the current cycle is compared with the count in the previous cycle to
determine if it is being incremented or decremented.
The results are reflected in the High-speed Counter Count Direction Flags.
Address of High-speed
High-speed counter
Counter Count Direction Flag
High-speed counter 0 A274.10
High-speed counter 1 A275.10
High-speed counter 2 A320.10
High-speed counter 3 A321.10
High-speed counter 4 A326.10
High-speed counter 5 A327.10
Linear Mode
Input pulses can be counted in the range between the lower limit and upper limit values. If the pulse
count goes beyond the lower/upper limit, an underflow/overflow will occur and counting will stop.
• Increment Mode
0 4294967295
(000000 Hex) (FFFFFFFF Hex)
PV overflow
• Up/Down Mode
-2147483648 0 +2147483647
(80000000 Hex) (00000000 Hex) (7FFFFFFF Hex)
PV underflow PV overflow
Maximum ring
count
Phase Z
Reset bit
Note The phase-Z signal cannot be used if an incremental counter is specified. Only a software reset can be used.
Software Reset
The high-speed counter’s PV is reset when the corresponding High-speed Counter Reset Bit (A531.00
to A531.05) goes from OFF to ON.
The CPU Unit recognizes the OFF-to-ON transition of the High-speed Counter Reset Bit only at the begin-
ning of the PLC cycle during the overseeing processes. Reset processing is performed at the same time.
The OFF-to-ON transition will not be recognized if the Reset Bit goes OFF again within the same cycle.
One cycle
Reset bit
Additional Information
The comparison operation can be selected to stop or continue in the PLC Setup when a high-
speed counter is reset. This enables applications where the comparison operation can be
restarted from a counter PV of 0 when the counter is reset.
@PRV
#0010 C1: Port specifier (example for high-speed counter input 0 (fixed))
#0000 C2: Control data (for reading PV)
D100 S: First destination word
15 0
Overview
This function measures the frequency of the high-speed counter (input pulses.)
The input pulse frequency can be read by executing the PRV instruction. The measured frequency is
output in 8-digit hexadecimal and expressed in Hz. The frequency measurement function can be used 11
with high-speed counter 0 only.
The frequency can be measured while a high-speed counter 0 comparison operation is in progress.
@PRV
#0010 C1: Port specifier (example for high-speed counter input 0 (fixed))
#0013 C2: Control data for reading frequency (10-ms sampling)
D100 S: First destination word
15 0
Present frequency
D100 data lower bytes High-speed counter frequency
D101
Present frequency that was read
data upper bytes
z Specifications
Item Specifications
Number of frequency mea- 1 input (high-speed counter 0 only)
surement inputs
Frequency measurement High-speed counter 0:
range Differential phase inputs: 0 to 50 kHz
All other input modes: 0 to 100 kHz
Measurement method Execution of the PRV instruction
Stored data Unit Hz
Output data Differential phase input: 0000 0000 to 0003 0D40 hex (0 to 200 kHz)
range* All other input modes: 0000 0000 to 0001 86A0 hex (0 to 100 kHz)
* If the frequency exceeds the maximum value, the maximum value will be stored.
11-3-1 Overview
This function counts input pulses with the CPU Unit’s built-in high-speed counter and executes an inter-
rupt task when the count reaches the preset value or falls within a preset range (target-value or zone
comparison). An interrupt task between 0 and 15 can be allocated with the CTBL instruction.
Rotary Encoder
Built-in input
Time
Interrupt task
Cyclic tasks
(ladder programs) Interrupt occurs Ladder diagram
Cycle
END
END
I/O refresh
Target value 1
Target value range
Target value 2
0 0
Time Time
Counting enabled Counting enabled
Cyclic task Interrupted Cyclic task Interrupted Cyclic task Cyclic task Interrupted Cyclic task Interrupted Cyclic task
execution execution execution execution execution execution
Interrupts
• Enable the required high-speed counters.
PLC Setup • Select the Use high speed counter Check Box for
high-speed counters 0 to 5. Set the input setting,
counting mode and reset method on the Built-in
Tab Page of the PLC Setup using the CX-Pro-
grammer. 11
• Terminals 00 to 06 on the 0CH terminal block can
be used for high-speed counters. High-speed
counters 0 to 5 correspond to terminals 00 to 05.
11-3-1 Overview
2 Interrupt task
Write a program for interrupt tasks 0 to 15.
PLC Setup
Click the Built-in Input Tab and select the Use high-speed counter Check Box for high-speed counters 0
to 5, and then set the counting mode, reset method, and input setting.
Interrupts
started in this step.
The following examples show the operation of an interrupt task for a comparison table.
Example 1
High-speed counter PV
Comparison table
Number of values = 4
Target value 4 Target value 1 (when counting up)
Target value 3
Comparison is Interrupt task = 0
executed according Target value 2 (when counting up)
to the order of the Interrupt task = 1
Target value 2
values in the table. Target value 3 (when counting up)
Interrupt task = 5
Target value 1 Target value 4 (when counting up)
Interrupt task = 8
Time
Interrupt task number that is started. No.0 No.1 No.5 No.8 No.0
Example 2
High-speed counter PV
Comparison table
Number of values = 4
Target value 1 Target value 1 (when counting up)
Target value 2
Comparison is Interrupt task = 0
executed according Target value 2 (when counting down)
to the order of the Interrupt task = 1
Target value 3
values in the table. Target value 3 (when counting down)
Interrupt task = 5
Target value 4 Target value 4 (when counting down)
Interrupt task = 8
Time
Interrupt task number that is started. No.0 No.1 No.5 No.8
Bad OK
Match / Target value + 1 Target value + 2
• The maximum response frequencies of the high-speed counters are given in the following table.
E/S
-type and
Item N30/40/60 CPU Unit
N4/20 CPU Unit
Incremental pulse 100kHz 100kHz
Up and down pulses
High-speed counter 0
Pulse plus direction
Differential phase (×4) 50kHz 50kHz
Incremental pulse 100kHz 100kHz
Up and down pulses 10kHz
High-speed counter 1
Pulse plus direction 100kHz
Differential phase (×4) 5kHz 50kHz
High-speed counter 2 Incremental pulse 10kHz 100kHz
High-speed counter 3 Incremental pulse 10kHz
High-speed counter 4 Incremental pulse
High-speed counter 5 Incremental pulse
Interrupts
when using target matching.
Use the counters for target matching under the frequencies in the following table.
If the pulse frequencies input to the high-speed counters are higher than those in the table,
target matching may be omitted.
• When using target matching, the interval between interrupts for target matches must be
longer than 3 ms plus the sum of execution time for interrupt tasks that may possibly happen
at the same time.
The sum of execution time for interrupt tasks in one cycle is stored in A442.
Range Comparison
The specified interrupt task is executed when the high-speed counter PV is within the range defined by
the upper and lower limit values.
• The comparison conditions (upper and lower limits of the range) are registered in the comparison
table along with the corresponding interrupt task number. The specified interrupt task will be exe-
cuted once when the high-speed counter PV is in the range (Lower limit ≤ PV ≤ Upper limit).
Time
Interrupt task number to execute No.2 No.1 No.1 No.2
• A total of 6 ranges (upper and lower limits) are registered in the comparison table.
• The ranges can overlap.
• A different interrupt task can be registered for each range.
• The counter PV is compared with the 6 ranges once each cycle.
• The interrupt task is executed just once when the comparison condition goes from unmet to met.
When more than one comparison condition is met in a cycle, the first interrupt task in the table
will be executed in that cycle. The next interrupt task in the table will be executed in the next
cycle.
Additional Information
The range comparison table can be used without starting an interrupt task when the comparison
condition is met. The range comparison function can be useful when you just want to know
whether or not the high-speed counter PV is within a particular range.
Use the Range Comparison Condition Met Flags to determine whether the high-speed counter
PV is within a registered range.
Execution condition
@CTBL
C1 C1: Port specifier
C2 C2: Control data
S S: First comparison table word
Operand Settings
C1 Port specifier #0000 High-speed counter 0
~
~
Interrupts
15 0
S Number of target values 0001 to 0006 hex (1 to 6 target values)
15 0
S Lower word of range 1 lower limit
0000 0000 to FFFF FFFF hex (See note.)
S+1 Upper word of range 1 lower limit
S+2 Lower word of range 1 upper limit
0000 0000 to FFFF FFFF hex (See note.)
S+3 Upper word of range 1 upper limit
Range 1 interrupt task number
Note Always set the upper limit greater than or equal to the lower limit for any one range.
Execution condition
@INI
C1 C1: Port specifier
C2 C2: Control data
S S: First word of new PV
Operand Settings
C1 Port specifier #0010 High-speed counter 0
~
~
#0015 High-speed counter 5
C2 Control data #0000 Start comparison.
#0001 Stop comparison.
#0002 Change the PV.
S First word of S contains the first word of the new PV when C is set to #0002
new PV (change the PV).
W0.00
Interrupts
@CTBL
#0000 Use high-speed counter 0.
#0000 Register a target-value comparison
D1000 table and start comparison operation.
First comparison table word. 11
When execution condition W0.00 turns ON, the comparison starts with high-speed counter 0.
W0.00
0.00
0.01
Counting enabled
1 Set high-speed counter 1 on the PLC Setup’s Built-in Input Tab Page.
Item Setting
High-speed counter 1 Use counter
Counting mode Circular mode
Circular Max. Count 50,000
Reset method Software reset (continue comparing)
Input Setting Up/Down inputs
2 Set the range comparison table starting at word D2000. Even though range 1 is the only range
being used, all 30 words must still be dedicated to the range comparison table.
Word Setting Function
D2000 #61A8 Rightmost 4 digits of range 1 lower Lower limit value: 25,000
limit
D2001 #0000 Leftmost 4 digits of range 1 lower limit
D2002 #639C Rightmost 4 digits of range 1 upper Upper limit value: 25,500
limit
D2003 #0000 Leftmost 4 digits of range 1 upper limit
D2004 #000C Range 1 interrupt task number = 12 (C hex)
D2005 All Range 2 lower and upper limit values Range 2 settings
to #0000 (Not used and do not need to be set.)
D2008
D2009 #FFFF Disables range 2.
D2014 #FFFF ~
Set the fifth word for ranges 3 to 6 (listed at left) to #FFFF (Range
D2019 settings are invalid) to disable those ranges.
D2024
D2029
4 Use the CTBL instruction to start the comparison operation with high-speed counter 1 and inter-
rupt task 12.
W0.00
@CTBL
#0001 Use high-speed counter 1.
#0001 Register a range comparison table
D2000 and start comparison operation.
First comparison table word.
When execution condition W0.00 turns ON, the comparison starts with high-speed counter 1.
When the PV of high speed counter 1 is between 25,000 and 25,500, cyclic task execution is
interrupted, and interrupt task 12 is executed.
When interrupt task 12 execution is completed, execution of the interrupted cyclic task resumes.
W0.00
0.02
0.03
High-speed counter 1 PV
(in A272 and A273)
Counting enabled
and Words
Bits and Words Allocated in the Auxiliary Area
High- High- High- High- High- High-
Contents speed speed speed speed speed speed
counter 0 counter 1 counter 2 counter 3 counter 4 counter 5
11
High-speed Leftmost 4 digits A271 A273 A317 A319 A323 A325
counter PV Rightmost 4 digits A270 A272 A316 A318 A322 A324
storage
z Operation Overview
A sheet feeder is controlled to feed constant lengths in a given direction, e.g., for vacuum packing of
food products.
Motor speed
3550
Number of pulses 3500
counted by high- 3000
speed counter (Pulses)
(A270)
While the pulse count is between 3,500 and 3,550, normal stop position output (CIO 100.02) will be
ON. If the pulse count exceeds 3550, the error stop position output (CIO 100.03) will turn ON.
Wiring Example
White Phase B
Orange Phase Z
Brown
11
Example: E6B2-CWZ6C
NPN open-collector output Blue
24 VDC
power supply
Start motor
100 to 240 VAC
CP2E-N20DR-A
PLC Setup
Use the following procedure to enable high-speed counter 0.
3 Select the Use high speed counter 0 Check Box for high-speed counter 0.
z Programming Example 1
In this example, the CTBL (COMPARISON TABLE LOAD) instruction is used to create an interrupt
when the target value is reached. Slowing and stopping are executed as interrupt tasks, allowing
high-speed processes to be executed without affecting the cycle time.
Ladder Program
Use the CTBL instruction to execute interrupt tasks when the target positions are reached.
Interrupt task 4
Turns ON the motor
low speed output
When the present vale of the high-speed counter matches target value 2 (3500), interrupt task 5 is 11
executed.
Interrupt task 5
Turns OFF the motor
low speed output
DM Area Setup
The comparison table for the CTBL (COMPARISON TABLE LOAD) instruction is set in D600 through
D606.
Word Value Contents
D600 0002 Number of target values: 2
D601 0BB8 Target value 1: 3000 (BB8 hex)
D602 0000
D603 0004 Target value 1: Interrupt task No.4
D604 0DAC Target value 2: 3500 (DAC hex)
D605 0000
D606 0005 Target value 2: Interrupt task No.5
12-1 Overview
Pulse outputs can be used only with the CP2E N/S
-type CPU Unit with transistor outputs.
12-1-1 Overview
12-1 Overview
Pulse outputs can be output from the CPU Unit's built-in outputs using instructions to perform position-
ing or speed control with a servomotor or a stepping motor that accepts pulse inputs. It is also possible
to perform origin searches or origin returns.
zTrapezoidal control
Frequency (speed)
12
12-1-1 Overview
Travel distance
Built-in output
zJogging
Frequency (speed)
Servo Drive (or
stepping driver)
Travel distance
Time
Servomotor (or
stepping motor) zOrigin search
Frequency (speed)
Travel distance
Time
CP2E
Pulse output PV in
Auxiliary Area
ORG (Positioning
CW limit input completed)
Wiring Example
Sinking outputs
L L
V+ 00 01 02
V- COM(V-) COM 03
Although V- and COM(V-) are connected internally, also wire them externally.
Sourcing outputs
L L
V+ 00 01 02
V- COM(V+) COM 03
Although V+ and COM(V+) are connected internally, also wire them externally.
Do not connect an external power supply to N
-type CPU Units.
1 PLC Setup
• Setting is required for the following situations:
• Performing an origin search.
• Using the Limit Input Signal as an input to func-
tions other than origin searches.
PLC Setup
To perform an origin search or to use a Limit Input Signal as an input to a function other than origin
search, set the parameters on the Pulse Output 0 to 3 Tab Pages in the PLC Setup.
12-1 Overview
12
Note The power supply must be restarted after the PLC Setup is transferred in order to enable the pulse output
settings.
Refer to 12-6 Defining Origin Position for origin search settings in the PLC Setup.
Pulses
Origin Searches
Use the following input and output terminals for origin searches.
Input Terminals
• N20/30/40/60 or S30/40/60 CPU Units
Input terminal block Setting in PLC Setup Other functions that cannot be used at the same time
12-1 Overview
High-speed
Terminal counter setting
Terminal Enable origin searches Normal Interrupt Quick-response
block
number for pulse outputs 0 to 3 inputs inputs inputs Increment
label
pulse input
CIO 0 06 Pulse 0, Origin input signal Normal Interrupt Quick-response High-speed
input 6 input 6 input 6 counter 5 12
07 Pulse 1, Origin input signal Normal Interrupt Quick-response −
input 7 input 7 input 7
Output Terminals
Other functions that cannot
Output terminal block Setting in PLC Setup
be used at the same time
Terminal Terminal Enable origin searches for pulse
Normal outputs
block label number outputs 0 and 1
CIO 100 04 Pulse 0, Error counter reset output Normal output 4 (Note 2)
05 Pulse 1, Error counter reset output Normal output 5 (Note 2)
06 Pulse 2, Error counter reset output (Note 1) Normal output 6
07 Pulse 3, Error counter reset output (Note 1) Normal output 7
CIO 100 00 CIO 100.00 Stored in A276 Pulse Connect to Servo Drive’s pulse input (PULS).
and A277.
02 CIO 100.02 Direction Connect to Servo Drive’s direction input (SIGN).
Normal input The external signal must be CW limit Connect sensor to a normal input terminal.
received as an input and sensor
the input status must be
written to A540.08 in the
ladder program.
Normal input The external signal must be CCW limit Connect sensor to a normal input terminal.
received as an input and sensor
the input status must be
written to A540.09 in the
ladder program.
CIO 0 03 CIO 0.03 Origin prox- Connect to sensor for N14 CPU Unit.
imity input
06 CIO 0.06 Origin input Connect to open- Connect to the Connect to the
collector output phase-Z signal from phase-Z signal from
from sensor or the Servo Drive. the Servo Drive.
other device.
10 CIO 0.10 Origin prox- Connect to sensor for N20/30/40/60 CPU Unit.
imity input
CIO 100 04 CIO 100.04 Error Not used. Connect to error counter reset (ECRST)
counter of the Servo Drive.
reset output
Normal input The external signal must be Positioning Not used. Connect the Posi-
received as an input and completed tioning Completed
the input status must be input Signal (INP) from the
written to A540.10 in the Servo Drive to a nor-
ladder program. mal input terminal.
12-1 Overview
03 CIO 100.03 Direction Connect to Servo Drive’s direction input (SIGN).
Normal input The external signal must be CW limit Connect sensor to a normal input terminal.
received as an input and sensor
the input status must be
written to A541.08 in the
ladder program.
Normal input The external signal must be CCW limit Connect sensor to a normal input terminal.
received as an input and
the input status must be
sensor 12
written to A541.09 in the
ladder program.
24-VDC
CP2E CPU Unit built-in output terminals power
supply
+ - Servo Drive for 24-VDC input
12-1 Overview
PULS
(+)
PULS
100.00
100.01 (-)
(+)
SGN 12
100.02
100.03 (-)
Direction output
24-VDC
CP2E CPU Unit built-in output terminals power
supply
+ - Servo Drive for 24-VDC input
V+
PULS
(+)
PULS
100.00
100.01 (-)
(+)
SGN
100.02
100.03 (-)
Direction output
COM
V-
Set the Servo Drive’s command pulse mode to feed pulse and forward/reverse signals because the
method of pulse output from a CP2E CPU Unit is pulse + direction.
G5-series R88D-KT
Output terminal block R88A-CPGS PIN Signal
Pulse output (CIO 100.00) 1 +24VCW
Pulse 4 -PULS
output 0 Direction output (CIO 100.02) 2 +24VCCW
6 -SIGN
COM
V+ (S-type only)
V- (S-type only)
Input terminal block 25 ZGND
Pulse 0 origin input signal (CIO 0.06) 19 Z
COM 7 +24VIN
24-VDC Servo Drive
RUN input X1
Pulse 0 origin proximity input signal (CIO 0.10) 29 RUN
36 ALMCOM
10 BKIRCOM
X1 37 /ALM
24-VDC
XB 11 BKIR
Hood FG
Only S-type CPU Units can wire V+ and V-. Do not wire them in N-type CPU Units.
12-1 Overview
4 Gray/Black (1) -CW/-PULS/-FA 29 Yellow/Red (3) SI6
5 White/Red (1) +CCW/+SIGN/+FB 30 Pink/Red (3) SI7
6 White/Black (1) -CCW/-SIGN/-FB 31 Yellow/Black (3) SI8
7 Yellow/Red (1) +24VIN 32 Gray/Black (4) SI9
8 Pink/Red (1) SI1 33 Orange/Red (4) SI10
9 Pink/Black (1) SI2 34 White/Red (4) SO2- 12
10 Orange/Red (2) SO1- 35 White/Black (4) SO2+
11 Orange/Black (2) SO1+ 36 Yellow/Red (4) ALMCOM
z Applicable Instructions
The following instructions are used.
Purpose Overview Instruction Reference
Performing trapezoidal control Performs trapezoidal pulse output PLS2: PULSE Refer to 12-2
control with independent accelera- OUTPUT
tion and deceleration rates.
(The number of pulses can be set.)
Jogging Without acceleration Performs pulse output control without SPED: SPEED Refer to 12-3
and deceleration acceleration or deceleration. OUTPUT
With acceleration Performs trapezoidal pulse output ACC:
and deceleration control with the same acceleration ACCELERATION
and deceleration rates. CONTROL
Performing interrupt feeding Performs interrupt feeding with inter- IFEED: INTERRUPT Refer to 12-4
rupt input and pulse output. FEEDING
Positioning Linear Interpolation Performs 2-axis to 4-axis linear inter- ITPL: LINEAR Refer to 12-5
polation. INTERPOLATION
Performing origin searches Actually moves the motor with pulse ORG: ORIGIN Refer to 12-6-4
outputs and defines the machine ori- SEARCH
gin based on the Origin Proximity
Input and Origin Input signals.
Performing origin returns Returns to the origin position from ORG: ORIGIN Refer to 12-6-6
any position. SEARCH
Changing or reading the pulse Changes the PV of the pulse output. INI: MODE Refer to 12-6-7
output PV (This operation defines the origin CONTROL
location.)
Reads the PV of the pulse output. PRV: HIGH-SPEED Refer to 12-7
COUNTER PV READ
12-1-3 Specifications
Item Specifications
Output mode Continuous mode (for speed control) or independent mode (for position con-
12-1 Overview
trol)
Positioning (independent mode) instruc- PULS and SPED, PULS and ACC, or PLS2
tions
Speed control (continuous mode) SPED or ACC
instructions
Origin (origin search and origin return) ORG
instructions 12
Interrupt feeding instructions IFEED
12-1-3 Specifications
Linear interpolation instructions ITPL (N-type CPU Unit only)
Output frequency 1 Hz to 100 kHz (1 Hz units)
S-type and N14/20 CPU Unit: 2 pulse outputs
N30/40/60 CPU Unit: 4 pulse outputs
Frequency acceleration and decelera- Set in increments of 1 Hz for acceleration/deceleration rates from 1 to 65,535 Hz
tion rates (every 4 ms).
Changing SVs during instruction execu- The target frequency, acceleration/deceleration rate, and target position can
tion be changed.
ORG, IFEED and ITPL instructions cannot be changed.
Duty factor Fixed at 50%
The duty factor is less than 50% only when the output is less than 125 Hz by
linear interpolation.
Pulse output method Pulse + direction outputs (CW/CCW outputs cannot be used.)
Number of output pulses Relative coordinates: 0000 0000 to 7FFF FFFF hex(Accelerating or decelerat-
ing in either direction: 2,147,483,647)
Absolute coordinates: 8000 0000 to 7FFF FFFF hex(-2,147,483,648 to
2,147,483,647)
Pulse output PV’s relative/absolute Absolute coordinates are specified automatically when the origin location has
coordinate specifications been defined by setting the pulse output PV with the INI instruction or perform-
ing an origin search with the ORG instruction. Relative coordinates are used
when the origin location is undefined.
Relative pulse/absolute pulse specifica- The pulse type can be specified with an operand in the PULS or PLS2 instruc-
tions tion.
Only absolute pulse can be specified with linear interpolation (ITPL) instruc-
tion.
Note The absolute pulse specification can be used when absolute coordi-
nates are specified for the pulse output PV, i.e. the origin location has
been defined.The absolute pulse specification cannot be used when rel-
ative coordinates are specified, i.e. the origin location is undefined. An
instruction error will occur.
Pulse output PV’s storage location The following Auxiliary Area words contain the pulse output PVs
Pulse output 0: A277 (leftmost 4 digits) and A276 (rightmost 4 digits)
Pulse output 1: A279 (leftmost 4 digits) and A278 (rightmost 4 digits)
Pulse output 2: A53 (leftmost 4 digits) and A52 (rightmost 4 digits)
Pulse output 3: A55 (leftmost 4 digits) and A54 (rightmost 4 digits)
The PVs are refreshed during regular I/O refreshing.
Specified number of
pulses
Starting frequency
=
Number of movement
pulses
Number of pulses setting
=
Number of 100
movement pulses Pulse output
0 Target position Present position PV
100 Origin
+100
+200
Pulse output
0 Target position= Present position PV
Number of pulses setting
Origin
The absolute pulse cannot be specified with the origin undefined. Please specify them when the
origin is defined by performing the origin searches.
Additional Information
The origin position is undefined in the following case. Please define the origin position by per-
forming the origin searches again.
• When the pulse output reset flag is turned ON
• When the RUN or MONITOR mode is changed to the PROGRAM mode
Applicable Instructions
PLS2
Preparations
z PLC Setup
There are no settings that need to be made in the PLC Setup.
z DM Area Settings
• Settings for PLS2 Instruction (D0 to D7)
Setting Address Data
0.00
@PLS2
#0001 ← Pulse output 1
Start input
#0100 ← Specifies Pulse + Direction output method, CW, and relative pulses
D0 ← Acceleration rate, deceleration rate, target frequency, number of pulses setting
D6 ← Starting frequency
Additional Information
• Absolute pulses can be specified when the origin position has been defined.
• If a target frequency that cannot be reached has been set, the target frequency will be reduced
automatically, i.e., triangular control will be performed. In some cases where the acceleration
rate is substantially greater than the deceleration rate, the operation will not be true triangular
control. The motor will be operated at a constant speed for a short time between the accelera-
tion and deceleration.
12-3 Jogging
Jogging can be performed by using the SPED (SPEED OUTPUT) and ACC (ACCELERATION CON-
TROL) instructions. This section describes the steps for jogging.
Acceleration
Target frequency and
deceleration
rate
Target frequency Starting pulse output: 1 Hz to 100 kHz (in increments of 1 Hz)
Stopping pulse output: 0 Hz
Acceleration and deceleration rate Set in increments of 1 Hz from 1 to 65,535 Hz (every 4 ms).
Direction specification Set to CW or CCW.
Mode specification Set to continuous mode.
Start pulse output without acceleration or deceleration using the SPED instruction. Set the target fre-
quency of the SPED instruction to 0 Hz to stop the pulse output.
Target frequency
Target frequency Starting pulse output: 1 Hz to 100 kHz (in increments of 1 Hz)
Stopping pulse output: 0 Hz
Direction specification Set to CW or CCW.
Mode specification Set to continuous mode.
Pulse frequency
CCW
CW low-speed jogging (CIO 0.00)
12-3 Jogging
CCW low-speed jogging (CIO 0.01)
The example shows jogging with acceleration and deceleration executed using an ACC instruction. It is
used for high-speed jogging.
• Clockwise high-speed jogging will be executed from pulse output 1 while CIO 0.04 is ON.
12
• Counterclockwise high-speed jogging will be executed from pulse output 1 while CIO 0.05 is ON.
Acceleration/
Pulse frequency deceleration rate
100Hz/4ms
Acceleration/
deceleration rate
100Hz/4ms
CCW
Preparations
z PLC Setup
There are no settings that need to be made in the PLC Setup.
z DM Area Settings
• Settings to Control Speed while Jogging (D0 to D1 and D10 to D15)
Setting Address Data
Target frequency (low speed): 1,000 Hz D0 #03E8
D1 #0000
Acceleration rate: 100 Hz/4 ms D10 #0064
Target frequency (high speed): 100,000 Hz D11 #86A0
D12 #0001
Acceleration/deceleration rate: 100 Hz/4 ms D13 #0064
(Not used.)
Target frequency (stop): 0 Hz D14 #0000
D15 #0000
Ladder Program
0.00 A281.04
SPED
Low-speed Pulse Output #0001 ← Pulse output 1
#0100 ← Specifies Pulse + Direction output method, CW, and continuous mode.
CW Start in Progress D0 ← Target frequency
SET W0.00
W0.00 0.00
SPED
Low-speed Low-speed #0001
CW Start #0100
CW output #0000
in progress
RSET W0.00
0.01 A281.04
SPED
Low-speed Pulse Output #0001 ← Pulse output 1
CCW Start in Progress #0110 ← Specifies Pulse + Direction output method, CCW, and continuous mode.
D0 ← Target frequency
SET W0.01
W0.01 0.01
SPED
Low-speed Low-speed #0001
CCW output CCW Start #0110
#0000
in progress
RSET W0.01
0.04 A281.04
ACC
High-speed Pulse Output #0001 ← Pulse output 1
CW Start in Progress #0100 ← Specifies Pulse + Direction output method, CW, and continuous mode.
D10 ← Acceleration/deceleration rate and target frequency
SET W0.02
W0.02 0.04
ACC
High-speed High-speed #0001
CW output CW Start #0100
D13
in progress
RSET W0.02
0.05 A281.04
ACC
High-speed Pulse Output #0001 ← Pulse output 1
CCW Start in Progress #0110 ← Specifies Pulse + Direction output method, CCW, and continuous mode.
D10 ← Acceleration/deceleration rate and target frequency
SET W0.03
W0.03 0.05
ACC
#0001
High-speed High-speed
#0110
CCW output CCW Start D13
in progress
RSET W0.03
Additional Information
The PLS2 instruction can be used to set a starting frequency or separate acceleration and decel-
eration rates, but there are limitations on the operating range because the end point must be
specified in the PLS2 instruction.
Additional Information
• Only specific pulse outputs and interrupt inputs can be used together.
If you want to pair any other pulse outputs and interrupt inputs, or if you want to change set-
tings during pulse output, use the ACC and PLS2 instructions together.
If the ACC and PLS2 instructions are used, delays will occur for the interrupt startup time and
possibly for other interrupts.
• The IFEED instruction cannot be executed when the pulse output port specified by the axis
specifier of the IFEED instruction is already outputting pulses by the SPED, ACC, PLS2, ORG,
IFEED and ITPL instructions. P_ER flag turns ON.
1 PLC Setup
• Select Interrupt Input in the Interrupt Input
Dialog Box that is accessed from the Built-in
Input Tab Page of the PLC Setup using the
CX-Programmer.
2 Create ladder program.
• Set whether to start the interrupt on OFF
transitions or ON transitions in the input
using the MSKS instruction.
• Set pulse output ports 0 to 3, output mode,
output direction, acceleration/deceleration
rate, target frequency, and number of output
pulses.
• Execute the IFEED instruction.
PLC Setup
* Pulse output 2 and pulse output 3 can be used with N30/40/60 CPU unit.
W0.00
@MSKS
116 Interruptinput 6
#0001 Input signal OFF detection
Execution condition
@IFEED
#0100 Interrupt input 6 and pulse output 0
Pulse + direction and CW direction
#0000
Acceleration rate:
12
D0 First word of D0 #0032
setting table S: 50 Hz/4 ms
S+1: D1 #0014 Deceleration rate:
20 Hz/4 ms
50 Hz/4 ms 20 Hz/4 ms
Speed Position
control control
Time
IFEED executed
Startup frequency
(S+4)
Time
Port 0 frequency
Time
Port 1 frequency
Time
• The target frequency and starting frequency set the frequency of linear interpolation positioning. The
frequency and travel distance of each axis are automatically set internally.
• The stop during linear interpolation can be immediate stop or deceleration stop.
In the case of a deceleration stop, it stops on a linear interpolation line. Please execute the linear
interpolation instruction again to restart.
The linear interpolation positioning can not be performed with the origin undefined. Please spec-
ify them when the origin is defined by performing the origin searches.
If the output speed is less than 125 Hz, pulse output cannot be performed because the number
of pulse per cycle is less than one pulse. As a result, the pulse duty factor may not be 50%.
Additional Information
• The ITPL instruction can not be executed when the pulse output port specified by the axis
specifier of the ITPL instruction is already outputting pulses by the SPED, ACC, PLS2, ORG,
IFEED and ITPL instructions. P_ER flag turns ON.
• The distance and the operation time that can be moved by linear interpolation have an upper
limit. Please specify the linear distance to 100,000,000 pulses or less, and the operation time
to 1,000 seconds or less.
• Set the starting frequency ≤ target frequency. If the starting frequency > target frequency, it
operates at the target frequency.
W0.00
@ITPL(893)
D100 01F4 Acceleration rate: 500Hz/4ms
Pulse output 1
Deceleration rate
400Hz/4ms
70,000
Target frequency
30kHz
Acceleration
rate
500Hz/4ms
Startup position
800,000
Pulse output 0
Name Action
Pulse Output PV Storage Words Current value is stored.
Pulse Output Reser Bit During linear interpolation, the pulse output PV cannot be cleared even if the
reset flag is turned ON.
CW Limit Input Signal Flag Valid only when Limit Input Signal Operation in PLC Setting is Always.
CCW Limit Input Signal Flag Valid only when Limit Input Signal Operation in PLC Setting is Always.
Accel/Decel Flag ON when the linear interpolation is accelerating or decelerating. All the pulse 12
outputs specified by the linear interpolation instruction operate in the same
way.
In the following example, the motor is started at a specified speed, accelerated to the origin search high
speed, and run at that speed until the origin proximity position is detected. After the Origin Proximity
Input is detected, the motor is decelerated to the origin search low speed and run at that speed until the
origin position is detected. The motor is stopped at the origin position.
1
Origin Proximity
Input Signal 0
Origin Input 1
Signal
0
Pulse frequency
Origin search high speed Origin search deceleration rate
Origin search
acceleration rate
Deceleration point Origin search proximity speed
Origin search
initial speed
Time
Start Decelerate from high to low speed Stop
Additional Information
The motor can be moved even if the origin position has not been defined, but positioning opera-
tions will be limited as follows:
• Origin return: Cannot be used.
• Positioning with absolute pulse specification: Cannot be used.
• Positioning with relative pulse specification: Outputs the specified number of pulses after set-
ting the present position to 0.
* The actual monitoring time will be the Positioning Monitor Time rounded up to the nearest 10-ms unit + 10 ms
max. If the Positioning Monitor Time is set to 0, the function will be disabled and the Unit will continue waiting for
the Positioning Completed Signal to come ON. (A Positioning Timeout Error will not be generated.)
Note The power supply must be restarted after the PLC Setup is transferred in order to enable the
settings for using the origin search.
Operating Mode
The operating mode parameter specifies the kind of I/O signals that are used in the origin search.
I/O signal Mode 0 Mode 1 Mode 2
Driver Stepping motor* Servomotor
Operation Origin Input Inputs signals are arranged Even if an Origin Input Signal is received during
Signal so deceleration starts when deceleration, it is ignored. After the motor has
the Origin Proximity Input reached the origin search proximity speed and the 12
Signal is received and then Origin Input Signal is received, the motor stops, com-
the Origin Input Signal is pleting the origin search process.
received while the motor is
decelerating to the origin
search proximity speed. If an
Origin Input Signal is
detected during this deceler-
ation, an Origin Input Signal
error will occur and the
motor will decelerate to a
stop.
Positioning The Positioning Completed The Positioning Com- After detecting the origin,
Completed Signal from the driver is not pleted Signal from the the origin search pro-
Signal connected. * driver is not connected. cess is not completed
Use this mode when you until the Positioning
want to reduce the pro- Completed Signal is
cessing time, even at the received.
expense of positioning Use this mode when you
accuracy. want high positioning
accuracy.
* There are stepping motor drivers that are equipped with a Positioning Completed Signal like a servomotor. Oper-
ating modes 1 and 2 can be used with these stepping motor drivers.
The use of an error counter reset output and positioning completed input depends on the mode as
described in the following table.
I/O signal Mode 0 Mode 1 Mode 2
Origin Input Connected to the open- Connected to the phase-Z Connected to the phase-Z
Signal collector output from a sen- signal from the Servo Drive. signal from the Servo Drive.
sor or other device.
Error counter Not used. Connected to the error Connected to the error
reset output (The origin search operation counter reset of the Servo counter reset of the Servo
is completed when the origin Drive. Drive.
is detected.)
Positioning Not used. Not used. Connected to the Position-
completed input ing Completed Signal from
the Servo Drive.
Origin Proximity 1
Input Signal 0
Origin Input 1
Signal 0
Pulse output
CCW CW
Starts when ORG is executed Origin Input Signal Error (error code 0202)
1
Origin Input Signal
(phase-Z signal) 0
1
Pulse output
0
Error Counter
Reset Signal
Approx. 20 to 30 ms
Though the Origin Proximity Input Signal is received, the signal will be ignored and the motor will
begin decelerating from the origin search high speed to the origin search proximity speed. In this
operating mode, the motor will stop at the Origin Input Signal after deceleration is completed.
CCW CW
(The deceleration time is Stop*
relatively short in this case.)
* The Origin Input Signal can be detected
Starts
when ORG is executed immediately after the Origin Proximity
Input Signal turns OFF if the deceleration
time is short, e.g., when starting from
within the Origin Proximity Input Signal.
1
Origin Proximity
Input Signal 0
CCW CW
(The deceleration time is
relatively long in this case.) Starts Stop
when ORG
is executed Motor stopped by an Origin Input
Signal received after deceleration
CCW CW
(The deceleration time is
relatively short in this case.) Starts Stop
when ORG is executed
Pulse output
Time
Stop
1
Error Counter
Reset Output 0
Positioning 1
Completed Signal 0
Proximity speed
Pulse output for origin search
Acceleration
Initial speed
Start when ORG is executed Stop
CCW CW
Start Stop
CCW CW
Stop
CW Limit Input Signal (See note.)
Start
CCW CW
Stop Start
Note When the Limit Input Signal is received, the motor stops without
deceleration, reverses direction, and accelerates.
1: Origin Proximity Input Signal 1
Origin Proximity
reversal not required. Input Signal 0
1
Origin Input Signal
0
Pulse output
CCW CW
Start Stop
CCW CW
Stop
CW Limit Input Signal (See note.)
Start
CCW CW
Stop Start
Note When the Limit Input Signal is received, the motor stops without
deceleration, reverses direction, and accelerates.
CCW CW
Start Stop
CCW CW
CCW CW
Stop Start
Note When the Limit Input Signal is received, the motor stops without
deceleration, reverses direction, and accelerates.
Pulse output
CCW CW
Start Stop
12
CCW CW
CCW CW
Pulse output
CCW CW
Start Stop
CCW CW
CCW CW
Start Limit stop
(error code:0200)
Note When the Limit Input Signal is received, the motor stops
without deceleration.
CCW CW
Start Stop
CCW CW
CCW CW
Origin return
initial speed
Time
Start Stop
PLC Setup
The various origin return parameters are set on the Pulse Output 0 Tab Page in the PLC Setup.
Note An instruction execution error will occur if the origin is not defined (relative coordinate system)
when the ORG instruction is executed to perform an origin return operation.
@INI
#0000 C1: Port specifier (example for pulse output 0)
#0002 C2: Control data (example for changing PV)
D100 S:First word with new PV
15 0
D100 #0 0 0 0
D101 #0 0 0 0
Operands Settings
C1 Port specifier #0000 Pulse output 0
#0001 Pulse output 1
#0002 Pulse output 2
#0003 Pulse output 3
C2 Control data #0002 Changes PV
S First word with new PV Store the new PV in S and S+1 (32 bits).
Execution condition
@PRV
#0000 C1: Port specifier (example for pulse output 0)
#0000 C2: Control data (example for reading PV)
D100 D: First destination word
15 0
D100 Present value data lower bytes
Pulse output PV that was read
D101 Present value data upper bytes
(2) (3)
From mounter
(1)
z Operation Pattern
(1) An origin search is performed.
(2) Fixed-distance positioning is repeated.
(3) The system is returned to the original position.
50,000 Hz
(C350 Hex)
10,000
(2710 Hex)
CCW CW
Acceleration/deceleration:
(3) Return to start 1,000 Hz/4 ms (03E8 hex)
G5-series
Servo Drive
R88A-CPGS 12
G5-series R88D-KT
Output terminal block R88A-CPG
S PIN Signal
Pulse output (CIO 100.00) 1 +24VCW * Instruction pulse mode =
Pulse 4 -PULS feed pulse and
output 0 Direction output (CIO 100.02) 2 +24VCCW forward/reverse signal
6 -SIGN
COM
V+ (S
-type only)
V- (S
-type only)
Input terminal block 25 ZGND
Pulse 0 origin input signal (CIO 0.06) 19 Z
COM 7 +24VIN
24-VDC Servo Drive
RUN input X1
Pulse 0 origin proximity input signal (CIO 0.10) 29 RUN
36 ALMCOM
10 BKIRCOM
X1 37 /ALM
24-VDC
XB 11 BKIR
Hood FG
Only S-type CPU Units can wire V+ and V-. Do not wire them in N-type CPU Units.
z Operation
1 An origin search is performed using the Origin Search Start Switch (CIO 0.00).
2 When the origin search is finished, the PCB Storage Enabled Output (CIO 100.03) is turned ON.
3 When a PCB has been stored, the stocker is raised (relative positioning) using the PCB Storage
Completed Input (CIO 0.03).
4 Storing PCBs is repeated until the stocker is full.
5 The number of PCBs in the stocker is counted with counter C0 by counting the number of times
the stocker is raised.
6 When the stocker is full, it is moved (CIO 100.01) and only the conveyor is lowered (absolute
positioning) when stoker movement is completed (CIO 0.04).
7 An emergency stop is executed to stop pulse output with the Emergency Stop Switch Input (CIO 0.01).
Preparations
z PLC Setup
Setting
Use define origin operation for pulse output 0.
Note The Use define origin operation setting is read from the PLC Setup when the power supply is turned ON.
z DM Area Settings
• Settings for PLS2 for Fixed-distance Positioning (D0 to D7)
Setting details Address Data
Acceleration rate: 1,000 Hz/4 ms D0 #03E8
Deceleration rate: 1,000 Hz/4 ms D1 #03E8
Target frequency: 50,000 Hz D2 #C350
D3 #0000
Number of output pulses: 10,000 pulses D4 #2710
D5 #0000
Starting frequency: 0 Hz D6 #0000
D7 #0000
• Settings for PLS2 to Return to Start (D10 to D17)
Setting details Address Data
Acceleration rate: 300 Hz/4 ms D10 #012C
Deceleration rate: 200 Hz/4 ms D11 #00C8
Target frequency: 50,000 Hz D12 #C350
D13 #0000
Number of output pulses: 0 pulse D14 #0000
D15 #0000
Starting frequency: 100 Hz D16 #0064
D17 #0000
• Number of Repeats of Fixed-distance Positioning Operation (D20)
Setting details Address Data
Number of repeats of fixed-distance positioning D20 #000F
operation (number of PCBs in stocker)
Ladder Program
Positioning
Lift 10,000 pulses (relative) at a time
W0.02 W0.04 W0.03
Lift positioning in progress
Lift positioning Lift positioning
start completed
@PLS2
W0.03
#0000
Lift positioning #0100
in progress D0
D6
A280.03 W0.04
Lift positioning completed
Pulse Output Completed Flag
Counter for number of lifts (number of PCBs stored)
W0.04
CNTX
Lift positioning completed 0000
W0.09 D20
Lower positioning
completed
P_First_Cycle
Positioning
Lower to "0" position (absolute pulses)
W0.08
W0.07 W0.09
Lower positioning in progress
Lower positioning Lower positioning
start completed @PLS2
W0.08
#0000
Lower positioning #0101
in progress D10
D16
A280.03 W0.09
Lower positioning completed
Pulse Output Completed Flag
A540.08
0.05
CW Limit Input Signal Flag
Built-in input
0.07 A540.09
CCW Limit Input Signal Flag
Built-in input
12
Marker sensor Speed
Position
control
Pulse output
z Operation Pattern
Speed control is used to feed wrapping material to the initial position. When the marker sensor input
(rising) is received, fixed-distance positioning is performed before stopping.
10,000 Hz
500 Hz/4ms (2710 Hex)
(01F4 Hex)
Position control
Speed control 5,000 (1388 hex)
pulses output before stopping.
IFEED executed
Marker sensor
input (0.06)
z Operation
1 Speed control is used to feed wrapping material to the initial position by executing the IFEED
instruction when the Start Switch (CIO 0.00) is activated.
2 When the Marker Sensor Input (CIO 0.06) is received, the operation is switched to position con-
trol.
3 The axis is moved the specified travel amount and then stopped.
4 An emergency stop is executed to stop pulse output with the Emergency Stop Switch input (CIO
0.01).
Preparations
z PLC Setup
Setting
Enable using built-in input IN6 as an interrupt input.
Note The interrupt input setting is read from the PLC Setup when the power supply is turned ON.
z DM Area Settings
• Speed Control Settings to Feed Wrapping Material to Initial Position and Positioning Control Set-
tings for Wrapping Material
Setting Address Data
Acceleration rate: 500 Hz/4 ms D10 #01F4
Deceleration rate: 500 Hz/4 ms D11 #01F4
Target frequency: 10,000 Hz D12 #2710
D13 #0000
Number of output pulses: 5,000 D14 #1388
pulses D15 #0000
Ladder Program
A280.03 W0.01
Material positioning completed
Pulse Output
Completed Flag
Emergency Stop
0.01
@INI
Emergency stop switch #0000
#0003
0
Note When the interrupt input is falling, it is necessary to specify edge detection falling with MSKS instruction.
In this example, the MSKS instruction can be omitted because it is rising.
Limit input
Pulse output 0 CW (CIO 1.00)
Pulse output 0 CCW (CIO 1.01)
12
Pulse output 1 CW (CIO 1.02)
Pulse output 1 CCW (CIO 1.03)
Workpiece is
Y axis
Pulse output 1
X axis
Pulse output 0
z Operation Pattern
1. Perform origin search.
2. A workpiece is grasped and moved to position A.
3. The workpiece is repeatedly moved between the grasp position and the assembly positions using
linear interpolation operation.
1. Origin search
Speed 80 KHz 8 0K
eed
Sp
B D 25000
(61A8 hex)
Speed 80 KHz
35000
C
(88B8 hex)
X axis (CW)
Pulse output 0
z Operation
1 An origin search of X axis (pulse output 0) and Y axis (pulse output 1) is performed using the Ori-
gin Search Start Switch (CIO 0.00).
2 When the origin search is finished, the following operations are performed continuously using lin-
ear interpolation 0.
Move in to A.
Move to B and return to A.
Move to C and return to A.
Move to D and return to A.
3 An immediate stop is executed to stop pulse output with the Immediate Stop input (CIO 0.01).
Preparations
z PLC Setup
Setting
Origin Search Detailed Settings for pulse output 0 and 1
Note The setting of the option to use the origin search is read from the PLC Setup when the power supply is
turned ON.
z DM Area Settings
• ITPL(893) Settings to Move from Origin to Position A
Ladder Program
Origin Search for X and Y Axes
0.00
SET Setting
Origin Search Switch W0.00 Bit address
W1.14
W0.00
Origin search start
W1.15
RSET Resetting
Origin search completed W0.00 Bit address
Operation 1: Positioning to A
W0.00
SET Setting
W1.00
W0.01
Positioning to A start
W2.00
RSET Resetting
Positioning to A completed W0.01 Bit address
Operation 2: Positioning to B
W0.01
SET Setting
W1.01
W0.02
Positioning to B start
W2.01
RSET Resetting
Positioning to B completed W0.02 Bit address
Operation 2: Positioning to A
W0.02
SET Setting
W3.00
W0.03
Positioning to A start
W2.00
RSET Resetting
Positioning to A completed W0.03 Bit address
Operation 3: Positioning to C
W0.03
SET Setting
W0.04 Bit address
W1.02
W0.04
Positioning to C start
W2.02
RSET Resetting
Operation 3: Positioning to A
W0.04
SET Setting
W3.01
W0.05
Positioning to A start
W2.00
RSET Resetting
Positioning to A completed W0.05 Bit address
Operation 4: Positioning to D
W0.05
SET Setting
W1.03 12
W0.06
Positioning to D start
W2.03
Operation 5: Positioning to A
W0.06
SET Setting
W0.07 Bit address
W3.02
W0.07
Positioning to A start
W2.00
RSET Resetting
Positioning to A completed W0.07 Bit address
W1.15
A280.05 A281.05
Origin search completed
No Origin Flag No Origin Flag
Positioning to A
start W2.00
A280.03 A281.03
Positioning to A completed
Pulse output completed Pulse output completed
W1.01
@ITPL (893) Linear interpolation
Positioning to #0030 Port specifier: Linear interpolation 0
B start
#0101 Control data
D30 First word of setting table
W2.01
A280.03 A281.03
Positioning to B completed
Pulse output completed Pulse output completed
W2.02
A280.03 A281.03
Positioning to C completed
Pulse output Pulse output
completed completed
W2.03
A280.03 A281.03
Positioning to D completed
Pulse output completed Pulse output completed
When operating with the absolute pulse specification, the movement direction (CW/CCW) is selected
automatically based on the relationship between the pulse output PV when the instruction is executed
and the specified target position. The direction (CW/CCW) specified in an ACC, SPED or PLS2 instruc-
tion is not effective.
12
Using CW/CCW Limit Inputs for Pulse Output Functions other than
Origin Searches
z Equations
The INT function extracts an integer from the fraction. The non-integer remainder is rounded.
Changing Settings
Example Procedure
Operation Frequency changes Description
application Instruction Settings
Change Changing the Pulse frequency Changes the SPED • Port
speed in one speed during frequency (Continuous) • Continuous
Target frequency
step operation (higher or ↓ • Target frequency
lower) of the
Present frequency SPED
pulse output
Time (Continuous)
in one step.
Execution of SPED
Example Procedure
Operation Frequency changes Description
application Instruction Settings
Stop pulse Immediate stop Pulse frequency Stops the SPED • Port
output pulse output (Continuous) • Continuous
Present
frequency
immediately. ↓ • Target
SPED frequency=0
Time
(Continuous)
Execution of SPED
* If an ACC instruction started the operation, the original acceleration/deceleration rate will remain in effect.
If a SPED instruction started the operation, the acceleration/deceleration rate will be invalid and the pulse output will stop
immediately.
* Triangular Control
If the specified number of pulses is less than the number required just to reach the target frequency and
return to zero, the function will automatically reduce the acceleration/deceleration time and perform triangu-
Time Time
12
Changing Settings
Procedure
Example Procedure
Operation Frequency changes Description
application Instruction Settings
Change Changing Pulse frequency Specified number of pulses PLS2 can be exe- PULS • Number of
(Specified with PULS.)
speed the target New target frequency cuted during posi- ↓ pulses
smoothly speed (fre- Target frequency tioning to change • Relative or
Acceleration/ ACC
(with quency) deceleration the acceleration absolute
rate (Independent)
unequal during posi- rate, deceleration pulse speci-
accelera- tioning
Time
rate, and target fre- ↓ fication
Execution of ACC
tion and (different (independent mode) quency. PLS2 • Port
PLS2 executed to change the target
decelera- accelera- To prevent the tar-
frequency and acceleration/deceleration
PLS2 • Pulse +
tion rates) tion and rates.(The target position is not
get position from
↓ Direction
changed. The original target position is
decelera- specified again.)
being changed
tion rates) PLS2 • Accelera-
intentionally, the
tion rate
original target posi-
tion must be speci- • Decelera-
fied in absolute tion rate
coordinates. • Target fre-
quency
• Starting fre-
quency
Change Change the Pulse frequency Number of pulses
PLS2 can be exe- PULS • Number of
target target posi- Secified number
changed with PLS2. cuted during posi- ↓ pulses
of pulses
position tion during tioning to change • Relative or
Target frequency Acceleration/ ACC
positioning deceleration the target position absolute
rate (Independent)
(multiple (number of pulses). pulse speci-
Time
↓ fication
start Execution of PLS2
When the target
function) position cannot be PLS2 • Port
PLS2 executed to change the target
position.(The target frequency and
acceleration/deceleration rates are
changed without PLS2 • Pulse +
not changed.) maintaining the
↓ Direction
same speed range,
PLS2 • Accelera-
an error will occur
tion rate
and the original
operation will con- • Decelera-
tinue to the original tion rate
target position. • Target fre-
quency
• Starting fre-
quency
Example Procedure
Stop sloped Decelerate Pulse frequency Decelerates the pulse output PULS • Port
pulse out- to a stop Present
to a stop. ↓ • Indepen-
Original acceleration/
put frequency deceleration rate
If ACC started the operation, dent
ACC or SPED
smoothly. the original acceleration/decel- • Target fre-
(Independent)
(Number of eration rate will remain in quency = 0
pulses set-
Target
frequency=0
Time
↓
Execution of ACC
effect.
ting is not If SPED started the operation, ACC
preserved.) the acceleration/deceleration (Independent)
rate will be invalid and the PLS2
pulse output will stop immedi-
↓
ately.
ACC
(Independent)
Time
Execution of ACC
(continuous)
Execution of PLS2 with the following settings
Number of pulses = number of pulses until stop
Relative pulse specification
Target frequency = present frequency
Acceleration rate = Not 0
Deceleration rate = target deceleration rate
z Application example
• Controlling temperature on a time-proportional basis using the PWM output.
• Controlling the brightness of lighting.
Built-in output
PWM output
Duty factor:15%
50%
Duty factor:50%
75%
Duty factor:75%
Specifications
Item Specification
Duty factor 0.0% to 100.0% in 0.1% increments
(Duty factor accuracy is +1%/-0% at 10 kHz, +5%/-0% at 10 to 32 kHz .)
Frequency 2.0 Hz to 6,553.5 Hz (Set in 0.1-Hz increments.)*
2 Hz to 32,000 Hz (Set in 1-Hz increments.)*
Output mode Continuous mode
Instruction PWM
* The duty factor accuracy declines significantly at high frequencies because of limitations in the output circuit at
high frequencies.
Additional Information
For N30/40/60 CPU Units, the output indicator of terminal 01 on terminal block CIO100 is always
lit during PWM output.
z Wiring Example
Sinking outputs
V+ 00 01 02
V- COM(V-) COM 03
13
Although V- and COM(V-) are connected internally, also wire them externally.
Sourcing outputs
V+ 00 01 02
V- COM(V+) COM 03
Although V+ and COM(V+) are connected internally, also wire them externally.
Do not connect an external power supply to N
-type CPU Units.
Preparations
z PLC Setup
There are no settings that need to be made in the PLC Setup.
z DM Area Settings
• PWM Operand Settings (D0 and D1)
13
Setting Operand Data
Frequency: 2,000.0 Hz D0 #4E20
z Ladder Diagram
0.00
@PWM
Start input #1000 ←PWM output 0 (Duty factor in increments of 0.1%, Frequency in increments of 0.1 Hz)
D0 ←Frequency setting
D1 ←Duty factor setting
0.01
@INI
Stop input #1000 ←PWM output 0
#0003 ←Stops pulse output
D10 ←Not used.
Serial Ports
14
Installation Example
Option Board with 2 ports RS-422A/485 Option Board
CP2W-CIFD CP1W-CIF12-V1
1:N NT Link
1:N NT Link Host Link
Host Link
Inverter
Inverter
CP-series PLC
or CJ2M PLC CP-series PLC or CJ2M PLC
Inverter
Data links between CPU Units Data links can be created Serial PLC Links*2 OK OK OK
for up to nine CP-series
CP2E CPU Unit Polling Unit or CJ2M CPU Units,
including one Polling Unit
RS-422A/485
and up to eight Polled
Shared data Units. Up to 10 words can
be shared per Unit.*1
CP2E CPU Unit Polled Unit CP1L CPU Unit Polled Unit
Built-in Built-in
Serial
Communications RS-232C/ RS-485/
Connected devices Description Port 1
protocol Serial Serial
(EX)
Port 1 Port 2
Host computers PLC data can be read by Host Link OK OK NO
the host computer or writ-
ten to the PLC from the
computer. The host com-
Computer
puter sends a Host Link
command (C Mode) or a
RS-232C
FINS command to the
Host Link CPU Unit to read/write
I/O memory, change the
operating mode, or to
force-set/reset bits in the
CPU Unit.
RS-485
Modbus-RTU
CP2E
Slave
Note The Built-in RS-485 port of S
-type CPU Units and the RS-485 port of CP2W-CIFD2/CIFD3 can only communicate in
half duplex.
Additional Information
Refer to A-3 Wiring for Serial Communications in the CP2E CPU Unit Hardware User’s Manual
(Cat.No.W613) for Serial communication wiring.
14-2-1 Overview
Communications without special communications programming is possible between a CP2E CPU Unit
and a Programmable Terminal (PT) by using the Host Link or 1:N NT Link protocol.
Connect the serial port of the CP2E CPU Unit and PT with Host Link or NT Link (1:N) communication
mode, and connect the CP2E CPU Unit and PT 1:1 as shown below.
PT: NB, NS or NV series
RS-232C
Host Link or 1:N NT Link 14
CP2E CPU Unit
14-2-1 Overview
z Connectable Programmable Terminals (PTs)
High-speed Links (115,200 bps) can be used with NB-series, NS-series, or NV-series PTs.
4 Set the same communications settings in the CP2E CPU Unit’s PLC Setup and in the NB-series PT.
5 Connect the CP2E CPU Unit and PT using the RS-232C or RS-422A/485 ports.
PLC Setup
Click the Built-in RS-232C, Built-in RS-485 or Serial Port Tab in the PLC Settings Dialog Box.
PT System Menu
Example: NB-series PT
• Set the baud rate to 115,200, the data bit to 7, the parity check to even, and the stop bit to 2 on the 14
COM1 Settings or the COM2 Settings in the PT property.
14-3-1 Overview
CP2E CPU Units and general devices with serial communications ports can be used for no-protocol
communications.
No-protocol communications enable sending and receiving data using the TRANSMIT (TXD) and
RECEIVE (RXD) instructions without using a protocol and without data conversion (e.g., no retry pro-
cessing, data type conversion, or process branching based on received data).
The serial communications mode is set to RS-232C.
TXD or RXD
General component
(e.g., barcode reader)
No-protocol communications are used to send data in one direction to or from general external devices
that have an RS-232C or RS-422A/485 port using TXD or RXD.
For example, simple (no-protocol) communications can be used to input data from a barcode reader or
output data to a printer.
The following table lists the no-protocol communication functions supported by CP2E PLCs.
Max. Frame format
Communica- Transfer
Method amount of Other functions
tions direction Start code End code
data
Data PLC → Execution 256 bytes Yes: 00 to FF Yes: 00 to FF • Send delay time (delay
transmission External of TXD in hex hex or CR+LF between TXD execution and
device the ladder No: None No: None (The sending data from specified
program amount of data port): 0 to 99,990 ms at the
to receive is minimum(unit: 10 ms)
specified • Controlling RS and ER signals
between 1 and
Data External Execution 256 bytes Monitoring CS and DR signals
256 bytes when
reception device → of RXD in
no end code is
PLC the ladder
specified.)
program
Note 1 Because the built-in RS-485 port of the S
-type CPU Unit and the RS-485 port of CP2W-CIFD2/CIFD3
use 2-wire connections, so they can only communicate in half duplex. Communications are not possible in
full duplex.
1 Wiring communications
Connect the CP2E CPU Unit and external device using
RS-232C or RS-422A/485 ports.
2 PLC Setup
Select Built-in RS-232C, Built-in RS-485 or Serial Port
in the PLC Setup and transfer the PLC Setup from the
CX-Programmer to the CP2E CPU Unit.
(Set the serial communications mode to RS-232C, and
set the communications conditions.)
14
3 Create
ladder
Cyclic tasks
• PLC to External device: Execute the TXD instruction.
• External device to PLC: Execute the RXD instruction.
14-4-1 Overview
Using the Modbus-RTU Easy Master enables easy control of Modbus-compatible slaves, such as
inverters, using serial communications. The serial communications mode is set to Modbus-RTU Easy
Master.
15 08 07 00
D1200 - - Slave address
D1201 - - Function code
D1202 Number of communications data bytes
Communications are easily achieved D1203
by simply turning ON A640.00 after Communications data
~
setting the Modbus-RTU command in
the DM fixed allocation words.
Modbus-RTU commands can be sent simply by turning ON a software switch after setting the Modbus
slave address, function, and data in the DM fixed allocation words for the Modbus-RTU Easy Master.
The response when received is automatically stored in the DM fixed allocation words for the Modbus-
RTU Easy Master.
1 Wiring communications
Connect the CP2E CPU Unit and Modbus-RTU Slave
using RS-232C or RS-422A/485 ports.
2 PLC Setup
Select Built-in RS-232C, Built-in RS-485 or Serial Port in
the PLC Setup and transfer the PLC Setup from the CX-
Programmer to the CP2E CPU Unit. (Set the serial com-
munications mode to Modbus Easy Master, and set the
communications conditions.)
z Error Codes
Code Description Description
00 hex Normal end −
01 hex Illegal address The slave address specified in the parameter is illegal (248 or higher).
02 hex Illegal function code The function code specified in the parameter is illegal.
03 hex Data length overflow There are more than 94 data bytes.
04 hex Serial communications mode The Modbus-RTU Easy Master function was executed when the
error serial communications mode was not the Modbus-RTU Easy Mas-
ter Mode or when the option board is not equipped.
80 hex Response timeout A response was not received from the slave.
81 hex Parity error A parity error occurred.
82 hex Framing error A framing error occurred.
83 hex Overrun error An overrun error occurred.
84 hex CRC error A CRC error occurred.
85 hex Incorrect confirmation address The slave address in the response is different from the one in the
request.
86 hex Incorrect confirmation function The function code in the response is different from the one in the
code request.
87 hex Response size overflow The response frame is larger than the storage area (92 bytes).
88 hex Exception response An exception response was received from the slave.
89 hex Service being executed A service is already being executed (reception traffic congestion).
8A hex Execution canceled Executing the service has been canceled.
8F hex Other error Other FINS response code was received.
When the Modbus-RTU communication abnormality occurs, the following bits are turned ON.
Address Name Contents
A392.04 Serial Port 1/Built-in RS-232C Port Turns ON when a timeout error, an overrun error, a
Communication Error Flag framing error or a parity error occurs on Modbus-RTU
Easy Master with serial port 1 or built-in RS-232C port.
A392.12 Serial Port 2/Built-in RS-485 Port Com- Turns ON when a timeout error, an overrun error, a
munication Error Flag framing error or a parity error occurs on Modbus-RTU
14
Easy Master with serial port 2 or built-in RS-485 port.
A50.04 Serial Port 1(EX) Communication Error Turns ON when a timeout error, an overrun error, a
Frequency
setting
60.00Hz 55.00Hz 50.00Hz
The start/stop and target speed is changed according to inputs from multiple contacts. Acceleration and
deceleration are controlled using the acceleration and deceleration of an inverter.
Wiring Examples
The OMRON 3G3MX2-V1 Inverter is connected to the option slot 2 of the CP2E N
-type CPU Unit
or the built-in RS-485 port of the CP2E S
-type CPU Unit using RS-485 for frequency and start/stop
CP1W-CIF11/CIF12-V1 3G3MX2-V1
RS-422A/485 Option Board
Symbol
RDA- Control circuit
RDB+ terminal block
SDA- 50 m max. (communications
SDB+ terminals)
FG
CP1W-CIF11/CIF12-V1
RS-422A/485 Option Board
z CP1W-CIF11/CIF12-V1 Settings
Set the DIP switch as shown in the following table
(Back)
z 3G3MX2-V1 Settings
Set the following parameters according to the communication specifications.
As for C071, C074 and C075, modified data are not reflected until the power is reconnected or a
reset is performed. To perform a reset, turn the reset terminal (18: RS) OFF, ON and then OFF
again.
z PLC Setup
Click the Built-in RS-232C, Built-in RS-485 or Serial Port Tab in the PLC Settings Dialog Box.
z Programming Example
W0.00
MOV(021)
Initial
Frequency Slave address
#1
Setting 01 Hex
D1300
MOV(021)
FUNCTION code
#6
06 Hex
D1301
MOV(021)
Register number 0002 Hex
(Register number -1) #1
0001 Hex
D1303
MOV(021)
Frequency setting 60.00 Hz
#1770
1770 Hex
D1304
W1.00
MOV(021)
RUN
Command Slave address
#1
01 Hex
D1300
MOV(021)
FUNCTION code
#5
05 Hex
D1301
MOV(021)
Communication data Start operation
#4 Write ON (FF00 Hex) to coil
4 bytes (Hex)
number 0001 (Hex)
D1302
MOV(021)
Register number 0001 Hex
(Register number -1) #0
0001 Hex
D1303
MOV(021)
ON
#FF00
FF00 Hex
D1304
W0.01
MOV(021)
Frequency
Setting A Slave address
#1
01 Hex
D1300
D1301
MOV(021)
Frequency setting A
Communication data Write 55.00 Hz (157C Hex)
#4
4 bytes (Hex) to register number 0002
D1302 (Hex)
MOV(021)
Register number 0002 Hex 14
(Register number -1) #1
0001 Hex
D1303
D1304
W0.02
MOV(021)
Frequency
Setting B Slave address
#1
01 Hex
D1300
MOV(021)
FUNCTION code
#6
06 Hex
D1301
MOV(021)
Frequency setting B
Communication data Write 50.00 Hz (1388 Hex)
#4
4 bytes (Hex) to register number 0002
D1302 (Hex)
MOV(021)
Register number 0002 Hex
(Register number -1) #1
0001 Hex
D1303
MOV(021)
Frequency setting 55.00 Hz #1388
1388 Hex
D1304
W1.00
MOV(021)
RUN
Command Slave address
#1
01 Hex
D1300
MOV(021)
FUNCTION code
#5
05 Hex
D1301
MOV(021)
Communication data Stop operation
4 bytes (Hex) #4 Write OFF (0000 Hex) to
coil number 0001 (Hex)
D1302
MOV(021)
Register number 0001 Hex
(Register number -1) #0
0001 Hex
D1303
MOV(021)
OFF
#0000
0000 Hex
D1304
P On
TIMX(550)
Always ON flag
000
z Flags for Modbus-RTU Easy Master for Serial Port 2 or Built-in RS-485 Port
(1)Turn ON A641.00 (Execution Bit) to send command data stored starting at D1300. For details, refer
to Data Memory (DM) Area Settings on page 14-26.
Words
Bits Setting
Serial Option Port
D1300 00 to 07 Command Slave address (00 to F7 hex)
08 to 15 Reserved (Always 00 hex.)
D1301 00 to 07 Function code 14
08 to 15 Reserved (Always 00 hex.)
D1302 00 to 15 Number of communications data bytes (0000 to
The Execution Bit will automatically turn OFF. Do not turn OFF the bit through the ladder.
(2)When a command has been sent successfully, A641.01 (Execution Normal Flag) will turn ON, and
the response data will be stored starting from D1350.
Words
Bits Setting
Serial Option Port
D1350 00 to 07 Response Slave address (01 to F7 hex)
08 to 15 Reserved (Always 00 hex.)
D1351 00 to 07 Function code
08 to 15 Reserved
D1352 00 to 07 Error code
08 to 15 Reserved (Always 00 hex.)
D1353 00 to 15 Number of response bytes (0000 to 03EA hex)
D1354 to D1399 00 to 15 Response data (92 bytes max.)
(3)If a communications error occurs, A641.02 (Execution Error Flag) will turn ON, and the error code
will be stored in D1352.
For details on 3G3MX2-V1 parameters and Modbus-RTU communication data, refer to the
3G3MX2-V1 User’s Manual (I585).
With the Modbus-RTU Easy Master, a CRC-16 checksum does not need to be set in the DM Area,
because it is calculated automatically.
14-5-1 Overview
Serial PLC Links enable exchanging data between CP2E CPU Units, CP1H/CP1L/CP1E CPU Units, or
CJ2M CPU Units without using special programming. The serial communications mode is set to Serial
PLC Links. Up to 9 PLCs can be linked.
z Connecting CP2E, CP1H, CP1L, CP1E or CJ2M CPU Units 1:N (8 Nodes
Maximum)
14-5-1 Overview
Shared data
CJ2M CPU Unit
(Polled Unit)
8 nodes maximum
RS-232C or RS422A/485
Shared data
CP1E or
CP1L CPU
Unit (Polled
Unit)
1 Wiring communications
Connect the CP2E CPU Unit and other CPU Units using
RS-232C or RS-422A/485 ports.
2 PLC Setup
Set Built-in RS-232C, Built-in RS-485 or Serial Port in
the PLC Setup and transfer the PLC Setup from the CX-
Programmer to the CP2E CPU Unit. (Set the serial com-
munications mode to Serial PC Link (Master) or Serial
PC Link (Slave) and set the communications conditions,
link words, and PLC Link method.)
3 Start communications
14
z Complete Link
The data from all nodes in the Serial PLC Links are reflected in both the Polling Unit and the Polled
Units.
The only exceptions are the addresses of Polled Units that are not present in the network. These
data areas are undefined in all nodes.
Polled Unit No. 0 Local area Polled Unit No. 0 Polled Unit No. 0
Polled Unit No. 1 Polled Unit No. 1 Local area Polled Unit No. 1
Polled Unit No. 3 Polled Unit No. 3 Polled Unit No. 3 Local area
Serial PLC Link Words Serial PLC Link Words Serial PLC Link Words Serial PLC Link Words
CIO 200 to 209 CIO 200 to 209 CIO 3100 to 3109 CIO 3100 to 3109
No.0 CIO 210 to 219 No.0 CIO 210 to 219 No.0 CIO 3110 to 3119 No.0 CIO 3110 to 3119
No.1 CIO 220 to 229 No.1 CIO 220 to 229 No.1 CIO 3120 to 3129 No.1 CIO 3120 to 3129
No.2 CIO 230 to 239 No.2 CIO 230 to 239 No.2 CIO 3130 to 3139 No.2 CIO 3130 to 3139
No.3 CIO 240 to 249 No.3 CIO 240 to 249 No.3 CIO 3140 to 3149 No.3 CIO 3140 to 3149
No.4 CIO 250 to 259 No.4 CIO 250 to 259 No.4 CIO 3150 to 3159 No.4 CIO 3150 to 3159
No.5 CIO 260 to 269 No.5 CIO 260 to 269 No.5 CIO 3160 to 3169 No.5 CIO 3160 to 3169
No.6 CIO 270 to 279 No.6 CIO 270 to 279 No.6 CIO 3170 to 3179 No.6 CIO 3170 to 3179
No.7 CIO 280 to 289 No.7 CIO 280 to 289 No.7 CIO 3180 to 3189 No.7 CIO 3180 to 3189
Polling Unit Polled Unit No. 0 Polled Unit No. 1 Polled Unit No. 3
CP2E CPU Unit CP2E CPU Unit CP1L CPU Unit Example: CJ2M CPU Unit
(Polling Unit) (Polled Unit No. 0) (Polled Unit No. 1) (Polled Unit No. 2)
Serial PLC Link Words Serial PLC Link Words Serial PLC Link Words Serial PLC Link Words
CIO 200 to 209 CIO 200 to 209 CIO 3100 to 3109 CIO 3100 to 3109
No.0 CIO 210 to 219 CIO 210 to 219 CIO 3110 to 3119 CIO 3110 to 3119
No.1 CIO 220 to 229
No.2 CIO 230 to 239
No.3 CIO 240 to 249
No.4 CIO 250 to 259
No.5 CIO 260 to 269
No.6 CIO 270 to 279
No.7 CIO 280 to 289
z Allocated Words
* In the same way as for the 1:N NT Link, the status (communicating/not communicating) of the Polled Unit in
Serial PLC Links can be checked from the Polling Unit (CPU Unit) by reading the Serial Port 1 Communicating
with Polled Unit Flag (A393.00 to A393.07 for unit numbers 0 to 7) , the Serial Port 1 (EX) Communicating with
Polled Unit Flag (A51.00 to A51.17 for unit number of 0 to 7) or the Serial Port 2 Communicating with Polled Unit
Flag (A394.00 to A394.07 for unit numbers 0 to 7).
When errors occur in the Serial PLC Links communication, PC Link Master station would retry before the com-
munication reestablished. So it is not necessary for users to restart the port for restoring the communication. If
the errors have been removed, the communication between PC Link (Master) and PC Link (Slave) will be rees-
tablished automatically. But the error flags remained. Please restart the port if you want to clear the error flags.
Operation
The present temperature information is exchanged between the boilers. This information is used to
adjust the temperature control of one boiler depending on the status of the other boilers and for moni-
toring individual boilers.
Boiler A Boiler B Boiler C
Two Pt100 Sensor Inputs Two Pt100 Sensor Inputs Two Pt100 Sensor Inputs
CP1W-CIF11 CP1W-CIF11 CP1W-CIF11
RS-422A/485 RS-422A/485 RS-422A/485
Option Board Option Board Option Board
-type CPU Unit
When a RS-422A/485 Option Board is mounted on a CP2E N
RDA- RDA- RDA-
RDB+ RDB+ RDB+
SDA- SDA- SDA-
SDB+ SDB+ SDB+
FG FG FG
z PLC Setup
Item Boiler A (Polling Unit) Boiler B (Polled Unit No. 0) Boiler C (Polled Unit No. 1)
Communications Settings Custom
Baud Rate 115200bps
Parameters 7.2.E (default)
Mode PC Link (Master) PC link (Slave)
Link words 10 (default) − −
PC Link Mode ALL − −
NT/PC Link Max. 1 − −
PC Link Unit No. − 0 1
z Programming Example
Data in the Serial PLC Link Areas are transferred using data links by the Serial PLC Link and without
using any special programming. The ladder program is used to transfer the data that needs to be
linked to the data link area.
Boiler A Boiler B Boiler C
CP2E (Polling Unit) CP2E (Polled Unit No.1) CP2E (Polled Unit No. 0)
CIO 0
Input Bits Input Bits Input Bits
CIO 1
CIO 2 A_Temperature data 0 B_Temperature data 0 C_Temperature data 0
CIO 3 A_Temperature data 1 B_Temperature data 1 C_Temperature data 1
CIO 209
CIO 210 B_Temperature data 0 B_Temperature data 0 B_Temperature data 0
CIO 211 B_Temperature data 1 B_Temperature data 1 B_Temperature data 1
Serial PLC
Link Areas
CIO 219
CIO 220 C_Temperature data 0 C_Temperature data 0 C_Temperature data 0
CIO 221 C_Temperature data 1 C_Temperature data 1 C_Temperature data 1
CIO 229
CIO 289
z Ladder Diagram
Boiler A Boiler B Boiler C
CP2E CPU Unit CP2E CPU Unit CP2E CPU Unit
(Polling Unit) (Polled Unit No. 0) (Polled Unit No. 1)
#2 #2 #2
2 2 2
200 210 220
Transfer CIO 2 and CIO 3 to Transfer CIO 2 and CIO 3 to Transfer CIO 2 and CIO 3 to
CIO 200 and CIO 201 using a CIO 210 and CIO 211 using a CIO 220 and CIO 221 using a
BLOCK TRANSFER instruction. BLOCK TRANSFER instruction. BLOCK TRANSFER instruction
14-6-1 Overview
Communica-
Command flow Command type Configuration Application Remarks
tions method
Host computer Host link Create frame Directly connect the host com- Use this
→ PLC command in the host puter in a 1:1 or 1:N system. method when
(C Mode) computer communicating
and send the primarily from
Host link command command to the host com- −
the PLC.
OR
Command
puter to the
14
Receive the PLC.
response.
14-6-1 Overview
FINS command Directly connect the host com- Use these The FINS com-
(with Host Link puter in a 1:1 system or 1:N methods when mand must be
header and system. communicating placed between
terminator) sent. primarily from a Host Link
FINS the host com- header and ter-
Host Link
header
Host Link
terminator
OR puter to PLCs minator and
Command
in the network. then sent by the
host computer.
1 Communications wiring
Connect the computer and CP2E CPU Unit using
RS-232C ports or RS-485 ports.
2 PLC Setup
Set the PLC Setup (select Host Link for the serial
communications mode and set the communications
conditions) and transfer the PLC Setup from the
CX-Programmer to the CP2E CPU Unit.
14-7-1 Overview
Modbus-RTU Slave enables to read and write CP2E data from Modbus-compatible masters, such as
host PLCs or host computers, using serial communications.
The serial communication mode is set to Modbus-RTU Slave.
Modbus-RTU master device CP2E CPU Unit
By setting the Modbus-RTU slave address on the CP2E side, the target slave address, function code
and data from the master devices can be transmited.
Specifications
Item Contents
Mode Modbus-RTU Slave
Baud rate 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200 bps
Data length 8 bits *1
Parity Odd, Even, None
Stop bits 1 bit (2 bits only when setting to no parity) *2
Slave addresse 1 to 247 *3
Frame format Slave address: 1 byte
Function code: 1 byte
Data: 0 to 252 bytes
CRC code: 2 bytes
1 Wiring communications
Connect CP2E CPU Unit and Modbus-RTU master
device using RS-232C or RS-422A/485 ports.
3 Create
ladder
Cyclic tasks
When receiving a Modbus-RTU command from a
Modbus-RTU Master, it automatically responds without a
ladder program.
program Interrupt tasks
14
Discrete 0 None
Modbus-RTU Command Inputs 1
2
:
Coils 0 Auxiliary Area 0
Read Coils 1 (W) 1
Read Holding Registers 2 2
: :
Write Single Register
Write Multiple Coils Input 0 None
Write Multiple Registers Registers 1
2
:
Holding 0 Data Memory 0
Registers 1 (D) 1
2 2
: :
Additional Information
Addresses in Modbus data models start from 1, but addresses specified in Modbus-RTU com-
mands and addresses in the CP2E CPU Unit start from 0. Refer to the above table when speci-
fying addresses in applications.
Setting the slave address to 0 indicates a broadcast command. The CP2E CPU unit does not
return a response for broadcast commands.
z Read Multiple Bits from the Auxiliary Area (W) (Read Coils)
Command (Modbus-RTU Master)
Field name Data length Data
Function code 1 byte 01 Hex
Coil starting address 2 bytes 0 to 7FFHex (0 to 2047)
W0.00 to W127.15
Quantity of coils 2 bytes 1 to 7FFHex (1 to 2047)
Note The maximum number of coils depends on the assigned starting address.
Response (CP2E)
Field name Data length Data
Function code 1 byte 01 Hex
Byte count 1 byte N
Coil status n bytes n=N or N+1
Note The subscript numbers in the shaded boxes indicate the ON/OFF (1/0) status of the bits that are read.
z Read Multiple Words from the Data Memory (D) (Read Holding Registers)
Command (Modbus-RTU Master)
Field name Data length Data
Function code 1 byte 03 Hex
Register starting address 2 bytes E
-type: 0 to 0FFF Hex (D0 to D4095)
S
-type: 0 to 1FFF Hex (D0 to D8191)
N
-type: 0 to 3FFF Hex (D0 to D16383)
Quantity of Registers 2 bytes 1 to 7D Hex (1 to 125)
Note The maximum number of coils depends on the assigned starting address.
Response (CP2E)
Field name Data length Data
Function code 1 byte 03 Hex
Byte count 1 byte 2×N (N: Quantity of registers)
Register value 2×N bytes
Response (CP2E)
Field name Data length Data
Function code 1 byte 06 Hex
Register address 2 bytes E
-type: 0 to 0FFF Hex (D0 to D4095)
S
-type: 0 to 1FFF Hex (D0 to D8191)
N
-type: 0 to 3FFF Hex (D0 to D16383)
Register value 2 bytes 0000 to FFFF Hex
DM 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
2000 3 A C 5
2001
2002
z Write Multiple Bits in the Auxiliary Area (W) (Write Multiple Coils)
Command (Modbus-RTU Master)
Field name Data length Data
Function code 1 byte 0F Hex
Starting address 2 bytes 0 to 07FF Hex (0 to 2047)
W0.00 to W127.15
Quantity of output 2 bytes 0001 to 07B0 Hex (1 to 1968)
Byte count 1 byte N = Quantity of output / 8, if the remainder is not 0, N+1
Output value N bytes
Response (CP2E)
Field name Data length Data
Function code 1 byte 0F Hex
Starting address 2 bytes 0 to 07FF Hex (0 to 2047)
W0.00 to W127.15
Quantity of output 2 bytes 0001 to 07B0 Hex (1 to 1968)
Example: Writing 10 bits (xxxx xx11 1100 1101) from W1.04 to W1.13
Command (Modbus-RTU Master) Response (CP2E)
Field name Data Field name Data
Function code 06 Hex Function code 0F Hex
Starting address (H) 00 Hex Starting address (H) 00 Hex
Starting address (L) 14 Hex Starting address (L) 14 Hex
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0CH 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1CH 31 0 30 0 29 0 28 1 27 0 26 0 25 1 24 1 23 1 22 0 21 1 20 0 19 0 18 0 17 0 16 0
14
Note The subscript numbers in the shaded boxes indicate the ON/OFF (1/0) status of the bits that are written.
Other bits in the same word are set to 0.
Response (CP2E)
Field name Data length Data
Function code 1 byte 10 Hex
Starting address 2 bytes 0 to 7FF Hex (0 to 2047)
W0.00 to W127.15
Quantity of registers 2 bytes 0001~07BHex (1~123)
DM 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1000 3 A C 5
1001 9 7 1 3
z Error Response
Field name Data length Data
Function code 1 byte Function code + 80 Hex
For example: 86 Hex for Write Single Register (06Hex)
Exception code 1 byte Reference below
When using the RS-485 (2-wire), it can only communicate in half duplex.
Please secure the waiting time shown below till the next data transmission after the remote device
receives data from CP2E. If the receive data are transmitted from the remote device within the waiting
time shown below after CP2E data transmission, the data may not be received by CP2E.
Send data
Remote device Send data
Send data
CP2E
Secure the waiting time shown below till the next data
transmission after the data reception from CP2E.
Baud rate
9600 to 115200 bit/s:1ms min.
1200 to 4800 bit/s:3ms min.
15-6 Automatic Clock Adjustment and Specifying Servers by Host Name. . . 15-54
15-6-1 Automatic Clock Adjustment Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-54
15-6-2 Specifying Servers by Host Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-54
15-6-3 Procedure for Using the Automatic Clock Adjustment Function. . . . . . . . . . . 15-55
15-6-4 PLC Setup for DNS and Automatic clock Adjustment . . . . . . . . . . . . . . . . . . 15-55
15-6-5 Auxiliary Area Allocations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-58
CX-Programmer
FINS
Internet
IP router (3) Configuring an independent communications protocol
for the host application using TCP/IP (UDP/IP)
Intranet
Firewall
Server Room Office Floor
Router
(Factory line)
CX-Programmer
NB-series PT
Writing
commands FINS FINS
Ethernet
FINS message
(4) Automatically adjusting the communications
(5) Auto IP
PLC's internal clock
periodically
Auto IP Operation
Auto IP protocol is supported by CP2E N
-type CPU Units.
With Auto-IP, CX-Programmer’s online connection command can be executed without any IP setting in
computer side when PLC is physically connected with the computer directly.
CX-Programmer can list all the CP2E N
-type CPU Units connected in a same segment with the
computer. And the information of PLC (such as IP address, MAC address) will be displayed.
CP2E-N D - CP2E-N D -
FINS message
communications
Operation
Use the automatic clock adjustment function.
With the automatic clock adjustment function, the SNTP server’s clock is taken as the standard for auto-
matically adjusting the built-in clock of the PLC. The adjustment can be regularly executed at a speci-
fied time (once a day) and it can be executed each time by the ladder program.
To use the automatic clock adjustment function, there must be a separate SNTP server on the network.
Aside from the IP address, the host name used for DNS service can be specified for the SNTP server.
15-2 Specifications
15-2 Specifications
Transmission media • Unshielded twisted-pair (UDP) •
Unshielded twisted-pair (UDP)
cable cable
Categories: 5, 5e Categories: 3, 4, 5, 5e
• Shielded twisted-pair (STP) cable •
Shielded twisted-pair (STP) cable
Categories: 100Ω at 5, 5e Categories: 100Ω at 3, 4, 5, 5e
Transmission distance 100 m (distance between hub and node)
Cascade connection There is no limitation on the usage of switching hub
Protocols TCP, UDP, ARP, ICMP (ping only), SNTP, DNS 15
Applications FINS, Socket, SNTP, DNS (Client)
Additional Information
The switching hub function works normally even if a fatal/non-fatal error or CPU WDT error
occurs. The switching hub function does not work when the power of the CPU Unit is turned
OFF.
15-2 Specifications
online to the PLC via Ethernet.
15
Refer to Ethernet Units Construction of Networks Operation Manual for CS/CJ Series
Determine the local IP address (Cat. No. W420) SECTION 5 Determining IP Addresses.
and address conversion method.
Connect to the network Refer to CP2E CPU Unit Hardware User’s Manual (Cat. No. W613) A-4 Network
using twisted-pair cable. Installation.
Use auto connection method or Set the IP address freely with the
the default IP address. CX-Programmer.
(See note 1.)
Refer to 15-3-3 Basic Settings.
Refer to Ethernet Units Construction of Networks Operation Manual for CS/CJ Series
Create the routing tables.
(Cat. No. W420) 6-4 Creating Routing Tables.
(See note 2.)
Note 1 The local IP address and other parameters can be set from the CX-Programmer.
2 It is not necessary step, and the CX-Integrator version 2.67 or higher (CX-One version 4.51 or higher) is
required.
When the FINS communications service is used, routing tables must be created in advance. Routing
tables are required in the following circumstances.
• When communicating with a PLC or computer on another network (e.g. remote programming or monitor-
ing using FINS message or a CX-programmer)
• When routing tables are used for one or more other nodes on the same network
2 Move the cursor to the Settings and double click. Select the Built-in Ethernet Tab to display the
window for making the Ethernet Port Setup.
The default settings are shown below.
15
5 In order for the Ethernet Setup to go into effect, the Ethernet Port must be restarted.
Please use the following way to reset the Ethernet Port.
After the LNK/ACT indicator has turned OFF and then turned ON again (Ethernet cable should
be connected), the Ethernet port will recognize the new settings.
Basic Setting
CX-Programmer tab Settings
Built-in Ethernet IP address
Subnet mask
Broadcast
TCP/IP keep-alive
CX-Programmer Setup
Move the cursor to the Settings and double click. Select the Built-in Ethernet Tab in PLC setup dialog.
15
Note 1 Make settings using the PLC settings function in the CX-Programmer (to be included in version 9.72 and
higher).
2 For details, refer to 2-9 Basic Settings in the Ethernet Units Construction of Networks Operation Manual
(Cat. No. W420).
IP Router Table
An IP router table is a table of correspondences for finding IP addresses for the IP routers that relay tar-
get segments when the Unit communicates via IP routers with nodes on other IP network segments.
z Setting Example
In this example setting for Node A, a network with a Network ID of 130.26.1.1 is connected to an IP
router with an IP address of 130.28.36.253.
130.28.XX (Network ID) 130.26.XX (Network ID)
Set the IP Address to the network number (i.e., the net ID) of the other IP network segment with
which communications are to be executed. The length of the network number (i.e., the number of
bytes) will vary depending on the IP address class. Four bytes are reserved for setting the IP
Address, so set the network number from the beginning and then set 00 in the remaining space.
A maximum of eight settings can be registered. The default is no setting.
Only one default IP router can be set.
The default IP router is selected when no Network ID exists in the IP router table for the destination
network number. To set the default IP router, set 0.0.0.0 for the IP address and set the default IP
router's IP address for the router address.
PING Command
TCP UDP 15
ICMP
Ethernet
Echo response
Echo request
The PLC automatically returns the echo response packet in response to an echo request packet sent
by another node (host computer or other Ethernet Unit).
Note 1 Refer to the following diagram for the relation between message length and date length.
Ethernet
User program
SEND(090),
RECV(098), or
CMND(490)
instruction
Executing, from the host computer, FINS commands with UDP/IP or TCP/IP headers enables various
15
control operations, such as the reading and writing of I/O memory between PLCs, mode changes.
2. Make the settings for FINS/UDP in the PLC Setup with CX-Programmer.
3. Make the routing table settings and transfer them to each PLC. (See note.)
Set the routing tables with CX-Integrator, and transfer it to each PLC.
4. Create a ladder program that includes the SEND, RECV, and CMND
instructions.
2. Make the settings for FINS/TCP in the PLC Setup with CX-Programmer.
3. Make the routing table settings and transfer them to each PLC. (See note.)
Set the routing tables with CX-Integrator, and transfer it to each PLC.
4. Create a ladder program that includes the SEND, RECV, and CMND
instructions.
z FINS/UDP
Button name Settings
FINS/UDP Setting Conversion
FINS/UDP Port
IP Address Table
Destination IP Address
Change Dynamically
z FINS/TCP
Button name Settings
FINS/TCP Setting FINS/TCP Port
FINS/TCP Connection Setting
CX-Programmer Setup
z FINS/UDP
Move the cursor to the Settings and double click. Select the Built-in Ethernet Tab. Click the
FINS/UDP Setting button to display the FINS/UDP setup dialog.
FINS/UDP
Note 1 Make settings using the PLC settings function in the CX-Programmer (to be included in ver-
sion 9.72 and higher).
2 For the details of IP address conversion, IP address dynamically changing and IP address
table, refer to Section 5 Determining IP Addresses in the CS/CJ Series Ethernet Units Con-
struction of Networks Operation Manual (Cat. No. W420).
z FINS/TCP
Move the cursor to the Settings and double click. Select the Built-in Ethernet Tab. Click the
FINS/TCP Setting button to display the FINS/TCP setup dialog.
For details, refer to SECTION 6 FINS Communications Service in the Ethernet Units Operation
Manual Construction of Networks (Cat. No. W420).
Note 1 There are two unit address (DA2 in FINS header) used in CP2E N -type CPU Units.
0xFA It is used for the two new added FINS commands relative with built-in
Ethernet Port. (Ethernet controller reset command and Ethernet Port
information read command)
0x00 It is used for the FINS commands other than the two commands above.
2 Ethernet controller reset command and Ethernet Port information read command can only be executed by
other PLCs or computers on the Ethernet network. It cannot be executed in the local node by CMND
instruction.
The MRES codes are shown in the following table along with the results they indicate.
MRES Execution results
00 Normal completion
01 Local node error
02 Remote node error
03 Unit error (controller error)
04 Service not supported
05 Routing error
10 Command format error
11 Parameter error
22 Status error
23 Operating environment error
25 Unit error
Refer to the SYSMAC CS/CJ/CP/NSJ-series Communications Commands Reference Manual (Cat. No.
W342) or the operation manuals for the relevant unit for further information on response codes.
Command/Response Reference
This section describes the FINS commands that can be sent to PLC’s Ethernet module and the
responses to each command.
The command, response, and (where applicable) the results storage blocks are given with the com-
mands in graphic form as shown in the following diagram. If the data is fixed, it is included in the blocks.
If the data is variable, it is described following the blocks. Each box represents 1 byte; every two boxes
represents 1 word. The following diagram shows 2 bytes, or 1 word.
Two bytes
The results storage format is the format used to store transfer results.
Response codes applicable to the command are described at the end of the command description. If
any UNIX error codes are generated, these are also described. Refer to your UNIX error symbol defini-
tion file /usr/include/sys/errno.h for details. UNIX errors are returned in the results storage area.
Note Except for special cases, all send/receive data is in hexadecimal format.
z RESET: 0403
Reset the Ethernet Unit.
Command Block
04 03
Command code
Response Block
04 03
Command Response
code code
No response will be returned if the command ends normally. A response will be returned only if
an error occurs.
In some cases, send requests (SEND/RECV instructions) made from the PLC to the built-in
Ethernet port just before execution of the RESET command may not be executed.
Except for the FINS communications service sockets, all open sockets (for sockets services) are
closed immediately before resetting.
Response Codes
Command Block
05 01
15
Command code
Command Response Model Version IP address Subnet FINS UDP Mode Ethernet address
code code mask port number setting
Parameters
Model, Version (Response)
The PLC model and version are returned as ASCII characters occupying 20 bytes each (i.e., 20
characters each). If all bytes are not used, the remaining bytes will be all spaces (ASCII 20 Hex).
Example Model: CP2E-ETN21
Version: V1.00
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Bit
0 0 0 0 0 0 0 0 0
Response Codes
Response code Description
0000 Normal
1004 Command format error
Command Block
Response Block
27 30
Command Response
code code
Parameters
FINS/TCP Connection No. (Command)
Specifies, in two bytes, the FINS/TCP connection number (1 to 3) for which the change is to be
made.
Response Codes
Response code Description
0000 Normal
0105 Node address setting error
Local IP address setting error
1004 Command format error
1100 Connection number not set from 1 to 3
Remote IP address set to 0
Remote TCP port number set to 0
2230 Connection already established with specified remote node
2231 Specified connection number not set as FINS/TCP client in
Unit Setup
2232 Remote node change processing for specified connection
number aborted because change request received during
processing
Command Block
27 31
Command FINS/TCP
code connection No.
Response Block
27 31
Command Response FINS/TCP Connection Local IP address Local TCP Remote IP Remote TCP TCP transition
code code connection service port number address port number
No.
Parameters
FIFINS/TCP Connection No. (Command, Response)
Command: Specifies, in two bytes, the FINS/TCP connection number (1 to 3) for which the status is
to be read.
Response: Specifies the FINS/TCP connection number (1 to 3) for which the status was read.
Response Codes 15
Response code Description
Command Block
27 50 6 bytes 6 bytes
Response Block
27 51
Command Response
code code
Parameters
Number of Records (Command)
The number of records to write is specified in hexadecimal between 0000 and 0020 (0 to 32 deci-
mal) in the command. If this value is set to 0, the IP address table will be cleared so that no records
are registered.
00
The new I/O address table records will not be effective until the PC is restarted or the Ethernet
Unit is reset.
An error response will be returned if the IP address conversion method in the system mode set-
tings is set for automatic generation.
Response Codes
Response code Description
0000 Normal (echo reply received from the remote node)
1004 Command format error
1003 The number of records specified does not match the sent data
length.
110C The number of records is not between 0 and 32.
The FINS node address is not between 1 and 126
The IP address is 0.
2307 IP address conversion method is set for automatic generation.
Command Block
27 51 8 bytes 8 bytes
Response Block
27 51
Command Response
code code
Parameters
Number of Records (Command)
The number of records to write is specified in hexadecimal between 0000 and 0008 in the com-
mand. If this value is set to 0, the IP router table will be cleared so that no records are registered.
• IP Network Address
The network ID from the IP address in hexadecimal. The network ID part corresponding to the
address class (determined by the leftmost 3 bits) set here, is enabled.
• Router IP Address
The IP address (in hexadecimal) of a router connected to a network specified with IP addresses.
15
Response Codes
Response code Description
Command Block
27 60
Command Number of
code records
Response Block
27 60 6 bytes 6 bytes
Parameters
Number of Records (Command, Response)
The number of records to read is specified between 0000 and 0020 (0 to 32 decimal) in the com-
mand. If this value is set to 0, the number of stored records is returned but the IP address table
records are not returned. The response returns the actual number of records read.
00
If the IP address table contains fewer records than the number specified in the number of
records parameter, all the records contained in the IP address table when the command is exe-
cuted will be returned and the command execution will end normally.
An error response will be returned if the IP address conversion method in the system mode set-
tings is set to the automatic generation method.
Response Codes
Response code Description
0000 Normal
1004 Command format error
2307 IP address conversion method is set to the automatic genera-
tion method.
Command Block
27 61
Command Number
code of records
Response Block
27 61 8 bytes 8 bytes
Parameters
Number of Records (Command, Response)
The number of records to read is specified between 0000 and 0008 (0 to 8 decimal) in the com-
mand. If this value is set to 0, the number of stored records will be returned but the IP router table
records will not be returned. The response returns the actual number of records read.
• IP Network Address
The network ID from the IP address in hexadecimal. The network ID part corresponding to the
address class (determined by the leftmost 3 bits) set here, is enabled.
• Router IP Address
The IP address (in hexadecimal) of a router connected to a network specified with IP addresses.
If the IP router table contains fewer records than the number specified in the number of records
parameter, all the records contained in the IP router table when the command is executed will be
returned and the command execution will end normally.
Response Codes
Response code Description
0000 Normal
1004 Command format error
The data and FINS commands can be transmitted between the CP2E N
-type CPU Unit and other
devices using the CMND, SEND or RECV instuction.
Setting the network address and the node address of the instrction in the CP2E N
-type CPU Unit
ladder program, it is possible to send the data and FINS commands to another device, or receive data
from another device.
Sample Program
cCP2E N
-type CPU Unit requests the data to be transmitted from dCP2E N
-type CPU Unit
(node address 3) in the local network and receives the data.
When W0.00 and A202.7 (the Communications Port Enabled Flag for port 07) are ON, 20 words are
read from D100 to D119 of dCP2E N
-type (node address 3), transmitted to cCP2E N
-type
and stored in D200 to D219 using the RECV instruction.
Send request
RECV instruction
Response data
D200 D100
D201 D101
20 words 20 words
: :
D219 D119
W0.00 A202.07
RECV
S D00100 First source word (remote node)
D D00200 First destination word (local node)
C D00300 First control word
15 87 0
D: D00300 0 0 1 4 Number of words to receive (send request): 0014 hex (20 words)
C+2: D00302 0 3 0 0 Source node address: 3 hex, Source unit address: 00 hex (CPU Unit)
C+3: D00303 0 7 0 3 Response requested (fixed), Logical port number: 7 hex, Retries: 3 hex
CS/CJ/CP Series PT
Ethernet port Computer
CP2E N
-type CPU Unit can be only configed as the end point of the network.
It cannot be used as a rely node for the network. It can send or receive FINS command through up to 3
layers of the network. 15
CP2E N-type
PLC2
Network 2
PLC3
Network 3
Ethernet
TCP/UDP
protocol
CP2E-N
-type
CPU Unit
UDP TCP
Socket
TCP/UDP Parameters
protocol
3. Select Transfer to PLC from the Options Menu, and then click the Yes
button. The Setup data in the allocated DM Area will be transferred to the
CPU Unit.
A Socket Service Parameter Area cannot be used for other sockets once open processing has
been successfully completed for it. Check the socket status before attempting to open a socket.
TCP socket status is provided in words m+4 to m+6 in the DM Area for sockets 1 to 3.
When a send or receive request is made, the data will be automatically sent or received accord-
ing to the send/receive data address in the Socket Service Parameter Area. When processing
has been completed, a response code will be automatically stored in the Socket Service Param-
eters.
Note For details about timing charts, refer to SECTION 6 Socket Services in the Ethernet Units Construction of
Applications Operation Manual (Cat. No. W421).
Socket services cannot support CMND command.
Note Make settings using the PLC settings function in the CX-Programmer (to be included in version 9.72 and
higher).
15
Socket Service
Closing Flag
Note Do not forcibly manipulate the above status flags during socket service is used.
7 6 5 4 3 2 1 0
A571 to A572
UDP Open Request Switch
TCP Passive Open Request Switch
TCP Active Open Request Switch
Send Request Switch
Receive Request Switch
Close Request Switch
Offset Word
Bit
15 08 07 00
m D16000 TCP Socket No. 1 Number of Bytes Received
m+1 D16001 TCP Socket No. 2 Number of Bytes Received
For each TCP socket, the number of bytes of data in the reception buffer is stored in one word. A max-
imum of 4,096 bytes of data can be held in the reception buffer, but a value of only up to the maximum
value (1,024 bytes) that can be set for receive requests by manipulating control bits is stored.
0000 hex: 0 bytes
0400 hex: 1,024 bytes
The Data Received Flag in the CIO Area turns ON and OFF linked to this word. This area is given a
value of 0000 hex when a receive request is executed by manipulating control bits. If any data
remains in the reception buffer after the receive request processing is completed, the remaining
number of bytes is stored and the Data Received Flag turns ON again.
Before a receive request is executed, a check is performed to confirm that the required data is avail-
able.
The connection status for each TCP socket is stored by code in this word. For details, refer to A-6-1
TCP Status Transitions.
When socket services are requested by control bit manipulation, the settings must be made in
Parameter Settings
The following table shows the parameters that are required for each service and the use of the
parameters by the socket service.
15
z UDP Socket Services
Parameters
z Socket Option
For the TCP OPEN REQUEST (ACTIVE or PASSIVE) command, specifies whether or not the keep-
alive function is to be used. When the keep-alive function is used, bit 8 is ON.
z Remote IP Address
Specify the IP address of the remote device.
• Offset +2 in the Socket Service Parameter Area contains the upper bytes of the Remote IP
Address, and offset +3 contains the lower bytes.
Example: The contents of offsets +2 and +3 would be as shown below when the Remote IP
Address is 196.36.32.55 (C4.24.20.37 hexadecimal).
+2: C424
+3: 2037
• This parameter is not used when making a receive request for a UDP socket. The remote IP
address will be stored with the response data and will be written as the Remote IP Address in the
Socket Service Parameter Area.
• When opening a passive TCP socket, the combination of the remote IP address and the remote
TCP port number can be used to affect processing as shown in the following table.
Remote IP Remote TCP Processing
Offset 15 8 7 0
+6 Area Leftmost 2 digits
designation of word address
Rightmost 2 digits Bit number
+7
of word address (always 00 Hex)
z Response Codes
When processing of a request has been completed for socket services executed using Socket Ser-
vice Request Switches, a response code will be stored in the Response Code word in the Socket
Service Parameter Area. The following response codes will be stored depending on the service that
was requested.
Note These response codes will be returned only on large, multilevel networks.
Note These response codes will be returned only on large, multilevel networks.
Note These response codes will be returned only on large, multilevel networks.
Note These response codes will be returned only on large, multilevel networks.
For details, refer to SECTION 6 Socket Services in the Ethernet Units Construction of Applications
Operation Manual (Cat. No. W421).
z System Configuration
The programming example uses the following system configuration. For the TCP connection, the
Ethernet Unit uses a passive open and the host computer uses an active open.
z Data Flow
The data will flow between the CPU Unit, Ethernet Unit, and host computer as shown in the following
diagram.
Note Here, “execution bits” refer to W0.00 to W0.03, which are used in the ladder diagram to con-
trol execution of communications.
z Basic Operations
• W0.00 is turned ON to request opening a TCP socket from the Ethernet Unit.
• W0.01 is turned ON to request closing the TCP socket from the Ethernet Unit.
• W0.02 is turned ON to request sending data from the Ethernet Unit. Data (100 bytes) is sent
beginning at D00000.
• W0.03 is turned ON to request receiving data from the Ethernet Unit. The data that is received
(100 bytes) is stored beginning at D01000.
• One of the bits between W1.00 and W1.03 will turn ON if an error occurs. Refer to 15-7-5 Socket
Service Request Switches for information on errors.
DM Area
15
D00049
D01049
WR Area
15 03 02 01 00
TCP
W0 Receive TCP TCP TCP
Bit Send Bit Close Bit Open Bit
Programming Example
W0.00
TCP Passive Open
@RSET When the TCP Open Bit (W0.00) turns ON, the TCP
W1.00 Open Error Flag (W1.00) is turned OFF and the TCP
@SET Opening Flag (W2.00) is turned ON to initialize
W2.00 processing.
W0.00 W2.00
MOV(021)
#1 When the TCP Opening Flag (W2.00) turns ON, the
D16008
following parameters are written to the parameter
MOV(021) area for socket number 1.
#1000 D16008: 0001 Hex = UDP/TCP socket No. 1
D16009 D16009: 1000 Hex = Local UDP/TCP port No. 4096
D16010 and D16011:
MOV(021)
#C0A8
C0A8 FA05 Hex =
D16010 Remote IP address 192.168.250.5
D16012: 0000 Hex = Any remote UDP/TCP port No.
MOV(021) D16016: 0000 Hex = No timeout time
#FA05
D16011
MOV(021)
#0
D16012
MOV(021)
#0
W0.00 W2.00 D16016
After the parameters have been set, the TCP Passive
SET
A571.01 Open Request Switch (A571.01) is turned ON and the
TCP Opening Flag (W2.00) is turned OFF.
RSET
W2.00
If the TCP Passive Open Request Switch (A571.01)
turns OFF while the TCP Opening Flag (W2.00) is OFF,
W0.00 W2.00 A571.01 the contents of the response code (D16017) in the
<>(305) SET Socket Service Parameter Area is checked, and if it is
D16017 W1.00 not 0000 Hex (normal end), the TCP Open Error Flag
#0 (W1.00) is turned ON.
W0.00 W2.00 A571.01 After the execution results have been checked, the
RSET TCP Open Bit (W0.00) is turned OFF.
W0.00
W0.01
TCP Close
@RSET When the TCP Close Bit (W0.01) turns ON, the TCP
W1.01 Close Error Flag (W1.01) is turned OFF and the TCP
@SET Closing Flag (W2.01) is turned ON to initialize
W0.01 W2.01
W2.01 processing.
MOV(021)
#1
W2.01 D16008
W0.01 When the TCP Closing Flag (W2.01) turns ON, the
SET following parameter is written to the parameter area for
A571.05 socket number 1.
D16008: 0001 Hex = UDP/TCP socket No. 1
RSET
W2.01
After the parameter has been set, the Close Request
W0.01 W2.01 A571.05
Switch (A571.05) is turned ON and the TCP Closing
<>(305) SET Flag (W2.01) is turned OFF.
D16017 W1.01
#0 If the Close Request Switch (A571.05) turns OFF
while the TCP Opening Flag (W2.01) is OFF, the
W0.01 W2.01 A571.05
contents of the response code (D16017) in the
RSET Socket Service Parameter Area is checked, and if it
W0.01 is not 0000 Hex (normal end), the TCP Close Error
Flag (W1.01) is turned ON.
Continued on next page. After the execution results have been checked, the
TCP Close Bit (W0.01) is turned OFF.
MOV(021)
#0
W0.02 W2.02 D16015
SET
After the parameters have been set, the Send Request Switch
A571.03 (A571.03) is turned ON and the TCP Sending Flag (W2.02) is
=(300) @SET 15
D16000 W2.03
&100
W0.03 W2.03 TCP Receive
MOV(021) When the TCP Receive Bit (W0.03) turns ON, the TCP Receive
SET
A571.04
RSET
W2.03
W0.03 W2.03 A571.04 If the Receive Request Switch (A571.04) turns OFF while the TCP
Receiving Flag (W2.03) is OFF, the contents of the response code
RSET
W0.03 (D16017) in the Socket Service Parameter Area is checked, and if it
is not 0000 Hex (normal end), the TCP Receive Error Flag (W1.03)
is turned ON.
After the execution results have been checked, the TCP Receive Bit
(W0.03) is turned OFF.
Note When using the above programming example, change the bit and word addresses as necessary to avoid
using the same areas used by other parts of the user program or the CPU Bus Unit.
The built-in clock of the PLC connected to the Ethernet can be automatically adjusted, with the SNTP
server clock taken as the standard. Automatic adjustments through the entire system enable the vari-
ous records generated by production equipment to be managed according to clock information and
analyzed.
The PLC can acquire clock information from the SNTP server at a particular time or when a dedicated
bit turns ON, and it can refresh the internal clock information automatically.
SNTP server
Ethernet
Clock information
CP2E N
-type
CPU Unit
IP address Ethernet
Host name
CP2E N
-type
CPU Unit
2. With the CX-Programmer online, set the following items in the PLC Setup.
• SNTP server specification (required)
• Access to the SNTP server is enabled when writing clock information from
the SNTP server to the CPU Unit when the Automatic Clock Adjustment
Switch is turned from OFF to ON and at a set automatic adjustment time.
• Automatic clock adjustment setting
4. Select Transfer to PLC from the Options Menu and click the Yes button.
The PLC Setup will be transferred to the CPU Unit. 15
All these settings are in the Built-in Ethernet Tab. Click on the relative button can open the setup dialog.
CX-Programmer Setup
z DNS Setting
Move the cursor to the Settings and double click. Select the Built-in Ethernet Tab. Click the DNS
Setting button to display the DNS setup dialog.
Retry timer Set the time to elapse before retrying when a connection to the 0 (10 s)
DNS server fails.
This setting does not normally need to be changed.
Service Status
Address Bit(s) Name Status Unit operation Access
A46 5 DNS Server Error ON ON when the following errors occur Read only
during DNS server operation:
• An illegal server IP address is set.
• A timeout occurs during communications
with the server.
OFF OFF when DNS server operation is
normal.
11 SNTP Server ON ON when the following errors occur during
Error SNTP server operation:
• An illegal server IP address is set.
• A timeout occurs during communications
with the server.
OFF OFF when SNTP server operation is normal.
Service Request
Address Bit(s) Name Status Unit operation Access
A566 4 Automatic Clock ON The automatic clock adjustment is executed Read/Write
Adjustment when this bit turns ON.
Switch
OFF Turned OFF by Unit after automatic clock
adjustment has been completed.
16-1-1 Overview
The CP2E CPU Unit supports PID instructions with the autotuning function. Ladder programs can be
written to perform PID temperature control.
• Temperature Input from Temperature Sensor Unit to words in the Input Area.
input:
• PID control: Execute using the PIDAT instruction in ladder program.
The PIDAT instruction is used in combination with the TPO instruction
(TIME-PROPORTIONAL OUTPUT) to perform time-proportional control.
• Control output: To connect an SSR, connect a 24-V power supply to the transistor output and
output voltage pulses.
Ladder program
PIDAT
S: Input word
S
C: First parameter word
C
D D: Output word
TPO
S S: Input word
CP2E
PID
Time-proportional
transistor output
Temperature Sensor
SSR
Additional Information
The sampling cycle set for a PIDAT instruction is between 10 ms to 99.99 s in increments of
10 ms. The actual calculation cycle is determined by the relationship with cycle time. Refer to the
CP1E/CP2E CPU Unit Instructions Reference Manual (Cat. No. W483) for the PIDAT instruction.
2 Wiring I/O
• Connect the temperature sensor to the Tempera-
ture Sensor Unit.
• Connect the SSR to the transistor output.
z PIDAT Instruction
The PIDAT instruction treats the PV as unsigned hexadecimal data (0000 to FFFF hex). Signed data
cannot be used, so if the temperature range includes negative values, apply scaling with the APR
instruction.
Autotuning Procedure
1 Set the PID parameter in words C to C+10. Word C is specified by the second operand.
Example: Place the set value (SV) in C and place the input range in bits 08 to 11 of C+6. Turn
ON bit 15 of C+9 (AT Command Bit).
1 Set the PID parameter in words C to C+10. Word C is specified by the second operand.
Example: Place the set value (SV) in C, the proportional band in C+1, the integral constant in
C+2, the derivative constant in C+3, and the input range in bits 08 to 11 of C+6. Turn OFF bit 15
of C+9 (AT Command Bit).
2 Turn ON the PIDAT instruction’s input condition. PID control will be started with the specified
PID constants.
3 Turn ON bit 15 in C+9 (the AT Command Bit) while the input condition for the PID instruction is
ON. Autotuning will be performed. When it has finished, the AT Command Bit (bit 15 in C+9) will
turn OFF. The proportional band (C+1), integral constant (C+2), and derivative constant (C+3)
calculated by autotuning will be stored and PID control will be started with those PID constants.
System Configuration
K thermocouple
Controlled device
Inputs connected to terminal Inputs connected to
blocks CIO 0 and CIO 1 terminal block CIO 2
• A K thermocouple is used for the temperature input. Use a CP1W-TS001 Temperature Sensor Unit
(thermocouple input).
C+40:D140
W1.00
When autotuning is completed, the content of D109 is automatically overwritten
by #0000 hex and the calculated PID constants are input to D101 to 103.
W1.00
Manipulated variable range: 13 bits (bits 0 to 3: #5 hex)/
RSET Input type: Manipulated variable (bits 4 to 7: #1 hex),
always read input (bits 8 to 11: #3 hex)/Output limit
100.00 disabled (bits 12 to 15: #0 hex)
C:D300 #0315
C+1:D301 &2000 Control cycle: 20.00 s
C+2:D302 &0 No upper output limit
C+3:D303 &0 No lower output limit
C+4:D304
~
Work Area
C+6:D306
z Description
• When W0.00 turns ON, the work area in D111 to D140 is initialized (cleared) according to the
parameters set in D100 to D110. After the work area has been initialized, autotuning is started
and the PID constants are calculated from the results from changing the manipulated variable.
After autotuning has been completed, PID control is executed according to the calculated PID
constants set in D101 to D103. The manipulated variable is output to D200. The manipulated vari-
able in D200 is divided by the manipulated variable range using the TPO instruction. This value is
treated as the duty factor which is converted to a time-proportional output and output to
CIO100.00 as a pulse output.
• When W0.00 turns OFF, PID is stopped and CIO100.00 turns OFF.
• When W0.00 is ON, the Thermocouple’s PV (-200 to 1300) is scaled to the PIDAT instruction input
range (#0 to #1FFF hex). The set values must be input according to the scaled PV. For example, if
the PV is 160°C, it is set as [8191/(1300+200)] × (160+200) = 1966].
16-2 Clock
The clock can be used only with the CP2E N/S
-type CPU Unit.
The current data is stored in the following words in the Auxiliary Area.
Name Address Function
Clock data A351 to A354 The seconds, minutes, hour, day of month, month, year, and day of
week are stored each cycle.
A351.00 to A351.07 Seconds: 00 to 59 (BCD)
A351.08 to A351.15 Minutes: 00 to 59 (BCD)
A352.00 to A352.07 Hour: 00 to 23 (BCD)
A352.08 to A352.15 Day of the month: 01 to 31 (BCD)
A353.00 to A353.07 Month: 01 to 12 (BCD)
A353.08 to A353.15 Year: 00 to 99 (BCD)
A354.00 to A354.07 Day of the week:
00: Sunday, 01: Monday, 02: Tuesday, 03: Wednesday,
04: Thursday, 05: Friday, 06: Saturday
16-2 Clock
Additional Information
The clock cannot be used if a battery is not installed or the battery voltage is low.
When the clock stops, the clock data will be reset to 2001-01-01 01:01:01 Sunday.
16
z Related Auxiliary Area Bits and Words
Name Address Contents
Start-up Time A510 and A511 The time at which the power was turned ON
(day of month, hour, minutes, and seconds).
Power Interruption Time A512 and A513 The time at which the power was last interrupted
(day of month, hour, minutes, and seconds).
Power ON Clock Data 1 A720 to A722 Consecutive times at which the power was turned
Power ON Clock Data 2 A723 to A725 ON (year, month, day of month, hour, minutes, and
seconds). The times are progressively older from
Power ON Clock Data 3 A726 to A728 number 1 to number 10.
Power ON Clock Data 4 A729 to A731
Power ON Clock Data 5 A732 to A734
Power ON Clock Data 6 A735 to A737
Power ON Clock Data 7 A738 to A740
Power ON Clock Data 8 A741 to A743
Power ON Clock Data 9 A744 to A746
Power ON Clock Data 10 A747 to A749
Operation Start Time A515 to A517 The time that operation started (year, month, day
of month, hour, minutes, and seconds).
Operation End Time A518 to A520 The time that operation stopped (year, month, day
of month, hour, minutes, and seconds).
z Time-related Instructions
Name Mnemonic Function
CALENDAR ADD CADD Adds time to the calendar data in the specified words.
CALENDAR SUBTRACT CSUB Subtracts time from the calendar data in the specified words.
CLOCK ADJUSTMENT DATE Changes the internal clock setting to the setting in the speci-
fied source words.
Overview
The contents of the DM Area (D) can be saved when the user needs it. The contents of the specified
words in the DM Area data can be backed up from I/O memory to the built-in Flash Memory during
operation by turning ON a bit in the Auxiliary Area. The number of DM Area words to back up is speci-
fied in the Number of CH of DM for backup Box in the PLC Setup. If the Restore D0- from backup mem-
ory Check Box is selected in the PLC Setup, the backup data will automatically be restored to I/O
memory when the power is turned back ON so that data is not lost even if power is interrupted.
D0
16
~
Specified number
of words Data
D (n-1)
restored.
16-3-2 Procedure
Perform the following procedure to save the DM data to the built-in Flash Memory during operation or
while stopped.
1 Check the Restore D0- from backup memory Check Box in the Startup Data Read Area of the
PLC Setup from the CX-Programmer.
Also, set the number of words to be backed up starting from D0 in the Number of CH of DM for
backup Box. Transfer the PLC Setup to the CPU Unit and turn ON the power supply.
16-3-2 Procedure
2 Turn ON A751.15 (DM Backup Save Start Bit) from the CX-Programmer, a Programmable Ter-
minal (PT), or a ladder program.
The specified number of words in the DM Area starting from D0 will be backed up to the built-in
Flash Memory.
• Using a Ladder Program
DM Backup Save
Start Bit
One cycle
DM Backup Save ON
Start Bit
(A715.15)
OFF
DM Backup Save ON
Flag
(A751.14)
OFF
When the saving operation has been completed, A751.14 (DM Backup Save Flag) will turn OFF.
A751.11
Generates a user-defined
FALS
fatal error
10
DM Backup Restore Failed Flag
#0000
• To ensure concurrency between DM backup data and the contents of the DM Area in the I/O
memory, use exclusive processing in the ladder program so that contents of the DM Area
words in the I/O memory that are set to be backed up are not changed during a backup
operation.
• Data can be written up to 100,000 times to the built-in Flash Memory. Data cannot be written
once this limit is exceeded. If writing fails, A315.15 (Backup Memory Error Flag) will turn ON.
Additional Information
Read Protection
With the CX-Programmer, it is possible to set read protection using a password for the whole ladder
program.
When the program is read-protected using a password, it is not possible to display or edit any of the lad-
der programs using the CX-Programmer unless the password is entered in the Disable Password Dia-
log Box from the CX-Programmer.
This enables improved security for PLC data in equipment.
z Setting Protection
1 Right-click the PLC in the project tree to open the Protection Tab Page of the PLC Proper-
ties. 16
4 Confirm that the setting item is checked, then click the OK button.
z Overview
The lot number is stored in words A310 and A311 of the CP2E CPU Unit’s Auxiliary Area. These
words generate a fatal error to prevent a user program from running on a PLC with a different pro-
duction lot number. In addition, by setting passwords, you can prohibit loading of programs, and
d d m y y
16
y y m m d d
A311 A310
z Programming Example
(1) The following instructions will create a fatal error to prevent the program from being
executed when the lot number is not 23905.
(2) The following instructions will create a fatal error to prevent the program from being
executed when the lot number does not end in 05.
(3) The following instructions will create a fatal error to prevent the program from being
executed when the lot number does not begin with 23Y.
Terminal Arrangement
z CP1W-ADB21
VI1 II1 VI2 II2 COM
z CP1W-DAB21V
VO1 VO2 COM
z CP1W-MAB221
LED pattern
LED Color Description Status Remark 17
ERR Red Fault condition indicator Flash A communication error with CPU Unit has occurred
at the unit.
Lit Other errors except the communication error.
Not lit Operation is normal.
17-3-1 Installation
The following processing explains how to install and remove an Analog Option Board.
1 Press the up/down lock-levers on both sides of the Option Board slot cover at the same time to
unlock the cover, and then pull the cover out.
2 Check the alignment to make the corner cut of the Analog Option Board fit in the Option Board
slot, and firmly press the Analog Option Board in until it snaps into place.
17-3-2 Setting
To use the analog option board on CP2E N
-type CPU Unit, it is necessary to set the serial commu-
nication settings in the PLC Settings.
Connect the CX-Programmer to the CPU Unit, and then change the PLC Settings as follows.
Always turn OFF the power supply to the CPU unit and wait until all the operation indicators go out.
Press the up/down lock-levers on both sides of the Analog Option Board at the same time to unlock the
Option Board, and then pull it out.
The memory allocation about analog conversion in the CIO area of PLC is shown as the following diagram.
The range of the CIO area is CIO80 to CIO89.
The details of allocated CIO channels are described in the following table.
Contents
Channel
CP1W-ADB21 CP1W-DAB21V CP1W-MAB221
CIO80 Analog Input 1 --- Analog Input 1
CIO81 Analog Input 2 --- Analog Input 2
CIO82 to CIO84 --- --- ---
CIO85 --- Analog Output 1 Analog Output 1
CIO86 --- Analog Output 2 Analog Output 2
CIO87 to CIO89 --- --- ---
Note The flag sets ON if Analog Option Board has already worked normally. Then A/D input data can be read and
D/A output data can be written.
Output off bit: A500.15
AR Bits Content Error Process
A500.15 Output Off Bit 0: Output effective
1: Analog option board DA output clear
Note This bit will also affect other PLC output channels.
Option board error bit: A315.13
AR Bits Content Error Process
A315.13 Option board error • Turn ON when two Analog Option Boards
bit are installed on CP2E N30/40/60 CPU
Unit.
• Cleared when the corresponding anomaly
is cleared.
Note When Analog Option Boards are installed in both option board slots, A424.00 and A424.01 are all set ON.
z 0 to 10 V
The 0 to 10 V range corresponds to the hexadecimal values 0000 to 0FA0 (0 to 4000). The entire
data range is 0000 to 0FFF (0 to 4095).
Converted Data
Hexadecimal (Decimal)
0FFF(4095)
0FA0(4000)
0000(0)
0V 10V 10.24V
z 0 to 20 mA
The 0 to 20 mA range corresponds to the hexadecimal values 0000 to 07D0 (0 to 2000). The possi-
ble data range is 0000 to 0FFF (0 to 4095). But it is strongly suggested that the input current must
not exceed 30 mA.
Converted Data
Hexadecimal (Decimal)
07D0(2000)
0000(0)
0mA 20mA
Note When using current inputs, voltage input terminals must be short-circuited with current input terminals.
17
17-5-3 Wiring
17-5-3 Wiring
Internal Circuits
180 kΩ
VI1
56 kΩ 250 Ω
II1
Analog input 1
Internal circuits
to to
180 kΩ
VI2
56 kΩ 250 Ω
II2
Analog input 2
COM (−)
Analog ground
z Applicable Cables
Solid wire or ferrules can be used.
• Recommended solid wire
Wire type Wire size
Solid Wire 0.2mm to 0.5mm2 (AWG24 to AWG20)
2
• Recommended ferrules
Manufacturer Model Applicable wire
Phoenix Contact AI-0.25-12 0.2mm2 (AWG24)
z Terminal Wiring
When wiring the analog I/O terminal block, treat either solid or stranded wires directly.
2-conductor shielded
twisted-pair cable
Release button
• To make the connection, press the release button in with a small flat blade screwdriver and push
the line in while the lock is released. Remove the screwdriver and lock it inside.
• To disconnect the wiring, press the release button in with a small flat blade screwdriver and pull
the line out while the lock is released.
Note 1 Ferrules without plastic sleeve cannot be used.
2 When using stranded wire, twist the core so that the barbed wires cannot protrude.
3 Do not solder-plate the end of cable.
The screwdriver shown below is recommended for wiring.
Model Manufacturer
SZS 0.4×2.5 Phoenix Contact
Side Front
0.4mm 2.5mm
Note 1 When an input is not being used, short the V IN, I IN and COM terminals.
2 Separate wiring from power lines (AC power supply lines, high-voltage lines, etc.)
3 When there is noise in the power supply line, install a noise filter on the input section and the power supply.
0V 0V
0V
17
17-5-3 Wiring
z 0 to 10 V
The hexadecimal values 0000 to 0FA0 (0 to 4000) correspond to an analog voltage range of 0 to 10
V. The entire output range is 10 to 10.24 V.
10.24V
10V
17-6-3 Wiring
Internal Circuits
VO1
Analog output 1
Internal circuits
Analog output 2
COM(−)
Analog ground
17
Applicable Cables and Terminal Wiring
z Applicable Cables
17-6-3 Wiring
Solid wire or ferrules can be used.
• Recommended solid wire
Wire type Wire size
Solid Wire 0.2mm2 to 0.5mm2 (AWG24 to AWG20)
• Recommended ferrules
Manufacturer Model Applicable wire
Phoenix Contact AI-0.25-12 0.2mm2 (AWG24)
z Terminal Wiring
When wiring the analog I/O terminal block, treat either solid or stranded wires directly.
2-conductor shielded
twisted-pair cable
Release button
• To make the connection, press the release button in with a small flat blade screwdriver and push
the line in while the lock is released. Remove the screwdriver and lock it inside.
• To disconnect the wiring, press the release button in with a small flat blade screwdriver and pull
the line out while the lock is released.
Note 1 Ferrules without plastic sleeve cannot be used.
2 When using stranded wire, twist the core so that the barbed wires cannot protrude.
3 Do not solder-plate the end of cable.
The screwdriver shown below is recommended for wiring.
Model Manufacturer
SZS 0.4×2.5 Phoenix Contact
Side Front
0.4mm 2.5mm
FG
Note 1 Separate wiring from power lines (AC power supply lines, high-voltage lines, etc.)
2 When there is noise in the power supply line, install a noise filter on the input section and the power supply.
3 When external power is supplied, or when the power is interrupted, there may be a pulse status analog
output of up to 1 ms. If this status is a problem, take the following measures.
• Turn ON the power to the CP2E N
-type CPU Unit, check the operation status, and then turn ON the
power at the load.
• Turn OFF the power to the load and then turn OFF the power to the CP2E N
-type CPU Unit.
0V 0V
0V
17-6-3 Wiring
z 0 to 10 V
The 0 to 10 V range corresponds to the hexadecimal values 0000 to 0FA0 (0 to 4000). The entire
data range is 0000 to 0FFF (0 to 4095).
Converted Data
Hexadecimal (Decimal)
0FFF(4095)
0FA0(4000)
z 0 to 20 mA
17
The 0 to 20 mA range corresponds to the hexadecimal values 0000 to 07D0 (0 to 2000). The possi-
ble data range is 0000 to 0FFF (0 to 4095). But it is strongly suggested that the input current mustn’t
exceed 30 mA.
07D0(2000)
0000(0)
0mA 20mA
z 0 to 10 V
The hexadecimal values 0000 to 0FA0 (0 to 4000) correspond to an analog voltage range of 0 to 10
V. The entire output range is 10 to 10.24 V.
10.24V
10V
Note When using current inputs, voltage input terminals must be short-circuited with current input terminals.
17-7-3 Wiring
Internal Circuits
180 kΩ
VI1 VO1
56 kΩ 250 Ω Analog output 1
II1
Analog input 1
Internal circuits
Internal circuits
to to
to to
180 kΩ VO2
VI2
56 kΩ 250 Ω Analog output 2
II2
Analog input 2
COM(−)
COM(−)
Analog ground Analog ground
z Applicable Cables
Solid wire or ferrules can be used.
• Recommended solid wire
Wire type Wire size
Solid Wire 0.2mm2 to 0.5mm2 (AWG24 to AWG20) 17
• Recommended ferrules
17-7-3 Wiring
Manufacturer Model Applicable wire
Phoenix Contact AI-0.25-12 0.2mm2 (AWG24)
z Terminal Wiring
When wiring the analog I/O terminal block, treat either solid or stranded wires directly.
2-conductor shielded
twisted-pair cable
Release button
• To make the connection, press the release button in with a small flat blade screwdriver and push
the line in while the lock is released. Remove the screwdriver and lock it inside.
• To disconnect the wiring, press the release button in with a small flat blade screwdriver and pull
the line out while the lock is released.
Note 1 Ferrules without plastic sleeve cannot be used.
2 When using stranded wire, twist the core so that the barbed wires cannot protrude.
3 Do not solder-plate the end of cable.
The screwdriver shown below is recommended for wiring.
Model Manufacturer
SZS 0.4×2.5 Phoenix Contact
Side Front
0.4mm 2.5mm
2-core shielded
twisted-pair cable
V OUT +
Analog Analog
I/O device with
Option voltage
Board COM − input
FG
Note 1 When an input is not being used, short the V IN, I IN and COM terminals.
2 Separate wiring from power lines (AC power supply lines, high-voltage lines, etc.)
3 When there is noise in the power supply line, install a noise filter on the input section and the power supply.
4 When external power is supplied, or when the power is interrupted, there may be a pulse status analog
output of up to 1 ms. If this status is a problem, take the following measures.
• Turn ON the power to the CP2E N
-type CPU Unit, check the operation status, and then turn ON the
power at the load.
• Turn OFF the power to the load and then turn OFF the power to the CP2E N
-type CPU Unit.
0V 0V
0V
17-7-3 Wiring
17-10Trouble Shooting
17-11-1 Procedure
Note 1 If PLC communication protocol setting is error, the option board will always try to link the PLC, and the
error LED will be lit.
2 Only when the initialization process has finished (A435.15 sets on), user can use the A/D conversion
data or write the D/A output data.
17
17-11-1 Procedure
Execution
condition A435.15
MOV(021)
80
D0 ← Reads analog input 1’s converted value to D0.
Execution
condition A435.15
MOV(021)
81
D1 ← Reads analog input 2’s converted value to D1.
Execution
condition A435.15
MOV(021)
D2
85 ← The content of D2 is written to the analog
output 1.
18-2-1 CX-Programmer
The CX-Programmer is a programming application for creating the ladder programs that are executed in
a CP2E CPU Unit.
In addition to ladder program creation, the CX-Programmer also has functions that are needed to set up
and operate the CP2E, including functions for debugging ladder programs, displaying addresses and
present values, monitoring, setting the connected PLC, programming, and monitoring.
The CX-Programmer can be installed foom CX-One installer. Refer to CX-One FA Integrated Tool
Package Setup Manual (Cat. No. W463) for details.
For details on the operation of the CX-Programmer, refer to the CX-Programmer Online Help.
2 Create new project Select CP2E or CP2E-N in the Change PLC Dialog Box.
18
6 Change operating mode Select PLC - Operating mode - Program.
18-2-1 CX-Programmer
8 Restart the CP2E Once turn OFF the power supply to the CP2E CPU Unit, then turn
ON again.
9 Start operation
CP2E CPU Unit operation will start.
Start CX-Programmer
Select Start - Programs - OMRON - CX-One - CX-Programmer.
The CX-Programmer will start.
The title display will appear, followed by the Main Window.
z Main Window
(1)
(2)
(3)
(4)
(5)
(7)
(6)
(8)
(9)
(10)
(1)Title Bar
Displays the name of the project.
(2)Main Menu
Displays the menus from which commands are selected.
(3)Toolbar
Displays the icons for executing commands.
(4)Project Tree and (6) Project Workspace
Used to manage programs and settings.
(5)Sections
Allow ladder programming to be split up into a number of parts.
(7)Ladder Section Window
A window that is used to create and edit ladder programs.
(8)I/O Comment Bar
Displays the name, address, value, and I/O comment of the symbol selected with the cursor.
(9)Output Window
Displays messages, such as search results and errors.
(10)Status Bar
Displays information such as the PLC name, online/offline status, and position of the active cell.
(3)
(4)
(1)Rung Number
18
(2)Program Address
Operation
18-2-2 CX-Programmer Flow from Startup to
(3)Rung Header
If a rung is incomplete, a red line will be displayed on the right side of the rung header.
(4)Bus Bar
18-2-3 Help
The CX-Programmer Help describes all the operations of CX-Programmer. It provides an introduction
to the various windows and panes and describes basic operations, ladder program creation, and moni-
toring. It also describes each of the instructions, including operand notation and contents.
18
18-3-1 Inputting a Ladder Program
Additional Information
If “USB” is not displayed for the network type, refer to CX-Programmer Ver.9.
Operation Man-
ual (Cat. No. W446), and check that the USB driver has been installed correctly.
Additional Information
The symbols indicating these instruction variations will be added to the beginning of the instruc-
tion whenever they are input regardless of whether the cursor is before (example: |LD), in the
middle (example:L|D), or at the end (example: LD|) of the instruction.
• After an instruction has been entered, the variation can be changed as follows.
• @: Upward differentiation
• %: Downward differentiation
• !: Immediate refreshing
• Shift + 0: No differentiation
z Input Example
Inputting Instructions
A mnemonic can be entered directly as a character string.
When you enter the first letter, a list of candidate mnemonics will be displayed. Use the Up Cursor and
Down Cursor Keys to move up and down through this list, and then press the Enter Key to make a
selection. Then, input the operands.
1 Select the above rung and then select Address Increment Copy from the Edit Menu.
The following dialog box will be displayed.
2 In the Offset Area set the Bit Field to 16 and the CH Field to 10 for this example.
Click the Paste Button.
As shown below, the addresses are automatically incremented and the rung is pasted as the
next rung.
Addresses are
automatically incremented
when the rung is pasted.
· Bits:
Example: Incrementing by +16 Bits (One Word)
Example: CIO 0.00 is incremented to CIO 1.00.
· Words:
Example: Incrementing by +10 Words
Example: D100 is incremented to D110.
Example: Example:
The symbol name Sensor02 is automatically The symbol name LAMP_Blue_1 is automatically
created from the symbol name Sensor01. created from the symbol name LAMP_Blue.
Automatically
incremented.
Example:
The symbol name ALARM_1 is automatically
Any number at the end of When there are no numbers in the I/O
an I/O comment is comment, sequential numbers starting
incremented by 1. from 1 will be added after an underbar.
Automatically incremented.
18
18-3-1 Inputting a Ladder Program
18
18-3-2 Saving and Reading Ladder Programs
Note The Comment Dialog Box shown above is displayed only when the Show with comment dialog Option is
selected on the Options - Diagrams Dialog Box. The Options - Diagrams Dialog Box is accessed by select-
ing Options from the Tools Menu.
18
18-3-3 Editing Ladder Programs
CX-Programmer
CP2E
1 Open the project containing the program to be transferred from the CX-Programmer.
Additional Information
Refer to Section 4 Programming Device in the CP2E CPU Unit Hardware User’s Manual (Cat.
No. W613) for the connection method with the CP2E.
18
2 Click the Yes Button.
The operating mode will be changed.
18-4-2 Changing Operating Modes
Additional Information
Change to PROGRAM mode before transferring the PLC Setup and ladder program.
1 Change to PROGRAM mode, select Operating Mode - Program from the PLC Menu, and then
click the Yes Button.
Additional Information
For details on the transfer options, refer to the CX-Programmer Online Help.
Use the following procedure to change the operating mode to RUN mode. To perform trial operation for 18
debugging or adjustments, change the operating mode to MONITOR mode.
18-4-4 Starting Operation
Additional Information
PROGRAM mode cannot be changed to MONITOR or RUN mode when the user program, PLC
Setup settings and DM area data in the CPU Units are being backed up. Change the operating
mode after the backup is completed.
18
18-5-1 Monitoring Status
z Window Frames
You can drag the frames in the window to display different views of the program in the Ladder Sec-
tion Window. The window can be split into up to four sections.
1 While online, select Window - Watch Window from the View Menu.
2 Input an address.
The bit status or word contents will
be displayed. For BOOL data, 0 indi-
cates OFF.
Additional Information
• When entering an address, place a period between the word address and bit number. For
example, to input the address of bit 04 in CIO 0, input “0.04.”
• An address can be input by dragging it from the Ladder Section Window and dropping it into
the Watch Window. By dragging and dropping the header of a rung, all of the addresses on
that rung can be input.
18
Force-setting 18-5-2 Force-set/Reset Bits
Force-setting a bit.
Additional Information
18
18-5-3 Online Editing
Appendices
Starting point
of block
LOAD NOT LD NOT @/%/!/!@/!% Bus bar Indicates a logical start and creates an ON/OFF execution condi-
tion based on the reverse of the ON/OFF status of the specified
operand bit.
Starting point
of block
AND AND @/%/!/!@/!% Symbol Takes a logical AND of the status of the specified operand bit and
the current execution condition.
AND NOT AND NOT @/%/!/!@/!% Symbol Reverses the status of the specified operand bit and takes a logi-
cal AND with the current execution condition.
OR OR @/%/!/!@/!% Bus bar Takes a logical OR of the ON/OFF status of the specified operand
bit and the current execution condition.
OR NOT OR NOT @/%/!/!@/!% Bus bar Reverses the status of the specified bit and takes a logical OR
with the current execution condition.
AND LOAD AND LD --- Takes a logical AND between logic blocks.
Logic block Logic block
LD
to Logic block A
LD
to Logic block B
LD
to Logic block A
Logic block
LD
to Logic block B
LOAD BIT LD TSTN --- LD TSTN(351) is used in the program like LD NOT; the execution
TEST NOT TSTN(351) condition is OFF when the specified bit in the specified word is
S ON, and ON when the bit is OFF.
N
S: Source word
N: Bit number
AND BIT TEST AND TST --- AND TST(350) is used in the program like AND; the execution
AND TST(350)
condition is ON when the specified bit in the specified word is ON,
S
and OFF when the bit is OFF.
N
S: Source word
N: Bit number
AND BIT TEST AND TSTN --- AND TSTN(351) is used in the program like AND NOT; the execu-
AND TSTN(351)
NOT tion condition is OFF when the specified bit in the specified word is
S ON, and ON when the bit is OFF.
N
S: Source word
N: Bit number
OR BIT TEST OR TST --- OR TST(350) is used in the program like OR; the execution condi-
TST(350)
tion is ON when the specified bit in the specified word is ON, and
S OFF when the bit is OFF.
N
S: Source word
N: Bit number
OR BIT TEST OR TSTN --- OR TSTN(351) is used in the program like OR NOT; the execution
TSTN(351)
NOT condition is OFF when the specified bit in the specified word is
S ON, and ON when the bit is OFF.
N
S: Source word
B: Bit
Reset
S execution
condition
R execution
condition
Status of B
Status of B
One cycle
DIFFERENTI- DIFD ! DIFD(014) turns the designated bit ON for one cycle when the
DIFD(014)
ATE DOWN execution condition goes from ON to OFF (falling edge).
B
Execution
B: Bit condition
Status of B
One cycle
SET SET @/%/!/!@/!% SET turns the operand bit ON when the execution condition is ON.
SET
B Execution
condition of SET
B: Bit
Status of B
RESET RSET @/%/!/!@/!% RSET turns the operand bit OFF when the execution condition is ON.
RSET
B Execution
condition of RSET
B: Bit
Status of B
MULTIPLE BIT SETA @ SETA(530) turns ON the specified number of consecutive bits.
SETA(530)
SET
D
N1
N2 bits are set
N2 to 1 (ON).
D: Beginning word
N1: Beginning bit
N2: Number of bits
MULTIPLE BIT RSTA @ RSTA(531) turns OFF the specified number of consecutive bits.
RSTA(531)
RESET
D
N1
N2 N2 bits are
reset to 0
D: Beginning word (OFF).
N1: Beginning bit
N2: Number of bits
SINGLE BIT SETB @/!/!@ SETB(532) turns ON the specified bit in the specified word when
SETB(532)
SET the execution condition is ON.
D
Unlike the SET instruction, SETB(532) can be used to reset a bit
N in a DM word.
D: Word address
N: Bit number
SINGLE BIT RSTB @/!/!@ RSTB(533) turns OFF the specified bit in the specified word when
RESET RSTB(533) the execution condition is ON.
D
Unlike the RSET instruction, RSTB(533) can be used to reset a bit
N in a DM word.
D: Word address
N: Bit number
NO OPERA- NOP --- --- This instruction has no function. (No processing is performed for
TION NOP(000).)
INTERLOCK IL --- Interlocks all outputs between IL(002) and ILC(003) when the exe-
IL(002)
cution condition for IL(002) is OFF. IL(002) and ILC(003) are nor-
mally used in pairs.
Execution Execution
condition ON condition OFF
Execution
condition
Normal Outputs
Interlocked section execution
of the program interlocked.
INTERLOCK ILC --- All outputs between IL(002) and ILC(003) are interlocked when
ILC(003)
CLEAR the execution condition for IL(002) is OFF. IL(002) and ILC(003)
are normally used in pairs.
MULTI-INTER- MILH --- When the execution condition for MILH(517) is OFF, the outputs
MILH (517)
LOCK DIFFER- for all instructions between that MILH(517) instruction and the next
ENTIATION N MILC(519) instruction are interlocked. MILH(517) and MILC(519)
HOLD D are used as a pair.
N: Interlock number MILH(517)/MILC(519) interlocks can be nested (e.g., MILH(517)-
D: Interlock Status Bit MILH(517)-MILC(519)-MILC(519)).
If there is a differentiated instruction (DIFU, DIFD, or instruction
with a @ or % prefix) between MILH(517) and the corresponding
MILC(519), that instruction will be executed after the interlock is
cleared if the differentiation condition of the instruction was estab-
lished.
MULTI-INTER- MILR --- When the execution condition for MILR(518) is OFF, the outputs
MILR (518)
LOCK DIFFER- for all instructions between that MILR(518) instruction and the next
ENTIATION N MILC(519) instruction are interlocked.MILR(518) and MILC(519)
Instructions in
this section
are not
executed and
Instruc- Instructions out-put status
tions jumped is maintained.
ex- The instruction
ecuted execution time
for these
instructions is
eliminated.
Execution condition
Instructions in
this section are
not executed
and out-put
Instruc- status is
tions Instructions
jumped maintained.
ex- The instruction
ecuted execution time
for these
instructions is
eliminated.
N: Interlock number
FOR-NEXT FOR --- The instructions between FOR(512) and NEXT(513) are repeated
FOR(512)
LOOPS a specified number of times. FOR(512) and NEXT(513) are used
N in pairs.
N: Number of loops
Repeated N times
BREAK LOOP BREAK --- Programmed in a FOR-NEXT loop to cancel the execution of the
BREAK(514)
loop for a given execution condition. The remaining instructions in
the loop are processed as NOP(000) instructions.
N repetitions Condition a ON
Repetitions
forced to
end.
Processed as
NOP(000).
FOR-NEXT NEXT --- The instructions between FOR(512) and NEXT(513) are repeated
NEXT(513)
LOOPS a specified number of times. FOR(512) and NEXT(513) are used
in pairs.
SV
Timer PV
0
Completion ON
Flag OFF
Timer PV SV
TIMHX ---
TIMHX(551) 0
(Binary)
N
Completion ON
Flag OFF
S
N: Timer number
S: Set value Timer Input Turned OFF before Completion Flag Turns
ON
ON
Timer input OFF
Completion ON
Flag OFF
OFF
N: Timer number
S: Set value
Timer Input Turned OFF before Completion
Flag Turns ON
Instructions
Timer input ON
OFF
SV
Timer PV 0
Completion ON
Flag OFF
LONG TIMER TIML --- TIML(542)/TIMLX(553) operates a decrementing timer with units
(BCD) TIML(542) of 0.1-s that can time up to approx. 115 days for TIML(BCD) and
D1 49,710 days for TIMLX(Binary).
D2 Timer input ON
OFF
S
SV
D1: Completion Flag Timer PV
D2: PV word
S: SV word
0
TIMLX ---
TIMLX(553) Completion Flag ON
(Binary) (Bit 00 of D1) OFF
D1
D2
S
D1: Completion Flag
D2: PV word
S: SV word
COUNTER CNT --- Count CNT/CNTX(546) operates a decrementing counter. The setting
CNT
(BCD) input range for the set value (SV) is 0 to 9,999 for CNT(BCD) and 0 to
N 65,535 for CNTX(Binary).
S
ON
Reset
input Count input OFF
N: Counter number ON
S: Set value Reset input
OFF
CNTX ---
Count CNTX(546) SV
(Binary) input Counter PV
N
S 0
Reset ON
input Completion
Flag OFF
N: Counter number
S: Set value
Counter PV
CNTRX --- 0
Increment CNTRX(548)
(Binary) input
Decrement N
input SV
Counter PV
Reset S
input
+1
0
N: Counter number
S: Set value
ON
Completion Flag
OFF
SV 1
Counter PV
ON
Completion Flag
OFF
CNRX @
(Binary) CNRX(547)
N1
App
A-1-4 Timer and Counter
Instructions
S1
S2 OR
One-word
S1: Comparison data 1
S2: Comparison data 2
Double length
S1: 1st word of comparison data 1
S2: 1st word of comparison data 2
<
S2
C: Control word
S1: 1st word of present time
S2: 1st word of comparison time
UNSIGNED CMP ! Compares two unsigned binary values (constants and/or the con-
COMPARE CMP(020) tents of specified words) and outputs the result to the Arithmetic
S1 Flags in the Auxiliary Area.
S2 Unsigned binary
comparison
Arithmetic Flags
(>, >=, =, <=, <, <>)
S2 Unsigned binary
comparison
S1: Comparison data 1 S1+1 S2+1
S2: Comparison data 2
Arithmetic Flags
(>, >=, =, <=, <, <>)
SIGNED CPS ! Compares two signed binary values (constants and/or the con-
BINARY COM- CPS(114) tents of specified words) and outputs the result to the Arithmetic
PARE S1 Flags in the Auxiliary Area.
S2 Signed binary
comparison
DOUBLE CPSL --- Compares two double signed binary values (constants and/or the
SIGNED CPSL(115) contents of specified words) and outputs the result to the Arith-
BINARY COM- S1 metic Flags in the Auxiliary Area.
PARE
S2 Signed binary
comparison
S1: Comparison data 1 S1+1 S2+1
S2: Comparison data 2
Arithmetic Flags
(>, >=, =, <=, <, <>)
TABLE COM- TCMP @ Compares the source data to the contents of 16 words and turns
PARE TCMP(085) ON the corresponding bit in the result word when the contents are
S equal.
T Comparison R
1: Data
R are equal.
0: Data
aren't equal.
S: Source data
T: 1st word of table
R: Result word
UNSIGNED BCMP @ Compares the source data to 16 ranges (defined by 16 lower limits
BLOCK COM- BCMP(068) and 16 upper limits) and turns ON the corresponding bit in the
PARE S result word when the source data is within the range.
T Ranges
1: In range
0: Not in range
R
App
Lower limit Upper limit R
S: Source data T to T+1 0
T: 1st word of table
R: Result word T+2 1
Source data to T+3
A-1-5 Comparison Instructions
T+28 to T+29 14
T+30 to T+31 15
B: First word of block
LL
UL
DOUBLE ZCPL --- Compares the 32-bit unsigned binary value in CD and CD+1 (word
AREA RANGE ZCPL(116) contents or constant) to the range defined by LL and UL and out-
COMPARE CD puts the results to the Arithmetic Flags in the Auxiliary Area.
LL
UL
S Source word
D
S: Source
D: Destination
Bit status not
changed.
Destination word
MOVE NOT MVN @ Transfers the complement of a word of data to the specified word.
MVN(022)
S Source word
D
S: Source
D: Destination Bit status
inverted.
Destination word
S
C
D
S: Source word or data
C: Control word
D: Destination word
C: Control Word
15 8 7 0
C m n
Source bit: 00 to 0F
(0 to 15 decimal)
Destination bit: 00 to 0F
(0 to 15 decimal)
MOVE DIGIT MOVD @ Transfers the specified digit or digits. (Each digit is made up of 4
MOVD(083) bits.)
S 15 12 11 8 7 4 3 0
C C 0 l n m
n
D
m
S: Source word or data S
C: Control word
D: Destination word
l
D
C: Control Word
15 12 11 8 7 4 3 0
C 0 n m
C
S
D
C: Control word
S: 1st source word
D: 1st destination word App
C: Control Word
15 8 7 4 3 0
C n m
A-1-6 Data Movement Instructions
First bit in S ( ): 0 to F
(0 to 15)
First bit in D (m): 0 to F
(0 to 15)
Number of bits (n): 00 to FF
(0 to 255)
N: Number of words
S: 1st source word N: Number of Words
D: 1st destination word The possible range for N is 0000 to FFFF (0 to 65,535 decimal).
15 0
S
to
S+(N-1)
15 0
D
to
D+(N-1)
BLOCK SET BSET @ Copies the same word to a range of consecutive words.
BSET(071)
Source word Destination words
S
St
St
E
S: Source word
St: Starting word
E: End word
E
E2
SINGLE DIST @ Transfers the source word to a destination word calculated by add-
WORD DIS- DIST(080) ing an offset value to the base address.
TRIBUTE S
S Bs Of
Bs
Of
S: Source word
Bs: Destination base address
Of: Offset
Bs+n
DATA COL- COLL @ Transfers the source word (calculated by adding an offset value to
LECT COLL(081) the base address) to the destination word.
Bs
Bs Of
Of
D
MOVE TO MOVR @ Sets the PLC memory address of the specified word, bit, or
REGISTER MOVR(560) timer/counter Completion Flag in the specified Index Register.
S
Internal I/O memory address of S
D
S: Source (desired word or bit)
D: Destination (Index Register)
Index Register
Index Register
REVERSIBLE SFTR @ Creates a shift register that shifts data to either the right or the left.
SHIFT REGIS- SFTR(084)
TER C
St E St Data input
E Shift
direc-
E St tion
Data
C: Control word input
St: Starting word
E: End word C: Control Word
15 14 13 12
Shift direction
1 (ON): Left
0 (OFF): Right
Data input
Shift input
Reset
S: Source word
St: Starting word
E: End word
CY
1 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0
DOUBLE ASLL @ Shifts the contents of Wd and Wd +1 one bit to the left.
SHIFT LEFT ASLL(570)
Wd Wd Wd
Wd: Word
DOUBLE ASRL @ Shifts the contents of Wd and Wd +1 one bit to the right.
SHIFT RIGHT ASRL(571)
Wd Wd Wd
Wd: Word
ROTATE LEFT ROL @ Shifts all Wd bits one bit to the left including the Carry Flag (CY).
ROL(027)
Wd
Wd: Word
DOUBLE ROLL @ Shifts all Wd and Wd +1 bits one bit to the left including the Carry
ROTATE LEFT ROLL(572) Flag (CY).
Wd Wd+1 Wd
Wd: Word
ROTATE ROR @ Shifts all Wd bits one bit to the right including the Carry Flag (CY).
RIGHT ROR(028)
Wd
Wd
Wd: Word
DOUBLE RORL @ Shifts all Wd and Wd +1 bits one bit to the right including the Carry
ROTATE RORL(573) Flag (CY).
RIGHT Wd Wd+1 Wd
Wd: Word
ONE DIGIT SLD @ Shifts data by one digit (4 bits) to the left.
SHIFT LEFT SLD(074)
E S t
St
Lost
E
ONE DIGIT SRD @ Shifts data by one digit (4 bits) to the right.
SHIFT RIGHT SRD(075)
E S t
St
Lost
E
St: Starting word
E: End word
DOUBLE NSLL @
SHIFT N-BITS NSLL(582)
Contents of
LEFT D "a" or "0"
Lost shifted in
C
N bits
D: Shift word
C: Control word C: Control word
• NASL
15 12 11 8 7 0
C
0
Always 0.
Data shifted into register
0 Hex: 0 shifted in
8 Hex: Contents of rightmost bit shifted in
• NSLL
15 12 11 8 7 0
C
0
Always 0.
Data shifted into register
0 Hex: 0 shifted in
App
A-1-7 Data Shift Instructions
Always 0.
Data shifted into register
0 Hex: 0 shifted in
8 Hex: Contents of rightmost bit shifted in
• NSRL
15 12 11 8 7 0
C
0
Always 0.
Data shifted into register
0 Hex: 0 shifted in
8 Hex: Contents of rightmost bit shifted in
DOUBLE ++L @ Increments the 8-digit hexadecimal content of the specified words
INCREMENT ++L(591) by 1.
BINARY Wd
Wd+1 Wd Wd+1 Wd
Wd: Word
INCREMENT ++B @ Increments the 4-digit BCD content of the specified word by 1.
BCD ++B(594)
Wd Wd Wd
Wd: Word
Wd: Word
DOUBLE DEC- − −BL @ Decrements the 8-digit BCD content of the specified words by 1.
REMENT BCD − − BL(597)
Wd Wd+1 Wd Wd+1 Wd
BINARY ADD Au
WITH CARRY Au+1 Au (Signed binary)
Ad
Ad+1 Ad (Signed binary)
R
+ CY
Au: 1st augend word
CY will
Ad: 1st addend word
turn ON
R: 1st result word when there CY R+1 R (Signed binary)
is a carry.
Ad Ad (BCD)
+
R
CY will turn
Au: Augend word ON when CY R (BCD)
Ad: Addend word there is a
carry.
R: Result word
DOUBLE BCD +BL @ Adds 8-digit (double-word) BCD data and/or constants.
ADD WITH- +BL(405)
OUT CARRY Au Au+1 Au (BCD)
Ad Ad+1 Ad (BCD)
+
R
CY will turn
Au: 1st augend word ON when CY R+1 R (BCD)
Ad: 1st addend word there is a
carry.
R: 1st result word
BCD ADD +BC @ Adds 4-digit (single-word) BCD data and/or constants with the
WITH CARRY +BC(406) Carry Flag (CY).
Au
Au (BCD)
Ad
R Ad (BCD)
DOUBLE BCD +BCL @ Adds 8-digit (double-word) BCD data and/or constants with the
ADD WITH +BCL(407) Carry Flag (CY).
CARRY Au
Au+1 Au (BCD)
Ad
R Ad+1 Ad (BCD)
− CY
Mi: Minuend word
Su: Subtrahend word
R: Result word CY will turn
ON when CY R (Signed binary)
there is a
borrow.
Su − Su (BCD)
R
CY will turn ON
Mi: Minuend word when there is a CY R (BCD)
Su: Subtrahend word carry.
R: Result word
BCD SUB- − BC @ Subtracts 4-digit (single-word) BCD data and/or constants with the
TRACT WITH −BC(416) Carry Flag (CY).
CARRY Mi
Mi (BCD)
Su
R Su (BCD)
DOUBLE BCD − BCL @ Subtracts 8-digit (double-word) BCD data and/or constants with
SUBTRACT −BCL(417) the Carry Flag (CY).
WITH CARRY
A-1-9 Symbol Math Instructions
Mi
Mi +1 Mi (BCD)
Su
R Su+1 Su (BCD)
Mr × (Signed binary)
Mr
R
Md: Multiplicand word R +1 R (Signed binary)
Mr: Multiplier word
R: Result word
Mr × Mr (Unsigned binary)
R
R+1 R (Unsigned binary)
Md: Multiplicand word
Mr: Multiplier word
R: Result word
DOUBLE BCD *BL @ Multiplies 8-digit (double-word) BCD data and/or constants.
MULTIPLY *BL(425)
Md Md + 1 Md (BCD)
Mr
× Mr + 1 Mr (BCD)
R
Remainder Quotient
R ÷ Dr (Unsigned binary)
Dd: Dividend word
Dr: Divisor word R+1 R (Unsigned binary)
R: Result word
Remainder Quotient
DOUBLE /UL @ Function:Divides 8-digit (double-word) unsigned hexadecimal data
UNSIGNED /UL(433) and/or constants.
BINARY Dd
DIVIDE Dd + 1 Dd (Unsigned binary)
Dr
R ÷ Dr + 1 Dr (Unsigned binary)
Dr
÷ Dr + 1 Dr (BCD)
R
DOUBLE BINL @ Converts 8-digit BCD data to 8-digit hexadecimal (32-bit binary)
BCD-TO-DOU- BINL(058) data.
BLE BINARY S
(BCD) R (BIN)
R
(BCD) R+1 (BIN)
S: 1st source word
R: 1st result word
R
S: Source word
R: Result word
DOUBLE BCDL @ Converts 8-digit hexadecimal (32-bit binary) data to 8-digit BCD
BINARY-TO- BCDL(059) data.
DOUBLE BCD S
(BIN) R (BCD)
R
(BIN) R+1 (BCD)
S: 1st source word
R: 1st result word
2'S COMPLE- NEG @ Calculates the 2's complement of a word of hexadecimal data.
MENT NEG(160)
2's complement
S (Complement + 1)
R (S) (R)
S: Source word
R: Result word
R
R+1
R+1
R+14
R+15
R+16
R+17
Two 16-word ranges
are used when l
specifies 2 bytes.
R+30
R+31
C: Control Word
• 4-to-16 bit decoder
15 12 11 8 7 4 3 0
C 0 l n
15 12 11 8 7 4 3 0
C 1 l n
App
Specifies the first digit/byte
to be converted
0 or 1 (byte 0 or 1)
0 or 1 (1 or 2 bytes)
Always 0.
Conversion process
1: 8-to-256 bits (byte to 16-word range)
Leftmost bit
C: Control Word
• 16-to-4 bit conversion
15 12 11 8 7 4 3 0
C 0 l n
Conversion process
0: 16-to-4 bits (word to digit)
15 12 11 8 7 4 3 0
C 1 l n
S: Source word
Di: Digit designator
D: 1st destination word
Number of
digits (n+1)
Digit number: 3 2 1 0
ASCII TO HEX HEX @ Converts up to 4 bytes of ASCII data in the source word to their
HEX(162) hexadecimal equivalents and writes these digits in the specified
S destination word.
Di C: 0021
D Di
First byte to convert
S: 1st source word
Di: Digit designator Left (1) Right (0)
Digit number: 3 2 1 0
App
1: 2 digits
2: 3 digits
3: 4 digits
Parity 0: None
1: Even
2: Odd
DOUBLE ANDL @ Takes the logical AND of corresponding bits in double words of
ANDL(610) word data and/or constants.
LOGICAL AND
I1
(I1, I1+1). (I2, I2+1) → (R, R+1)
I2
I1, I1+1 I2, I2+1 R, R+1
R
1 1 1
I1: Input 1
I2: Input 2 1 0 0
R: Result word
0 1 0
0 0 0
LOGICAL OR ORW @ Takes the logical OR of corresponding bits in single words of word
ORW(035) data and/or constants.
I1
I1 + I2 →R
I2
I1 I2 R
R
1 1 1
I1: Input 1
I2: Input 2 1 0 1
R: Result word
0 1 1
0 0 0
Wd Wd → Wd: 1 → 0 and 0 → 1
Wd: Word
DOUBLE COML @ Turns OFF all ON bits and turns ON all OFF bits in Wd and Wd+1.
COMPLE- COML(614)
MENT Wd (Wd+1, Wd) → (Wd+1, Wd)
Wd: Word
R
C: Control word
S: Source data
R: Result word
BIT COUNTER BCNT @ Counts the total number of ON bits in the specified word(s).
BCNT(067)
N N words
S Counts the number of
to ON bits.
R
S+(N − 1) Binary
result
N: Number of words
S: 1st source word
R: Result word R
N: Number of words
The number of words must be 0001 to FFFF (1 to 65,535 words).
FLOATING TO FIXL @ Converts a 32-bit floating-point value to 32-bit signed binary data
32-BIT FIXL(451) and places the result in the specified result words.
A-1-12 Special Math Instructions
S Floating-point data
S+1 S (32 bits)
R
S: 1st source word
R: 1st result word Signed binary data
R+1 R (32 bits)
16-BIT TO FLT @ Converts a 16-bit signed binary value to 32-bit floating-point data
FLOATING FLT(452) and places the result in the specified result words.
S Signed binary data
S (16 bits)
R
S: Source word
R: 1st result word Floating-point data
R+1 R (32 bits)
FLOATING- +F @ Adds two 32-bit floating-point numbers and places the result in the
POINT ADD +F(454) specified result words.
Au Augend (floating-point
Au+1 Au data, 32 bits)
Ad
R Addend (floating-point
R Subtrahend
− Su+1 Su (floating-point
data, 32 bits)
Mi: 1st Minuend word
Su: 1st Subtrahend word
R: 1st result word Result (floating-point
R+1 R data, 32 bits)
FLOATING- *F @ Multiplies two 32-bit floating-point numbers and places the result
POINT *F(456) in the specified result words.
MULTIPLY Md Multiplicand
Md+1 Md (floating-point
Mr data, 32 bits)
R
× Mr+1 Mr
Multiplier
(floating-point data,
32 bits)
Md: 1st Multiplicand word
Mr: 1st Multiplier word
R: 1st result word Result (floating-point
R+1 R data, 32 bits)
R Divisor
÷ Dr+1 Dr (floating-point data,
32 bits)
Dd: 1st Dividend word
Dr: 1st Divisor word
R: 1st result word Result
R+1 R (floating-point data,
32 bits)
Symbol, option S2
<F
S1
ON execution condition when
S2
comparison result is true.
App
A-1-13 Floating-point Math
Instructions
FRAME FCS @ Calculates the FCS value for the specified range and outputs the
CHECKSUM FCS(180) result in ASCII.
C
R1 R1
D W (Table length)
0
Starting byte (Valid only when bit 13 is 1.)
0: Leftmost byte
1: Rightmost byte
Calculation units
0: Words
1: Bytes
0
15 8 7 4 3 2 1 0
C+5 0
Forward/reverse
designation
PID constant update
timing designation
Manipulated variable
output setting
2-PID parameter(α)
15 14 13 12 11 8 7 4 3 0
C+6 0 0 0
Output range
Input range
15 0
C+7 Manipulated variable output lower limit
C+8 Manipulated variable output upper limit
15 14 13 12 0
C+9 0 0 0
AT Command Bit
15 0
C+10 Limit-cycle Hysteresis
C+11
Work area
(30 words: Cannot be used by user.)
C+40 App
A-1-15 Data Control Instructions
15 12 11 8 7 4 3 0
C
Manipulated variable
range
Input type
15 0
C+1 Control period
C+4
Work area
C+5 (3 words, cannot be used by user)
C+6
15 0
P1
Offset of 0000
P1 Offset (Signed binary) R (signed BCD)
P1 + 1 ΔY (Signed binary)
P1 + 2 ΔX (Signed BCD)
ΔY
Offset = 0000 hex
ΔX
S (signed
binary)
15 0
P1
App
A-1-15 Data Control Instructions
ΔX ΔX
Offset Offset S (signed BCD)
Min.
conver- S (signed BCD)
sion Min. conversion
Offset of 0000
R (signed binary)
Max.
conver-
sion
ΔY
ΔX
S (signed BCD)
Min. conversion
15 0
P1
ΔX
0001 to 9999 (BCD)
15 0
P1+2
ΔY
8000 to 7FFF (signed binary)
15 0
P1+3
Maximum conversion
8000 to 7FFF (signed binary)
15 0
P1+4
Minimum conversion
8000 to 7FFF (signed binary)
R+1 Pointer
Average Valid Flag
Average
R+2
R+3
N values
R+N+1
Main program
Program end
SUBROUTINE SBN --- Indicates the beginning of the subroutine program with the speci-
ENTRY SBN(092) fied subroutine number.
App
N
N: Subroutine number
or
A-1-16 Subroutine Instructions
Subroutine region
Time interval
Scheduled
interrupt Set scheduled interrupt
time interval.
CLEAR CLI @ Clears or retains recorded interrupt inputs for I/O interrupts or sets
INTERRUPT
CLI(691) the time to the first scheduled interrupt for scheduled interrupts.
N N = 102 to 109 (108 and 109 can only be used in CP2E-N20/30/40/
C 60D-.)
Internal Internal
status status
Recorded interrupt cleared Recorded interrupt retained
N=4
MSKS(690)
Execution of scheduled
interrupt task.
Time to first
scheduled interrupt
DISABLE DI @ Disables execution of all interrupt tasks.
INTERRUPTS DI(693)
ENABLE EI --- Enables execution of all interrupt tasks that were disabled with
INTERRUPTS EI(694) DI(693).
DI
EI
Execution condition
@INI
#0000 C1: Port specifier (example for pulse output 0)
#0002 C2: Control data (example for changing PV)
D100 S:First word with new PV
15 0
D100 #0 0 0 0
D101 #0 0 0 0
P: Port Specifier
tain the new PV. Any values in NV and NV+1 are ignored when
C is not 0002 hex.
Output Instructions
15 0
NV Lower word of new PV
NV+1 Upper word of new PV
15 0
D Lower word of PV
D+1 Upper word of PV
2-word PV
Pulse output PV, high-speed counter input PV,
high-speed counter input frequency for high-speed counter input 0
15 0
D PV
1-word PV
Status, range comparison results
P: Port specifier
C: Control data
TB: First comparison table word
Time
Interrupt task
Cyclic tasks
(ladder programs) Interrupt occurs Ladder diagram
END
END
I/O refresh
P: Port specifier
C: Control data
Note Always set the upper limit greater than or equal to the lower
limit for any one range.
SPEED OUT- SPED @ Sets the output pulse frequency for a specific port and starts pulse
SPED(855)
PUT output without acceleration or deceleration.
P
Pulse frequency
M
F
P: Port specifier
M: Output mode
F: First pulse frequency word
Target frequency
Time
SPED(885) executed.
P: Port specifier
15 12 11 87 4 3 0
M
Mode
0 hex: Continuous
1 hex: Independent
Direction
0 hex: CW
1 hex: CCW
Pulse output method
1 hex: Pulse + direction
Always 0 hex.
15 0
F Lower word of target frequency 0 to 100000 Hz
(0000 0000 to 0001 86A0 hex)
F+1 Upper word of target frequency
N: Number of pulses
15 0
N Lower word with number of pulses
N+1 Upper word with number of pulses
Relative/absolute specifier
0 hex: Relative pulses
1 hex: Absolute pulses
Direction
0 hex: CW
1 hex: CCW
Pulse output method
1 hex: Pulse + direction
Always 0 hex.
P: Port Specifier
15 12 11 87 4 3 0
M
Mode
0 hex: Continuous mode
1 hex: Independent mode
Direction
0 hex: CW
1 hex: CCW
Pulse output method
1 hex: Pulse + direction
Always 0 hex.
15 0
S Acceleration/deceleration rate 1 to 65535 Hz (#0001 to FFFF)
Specify the increase or decrease in the
frequency per pulse control period (4 ms).
App
A-1-18 High-speed Counter/Pulse
Output Instructions
C Origin Input
Signal
1
0
Pulse frequency
Origin search high speed Origin search deceleration rate
P: Port specifier
C: Control data Origin search
acceleration rate
Deceleration point Origin search low speed
Origin search
initial speed
Time
Start Decelerate from high to low speed Stop
P: Port Specifier
15 12 11 87 4 3 0
C
Always 0 hex.
Always 0 hex.
Mode
0 hex: Origin search
1 hex: Origin return
P: Port specifier
F: Frequency
D: Duty factor
Built-in output
PWM output
Duty factor:15%
50%
Duty factor:50%
P: Port Specifier
F: Frequency
F specifies the frequency of the PWM output between 2.0 and
6,553.5 Hz (0.1 Hz units, 0014 to FFFF hex), or between 2 and
32,000 Hz (2 Hz units, 0002 to 7D00 hex).
D: Duty Factor
0.0% to 100.0% (0.1% units, 0000 to 03E8 hex)
D specifies the duty factor of the PWM output, i.e., the percent-
age of time that the output is ON.
Deceleration rate
Acceleration rate
Speed control Position control
Time
Execution of IFEED(892)
P: Port Specifier
15 12 11 8 7 4 3 0
C 0 hex 0 hex
Direction
0 hex: CW
1 hex: CCW
Relative/absolute specifier
pulses1 hex: Absolute pulses
Always 0 hex.
Pulse output method (See note 1.)
1 hex: Pulse + direction
Specify axis(See note 2,3,4,5.)
0 hex: 2-axes interpolation
1 hex: 3-axes interpolation
2 hex: 4-axes interpolation
Note 1 Use the same pulse output method when using pulse out-
puts 1.
2 2-axes interpolation use 0/1 axes in linear interpolation 0
and 2/3 axes in linear interpolation 1 during pulse output.
3 3-axes interpolation can only be executed in linear inter-
polation 0 and use 0/1/2 axes during pulse output.
4 4-axes interpolation can only be executed in linear inter-
polation 0 only and use 0/1/2/3 axes during pulse output.
5 CP2E N14/20 CPU Units cannot use 3-axes interpolation
or 4-axes interpolation.
S1: First word of settings table
15 0
S1 Acceleration rate 1 to 65535Hz
S1+1 Deceleration rate (0001 to FFFF Hex)
Specify the increase or decrease in the frequency per pulse control
period (4 ms) in Hz.
S1+2 Lower word with target frequency 1 to 100000Hz
S1+3 Upper word with target frequency (00000001 to 000186A0 Hex)
Specify the frequency after acceleration in Hz.
B: Bit
STEP(008)
STEP START SNXT --- SNXT(009) is used in the following three ways:
SNXT(009)
(1)To start step programming execution.
B (2)To proceed to the next step control bit.
B: Bit (3)To end step programming execution.
7-SEGMENT SDEC @ Converts the hexadecimal contents of the designated digit(s) into
DECODER SDEC(078) 8-bit, 7-segment display code and places it into the upper or lower
S 8-bits of the specified destination words.
Di
Di
D Number of digits
First digit to convert
S: Source word
Di: Digit designator
D: 1st destination word
7-segment
15 12 11 87 43 0
Di 0 1/0 m n
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
O
CS0
CS1
One Round Flag CS signals
CS2
RD0 Read signal CS3
15 0
C2
System word
(Cannot be accessed by the user.)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
O
0
1
2
3
4 Bits 00 to 07
5 correspond
6 to Output Unit
7 outputs 0 to 7.
C: System Word
Specifies a work word used by the instruction. This word can-
not be used in any other application.
15 0
C
System word
(Cannot be accessed by the user.)
• Converting 8 digits
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
O
One Round
Flag LE3 D0
LE2 D1
Latch Leftmost
LE1 D2
outputs 4-digit data
LE0 D3
output
D0
D1
D2 Rightmost 4-digit
D3 data output
C: Control Data
The value of C indicates the number of digits of source data
and the logic for the Input and Output Units, as shown in the fol-
lowing table. (The logic refers to the transistor output’s NPN or
PNP logic.)
Display’s data
Source data Display’s latch input logic C
input logic
4 digits (S) Same as Out- Same as Output Unit 0000
put Unit
Different from Output Unit 0001
D: System Word
Specifies a work word used by the instruction. This word can-
App
not be used in any other application.
15 0
D
A-1-20 Basic I/O Unit Instructions
System word
(Cannot be accessed by the user.)
RECEIVE RXD @ Reads the specified number of bytes of data starting with the
RXD(235) specified first word from the RS-232C port or RS-485 port built
into the CPU Unit or the serial Option Board according to the start
D
code and end code specified for no-protocol mode in the PLC
C Setup.
N C: Control Word
D Number
C of words
to trans-
S: First source word (local node) mission
D: First destination word (remote node)
C: First control word
NETWORD RECV @ Requests data to be transmitted from a node in the Ethernet net-
RECV(098)
RECEIVE work and receives the data.
S
Local node Source node (remote node)
D
C Number of
words to
S: First source word (remote node) receive
D: First destination word (local node)
C: First control word
D
C Command
Command
data Interpret
S: First command word (n bytes)
D: First response word
C: First control word
Response
Response Execute
data
(m bytes)
15 8 7 0
R Minutes Seconds
R+1 Day Hour
R+2 Year Month
CALENDAR CSUB @ Subtracts time from the calendar data in the specified words.
SUBTRACT CSUB(731)
15 8 7 0
C C Seconds
Minutes
T C+1 Day Hour
R C+2 Year Month
−
C: 1st calendar word
T: 1st time word 15 8 7 0
R: 1st result word T Minutes Seconds
T+1 Hours
15 8 7 0
R Minutes Seconds
R+1 Day Hour
R+2 Year Month
CLOCK DATE @ Changes the internal clock setting to the setting in the specified
DATE(735) source words.
ADJUSTMENT
S
CPU Unit
S: 1st source word
Internal clock
Minutes Seconds
New
setting Day Hour
Year Month
00 Day of week
EXTEND WDT @ Extends the maximum cycle time, but only for the cycle in which
WDT(094) this instruction is executed.
MAXIMUM
CYCLE TIME T
App
A-1-24 Failure Diagnosis
Instructions
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A45 14 Ethernet Link Status Ethernet port of N14/20 CPU unit and ON: Ethernet link is --- Cleared Refreshed
Flag (N14/20 Ethernet port A of N30/40/60 CPU unit will be established when the
port, N30/40/60 ON when the Ethernet link is OFF: Ethernet link is Ethernet link
Ethernet PORT1A) established. terminated status is
changed.
15 Ethernet Link Status Port B of N30/40/60 CPU unit will be
Flag (N30/40/60 ON when the Ethernet link is
Ethernet PORT1B) established.
A46 02 IP Address Setting ON when the IP address meets the ON: Error --- Cleared Refreshed
Erro Flag following conditions: OFF: Normal when error
• All bits of the host ID are 0 or 1 occurs
02 FINS/TCP Connection
App
Establish Flag (No.3)
A-2-1 Read-only Words
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A50 04 Serial Port 1 (EX) ON when a communication error has ON: Error Retained Cleared Refreshed
Communication Error occurred at the Serial Port 1 (EX). OFF: Normal when error
Flag occurs
05 Serial Port 1 (EX) ON when the Serial Port 1 (EX) is able ON: Able-to-send Retained Cleared Written after
Send Ready Flag to send data in no-protocol mode. OFF: Unable-to-send transmission.
(No-protocol Mode)
06 Serial Port 1 (EX) ON when the Serial Port 1 (EX) has ON: Reception Retained Cleared Written after
Reception Completed completed the reception in no-protocol completed transmission.
Flag (No-protocol mode. OFF: Reception not
Mode) • When the number of bytes was completed
specified: ON when the specified
number of bytes is received.
• When the end code was specified:
ON when the end code is received or
256 bytes are received.
07 Serial Port 1 (EX) • ON when a data overflow occurred ON: Overflow Retained Cleared Written after
Reception Overflow during reception through the Serial OFF: No overflow transmission.
Flag (No-protocol Port 1 (EX) in no-protocol mode.
Mode) • When the number of bytes was
specified: ON when more data is
received after the reception was
completed but before RXD was exe-
cuted.
• When the end code was specified:
ON when more data is received after
the end code was received but
before RXD was executed.
• ON when 257 bytes are received
before the end code.
A51 00 to Serial Port 1(EX) The corresponding bit will be ON when ON: Communicating Retained Cleared Refreshed
07 Polled Unit the Serial Port 1(EX) is communicating OFF: Not when there is a
Communications Flags with Serial PLC Link mode. communicating normal
Bits 0 to 7 correspond to Units 0 to 7. response to
the token.
00 to Serial Port 1(EX) Indicates (in binary) the number of Retained Cleared Refreshed
15 Reception Counter bytes of data received when the serial when data is
(No-protocol mode port 1(EX) is in no-protocol mode. received.
only)
A52 --- Pulse Lower four Contain the number of pulses output Cleared Cleared • Refreshed
Output 2 digits from the corresponding pulse output each cycle
PV port. during the
A53 Upper four
PV range: 8000 0000 to 7FFF FFFF overseeing
digits
hex (-2,147,483,648 to 2,147,483,647) processes.
A54 --- Pulse Lower four When pulses are being output in the
• Refreshed
Output 3 digits CW direction, the PV is incremented by when the INI
PV
A55 Upper four 1 for each pulse. instruction is
digits When pulses are being output in the executed
CCW direction, the PV is decremented (PV
by 1 for each pulse. change).
PV after overflow: 7FFF FFFF hex
PV after underflow: 8000 0000 hex
Note If the coordinate system is rela-
tive coordinates (undefined ori-
gin), the PV will be cleared to 0
when a pulse output starts, i.e.
when a pulse output instruction
(SPED, ACC, PLS2, ITPL or
IFEED) is executed.
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A56 00 Pulse Output 2 This flag will be ON when pulses are ON: Accelerating or --- Cleared Refreshed
Accel/Decel Flag being output from pulse output 2 decelerating each cycle
according to an ORG, ACC, PLS2, OFF: Constant speed during the
ITPL or IFEED instruction and the overseeing
output frequency is being changed in processes.
steps (accelerating or decelerating).
01 Pulse Output 2 This flag indicates when an overflow or ON: Overflow or --- Cleared • Refreshed
Overflow/Underflow underflow has occurred in the pulse underflow when the PV
Flag output 2 PV. OFF: Normal is changed
by the INI
instruction.
• Refreshed
when an
overflow or
underflow
occurs.
02 Pulse Output 2 Output ON when the number of output pulses ON: Setting made --- Cleared • Refreshed
Amount Set Flag for pulse output 2 has been set with the OFF: No setting when the
PULS instruction. PULS
instruction is
executed.
• Refreshed
when pulse
output stops.
03 Pulse Output 2 Output ON when the number of output pulses ON: Output --- Cleared Refreshed at
Completed Flag set with the PULS, PLS2, ITPL or completed the start or
IFEED instruction has been output OFF: Output not completion of
through pulse output 2. completed pulse output.
04 Pulse Output 2 Output ON when pulses are being output from ON: Outputting --- Cleared Refreshed
In-progress Flag pulse output 2. pulses when pulse
08 Pulse Output 2 ON between Input Interrupt - ON: Feeding Cleared Cleared • Refreshed
Interrupt Feeding Flag decelerating to stop when Interrupt OFF: Not feeding when feed-
Feeding function (IFEED instruction) is ing is com-
executing. pleted.
• Refreshed
when inter-
rupt feeding
is executing.
09 Pulse Output 2 ON if an overflow or underflow error ON: Overflow or Cleared Cleared Refreshed
Interrupt Feeding Error occurs during input interrupt or underflow when interrupt
Flag specified number of pulse output, when OFF: Normal feeding is
Interrupt Feeding function (IFEED executing.
instruction) is executing.
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A57 00 Pulse Output 3 This flag will be ON when pulses are ON: Accelerating or --- Cleared Refreshed
Accel/Decel Flag being output from pulse output 3 decelerating each cycle
according to an ORG, ACC, PLS2, OFF: Constant speed during the
ITPL or IFEED instruction and the overseeing
output frequency is being changed in processes.
steps (accelerating or decelerating).
01 Pulse Output 3 This flag indicates when an overflow or ON: Overflow or --- Cleared • Refreshed
Overflow/Underflow underflow has occurred in the pulse underflow when the PV
Flag output 3 PV. OFF: Normal is changed
by the INI
instruction.
• Refreshed
when an
overflow or
underflow
occurs.
02 Pulse Output 3 Output ON when the number of output pulses ON: Setting made --- Cleared • Refreshed
Amount Set Flag for pulse output 3 has been set with the OFF: No setting when the
PULS instruction. PULS
instruction is
executed.
• Refreshed
when pulse
output stops.
03 Pulse Output 3 Output ON when the number of output pulses ON: Output --- Cleared Refreshed at
Completed Flag set with the PULS, PLS2, ITPL or completed the start or
IFEED instruction has been output OFF: Output not completion of
through pulse output3. completed pulse output.
04 Pulse Output 3 Output ON when pulses are being output from ON: Outputting --- Cleared Refreshed
In-progress Flag pulse output 3. pulses when pulse
OFF: Stopped output starts or
stops.
05 Pulse Output 3 ON when the origin has not been ON: Origin not ON ON Refreshed
No-origin Flag determined for pulse output 3 and goes established each cycle
OFF when the origin has been OFF: Origin during the
determined. established overseeing
processes.
06 Pulse Output 3 ON when the pulse output 3 PV ON: Stopped at origin --- Cleared Refreshed
At-origin Flag matches the origin (0). OFF: Not stopped at each cycle
origin during the
overseeing
processes.
07 Pulse Output 3 Output ON when an error occurred while out ON: Stop error --- Cleared • Refreshed A439
Stopped Error Flag putting pulses in the pulse output 3 occurred when origin
origin search function. OFF: No error search
The Pulse Output 3 Output Stop Error starts.
code will be written to A439. • Refreshed
when a
pulse output
stop error
occurs.
08 Pulse Output 3 ON between Input Interrupt - ON: Feeding Cleared Cleared • Refreshed
Interrupt Feeding Flag decelerating to stop when Interrupt OFF: Not feeding when feed-
Feeding function (IFEED instrnction) is ing is com-
executing. pleted.
• Refreshed
when inter-
rupt feeding
is executing.
09 Pulse Output 3 ON if an overflow or unlerflow error ON: Overflow or Cleared Cleared Refreshed
Interrupt Feeding Error occurrs during input interrupt or underflow when interrupt
Flag specified number of pulse output, when OFF: Normal feeding is
Interrupt Feeding function (IFEED executing.
instrnction) is executing.
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A99 00 UM Read Protection Indicates whether all of the ladder ON: UM read- Retained Retained When
Status programs in the PLC are protected. protection is
read-protected. OFF: UM not set or cleared
read-protected
A100 --- Error Log Area When an error has occurred, the error Error code Retained Retained Refreshed A500.14
to A199 code, error contents, and error's time Error contents: when error A300
and date are stored in the Error Log Address of Aux. Area occurs. A400
Area. Information on the 20 most word with details or
recent errors can be stored. 0000 hex if there is
Each error record occupies 5 words; no related word.
the function of these 5 words is as Seconds: 00 to 59,
follows: BCD
First word: Error code (bits 0 to 15)
First word + 1: Error contents (bits 0 to Minutes: 00 to 59,
15) BCD
First word + 2: Minutes (upper byte), Hours: 00 to 23, BCD
Seconds (lower byte) Day of month: 01 to
First word + 3: Day of month (upper 31, BCD
byte), Hours (lower byte)
First word + 4: Year (upper byte), Month: 01 to 12, BCD
Month (lower byte) Year: 00 to 99, BCD
Note 1 Errors generated by FAL(006)
and FALS(007) will also be
stored in this Error Log.
2 The Error Log Area can be
reset from the CX-Program-
mer.
3 If the Error Log Area is full (20
records) and another error
occurs, the oldest record in
A100 to A104 will be cleared,
tus.
15 First Task Startup Flag ON when a task is executed for the first ON: First execution Cleared Cleared ---
time. This flag can be used to check OFF: Not executable
whether the current task is being or not being
executed for the first time so that executed for the
initialization processing can be first time.
performed if necessary.
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A202 00 to Communications Port ON when a communication instruction ON: Network --- Cleared • Refreshed
07 Enabled Flags (SEND, RECV, or CMND) can be communication when com-
executed with the corresponding port is not being munications
number. executed finished.
Each bit corresponds to a OFF: Network • Refreshed
communication port number. communication when
Bits 00 to 07 correspond to is being instruction is
communications ports 0 to 7. executed executed.
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A270 --- High-speed Counter 0 Contains the PV of high-speed counter Cleared Cleared • Refreshed
to A271 PV 0. A271 contains the upper 4 digits and each cycle
A270 contains the lower 4 digits. during the
overseeing
processes.
• Refreshed
when PRV
instruction is
executed to
read the PV.
• Refreshed
when INI
instruction is
executed.
A272 --- High-speed Counter 1 Contains the PV of high-speed counter Cleared Cleared • Refreshed
to A273 PV 1. A273 contains the upper 4 digits and each cycle
A272 contains the lower 4 digits. during the
overseeing
processes.
• Refreshed
when PRV
instruction is
executed to
read the PV.
• Refreshed
when INI
instruction is
executed.
A274 00 High-speed Counter 0 These flags indicate whether the PV is ON: PV in range Cleared Cleared • Refreshed
Range 1 Comparison within the specified ranges when OFF: PV not in range each cycle
09 High-speed Counter 0 This flag indicates when an overflow or ON: Overflow or Cleared Cleared • Refreshed
Overflow/Underflow underflow has occurred in the underflow when an
Flag high-speed counter 0 PV. (Used with OFF: Normal overflow or
the linear mode counting range only.) underflow
occurs.
• Refreshed
when PV is
changed.
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A274 10 High-speed Counter 0 This flag indicates whether the ON: Incrementing --- Cleared Setting used
Count Direction high-speed counter 0 is currently being OFF: Decrementing for high-speed
incremented or decremented. The counter, valid
counter PV for the current cycle is during counter
compared with the PV in last cycle to operation.
determine the direction.
A275 00 High-speed Counter 1 These flags indicate whether the PV is ON: PV in range Cleared Cleared • Refreshed
Range 1 Comparison within the specified ranges when OFF: PV not in range each cycle
Condition Met Flag high-speed counter 1 is being operated during the
in range-comparison mode for upper overseeing
01 High-speed Counter 1
and lower limits. processes.
Range 2 Comparison
Condition Met Flag • Refreshed
when PRV
02 High-speed Counter 1
instruction is
Range 3 Comparison
executed to
Condition Met Flag
read the
03 High-speed Counter 1 results of
Range 4 Comparison range com-
Condition Met Flag parison.
04 High-speed Counter 1 • Refreshed
Range 5 Comparison when range
Condition Met Flag comparison
table is reg-
05 High-speed Counter 1
istered.
Range 6 Comparison
Condition Met Flag
08 High-speed Counter 1 This flag indicates whether a ON: Being executed --- Cleared Refreshed
Comparison comparison operation is being OFF: Stopped when
In-progress Flag executed for high-speed counter 1. comparison
operation
starts or stops.
09 High-speed Counter 1 This flag indicates when an overflow or ON: Overflow or Cleared Cleared • Refreshed
Overflow/Underflow underflow has occurred in the underflow when an
Flag high-speed counter 1 PV. (Used with OFF: Normal overflow or
the linear mode counting range only.) underflow
occurs.
• Refreshed
when PV is
changed.
10 High-speed Counter 1 This flag indicates whether the ON: Incrementing --- Cleared Setting used
Count Direction high-speed counter 1 is currently being OFF: Decrementing for high-speed
incremented or decremented. The counter, valid
counter PV for the current cycle is during counter
compared with the PV in last cycle to operation.
determine the direction.
A276 --- Pulse Lower four Contain the number of pulses output Cleared Cleared • Refreshed
Output 0 digits from the corresponding pulse output each cycle
PV port. during the
A277 Upper four
PV range: 8000 0000 to 7FFF FFFF overseeing
digits
hex processes.
A278 --- Pulse Lower four
(-2,147,483,648 to 2,147,483,647) • Refreshed
Output 1 digits
when the INI
PV
A279 Upper four When pulses are being output in the instruction is
digits CW direction, the PV is incremented by executed
1 for each pulse. (PV
When pulses are being output in the change).
CCW direction, the PV is decremented
by 1 for each pulse.
PV after overflow: 7FFF FFFF hex
PV after underflow: 8000 0000 hex
Note If the coordinate system is rela-
tive coordinates (undefined ori-
gin), the PV will be cleared to 0
when a pulse output starts, i.e.
when a pulse output instruction
(SPED, ACC, PLS2, ITPL or
IFEED) is executed.
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A280 00 Pulse Output 0 This flag will be ON when pulses are ON: Accelerating or --- Cleared Refreshed
Accel/Decel Flag being output from pulse output 0 decelerating each cycle
according to an ORG, ACC, PLS2, OFF: Constant speed during the
ITPL or IFEED instruction and the overseeing
output frequency is being changed in processes.
steps (accelerating or decelerating).
01 Pulse Output 0 This flag indicates when an overflow or ON: Overflow or --- Cleared • Refreshed
Overflow/Underflow underflow has occurred in the pulse underflow when the PV
Flag output 0 PV. OFF: Normal is changed
by the INI
instruction.
• Refreshed
when an
overflow or
underflow
occurs.
02 Pulse Output 0 ON when the number of output pulses ON: Setting made --- Cleared • Refreshed
Output Amount Set for pulse output 0 has been set with the OFF: No setting when the
Flag PULS instruction. PULS
instruction is
executed.
• Refreshed
when pulse
output stops.
03 Pulse Output 0 ON when the number of output pulses ON: Output --- Cleared Refreshed at
Output Completed set with the PULS, PLS2, ITPL or completed the start or
Flag IFEED instruction has been output OFF: Output not completion of
through pulse output 0. completed pulse output.
04 Pulse Output 0 ON when pulses are being output from ON: Outputting --- Cleared Refreshed
Output In-progress pulse output 0. pulses when pulse
08 Pulse Output 0 ON between Input Interrupt - ON: Feeding Cleared Cleared • Refreshed
Interrupt Feeding Flag decelerating to stop when Interrupt OFF: Not feeding when feed-
Feeding function (IFEED instruction) is ing is com-
executing. pleted.
• Refreshed
when inter-
rupt feeding
is executing.
09 Pulse Output 0 ON if an overflow or underflow error ON: Overflow or Cleared Cleared Refreshed
Interrupt Feeding Error occurs during input interrupt or underflow when interrupt
Flag specified number of pulse output, when OFF: Normal feeding is
Interrupt Feeding function (IFEED executing.
instruction) is executing.
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A281 00 Pulse Output 1 This flag will be ON when pulses are ON: Accelerating or --- Cleared Refreshed
Accel/Decel Flag being output from pulse output 1 decelerating each cycle
according to an ORG, ACC, PLS2, OFF: Constant speed during the
ITPL or IFEED instruction and the overseeing
output frequency is being changed in processes.
steps (accelerating or decelerating).
01 Pulse Output 1 This flag indicates when an overflow or ON: Overflow or --- Cleared • Refreshed
Overflow/Underflow underflow has occurred in the pulse underflow when the PV
Flag output 1 PV. OFF: Normal is changed
by the INI
instruction.
• Refreshed
when an
overflow or
underflow
occurs.
02 Pulse Output 1 ON when the number of output pulses ON: Setting made --- Cleared • Refreshed
Output Amount Set for pulse output 1 has been set with the OFF: No setting when the
Flag PULS instruction. PULS
instruction is
executed.
• Refreshed
when pulse
output stops.
03 Pulse Output 1 ON when the number of output pulses ON: Output --- Cleared Refreshed at
Output Completed set with the PULS, PLS2, ITPL or completed the start or
Flag IFEED instruction has been output OFF: Output not completion of
through pulse output 1. completed pulse output.
04 Pulse Output 1 ON when pulses are being output from ON: Outputting --- Cleared Refreshed
Output In-progress pulse output 1. pulses when pulse
Flag OFF: Stopped output starts or
stops.
05 Pulse Output 1 ON when the origin has not been ON: Origin not ON ON Refreshed
No-origin Flag determined for pulse output 1 and goes established each cycle
OFF when the origin has been OFF: Origin during the
determined. established overseeing
processes.
06 Pulse Output 1 ON when the pulse output 1 PV ON: Stopped at origin --- Cleared Refreshed
At-origin Flag matches the origin (0). OFF: Not stopped at each cycle
origin during the
overseeing
processes.
07 Pulse Output 1 ON when an error occurred while ON: Stop error --- Cleared • Refreshed A445
Output Stopped Error outputting pulses in the pulse output 1 occurred when origin
Flag origin search function. OFF: No error search
The Pulse Output 1 Output Stop Error starts.
code will be written to A445. • Refreshed
when a
pulse output
stop error
occurs.
08 Pulse Output 1 ON between Input Interrupt - ON: Feeding Cleared Cleared • Refreshed
Interrupt Feeding Flag decelerating to stop when Interrupt OFF: Not feeding when feed-
Feeding function (IFEED instruction) is ing is com-
executing. pleted.
• Refreshed
when inter-
rupt feeding
is executing.
09 Pulse Output 1 ON if an overflow or underflow error ON: Overflow or Cleared Cleared Refreshed
Interrupt Feeding Error occurs during input interrupt or underflow when interrupt
Flag specified number of pulse output, when OFF: Normal feeding is
Interrupt Feeding function (IFEED executing.
instruction) is executing.
A283 00 PWM Output 0 ON when pulses are being output from ON: Outputting Cleared Cleared Refreshed
Output In-progress PWM output 0. pulses when pulse
Flag OFF: Stopped output starts or
stops.
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A294 Task Number when This word contains the task number of Cyclic tasks: 0000 Cleared Cleared When program A298/
Program Stopped the task that was being executed when Interrupt tasks: 8000 error occurs. A299
program execution was stopped to 800F (task 0 to 15)
because of a program error.
Note A298 and A299 contain the pro-
gram address where program
execution was stopped.
A295 08 Instruction Processing This flag and the Error Flag (ER) will be ON: Error Flag ON Cleared Cleared When program A294,
Error Flag turned ON when an instruction OFF: Error Flag OFF error occurs. A298/
processing error has occurred and the A299
PLC Setup has been set to stop PLC
operation for an instruction error. CPU Setup
Unit operation will stop and the (Operatio
ERR/ALM indicator will light when this n when
flag goes ON. instruction
Note The task number where the error error has
occurred will be stored in A294 occurred)
and the program address will be
stored in A298 and A299.
09 Indirect DM BCD Error This flag and the Access Error Flag ON: Not BCD Cleared Cleared When program A294,
Flag (AER) will be turned ON when an OFF: Normal error occurs. A298/
indirect DM BCD error has occurred A299
and the PLC Setup has been set to PLC
stop operation an indirect DM BCD Setup
error. (This error occurs when the (Operatio
content of an indirectly addressed DM n when
word is not BCD although BCD mode instruction
has been selected.) CPU Unit error has
operation will stop and the ERR/ALM occurred)
indicator will light when this flag goes
ON.
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A295 12 Task Error Flag ON when a task error has occurred. A ON: Error Cleared Cleared When program A294,
task error will occur when there is no OFF: Normal error occurs. A298/
program allocated to the task. A299
Note The task number where the error
occurred will be stored in A294
and the program address will be
stored in A298 and A299.
13 Differentiation The allowed value for Differentiation ON: Error Cleared Cleared When program A294,
Overflow Error Flag Flags which correspond to OFF: Normal error occurs. A298/
differentiation instructions has been A299
exceeded. CPU Unit operation will stop
and the ERR/ALM indicator will light
when this flag goes ON.
Note The task number where the error
occurred will be stored in A294
and the program address will be
stored in A298 and A299.
14 Illegal Instruction Error ON when a program that cannot be ON: Error Cleared Cleared When program A294,
Flag executed has been stored. CPU Unit OFF: Normal error occurs. A298/
operation will stop and the ERR/ALM A299
indicator will light when this flag goes
ON.
15 UM Overflow Error ON when the last address in UM (User ON: Error Cleared Cleared When program A294,
Flag Memory) has been exceeded. CPU OFF: Normal error occurs. A298/
Unit operation will stop and the A299
ERR/ALM indicator will light when this
flag goes ON.
A297 --- Program Stop Error This word contains FFFF hex when the FFFF hex: Stop in the Retained Cleared When program A295,
Identification stop position is in the program except program error occurs. A297/
information the function block. Except FFFF hex: A298
This word contains the data other than Stop in the function
FFFF hex when the stop position is in block
the function block.
A298 --- Program Address These words contain the program Lower digits of the Cleared Cleared When program A294
Where Program address of the instruction where program address error occurs.
Stopped program execution was stopped due to
(Lower digits) a program error.
A299 --- Program Address Note A294 contains the task number of Upper digits of the
Where Program the task where program execu- program address
Stopped tion was stopped.
(Upper digits)
A300 --- Error Log Pointer When an error occurs, the Error Log 00 to 14 hex Retained Retained Refreshed A500.14
Pointer is incremented by 1 to indicate when error
the location where the next error record occurs.
will be recorded as an offset from the
beginning of the Error Log Area (A100
to A199).
Note 1 The Error Log Pointer can be
cleared to 00 by turning
A500.14 (the Error Log Reset
Bit) ON.
2 When the Error Log Pointer
has reached 14 hex (20 deci-
mal), the next record is stored
in A195 to A199 when the next
error occurs.
A310 --- Manufacturing Lot The manufacturing lot number is stored Examples: Retained Retained Fixed value
Number, Lower Digits in 6 digits hexadecimal. X, Y, and Z in Lot number 01805
the lot number are converted to 10, 11, A310 = 0801, A311 =
A311 --- Manufacturing Lot
and 12, respectively. 0005
Number, Upper Digits
Lot number 30Y05
A310 =1130, A311 =
0005
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A313 --- Error Contents for An error content is registered when a For details of the Cleared Cleared Refreshed A315.10
Ethernet Errors built-in Ethernet error or Ethernet error contents, refer when a
setting table error occurs. to 6-1-10 Non-fatal non-fatal error
Errors in the CP2E occurs.
CPU Unit Hardware
User's Manual (Cat.
No. W613).
A315 10 Built-in Etherent ON when an error occurs in the ON: Error Cleared Cleared Refreshed A313
Contents/Setup Error connection/setting of FINS/TCP, SNTP OFF: Normal when a A402.00
Flag and DNS server. non-fatal error
occurs.
11 Logic Error in Setting ON when an error occurs in the routing ON: Error Cleared Cleared Refreshed A402.00
Tables table, IP address table and IP router OFF: Normal when a
table. non-fatal error
The error code is stored in A313. occurs.
13 Option Board Error ON when the Option Board is removed ON: Error Cleared Cleared Refreshed A402.00,
Flag while the power is being supplied. OFF: Normal when a A424
ON when two Analog Option Boards non-fatal error
are mounted. occurs.
executed to
read PV.
• Refreshed
when INI
instruction is
executed.
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A320 00 High-speed Counter 2 These flags indicate whether the PV is ON: PV in range Cleared Cleared • Refreshed
Range 1 Comparison within the specified ranges when OFF: PV not in range each cycle
Condition Met Flag high-speed counter 2 is being operated during the
in range-comparison mode for upper overseeing
01 High-speed Counter 2
and lower limits. processes.
Range 2 Comparison
Condition Met Flag • Refreshed
when PRV
02 High-speed Counter 2
instruction is
Range 3 Comparison
executed to
Condition Met Flag
read the
03 High-speed Counter 2 results of
Range 4 Comparison range com-
Condition Met Flag parison.
04 High-speed Counter 2 • Refreshed
Range 5 Comparison when range
Condition Met Flag comparison
table is reg-
05 High-speed Counter 2
istered.
Range 6 Comparison
Condition Met Flag
08 High-speed Counter 2 This flag indicates whether a ON: Being executed --- Cleared Refreshed
Comparison comparison operation is being OFF: Stopped when
In-progress Flag executed for high-speed counter 2. comparison
operation
starts or stops.
09 High-speed Counter 2 This flag indicates when an overflow or ON: Overflow or Cleared Cleared • Refreshed
Overflow/Underflow underflow has occurred in the underflow when an
Flag high-speed counter 2 PV. (Used with OFF: Normal overflow or
the linear mode counting range only.) underflow
occurs.
• Refreshed
when PV is
changed.
10 High-speed Counter 2 This flag indicates whether the ON: Incrementing --- Cleared Setting used
Count Direction high-speed counter 2 is currently being OFF: Decrementing for high-speed
incremented or decremented. The counter, valid
counter PV for the current cycle is during counter
compared with the PV in last cycle to operation.
determine the direction.
A321 00 High-speed Counter 3 These flags indicate whether the PV is ON: PV in range Cleared Cleared • Refreshed
Range 1 Comparison within the specified ranges when OFF: PV not in range each cycle
Condition Met Flag high-speed counter 3 is being operated during the
in range-comparison mode for upper overseeing
01 High-speed Counter 3
and lower limits. processes.
Range 2 Comparison
Condition Met Flag • Refreshed
when PRV
02 High-speed Counter 3
instruction is
Range 3 Comparison
executed to
Condition Met Flag
read the
03 High-speed Counter 3 results of
Range 4 Comparison range com-
Condition Met Flag parison.
04 High-speed Counter 3 • Refreshed
Range 5 Comparison when range
Condition Met Flag comparison
table is reg-
05 High-speed Counter 3
istered.
Range 6 Comparison
Condition Met Flag
08 High-speed Counter 3 This flag indicates whether a ON: Being executed --- Cleared Refreshed
Comparison comparison operation is being OFF: Stopped when
In-progress Flag executed for high-speed counter 3. comparison
operation
starts or stops.
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A321 09 High-speed Counter 3 This flag indicates when an overflow or ON: Overflow or Cleared Cleared • Refreshed
Overflow/Underflow underflow has occurred in the underflow when an
Flag high-speed counter 3 PV. (Used with OFF: Normal overflow or
the linear mode counting range only.) underflow
occurs.
• Refreshed
when PV is
changed.
10 High-speed Counter 3 This flag indicates whether the ON: Incrementing --- Cleared Setting used
Count Direction high-speed counter is currently being OFF: Decrementing for high-speed
incremented or decremented. The counter, valid
counter PV for the current cycle is during counter
compared with the PV in last cycle to operation.
determine the direction.
A322 High-speed Counter 4 Contains the PV of high-speed counter Cleared Cleared • Refreshed
to A323 PV 4. each cycle
A323 contains the upper four digits and during the
A322 contains the lower four digits. overseeing
processes.
• Refreshed
when PRV
instruction is
executed to
read PV.
• Refreshed
when INI
instruction is
executed.
A324 to High-speed Counter 5 Contains the PV of high-speed counter Cleared Cleared • Refreshed
A325 PV 5. each cycle
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A326 09 High-speed Counter 4 This flag indicates when an overflow or ON: Overflow or Cleared Cleared • Refreshed
Overflow/Underflow underflow has occurred in the underflow when an
Flag high-speed counter 4 PV. (Used with OFF: Normal overflow or
the linear mode counting range only.) underflow
occurs.
• Refreshed
when PV is
changed.
10 High-speed Counter 4 This flag indicates whether the ON: Incrementing --- Cleared Setting used
Count Direction high-speed counter is currently being OFF: Decrementing for high-speed
incremented or decremented. The counter, valid
counter PV for the current cycle is during counter
compared with the PV in last cycle to operation.
determine the direction.
A327 00 High-speed Counter 5 These flags indicate whether the PV is ON: PV in range Cleared Cleared • Refreshed
Range 1 Comparison within the specified ranges when OFF: PV not in range each cycle
Condition Met Flag high-speed counter 5 is being operated during the
in range-comparison mode. overseeing
01 High-speed Counter 5
processes.
Range 2 Comparison
Condition Met Flag • Refreshed
when PRV
02 High-speed Counter 5
instruction is
Range 3 Comparison
executed to
Condition Met Flag
read the
03 High-speed Counter 5 results of
Range 4 Comparison range com-
Condition Met Flag parison.
04 High-speed Counter 5 • Refreshed
Range 5 Comparison when range
Condition Met Flag comparison
table is reg-
05 High-speed Counter 5
istered.
Range 6 Comparison
Condition Met Flag
08 High-speed Counter 5 This flag indicates whether a ON: Being executed --- Cleared Refreshed
Comparison comparison operation is being OFF: Stopped when
In-progress Flag executed for high-speed counter 5. comparison
operation
starts or stops.
09 High-speed Counter 5 This flag indicates when an overflow or ON: Overflow or Cleared Cleared • Refreshed
Overflow/Underflow underflow has occurred in the underflow when an
Flag high-speed counter 5 PV. (Used with OFF: Normal overflow or
the linear mode counting range only.) underflow
occurs.
• Refreshed
when PV is
changed.
10 High-speed Counter 5 This flag indicates whether the ON: Incrementing --- Cleared Setting used
Count Direction high-speed counter is currently being OFF: Decrementing for high-speed
incremented or decremented. The counter, valid
counter PV for the current cycle is during counter
compared with the PV in last cycle to operation.
determine the direction.
A339 to --- Maximum These words contain the maximum --- Cleared • Written at A295.13
A340 Differentiation Flag value of the differentiation flag the start of
Number numbers being used by differentiation operation.
instructions. • Written at
the time of
online edit-
ing.
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A351 to Calendar/Clock Area These words contain the CPU Unit’s Retained Retained Written every
A354 internal clock data in BCD. The clock cycle
can be set from the CX-Programmer,
with the DATE instruction, or with a
FINS command (CLOCK WRITE,
0702).
A351.00 to A351.07:
Seconds (00 to 59)(BCD)
A351.08 to A351.15:
Minutes (00 to 59)(BCD)
A352.00 to A352.07:
Hours (00 to 23)(BCD)
A352.08 to A352.15:
Day of the month (01 to 31)(BCD)
A353.00 to A353.07:
Month (01 to 12)(BCD)
A353.08 to A353.15:
Year (00 to 99)(BCD)
A354.00 to A354.07:
Day of the week (00 to 06)(BCD)
00: Sunday
01: Monday
02: Tuesday
03: Wednesday
04: Thursday
05: Friday
App
A-2-1 Read-only Words
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A392 04 Serial Port 1/ ON when an error has occurred at the ON: Error Retained Cleared Refreshed
Built-in RS-232C Port serial port 1 or built-in RS-232C port. OFF: Normal when error
Error Flag (Not valid in NT Link mode.) occurs.
05 Serial Port 1/ ON when the serial port 1 or built-in ON: Able-to-send Retained Cleared Written after
Built-in RS-232C Port RS-232C port is able to send data in OFF: Unable-to-send transmission
Send Ready Flag no-protocol mode.
(No-protocol mode)
06 Serial Port 1/ ON when the serial port 1 or built-in ON: Reception Retained Cleared Written after
Built-in RS-232C Port RS-232C port has completed the completed reception
Reception Completed reception in no-protocol mode. OFF: Reception not
Flag (No-protocol • When the number of bytes was completed
mode) specified: ON when the specified
number of bytes is received.
• When the end code was specified:
ON when the end code is received or
256 bytes are received.
07 Serial Port 1/ ON when a data overflow occurred ON: Overflow Retained Cleared Refreshed
Built-in RS-232C Port during reception through the serial port OFF: No overflow when error
Reception Overflow 1 or built-in RS-232C port in occurs.
Flag (No-protocol no-protocol mode.
mode) • When the number of bytes was
specified: ON when more data is
received after the reception was
completed but before RXD was exe-
cuted.
• When the end code was specified:
ON when more data is received after
the end code was received but
before RXD was executed.
ON when 257 bytes are received
before the end code.
12 Serial Port 2/ ON when a communications error has ON: Error Retained Cleared Refreshed
Built-in RS-485 Port occurred at the serial port 2 or built-in OFF: No error when error
Communications Error RS-485 port. (Not valid in NT Link occurs.
Flag (CP2E N30/40/60 mode.)
or S
-type CPU Unit
only)
13 Serial Port 2/ ON when the serial port 2 or built-in ON: Able-to-send Retained Cleared Written after
Built-in RS-485 Port RS-485 port is able to send data in OFF: Unable-to-send transmission
Send Ready Flag no-protocol mode.
(No-protocol Mode)
(CP2E N30/40/60 or
S
-type CPU Unit
only)
14 Serial Port 2/ ON when the serial port 2 or built-in ON: Reception Retained Cleared Written after
Built-in RS-485 Port RS-485 port has completed the completed reception
Reception Completed reception in no-protocol mode. OFF: Reception not
Flag (No-protocol • When the number of bytes was completed
mode) (CP2E specified: ON when the specified
N30/40/60 or number of bytes is received.
S
-type CPU Unit
only) • When the end code was specified:
ON when the end code is received or
256 bytes are received.
15 Serial Port 2/ ON when a data overflow occurred ON: Reception Retained Cleared Refreshed
Built-in RS-485 Port during reception through serial port 2 completed when error
Reception Overflow or built-in RS-485 port in no-protocol OFF: Reception not occurs.
Flag (No-protocol mode. completed
mode) (CP2E • When the number of bytes was
N30/40/60 or specified: ON when more data is
S
-type CPU Unit received after the reception was
only) completed but before RXD was exe-
cuted.
• When the end code was specified:
ON when more data is received after
the end code was received but
before RXD was executed.
ON when 257 bytes are received
before the end code.
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A393 00 to Serial Port 1/ The corresponding bit will be ON when ON: Communicating Retained Cleared Refreshed
07 Built-in RS-232C Port the serial port 1 or built-in RS-232C OFF: Not when there is a
Polled Unit port is communicating with NT Link communicating normal
Communications Flags mode or Serial PLC Link mode. response to
Bits 0 to 7 correspond to Units 0 to 7. the token.
00 to Serial Port 1/ Indicates (in binary) the number of Retained Cleared Refreshed
15 Built-in RS-232C Port bytes of data received when the serial when data is
Reception Counter port 1 or built-in RS-232C port is in received.
(No-protocol Mode) no-protocol mode.
A394 00 to Serial Port 2/ The corresponding bit will be ON when ON: Communicating Retained Cleared Refreshed
07 Built-in RS-485 Port the serial port 2 or built-in RS-485 port OFF: Not when there is a
Polled Unit is communicating with NT link mode or communicating normal
Communications Flags Serial PLC Link made. response to
(CP2E N30/40/60 or Bits 0 to 7 correspond to Units 0 to 7. the token.
S
-type CPU Unit
only)
00 to Serial Port 2/ Indicates (in binary) the number of Retained Cleared Refreshed
15 Built-in RS-485 Port bytes of data received when the serial when data is
Reception Counter port 2 or built-in RS-485 port is in received.
(No-protocol Mode) no-protocol mode.
(CP2E N30/40/60 or
S
-type CPU Unit
only)
A395 08 Clock Stop Flag • ON if Clock stop working. ON: Clock stops Retained Cleared Refreshed
• Cleared when Clock set. OFF: Clock is running when power is
ON.
A400 --- Error code When a non-fatal error (user-defined Cleared Cleared Refreshed
FALS or system error) or a fatal error when error
(user-defined FALS or system error) occurs.
occurs, the 4-digit hexadecimal error
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A401 09 Program Error Flag ON when program contents are ON: Error Cleared Cleared Refreshed A294,
(fatal error) incorrect. CPU Unit operation will stop OFF: Normal when error A295,
and the ERR/ALM indicator on the front occurs. A298 and
of the CPU Unit will light. The task A299
number where the error occurred will
be stored in A294 and the program
address will be stored in A298 and
A299. The type of program error that
occurred will be stored in A295.08 to
A295.15. Refer to the description of
A295 for more details on program
errors.
11 Too Many I/O Points ON when the number of Expansion ON: Error Cleared Cleared Refreshed A407
Flag Units and Expansion I/O Units exceeds OFF: Normal when error
(fatal error) the limit, when the number of words occurs.
allocated to these Units exceeds the
limit, are mounted.
CPU Unit operation will stop and the
ERR/ALM indicator on the front of the
CPU Unit will light.
14 I/O Bus Error Flag ON in the following cases: ON: Error Cleared Cleared Refreshed A404
(fatal error) • When an error occurs in a data OFF: Normal when error
transfer between the CPU Unit and occurs.
an Expansion Unit or Expansion I/O
Unit. If this happens, 0A0A hex will
be output to A404.
CPU Unit operation will stop and the
ERR/ALM indicator on the front of the
CPU Unit will light.
15 Memory Error Flag ON when an error occurred in memory. ON: Error Cleared Cleared Refreshed A403.00
(fatal error) OFF: Normal when error to
CPU Unit operation will stop and the occurs. A403.08,
ERR/ALM indicator on the front of the A403.09
CPU Unit will light. The location where
the error occurred is indicated in
A403.00 to A403.14.
This flag will be turned OFF when the
error is cleared.
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A402 00 Other Non-Fatal Error ON when a non-fatal error that is not ON: Other non-fatal Cleared Cleared Refreshed A315
Flag defined for A402.01 to A402.15 occurs. error when error
Detailed information is output to the OFF: No other occurs.
bits of A315. non-fatal error
04 Battery Error Flag ON if the CPU Unit’s battery is ON: Error Cleared Cleared Refreshed PLC
(non-fatal error) disconnected or its voltage is low and OFF: Normal when error Setup
the Detect Battery Error setting has occurs. (Detect
been set in the PLC Setup. Battery
The CPU Unit will continue operating Error)
and the ERR/ALM indicator on the front
of the CPU Unit will flash.
• This flag can be used to control an
external warning light or other indica-
tor to indicate that the battery needs
to be replaced.
• This flag will be turned OFF when
the error is cleared.
10 PLC Setup Error Flag ON when there is a setting error in the ON: Error Cleared Cleared Refreshed
(non-fatal error) PLC Setup. The CPU Unit will continue OFF: Normal when error
operating and the ERR/ALM indicator occurs.
on the front of the CPU Unit will flash.
Note This flag will be turned OFF when
the error is cleared.
15 FAL Error Flag ON when a non-fatal error is generated ON: FAL error Cleared Cleared Refreshed A360 to
(non-fatal error) by executing FAL. The CPU Unit will occurred when error A391,
continue operating and the ERR/ALM OFF: FAL not occurs. A400
indicator on the front of the CPU Unit executed
will flash.
The bit in A360 to A391 that
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A424 00 to Error Option Board The bit corresponding to the option slot ON: Error Cleared Cleared Refreshed A353.13
15 Flags turns ON when an error occurs in an OFF: Normal when error
Option Board (A315.13 will be ON). occurs.
Bit 00: Option slot 1 (Left)
Bit 01: Option slot 2 (Right)
A435 14 I/O Option Board Run Turn ON when the I/O Option Board ON: In initial Cleared Cleared When I/O
State Flag works normally. Turn OFF when the processing or option board
(Option 1/Left) I/O Option Board is in initial processing error occurred. state changes.
or an error occurs. OFF: Normal
15 I/O Option Board Run
State Flag
(Option 2/Right)
A436 00 to Expansion Unit and ON when an error occurs in a ON: Error Retained Cleared
02 Expansion I/O Unit CP-series Expansion Unit or OFF: Normal
Error Flags Expansion I/O Unit.
A436.00: 1st Unit
A436.01: 2nd Unit
A436.02: 3rd Unit
A436.03: 4th Unit
A436.04: 5th Unit
A436.05: 6th Unit
Note CP1W-TS002/TS003/TS102/
AD041/AD042/DA041/DA042/
MAD42/MAD44/32ER/32ET/32E
T1 are each counted as two
Units.
A437 --- Number of Connected Stores the number of Expansion Units 0000 to 0006 hex Retained Cleared Retained when
Units and Expansion I/O Units connected as error occurs.
a hexadecimal number.
Note This information is invalid only
when a Too Many I/O Points error
has occurred.
CP1W-TS002/TS003/TS102/
AD041/AD042/DA041/DA042/
MAD42/MAD44/32ER/32ET/32ET
1 are each counted as two Units.
A438 --- Pulse Output 2 Stop If a Pulse Output Stop Error occurs for Retained Cleared Retained when
Error Code pulse output 2, the error code is written error occurs.
to this word.
A439 --- Pulse Output 3 Stop If a Pulse Output Stop Error occurs for Retained Cleared Retained when
Error Code pulse output 3, the error code is written error occurs.
to this word.
A440 --- Max. Interrupt Task Contains the Maximum Interrupt Task 0000 to FFFF hex Cleared Cleared Written after
Processing Time Processing Time in units of 0.1 ms. the interrupt
Note This value is cleared when PLC task with the
operation begins. max.
processing
time is
executed.
A441 --- Interrupt Task with Contains the task number of the 8000 to 800F hex Cleared Cleared Written after
Max. Processing Time interrupt task with the maximum the interrupt
processing time. Hexadecimal values task with the
8000 to 800F correspond to task max.
numbers 00 to 0F. Bit 15 is turned ON processing
when an interrupt has occurred. time is
Note This value is cleared when PLC executed.
operation begins.
A442 --- Total Interrupt Task Contains the Total Interrupt Task Pro- 0000 to FFFF hex Cleared Cleared Each cycle A440
Processing Time One cessing Time in one cycle in units of
Cycle 0.1ms.Sets when the value is bigger
than the last one once a cycle by com-
mon processing.
Note This value is cleared when PLC
operation begins. The value is
unstable for CPU Unit version 1.0
or earlier.
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A444 --- Pulse Output 0 If a Pulse Output Stop Error occurs for Retained Cleared • Refreshed
Stop Error Code pulse output 0, the error code is written when origin
to this word. search
starts.
• Refreshed
when a
pulse output
stop error
occurs.
A445 --- Pulse Output 1 If a Pulse Output Stop Error occurs for Retained Cleared • Refreshed
Stop Error Code pulse output 1, the error code is written when origin
to this word. search
starts.
• Refreshed
when a
pulse output
stop error
occurs.
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A512 --- Power Interruption These words contain the time at which See Function col- Retained Retained Written at
to Time the power was interrupted. The con- umn. power
A513 tents are updated every time that the interruption.
power is interrupted. The data is
stored in BCD.
A512.00 to A512.07: Second (00 to
59)
A512.08 to A512.15: Minute (00 to 59)
A513.00 to A513.07: Hour (00 to 23)
A513.08 to A513.15: Day of month (01
to 31)
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A518 --- Operation End Time The time that operation stopped as a See Function col- Retained Retained See Function
to result of changing the operating mode umn. column.
A520 to PROGRAM mode is stored here in
BCD.
A518.00 to A518.07: Seconds (00 to
59)
A518.08 to A518.15: Minutes (00 to
59)
A519.00 to A519.07: Hour (00 to 23)
A519.08 to A519.15: Day of month (01
to 31)
A520.00 to A520.07: Month (01 to 12)
A520.08 to A520.15: Year (00 to 99)
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A528 00 Serial Port 1/ These flags indicate what kind of error Bits 00 and 01: Not Retained Cleared Refreshed
to Built-in RS-232C Port has occurred at the serial port 1 or used. when commu-
07 Error Flags built-in RS-232C port. Bit 02: ON for parity nication error
• They are automatically turned OFF error. occurs.
when the serial port 1 or built-in Bit 03: ON for fram-
RS-232C port is restarted. ing error.
• Only bit 5 (timeout error) is valid in
Bit 04: ON for over-
NT Link mode.
run error.
• Serial PLC Link Polling Unit:
Bit 05: ON for time-
Bit 05: ON for timeout error.
out error.
Serial PLC Link Polled Unit:
Bit 02: ON for parity error. Bits 06 and 07: Not
Bit 03: ON for framing error. used.
Bit 04: ON for overrun error.
These bits can be cleared by the
CX-Programmer.
08 Serial Port 2/ These flags indicate what kind of error Bits 08 and 09: Not Retained Cleared Refreshed
to Bult-in RS-485 Port has occurred at the serial port 2 or used. when commu-
15 Error Flags (CP2E built-in RS-485 port. Bit 10: ON for parity nication error
N30/40/60 or • They are automatically turned OFF error. occurs.
S
-type CPU Unit when the serial port 2 or built-in
only) Bit 11: ON for fram-
RS-485 port is restarted. ing error.
• Only bit 5 (timeout error) is valid in
Bit 12: ON for over-
NT Link mode.
run error.
• Serial PLC Link Polling Unit:
Bit 13: ON for time-
Bit 13: ON for timeout error.
out error.
Serial PLC Link Polled Unit:
Bit 10: ON for parity error. Bits 14 and 15: Not
Bit 11: ON for framing error. used.
Bit 12: ON for overrun error.
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A540 00 Pulse Output 0 Reset The pulse output 0 PV (contained in OFF to ON: Cleared Retained Cleared --- A276 and
Bit A276 and A277) will be cleared when A277
this bit is turned ON.
08 Pulse Output 0 CW This is the CW limit input signal for --- Retained Cleared ---
Limit Input Signal Flag pulse output 0, which is used in the
origin search. To use this signal, write
the input from the actual sensor as an
input condition in the ladder program
and output the result to this flag.
09 Pulse Output 0 CCW This is the CCW limit input signal for --- Retained Cleared ---
Limit Input Signal Flag pulse output 0, which is used in the
origin search. To use this signal, write
the input from the actual sensor as an
input condition in the ladder program
and output the result to this flag.
10 Pulse Output 0 This is the positioning completed input --- Retained Cleared ---
Positioning signal used in the origin search for
pulse output 0. The input signal from
Completed Signal the servo driver is output to this bit
from the ladder program to enable
using the signal.
A541 00 Pulse Output 1 Reset The pulse output 1 PV (contained in OFF to ON: Cleared Retained Cleared --- A278 and
Bit A278 and A279) will be cleared when A279
this bit is turned ON.
08 Pulse Output 1 CW This is the CW limit input signal for --- Retained Cleared ---
Limit Input Signal Flag pulse output 1, which is used in the
origin search. To use this signal, write
the input from the actual sensor as an
input condition in the ladder program
and output the result to this flag.
09 Pulse Output 1 CCW This is the CCW limit input signal for --- Retained Cleared ---
Limit Input Signal Flag pulse output 1, which is used in the
origin search. To use this signal, write
the input from the actual sensor as an
input condition in the ladder program
and output the result to this flag.
10 Pulse Output 1 This is the positioning completed input --- Retained Cleared ---
Positioning signal used in the origin search for
Completed Signal pulse output 1. The input signal from
the servo driver is output to this bit
from the ladder program to enable
using the signal.
A542 00 Pulse Output 2 Reset The pulse output 2 PV (contained in OFF to ON: Cleared Retained Cleared --- A52 and
Bit A52 and A53) will be cleared when A53
this bit is turned ON.
08 Pulse Output 2 CW This is the CW limit input signal for --- Retained Cleared ---
Limit Input Signal Flag pulse output 2, which is used in the
origin search. To use this signal, write
the input from the actual sensor as an
input condition in the ladder program
and output the result to this flag.
09 Pulse Output 2 CCW This is the CCW limit input signal for --- Retained Cleared ---
Limit Input Signal Flag pulse output 2, which is used in the
origin search. To use this signal, write
the input from the actual sensor as an
input condition in the ladder program
and output the result to this flag.
10 Pulse Output 2 This is the positioning completed input --- Retained Cleared ---
Positioning signal used in the origin search for
Completed Signal pulse output 2. The input signal from
the servo driver is output to this bit
from the ladder program to enable
using the signal.
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A543 00 Pulse Output 3 Reset The pulse output 3 PV (contained in OFF to ON: Cleared Retained Cleared --- A54 and
Bit A54 and A55) will be cleared when A55
this bit is turned ON.
08 Pulse Output 3 CW This is the CW limit input signal for --- Retained Cleared ---
Limit Input Signal Flag pulse output 3, which is used in the
origin search. To use this signal, write
the input from the actual sensor as an
input condition in the ladder
programand output the result to this
flag.
09 Pulse Output 3 CCW This is the CCW limit input signal for --- Retained Cleared ---
Limit Input Signal Flag pulse output 3, which is used in the
origin search. To use this signal, write
the input from the actual sensor as an
input condition in the ladder
programand output the result to this
flag.
10 Pulse Output 3 This is the positioning completed input --- Retained Cleared ---
Positioning signal used in the origin search for
Completed Signal pulse output 3. The input signal from
the servo driver is output to this bit
from the ladder program to enable
using the signal.
A566 02 Socket Force-close OFF Æ ON: Forced close of all socket OFF to ON: Forced --- Cleared ---
Switch is executed. close is executed
Automatically turns OFF when closing
is completed.
04 Automatic Clock At the rise of OFF to ON, clock OFF to ON: Clock --- Cleared ---
Information information is obtained from SNTP information is
App
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A567 00 Open Processing Flag Flag keeps ON during open ON: During open --- Cleared Refreshed at
for Socket No.1 processing of socket No.1. processing the start or
Finish open process, and then flag OFF: Open completion of
turns OFF. completed open process
01 Reception Flag keeps ON during reception ON: Receiving --- Cleared Refreshed at
Progressing Flag for processing of socket No.1. OFF: Reception the start or
Socker No.1 Finish reception process, and then completed completion of
flag turns OFF. reception
process
02 Transmission Flag keeps ON during transimission ON: Sending --- Cleared Refreshed at
Progressing Flag for processing of socket No.1. OFF: Transimission the start or
Socket No.1 Finish transmission process, and then completed completion of
flag turns OFF. transmission
process
03 Close Processing Flag keeps ON during close ON: During close --- Cleared Refreshed at
Flag for Socker No.1 processing of socket No.1. processing the start or
Finish clsoe process, and then flag OFF: Close completion of
turns OFF. completed close process
13 Data Received Flag keeps ON when data is received ON: Data reception --- Cleared • Refreshed
Present/Not Present from the other node on an open TCP completed after recep-
Flag for Socket No.1 socket. OFF: Waiting for tion
Flag turns OFF when the reception reception • Refreshed
request is executed. when
reception
process is
requested
14 Result Storage Error Flag keeps ON when any value other ON: Code other than --- Cleared Refreshed
Flag for Socket No.1 than normal end (0000 hex) is stored normal end is when socket
stored
in the end code of the parameter area request
of socket No.1. OFF: Normal end process is
Flag turns OFF when the next request completed
is received.
15 TCP/UDP Open Flag When open processing of socket No.1 ON: Close com- --- Cleared Refreshed
for Socket No.1 is completed, the flag turns ON. pleted when
When closing process is completed or OFF: Open open/close
while closing, the flag turns OFF. completed process is
When open processing ends completed
abnormally, the flag remains OFF.
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A568 00 Open Processing Flag Flag keeps ON during open ON: During open --- Cleared Refreshed at
for Socket No.2 processing of socket No.2. processing the start or
Finish open process, and then flag OFF: Open completion of
turns OFF. completed open process
01 Reception Flag keeps ON during reception ON: Receiving --- Cleared Refreshed at
Progressing Flag for processing of socket No.2. OFF: Reception the start or
Socker No.2 Finish reception process, and then completed completion of
flag turns OFF. reception
process
02 Transmission Flag keeps ON during transimission ON: Sending --- Cleared Refreshed at
Progressing Flag for processing of socket No.2. OFF: Transimission the start or
Socket No.2 Finish transmission process, and then completed completion of
flag turns OFF. transmission
process
03 Close Processing Flag keeps ON during close ON: During close --- Cleared Refreshed at
Flag for Socker No.2 processing of socket No.2. processing the start or
Finish clsoe process, and then flag OFF: Close completion of
turns OFF. completed close process
13 Data Received Flag keeps ON when data is received ON: Data reception --- Cleared • Refreshed
Present/Not Present from the other node on an open TCP completed after recep-
Flag for Socket No.2 socket. OFF: Waiting for tion
Flag turns OFF when the reception reception • Refreshed
request is executed. when
reception
process is
requested
14 Result Storage Error Flag keeps ON when any value other ON: Code other than --- Cleared Refreshed
Flag for Socket No.2 than normal end (0000 hex) is stored normal end is when socket
stored
in the end code of the parameter area request
15 TCP/UDP Open Flag When open processing of socket No.2 ON: Close com- --- Cleared Refreshed
for Socket No.2 is completed, the flag turns ON. pleted when
When closing process is completed or OFF: Open open/close
while closing, the flag turns OFF. completed process is
When open processing ends completed
abnormally, the flag remains OFF.
App
A-2-2 Read/Write Words
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A569 00 Open Processing Flag Flag keeps ON during open ON: During open --- Cleared Refreshed at
for Socket No.3 processing of socket No.3. processing the start or
Finish open process, and then flag OFF: Open completion of
turns OFF. completed open process
01 Reception Flag keeps ON during reception ON: Receiving --- Cleared Refreshed at
Progressing Flag for processing of socket No.3. OFF: Reception the start or
Socker No.3 Finish reception process, and then completed completion of
flag turns OFF. reception
process
02 Transmission Flag keeps ON during transimission ON: Sending --- Cleared Refreshed at
Progressing Flag for processing of socket No.3. OFF: Transimission the start or
Socket No.3 Finish transmission process, and then completed completion of
flag turns OFF. transmission
process
03 Close Processing Flag keeps ON during close ON: During close --- Cleared Refreshed at
Flag for Socker No.3 processing of socket No.3. processing the start or
Finish clsoe process, and then flag OFF: Close completion of
turns OFF. completed close process
13 Data Received Flag keeps ON when data is received ON: Data reception --- Cleared • Refreshed
Present/Not Present from the other node on an open TCP completed after recep-
Flag for Socket No.3 socket. OFF: Waiting for tion
Flag turns OFF when the reception reception • Refreshed
request is executed. when
reception
process is
requested
14 Result Storage Error Flag keeps ON when any value other ON: Code other than --- Cleared Refreshed
Flag for Socket No.3 than normal end (0000 hex) is stored normal end is when socket
stored
in the end code of the parameter area request
of socket No.3. OFF: Normal end process is
Flag turns OFF when the next request completed
is received.
15 TCP/UDP Open Flag When open processing of socket No.3 ON: Close com- --- Cleared Refreshed
for Socket No.3 is completed, the flag turns ON. pleted when
When closing process is completed or OFF: Open open/close
while closing, the flag turns OFF. completed process is
When open processing ends completed
abnormally, the flag remains OFF.
A571 00 UDP Open Request When the flag changes from OFF to OFF to ON: UDP --- Cleared ---
Switch for Socket ON, UDP open processing is open
No.1 executed.
When open process is completed, the
flag automatically turns OFF.
01 TCP Passive Open When the flag changes from OFF to OFF to ON: TCP --- Cleared ---
Request Switch for ON, TCP passive open processing is passive open
Socket No.1 executed.
When open process is completed, the
flag automatically turns OFF.
02 TCP Active Open When the flag changes from OFF to OFF to ON: TCP --- Cleared ---
Request Switch for ON, TCP active open processing is active open
Socket No.1 executed.
When open process is completed, the
flag automatically turns OFF.
03 Send Request Switch When the flag changes from OFF to OFF to ON: Send --- Cleared ---
for Socket No.1 ON, transmission processing is
executed.
When transmission process is
completed, the flag automatically turns
OFF.
04 Receive Request When the flag changes from OFF to OFF to ON: Receive --- Cleared ---
Switch for Socket ON, reception processing is executed.
No.1 When reception process is completed,
the flag automatically turns OFF.
05 Close Request Switch When the flag changes from OFF to OFF to ON: Close --- Cleared ---
for Socket No.1 ON, close processing is executed.
When close process is completed, the
flag automatically turns OFF.
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A571 08 UDP Open Request When the flag changes from OFF to OFF to ON: UDP --- Cleared ---
Switch for Socket ON, UDP open processing is open
No.2 executed.
When open process is completed, the
flag automatically turns OFF.
09 TCP Passive Open When the flag changes from OFF to OFF to ON: TCP --- Cleared ---
Request Switch for ON, TCP passive open processing is passive open
Socket No.2 executed.
When open process is completed, the
flag automatically turns OFF.
10 TCP Active Open When the flag changes from OFF to OFF to ON: TCP --- Cleared ---
Request Switch for ON, TCP active open processing is active open
Socket No.2 executed.
When open process is completed, the
flag automatically turns OFF.
11 Send Request Switch When the flag changes from OFF to OFF to ON: Send --- Cleared ---
for Socket No.2 ON, transmission processing is
executed.
When transmission process is
completed, the flag automatically turns
OFF.
12 Receive Request When the flag changes from OFF to OFF to ON: Receive --- Cleared ---
Switch for Socket ON, reception processing is executed.
No.2 When reception process is completed,
the flag automatically turns OFF.
13 Close Request Switch When the flag changes from OFF to OFF to ON: Close --- Cleared ---
for Socket No.2 ON, close processing is executed.
When close process is completed, the
flag automatically turns OFF.
01 TCP Passive Open When the flag changes from OFF to OFF to ON: TCP --- Cleared ---
Request Switch for ON, TCP passive open processing is passive open
Socket No.3 executed.
When open process is completed, the
flag automatically turns OFF.
02 TCP Active Open When the flag changes from OFF to OFF to ON: TCP --- Cleared ---
Request Switch for ON, TCP active open processing is active open
Socket No.3 executed.
When open process is completed, the
flag automatically turns OFF.
03 Send Request Switch When the flag changes from OFF to OFF to ON: Send --- Cleared ---
for Socket No.3 ON, transmission processing is
App
executed.
When transmission process is
completed, the flag automatically turns
OFF.
A-2-2 Read/Write Words
04 Receive Request When the flag changes from OFF to OFF to ON: Receive --- Cleared ---
Switch for Socket ON, reception processing is executed.
No.3 When reception process is completed,
the flag automatically turns OFF.
05 Close Request Switch When the flag changes from OFF to OFF to ON: Close --- Cleared ---
for Socket No.3 ON, close processing is executed.
When close process is completed, the
flag automatically turns OFF.
A580 00 FB Communications Automatically stores the number of 0 to F hex Set the Cleared Written at the
to Instruction Retries retries of FB communication PLC start of
03 Count instruction settings in the PLC Setup. Settings operation.
A581 --- FB Communications Automatically stores the FB 0001 to FFFF hex Set the Cleared Written at the
Instruction Response communication instruction response (unit 0.1 s: 0.1 to PLC start of
Monitoring Time monitoring time settings in the PLC 6553.5 s) Settings operation.
Setup. 0000 Hex: 2 s
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A583 00 I/O Memory Backup The flag will be ON when the I/O ON: I/O memory Retained Retained Refreshed A403.14
Error Flag memory is not held at power ON. backup error when the
It will still be ON until the memory area occurred power is
is cleared or the flag is turned OFF OFF: Normal turned ON.
manually.
A616 00 Serial Port 1 (EX) Display the present communication Parity Retained See Refreshed
Communication settings of the serial port 1 (EX). 0: Even Function when power is
Settings Reflect the PLC Setup when power is column. turned ON.
1: Odd
turned ON.
01 Parity Retained See Refreshed
0: Yes Function when power is
column. turned ON.
1: No
02 Stop bit Retained See Refreshed
0: 2 bits Function when power is
column. turned ON.
1: 1 bit
03 Data length Retained See Refreshed
0: 7 bits Function when power is
column. turned ON.
1: 8 bits
04 Start bit Retained See Refreshed
0: 1 bit (fixed) Function when power is
column. turned ON.
08 Communication Retained See Refreshed
to speed Function when power is
11 0 hex: Default (9600) column. turned ON.
3 hex: 1200
4 hex: 2400
5 hex: 4800
6 hex: 9600
7 hex: 19200
8 hex: 38400
9 hex: 57600
A hex: 115200
12 Communication Retained See Refreshed
to mode Function when power is
15 0 hex: Default (Host column. turned ON.
Link)
3 hex: Non-protocol
5 hex: Host Link
7 hex: Serial PLC
Link (Slave)
8 hex: Serial PLC
Link (Master)
9 hex: Modbus-RTU
Easy Master
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A617 00 Serial Port 1/ Display the present communication Parity Retained See Refreshed
Built-in RS232C Port settings of the serial port 1 or built-in 0: Even Function when power is
Communication Set- RS232C port. Reflect the PLC Setup column. turned ON.
tings when power is turned ON. 1: Odd
01 Parity Retained See Refreshed
0: Yes Function when power is
column. turned ON.
1: No
02 Stop bit Retained See Refreshed
0: 2 bits Function when power is
column. turned ON.
1: 1 bit
03 Data length Retained See Refreshed
0: 7 bits Function when power is
column. turned ON.
1: 8 bits
04 Start bit Retained See Refreshed
0: 1 bit (fixed) Function when power is
column. turned ON.
08 Communication Retained See Refreshed
to speed Function when power is
11 0 hex: Default (9600) column. turned ON.
3 hex: 1200
4 hex: 2400
5 hex: 4800
6 hex: 9600
7 hex: 19200
8 hex: 38400
9 hex: 57600
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A618 08 Serial Port 2 Built-in Display the present communication Communication Retained See Refreshed
to RS-485 Port Commu- settings of the serial port 2 or Built-in speed Function when power is
11 nication Settings RS-485 Port. Reflect the PLC Setup column. turned ON.
0 hex: Default (9600)
when power is turned ON.
3 hex: 1200
4 hex: 2400
5 hex: 4800
6 hex: 9600
7 hex: 19200
8 hex: 38400
9 hex: 57600
A hex: 115200
12 Communication Retained See Refreshed
to mode Function when power is
15 0 hex: Default (Host column. turned ON.
Link)
2 hex: NT link(1: N)
3 hex: Non-protocol
5 hex: Host Link
7 hex: Serial PLC
Link (Slave)
8 hex: Serial PLC
Link (Master)
9 hex: Modbus-RTU
Easy Master
D hex: Modbus-RTU
Slave
A638 00 Serial Port 1(EX) Turn ON this bit to send a command Turned ON: Execu- Retained Cleared --- DM Area
Modbus-RTU Easy and receive a response for the serial tion started words for
Master Execution port 1(EX) using the Modbus-RTU ON: Execution in serial
Flag (CP2E easy master function. progress. port
N
-type CPU Unit 1(EX)
Note This bit will be turned OFF auto- OFF: Not executed Mod-
only) or execution
matically by the system when bus-RTU
communications have been com- completed.
Easy
pleted. Master:
D1400 to
D1499
01 Serial Port 1(EX) ON when one command has been ON: Execution nor- Retained Cleared Written after
Modbus-RTU Easy sent and the response received for the mal. reception.
Master Normal End serial port 1(EX) using the Mod- OFF: Execution error
Flag (CP2E bus-RTU easy master function. or still in
N
-type CPU Unit progress.
only)
02 Serial Port 1(EX) ON when an error has occurred in ON: Execution error. Retained Cleared Written when D1452
Modbus-RTU Easy communications for the serial port OFF: Execution error ends.
Master Error End Flag 1(EX) using the Modbus-RTU easy normal or still
(CP2E N
-type master function. in progress.
CPU Unit only) The error code is output to D1452 in
the DM fixed allocation words for Mod-
bus-RTU Easy Master.
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A640 00 Serial Port 1/ Turn ON this bit to send a command Turned ON: Execu- Retained Cleared --- DM Area
Built-in RS-232C Port and receive a response for the serial tion started words for
Modbus-RTU Easy port 1 or built-in RS-232C port using serial
ON: Execution in
Master Execution Bit the Modbus-RTU easy master func- port 1 or
progress.
tion. built-in
OFF: Not executed RS-232C
Note This bit will be turned OFF auto- or execution
port Mod-
matically by the system when completed.
bus-RTU
communications have been com- Easy
pleted. Master:
D1200 to
D1299
01 Serial Port 1/ ON when one command has been ON: Execution nor- Retained Cleared Written after
Built-in RS-232C Port sent and the response received for mal. reception.
Modbus-RTU Easy the serial port 1 or built-in RS-232C OFF: Execution error
Master Normal End port using the Modbus-RTU easy or still in
Flag master function. progress.
02 Serial Port 1/ ON when an error has occurred in ON: Execution error. Retained Cleared Written when D1252
Built-in RS-232C Port communications for the serial port 1 or OFF: Execution error ends.
Modbus-RTU Easy built-in RS-232C port using the Mod- normal or still
Master Error End Flag bus-RTU easy master function. in progress.
The error code is output to D1252 in
the DM fixed allocation words for Mod-
bus-RTU Easy Master.
A641 00 Serial Port 2/ Turn ON this bit to send a command Turned ON: Execu- Retained Cleared --- DM Area
Built-in RS-485 Port and receive a response for the serial tion started words for
Modbus-RTU Master port 2 or built-in RS-485 port using the serial
ON: Execution in
Execution Bit (CP2E Modbus-RTU easy master function. port 2 or
progress.
N30/40/60 or built-in
S
-type CPU Unit Note This bit will be turned OFF auto- OFF: Not executed RS-485
only) matically by the system when or execution
port Mod-
communications have been com- completed.
bus-RTU
pleted.
59)
A720.08 to A720.15: Minutes (00 to
59)
A721.00 to A721.07: Hour (00 to 23)
A721.08 to A721.15: Day of month (01
to 31)
A722.00 to A722.07: Month (01 to 12)
A722.08 to A722.15: Year (00 to 99)
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A723 Power ON Clock Data These words contain the time at which See at left. Retained Retained Written when
to 2 the power was turned ON two times power is
A725 before the startup time stored in words turned ON.
A510 to A511.
A723.00 to A723.07: Seconds (00 to
59)
A723.08 to A723.15: Minutes (00 to
59)
A724.00 to A724.07: Hour (00 to 23)
A724.08 to A724.15: Day of month (01
to 31)
A725.00 to A725.07: Month (01 to 12)
A725.08 to A725.15: Year (00 to 99)
A726 Power ON Clock Data These words contain the time at which See at left. Retained Retained Written when
to 3 the power was turned ON three times power is
A728 before the startup time stored in words turned ON.
A510 to A511.
A726.00 to A726.07: Seconds (00 to
59)
A726.08 to A726.15: Minutes (00 to
59)
A727.00 to A727.07: Hour (00 to 23)
A727.08 to A727.15: Day of month (01
to 31)
A728.00 to A728.07: Month (01 to 12)
A728.08 to A728.15: Year (00 to 99)
A729 Power ON Clock Data These words contain the time at which See at left. Retained Retained Written when
to 4 the power was turned ON four times power is
A731 before the startup time stored in words turned ON.
A510 to A511.
A729.00 to A729.07: Seconds (00 to
59)
A729.08 to A729.15: Minutes (00 to
59)
A730.00 to A730.07: Hour (00 to 23)
A730.08 to A730.15: Day of month (01
to 31)
A731.00 to A731.07: Month (01 to 12)
A731.08 to A731.15: Year (00 to 99)
A732 Power ON Clock Data These words contain the time at which See at left. Retained Retained Written when
to 5 the power was turned ON five times power is
A734 before the startup time stored in words turned ON.
A510 to A511.
A732.00 to A732.07: Seconds (00 to
59)
A732.08 to A732.15: Minutes (00 to
59)
A733.00 to A733.07: Hour (00 to 23)
A733.08 to A733.15: Day of month (01
to 31)
A734.00 to A734.07: Month (01 to 12)
A734.08 to A734.15: Year (00 to 99)
A735 Power ON Clock Data These words contain the time at which See at left. Retained Retained Written when
to 6 the power was turned ON six times power is
A737 before the startup time stored in words turned ON.
A510 to A511.
A735.00 to A735.07: Seconds (00 to
59)
A735.08 to A735.15: Minutes (00 to
59)
A736.00 to A736.07: Hour (00 to 23)
A736.08 to A736.15: Day of month (01
to 31)
A737.00 to A737.07: Month (01 to 12)
A737.08 to A737.15: Year (00 to 99)
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A738 Power ON Clock Data These words contain the time at which See at left. Retained Retained Written when
to 7 the power was turned ON seven times power is
A740 before the startup time stored in words turned ON.
A510 to A511.
A738.00 to A738.07: Seconds (00 to
59)
A738.08 to A738.15: Minutes (00 to
59)
A739.00 to A739.07: Hour (00 to 23)
A739.08 to A739.15: Day of month (01
to 31)
A740.00 to A740.07: Month (01 to 12)
A740.08 to A740.15: Year (00 to 99)
A741 Power ON Clock Data These words contain the time at which See at left. Retained Retained Written when
to 8 the power was turned ON eight times power is
A743 before the startup time stored in words turned ON.
A510 to A511.
A741.00 to A741.07: Seconds (00 to
59)
A741.08 to A741.15: Minutes (00 to
59)
A742.00 to A742.07: Hour (00 to 23)
A742.08 to A742.15: Day of month (01
to 31)
A743.00 to A743.07: Month (01 to 12)
A743.08 to A743.15: Year (00 to 99)
A744 Power ON Clock Data These words contain the time at which See at left. Retained Retained Written when
to 9 the power was turned ON nine times power is
A746 before the startup time stored in words turned ON.
A510 to A511.
Address Status
Related
after Status at Write
Name Function Settings flags,
Words Bits mode startup timing
settings
change
A751 11 DM Backup Restore ON when DM backup data could not ON: Restore failed Retained Cleared Written when
Failed Flag be restored normally. If this flag turns OFF: Execution fail to restore.
ON, data will not be restored from the normal
built-in Flash Memory to RAM.
14 DM Backup Save Flag ON when A751.15 is turned ON to ON: Saving Retained Cleared Written when
start the saving operation. This flag OFF: Not saving save starts
stays ON while data is being saved
and turns OFF when finished.
15 DM Backup Save Saving the specified words from the ON: Start saving. Retained Cleared ---
Start Bit DM Area in RAM to the built-in Flash OFF: Execution
Memory is started when this bit is normal or still
turned ON. in progress.
This bit will not turn OFF automatically
even when saving the data has been
completed.
If this bit is turned ON and OFF while
the DM Backup Save Flag (A751.14)
is ON, it will be ignored and the data
will not be backed up again.
The I/O response time is the time it takes from when an input turns ON, the data is recognized by the
CPU Unit, and the ladder programs are executed, up to the time for the result to be output to an output
terminal.
The length of the I/O response time depends on the following conditions.
• Timing of Input Bit turning ON.
• The cycle time
Note The input and output ON delays depend on the type of terminals used on the CPU Unit or the model number
of the Unit being used.
:I/O refresh
Inputs:
Input ON delay
(Status read to
the CPU Unit.):
Cycle time Cycle time
Instruction Instruction
Minimum I/O
Response Time
:I/O refresh
Inputs:
Input ON delay
(Status read to
the CPU Unit.):
Cycle time Cycle time
Instruction Instruction Instruction
execution execution execution
Output ON delay
Outputs:
z Calculation Example
Conditions:
Input ON delay: 1 ms (normal input 0.08 to 0.11 with input constant set to 0 ms)
Output ON delay: 0.1 ms (transistor output)
Cycle time: 20 ms
Minimum I/O response time = 1 ms + 20 ms + 0.1 ms = 21.1 ms
Maximum I/O response time = 1 ms + (20 ms × 2) + 0.1 ms = 41.1 ms
z PLC Setup
Name Description Setting Default
Input Constant Settings Input Constants 00 hex: 8 ms 00 hex (8 ms)
10 hex: No filter (0 ms)
12 hex: 1 ms
13 hex: 2 ms
14 hex: 4 ms
15 hex: 8 ms
16 hex: 16 ms
17 hex: 32 ms
Note The input constants of CP1W-40EDR/EDT/EDT1 are always 16ms regardless of the settings.
* The wait time occurs when there is competition with other interrupts. As a guideline, the wait time will be 0 to
3 ms.
Note Input interrupt tasks can be executed during execution of the user program, I/O refresh, peripheral servicing,
or overseeing. (Even if an instruction is being executed, execution of the instruction will be stopped to exe-
cute the interrupt task.)
The interrupt response time is not affected by the above processing operations during which the interrupt
inputs turns ON.
Input interrupts, however, are not executed during execution of other interrupt tasks even if the input interrupt
conditions are satisfied. Instead, the input interrupts are executed after the current interrupt task has com-
pleted execution and the software interrupt response time has elapsed.
Inputs:
Interrupt task
execution:
Interrupt response Ladder program Return time
time for input execution time from input
interrupt task interrupt task
Cyclic task execution (main
program):
App
The time from when execution of the input interrupt task is completed until
execution of the cyclic task is resumed is 11 μs.
A-3-2 Interrupt Response Time
Internal timer:
Number of participat- The number of polled units to which links have been established within the
ing polled unit nodes maximum unit number set in the polling unit.
Number of non- The number of polled units not participating in the links within the maximum unit
participating polled number set in the polling unit.
unit nodes
Communications cycle Polled unit communications time × Number of participating polled unit nodes +
time (ms) 10 × Number of non-participating polled unit nodes + 20 × Number of polled unit
nodes
Polled unit • Communications time set to Standard:
communications 0.4 + 0.286 × [(No. of polled units + 1) × No. of link words × 2 + 12]
time (ms) • Communications time set to Fast:
0.4 + 0.0955 × [(No. of polled units + 1) × No. of link words × 2 + 12]
Instruction
execution Start time
Pulse output
*1 The wait time occurs when there is competition with other interrupts. As a guideline, the wait time will be 0 to
3 ms.
*2 When the frequency of pulse output is lower than 250Hz, 1 control cycle will be equal to the time of pulse output.
Example: The change response time of 100Hz pulse output is above 1 control cycle (10ms) and below 2 control
cycles (20ms).
10ms
Time
0 0 to 10 ms max.
(0 to 2ms max. for
DC power supply)
Momentary power
interruption not detected
Operation continues
Supply
voltage 10 ms min.
(2ms min. for DC power supply)
Supply
voltage
Operation will continue or stop
depending on whether a
momentary power interruption
is detected.
z Automatic Recovery
Operation is automatically restarted when the power supply voltage is restored.
Program execution
Cyclic task or interrupt task Stop
status
Power OFF Detection Time: The time from when the power supply voltage drops to 85% or less the rated voltage until the
power interruption is detected.
Power Holding Time: The maximum amount of time (fixed at 1 ms) that 5 V will be held internally after power shuts
OFF.
z Description of Operation
The power interruption will be detected if the 100 to 240 VAC power supply falls below 85% of the
an external NC contact input is used or the ladder program counts the number of ON to OFF transitions,
a malfunction may occur if the external power supply turns OFF.
Response Time
Program execution
status Cyclic task or interrupt task
100 VAC
External power
supply input
L1 L2 COM 0.00 0.01
CP2E
• Ladder Program
Emergency
stop output
PLC memory addresses are set in Index Registers (IR00 to IR15) to indirectly address I/O memory.
Normally, use the MOVE TO REGISTER (MOVR(560)) and MOVE TIMER/COUNTER PV TO REGIS-
TER (MOVRW(561)) instructions to set PLC memory addresses into the Index Registers.
Some instructions, such as FIND MAXIMUM (MAX(182)), and FIND MINIMUM (MIN(183)), output the
results of processing to an Index Register to indicate an PLC memory address.
There are also instructions for which Index Registers can be directly designated to use the PLC mem-
ory addresses stored in them by other instructions. These instructions include DOUBLE MOVE
(MOVL(498)), some symbol comparison instructions (=L, <>L, <L, >L, <=L, and >=L), DOUBLE COM-
PARE (CMPL(060)), DOUBLE INCREMENT BINARY (++L(591)), DOUBLE DECREMENT BINARY
(––L(593)), DOUBLE SIGNED BINARY ADD WITHOUT CARRY (+L(401)), DOUBLE SIGNED BINARY
SUBTRACT WITHOUT CARRY (–L(411)).
The PLC memory addresses all are continuous and the user must be aware of the order and bound-
aries of the memory areas. As reference, the PLC memory addresses are provided in a table at the end
of this appendix.
Note Directly setting PLC memory addresses in the program should be avoided whenever possible. If PLC mem-
ory addresses are set in the program, the program will be less compatible with new CPU Unit models or CPU
Units for which changes have been made to the layout of the memory.
Memory Configuration
There are two classifications of the RAM memory in a CP-series CPU Unit.
Parameter Areas: These areas contain CPU Unit system setting data, such as the PLC Setup, CPU
Bus Unit Setups, etc. An illegal access error will occur if an attempt is made to access any of the
parameter areas from an instruction in the user program.
I/O Memory Areas: These are the areas that can be specified as operands in the instructions in user
App
Memory Map
PLC memory address
Classification User addresses Area
(hex)
I/O memory 0 to 0174F --- Reserved for system
areas 01750 to 0176F T00 to T31 Timer Completion Flags
01770 to 0178F C00 to C31 Counter Completion Flags
01790 to 017BF --- Reserved for system
017C0 to 0197F A0 to A447 Read-only Auxiliary Area
01980 to 01B7F A448 to A959 Read/Write Auxiliary Area
01B80 to 01CA1 CIO 0 to 289 CIO Area
01CA2 to 01CBF --- Reserved for system
01CC0 to 01D3F H0 to H127 Holding Area
01D40 to 022BF --- Reserved for system
022C0 to 0233F W0 to W127 Work Area
02340 to 0253F T000 to T511 Timer PVs
02540 to 0273F C000 to C511 Counter PVs
E
-type CPU Unit: E
-type CPU Unit: DM Area
02740 to 0373F D0 to D4095
S
-type CPU Unit: S
-type CPU Unit:
02740 to 0473F D0 to D8191
N
-type CPU Unit: N
-type CPU Unit:
02740 to 0673F D0 to D16383
E
-type CPU Unit: --- Reserved for system
03740 to 0673F
S
-type CPU Unit:
04740 to 0673F
Note Do not access areas reserved for the system.
CLOSED
ACTIVE OPEN
snd SYN
Passive OPEN CLOSE
LISTEN
CLOSE
rcv SYN
SEND
snd SYN, ACK
snd SYN
Socket recepiton
buffer
(3×4096 bytes)
IP packet input
FINS packet input
buffer
buffer
(8×608 bytes))
(18,432 bytes)
Ethernet FINS event buffer FINS/TCP
(IN + Out: 8×1024 Communications
Event recepiton buffer controller
bytes) (4×4096 bytes)
IP packet output
buffer
(4×1600 bytes)
Socket send
buffer
(3×1024 bytes)
Revision code
OMRON ASIA PACIFIC PTE. LTD. OMRON (CHINA) CO., LTD. © OMRON Corporation 2019 All Rights Reserved.
No. 438A Alexandra Road # 05-05/08 (Lobby 2), Room 2211, Bank of China Tower, In the interest of product improvement,
Alexandra Technopark, 200 Yin Cheng Zhong Road, specifications are subject to change without notice.
Singapore 119967 PuDong New Area, Shanghai, 200120, China
Tel: (65) 6835-3011/Fax: (65) 6835-2711 Tel: (86) 21-5037-2222/Fax: (86) 21-5037-2200 Cat. No. W614-E1-01 0919