Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
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
CS/CJ/CP Series
CS1D-CPUP
CS-series Basic I/O Units CJ-series Basic I/O Units CPM1A-series Expansion Units
* Expansion I/O Units and Expansion Units cannot be connected to CP1E CPU Units with 20 I/O Points.
This Manual
CP1E Hardware Users CP1E Software Users CP1E Instructions Reference
Manual(Cat. No. W479) Manual(Cat. No. W480) 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
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
Maintenance and CX-Programmer
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:
Additional Information
Additional information to increase understanding or make operation easier.
1 10
2 11
Overview and Overview of Built-in Functions
1 SYSMAC Features 10 and Allocations
3 12
Internal Memory in
2 the CPU Unit 11 Quick-response Inputs
4 13
CPU Unit
4 Initialization 13 High-speed Counters 6 15
Understanding 7 16
5 Programming 14 Pulse Outputs
8 17
6 I/O Memory 15 PWM Outputs
9 18
Serial
7 File Operations 16 Communications
9 PLC Setup 18
Section 12 Interrupts
12-1 Interrupts ................................................................................................................................ 12-2
12-1-1 CP1E Interrupts ........................................................................................................................ 12-2
12-2 Input Interrupts ...................................................................................................................... 12-3
12-2-1 Overview................................................................................................................................... 12-3
12-2-2 Flow of Operation ..................................................................................................................... 12-4
12-2-3 Application Example for Input Interrupts................................................................................... 12-8
12-3 Scheduled Interrupts........................................................................................................... 12-11
12-3-1 Overview................................................................................................................................. 12-11
Section A Appendices
A-1 Summary of Instructions ........................................................................................................A-2
A-2 .................................................................................................................................................A-12
A-3 CP1E CPU Unit Instruction Execution Times and Number of Steps ................................A-13
A-4 Ladder Programming Example ...................................................A-25
A-4-1 Shutter Control System .............................................................................................................A-25
A-5 Comparison with the CP1L ...................................................................................................A-29
A-5-1 Differences between CP1E and CP1L ......................................................................................A-29
LIMITATIONS OF LIABILITY
OMRON SHALL NOT BE RESPONSIBLE FOR SPECIAL, INDIRECT, OR CONSEQUENTIAL DAMAGES,
LOSS OF PROFITS OR COMMERCIAL LOSS IN ANY WAY CONNECTED WITH THE PRODUCTS,
WHETHER SUCH CLAIM IS BASED ON CONTRACT, WARRANTY, NEGLIGENCE, OR STRICT
LIABILITY.
In no event shall the responsibility of OMRON for any act exceed the individual price of the product on which
liability is asserted.
At the customers request, OMRON will provide applicable third party certification documents identifying
ratings and limitations of use that apply to the products. This information by itself is not sufficient for a
complete determination of the suitability of the products in combination with the end product, machine,
system, or other application or use.
The following are some examples of applications for which particular attention must be given. This is not
intended to be an exhaustive list of all possible uses of the products, nor is it intended to imply that the uses
listed may be suitable for the products:
Outdoor use, uses involving potential chemical contamination or electrical interference, or conditions or
uses not described in this manual.
Nuclear energy control systems, combustion systems, railroad systems, aviation systems, medical
equipment, amusement machines, vehicles, safety equipment, and installations subject to separate
industry or government regulations.
Systems, machines, and equipment that could present a risk to life or property.
Please know and observe all prohibitions of use applicable to the products.
NEVER USE THE PRODUCTS FOR AN APPLICATION INVOLVING SERIOUS RISK TO LIFE OR
PROPERTY WITHOUT ENSURING THAT THE SYSTEM AS A WHOLE HAS BEEN DESIGNED TO
ADDRESS THE RISKS, AND THAT THE OMRON PRODUCTS ARE PROPERLY RATED AND INSTALLED
FOR THE INTENDED USE WITHIN THE OVERALL EQUIPMENT OR SYSTEM.
PROGRAMMABLE PRODUCTS
OMRON shall not be responsible for the users programming of a programmable product, or any
consequence thereof.
It is our practice to change model numbers when published ratings or features are changed, or when
significant construction changes are made. However, some specifications of the products may be changed
without any notice. When in doubt, special model numbers may be assigned to fix or establish key
specifications for your application on your request. Please consult with your OMRON representative at any
time to confirm actual specifications of purchased products.
PERFORMANCE DATA
Performance data given in this manual is provided as a guide for the user in determining suitability and does
not constitute a warranty. It may represent the result of OMRONs test conditions, and the users must
correlate it to actual application requirements. Actual performance is subject to the OMRON Warranty and
Limitations of Liability.
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.
Do not attempt to take any Unit apart while the power is being supplied.
Doing so may result in electric shock.
Do not touch any of the terminals or terminal blocks while the power is being supplied.
Doing so may result in electric shock.
Provide safety measures in external circuits (i.e., not in the Programmable Control-
ler), including the following items, to ensure safety in the system if an abnormality
occurs due to malfunction of the PLC or another external factor affecting the PLC
operation. Not doing so may result in serious accidents.
Emergency stop circuits, interlock circuits, limit circuits, and similar safety mea-
sures must be provided in external control circuits.
The PLC will turn OFF all outputs when its self-diagnosis function detects any error
or when a severe failure alarm (FALS) instruction is executed. As a countermeasure
for such errors, external safety measures must be provided to ensure safety in the
system.
The PLC outputs may remain ON or OFF due to deposition or burning of the output
relays or destruction of the output transistors. As a countermeasure for such prob-
lems, external safety measures must be provided to ensure safety in the system.
When the 24-VDC output (service power supply to the PLC) is overloaded or short-
circuited, the voltage may drop and result in the outputs being turned OFF. As a
countermeasure for such problems, external safety measures must be provided to
ensure safety in the system.
Fail-safe measures must be taken by the customer to ensure safety in the event of
incorrect, missing, or abnormal signals caused by broken signal lines, momentary
power interruptions, or other causes. Serious accidents may result from abnormal
operation if proper measures are not provided.
Do not apply the voltage/current outside the specified range to this unit. It may cause
a malfunction or fire.
If the power supply is interrupted for longer than the backup time of the built-in capaci-
tor, the following areas will be cleared to all zeros and the Auxiliary Area (A) will be
cleared to its default values.
DM Area (D), Holding Area (H), Counter Completion Flags (C), and Counter
Present Values (C)
For an N-type CPU Unit, the internal clock will also be cleared.
These areas are backed up by the capacitor that is built into the CPU Unit. The backup
time of the capacitor built into the CP1E CPU Unit is 50 hours for an E-type CPU Unit
and 40 hours for an N-type CPU Unit at 25C.
Create a system and write the ladder programs so that problems will not occur in the
system if the data in these areas is cleared. Always mount a CP1W-BAT01 Battery
(sold separately) in an N-type CPU Unit. (This Battery cannot be mounted in an E-type
CPU Unit.)
Data may be lost and abnormal operation may occur if a power interruption lasts too
long, possibly resulting in serious accidents.
Backup time of built-in capacitor
50 hours
CP1E-ECPU Unit
40 hours
CP1E-NCPU Unit
25 hours
20 hours
9 hours
7 hours
The data in the user programs, parameter area, and the backed up words of the DM
Area is backed up in built-in backup memory (EEPROM) and will not be lost even if the
backup time of the built-in capacitor is exceeded.
The data backed up in the CP1E CPU Units and the backup methods are listed in the
following table.
Holding Areas Data backup method
DM Area (D) Backed up by built-in capacitor.
Holding Area (H) (Data is cleared or initialized in these areas if a power
Counter Completion Flags/PVs (C) interruption lasts longer than the backup time of the
Auxiliary Area (A) built-in capacitor.)
A509.15
SET Turn ON the Output
I/O Memory Corrupted Flag A500.15 OFF Bit.
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.
Tighten the screws on the terminal block of the AC power supply section to the torque
specified in the users manual. The loose screws may result in burning or malfunction.
Do not touch the power supply section when power is being supplied or immediately
after the power supply is turned OFF. The power supply section and I/O terminal
blocks will be hot and you may be burned.
Pay careful attention to the polarities (+/-) when wiring the DC power supply. A wrong
connection may cause malfunction of the system.
z Power Supply
Always use the power supply voltages specified in the users manuals. An incorrect voltage may
result in malfunction or burning.
Take appropriate measures to ensure that the specified power with the rated voltage and fre-
quency is supplied. Be particularly careful in places where the power supply is unstable. An incor-
rect power supply may result in malfunction.
Double-check all wiring and switch settings before turning ON the power supply. Incorrect wiring
may result in burning.
Always turn OFF the power supply to the PLC before attempting any of the following. Not turning
OFF the power supply may result in malfunction or electric shock.
Mounting or dismounting Expansion Units or Expansion I/O Units
Mounting or dismounting Option Boards
Setting rotary switches
Connecting cables or wiring the system
Connecting or disconnecting the connectors
z Installation
Before touching a Unit, be sure to first touch a grounded metallic object in order to discharge any
static build-up. Not doing so may result in malfunction or damage.
Be sure that the terminal blocks, connectors, Option Boards, and other items with locking devices
are properly locked into place. Improper locking may result in malfunction.
z Wiring
Wire correctly according to specified procedures in this manual.
AWG22-18 (0.32~0.82mm2)Always use the following size wire when connecting I/O terminals:
AWG22 to AWG18 (0.32 to 0.82 mm2).
Install external breakers and take other safety measures against short-circuiting in external wiring.
Insufficient safety measures against short-circuiting may result in burning.
Always connect to a ground of 100 or less when installing the Units. Not connecting to a ground
of 100 or less may result in electric shock.
Leave the label attached to the top of the Unit when wiring to prevent the entry of foreign matter.
Removing the label may result in malfunction if foreign matter enters the Unit.
Remove the label after the completion of wiring to ensure proper heat dissipation. Leaving the
label attached may result in malfunction.
Use crimp terminals for wiring. Do not connect bare stranded wires directly to terminals. Connec-
tion of bare stranded wires may result in burning.
Do not apply voltages to the input terminals in excess of the rated input voltage. Excess voltages
may result in burning.
Do not apply voltages or connect loads to the output terminals in excess of the maximum switch-
ing capacity. Excess voltage or loads may result in burning.
Disconnect the functional ground terminal when performing withstand voltage tests. Not discon-
necting the functional ground terminal may result in burning.
z Handling
Memory Status after Power Interrupts
A Battery cannot be installed in CP1E E-type CPU Units (basic models). The Battery is sold sepa-
rately for CP1E N-type CPU Units (application models).
Data in the following four areas will be cleared if power is interrupted for more than 50 hours (at
25C) for an E-type CPU Unit and for more than 40 hours (at 25C) for an N-type CPU Unit.
DM Area (D) (excluding backed up DM Area words)
Holding Area (H)
Counter PVs and Completion Flags (C)
Auxiliary Area (A)
Consider the possibility of data being cleared due to power interrupts, and observe the following pre-
cautions.
Write the ladder programs to set any data required for operation when starting operation.
P_First_Cycle
Set any data
required for
operation at the start
First Cycle Flag (A200.11)
of operation using
the MOV, XFER, or
other instructions.
Include programming to back up specified parts of the DM Area to built-in EEPROM during or
after operation. (This is called the DM backup function.)
Example)
Execution condition
SET Backs up D0 to D499
to built-in EEPROM.
A752.00
RST
A752.00
Refer to 3-2 Memory Backup in the CP1E Software Users Manual (Cat. No. W480) for other
processing information.
Check the ladder program for proper execution before actually running it on the Unit. Not checking
the program may result in an unexpected operation.
The ladder program and parameter area data in the CP1E CPU Units are backed up in the backup
memory. The BKUP indicator will light on the front of the CPU Unit when the backup operation 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.
UL standards require that only an experienced engineer can replace the battery. Make sure that
an experienced engineer is in charge of battery replacement. Follow the procedure for battery
replacement given in this manual.
z External Circuits
Always configure the external circuits to turn ON power to the PLC before turning ON power to the
control system. If the PLC power supply is turned ON after the control power supply, temporary
errors may result in control system signals because the output terminals on DC Output Units and
other Units will momentarily turn ON when power is turned ON to the PLC.
Fail-safe measures must be taken by the customer to ensure safety in the event that outputs from
output terminals remain ON as a result of internal circuit failures, which can occur in relays, tran-
sistors, and other elements.
If the I/O Hold Bit is turned ON, the outputs from the PLC will not be turned OFF and will maintain
their previous status when the PLC is switched from RUN or MONITOR mode to PROGRAM
mode. Make sure that the external loads will not produce dangerous conditions when this occurs.
(When operation stops for a fatal error, including those produced with the FALS instruction, all out-
puts from PLC will be turned OFF and only the internal output status in the CPU Unit will be main-
tained.)
Conformance to EC Directives
Applicable Directives
EMC Directives
Low Voltage Directive
Concepts
z EMC Directives
OMRON devices are electrical components that are designed to be built into equipment and manu-
facturing systems. OMRON devices that comply with EMC Directives also conform to the related
EMC standards (see note) so that they can be more easily built into other devices or the overall
machine. Whether the products conform to the standards in the system used by the customer, how-
ever, must be checked by the customer.
EMC-related performance of the OMRON devices that comply with EC Directives will vary depend-
ing on the configuration, wiring, and other conditions of the equipment or control panel on which the
OMRON devices are installed. The customer must, therefore, perform the final check to confirm that
devices and the overall machine conform to EMC standards.
Note The applicable EMC (Electromagnetic Compatibility) standard is EN61131-2.
z Conformance to EC Directives
The CP1E PLCs comply with EC Directives. To ensure that the machine or device in which the
CP1E PLC is used complies with EC Directives, the PLC must be installed as follows:
1 The CP-series PLC must be installed within a control panel.
2 CP-series PLCs complying with EC Directives also conform to EN61131-2. Radiated emission
characteristics (10-m regulations) may vary depending on the configuration of the control panel
used, other devices connected to the control panel, wiring, and other conditions. You must there-
fore confirm that the overall machine or equipment complies with EC Directives.
3 A SYSMAC CP-series PLC is a class A product (for an industrial environment). In residential
areas it may cause radio interference, in which case the user may be required to take adequate
measures to reduce interference.
CP1E CPU Unit (An N-type CPU Unit with 40 I/O Points is shown here.)
CX-Programmer for CPIE
USB port CP1W-BAT01 Battery (sold separately) Power supply and input terminals
(Can be mounted only to N-type CPU Units.)
Expansion Units (Can be mounted to CPU Units with 30 or 40 I/O points.)
Commercially NC
COM
00
01
02
03
04
05
06
07
08
09
10
11
NC
COM
00
01
02
03
04
05
06
07
08
09
10
11
NC
COM
00
01
02
03
04
05
06
07
08
09
10
11
available USB IN CH
CH 00 01 02 03 04 05 06 07
IN CH
CH 00 01 02 03 04 05 06 07
IN CH
CH 00 01 02 03 04 05 06 07
cable 08 09 10 11 08 09 10 11 08 09 10 11
Analog adjuster
1-1-2 Features
The CX-Programmer for CP1E is connected using a commercially available USB cable between the
computers USB port and the built-in peripheral USB port of the CP1E.
Quick-response Inputs
By setting a built-in input to quick-response operation, inputs with signal widths as small as 50 s can
be read with certainty regardless of the cycle time.
Up to six quick-response inputs can be used.
Quick-response input
Cycle time
Built-in input
I/O refresh
Cycle time
Can read ON signals
shorter than this time.
Note The user setting in the PLC Setup determines if each input is a quick-response input, normal input, interrupt
input, or high-speed counter input.
Input Interrupts
An interrupt task can be started when a built-in input turns ON or turns OFF (supported only in direct
mode).
Up to six interrupt inputs can be used.
Interrupt input
Built-in input
Interrupt task
Ladder program
Interrupt occurs
END
Note The user setting in the PLC Setup determines if each input is a quick-response input, normal input, interrupt
input, or high-speed counter input.
Built-in Inputs
(Functions can be assigned.)
Note The user setting in the PLC Setup determines if each input is a quick-response input, normal
input, interrupt input, or high-speed counter input
High-speed counters can be used for high-speed processing, using either target value comparison or
range comparison with the counters PV to create interrupts.
An interrupt task can be started when the count reaches a specified value or falls within a specified
range.
High-speed counter input frequency (speed) can be measured.
The input pulse frequency can be measured using the PRV instruction (counter 0 only).
1-1-2 Features
Stepping Motor
Servomotor
16 Built-in Outputs
(Functions can be assigned.) (See note.)
Note The instruction used to control each output determines whether it is used as a normal output, pulse output,
or PWM output.
Positioning is possible with Trapezoidal Acceleration and Deceleration
Trapezoidal acceleration and deceleration can be used for positioning using the PULSE OUTPUT
(PLS2) instruction.
Jogging Can Be Performed
Jogging can be performed by executing the SPED or ACC instruction.
Origin Searches and Origin Returns Can Be Performed Using the ORIGIN SEARCH Instruction
An accurate origin search combining all I/O signals can be executed with a single instruction. It is
also possible to move directly to an established origin using the ORIGIN SEARCH (ORG) instruction.
Analog Settings
Phillips screwdriver
Analog adjuster
Ladder program
Turning the adjuster on the CP1E changes the value in
A642 to between 0000 and 0255 (00 and FF hex).
CNTX
A642 CH
Example: The production quantity could be changed by
changing the counter set value from 100 to 150.
1-1-2 Features
RS-232C
RS-422A
Built-in RS-232C Modbus-RTU Easy Master Function
port
Example: Inverter
CP1E, CP1H
CP1L, CJ1M
2. Wiring
Wire the power supply, I/O, and communications.
Refer to Section 5 Installation and Wiring in the CP1E Hardware Users Manual (Cat. No. W479).
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 8 Backup Operations in the CP1E Hardware Users Manual (Cat. No. W479).
5. Software Setup
Make the PLC software settings.
With a CP1E CPU Unit, all you have to do is set the PLC Setup.
Refer to Section 4 Initial Settings for CPU Unit and Section 9 PLC Setup in the CP1E CPU Unit Software
Users Manual (Cat. No. W480).
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 10 Overview and Allocation of Built-in Functions and 17-8 Debugging in the CP1E CPU
Unit Software Users Manual (Cat. No. W480).
As shown above, the initial settings of PLC functions, such as interrupts and high-speed
counters, can be set using software.
C 1 3 5 7 9 11
0 2 4 6 8 10
Additional Information
For SYSMAC PLCs, the PLC Setup is used for initial settings of parameters that need to be
changed during operation. Programming instructions are used to set parameters that need to be
changed during operation.
Power supply ON
Operation CP1E
Programs
Additional Information
With a SYSMAC PLCs, turn ON the PLC power supply to enable the initial settings, such as
those in the PLC Setup. When the power supply is turned ON, operation will begin. Change the
operating mode to PROGRAM mode to transfer programs and the PLC Setup from the CX-Pro-
grammer for CP1E.
0CH 100CH
Inputs Outputs
1CH 101CH
As shown above, input bit addresses start at CIO 0 (for terminal block 0CH) and output bit
addresses start at CIO 100 (for terminal block 100CH). You can thus differentiate input bits
and output bits by their addresses.
z Inputs and outputs can be distinguished by the notation used by the CX-
Programmer for CP1E.
Addresses that start with I are for input bits. Example: I0.00
Addresses that start with Q are for output bits. Example: Q100.00
I0.00 Q100.00
X0.00 Y100.00
Bit number
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
W0
W1
Word Address W2
.
.
.
W2 W0 . 00
Bit number (00 to 15)
As shown above, it is possible to specify either words or bits in the same area of the
memory map for bit-addressable areas.
Additional Information
Bits are specified by placing a period after the word address and indicating the bit number
from 00 to 15.
PRV
The high-speed
0
counter frequency or D100 #FFFF 16 Stored in
D0 present value is read to hexadecimal format
D100 and D101 D101 #7FFF
D100
Additional Information
Numbers without a symbol are not treated as constants except for operands that specify num-
bers.
Example: 10 is not the constant 10. Instead it indicates word CIO 10.
Example:
Example: HEX ASCII TO HEX instruction CMP Comparison instruction
S Data to be converted S1 Comparison data 1
Instruction Equal
error C when S2 Comparison data 2
occurs compared
D
As shown above, Condition Flags show the results of instruction execution and are
shared by all instructions.
Additional Information
Instruction execution results are given by the Condition Flags, which are shared by all tasks.
Specifies the
first address I/O memory
First address of Example:
control data D100
D100
Parameters
D101 Control data
Used as
parameters
=
Configures the
instructions function
Example:
Additional Information
With SYSMAC PLCs, one instruction can be used for different functions by indirectly accessing
I/O memory using the instruction parameters as control data.
As shown in the following diagram, the internal memory in the CPU Unit consists of built-in RAM and
built-in EEPROM. The built-in RAM is used as execution memory and the built-in EEPROM is used as
backup memory.
Built-in RAM
The built-in RAM is the execution memory for the CPU Unit.
The user programs, PLC Setup, and I/O memory are stored in the built-in RAM.
The data is backed up by a built-in capacitor.
The backup time of the built-in capacitor is 50 hours for an E-type CPU Unit and 40 hours for an N-type
CPU Unit at 25C.
If a CP1W-BAT01 Battery (sold separately) is mounted to an N-type CPU Unit, the data is backed up by
the Battery.
The user programs and parameters are backed up to the built-in EEPROM, so they are not lost.
50 hours
CP1E-E CPU Unit
40 hours
CP1E-N CPU Unit
25 hours
20 hours
9 hours
7 hours
Built-in Built-in
Memory area and stored data Details
RAM EEPROM
User Program Area The User Program Area stores the object code for executing Stored Stored
the user program that was created using the CX-Programmer
for CP1E.
Parameter Area The Parameter Area stores the initial settings for the PLC. Stored Stored
PLC Names Not supported.
Setting PLC Setup Various initial settings are made in the PLC Setup using soft-
ware switches.
Refer to Section 9 PLC Setup.
I/O Tables Not supported.
Routing Tables
CPU Bus Unit Setup
I/O Memory Areas The I/O Memory Areas are used for reading and writing from Stored Not stored
the user programs.It is partitioned into the following regions
according to purpose.
Regions where data is cleared when power to the CPU Unit
is reset, and regions where data is retained.
Regions where data are exchanged with other Units, and
regions that are used internally.
DM Area words backed up to EEPROM using control bits in Stored Stored
the Auxiliary Area.
Source Code and Comment Area Not Stored
Source Code Not supported. stored
Symbol Table The symbol table contains symbols created using the CX-Pro-
grammer for CP1E (symbol names, addresses, and I/O com-
ments).
Comments Comments are created using the CX-Programmer for CP1E
and include annotations and row comments.
Program Index The program index provides information on program sections
created using the CX-Programmer for CP1E, as well as pro-
gram comments.
Network Symbols (Tags) Not supported. Note Stored
stored
User programs
User programs 2
Symbol Table
Symbol Table
PLC Setup
Comments and
program index
PLC Memory
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. The cycle time can be determined
beforehand for SYSMAC PLCs. Refer to 19-2 Computing the Cycle Time for how to calculate the
cycle time.
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.
Ladder Programs
User ladder programs are saved in memory.
I/O Memory
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.
RUN mode: This is the mode in which the ladder program is executed. Some operations are dis-
abled during this mode. It is the default startup mode.
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 indicator on
Operating mode Remarks
CPU Unit
PROGRAM mode
Not lit
RUN or MONITOR mode Use the CX-Programmer to see if the mode is
RUN or MONITOR mode.
Lit (green)
Offline Online
Status Bar
The operating mode is displayed here. The average cycle time will be displayed if
the CPU Unit is in RUN or MONITOR mode.
Operation
All outputs are turned OFF
Method
The load OFF function is executed by turning ON the Output OFF Bit (A500.15) in the Auxiliary Area
using an instruction in a ladder program or the CX-Programmer.
Applications
z The INH indicator on the front of the CPU Unit will be lit when all outputs are
10ms
Time
0
0 to 10 ms max.
Momentary power
interruption not detected
Operation continues
Supply
voltage
10ms
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
minimum rated voltage for the power OFF detection time (10 ms minimum, not fixed).
The CPU reset signal will turn ON and the CPU Unit will be reset immediately.
Program execution
status Cyclic task or interrupt task
100 VAC
External power
supply input
L1 L2 COM 0.00 0.01
CP1E
Ladder Program
Emergency
stop output
PLC Setup
PLC Setup
DM Area DM Area
z Restoring Memory
Ladder programs and PLC Setup are automatically transferred from the built-in EEPROM backup
memory to the RAM when power is turned ON again or at startup.
50 hours
40 hours
CP1E N-type CPU Unit
without a battery
25 hours
20 hours
9 hours
7 hours
The following areas are cleared when power is interrupted for longer than the I/O memory backup
times given above.
DM Area (D) (excluding words backed up to the EEPROM using the DM backup function)
Holding Area (H)
Counter PVs and Completion Flags (C)
Auxiliary Area (A) (including clock data for N-type CPU Units)
Additional Information
The following words in the Auxiliary Area are cleared to zero. Others are cleared to default val-
ues.
Caution
Write the ladder programs and construct the system so that problems will not occur even if the
DM Area, Holding Aea, Counter PVs, and Counter Completion Flags (C) are cleared to zero and
the Auxiliary Area is cleared to default values when a power interruption continues for longer
than 50 hours for an E-type CPU Unit or 40 hours for an N-type CPU Unit (at 25C).Always
mount a CP1W-BAT01 Battery (sold separately) to an N-type CPU Unit. (This Battery cannot be
mounted to an E-type CPU Unit.)
Data may be lost and abnormal operation may occur if a power interruption lasts too long, possi-
bly resulting in serious accidents.
Power interruption
longer than I/O memory Retained when power supply
backup time is turned ON or there is a
momentary interruption.
E-type: Power interruption longer than 50 hours*1
Power supply N-type: Power interruption longer than 40 hours*1
*1: At 25C.
Cleared
DM Area (D)*
Additional Information
Ladder programs and PLC Setup are automatically backed up to backup memory. Words in the
DM Area backed up to the backup memory using Auxiliary Area bits are also backed up to the
backup memory.
A509.15
FAL User-defined
non-fatal error
I/O Memory Corruption Flag 10
#0000
Power interruption
longer than I/O memory
backup time Turned OFF by user.
A509.15 ON
I/O Memory Previous Corruption
Flag (Held at startup.) OFF
A509.15
2 Make the necessary settings in DM Area words and Holding Area words using the CX-Program-
mer after checking that the load OFF function is being executed (front panel INH Indicator).
3 Use the CX-Programmer to turn OFF A509.15 (I/O Memory Previous Corruption Flag (held at
startup)).
Additional Information
To detect the clock stopping as well as I/O memory lost, use A509.13 (I/O Memory Previous Cor-
ruption or Clock Stopped Flag (held at startup)) as the input condition instead of A509.15. This
flag turns ON when power is interrupted for longer than the I/O memory backup time, but
A509.14 (I/O Memory Lost Flag (cleared at startup)) is cleared when power supply is turned ON.
This flag can be used to check whether I/O memory was cleared by a power interruption.
A509.15 ON
(I/O Memory Previous
Corruption Flag (Held at OFF
startup.))
E-type CPU Unit: Power interrution for longer than 50 hours
N-type CPU Unit: Power interruption for longer than 40 hours
ON
A509.14
(I/O Memory Corruption
Flag (Held at startup.)) OFF
Power supply turned ON
1 To create a memory error, select the Create memory error when I/O memory is lost Check Box
in the Execution Settings Area on the Startup Tab Page of the PLC Setup.
3 Make the necessary setting in DM Area words and Holding Area words using the CX-Program-
mer after confirming the memory error.
4 Turn OFF A509.13 (I/O Memory Previous Corruption or Clock Stopped Flag (held at startup)) or
A509.15 (I/O Memory Previous Corruption Flag (held at startup) using the CX-Programmer.
5 Clear the error display by clicking the Clear All Button on the Error Tab Page of the CX-Pro-
grammer.
6 Restart operation.
Power interruption
longer than I/O
memory backup time Turned OFF by user.
A509.13
I/O Memory Previous ON
Corruption or Clock Stopped
Flag (Held at startup.)
OFF
or A509.15
I/O Memory Previous Corruption
Flag (Held at startup.)
I/O memory: Cleared Click the Clear All Button on the Error Tab
Page to clear the error display.
The only initial settings required by the CPU Unit are in the PLC Setup.
CPU Unit
Hardware Settings
There are no DIP switches on CP1E CPU Units.
Software Settings
The following table gives the software setting applications and setting methods for applicable Units.
Files created
Applicable Setting Backup desti-
Set data Applications with Program-
Units method nation
ming Device
CPU Unit Parame- PLC Using non-default CX-Program- CX-Programmer Backup mem-
ter Area Setup specifications mer for CP1E for CP1E project ory (built-in
file (.CXP) EEPROM)
z PLC Setup
The PLC Setup is used to make changes for using the CPU Unit with non-default specifications.
The following settings are examples of the defaults for the CPU Unit.
Example:
Startup mode: RUN mode
Fixed servicing time: 4% of cycle time
To use specifications other than these defaults, change the PLC Setup using the CX-Programmer
for CP1E, and transfer the PLC Setup to the CPU Unit.
CX-Programmer
for CP1E PLC Parameter Default
Setup Tab Page
Startup Startup Hold Settings Forced Status Hold Bit Not retained when power is
ON.
IOM Hold Bit Startup Hold Setting Not retained when power is
ON.
Mode Run
Settings Execute Settings Create error for I/O memory cor- Do not create
ruption
Do not detect Low Battery Do not detect
Stop CPU on Instruction Error Do not stop
Do not register FAL to error log Register to error log
Timings Watch Cycle Time 1000 ms (1 s)
Constant Cycle Time No Setting
Scheduled Interrupt Interval 10 ms
Peripheral Service CPU Processing Mode Normal Mode
Set Time to All Events 4% of cycle time
Serial Port Communications Settings Used to sets serial communi- Standard (Host Link and
cations. 9,600 bps)
Built-in Inputs Interrupt Input Settings Used to sets quick-catch Normal inputs (general-
inputs and input interrupts. purpose inputs)
High-speed Counter Settings Used to set high-speed High-speed counters not
counters. used.
Pulse Outputs Base Settings Sets origin searches and ori- Origin searches and
Origin Search gin returns for pulse outputs. returns not used.
Origin Return
5-1 Programming
5-1-1 Programs
User programs
Symbol table
CX-Programmer for
.CXP CP1E project file
PLC Setup
Programming Languages
Programs can be written using only ladder programs.
It is possible to check the program size by selecting View - Memory View in the CX-Programmer.
The size of a ladder instruction depends on the specific instruction and operands that are used. For details,
refer to A-3 Instruction Execution Times and Number of Steps.
5-1 Programming
5-1-3 Basics of Programming
Special
Input Connecting instruction OUT
condition line instruction
Left bus bar Right bus bar
Rungs
Instruction blocks
Mnemonics
A mnemonic program is ladder program given using only instructions in mnemonic form.
It has program addresses, and one program address is equivalent to one instruction.
Example:
Instruction
0.00 0.01 0.02 0.03 102.00 Program
(mnemonic Operand
address
form)
0 LD 0.00
1.00 1.01
1 AND 0.01
2 LD 0.02
3 AND NOT 0.03
END
4 LD NOT 1.00
5 AND 1.01
6 OR LD
7 AND LD
8 OUT 102.00
9 END
Figure A
A Signal flow Order of execution (mnemonics)
() B
R1 LD A AND B
() LD C OUT R1
C D
OUT TR0
LD TR0
(
) AND D AND E
E OR LD OUT R2
R2
Figure B
A B
R1
E
C E
R2
There is no limit to the number of I/O bits, work bits, timers, and other input bits that can be used.
Program structure should be kept as clear and simple as possible even if it means using more
input bits to make the programs easier to understand and maintain.
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
5-1 Programming
102.00
A rung error will occur if an attempt is made to directly connect to the bus bar an instruction that
cannot be connected.
OUT instructions, timers, counters, and other output instructions cannot be connected directly to
the left bus bar.
If one is connected directly to the left bus bar, a rung error will occur during the program check on
the CX-Programmer for CP1E.
MOV
Additional Information
Insert an unused work bit or the Always ON Flag (ON, one of the Condition Flags) in an NC con-
dition if an input condition must be kept ON at all times.
ON (Always ON Flag)
MOV
A location error will occur if an instruction that cannot be connected to the right bus bar is con-
nected to it.
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 for CP1E.
0.01 102.01
A warning will occur if the same output bit is used more than once in an OUT instruction.
The same output bit cannot be controlled by more than one instruction. 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 ultimately saved in the output bit. The results of any previous instructions con-
trolling the same bit will be overwritten and not output.
Output bit CIO 100.00
5
5-2-2 Overview of Sections
Symbols
I/O memory area addresses or constants can be specified using character strings by registering the
character strings as symbols.
Register the symbols in the symbol table of the CX-Programmer for CP1E.
Programming with symbols enables programming with names rather than having to be aware of the
actual addresses.
The symbol table is saved in the CX-Programmer project file (.CXP) along with other parameters, such
as the user programs.
Symbol Types
The following types of symbols are supported.
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.
Addresses are allocated to symbols used in programming using one of the following methods.
User Specifications
Automatic allocation using the CX-Programmer for CP1E
The area of memory used for automatic allocations is set by selecting Memory Allocation - Auto-
matic Address Allocation from the PLC Menu in the CX-Programmer for CP1E.
Scope
Address and
Classifica- Project tree in the CX-Pro- Access I/O comment
Name Access Access
tion grammer for CP1E using sym- (without a
from other from the
bols from a symbol name)
tasks local task
network
Symbols in Global PLC tree Not Possible. Possible. Supported
program- symbols possible.
ming
Note Global and local indicate only the scope of application of the symbol.
They have nothing to do with the scope of application for memory addresses.
Therefore, a warning but not an error will occur in the following cases, and it will be possible to
transfer the user program.
The same addresses is used for two different local symbols.
The same addresses is used for a global symbol and a local symbol.
Additional Information
In programs in the CX-Programmer for CP1E, global symbols and local symbols can be identi-
fied by the following character colors and symbol icons.
3.00
5-3-1 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 SS Source oper- Source operand other than control
and the data to be read or a and data (C)
constant. CC Control data Compound data in a source operand
5
that has different meanings depend-
ing on bit status.
5-3-1 Operands
Destination Specifies the address DD
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
! @ 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
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
.
Word address CIO 1
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 (00000 to 32767)
&256 decimal Contents
Binary Mode to specify the word address in DM Area.
Add the @ symbol at the front to specify an (#0100 hexadecimal)
indirect address in Binary Mode.
@D Specify D00256
Indirect DM An offset from the beginning of the DM Area * D200 MOV #0001 *D200
Addressing is specified. The contents of the address will
in BCD be treated as BCD data (0000 to 9999) to Contents
#0100
Mode specify the word address in the DM Area.
Add an asterisk (*) at the front to specify an
indirect address in BCD Mode. Specify D100
*D
Add *
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
2s 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
Single-preci- 31 30 29 23 22 21 20 19 2 1 0
(Refer to
sion floating- the follow-
point decimal ing note.)
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.
Indicates this value.
The 8 bits from bit 23 to bit 30 contain the exponent. The exponent
n n-127
is expressed in binary as the n in 2 . The actual value is 2 .
This format conforms to the IEEE 754 standard for single-precision floating-
5
point data. It is used only with instructions that convert or calculate floating-
point data.
Note 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 Units 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 (!)
I/O will be refreshed as shown below when an instruction is executing if a real I/O bit in the CPU
Units 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 exe-
cuted.
Add an exclamation mark (!) in front of the instruction to specify immediate refreshing.
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.
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
Decimal Notation (No Symbol)
Floating Point (Real Number) Notation
Signed decimal notation (with + or - symbol and decimal point)
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 example:
+B #0010 D0 D1
Adds #0010 and the contents of D0 as BCD data
and stores the result in D1.
Application example:SBS 0
Jumps to subroutine 0.
Additional Information
Details
5-5-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.
z Bit Addresses
5
The bit address is offset by the amount specified by n (number of bits) from A (start bit address).
5-5-1 Overview
A [n]
Offset
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Word
If the number of offset bits exceeds the memory area of the start bit address, the final bit address will
be in the next memory area in the order determined by the actual PLC memory addresses.
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
If the number of offset words exceeds the memory area of the start word address, the final word
address will be in the next memory area in the order determined by the actual PLC memory
addresses.
Examples:
D0 [2] D2 a [2] D2
D0 [W0] D2
a [b] D2
Offset; W0 = &2
(word address in I/O memory) Offset;
symbol b(one-word symbol) = &2
Start bit address
(bit address in I/O memory) Start word address;
symbol a (one-word symbol) = D0
Caution
Observe the following precaution if a symbol or address is specified for an offset in a ladder dia-
gram.
Program so that the memory area of the start address is not exceeded when the offset is spec-
ified indirectly using a word address or symbol.
For example, write the program so that processing is executed only when the indirect specifica-
tion does not cause the final address to exceed the memory area by using an input comparison
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
The results of checking are output to the Text Tab Page of the Output Window.
Also, the left bus bar of illegal program sections will be displayed in red in Ladder View.
5
5-6-2 Program Checks with the CX-Programmer for CP1E
Refer to the CS/CJ/NSJ-series Instructions Reference Manual (Cat. No. W483) for details.
CX-Programmer
Simulation
Simulation line connection
Download
Virtual PLC
(Simulator)
In addition to transferring programs and monitoring, the following functions can be used with the Simu-
lator.
Executing Step Run, Continuous Step Run, or Scan Run.
Specifying break points, start points, and I/O break conditions.
Checking the number of executions and execution time for each task.
Simulating execution of interrupt tasks.
Force-setting and force-resetting bits.
Simulation in progress
An error occurs
Virtual PLC
Note Unlike with an actual error, ladder execution will not stop even if a fatal error is generated using the PLC error
Additional Information
System errors can also be generated in the PLC by using a FAL or FALS instruction.
If Instruction Errors are set to Stop Operation in the PLC Setup, then operation will stop (fatal error)
and the Instruction Processing Error Flag (A295.08) will turn ON if an instruction processing error
occurs and the P_ER Flag turns ON.
Instruction processing will continue and the Error Flag (ER Flag) will not turn ON if an access error
occurs, but the Access Error Flag (P_AER Flag) will turn ON.
An access error will occur for the following:
If Instruction Errors are set to Stop Operation in the PLC Setup, then operation will stop (fatal error)
and the Illegal Access Error Flag (A295.10) will turn ON if an illegal access error occurs and the AER
Flag turns ON.
Additional Information
The Access Error Flag (P_AER Flag) will not be cleared after a task is executed. If Instruction
Errors are set to Continue Operation, this Flag can be monitored until just before the END
instruction to see if an illegal access error has occurred in the task program. (The status of the
final P_AER Flag after the entire user program has been executed will be monitored if the AER
3. Other Errors
z Illegal Instruction Errors
Illegal instruction errors indicate that an attempt was made to execute instruction data other than
that defined in the system. 5
This error will normally not occur as long as the program is created with CX-Programmer for CP1E.
In the rare even that this error does occur, it will be treated as a program error, operation will stop
Additional Information
If the Error Flag (P_ER) or Illegal Access Error Flag (P_AER) turns ON, it will be treated as a
program error and it can be used to stop the CPU Unit from running. Specify operation for pro-
gram errors in the PLC Setup.
z Program Errors
Program error Description Related flags
No END Instruction An END instruction is not present in the program. The No END Flag
(A295.11) turns ON.
Error During Task Execution No task is ready in the cycle. The Task Error Flag
No program is allocated to a task. (295.12) turns ON.
The corresponding interrupt task number is not
present even though the execution condition for the
interrupt task was met.
Instruction Processing Error The wrong data values were provided in the oper- The ER Flag turns ON and
(ER Flag ON) and Stop Oper- and when an attempt was made to execute an the Instruction Processing
ation set for Instruction Errors instruction. Error Flag (A295.08) turns
in PLC Setup ON if Stop Operation set for
Instruction Errors in PLC
Setup.
Illegal Access Error (AER A read or write was executed for a parameter area. The AER Flag turns ON
Flag ON) and Stop Opera- A read or write was executed for a memory area and the Illegal Access Error
tion set for Instruction Errors that is not mounted. Flag (A295.10) turns ON if
in PLC Setup Stop Operation set for
Writing to a read-only area.
Instruction Errors in PLC
The value specified in an indirect DM address in Setup.
BCD mode is not BCD.
Indirect DM/EM BCD Error The value specified in an indirect DM address in The AER Flag turns ON
and Stop Operation set for BCD mode is not BCD. and the DM/EM Indirect
Instruction Errors in PLC BCD Error Flag (A295.09)
Setup turns ON if Stop Operation
set for Instruction Errors in
the PLC Setup.
Differentiation Address Over- During online editing, more than 131,071 differenti- The Differentiation Over-
flow Error ated instructions have been inserted or deleted. flow Error Flag (A295.13)
turns ON.
Illegal Instruction Errors Execution of an unexecuteable instruction was The UM (User Memory)
attempted. Overflow Flag (A295.14)
turns ON.
User Program Area Overflow An attempt was made to execute instruction data The UM (User Memory)
Errors stored beyond the last address in user memory Overflow Flag (A295.15)
(UM) defined as program storage area. turns ON.
The Condition Flags are shared by all of the instructions, so their status may change often in a single
z Do not connect an input condition for a Condition Flag directly to the bus bar.
Never connect an input condition for a Condition Flag directly to the bus bar because this will cause
it to show the execution results for another instruction.
Example: Using Instruction A Execution Results
The same execution condition (a) is used for instructions A If the Condition Flag is directly connected to
and B to execute instruction B based on the execution the bus bar, instruction B will be executed
results of instruction A. based on the execution results of the previous
In this case, instruction B will be executed according to the instruction even if instruction A is not executed.
Condition Flag only if instruction A is executed.
z Creating N.C. and N.O. Condition Flag Inputs Using OUT Instructions
The Condition Flags are used by all instructions, so make sure that they do not cause interference in
the same program.
Example: Using Execution Results in N.C. and N.O. Inputs
Incorrect Use Correct use
The Condition Flags will pick up instruction B execution results Make sure each of the results is picked up once by an
even though the N.C. and N.O. input bits are executed from the OUT instruction to ensure that execution results for
same output branch. instruction B will be not be picked up.
Condition Flag
C
Ex) =
The result from instruction A
Condition Flag is shown in the Equals Flag.
The result from instruction A
Ex) = Condition Flag is shown in the Equals Flag.
D
Instruction B Ex) =
CMP
CMP
#10
#10
D100
D100
Shows results of executing CMP.
Shows results of executing CMP. = A
=
MOV
= B
#200
D200
A
Shows the result of executing MOV.
MOV
MOV
= #200
#300 D200
D300
MOV
B
#300
D300
Example: Instructions A and B will execute only if execution condition C is met, and instruction B picks up the execution
results from instruction A.
Incorrect Use Correct use
If execution condition C remains ON in the next cycle after If instructions A and B are not differentiated instructions,
instruction A was executed, then instruction B will be executed the DIFU (or DIFD) instruction is used instead and
(by the execution condition) when the Condition Flag turns ON instructions A and B are both upwardly (or downwardly)
because of results shown from a previous rung. differentiated and executed for one cycle only.
Previous rung
Previous rung
Additional Information
The CONDITION FLAG SAVE and CONDITION FLAG LOAD (CCS and CCL) instructions can
be used to save and load the Condition Flag status. These can be used to access the status of 5
the Condition Flags at other locations in a task or in a different task.
When the Error Flag is ON, the status of other Condition Flags, such as the <, >, OF, and UF Flags,
will not change.
The status of the = and N Flags will vary from instruction to instruction.
For information on the conditions that turn ON the Error Flag, refer to the pages in this manual that
describe the instructions.
Caution is required because some instructions will turn OFF the Error Flag regardless of conditions.
Additional Information
The PLC Setup Settings for when an instruction error occurs determines whether execution will
stop when the Error Flag turns ON.
In the default setting, operation will continue when the Error Flag turns ON.
If Stop Operation is specified when the Error Flag turns ON and operation stops (treated as a
program error), the program address at the point where operation stopped will be stored at in
A298 to A299.
At the same time, A295.08 will turn ON.
W500 D00000
XFER
~
~
~
Transfer
&20 Number of transfer words W511 D00011
T0000 D00012
W500 First source word
~
~
~
~
Instruction Combinations
The following table shows which of the special instructions can be used inside other program sections. 5
:Applicable, {: Not applicable
Subroutine
IL-ILC { {
Step Ladder section {
FOR - NEXT loop { { {
Subroutines
Place all the subroutines together just before the END instruction in all programs but after all of the
main program.
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
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.
User Areas
These areas can be used freely by the user.
Additional Information
System Areas
System Areas contain bits and words with preassigned functions.
z Word Addresses
Specifies a16-bit word.
W 1 0 0
I/O memory area The word number within
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
I/O memory Word number Period Bit number (00 to 15)
area designator
On the CX-Programmer for CP1E, addresses in the CIO Area (including addresses for Serial PLC
6
Links) are given with no I/O memory area designator. CIO is used as the I/O memory area desig-
nator in this manual for clarity.
Overview
These words are allocated to built-in I/O terminals of CP1E CPU Units and CP-series Expansion Units
and Expansion I/O Units.
Notation
0 . 02
Bit number: 02
Word number: 0
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.)
Overview
The Work Area is part of the internal memory of the CPU Unit. It is used in programming. Unlike the
input bits and output bits in the CIO Area, I/O to and from external devices is not refreshed for this area.
Notation
W 0 20 . 02
Bit number: 02
Range
The Work Area contains 100 words with addresses ranging from W0 to W099.
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.
W100
W100
NO bit
W100
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.)
Overview
The Holding Area is part of the internal memory of the CPU Unit. It is used in programming. Unlike the
input bits and output bits in the CIO Area, I/O to and from external devices is not refreshed for this area.
These words retain their content when the PLC is turned ON or the operating mode is switched
between PROGRAM mode and RUN or MONITOR mode.
Notation
H 020 . 02
Bit number: 02
6
Word number: 020
Range
The Holding area contains 50 words with addresses ranging from H0 to H049.
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.
A Holding Area bit will be cleared if it is programmed between the ILC and IL instructions and the exe-
cution condition for IL(002) is OFF.
To keep a bit ON even when the execution condition for the IL instruction is OFF, turn ON the bit with
the SET instruction just before the IL instruction.)
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.
A B
Set
KEEP
Input Unit
H1.00
~ A
Reset
A B
Set
KEEP
H1.00
Input Unit
~ A
Reset
There are no restrictions in the order of using bit address or in the number of N.C. or N.O. con-
ditions that can be programmed.
Overview
This data 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 EEPROM backup memory using Auxiliary Area
bits. These words are specifically referred to as the backed up words in the DM Area.
Notation
D 0200
Range
E-type CPU Units have DM Area addresses ranging from D0 to D2047.
(Of these, D0 to D1499 can be backed up in backup memory (built-in EEPROM).)
N-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 EEPROM).)
D6999 D6999
D7000 D7000
~
D8191 D8191
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 EEPROM Backup Memory
The corresponding DM Area words can be saved to the built-in EEPROM backup memory in 500
word increments during operation by turning ON the following Auxiliary Area bits.
Words that can be Backed Up and the Corresponding Auxiliary Area Bits
Words that can be saved to the built-in
Type of CP1E Auxiliary Area bits
EEPROM backup memory
E-type CPU Unit D0 to D1499 (total area: D0 to D2047) A752.00 to A752.02
N-type CPU Unit D0 to D6999 (total area: D0 to D8191) A752.00 to A752.13
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 or at startup.
Refer to 17-6 DM Backup for how to use DM Area words and bits.
z DM Fixed Allocation Words for the Modbus-RTU Easy Master
The following DM area words are used as command and response storage areas for the Modbus-
RTU Easy Master function.
Unit I/O capacity DM Area words
E-type CPU Units D0 to D2047
N-type CPU Units 20 I/O points D1300 to D1399 (for built-in RS-232C ports)
30 or 40 I/O points D1200 to D1299 (for built-in RS-232C ports)
D1300 to D1399 (for serial option ports)
Refer to 16-5 Modbus-RTU Easy Master function for how to use the DM Area words and bits.
z Indirect Addressing of the DM Area
Indirect addressing can be used in the DM Area.
There are two modes that can be used.
Binary-mode Addressing (@D)
If a @ symbol is input before a DM Area address, the contents of that DM Area word is treated
as a hexadecimal (binary) address and the instruction will operate on the DM Area word at that
address.
The entire DM Area can be indirectly addressed with hexadecimal values 0000 to 7FFF.
Example:
Overview
TR bits are used to temporarily store ON/OFF status when there are several output branches in a lad-
der program.
They are used only with mnemonic programs.
There is no need to use them when writing ladder programs using symbols with the CX-Programmer.
Notation
TR 2
Bit number: 2
Range
The TR Area contains 16 bits with addresses ranging from TR0 to TR15. 6
Applications
The TR Area is used in the following situations.
In this example, a TR bit is used when two outputs In this example, a TR bit is used when two outputs
have been directly connected to a branch point and are connected to a branch point without a separate
there are input conditions after the branch point. input condition for the second output.
Details
TR bits can be used only with the OUT and LD instructions.
OUT instructions (OUT TR0 to OUT TR15) store the ON/OFF status of a branch point and LD
instructions recall the stored ON/OFF status of the branch point.
TR bits cannot be used twice in the same instruction block. They can be used as many times as nec-
essary as long as they are used only once in each instruction block.
TR bit status cannot be changed using the CX-Programmer.
A TR bit is not required when there are no execution conditions after the branch point or there is an
execution condition only in the last line of the instruction block.
0.00 0.01 Instruction Operand
LD 0.00
0.02 OR 0.01
OUT 0.02
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 0.
Notation
T 0002
Details
z Types of Timers 6
The following table shows which instructions are used to refresh timer PVs in BCD and binary mode.
Timer instruction BCD mode Binary mode
ONE-MS TIMER TIM TIMX
TEN-MS TIMER TIMH TIMHX
HUNDRED-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 If the IOM Hold Bit (A500.12) is ON and the IOM Hold Bit Check Box is selected in the Startup Hold Area on
the Startup Tab Page in the PLC Setup, the PV and Completion Flag will be retained when the PLCs power is
cycled.
This data is cleared, however, if a power interruption lasts longer than the I/O memory backup time (50 hours
for an E-type CPU Unit and 40 hours for an N-type CPU Unit).
*3 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.
*4 The PV of timers programmed with timer numbers T0016 to T0255 will be held when jumped.
Timer Completion Flags can be force-set and force-reset.
Timer PVs cannot be force-set or force-reset, although the PVs can be refreshed indirectly by force-
setting/resetting the Completion Flag.
There are no restrictions in the order of using timer numbers or in the number of N.C. or N.O. condi-
tions that can be programmed.
Timer PVs can be read as word data and used in programming.
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).
6
Range
Counter numbers range from C0 to C0255.
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 instruction CNTX instruction
REVERSIBLE CNTR instruction CNTRX instruction
COUNTER
The refresh method for counter PVs can be set from the CX-Programmer to either BCD or binary.
Built-in high-speed counters 0 to 5 do not use counter numbers.
Binary mode
Overview
Write the ladder programs and construct the system so that problems will not occur even if this
data is cleared.
Notation
A 020. 02
Bit number: 02
Range
The Auxiliary Area contains 754 words with addresses ranging from A0 to A753.
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 A754).
Even the read/write bits in the Auxiliary Area cannot be force-set and force-reset continuously.
Refer to A-2 Auxiliary Area by Address for the functions of bits and words in the Auxiliary Area.
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 Condition Flags are specified with symbols, such as P_CY and P_ER, rather than addresses.
The CX-Programmer treats condition flags as system-defined symbols (global symbols) beginning with P_.
Notation
P_ ER
Details
The Condition Flags are read-only; they cannot be written from instructions or from the CX-Program-
mer.
All Condition Flags are cleared when the program switches tasks.
6
The status of the ER Flag, AER Flag, and other flags are thus retained only in the task in which the
error occurred.
The Condition Flags cannot be force-set and force-reset.
Name in CX-
Name Function
Programmer
Greater Than Flag P_GT Turned ON when the first operand of a Comparison Instruction is
greater than the second or a value exceeds a specified range.
Equals Flag P_EQ Turned ON when the two operands of a Comparison Instruction are
equal or the result of a calculation is 0.
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 Units 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.
They are cleared at the start of operation.
z Clock Pulses
Name in CX- 6
Name Description
Programmer
0.02-s Clock Pulse P_0_02s 0.01s ON for 0.01 s
OFF for 0.01 s
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)
Output Bits
CIO 100 (CIO 100.00 to CIO 100.07) 8-1-2 I/O Allocation Concepts
CIO 101 (CIO 101.00 to CIO 101.07)
16 outputs
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
CIO 0 Cannot be used Input bits: 24
CIO 1
CIO 100
Can be used as work bits 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).
The upper bits (bits 12 to 15) that are not used in the input words cannot be used as work bits. Only the
upper bits that are not used in the output words can be used as work bits.
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
Output bits Can be used as work bits
CIO n+1
Two input words (24 bits) and two output words (16 bits) are allocated to a 40-point I/O Unit.
Input bits 12 to 15 cannot be used as work bits. Output bits 08 to 15, however, can be used as work
bits.
CPU Unit with 40 I/O Points Three Expansion I/O Unit with 40 I/O points each
Input bits CIO 0.00 to CIO 0.11 CIO 2.00 to CIO 2.11 CIO 4.00 to CIO 4.11 CIO 6.00 to CIO 6.11
CIO 1.00 to CIO 1.11 CIO 3.00 to CIO 3.11 CIO 5.00 to CIO 5.11 CIO 7.00 to CIO 7.11
24 inputs 24 inputs 24 inputs 24 inputs
16 outputs 16 outputs 16 outputs 16 outputs
Output bits CIO 100.00 to CIO 100.07 CIO 102.00 to CIO 102.07 CIO 104.00 to CIO 104.07 CIO 106.00 to CIO 106.07
CIO 101.00 to CIO 101.07 CIO 103.00 to CIO 103.07 CIO 105.00 to CIO 105.07 CIO 107.00 to CIO 107.07
1st Unit 2nd Unit 3rd Unit
bit 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
CIO 0
CPU Unit with 40 I/O Points
CIO 1
CIO 2
8
1st Unit: Expansion I/O Unit with 40 I/O Points
CIO 3
Input bits Cannot be used
CIO 4
CIO 100
CPU Unit with 40 I/O Points
CIO 101
CIO 102
1st Unit: Expansion I/O Unit with 40 I/O Points
Output bits CIO 103
Can be used as work bits
CIO 104
2nd Unit: Expansion I/O Unit with 40 I/O Points
CIO 105
CIO 106
3rd Unit: Expansion I/O Unit with 40 I/O Points
CIO 107
CPU Unit with 30 I/O Points 1st Unit: 2nd Unit: 3rd Unit:
8-point Input Unit 16-point Output Unit 20-point I/O Unit
Input bits CIO 0.00 to CIO 0.11
CIO 2.00 to CIO 2.07 CIO 3.00 to CIO 3.11
CIO 1.00 to CIO 1.05
No inputs
18 inputs 12 inputs
8 inputs 16 outputs
12 outputs 8 outputs
No outputs
Output bits CIO 100.00 to CIO 100.07 CIO 102.00 to CIO 102.07
CIO 104.00 to CIO 104.07
CIO 101.00 to CIO 101.03 CIO 103.00 to CIO 103.07
bit 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
CIO 0
CPU Unit with 30 I/O Points
CIO 1
Input bits Cannot be used
CIO 2 1st Unit: 8-point Input Unit
CIO 3 3rd Unit: 20-point I/O Unit
bit 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
CIO 0 Cannot be used CPU Unit with 40 I/O Points
CIO 1
CIO 2
CIO 3 1st Unit: Temperature Sensor Unit
Input bits
CIO 4
CIO 5
CIO 6 Cannot be used 3rd Unit: Expansion I/O Unit with 40 I/O Points
CIO 7
PLC Setup
PLC Setup
Input Constants
When set-
Internal
Name Default Possible settings ting is read Bits Data
address
by CPU Unit
1 0CH: CIO 0 8 ms No filter (0 ms) When power 0 0 to 7 10 hex
is turned ON
1 ms 12 hex
2 ms 13 hex
4 ms 14 hex
8 ms 15 hex
16 ms 16 hex
32 ms 17 hex
2 1CH: CIO 1 Same as above. Same as above. Same as 1 8 to 15 Same as
above. above.
3 2CH: CIO 2 2 0 to 7
4 3CH: CIO 3 3 8 to 15
5 4CH: CIO 4 4 0 to 7
6 5CH: CIO 5 5 8 to 15
7 6CH: CIO 6 6 0 to 7
8 7CH: CIO 7 7 8 to 15
9 8CH: CIO 8 8 0 to 7
10 9CH: CIO 9 9 8 to 15
11 10CH: CIO 10 15 0 to 7
12 11CH: CIO 11 15 8 to 15
13 12CH: CIO 12 16 0 to 7
14 13CH: CIO 13 16 8 to 15
9-2-4 Serial Port 1 Settings (Built-in RS-232C Port for N-type CPU Units)
9
Communications Settings 9-2-3 Input Constant Settings
When set-
Internal
Name Default Possible settings ting is read Bits Data
address
by CPU Unit
1 Communications Settings Standard (9,600; Standard Every cycle 46 15 0
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
Host Link
Custom 1
2 Mode Host Link Host Link Every cycle 8 to 11 0 hex
(When custom settings have been 5 hex
selected.) NT Link (1:N): 1:N NT Links 2 hex
RS-232C (No-protocol) 3 hex
PC Link (Slave) 7 hex
PC Link (Master) 8 hex
Modbus-RTU Easy Master 9 hex
When set-
Internal
Name Default Possible settings ting is read Bits Data
address
by CPU Unit
2 2-1 Host Link Settings
2-1-1 Baud 9,600 bps 300 bps Every cycle 47 0 to 7 01 hex
600 bps 02 hex
1,200 bps 03 hex
2,400 bps 04 hex
4,800 bps 05 hex
9,600 bps 00 or 06
hex
19,200 bps 07 hex
38,400 bps 08 hex
57,600 bps 09 hex
115,200 bps 0A hex
2-1-2 Format (data length, 7 bits, 2 bits, even 7 bits, 2 bits, even Every cycle 46 0 to 3 0 hex
stop bits, parity)
7 bits, 2 bits, odd 1 hex
7 bits, 2 bits, no parity 2 hex
7 bits, 1 bit, even 4 hex
7 bits, 1 bit, odd 5 hex
7 bits, 1 bit, no parity 6 hex
8 bits, 2 bits, even 8 hex
8 bits, 2 bits, odd 9 hex
8 bits, 2 bits, no parity A hex
8 bits, 1 bit, even C hex
8 bits, 1 bit, odd D hex
8 bits, 1 bit, no parity E hex
2-1-3 Unit Number 0 0 Every cycle 49 0 to 7 00 hex
: :
31 1F hex
2-2 NT Link (1:N) Settings
2-2-1 Baud 115,200 bps 38,400 bps (standard) Every cycle 47 0 to 7 00 hex
(disabled) 115,200 bps (high speed) 0A hex
2-2-2 No.NT/PC Link Max. 1 0 Every cycle 52 0 to 3 0 hex
(Highest unit number
: :
of PT that can be
connected to the PLC) 7 7 hex
When set-
Internal
Name Default Possible settings ting is read Bits Data
address
by CPU Unit
2 2-3 2-3-2 Format 7 bits, 2 bits, even 7 bits, 2 bits, even Every cycle 46 0 to 3 0 hex
(data length, stop bits,
7 bits, 2 bits, odd 1 hex
parity)
7 bits, 2 bits, no parity 2 hex
7 bits, 1 bit, even 4 hex
7 bits, 1 bit, odd 5 hex
7 bits, 1 bit, no parity 6 hex
8 bits, 2 bits, even 8 hex
8 bits, 2 bits, odd 9 hex
8 bits, 2 bits, no parity A hex
8 bits, 1 bit, even C hex
8 bits, 1 bit, odd D hex
8 bits, 1 bit, no parity E hex
2-3-3 Start Code Disable. Disable. Every cycle 51 12 0
Set. 1
2-3-4 Start Code (setting) 00 Hex 00 Hex Every cycle 50 8 to 15 00 hex
: :
FF hex FF hex
2-3-5 End Code None Received Bytes (no end Every cycle 51 8 and 9 00
(Received Bytes) code)
CR, LF 10
Set End Code 01
2-3-6 Received Bytes 256 bytes 256 bytes Every cycle 51 0 to 7 00 hex
(setting)
1 byte 01 hex
: :
255 bytes FF hex
2-3-7 Set End Code 00 Hex 00 Hex Every cycle 50 0 to 7 00 hex
(setting) : :
When set-
Internal
Name Default Possible settings ting is read Bits Data
address
by CPU Unit
2 2-5 2-5-3 Response Timeout 5s 5s Every cycle 53 8 to 15 00 hex
1 (100 ms) 01 hex
: :
255 (100 ms) FF hex
2-6 PC Link (Slave) Settings
2-6-1 Baud 9,600 bps 38,400 bps (standard) Every cycle 47 0 to 7 00 hex
(disabled)
115,200 bps (high speed) 0A hex
2-6-2 PLC Link Unit No. 0 0 Every cycle 53 0 to 3 0 hex
: :
7 7 hex
2-7 PC Link (Master) Settings
2-7-1 Baud 9,600 bps 38,400 bps (standard) Every cycle 47 0 to 7 00 hex
(disabled)
115,200 bps (high speed) 0A hex
2-7-2 Link Words 10 Words 1 word Every cycle 52 4 to 7 1 hex
: :
10 words 0 or A hex
2-7-3 PC Link Mode ALL ALL Every cycle 52 15 0
Masters 1
2-7-4 No. 1 0 Every cycle 63 0 to 3 0 hex
NT/PC Link Max.
: :
(Highest unit number
of PT that can be 7 7 hex
connected to the PLC)
9-2-5 Serial Port 2 (N-type CP1E CPU Unit with 30 or 40 I/O Points)
Communications Settings
When set-
Internal
Name Default Possible settings ting is read Bits Data
address
by CPU Unit
1 Communications Settings Standard (9600; Standard Every cycle 56 15 0
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 1
2 Mode Host Link Host Link Every cycle 56 8 to11 0 or 5 hex
(When custom settings have been NT Link (1:N): 1:N NT Links 2 hex
selected.)
RS-232C (No-protocol) 3 hex
PC Link (Slave) 7 hex
PC Link (Master) 8 hex
Modbus-RTU Easy Master 9 hex
When set-
Internal
Name Default Possible settings ting is read Bits Data
address
by CPU Unit
2 2-1 Host Link Settings
2-1-1 Baud 9,600 bps 300 bps Every cycle 57 0 to 7 01 hex
600 bps 02 hex
1,200 bps 03 hex
2,400 bps 04 hex
4,800 bps 05 hex
9,600 bps 00 or 06
hex
19,200 bps 07 hex
38,400 bps 08 hex
57,600 bps 09 hex
115,200 bps 0A hex
2-1-2 Format 7 bits, 2 bits, even 7 bits, 2 bits, even Every cycle 56 0 to 3 0 hex
(data length, stop bits,
7 bits, 2 bits, odd 1 hex
parity)
7 bits, 2 bits, no parity 2 hex
7 bits, 1 bit, even 4 hex
7 bits, 1 bit, odd 5 hex
7 bits, 1 bit, no parity 6 hex
8 bits, 2 bits, even 8 hex
8 bits, 2 bits, odd 9 hex
8 bits, 2 bits, no parity A hex
8 bits, 1 bit, even C hex
8 bits, 1 bit, odd D hex
8 bits, 1 bit, no parity E hex
2-1-3 Unit Number 0 0 Every cycle 59 0 to 7 00 hex
: :
When set-
Internal
Name Default Possible settings ting is read Bits Data
address
by CPU Unit
2 2-3 2-3-2 Format 7 bits, 2 bits, even 7 bits, 2 bits, even Every cycle 56 0 to 3 0 hex
(data length, stop bits,
7 bits, 2 bits, odd 1 hex
parity)
7 bits, 2 bits, no parity 2 hex
7 bits, 1 bit, even 4 hex
7 bits, 1 bit, odd 5 hex
7 bits, 1 bit, no parity 6 hex
8 bits, 2 bits, even 8 hex
8 bits, 2 bits, odd 9 hex
8 bits, 2 bits, no parity A hex
8 bits, 1 bit, even C hex
8 bits, 1 bit, odd D hex
8 bits, 1 bit, no parity E hex
2-3-3 Start Code Disable. Disable. Every cycle 61 12 0
Set. 1
2-3-4 Start Code 00 hex 00 hex Every cycle 60 8 to 15 00 hex
(setting)
: :
FF hex FF hex
2-3-5 End Code None Received Bytes (no end Every cycle 61 8 and 9 00
(Received Bytes) code)
CR, LF 10
Set End Code 01
2-3-6 Received Bytes (set- 256 bytes 256 bytes Every cycle 60 0 to 7 00 hex
ting)
1 byte 01 hex
: :
255 bytes FF hex
2-3-7 Set End Code (setting) 00 hex 00 hex Every cycle 61 0 to 7 00 hex
: :
FF hex FF hex
2-3-8 Delay 0 ms 0 (10 ms) Every cycle 58 0 to 15 0000 hex
: :
9999 (10 ms) 270F hex
2-5 Modbus-RTU Easy Master Settings
2-5-1 Baud 9,600 bps 300 bps Every cycle 57 0 to 7 01 hex
600 bps 02 hex
1,200 bps 03 hex
2,400 bps 04 hex
4,800 bps 05 hex
9,600 bps 00 or 06
hex
19,200 bps 07 hex
38,400 bps 08 hex
57,600 bps 09 hex
115,200 bps 0A hex
When set-
Internal
Name Default Possible settings ting is read Bits Data
address
by CPU Unit
2 2-5 2-5-2 Format 7 bits, 2 bits, even 7 bits, 2 bits, even Every cycle 56 0 to 3 0 hex
(data length, stop bits,
7 bits, 2 bits, odd 1 hex
parity)
7 bits, 2 bits, no parity 2 hex
7 bits, 1 bit, even 4 hex
7 bits, 1 bit, odd 5 hex
7 bits, 1 bit, no parity 6 hex
8 bits, 2 bits, even 8 hex
8 bits, 2 bits, odd 9 hex
8 bits, 2 bits, no parity A hex
8 bits, 1 bit, even C hex
8 bits, 1 bit, odd D hex
8 bits, 1 bit, no parity E hex
2-5-3 Response Timeout 5s 5s Every cycle 63 8 to 15 00 hex
1 (100 ms) 01 hex
: :
255 (100 ms) FF hex
2-6 PC Link (Slave) Settings
2-6-1 Baud 9,600 bps 38,400 bps (standard) Every cycle 57 0 to 7 00 hex
(disabled)
115,200 bps (high speed) 0A hex
2-6-2 PLC Link Unit No. 0 0 Every cycle 63 0 to 3 0 Hex
: :
7 7 hex
2-7 PC Link (Master) Settings
2-7-1 Baud 9,600 bps 38,400 bps (standard) Every cycle 57 0 to 7 00 hex
(disabled)
115,200 bps (high speed) 0A hex
9
9-2-5 Serial Port 2 (N-type CP1E CPU Unit with
30 or 40 I/O Points)
When setting
Internal
Name Default Possible settings is read by Bits Data
address
CPU Unit
3-2 Reset Software reset Software reset When power 16 4 to 7 1 hex
is turned ON
Software reset (comparing) 3 hex
3-3 Input Setting Increment pulse Increment pulse input When power 16 0 to 3 3 hex
input is turned ON
4 Use high-speed counter 3 Do not use. Do not use. When power 19 12 to 15 0 hex
is turned ON
Use. 1 hex
4-1 Counting mode Linear mode Linear mode At start of 19 8 to 11 0 hex
operation
Circular mode 1 hex
4-1-1 Circular Max. Count 0 0 At start of 20 and 21 0 to 15 0000 0000
operation hex
: :
4,294,967,295 FFFF FFFF
hex
4-2 Reset Software reset Software reset When power 19 4 to 7 1 hex
is turned ON
Software reset (comparing) 3 hex
4-3 Input Setting Increment pulse Increment pulse input When power 19 0 to 3 3 hex
input is turned ON
5 Use high-speed counter 4 Do not use. Do not use. When power 22 12 to 15 0 hex
is turned ON
Use. 1 hex
5-1 Counting mode Linear mode Linear mode At start of 22 8 to 11 0 hex
operation
Circular mode 1 hex
5-1-1 Circular Max. Count 0 0 At start of 23 and 24 0 to 15 0000 0000
operation hex
: :
4,294,967,295 FFFF FFFF
hex
5-2 Reset Software reset Software reset When power 22 4 to 7 1 hex
Base Settings
When setting
Internal
Name Default Possible settings is read by Bits Data
address
CPU Unit
1 Undefined Origin (operation for limit Hold Hold At start of 88 12 to 15 0 hex
signal turning ON) operation
Undefined 1 hex
2 Limit Input Signal Operation Search Only Search Only When power 76 4 to 7 0 hex
is turned ON
Always 1 hex
3 Limit Input Signal NC NC At start of 88 0 to 3 0 hex
operation
NO 1 hex
4 Search/Return Initial Speed 0 pps (disabled) 0 pps At start of 78 and 79 0 to 15 0000 0001
operation hex
: :
100,000 pps 0001 86A0
hex
Base Settings
When setting
Internal
Name Default Possible settings is read by Bits Data
address
CPU Unit
1 Undefined Origin Hold Hold At start of 106 12 to 15 0 hex
(operation for limit signal turning ON) operation
Undefined 1 hex
2 Limit Input Signal Operation Search Only Search Only When power 94 4 to 7 0 hex
is turned ON
Always 1 hex
3 Limit Input Signal NC NC At start of 106 0 to 3 0 hex
operation
NO 1 hex
4 Search/Return Initial Speed 0 pps (disabled) 0 pps At start of 96 and 97 0 to 15 0000 0001
operation hex
: :
100,000 pps 0001 86A0
hex
: :
65,535 (pulses/4 ms) FFFF hex
1-11 Origin Search Deceleration 0 (disabled) 1 (pulses/4 ms) At start of 105 0 to 15 0001 hex
Ratio (Rate) operation
: :
65,535 (pulses/4 ms) FFFF hex
1-12 Positioning Monitor Time 0 (ms) 0 (ms) At start of 107 0 to 15 0000 hex
operation
: :
9,999 (ms) 270F hex
Function
6 Start Operation
Start PLC operation.
A CP1E 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.
Input terminals:
Normal inputs Normal inputs, interrupt inputs,
quick-response inputs, high-
Interrupt inputs speed counters, and origin
These functions cannot be searches use the same input
Quick-response inputs used simultaneously because terminals.
they use the same terminals.
High-speed counters
Origin searches
Input terminals
Output terminals
Output terminals:
Normal outputs, pulse outputs,
Normal outputs PWM output, and origin
searches (counter reset output)
Pulse outputs These functions cannot be use the same output terminals.
used simultaneously because
they use the same terminals.
Origin searches
PWM output
Functions
Specify the functions to use as shown below.
z Input Functions
10
Interrupt inputs
Origin searches
z Output Functions
1 Input functions can be selected by selecting the Use Check Box in a High-speed Counter Area
on the Built-in Internal Tab Page or by setting an input to Interrupt or Quick in the Interrupt
Input Area of the same page.
2 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.
Terminal Arrangement
L1 L2/N COM 01 03 05 07 09 11
NC 00 02 04 06 08 10
IN CIO 0
L1 L2/N COM 01 03 05 07 09 11 01 03 05
00 02 04 06 08 10 00 02 04 NC
IN CIO 0 IN CIO 1
L1 L2/N COM 01 03 05 07 09 11 01 03 05 07 09 11
00 02 04 06 08 10 00 02 04 06 08 10
IN CIO 0 IN CIO 1
Functions
that each terminal is used for only one function.
Settings in PLC Setup
Origin search
CPU Unit Input terminal block Interrupt input setting on High-speed counter 0 to 3 setting on settings on
Built-in Input Tab Page Built-in Input Tab Page Pulse Output
0/1 Tab Page
10
Note 1 The same input setting must be used for high-speed counter 0 and high-speed counter.
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.
Functions
Terminal Arrangement
+ 00 01 02 04 05 07 00 02
+ 00 01 02 03 04 06 00 01 03 04 06
Output 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.
Setting in PLC
When a pulse output
Other than Setup When the PWM
instruction (SPED,
those shown Origin search instruction is
Output terminal ACC, PLS2, or ORG) is
CPU Unit right setting on Pulse executed
block executed
Output 0/1 Tab Page
Variable duty
Terminal Fixed duty ratio pulse output ratio pulse
20-point 30-point 40-point Terminal
block Normal output output
I/O Units I/O Units I/O Units number
label
Pulse + direction Use PWM output
Applicable Applicable Applicable CIO 100 00 Normal output 0 Pulse output 0 (pulse)
11-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.
Photomicrosensor or other
device with short signal Quick-response input
Cycle time
Built-in input
I/O refresh
Cyclic tasks
(ladder programs)
Cycle time.
Can read ON signals
shorter than this time
END
I/O refresh
50s 50s
Restrictions
A built-in input cannot be used as a quick-response input if it is being used as a normal input, interrupt
input, or high-speed counter input.
L1 L2/N COM 01 03 05 07 09 11
NC 00 02 04 06 08 10
CIO 0
Quick-response input IN2: CIO 0.02
Quick-response input IN6: CIO 0.06
Quick-response input IN4: CIO 0.04
L1 L2/N COM 01 03 05 07 09 11 01 03 05
00 02 04 06 08 10 00 02 04
CIO 0 CIO 1
Quick-response input IN2: CIO 0.02
Quick-response input IN6: CIO 0.06
Quick-response input IN4: CIO 0.04
L1 L2/N COM 01 03 05 07 09 11 01 03 05 07 09 11
00 02 04 06 08 10 00 02 04 06 08 10
CIO 0 CIO 1
Quick-response input IN2: CIO 0.02
Quick-response input IN6: CIO 0.06
Quick-response input IN4: CIO 0.04
2 PLC Setup
Click the Built-in Input Tab and select Quick in the interrupt input settings.
Select Quick
Note The power supply must be restarted after the PLC Setup is transferred in order to validate the quick-
response input settings.
11
3 Creating Ladder Programs
0.02
The 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
input refresh period.
12-1 Interrupts
CP1E 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.
The CP1E performs the following processing when an interrupt occurs.
When an interrupt occurs, execution of the ladder programs in the normal cycle is interrupted.
The ladder program in the interrupt task is executed.
When the interrupt task is finished, the ladder program that was being executed is returned to.
Cycle END
Interrupts can thus be used to perform high-speed processing that is not restricted by the cycle time.
Refer to 13-3 High-speed Counter Interrupts for information on high-speed counter interrupts.
Additional Information
12-2-1 Overview
Interrupt input
Built-in input
12
12-2-1 Overview
Input interrupt bit turns ON
Interrupt task
Cyclic tasks
(ladder programs) Ladder program
Interrupt occurs
Cycle
END
END
I/O refreshing
Condition for
accepting interrupt
Example: CIO 0.02
(interrupt input IN0)
MSKS instruction
executed to enable
the interrupt
Processing Processing
Cyclic task execution
interrupted Cyclic task execution
interrupted
Interrupt task
Interrupt task
2 executed
2 executed
1 Assigning interrupt
input terminals
Terminals 02 to 07 on the 0CH terminal block can be used
for input interrupts.
Automatic bit allocation Bits CIO 0.02 to CIO 0.07 correspond to terminals 02 to
07.
2 PLC Setup Set IN2 to IN7 for interrupt inputs on the Built-in Input Tab
Page of the PLC Setup using the CX-Programmer.
3 Execute MSKS
Specify whether the interrupt is executed when the input
turns ON or when it turns OFF in the MSKS instruction.
instruction in a Set N to 112 to 117 in the MSKS instruction.
Ladder cyclic task Enable input interrupts in the MSKS instruction. Set N to
programming 102 to 107 in the MSKS instruction.
Restrictions
A built-in input cannot be used as a normal input, high-speed counter input, or quick-response input if it
is being used as an interrupt input.
L1 L2/N COM 01 03 05 07 09 11
NC 00 02 04 06 08 10
CIO 0
L1 L2/N COM 01 03 05 07 09 11 01 03 05
00 02 04 06 08 10 00 02 04
CIO 0 CIO 1
Upper Terminal Block Interrupt input IN5: CIO 0.05 Interrupt input IN7: CIO 0.07
Interrupt input IN3: CIO 0.03
L1 L2/N COM 01 03 05 07 09 11 01 03 05 07 09 11
00 02 04 06 08 10 00 02 04 06 08 10
CIO 0 CIO 1
2 PLC Setup
Click the Built-in Input Tab and select Interrupt in the interrupt intput settings.
Select Interrupt
Note The power supply must be restarted after the PLC Setup is transferred in order to enable the interrupt input
settings.
Execution condition
@MSKS (1)Specifies creating an interrupt when
N the input turns OFF or when it turns
C ON.
@MSKS
N (2)Enables input interrupts.
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.
Example
Specifying Detecting ON or OFF Input Signals
For interrupt input IN2: Specify 112.
Cyclic task
Specifies an interrupt when the input turns ON.
MSKS Enabling Input Interrupt CIO 0.02 turns ON
112 For interrupt input IN2: Specify 102.
#0000 Enables Input interrupt. Built-in input terminal
The specified input interrupt (here, IN2) is 01 03 05 07 09 11
MSKS enabled when the MSKS instruction is executed.
102 00 02 04 06 08 10
#0000
Interrupt CIO 0
Interrupt task 2
END
END
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
2)PLC Setup
Set IN2 to Interrupt in the interrupt input settings on the Built-in Input Tab Page.
3)Programming Example
(1) Cyclic Task
Interrupt input 0
0.04
Reset input
(2)Interrupt Task
OK output
Sensor input 1 Sensor input 2 Sensor input 3
NG output 2
Sensor input 1
Sensor input 1
Interrupt task 2
NG output 3
Sensor input 2
Sensor input 2
NG output 4
Sensor input 3
Sensor input 3
12-3-1 Overview
12
12-3-1 Overview
Minimum interval: 0.5 ms
Specified interval
Interrupt task
Cyclic tasks
Interrupt occurs Ladder program
(ladder programs)
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
0.5ms 0.5ms 0.5ms
Internal clock
Determine the scheduled Determine whether to set the time interval in units of
interrupt time unit 10 ms (default), 1 ms, or 0.1 ms.
Make the settings in the In the PLC Setup of the CX-Programmer, set the
1 PLC Setup scheduled interrupt interval time unit to 10 ms, 1 ms,
or 0.1 ms on the Timings Tab Page.
Interrupt task Write the program for the corresponding interrupt task.
1 PLC Setup
To change the time unit to 1 ms or 0.1 ms, set the scheduled interrupt interval parameter on the Timings
Tab Page of the PLC Setup.
Note The power supply must be restarted after the PLC Setup is transferred in order to enable the time unit set-
ting.
The scheduled interrupt interval is calculated by multiplying the unit set in the PLC Setup by the timer
SV set with MSKS.
@MSKS(690)
N Specifies scheduled interrupt 0 (interrupt task 1)
C Sets the scheduled interrupt interval and starts timing
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.
Example:
Interrupt
Interrupt task 1
END
END
If interrupt task A (an input interrupt, for example) is being executed when interrupt task B (a scheduled
interrupt, for example) is called, task A execution will not be interrupted. Task B execution will be started
when task A had been completed.
If multiple types of interrupts occur simultaneously, they are executed in the following order. If they are
the same interrupt type, the task with the lower interrupt task number will be executed frist.
13-1-1 Overview
High-speed counters are used to measure high-speed input signals that cannot be measured by
counter 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.
Hhigh-speed processing according to the workpieces 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 specified 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
2 PLC Setup
Enable the required high-speed counters.
Select the Use high speed counter Check Box for
high-speed counters 0 to 5 and select the input setting
on the Built-in Input Tab Page of the PLC Setup using
the CX-Programmer.
3 Ladder
Read counter PV
Read the PV from Auxiliary Area or by executing a
PRV instruction.
13
programming Execute a PRV instruction.
Read counter frequency
Use
Note 1 The same input setting 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.
(Do not use the same I/O power supply as other equipment.)
1
Power provided 0V Power supply
Encoder 2 24V 0V
Shielded twisted-pair cable
CP1E CPU Unit
13
IA
Phase A 0.00
IZ
Phase Z 0.04
COM
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.
13-1-3 Specifications
Item Description
nput setting (Selected in the PLC Increment input Differential Up/down pulse Pulse + direc-
Setup) phase inputs inputs tion inputs
Input terminal allocations Increment pulse Phase-A input Up pulse input Pulse input
input
Phase-B input Down pulse input Direction input
Phase-Z input Reset input Reset input
Input method Single-phase Differential Two Single- Single-phase
input phase, 4 phase inputs pulse + direc-
(Fixed) tion inputs
Frequency and CP1E-N F - F 100 kHz: 50 kHz: 100 kHz: 100 kHz:
number of high- 2 counters, 1 counter, 1 counter, 2 counters
speed counters 10 kHz: 5 kHz: 1 counter 10 kHz: 1 counter
4 counters
CP1E-E F - F 10 kHz: 5 kHz: 10 kHz: 10 kHz:
6 counters 2 counters 2 counters 2 counters
Counting mode Linear mode or circular (ring) mode (Select in the PLC Setup.)
Count values Linear mode: 8000 0000 to 7FFF FFFF hex
Ring Mode: 0000 0000 to Ring SV
(The ring SV (Circular Max. Count) is set in the PLC Setup and the setting
range is 0000 0001 to FFFF FFFF hex.)
High-speed counter PV storage High-speed counter 0: A271 (upper 4 digits) and A270 (lower 4 digits)
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)
Target value comparison interrupts or range comparison interrupts can be
executed based on these PVs.
Note 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
method comparison registered.
Range comparison Up to 6 ranges can be registered, with a separate upper limit, lower limit,
and interrupt task number for each range.
Counter reset method Phase-Z + Software reset
(Set the counter reset method in the The counter is reset when the phase-Z input goes ON while the Reset
PLC Setup.) Bit is ON. (Phase Z cannot be used for the increment pulse.)
Software reset
The counter is reset when the Reset Bit is turned ON.
Increment Mode
Up/Down Mode
The Up/Down Mode uses two signals, an increment pulse input and a decrement pulse input.
Conditions for Incrementing/
Decrementing the Count
Increment Decrement Increment Count value
pulse pulse pulse
OFF Decrement
Decrement ON Increment
pulse ON No change
0 1 2 3 4 5 6 7 8 7 6 5 4 3 2 1 0 OFF No change
OFF Increment
ON Decrement
ON No change
OFF No change
The count is incremented for each increment
pulse and decremented for each decrement pulse.
Only rising edges are counted.
Pulse + Direction Mode
The pulse + direction mode uses a direction signal input and pulse signal input. The count is incre-
mented or decremented depending on the status (ON or OFF) of the direction signal.
Conditions for Incrementing/
Decrementing the Count
OFF No change
Direction
ON Increment
ON No change
0 1 2 3 4 5 6 7 8 7 6 5 4 3 2 1 0 OFF No change
OFF Decrement
ON No change
ON No change
OFF No change
The count is incremented when the
direction signal is ON and
decremented when it is OFF.
Only rising edges are counted.
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
Count value
2 32-1
Maximum ring
count
One cycle
13
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 counters PV is reset when the corresponding High-speed Counter Reset Bit goes from
OFF to ON.
The CPU Unit recognizes the OFF-to-ON transition of the High-speed Counter Reset Bit only at the
beginning 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 set to stop or continue 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)
#0000 C2: Control data (for reading PV)
D100 S: First destination word
15 0
z Flow of Processing
13
z Reading the High-speed Counter Frequency with a PRV Instruction
@PRV
#0010 C1: Port specifier (example for high-speed counter input 0)
#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 Restrictions
The frequency measurement function can be used with high-speed counter 0 only.
Frequency measurements are not possible for high-speed counter 3.
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
Note If the frequency exceeds the maximum value, the maximum value will be
stored.
Measurement method Execution of the PRV instruction
Stored data Unit Hz
Output data Differential phase input: 0000 0000 to 0000 C350 hex
range All other input modes: 0000 0000 to 000186A0 hex
13-3-1 Overview
This function counts input pulses with the CPU Units 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 an 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
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
Flow of Processing
2 PLC Setup
Enable the required high-speed counters.
Select the Use high speed counter Check Box for
high-speed counters 0 to 5 and select the input
setting on the Built-in Tab Page of the PLC Setup
using the CX-Programmer.
13-3-1 Overview
z High-speed Counter Settings
Specify
Single- operand N in
Two-phase Instruc- Interrupt
phase Settings in PLC Setup the instruc-
terminal tion task number
terminal tion to enable
interrupts
00 on CIO 0 00 on CIO 0 Interrupt input High-speed Select Use CTBL #0000 0 to 15
terminal terminal settings on counter 0 Check Box. instruc- (Specified by
block block Built-in Input tion user.)
01 on CIO 0 Tab Page
terminal
block
04 on CIO 0
terminal
block
01 on CIO 0 02 on CIO 0 High-speed #0001 0 to 15
terminal terminal counter 1 (Specified by
block block user.)
03 on CIO 0
terminal
block
05 on CIO 0
terminal
block
02 on CIO 0 High-speed #0002 0 to 15
terminal counter 2 (Specified by
block user.)
03 on CIO 0 High-speed #0003 0 to 15
terminal counter 3 (Specified by
block user.)
04 on CIO 0 High-speed #0004 0 to 15
terminal counter 4 (Specified by
block user.)
05 on CIO 0 High-speed #0005 0 to 15
terminal counter 5 (Specified by
block user.)
Restrictions
A built-in input cannot be used as a normal input, interrupt input, or quick-response input if it is being
used as a high-speed counter input.
Termi- Use
nal Terminal Two-phase (differen-
block number Single-phase (incre- Two-phase
tial phase 4 or
label ment pulse input) (pulse/direction)
up/down)
CIO 0 00 High-speed counter 0, High-speed counter 0, High-speed counter 0,
increment input phase A or up input pulse input
01 High-speed counter 1, High-speed counter 0, High-speed counter 1,
increment input phase B or down input pulse input
02 High-speed counter 2, Counter 1, phase A or High-speed counter 0,
increment input up input direction
03 High-speed counter 1, High-speed counter 1,
phase B or down input direction
04 High-speed counter 3, High-speed counter 0, High-speed counter 0,
increment input phase Z or reset input reset input
05 High-speed counter 4, High-speed counter 1, High-speed counter 1,
increment input phase Z or reset input reset input
06 High-speed counter 5,
increment input
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, and then set the counting mode, reset method, and input setting.
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 that is started NO. 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 that is started NO. No.0 No.1 No.5 No.8
Match Match
The maximum response frequencies of the high-speed counters are given in the following table.
E-type CPU N-type CPU
Item
Unit Unit
Incremental pulse 10kHz 100kHz
Up and down pulses
High-speed counter 0
Pulse plus direction
Exceptions
When using target matching, the total processing frequency for all high-speed counters must be 13
50 kHz or less.
When using target matching, the interval between interrupts for target matches must be 1 ms or
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 to execute NO. 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.
z Restrictions
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: High-speed counter number
C2 C2: Control data
S S: First comparison table word
Operand Settings
C1 High-speed #0000 High-speed counter 0
counter num-
~
ber
#0005 High-speed counter 5
C2 Control data #0000 Registers a target-value comparison table and starts the com-
parison operation.
#0001 Registers a range comparison table and starts the comparison
operation.
#0002 Registers a target-value comparison table.
#0003 Registers a range comparison table.
S First compari- Specifies the first word address of the comparison table, which is described
son table word below.
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
13
~
(3)Create the programs for interrupt tasks 10 and 11. Always put an END instruction at the pro-
gram's last address.
(4)Use the CTBL instruction to start the comparison operation with high-speed counter 0 and inter-
rupt tasks 10 and 11.
W0.00
CTBL
#0000 Use high-speed counter 0.
#0000 Register a target-value comparison
D1000 table and start comparison operation.
First comparison table word.
(5)Operation
When execution condition W0.00 turns ON, the comparison starts with high-speed counter 0.
When the PV of high speed counter 0 reaches 30,000, cyclic task execution is interrupted, and inter-
rupt task 10 is executed.
When the PV of high speed counter 0 reaches 20,000, cyclic task execution is interrupted, and inter-
rupt task 11 is executed.
When interrupt task 10 or 11 execution has been completed, execution of the interrupted cyclic task
resumes.
W0.00
0.00
Counting enabled
(1)Set high-speed counter 1 on the PLC Setups 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 D20000. 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
D2014 #FFFF Set the fifth word for ranges 3 to 5 (listed at left) to #FFFF to disable
those ranges.
13
D2019
D2024
D2025 All Range 6 lower and upper limit val- Range 6 settings
to #0000 ues (Not used and don't need to
be set.)
D2028
D2029 #FFFF Disables the range.
(3)Create the program for interrupt task 12. Always put an END instruction at the programs last
address.
(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.
(5) Operation
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 inter-
rupted, and interrupt task 12 is executed.
When interrupt task 12 execution is completed, execution of the interrupted cyclic task resumes.
W0.00
0.02
High-speed counter 1 PV
(in A272 and A273)
Counting enabled
13-4 Auxiliary Area Bits and Words Used with High-speed Counters
13-4 Auxiliary Area Bits and Words Used
with High-speed Counters
Functions Used
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.
z Wiring Example
White Phase B
Orange Phase Z
Brown
Example: E6B2-CWZ6C
NPN open-collector output Blue
24 VDC
power supply
Start motor
100 to 240 VAC
13
CP1E-N20DR-A
z 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.
8 To apply changes made to the PLC Setup, cycle the power to the PLC.
z Ladder Program
Based on the counter value, the motor is started, decelerated, and stopped.
High-speed Counter
Reset Bit
Motor start Motor
stop
Programming Example 2
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.
z Ladder Program
Use the CTBL instruction to execute interrupt tasks when the target positions are reached.
When the PV of the high-speed counter matches target value 1 (3000), interrupt task 04 is executed.
Interrupt task
04
Turns ON the motor
low speed output
Interrupt task
05
Turns OFF the motor
low speed output
z DM Area Setup
The comparison table for the CTBL (COMPARISON TABLE LOAD) instruction is set in D600 through
D606.
Word Value Contents 13
D600 0002 Number of target values: 2
D601 0BB8 Target value 1: 3000 BCD (BB8 hex)
D602 0000
D603 0004 Target value 1: Interrupt task No.4
D604 0DAC Target value 2: 3500 BCD (DAC hex)
D605 0000
D606 0005 Target value 2: Interrupt task No.5
14-1-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
Travel distance
Built-in output
Jogging
Frequency (speed)
Servo Drive (or
stepping driver)
14
Travel distance
Time
14-1-1 Overview
Servomotor (or
stepping motor) Origin search
Frequency (speed)
Travel distance
Time
CP1E
Pulse output PV in
Auxiliary Area
2 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.
1 Setting the Pulse Output Method, Setting the Pulse Output Port
Number, Assigning Pulse Output Terminals, and Wiring
Pulses
z Origin Searches
Use the following input and output terminals for origin searches.
Input Terminals
Other functions that cannot be used at the same
Input terminal block Setting in PLC Setup
time
High-speed
counter
Terminal Quick- settings
Terminal Enable origin searches for Normal Interrupt
block response
number pulse outputs 0 and 1 inputs inputs Single-phase
PULS
(+)
PULS
(-)
(+)
SGN
(-)
Direction output
2 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 and Pulse Output 1 Tab Pages in the PLC Setup.
Note The power supply must be restarted after the PLC Setup is transferred in order to enable the pulse output
settings.
z Origin Searches
Refer to 14-4-4 Settings in PLC Setup
z Origin Returns
Refer to 14-4-4 Settings in PLC Setup
z Applicable Instructions
The following instructions are used.
Purpose Overview Instruction Reference
Note The absolute pulse specification can be used when absolute coordiates
are specified for the pulse output PV, i.e. the origin location has been
defined.The absolute pulse specification cannot be used when relative
coordinates are specified, i.e. the origin location is undefined. An instruc-
tion error will occur.
Pulse output PVs 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)
The PVs are refreshed during regular I/O refreshing.
14-2-1 Determine the Pulse Output Port, Output Method, and Output
Waveform
Output Waveform
Specify the output waveform in the instruction operands.
14-2-1 Determine the Pulse Output Port, Output Method, and Output Waveform
Specified number of
pulses
Starting frequency
=
pulses setting = 100 counterclockwise. Number of movement
pulses
Number of pulses setting
100
=
Pulse output PV
Pulse output PV range:
Target position Present position=0
8000 0000 to 7FFF FFFF hex
Pulse output PV range: Number of pulses setting range:
8000 0000 to 7FFF FFFF hex 0000 0000 to 7FFF FFFF hex
Number of pulses setting range:
0000 0000 to 7FFF FFFF hex
Absolute pulse The absolute pulse specification cannot be Positions the system to an absolute
specification used when the origin location is undefined, i.e., position relative to the origin.The num-
when the system is operating in the relative ber of movement pulses and movement
coordinate system. An instruction execution direction are calculated automatically
error will occur. from the present position (pulse output
PV) and target position.
The following example shows the num-
ber of pulses setting = +100.
Number of pulses setting
=
Number of movement
pulses
+100
+200
Pulse output
0 Target position= Present position PV
Number of pulses setting
Origin
The following table shows the operations that can affect the origin status (origin defined or undefined),
such as changing the operating mode and executing certain instructions.
The No-origin Flag will be ON when the corresponding pulse outputs origin is undefined and OFF when
the origin is defined.
Current status PROGRAM mode RUN mode or MONITOR mode
Operation Origin defined Origin undefined Origin defined Origin undefined
Operating Switch to RUN Origin becomes Origin continues to
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
Acceleration rate: 300 Hz/4 ms D0 #012C
Deceleration rate: 200 Hz/4 ms D1 #00C8
Target frequency: 50,000 Hz D2 #C350
D3 #0000
Number of output pulses: 600,000 pulses D4 #27C0
D5 #0009
Starting frequency: 100 Hz D6 #0064
D7 #0000
Ladder Program
0.00
@PLS2
#0001 Pulse output 1
Start input
#0100 Specifies Pulse + Direction output method, CW, and relative pulses
D0 Target frequency, number of pulses setting
D6 Starting frequency
END(001)
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.
14-3 Jogging
Jogging can be performed by using the SPED and ACC instructions. This section describes the steps
for jogging.
14-3-1 Determine the Pulse Output Port and Pulse Output Method
14-3 Jogging
14-3-2 Pulse Waveform and Applicable Instructions
14-3-1 Determine the Pulse Output Port and Pulse Output Method
Target frequency
Target frequency Starting pulse output: 1 Hz to 100 kHz (in increments of 1 kHz)
Stopping pulse output: 0 Hz
Direction specification Set to CW or CCW.
Mode specification Set to continuous mode.
Acceleration
Target frequency and
deceleration
rate
Target frequency Starting pulse output: 1 Hz to 100 kHz (in increments of 1 kHz)
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.
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.
Counterclockwise high-speed jogging will be executed from pulse output 1 while CIO 0.05 is ON.
Acceleration/
Target frequency 100,000Hz deceleration rate
100Hz/4ms
Acceleration/
deceleration rate
100Hz/4ms
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 CW Start Pulse Output in Progress #0001 Pulse output 1
#0100 Specifies Pulse + Direction output method, CW, and continuous mode.
D0 Target frequency
SET W0.00
W0.00 0.00
SPED
Low-speed CW Low-speed CW Start #0001
output in progress #0100
#0000
RSET W0.00
0.01 A281.04
SPED
Low-speed CCW Start Pulse Output in Progress #0001 Pulse output 1
#0110 Specifies Pulse + Direction output method, CCW, and continuous mode.
Target frequencyz
14-3 Jogging
D0
SET W0.01
W0.01 0.01
SPED
Low-speed CCW Low-speed CCW Start #0001
output in progress #0110
#0000
RSET W0.01
14
0.04 A281.04
ACC
SET W0.02
W0.02 0.04
ACC
High-speed CW High-speed CW Start #0001
output in progress #0100
D13
RSET W0.02
0.05 A281.04
ACC
High-speed CCW Start Pulse Output in Progress #0001 Pulse output 1
#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
High-speed CCW High-speed CCW Start #0001
output in progress #0110
D13
RSET W0.03
END
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.
When the ORG instruction executes an origin search, it outputs pulses to actually move the motor and
defines the origin position using the input signals that indicate the origin proximity and origin positions.
The input signals that indicate the origin position can be received from the servomotors built-in phase-Z
signal or external sensors such as photoelectric sensors, proximity sensors, or limit switches.
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 low 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.
2 PLC Setup
Set the origin search parameters in the Pulse
Output 0 and Pulse Output 1 Tab Pages of the
PLC Setup using the CX-Programmer.
14-4-3 Setting the Pulse Output Port and Pulse Output Method
CIO 100 00 CIO 100.00 stored in A276 Pulse Connect to Servo Drives pulse input (PULS).
and A277.
02 CIO 100.02 Direction Connect to Servo Drives 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 06 CIO 0.06 Origin input Connect to open- Connect to the Connect to the
signal collector output phase-Z signal phase-Z signal
from sensor or from the Servo from the Servo
other device. Drive. Drive.
10 CIO 0.10 Origin Proxim- Connect to sensor.
ity Input
CIO 100 04 CIO 100.04 Error counter Not used. Connect to error counter reset (ECRST)
reset output of the Servo Drive.
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
written to A540.10 in the the Servo Drive to
ladder program. a normal input ter-
minal.
Set the Servo Drives command pulse mode to feed pulse and forward/reverse signals because the
method of pulse output from a CP1E CPU Unit is pulse + direction.
XW2Z-J-B28
COM (CIO100)
Move stocker (CIO 100.02)
PCB storage enabled (CIO 100.03)
Input terminal block 14 GND
Pulse 0 origin input signal (CIO 0.06) 21 Z
COM
DC24V Servo Drive
RUN input X1
Pulse 0 origin proximity input signal (CIO 0.10) 2 RUN
3 RESET
Servo Drive alarm
Origin search start switch (CIO 0.00)
reset input
Emergency stop switch (CIO 0.01) 13 0GND
PCB storage completed (CIO 0.03) X1 9
Stocker movement completed (CIO 0.04) DC24V
/ALM
14
XB 11 BKIR
14-4-3 Setting the Pulse Output Port and Pulse Output Method
26 FG
Note 1 The power supply must be restarted after the PLC Setup is transferred in order to enable the
pulse output settings.
2 Only the Origin Input Signal type can be changed while the power is turned ON. Other param-
eters are updated when operation is started.
14
14-4-6 Details on the Origin Search Function
Note There are stepping motor drivers that are equipped with a Positioning Completed Signal like a servomotor.
Operating 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
Pulse output
0
Approx. 20 to 30 ms
When the Origin Proximity Input Signal is received, 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.
Operating Mode 1 with Origin Proximity Input Signal Reverse (Origin Detection Method Setting = 0)
The Origin Input Signal can be detected 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 Sig-
nal. Set an Origin Proximity Input Signal dog setting that is long enough (longer than the decelera- 14
tion time.)
CCW CW
Stop
Starts
when ORG is executed Ideal time for the Origin Proximity
Input Signal to go OFF
(Settings when the deceleration time is short)
CCW CW
Stop (*1)
*1 The Origin Input Signal can be detected
Starts immediately after the Origin Proximity Input
when ORG is executed Signal turns OFF if the deceleration time is
short, e.g., when starting from within the
Origin Proximity Input Signal.
Operating Mode 1 without Origin Proximity Input Signal Reverse (Origin Detection Method Setting = 1)
Depending on the length of the deceleration time, the stopping position may change when the Origin
Input Signal is detected during deceleration.
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
CCW CW
Start when ORG is executed Stop
CCW CW
Start when ORG is executed Stop
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 direction of operation is reversed, it is reversed immediately
without deceleration or acceleration.
Pulse output
CCW CW
CCW CW
Stop
CW Limit Input Signal (See note.)
Start
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
z Conditions
Operating mode: 1 Uses the Servomotor encoders phase-Z signal as the Origin Input
Signal.
Origin search operation setting: 1 Sets reverse mode 1. Reverses direction when the Limit Input Signal
is input in the origin search direction.
Origin detection method: 0 Reads the Origin Input Signal after the Origin Input Signal turns ON
and then turns OFF.
Origin search direction: CW direction
z System Configuration
Servomotor Driver
CIO 0.06: Servomotor encoders
phase-Z origin input
z Applicable Instructions
ORG
Any instruction, such as the OUT instruction, that can write the status of CIO 0.00 to A541.08 and
the status of CIO 0.01 to A541.09.
z I/O Allocations (CP1E-N40/30/20DT-)
Inputs
Input terminal
Terminal Terminal Name
block label number
CIO 0 00 CW limit sensor
The status of CIO 0.00 is written to A541.08 in the ladder program using an OUT
instruction.
01 CCW limit sensor
The status of CIO 0.01 is written to A541.09 in the ladder program using an OUT
instruction.
06 Pulse Output 0 Origin Input Signal
10 Pulse Output 0 Origin Proximity Input Signal
Outputs
Output terminal
Terminal Name
Terminal
block
number
label
CIO 100 00 Pulse Output 0 CW output
01 Pulse Output 0 CCW output
z Operation
1
1
Pulse Output 0
Origin Signal Input 0.06
0
Pulse
frequency
Origin search Origin search high speed Origin search
acceleration deceleration
rate rate
Pulse Output 0 Origin search proximity speed
100.00/100.01
Origin search
initial speed
CCW Stop CW
14
Execution of ORG starts:
Origin search starts
z Ladder Diagram
Execution condition
ORG
#0000 Origin search 0: #0000
Origin Return
An origin return operation moves the motor to the origin position from any other position. The origin
return operation is controlled by ORG.
The origin return operation returns the motor to the origin by starting at the specified speed, accelerat-
ing to the target speed, moving at the target speed, and then decelerating to a stop at the origin posi-
tion.
Origin return
acceleration rate
Origin return
initial speed
Time
Start Stop
14
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.
The present value of the pulse output can be changed by using the INI instruction. To define the present
value as the origin, set the pulse output PV to 0 using the INI instruction.
INI instruction executed
Pulse output
PV
Example: 0
Origin return
@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
C2 Control data #0002 Changes PV
#0003 Stops pulse output
S First word with new Store the new PV starting from this word when changing the PV
PV (i.e., when C = #0002).
@PRV
#0000 C1: Port specifier (example for pulse output 0)
#0002 C2: Control data (example for reading PV)
D100 S: First destination word
15 0
D100 Present value data lower bytes
Pulse output PV that was read
D101 Present value data upper bytes
14
z System Configuration
Jogging switch
IN 0.00
14
Positioning switch
IN 0.01
*Normal I/O other than pulse outputs are used for I/O.
z Operation
1 The workpiece is set at the starting position using the Jogging Switch Input (CIO 0.00).
2 The workpiece is fed the specified distance (relative) using the Positioning Switch Input (CIO
0.01).
3 When feeding has been completed, the cutter is activated using the Cutter Start Output (CIO
100.02).
4 Feeding is started again when the Cutter Finished Input (CIO 0.02) turns ON.
5 The feeding/cutting operation is repeated for the number of times specified for the counter (C0,
100 times).
6 When the operation has been completed, the Cutting Operation Finished Output (CIO 100.03) is
turned ON.
The feeding operation can be canceled and stopped at any point using the Emergency Switch Input
(CIO 0.03).
Applicable Instructions
SPED
PLS2
Preparations
z PLC Setup
There are no settings that need to be made in the PLC Setup.
z DM Area Settings
Speed Settings for Jogging (D0 to D3)
Setting details Address Data
Target frequency: 1,000 Hz D0 #03E8
D1 #0000
Target frequency: 0000 Hz D2 #0000
D3 #0000
Ladder Program
Jog Operation
0.00 A280.04
SPED
0.00 W0.00
SPED
A280.03
CNT
Pulse Output Completed Flag 0000
0.01 D20
Positioning Switch
C0000 100.03
Cutting Operation Finished
0.03
INI
Additional Information
The PLS2 instruction uses a relative pulse setting. This enables operation even if the origin is not
defined.
The present position in A276 (lower 4 digits) and A277 (upper 4 digits) is set to 0 before pulse output
and then contains the specified number of pulses.
The ACC instruction can be used instead of the SPED instruction for the jog operation. If ACC is
used, acceleration/deceleration can be included in the jog operation.
z Outline
PCBs with components mounted are stored in a stocker.
When a stocker becomes full, it is moved to the conveyance point.
From mounter
z Operation Pattern
An origin search is performed.
Fixed-distance positioning is repeated.
The system is returned to the original position.
Origin search
CCW Fixed-distance CW
positioning repeated
50,000 Hz
(C350 Hex)
10,000
(2710 Hex)
CCW CW
Acceleration/deceleration:
Return to start 1,000 Hz/4 ms (03E8 hex)
SmartStep A-series
Servo Drive
R88A-CPU00S
Hood FG
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.02) and only the conveyor is lowered (absolute
positioning) when stoker movement is completed (CIO 0.04).
The operation can be canceled and pulse output stopped at any point using the Emergency Switch
Input (CIO 0.01).
Preparations
z PLC Setup
Setting
Enable origin search function for pulse output 0.
* The origin search enable 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 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
eceleration rate: 200 Hz/4 ms D11 #00C8
Target frequency: 50,000 Hz D12 #C350
D13 #0000
Number of output pulses: 10,000 15 pulses D14 #49F0
D15 #0002
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 #0015
operation (number of PCBs in stocker)
Ladder Program
Jog Operation
100.03
W0.01 W0.02
PCB storage enabled
W0.05 W0.02
0.03
Lift positioning start
PCB stored PCB storage completed
100.03
14
PCB storage enabled
W0.03
W0.02 W0.04
Lift positioning in progress
A280.03 W0.04
Lower positioning
completed
W0.05
W0.04 C0000
PCB stored
Stocker moved
100.02 W0.07
0.04
Lower positioning
Stocker moving
Stocker movement completed
output
Positioning
Lower to "0" position (absolute pulses)
W0.08
W0.07 W0.09
Lower positioning in progress
A280.03 W0.09
@INI
Emergency stop switch #0000
#0003
0
Repeat limit input settings
Limit inputs are allocated to external sensors using the following programming.
A540.08
0.05
CW Limit Input Signal Flag
Built-in input
0.07 A540.09
Built-in input
Position
control
Pulse output
14
z Operation Pattern
10,000 Hz
500 Hz/4ms (2710 Hex)
(01F4 Hex)
Position control
Speed control 5,000 (1388 hex)
pulses output before stopping.
PLS2 is executed in
input interrupt task.
z Operation
1 Speed control is used to feed wrapping material to the initial position when the Start Switch (CIO
0.00) is activated.
2 When the Marker Sensor Input (CIO 0.04) is received, the PLS2 instruction is executed in inter-
rupt task 2.
4 An emergency stop is executed to stop pulse output with the Emergency Stop input (CIO 0.01).
Preparations
z PLC Setup
Setting
Enable using built-in input IN0 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
Setting Address Data
Acceleration/deceleration rate: D0 #03E8
500 Hz/4 ms
Target frequency: 10,000 Hz D1 #2710
D2 #0000
Ladder Program
P_First Cycle
MSKS
W0.00
0.00 W0.01
Material being fed
Material feed start Material positioning
completed
@ACC
W0.00
#0000
P_ON
@PLS2
Always ON Flag #0000
#0100
D10
D16
When operating with the absolute pulse specification, the movement direction is selected automatically
based on the relationship between the pulse output PV when the instruction is executed and the speci-
fied target position. The direction (CW/CCW) specified in an ACC or SPED instruction is not effective.
Using CW/CCW Limit Inputs for Pulse Output Functions Other than
Origin Searches
Pulse outputs will stop when either the CW or CCW Limit Input Signals turns ON. It is also possible to
select whether or not the defined origin will be cleared when a CW or CCW Limit Input Signal turns ON
for an origin search or other pulse output function.
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
Changing the Pulse frequency Acceleration/ Changes the ACC Port
deceleration rate n
speed in a Acceleration/
acceleration or (Continuous) Continuous
Target frequency deceleration rate 2
polyline curve Acceleration/
deceleration Target frequency
during operation deceleration
rate 1 rate during
Present frequency ACC Acceleration/
acceleration or
Time (Continuous) deceleration rate
deceleration.
Execution of ACC
Execution of ACC
Execution of ACC
Stop pulse Immediate stop Pulse frequency Stops the SPED or Port
output pulse output ACC Continuous
Present
frequency
immediately. (Continuous) Target
frequency=0
Time SPED
Execution of SPED (Continuous)
* 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.
*1 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 triangular control
(acceleration and deceleration only.) An error will not occur.
Time Time
Changing Settings
Example Procedure
Operation Frequency changes Description
application Instruction Settings
Change Changing Number of pulses SPED can be exe- PULS Number of
Specified number of specified with PULS
speed in the speed in Pulse frequency
pulses (Specified with does not change.
cuted during posi- pulses
one step one step New target frequency PULS.) tioning to change Relative or
SPED
during oper- Target frequency (raise or lower) the absolute
(Independent)
ation pulse output fre- pulse speci-
quency in one step. fication
Time
The target position SPED Port
Execution of SPED
(independent mode) (specified number (Independent)
SPED (independent mode) Pulse +
executed again to change the of pulses) is not
Direction
target frequency. (The target
position is not changed.)
changed.
Indepen-
dent
Target fre-
quency
Change Changing Number of pulses ACC can be exe- PULS Number of
specified with PULS
speed the target Pulse frequency
Specified number of
pulses (Specified does not change. cuted during posi- pulses
smoothly speed (fre- with PULS.) tioning to change Relative or
New target frequency ACC
(with quency) the acceleration/ absolute
Target frequency
Acceleration/ (Independent)
accelera- during posi- deceleration rate deceleration rate pulse speci-
tion rate = tioning and target fre- fication
Time
decelera- (accelera- quency. ACC Port
Execution of ACC
tion rate) tion rate = (independent mode) The target position (Independent)
Pulse +
decelera- ACC (independent mode) executed
(specified number
again to change the target frequency. Direction
tion rate) (The target position is not changed,
of pulses) is not
but the acceleration/deceleration rate
Indepen-
is changed.)
changed.
dent
Accelera-
tion/decel-
eration rate
Target fre-
quency
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- frequency and acceleration/deceleration
Note To prevent PLS2 Pulse +
tion rates) tion and rates.(The target position is not
decelera-
changed. The original target position is
specified again.)
the target Direction
tion rates) position from PLS2 Accelera-
being tion rate
changed
Example Procedure
Operation applica- Frequency changes Description Instruc-
tion Settings
tion
Change Change PLS2 can be executed PULS Number of
Number of pulses
target posi- the target Pulse frequency Specified number changed with PLS2. during positioning to pulses
of pulses
tion and position New target frequency change the target position Relative or
ACC
speed and target Target frequency (number of pulses), absolute
Acceleration/ (Indepen-
smoothly speed (fre- deceleration acceleration rate, decel- pulse spec-
rate dent)
quency) eration rate, and target ification
during
Time
frequency.
Execution of PLS2 Port
positioning PLS2
PLS2 executed to change the target Note When the settings Pulse +
(multiple position, target frequency, and
acceleration/deceleration rates cannot be changed Direction
start func-
tion) without maintaining Accelera-
the same speed tion rate
range, an error will Decelera-
occur and the origi- tion rate
nal operation will
Target fre-
continue to the orig-
quency
inal target position.
Starting
frequency
Change Pulse frequency Number of pulses specified
PLS2 can be executed PLS2 Number of
by PLS2 #N.
the accel- Acceleration/
deceleration rate n during positioning (accel- pulses
eration and New target frequency Acceleration/ eration or deceleration) to Accelera-
deceleration rate 3
Target frequency Acceleration/ PLS2
decelera- deceleration rate 2 change the acceleration tion rate
Acceleration/
tion rates deceleration
rate 1
rate or deceleration rate. Decelera-
during Time
tion rate
positioning Execution of PLS2 Execution of PLS2 #N
Execution of PLS2
(multiple Execution of PLS2
start func-
tion)
Change Change Pulse frequency
PLS2 can be executed PULS Number of
direction the direc- Secified number Change of direction at the
during positioning with pulses
tion during of pulses specified deceleration rate absolute pulse specifica- Absolute
Target ACC
positioning frequency
Number of pulses (position) tion to change to absolute pulse spec-
(Indepen-
changed by PLS2
pulses and reverse direc- ification
Time dent)
tion. Port
Execution
of PLS2
Execution of PLS2 Pulse +
PLS2
Direction
PLS2 Accelera-
tion rate
PLS2 Decelera-
tion rate
Target fre-
quency
Starting
frequency
Change Not supported.
pulse out-
put method
14
Stop sloped Decelerate Pulse frequency Decelerates the pulse output PULS Port
pulse out- to a stop Present
to a stop. Indepen-
Original acceleration/
Execution of ACC
cannot be achieved Number of
(continuous) after switching the pulses
Execution of PLS2
mode. If this hap-
pens, the instruction Note The start-
Fixed dis- ing fre-
Pulse frequency execution will be
tance feed quency is
ignored and the pre-
interrupt Present ignored.
frequency vious operation will
be continued.
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
15
15-1-1 Overview
A PWM (Pulse Width Modulation) pulse can be output with a specified duty factor. The duty factor is the
ratio of the pulses ON time and OFF time in one pulse cycle. Use the PWM instruction to generate vari-
able-duty-factor pulses from a built-in output. The duty factor can be changed during pulse output.
Application example:
Controlling temperature on a time-proportional basis using the variable-duty-factor output.
Controlling the brightness of lighting.
Built-in output
Variable-duty-factor 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 Pulse with variable duty factor (PWM)
* The frequency can be set up to 6553.5 Hz in the PWM instruction, but the duty factor accuracy declines signifi-
cantly at high frequencies because of limitations in the output circuit at high frequencies.
Flow of Processing
Setting pulse output port, Terminal 01 on terminal block 100CH is used for PWM
1 assigning pulse output terminals, output 0.
and wiring.
15-1-1 Overview
When the start input (CIO 0.00) turns ON in this example, pulses with a duty factor of 40% at a fre-
quency of 2,000 Hz are output from PWM output 0. When the stop input (CIO 0.01) turns ON, PWM
output 0 is stopped.
z Instructions Used
PWM
INI
z Preparations
PLC Setup
There are no settings that need to be made in the PLC Setup.
DM Area Settings
PWM Operand Settings (F and D)
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.
END(001)
Inverter
Data links between CPU Units Data links can be created for Serial PLC Links OK OK
up to nine CP-series or CJ1M
CPU Units, including one Poll-
CP1E CPU Unit Polling Unit
RS-422A/485 Option Board
ing Unit and up to eight Polled
RS-422A/485
Units. Up to 10 words can be
Shared data shared per Unit.
PTs set for 1:N NT Links can
also be included as Polled
Units in the same network.
CP1E CPU Unit Polled Unit CP1L CPU Unit Polled Unit Note A PT cannot be included
in the Serial PLC Links.
16
16-1-4 Optional Serial Communications Board for N-type CPU Units with
30 or 40 I/O Points
The Option Board can be mounted in the option slot of a CP1E N-type CPU Unit with 30 or 40 I/O
Points.
CP1W-CIF01 CP1W-CIF11/12
RS-232C RS-422A/485
Option Board Option Board
Maximum trans-
Model number Port Connection method
mission distance
CP1W-CIF01 One RS-232C port 15m Connector (D-sub, 9 pin female)
CP1W-CIF11 One RS-422A/485 port 50m Terminal block (using ferrules)
(not isolated)
CP1W-CIF12 One RS-422A/485 port 500m Terminal block (using ferrules)
(isolated)
When mounting an Option Board, first remove the slot cover. Grasp both of the covers up/down lock
levers at the same time to unlock the cover, and then pull the cover out.
Then to mount the Option Board, check the alignment and firmly press it in until it snaps into place.
Front Back
Communications
Status Indicator
CPU Unit Connector
COMM
RS-232C Connector
z RS-232C Connector
Signal
5 1 Pin Abbr. Signal name
direction
1 FG Frame ground
2 SD(TXD) Send data Output
9 6 3 RD(RXD) Receive data Input
4 RS(RTS) Request to send Output
5 CS(CTS) Clear to send Input
6 5V Power supply
7 DR(DSR) Data set ready Input
8 ER(DTR) Data terminal ready Output
9 SG(0V) Signal ground
Connector FG Frame ground
hood
RS-422A/485 Connector
16
z RS-422A/485 Terminal Block
2 Combine signal wires and SG (signal ground) wires in a twisted-pair cable. At the same time,
bundle the SG wires to the connectors on Option Board and the remote device.
3 Connect the shield of the communications cable to the hood (FG) of the RS-232C connector on
the Option Board. At the same time, ground the ground (GR) terminal of the CPU Unit to 100
or less.
16
A connection example is shown below.
Example: Twisted-pair Cable Connecting SD-RD, RD-SD, and SG-SG Terminals in Host Link Mode
FG 1 1 CD SG signal wires
SD 2 2 RD
RD 3 3 SD RS-232C
RS-232C
RS 4 4 ER interface Bundle the SG wires
interface CS 5 5 SG
5V 6 6 DR Aluminum foil
DR 7 7 RS
ER 8 8 CS
SG 9 9 CI
D-sub, 9-pin connector (male) D-sub, 9-pin connector (female) XM2S-0911-E
Note The hood (FG) is internally connected to the ground terminal (GR) on the CPU Unit.
Therefore, FG is grounded by grounding the power supply ground terminal (GR). Although there is conduc-
tivity between the hood (FG) and pin 1 (FG), connect the shield to both the hood and pin 1 to reduce the con-
tact resistance between the shield and FG and thus provide better noise resistance.
Refer to A-4 Wiring for Serial Communications in the CP1E Hardware Users Manual (Cat. No.
W479) for connector wiring methods.
2 Connect the shield of the communications cable to the FG terminal on the RS-422A/485 Option
Board. Also ground the ground (GR) terminal of the CPU Unit to 100 or less.
3 SDA- A()
4 SDB+ B(+)
1 RDA- FG
2 RDB+
5 FG Shield
Four-wire Connections
CP1E N-type CPU Unit
RS-422A/485 Option Board Remote device
z Electrical Specifications
422A/485
RS-422A/485 Terminal Block
Signal
RDA-
RDB+
RDA- RDB+ SDA- SDB+ FG
SDA-
SDB+
RDA- RDB+ SDA- SDB+ FG
FG
RS-232C Connector
Pin Signal
RS-232C port Connector pin
arrangement
1 FG
1 FG
+5V 6 2 RD
2 RD
7
8
3 SD 3 SD
4 CS
SG(0V) 9
5 RS
4 CS
5 RS
6 +5V
7,8 NC
9 SG(0V)
Hood NC (See note.)
Note The hood and the connector hood to which it is connected will have the same electrical potential.
z Dimensions
5.8 38.8 18.2
34.0
*1 When connecting to a CP-series CPU Unit, turn OFF pin 5 and turn ON pin 6.
16
z Application Example
422A/485
RS-232C Option Board
RS-422
Pin Signal RS-232C Pin Signal Signal Pin Signal
2 SD 3 RD SDA 4 RDA
3 RD 2 SD SDB 3 RDB
4 RS 4 RS RDA 6 SDA
5 CS 5 CS RDB 5 SDB
6 +5V 6 +5V GRD 1
7 DR 7 DR
8 ER 8 ER
9 SG 9 SG
Hood FG Hood FG Remote device
Shield
Signal
(See note)
RDA
RDB
SDA
SDB
FG
It is recommended that one of these cables be used to connect the RS-232C port on the Option Board
to the NT-AL001 RS-232C/RS-422 Link Adapter.
Note The hood (FG) is internally connected to the ground terminal (GR) on the CPU Unit. There-
fore, FG is grounded by grounding the ground terminal (GR) on the power supply terminal
block.
Always turn ON the terminating resistance if the node is at the end of the RS-422A/485 transmission
path.
Communications
cables
300 mm min.
Control cables
PLC power supply
and general control
circuit wiring 300 mm min.
Power cables
Power lines
200 mm min.
16-3-1 OVERVIEW
RS-232C
1:N NT Link
16-3-1 OVERVIEW
used. If more than one PT is connected, communications will be performed with only one of the
PTs. It cannot be predetermined with PT will be communicated with.
1 Select Serial Port 1 or Serial Port 2 in Create a project using the CX-
the PLC Setup of the CP1E CPU Unit Designer and select Serial Port A or
using the CX-Programmer. Set the CX-Designer
PLC Setup Serial Port B in the communications
serial communications mode to NT settings.
Link (1:N), set the baud rate, and set
the highest unit number to at least 1.
4 Set the same communications settings in the CP1E CPU Units PLC Setup and in the NS-series PT.
5 Connect the CP1E CPU Unit and external devices using the RS-232C or RS-422A/485 ports.
PLC Setup
Click the Serial Port 1 or Serial Port 2 Tab in the PLC Settings Dialog Box.
1 Select NT Links (1:N) from Serial Port A or Serial Port B on the Memory Switch Menu under the
System Menu on the PT.
2 Press the SET Touch Switch to set the baud rate to high speed. (A baud rate of 115,200 bps in
the PLC Setup is the same as setting high speed for the PT.)
FG Hood Hood FG
FG 1 1
SD 2 2 SD
Built-in RD 3 3 RD RS-232C
RS-232C interface
RS 4 4 RS
port
CS 5 5 CS
5V 6 6 5V
DR 7 7
ER 8 8
SG 9 9 SG
D-sub, 9-pin connector (male) D-sub, 9-pin connector (male)
Connecting PTs and a PLC 1:N with RS-422A/485 Port Using 4-wire,
RS-422A Communications
Communications mode: NT Link (1:N, N = 8 max.)
Note More than two NP-series PTs cannot be connected.
NS-series PT NS-series PT
CP1E N-type CPU Unit (Unit No. 0) (Unit No. 1)
z Wiring Example
NS-series PT NS-series PT
RS-422A/485 Option Board CP1E
(Unit No. 0) (Unit No. 1) NS-AL002
DIP switch for operation settings
DIP SW setting
SW1 Terminating resistance ON/OFF ON ON (RS/CS flow control) ON (RS/CS flow control) SW1 RS/CS control or always ON
SW2 2/4-wire selection switch OFF (4-wire connection) OFF (4-wire connection) OFF (4-wire connection) SW2 2/4-wire selection switch
SW3 2/4-wire selection switch OFF (4-wire connection) OFF (4-wire connection) OFF (4-wire connection) SW3 2/4-wire selection switch
SW4 Not used OFF OFF ON SW4 Terminating resistance ON/OFF
SW5 RD control OFF
SW6 SD control OFF
RDB+
RDB+
SDB+
RDB+
SDB+
SDB+
RDA-
RDA-
SDA-
RDA-
SDA-
SDA-
F6
F6
F6
16-4-1 Overview
TXD or RXD
16
General component
(e.g., barcode reader)
16-4-1 Overview
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 CP1E 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 (unit: 10
to receive is 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
1 Wiring communications
Connect the CP1E CPU Unit and external device using
RS-232C or RS-422A/485 ports.
2 PLC Setup
Select Serial Port 1 or Serial Port 2 in the PLC Setup
and transfer the PLC Setup from the CX-Programmer to
the CP1E CPU Unit.
(Set the serial communications mode to RS-232C, and
set the communications conditions.)
Signal RS-422A
Device supporting
RS-422A/485
NT-AL001 Communications
16-5-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 A641.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 CP1E CPU Unit and Modbus-RTU Slave
using RS-422A/485 ports.
2 PLC Setup
Select Serial Port 1 or Serial Port 2 in the PLC Setup and
transfer the PLC Setup from the CX-Programmer to the
CP1E CPU Unit. (Set the serial communications mode to
RS-232C, and set the communications conditions.)
Easy Master
08 to 15 Reserved
D01252 D01352 00 to 07 Error code
( See error codes in the following table. )
08 to 15 Reserved (Always 00 hex.)
D01253 D01352 00 to 15 Number of response bytes (0000 to 03EA hex)
D01254 to D01354 to D01399 00 to 15 Response data (92 bytes maximum)
D01299
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 Serial Gateway Mode.
80 hex Response timeout A response was not received from the server.
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.
Speed
Stopped
16
The target speed is changed according to inputs from multiple contacts. Acceleration and deceleration
are controlled using the acceleration and deceleration of an inverter.
CP1W-CIF11/12
RS-422A/485 Option Board
z CP1W-CIF11/12 Settings
Set the DIP switch as shown in the following table
(Back)
z 3G3MV Settings
Set the DIP switch as follows:
SW2, pin 1 : ON (terminating resistance connected) Terminating resistance for RS422/485
communications
Then, set the following parameters.
z PLC Setup
Click the Serial Port 1 or Serial Port 2 Tab in the PLC Settings Dialog Box.
z Programming Example
Contact A
Contact B
RUN command (1: Start)
Frequency reference: 55.00Hz(157C Hex)
Contact C
Contact Z
RUN command (0: Stop)
Frequency reference: 00.00Hz
(A)Turn ON A640.00 (Execution Bit) to send command data stored starting at D1200. For details, refer
to DM Area Data on the next page.
Words
Bits Setting
Serial Port 1
(B)When a command has been sent successfully, A640.01 (Execution Normal Flag) will turn ON, and
the response data will be stored starting from D1250.
Words
Serial Port 1
Bits Setting 16
D1250 00 to 07 Response Slave address (00 to F7 hex)
(C)If a communications error occurs, A640.02 (Execution Error Flag) will turn ON, and the error code
will be stored in D1252.
z DM Area Data
DM Fixed Allocation Words for Modbus-RTU Easy Master
DM Area data in words D1201 to D1205 are set before the execution of the ladder program.
D1206 and D1207 do not need to be set. They are modified by MOV instructions, and are used to
change, start, and stop frequency references.
Address
Value
For this example, only the RUN command (bit 00) will be used.
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.
16-6-1 Overview
Serial PLC Links enable exchanging data between CP1E N-type CPU Units, CP1E/CP1H CPU Units,
or CJ1M CPU Units without using special programming. The serial communications mode is set to
Serial PLC Links. Up to 9 PLCs can be linked.
Configuration
z Connecting CP1E, CP1L, CP1H, or CJ1M CPU Units 1:N (8 Nodes Maximum)
RS-422A/485
8 nodes maximum
16
z Connecting CP1E, CP1L, CP1H, or CJ1M CPU Units 1:1
16-6-1 Overview
CP1E N-type
CPU Unit
(Polling Unit)
RS-232C or RS422A/485
Shared data
CP1E or
CP1L CPU
Unit (Polled
Unit)
1 Wiring communications
Connect the CP1E CPU Unit and Modbus-RTU Slave
Unit using RS-422A/485 ports.
2 PLC Setup
Set Serial Port 1 or Serial Port 2 in the PLC Setup and
transfer the PLC Setup from the CX-Programmer to the
CP1E CPU Unit. (Set the serial communications 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
CJ1W-CIF11
CJ1W-CIF11 RS-422A Converter
RS-422A Converter
Note The CP1W-CIF11 is not isolated, so the total transmission distance for the whole
transmission path is 50 m max. If the total transmission distance is greater than 50 m, use
the NT-AL001, which is isolated, and do not use the CJ1W-CIF11. If the NT-AL001 is used,
the total transmission distance for the whole transmission path is 500 m max.
RS
-
2 2
3 CS 5 5 CS 3
2 5V 2
5V 6 6 C
C
DR 7 7 DR
ER 8 8 ER
SG 9 9 SG
RDB+
RDB+
RDB+
Signal
Signal
SDB+
SDB+
SDB+
RDA-
RDA-
SDA-
SDA-
SDA-
RDA-
FG
FG
FG
Shield
Signal
Signal
RDB+
RDB+
RDB+
SDB+
SDB+
SDB+
RDA-
RDA-
RDA-
SDA-
SDA-
SDA-
FG
FG
FG
Pin 1 2 3 4 5 Pin 1 2 3 4 5 Pin 1 2 3 4 5
Shield
16-6-5 Specifications
16-6-5 Specifications
ports are set for Serial PLC Links (either as polling node or polled node), a
PLC Setup setting error (nonfatal error) will occur and the PLC Setup Setting
Error Flag (A402.10) will turn ON.
Connection method RS-422A/485 or RS-232C connection via RS-422A/485 or RS-232C Option
Board.
Words allocated in CIO Area Serial PLC Link Words: CIO 200 to CIO 289 (Up to 10 words can be
allocated for each CPU Unit.)
Maximum number of Units 9 Units max., comprising 1 Polling Unit and 8 Polled Units (A PT can be
placed on the same network in an 1:N NT Link, but it must be counted as
one of the 8 Polled Units.)
Link methods (data refresh Complete link method or Polling Unit link method
methods)
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 address allocated to the connected PTs unit number and the addresses
of Polled Units that are not present in the network. These data areas are undefined in all nodes.
Polling Unit Polled Unit No. 0 Polled Unit No. 1 Polled Unit No. 3
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
16-6-5 Specifications
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
Complete Link Method
Address Link words 1 word 2 words 3 words to 10 words
CIO 200 Polling Unit CIO 200 CIO 200 to CIO 200 to CIO 200 to
201 202 209
Polled Unit CIO 201 CIO 202 to CIO 203 to CIO 210 to
No. 0 203 205 219
Polled Unit CIO 202 CIO 204 to CIO 206 to CIO 220 to
No. 1 205 208 229
Polled Unit CIO 203 CIO 206 to CIO 209 to CIO 230 to
No. 2 207 211 239
Polled Unit CIO 204 CIO 208 to CIO 212 to CIO 240 to
Serial PLC No. 3 209 214 249
Link Area Polled Unit CIO 205 CIO 210 to CIO 215 to CIO 250 to
No. 4 211 217 259
Polled Unit CIO 206 CIO 212 to CIO 218 to CIO 260 to
No. 5 213 220 269
Polled Unit CIO 207 CIO 214 to CIO 221 to CIO 270 to
No. 6 215 223 279
Polled Unit CIO 208 CIO 216 to CIO 224 to CIO 280 to
No. 7 217 226 289
CIO 299 Not used. CIO 209 to CIO 218 to CIO 227 to CIO 290 to
299 299 299 299
*1 In the same way as for the existing 1:N NT Link, the status (communicating/not communicating) of PTs in
Serial PLC Links can be checked from the Polling Unit (CPU Unit) by reading the Built-in RS-232C Port Com-
municating with PT Flag (A394.00 to A394.07 for unit numbers 0 to 7) or the Serial Option Port Communicating 16
with PT Flag (A393.00 to A393.07 for unit numbers 0 to 7).
Related Auxiliary Area Bits and Words for Serial Option Port
16-6-5 Specifications
Name Address Details Read/write Refresh timing
Serial Option Port A393.00 to When serial option port is being Read Cleared when power is turned ON.
Communicating A393.07 used in NT link mode, the bit corre- Turns ON the bit corresponding to the unit number
with PT Flags*1 sponding to the Unit performing of the PT/Polled Unit that is communicating via
communications will be ON. Bits 00 serial option port in NT link mode or Serial PLC
to 07 correspond to unit numbers 0 Link mode.
to 7, respectively.
Bits 00 to 07 correspond to unit numbers 0 to 7,
ON: Communicating
respectively.
OFF: Not communicating
Serial Option Port A528.00 to When an error occurs at serial Read/Write Cleared when power is turned ON.
Error Flags A528.07 option port, the corresponding When an error occurs at serial option port, the cor-
error bit is turned ON. responding error bit is turned ON.
Bit 00: Not used.
The flag is automatically turned OFF by the system
Bit 01: Not used.
when serial option port is restarted.
Bit 02: Parity error
Bit 03: Framing error Disabled during peripheral bus mode.
Bit 04: Overrun error In NT link mode, only bit 05 (timeout error) is
Bit 05: Timeout error enabled.
Bit 06: Not used. In Serial PLC Link mode, only the following bits are
Bit 07: Not used. enabled.
Errors at the Polling Unit:
Bit 05: Timeout error
Errors at Polled Units:
Bit 05: Timeout error
Bit 04: Overrun error
Bit 03: Framing error
*1 In the same way as for the existing 1:N NT Link, the status (communicating/not communicating) of PTs in
Serial PLC Links can be checked from the Polling Unit (CPU Unit) by reading the Built-in RS-232C Port Com-
municating with PT Flag (A394.00 to A394.07 for unit numbers 0 to 7) or the Serial Option Port Communicating
with PT Flag (A393.00 to A393.07 for unit numbers 0 to 7).
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.
z Wiring Example
Boiler A: CP1E (Polling Unit) Boiler B: CP1E (Polled Unit No. 0) Boiler C: CP1E (Polled Unit No. 1)
CP1W-TS101 CP1W-TS101 CP1W-TS101
CP1E N-type Temperature CP1E N-type Temperature CP1E N-type Temperature
CPU Unit Sensor Unit CPU Unit Sensor Unit CPU Unit Sensor Unit
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
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 PLC Link (Polling Unit) PLC link (Polled Unit)
Link words 10 (default)
PLC Link method All links
NT/PC Link Max. 1
PLC link polled 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
CP1L (Polling Unit) CP1L (Polled Unit No.1) CP1L (Polled Unit No. 0)
CIO 0
Input Bits Input Bits Input Bits
CIO 1
A_Temperature data 0 B_Temperature data 0 C_Temperature data 0
CIO 209
16
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
CIO 299
z Ladder Diagram
Boiler A Boiler B Boiler C
CP1E N-type CPU Unit CP1E N-type CPU Unit CP1E N-type CPU Unit
(polling unit) (Polled Unit No. 0) (Polled Unit No. 1)
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
16-7-1 Overview
Commands are sent from a host computer (not including Support Software) to the CP1E CPU Unit to
read and write data. The serial communications mode is set to Host Link.
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 OR the host com-
the PLC. Command
puter to the
Receive the PLC.
response.
- 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 CP1E CPU Unit using
RS-232C ports.
Set the PLC Setup (select Host Link for the serial
2 PLC Setup communications mode and set the communications
conditions) and transfer the PLC Setup from the
CX-Programmer to the CP1E CPU Unit.
17-1-1 Overview
The CP1E CPU Unit supports PID instructions with the autotuning function. Ladder programs can be
written to perform PID temperature control.
Temperature input: Input from Temperature Sensor Unit to words in the Input Area.
PID control: Execute using the PIDAT instruction in ladder program.
The PIDAT instruction is used in combination with the TPO instruction (TIME-PROPOR-
TIONAL 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 S: Input word
C C: First parameter word
D D: Output word
TPO
S S: Input word
C C: First parameter word
R R: Pulse output bit
CP1E
PID
Time-proportional
transistor output
Temperature Sensor
SSR
Additional Information
Sampling Cycle
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 Instruction Reference Manual (Cat. No. W483) for details.
2 Wiring I/O
Connect the temperature sensor to the Tempera-
ture Sensor Unit.
Connect the SSR to the transistor output.
5 Autotuning
Execute autotuning for the PID constants.
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).
3 The PID instruction will execute autotuning. When it has finished, the AT Command Bit (bit 15 in
C+9) will turn OFF. At the same time 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.
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 ON bit 15
of C+9 (AT Command Bit).
2 Turn ON the PIDAT instructions 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 0CH and 1CH terminal block 2CH
A K thermocouple is used for the temperature input. Use a CP1W-TS001 Temperature Sensor Unit
(thermocouple input).
The Temperature Sensor Units temperature input PV is stored in CIO 2.
The control output is the transistor output used to control the heater through the SSR using time-pro-
portional control.
The PIDAT sampling cycle is 1 second.
Control cycle: 20 s
When W0.00 turns ON, autotuning is immediately executed and PID control is started with the PID
constants calculated by autotuning.
TPO C+8:D108 #0000 and derivative constants: Time designation (bits 04 to 07: #9
hex)/MV limit control: No (bit 12: OFF)
C+9:D109 #8000
S D200 MV AT execution (bit 15: ON)/AT Calculation Gain = 1.00 (bits 0
C+10:D110 #000A to 11: #000 hex)
C D300
C+11:D111
D 100.00 Pulse Work Area
~
Work Area
C+6:D306
17
z Description
However, the PIDAT instruction can only handle unsigned hexadecimal data as the PV. The value is
thus converted from the range FF38 to 0514 to the PIDAT instruction input range of 0000 to 1FFF hex
(0 to 8191) using the APR instruction.
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: #3
RSET hex)/Input type: Manipulated variable (bits 4 to 7: #1 hex),
always read input (bit 8 to 11: #3 hex)/Output limit disabled
100.00 (bits 12 to 15: #0 hex)
C:D300 #0313
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 Thermocouples 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 160C, it is set as [8191/(1300+200)] (160+200) = 1966].
17-2-1 Overview
By turning one of the analog adjusters on the CP1E CPU Unit with a Phillips screwdriver, the PV in the
Auxiliary Area can be changed to any value within a range of 0 to 255. The PVs are in the following
words.
Analog adjuster 1: A642
Analog adjuster 1: A643
Any change to a set value is reflected in the next cycle.
Phillips screwdriver
Analog adjuster
Start condition
TIMX
0100
T0100
A642 17
100.00
Set values from the analog adjuster may vary with changes in the ambient temperature and the
power supply voltage. Do not use it for applications that require highly precise set values.
17-3-1 Overview
A minimum cycle time can be set for a CP1E CPU Unit. Variations in I/O response times can be elimi-
nated by repeating the program within the minimum cycle time.
Cyclic tasks
(ladder programs)
END
I/O refresh
This setting is effective only when the actual cycle time is shorter than the minimum cycle time setting.
If the actual cycle time is longer than the minimum cycle time setting, the actual cycle time will remain
unchanged.
17-4 Clock
The clock can be used only with the CP1E N-type CPU Unit.
17-4-1 Overview
The clock function can be used only with CP1E N-type CPU Units.
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 or 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
Additional Information
17-4 Clock
The clock cannot be used if a battery is not installed or the battery voltage is low.
If a Battery is not installed and the clock cannot be used because the power supply has been dis-
connected for longer than the I/O memory backup time, A509.13 (the I/O Memory Previous Cor-
ruption or Clock Stopped Flag (held at startup)) will turn ON.
17
17-4-1 Overview
z Time-related Instructions
Name Mnemonic Function
HOURS TO SEC Converts time data in hours/minutes/seconds format to an equiva-
SECONDS lent time in seconds only.
SECONDS TO HMS Converts seconds data to an equivalent time in hours/minutes/sec-
HOURS onds format.
CALENDAR ADD CADD Adds time to the calendar data in the specified words.
CALENDAR CSUB Subtracts time from the calendar data in the specified words.
SUBTRACT
CLOCK DATE Changes the internal clock setting to the setting in the specified
ADJUSTMENT source words.
I/O memory
PROGRAM mode
Areas not normally
Retained
retained, e.g., CIO
Area
MONITOR or RUN mode
I/O memory
MONITOR or RUN mode
Retained Areas not normally
retained, e.g., CIO
Area
PROGRAM mode
The following I/O memory areas are not retained: CIO Area (I/O bits), Work Area, Timer Completion
Flags, and Timer PVs.
When the IOM Hold Bit is ON, all outputs from Output Units will be retained when program execution
stops.
When the program starts again, outputs will have the same status that they had before the program
was stopped. (When the IOM Hold Bit is OFF, the status of the outputs will be cleared before instruc-
tions are executed.)
PLC Power ON
In order for all data in I/O memory to be retained when the PLC is turned ON, the IOM Hold Bit
(A500.12) must be ON and it must be protected in the PLC Setup.
I/O memory
z Procedure
1) Set the Disable Setting for Power OFF Interrupts in A530 to A5A5 hex to enable disabling Power OFF
Interrupts.
2) Enable disabling Power OFF Interrupts in the PLC Setup (this is the default setting).
3) Use the DI instruction to disable interrupts before the program section to be protected and then use
the EI instruction to enable interrupts after the section.
All instructions between the DI and EI instructions will be completed before the Power OFF Interrupt
is executed even if a power interruption occurs while executing the instructions between the DI and
EI instructions.
Execution condition
Power interruption
confirmed
D Instructions between E
I DI and EI executed I Stopped
17-6
17-6-1
17-6
17
17-6-1
Read Protection
With the CX-Programmer for CP1E, it is possible to set read protection using a password for each
PLC.
When the program is read-protected using a password, it is not possible to display or edit any of the
ladder programs using the CX-Programmer for CP1E unless the password is entered in the Disable
Password Dialog Box from the CX-Programmer for CP1E.
This enables improved security for PLC data in equipment.
z Protection Procedure
1 Go online and select PLC - Protection - Release Password. The Release Read Protection
Dialog Box will be displayed.
Additional Information
This function is equivalent to write protection using the DIP switch on the CPU Units in the CS/CJ
Series and the CP-series CP1H and CP1HL CPU Units.
z Procedure
A311 CH A310 CH
X, Y, and Z in manufacturing lot numbers will be converted to 10, 11, and 12, respectively, and stored.
17-8 Debugging
The CX-Programmer for CP1E can be used to force-set (turn ON) or force-reset (turn OFF) specified
bits in the CIO Area, Auxiliary Area or Holding Area, as well as timer and counter Completion Flags.
Forced status will take priority over status output from the program or status from I/O refreshing.
This status cannot be overwritten by instructions.
It will be retained regardless of the status of the program or external inputs until it is cleared from the
CX-Programmer for CP1E.
Force-set/reset operations are used to control the status of inputs and outputs during trial operation or
to control specific conditions during debugging.
Force-set/reset operations can be executed in either MONITOR or PROGRAM mode.
They cannot be used in RUN mode.
Bits in the following areas can be force-set and force-reset.
CIO Area (I/O bits and Serial PLC Link Bits), Work Area, Timer/Counter Completion Flag Areas, and
Holding Area.
17-8 Debugging
the CX-Programmer for CP1E when the CPU Unit is in MONITOR or PROGRAM mode. One or more
program sections can be added or changed at a time from the CX-Programmer for CP1E.
The function is designed for minor program changes without stopping the CPU Unit.
Online editing is possible simultaneously from more than one computer running the CX-Programmer for
CP1E as long as different tasks are edited.
17
17-8-3 Storing the Stop Position at Errors
This information makes it easier to determine where the fatal error occurred.
When a fatal error is cleared, the Program Error Task will be cleared.
The program address where task operation stopped is stored in A298 (rightmost bits of the program
address) and in A299 (leftmost bits of the program address).
The average, maximum, and minimum cycle times can be monitored when the CX-Programmer for
CP1E is connected online to a CPU Unit.
The average (mean), maximum, and minimum cycle times will be displayed in order from the top.
Click the Reset Button to recalculate and display the cycle time values.
Additional Information
The cycle time average value (= present value) and maximum value are stored in the following
Auxiliary Area words.
Average cycle time (= present value) (0.1-ms increments): A264 (lower bytes) and A265
(upper bytes)
Average Cycle Time (0.01-ms increments): A266 (lower digits) and A267 (upper digits)
Maximum Cycle Time (0.1-ms increments): A262 (lower bytes) and A263 (upper bytes)
The CPU Unit processes data in repeating cycles from the overseeing processing up to peripheral
servicing as shown in the following diagram.
19
Power ON
Overseeing processing
Error
Check OK?
Normal
Flashing (non-
ERR/ALM fatal error)
Program execution
NO
End of program?
YES
Cycle time calculation
I/O refresh
Peripheral
servicing
Peripheral servicing
The cycle time is the total time required for the PLC to perform the operations given in the following
tables.
Cycle time = (1) + (2) + (3) + (4) + (5)
(1) Overseeing
Processing time and
Operation
fluctuation cause
Checks the I/O bus and user memory, checks for battery errors, 0.4 ms
etc.
A minimum cycle time can be set in the PLC Setup between 1 and 32,000 ms in 1-ms increments.
Minimum cycle time Minimum cycle time Minimum cycle time
(When setting is (When setting is (When setting is
effective.) effective.) effective.)
This setting is effective only when the actual cycle time is shorter than the minimum cycle time setting.
If the actual cycle time is longer than the minimum cycle time setting, the actual cycle time will remain
unchanged.
Minimum cycle time
Minimum cycle time Minimum cycle time (When setting is effective.)
z PLC Setup
Name Description Default
Constant Cycle Time 0000 to 7D00 hex: 1 to 32,000 0000 hex: Variable cycle time
ms in 1-ms increments
z PLC Setup
Name Description Default
Watch Cycle Time enable setting 0: Default (1 s) 0000 hex: Watch
1: User setting cycle time of 1 s
Watch Cycle Time setting 001 to FA0 hex: 10 to 40,000 ms
(Valid only when bit 15 is set to 1 to (10-ms increments)
indicate a user setting.)
The average cycle time for the past eight cycles can be read from the CX-Programmer.
Additional Information
z I/O Refresh Times for CP-series Expansion Units and Expansion I/O Units
Unit name Model numbers I/O refresh time per Unit
Expansion I/O Units CP1W-40EDR 0.39ms
CPM1A-40EDR
CP1W-40EDT 0.39ms 19
CPM1A-40EDT
CP1W-40EDT1 0.39ms
Additional Information
The I/O refresh time for the built-in I/O of the CPU Unit is included in overseeing processing.
Calculation Example
Processing time
When editing online, the cycle time will be extended according to the editing that is performed.
Note When there is one task, online editing is processed all in the cycle time following the cycle in which online
editing is executed (written). When there are multiple tasks (the cyclic task and interrupt tasks), online editing
is separated, so that for n tasks, processing is executed over n to n 2 cycles max.
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:
Minimum I/O
Response Time
:I/O refresh
Inputs:
(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 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: 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
* The wait time occurs when there is competition with other interrupts.
As a guideline, the wait time will be 6 to 169 s.
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 in order of priority after the current inter-
rupt task has completed execution and the software interrupt response time has elapsed.
The interrupt response time of input interrupt tasks is calculated as follows:
Input interrupt response time = Input ON delay + Software interrupt response time
Inputs:
Interrupt task
execution:
Interrupt response Ladder program Return time
time for input execution time from input
interrupt task interrupt task
Cycle execution task
execution (main program):
The time from when execution of the input interrupt task is completed until
execution of the cycle execution task is resumed is 60 s.
Note Scheduled interrupt tasks can be executed during execution of the ladder program (even while an instruction
is being executed by stopping the execution of an instruction), I/O refresh, peripheral servicing, or overseeing.
The processing operation in which the scheduled interrupt occurs does not affect the interrupt processing
time.
Scheduled interrupts, however, are not executed during execution of other interrupt tasks even if the interrupt
conditions are satisfied. Instead, the interrupts are executed in order of priority after the current interrupt task
has completed execution and the software interrupt response time has elapsed.
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.
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
App
Appendices
Instrucion FUN
Instruction Mnemonic Function Page
Type No.
App
DIFFERENTIATE DIFD 014 DIFD(014) turns the designated bit ON for one cycle when the execution condi-
DOWN tion goes from ON to OFF (falling edge).
!DIFD
SET SET - SET turns the operand bit ON when the execution condition is ON.
@SET -
%SET -
!SET -
!@SET -
!%SET -
RESET RSET - RSET turns the operand bit OFF when the execution condition is ON.
@RSET -
%RSET -
!RSET -
!@RSET -
!%RSET -
MULTIPLE BIT SET SETA 530 SETA(530) turns ON the specified number of consecutive bits.
@SETA
MULTIPLE BIT RSTA 531 RSTA(531) turns OFF the specified number of consecutive bits.
RESET
@RSTA
SINGLE BIT SET SETB 532 SETB(532) turns ON the specified bit in the specified word when the execution
condition is ON.
@SETB
Unlike the SET instruction, SETB(532) can be used to set a bit in a DM or EM
!SETB
word.
!@SETB
SINGLE BIT RESET RSTB 533 RSTB(533) turns OFF the specified bit in the specified word when the execu-
tion condition is ON.
@RSTB
Unlike the RSET instruction, RSTB(533) can be used to reset a bit in a DM or
!RSTB
EM word.
!@RSTB
Instrucion FUN
Instruction Mnemonic Function Page
Type No.
Sequence END END 001 Indicates the end of a program.
Control
NO OPERATION NOP 000 This instruction has no function. (No processing is performed for NOP(000).)
Instructions
INTERLOCK IL 002 Interlocks all outputs between IL(002) and ILC(003) when the execution condi-
tion for IL(002) is OFF.
INTERLOCK ILC 003 All outputs between IL(002) and ILC(003) are interlocked when the execution
CLEAR condition for IL(002) is OFF.
MULTI-INTERLOCK MILH 517 When the execution condition for MILH(517) is OFF, the outputs for all instruc-
DIFFERENTIATION tions between that MILH(517) instruction and the next MILC(519) instruction
HOLD are interlocked.
MULTI-INTERLOCK MILR 518 When the execution condition for MILR(518) is OFF, the outputs for all instruc-
DIFFERENTIATION tions between that MILR(518) instruction and the next MILC(519) instruction
RELEASE are interlocked.
MULTI-INTERLOCK MILC 519 Clears an interlock started by an MILH(517) or MILR(518) with the same inter-
CLEAR lock number.
JUMP JMP 004 When the execution condition for JMP(004) is OFF, program execution jumps
directly to the first JME(005) in the program with the same jump number.
JUMP END JME 005 Indicates the end of a jump initiated by JMP(004) or CJP(510).
CONDITIONAL CJP 510 The operation of CJP(510) is the basically the opposite of JMP(004). When the
JUMP execution condition for CJP(510) is ON, program execution jumps directly to the
first JME(005) in the program with the same jump number.
FOR LOOP FOR 512 The instructions between FOR(512) and NEXT(513) are repeated a specified
number of times.
NEXT LOOP NEXT 513 The instructions between FOR(512) and NEXT(513) are repeated a specified
number of times.
BREAK LOOP BREAK 514 Programmed in a FOR-NEXT loop to cancel the execution of the loop for a
given execution condition. The remaining instructions in the loop are processed
as NOP(000) instructions.
Timer and HUNDRED-MS TIM - TIM/TIMX(550) operates a decrementing timer with units of 0.1-s.
Counter TIMER
TIMX 550
Instructions
TEN-MS TIMER TIMH 015 TIMH(015)/TIMHX(551) operates a decrementing timer with units of 10-ms.
TIMHX 551
ONE-MS TIMER TMHH 540 TMHH(540)/TMHHX(552) operates a decrementing timer with units of 1-ms.
TMHHX 552
ACCUMULATIVE TTIM 087 TTIM(087)/TTIMX(555) operates an incrementing timer with units of 0.1-s.
TIMER
TTIMX 555
LONG TIMER TIML 542 TIML(542)/TIMLX(553) operates a decrementing timer with units of 0.1-s.
TIMLX 553
COUNTER CNT - CNT/CNTX(546) operates a decrementing counter.
CNTX 546
REVERSIBLE CNTR 012 CNTR(012)/CNTRX(548) operates a reversible counter.
COUNTER
CNTRX 548
RESET TIMER/ CNR/ 545 CNR(545)/CNRX(547) resets the timers or counters within the specified range
COUNTER @CNR of timer or counter numbers.
CNRX/ 547
@CNRX
Instrucion FUN
Instruction Mnemonic Function Page
Type No.
App
LD, AND, 345
OR+>DT
LD, AND, 346
OR+>=DT
UNSIGNED CMP 020 Compares two unsigned binary values (constants and/or the contents of speci-
COMPARE fied words) and outputs the result to the Arithmetic Flags in the Auxiliary Area.
!CMP
DOUBLE CMPL 060 Compares two double unsigned binary values (constants and/or the contents of
UNSIGNED specified words) and outputs the result to the Arithmetic Flags in the Auxiliary
COMPARE Area.
SIGNED BINARY CPS 114 Compares two signed binary values (constants and/or the contents of specified
COMPARE words) and outputs the result to the Arithmetic Flags in the Auxiliary Area.
!CPS
DOUBLE SIGNED CPSL 115 Compares two double signed binary values (constants and/or the contents of
BINARY COMPARE specified words) and outputs the result to the Arithmetic Flags in the Auxiliary
Area.
TABLE COMPARE TCMP 085 Compares the source data to the contents of 16 words and turns ON the corre-
sponding bit in the result word when the contents are equal.
@TCMP
UNSIGNED BLOCK BCMP 068 Compares the source data to 16 ranges (defined by 16 lower limits and 16
COMPARE upper limits) and turns ON the corresponding bit in the result word when the
@BCMP
source data is within the range.
AREA RANGE ZCP 088 Compares the 16-bit unsigned binary value in CD (word contents or constant)
COMPARE to the range defined by LL and UL and outputs the results to the Arithmetic
Flags in the Auxiliary Area.
DOUBLE AREA ZCPL 116 Compares the 32-bit unsigned binary value in CD and CD+1 (word contents or
RANGE COMPARE constant) to the range defined by LL and UL and outputs the results to the
Arithmetic Flags in the Auxiliary Area.
Data Move- MOVE MOV 021 Transfers a word of data to the specified word.
ment Instruc-
@MOV
tions
!MOV
!@MOV
DOUBLE MOVE MOVL/ 498 Transfers two words of data to the specified words.
@MOVL
MOVE NOT MVN/ 022 Transfers the complement of a word of data to the specified word.
@MVN
MOVE BIT MOVB/ 082 Transfers the specified bit.
@MOVB
MOVE DIGIT MOVD/ 083 Transfers the specified digit or digits. (Each digit is made up of 4 bits.)
@MOVD
MULTIPLE BIT XFRB/ 062 Transfers the specified number of consecutive bits.
TRANSFER @XFRB
BLOCK TRANSFER XFER/ 070 Transfers the specified number of consecutive words.
@XFER
BLOCK SET BSET/ 071 Copies the same word to a range of consecutive words.
@BSET
DATA EXCHANGE XCHG/ 073 Exchanges the contents of the two specified words.
@XCHG
SINGLE WORD DIST/ 080 Transfers the source word to a destination word calculated by adding an offset
DISTRIBUTE @DIST value to the base address.
DATA COLLECT COLL/ 081 Transfers the source word (calculated by adding an offset value to the base
@COLL address) to the destination word.
Instrucion FUN
Instruction Mnemonic Function Page
Type No.
Data Shift SHIFT REGISTER SFT 010 Operates a shift register.
Instructions
REVERSIBLE SFTR/ 084 Creates a shift register that shifts data to either the right or the left.
SHIFT REGISTER @SFTR
WORD SHIFT WSFT/ 016 Shifts data between St and E in word units.
@WSFT
ARITHMETIC ASL/ 025
Shifts the contents of Wd one bit to the left.
SHIFT LEFT @ASL
ARITHMETIC ASR/ 026 Shifts the contents of Wd one bit to the right.
SHIFT RIGHT @ASR
ROTATE LEFT ROL/ 027 Shifts all Wd bits one bit to the left including the Carry Flag (CY).
@ROL
ROTATE RIGHT ROR/ 028 Shifts all Wd bits one bit to the right including the Carry Flag (CY).
@ROR
ONE DIGIT SHIFT SLD/ 074 Shifts data by one digit (4 bits) to the left.
LEFT @SLD
ONE DIGIT SHIFT SRD/ 075 Shifts data by one digit (4 bits) to the right.
RIGHT @SRD
SHIFT N-BITS LEFT NASL/ 580 Shifts the specified 16 bits of word data to the left by the specified number of
@NASL bits.
DOUBLE SHIFT NSLL/ 582 Shifts the specified 32 bits of word data to the left by the specified number of
N-BITS LEFT @NSLL bits.
SHIFT N-BITS NASR/ 581 Shifts the specified 16 bits of word data to the right by the specified number of
RIGHT @NASR bits.
DOUBLE SHIFT NSRL/ 583 Shifts the specified 32 bits of word data to the right by the specified number of
N-BITS RIGHT @NSRL bits.
Increment/ INCREMENT ++/ 590 Increments the 4-digit hexadecimal content of the specified word by 1.
Decrement BINARY @++
Instructions
DOUBLE INCRE- ++L/ 591 Increments the 8-digit hexadecimal content of the specified words by 1.
MENT BINARY @++L
DECREMENT --/ 592 Decrements the 4-digit hexadecimal content of the specified word by 1.
BINARY @--
DOUBLE DECRE- --L/ 593 Decrements the 8-digit hexadecimal content of the specified words by 1.
MENT BINARY @--L
INCREMENT BCD ++B/ 594 Increments the 4-digit BCD content of the specified word by 1.
@++B
DOUBLE INCRE- ++BL/ 595 Increments the 8-digit BCD content of the specified words by 1.
MENT BCD @++BL
DECREMENT BCD --B/ 596 Decrements the 4-digit BCD content of the specified word by 1.
@--B
DOUBLE DECRE- --BL/ 597 Decrements the 8-digit BCD content of the specified words by 1.
MENT BCD @--BL
Instrucion FUN
Instruction Mnemonic Function Page
Type No.
App
WITHOUT CARRY @+B
DOUBLE BCD ADD +BL/ 405 Adds 8-digit (double-word) BCD data and/or constants.
WITHOUT CARRY @+BL
BCD ADD WITH +BC/ 406 Adds 4-digit (single-word) BCD data and/or constants with the Carry Flag (CY).
CARRY @+BC
DOUBLE BCD ADD +BCL/ 407 Adds 8-digit (double-word) BCD data and/or constants with the Carry Flag (CY).
WITH CARRY @+BCL
SIGNED BINARY -/ 410 Subtracts 4-digit (single-word) hexadecimal data and/or constants.
SUBTRACT @-
WITHOUT CARRY
DOUBLE SIGNED -L/ 411 Subtracts 8-digit (double-word) hexadecimal data and/or constants.
BINARY @-L
SUBTRACT WITH-
OUT CARRY
SIGNED BINARY -C/ 412 Subtracts 4-digit (single-word) hexadecimal data and/or constants with the
SUBTRACT WITH @-C Carry Flag (CY).
CARRY
DOUBLE SIGNED -CL/ 413 Subtracts 8-digit (double-word) hexadecimal data and/or constants with the
BINARY WITH @-CL Carry Flag (CY).
CARRY
BCD SUBTRACT -B/ 414 Subtracts 4-digit (single-word) BCD data and/or constants.
WITHOUT CARRY @-B
DOUBLE BCD -BL/ 415 Subtracts 8-digit (double-word) BCD data and/or constants.
SUBTRACT @-BL
WITHOUT CARRY
BCD SUBTRACT -BC/ 416 Subtracts 4-digit (single-word) BCD data and/or constants with the Carry Flag
WITH CARRY @-BC (CY).
DOUBLE BCD -BCL/ 417 Subtracts 8-digit (double-word) BCD data and/or constants with the Carry Flag
SUBTRACT @-BCL (CY).
WITH CARRY
SIGNED BINARY / 420 Multiplies 4-digit signed hexadecimal data and/or constants.
MULTIPLY @
DOUBLE SIGNED L/ 421 Multiplies 8-digit signed hexadecimal data and/or constants.
BINARY MULTIPLY @L
BCD MULTIPLY B/ 424 Multiplies 4-digit (single-word) BCD data and/or constants.
@B
DOUBLE BCD BL/ 425 Multiplies 8-digit (double-word) BCD data and/or constants.
MULTIPLY @BL
SIGNED BINARY / 430 Divides 4-digit (single-word) signed hexadecimal data and/or constants.
DIVIDE @/
DOUBLE SIGNED /L 431 Divides 8-digit (double-word) signed hexadecimal data and/or constants.
BINARY DIVIDE @/L
BCD DIVIDE /B 434 Divides 4-digit (single-word) BCD data and/or constants.
@/B
DOUBLE BCD /BL 435 Divides 8-digit (double-word) BCD data and/or constants.
DIVIDE @/BL
Instrucion FUN
Instruction Mnemonic Function Page
Type No.
Conversion BCD TO BINARY BIN/ 023 Converts BCD data to binary data.
Instructions @BIN
DOUBLE BCD TO BINL/ 058 Converts 8-digit BCD data to 8-digit hexadecimal (32-bit binary) data.
DOUBLE BINARY @BINL
BINARY TO BCD BCD/ 024 Converts a word of binary data to a word of BCD data.
@BCD
DOUBLE BINARY BCDL/ 059 Converts 8-digit hexadecimal (32-bit binary) data to 8-digit BCD data.
TO DOUBLE BCD @BCDL
2S COMPLEMENT NEG/ 160 Calculates the 2' complement of a word of hexadecimal data.
@NEG
DATA DECODER MLPX/ 076 Reads the numerical value in the specified digit (or byte) in the source word,
@MLPX turns ON the corresponding bit in the result word (or 16-word range), and turns
OFF all other bits in the result word (or 16-word range).
DATA ENCODER DMPX/ 077 FInds the location of the first or last ON bit within the source word (or 16-word
@DMPX range), and writes that value to the specified digit (or byte) in the result word.
ASCII CONVERT ASC/ 086 Converts 4-bit hexadecimal digits in the source word into their 8-bit ASCII
@ASC equivalents.
ASCII TO HEX HEX/ 162 Converts up to 4 bytes of ASCII data in the source word to their hexadecimal
@HEX equivalents and writes these digits in the specified destination word.
Logic Instruc- LOGICAL AND ANDW/ 034 Takes the logical AND of corresponding bits in single words of word data and/or
tions @ANDW constants.
DOUBLE LOGICAL ANDL/ 610 Takes the logical AND of corresponding bits in double words of word data
AND @ANDL and/or constants.
LOGICAL OR ORW/ 035 Takes the logical OR of corresponding bits in single words of word data and/or
@ORW constants.
DOUBLE LOGICAL ORWL/ 611 Takes the logical OR of corresponding bits in double words of word data and/or
OR @ORWL constants.
EXCLUSIVE OR XORW/ 036 Takes the logical exclusive OR of corresponding bits in single words of word
@XORW data and/or constants.
DOUBLE EXCLU- XORL/ 612 Takes the logical exclusive OR of corresponding bits in double words of word
SIVE OR @XORL data and/or constants.
COMPLEMENT COM/ 029 Turns OFF all ON bits and turns ON all OFF bits in Wd.
@COM
DOUBLE COML/ 614 Turns OFF all ON bits and turns ON all OFF bits in Wd and Wd+1.
COMPLEMENT @COML
Special Math ARITHMETIC PRO- APR/ 069 Calculates the sine, cosine, or a linear extrapolation of the source data.
Instructions CESS @APR
BIT COUNTER BCNT/ 067 Counts the total number of ON bits in the specified word(s).
@BCNT
Instrucion FUN
Instruction Mnemonic Function Page
Type No.
App
SUBTRACT @-F the specified result words.
FLOATING- F/ 456 Multiplies two 32-bit floating-point numbers and places the result in the speci-
POINT MULTIPLY @F fied result words.
FLOATING- /F 457 Divides one 32-bit floating-point number by another and places the result in the
POINT DIVIDE @/F specified result words.
FLOATING =F 329 Compares the specified single-precision data (32 bits) or constants and creates
SYMBOL an ON execution condition if the comparison result is true. Three kinds of sym-
<>F 330
COMPARISON bols can be used with the floating-point symbol comparison instructions: LD
<F 331 (Load), AND, and OR.
<=F 332
>F 333
>=F 334
FLOATING- FSTR/ 448 Converts the specified single-precision floating-point data (32-bit decimal- point
POINT TO ASCII @FSTR or exponential format) to text string data (ASCII) and outputs the result to the
destination word.
ASCII TO FVAL/ 449 Converts the specified text string (ASCII) representation of single-precision
FLOATING-POINT @FVAL floating-point data (decimal-point or exponential format) to 32-bit single-preci-
sion floating-point data and outputs the result to the destination words.
Table Data SWAP BYTES SWAP/ 637 Switches the leftmost and rightmost bytes in all of the words in the range.
Processing @SWAP
Instructions
FRAME FCS/ 180 Calculates the ASCII FCS value for the specified range.
CHECKSUM @FCS
Data Control PID CONTROL PIDAT 191 Executes PID control according to the specified parameters. The PID constants
Instructions WITH AUTOTUN- can be auto-tuned with PIDAT(191).
ING
TIME-PROPOR- TPO 685 Inputs the duty ratio or manipulated variable from the specified word, converts
TIONAL OUTPUT the duty ratio to a time-proportional output based on the specified parameters,
and outputs the result from the specified output.
SCALING SCL/ 194 Converts unsigned binary data into unsigned BCD data according to the speci-
@SCL fied linear function.
SCALING 2 SCL2/ 486 Converts signed binary data into signed BCD data according to the specified
@SCL2 linear function. An offset can be input in defining the linear function.
SCALING 3 SCL3/ 487 Converts signed BCD data into signed binary data according to the specified
@SCL3 linear function. An offset can be input in defining the linear function.
AVERAGE AVG 195 Calculates the average value of an input word for the specified number of
cycles.
Subroutine SUBROUTINE SBS/ 091 Calls the subroutine with the specified subroutine number and executes that
Instructions CALL @SBS program.
SUBROUTINE SBN 092 Indicates the beginning of the subroutine program with the specified subroutine
ENTRY number.
SUBROUTINE RET 093 Indicates the end of a subroutine program.
RETURNI
Interrupt SET INTERRUPT MSKS/ 690 Sets up interrupt processing for I/O interrupts or scheduled interrupts.
Control MASK @MSKS
Instructions
CLEAR CLI/ 691 Clears or retains recorded interrupt inputs for I/O interrupts or sets the time to
INTERRUPT @CLI the first scheduled interrupt for scheduled interrupts.
DISABLE DI/ 693 Disables execution of all interrupt tasks except the power OFF interrupt.
INTERRUPTS @DI
ENABLE EI 694 Enables execution of all interrupt tasks that were disabled with DI(693).
INTERRUPTS
Instrucion FUN
Instruction Mnemonic Function Page
Type No.
High-speed MODE CONTROL INI/ 880 INI(880) is used to start and stop target value comparison, to change the
Counter and @INI present value (PV) of a high-speed counter, to change the PV of an interrupt
Pulse Output input (counter mode), to change the PV of a pulse output, or to stop pulse out-
Instructions put.
HIGH-SPEED PRV/ 881 PRV(881) is used to read the present value (PV) of a highspeed counter, pulse
COUNTER PV @PRV output, or interrupt input (counter mode).
READ
COMPARISON CTBL/ 882 CTBL(882) is used to perform target value or range comparisons for the
TABLE LOAD @CTBL present value (PV) of a high-speed counter.
SPEED OUTPUT SPED/ 885 SPED(885) is used to specify the frequency and perform pulse output without
@SPED acceleration or deceleration.
SET PULSES PULS/ 886 PULS(886) is used to set the number of pulses for pulse output.
@PULS
PULSE OUTPUT PLS2/ 887 PLS2(887) is used to set the pulse frequency and acceleration/deceleration
@PLS2 rates, and to perform pulse output with acceleration/deceleration (with different
acceleration/deceleration rates). Only positioning is possible.
ACCELERATION ACC/ 888 ACC(888) is used to set the pulse frequency and acceleration/deceleration
CONTROL @ACC rates, and to perform pulse output with acceleration/deceleration (with the
same acceleration/deceleration rate). Both positioning and speed control are
possible.
ORIGIN SEARCH ORG/ 889 ORG(889) is used to perform origin searches and returns.
@ORG
PULSE WITH PWM/ 891 PWM(891) is used to output pulses with a variable duty factor.
VARIABLE DUTY @PWM
FACTOR
Step STEP START SNXT 009 SNXT(009) is used in the following three ways:
Instructions (1)To start step programming execution.
(2)To proceed to the next step control bit.
(3)To end step programming execution.
STEP DEFINE STEP 008 STEP(008) functions in following 2 ways, depending on its position and whether
or not a control bit has been specified.
(1)Starts a specific step.
(2)Ends the step programming area (i.e., step execution).
Basic I/O Unit I/O REFRESH IORF/ 097 Refreshes the specified I/O words.
Instructions @IORF
7-SEGMENT SDEC/ 078 Converts the hexadecimal contents of the designated digit(s) into 8-bit, 7-seg-
DECODER @SDEC ment display code and places it into the upper or lower 8-bits of the specified
destination words.
DIGITAL SWITCH DSW 210 Reads the value set on an external digital switch (or thumbwheel switch) con-
INPUT nected to an Input Unit or Output Unit and stores the 4-digit or 8-digit BCD data
in the specified words.
MATRIX INPUT MTR 213 Inputs up to 64 signals from an 8 8 matrix connected to an Input Unit and
Output Unit (using 8 input points and 8 output points) and stores that 64-bit data
in the 4 destination words.
7-SEGMENT DIS- 7SEG 214 Converts the source data (either 4-digit or 8-digit BCD) to 7-segment display
PLAY OUTPUT data, and outputs that data to the specified output word.
Serial Com- TRANSMIT TXD/ 236 Outputs the specified number of bytes of data from the RS-232C port built into
munications @TXD the CPU Unit or the serial port of a Serial Communications Board (version 1.2
Instructions or later).
RECEIVE RXD/ 235 Reads the specified number of bytes of data from the RS-232C port built into
@RXD the CPU Unit or the serial port of a Serial Communications Board (version 1.2
or later).
Clock CALENDAR ADD CADD/ 730 Adds time to the calendar data in the specified words.
Instructions @CADD
CALENDAR CSUB/ 731 Subtracts time from the calendar data in the specified words.
SUBTRACT @CSUB
CLOCK DATE/ 735 Changes the internal clock setting to the setting in the specified source words.
ADJUSTMENT @DATE
Failure FAILURE ALARM FAL/ 006 Generates or clears user-defined non-fatal errors.
Diagnosis @FAL
Instructions
SEVERE FAILURE FALS 007 Generates user-defined fatal errors.
ALARM
Instrucion FUN
Instruction Mnemonic Function Page
Type No.
App
A-2
App
Note User programs are allocated tasks that can be executed within cyclic tasks and interrupt tasks
that satisfy interrupt conditions.
Execution times for most instructions differ depending on the CPU Unit used and the conditions when
the instruction is executed.
The execution time can also vary when the execution condition is OFF.
The following table also lists the length of each instruction in the Length (steps) column. The number of
steps required in the user program area for each instructions depends on the instruction and the oper-
ands used with it.
The number of steps in a program is not the same as the number of instructions.
Note 1 Most instructions are supported in differentiated form (indicated with , , @, and %).
Specifying differentiation will increase the execution times by the following amounts.
(unit:s)
CP1E CPU Unit
Symbol
CPU
or +0.5
@ or % +0.5
2 Use the following time as a guideline when instructions are not executed.
CP1E CPU Unit
CPU
0.05 0.30
Note When a double-length operand is used, add 1 to the value shown in the length column in the fol-
lowing table.
Note When a double-length operand is used, add 1 to the value shown in the length column in the
following table.
App
Not during interlock and interlock set
MULTI-INTERLOCK MILR 518 3 During interlock
DIFFERENTIATION RELEASE Not during interlock and interlock not set
Not during interlock and interlock set
MULTI-INTERLOCK CLEAR MILC 519 2 Interlock not cleared
Interlock cleared
JUMP JMP 004 2
JUMP END JME 005 2
CONDITIONAL JUMP CJP 510 2 When JMP condition is satisfied
FOR LOOP FOR 512 2 Designating a constant
BREAK LOOP BREAK 514 1
NEXT LOOP NEXT 513 1 When loop is continued
When loop is ended
Note When a double-length operand is used, add 1 to the value shown in the length column in the
following table.
Note When a double-length operand is used, add 1 to the value shown in the length column in the
following table.
Comparison Instructions
Length ON execution
FUN
Instruction Mnemonic (steps) time Conditions
No.
(See note) (s)
Input Comparison Instructions LD,AND,OR+= 300 4
(unsigned) LD,AND,OR+<> 305
LD,AND,OR+< 310
LD,AND,OR+<= 315
LD,AND,OR+> 320
LD,AND,OR+>= 325
Input Comparison Instructions LD,AND,OR+=+L 301 4
(double, unsigned) LD,AND,OR+<>+L 306
LD,AND,OR+<+L 311
LD,AND,OR+<=+L 316
LD,AND,OR+>+L 321
LD,AND,OR+>=+L 326
Input Comparison Instructions LD,AND,OR+=+S 302 4
(signed) LD,AND,OR+<>+S 307
LD,AND,OR+<+S 312
LD,AND,OR+<=+S 317
LD,AND,OR+>+S 322
LD,AND,OR+>=+S 327
Input Comparison Instructions LD,AND,OR+=+SL 303 4
(double, signed) LD,AND,OR+<>+SL 308
LD,AND,OR+<+SL 313
LD,AND,OR+<=+SL 318
LD,AND,OR+>+SL 323
LD,AND,OR+>=+SL 328
Time Comparison Instructions =DT 341 4
<>DT 342 4
<DT 343 4
<=DT 344 4
>DT 345 4
>=DT 346 4
COMPARE CMP 020 3
!CMP 020 7 Increase for immediate refresh
DOUBLE COMPARE CMPL 060 3
SIGNED BINARY COMPARE CPS 114 3
!CPS 114 7 Increase for immediate refresh
DOUBLE SIGNED BINARY CPSL 115 3
COMPARE
TABLE COMPARE TCMP 085 4
UNSIGNED BLOCK COMPARE BCMP 068 4
AREA RANGE COMPARE ZCP 088 3
DOUBLE AREA RANGE ZCPL 116 3
COMPARE
Note When a double-length operand is used, add 1 to the value shown in the length column in the
following table.
App
MOVE DIGIT MOVD 083 4
MULTIPLE BIT TRANSFER XFRB 062 Transferring 1 word
Transferring 1,000 words
BLOCK TRANSFER XFER 070 4 Transferring 1 word
Transferring 1,000 words
BLOCK SET BSET 071 4 Setting 1 word
Setting 1,000 words
DATA EXCHANGE XCHG 073 3
SINGLE WORD DISTRIBUTE DIST 080 4
DATA COLLECT COLL 081 4
Note When a double-length operand is used, add 1 to the value shown in the length column in the
following table.
Note When a double-length operand is used, add 1 to the value shown in the length column in the
following table.
Increment/Decrement Instructions
Length ON execution
FUN
Instruction Mnemonic (steps) time Conditions
No.
(See note) (s)
INCREMENT BINARY ++ 590 2
DOUBLE INCREMENT BINARY ++L 591 2
DECREMENT BINARY -- 592 2
DOUBLE DECREMENT BINARY --L 593 2
INCREMENT BCD ++B 594 2
DOUBLE INCREMENT BCD ++BL 595 2
DECREMENT BCD --B 596 2
DOUBLE DECREMENT BCD --BL 597 2
Note When a double-length operand is used, add 1 to the value shown in the length column in the
following table.
Note When a double-length operand is used, add 1 to the value shown in the length column in the
following table.
App
2S COMPLEMENT NEG 160 3
DATA DECODER MLPX 076 4 Decoding 1 digit (4 to 16)
Decoding 4 digits (4 to 16)
Decoding 1 digit (8 to 256)
Decoding 2 digits (8 to 256)
DATA ENCODER DMPX 077 4 Encoding 1 digit (16 to 4)
Encoding 4 digits (16 to 4)
Encoding 1 digit (256 to 8)
Encoding 2 digits (256 to 8)
ASCII CONVERT ASC 086 4 Converting 1 digit into ASCII
Converting 4 digits into ASCII
ASCII TO HEX HEX 162 4 Converting 1 digit
Note When a double-length operand is used, add 1 to the value shown in the length column in the
following table.
Logic Instructions
Length ON execution
FUN
Instruction Mnemonic (steps) time Conditions
No.
(See note) (s)
LOGICAL AND ANDW 034 4
DOUBLE LOGICAL AND ANDL 610 4
LOGICAL OR ORW 035 4
DOUBLE LOGICAL OR ORWL 611 4
EXCLUSIVE OR XORW 036 4
DOUBLE EXCLUSIVE OR XORL 612 4
COMPLEMENT COM 029 2
DOUBLE COMPLEMENT COML 614 2
Note When a double-length operand is used, add 1 to the value shown in the length column in the
following table.
Note When a double-length operand is used, add 1 to the value shown in the length column in the
following table.
Note When a double-length operand is used, add 1 to the value shown in the length column in the
following table.
Note When a double-length operand is used, add 1 to the value shown in the length column in the
following table.
App
ON execution time with duty designation
or displayed output limit
ON execution time with manipulated vari-
able designation and output limit enabled
SCALING SCL 194 4
SCALING 2 SCL2 486 4
SCALING 3 SCL3 487 4
AVERAGE AVG 195 4 Average of an operation
Average of 64 operations
Note When a double-length operand is used, add 1 to the value shown in the length column in the
following table.
Subroutine Instructions
Length ON execution
FUN
Instruction Mnemonic (steps) time Conditions
No.
(See note) (s)
SUBROUTINE CALL SBS 091 2
SUBROUTINE ENTRY SBN 092 2
SUBROUTINE RETURN RET 093 1
Note When a double-length operand is used, add 1 to the value shown in the length column in the
following table.
Note When a double-length operand is used, add 1 to the value shown in the length column in the
following table.
Note When a double-length operand is used, add 1 to the value shown in the length column in the
following table.
Note When a double-length operand is used, add 1 to the value shown in the length column in the
following table.
App
I/O Unit Instructions
Length ON execution
FUN
Instruction Mnemonic (steps) time Conditions
No.
(See note) (s)
I/O REFRESH IORF Refreshing 1 input word for CP1W
097 3
Expansion Unit
Refreshing 1 output word for CP1W
Expansion Unit
Refreshing 12 input words for CP1W
Expansion Unit
Refreshing 12 output words for CP1W
Expansion Unit
7-SEGMENT DECODER SDEC 078 4
MATRIX INPUT MTR 213 5 Data input value: 00
Data input value:FF
7-SEGMENT DISPLAY OUTPUT 7SEG 214 5 4 digits
8 digits
Note When a double-length operand is used, add 1 to the value shown in the length column in the
following table.
Note When a double-length operand is used, add 1 to the value shown in the length column in the
following table.
Clock Instructions
Length ON execution
FUN
Instruction Mnemonic (steps) time Conditions
No.
(See note) (s)
CALENDAR ADD CADD 730 4
CALENDAR SUBTRACT CSUB 731 4
CLOCK ADJUSTMENT DATE 735 2
Note When a double-length operand is used, add 1 to the value shown in the length column in the
following table.
Note When a double-length operand is used, add 1 to the value shown in the length column in the
following table.
Other Instructions
Length ON execution
FUN
Instruction Mnemonic (steps) time Conditions
No.
(See note) (s)
SET CARRY STC 040 1
CLEAR CARRY CLC 041 1
EXTEND MAXIMUM CYCLE TIME WDT 094 2
Note When a double-length operand is used, add 1 to the value shown in the length column in the
following table.
Shutter Operation
This example shows a ladder program that controls the following operation of a shutter control system.
App
A-4-1 Shutter Control System
A vehicle approaches the garage.
If the headlights are flashed three times within five seconds in front of the garage, a sensor detects
the light and sends a signal to open the shutter.
There are also buttons that can be pressed to open, close, and stop the shutter.
When the vehicle enters the garage, a sensor detects the vehicle and sends a signal to close the
shutter.
A button is pressed when the vehicle is going to exit the garage.
System Configuration
This section describes the configuration of the shutter control system.
The following control devices are used.
z PLC
CP1E CPU Unit with 20 Points and AC Power Input
z Inputs
Button to open shutter: PB1
Button to stop shutter: PB2
Button to close shutter: PB3
Sensor to detect vehicle: SEN1
Sensor to detect headlights of vehicle: SEN2
Limit switch that turns ON when shutter is opened all the way: LS1
Limit switch that turns ON when shutter is closed all the way: LS2
z Outputs
Contacts to activate motor to open shutter: MO1
Contacts to activate motor to close shutter: MO2
I/O bits in the CP1E CPU Unit are allocated to inputs and outputs.
z Inputs
Device Input Address
Open Button PB1 CIO 0.00
Stop Button PB2 CIO 0.01
App
Close Button PB3 CIO 0.02
Vehicle sensor SEN1 CIO 0.03
Headlight sensor SEN2 CIO 0.04
z Outputs
Device Output Address
Open motor MO1 CIO 100.00
Close motor MO2 CIO 100.01
8 inputs
Allocated
Output bits CIO 100 (100.00~100.05)
8 outputs
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
CIO 0
Cannot be used Input bits: 8
CIO 100
Can be used as work bits Output bits: 8
Allocated
For a CPU Unit with 20 I/O points, a total of 8 input bits are allocated to the input terminal block. The
bits that are allocated are input bits CIO 0.00 to CIO 0.07 (i.e., bits 00 to 11 in CIO 0).
In addition, a total of 6 output bits are allocated to the output terminal block. The bits that are allo-
cated are output bits CIO 100.00 to CIO 100.05 (i.e., bits 00 to 05 in CIO 0).
The upper bits (bits 8 to 15) not used in the input words cannot be used as work bits. Only the bits
that are not used in the output words (bits 06 to 15) can be used as work bits.
W0.00
Work bit
W0.00
TIM
Work bit 0000 Timer
#50
0.04
CNT
Headlight sensor 0000 Counters
T0000
#3
Timer
C0000
Counters
A200.11
Open Button
100.00
Open motor
Close Button Stop Button Close limit Open motor Close motor
sensor
100.01
Close motor
0.03
Vehicle sensor
App
PT Programming Console Supported. Not supported. Not supported.
function Force-setting/resetting bits Force-setting/resetting bits
is possible only from the is possible only from the
CX-Programmer for CP1E CX-Programmer for CP1E
Item CP1L CPU Units CP1E E-type CPU Units CP1E N-type CPU Units
CP1W-ME05M Memory Applicable. Cannot be used. Cannot be used.
Cassette (The Memory Cassette can
be used to back up program
data, DM Area initial data,
and other data from the
built-in flash memory or to
copy the data to another
CP1L CPU Unit.)
Terminal block CP1L-L: Not removable. Not removable. Not removable.
CP1L-M: Removable.
Automatic transfer from Supported. Not supported. Not supported.
Memory Cassette at startup
Option Boards CP1L L-type CPU Unit: 1 Not supported. 1 Board
Board
CP1L M-type CPU Unit: 2
Boards
CP1W-DAM01 LCD Option Applicable. Cannot be used. Cannot be used.
Board
Item CP1L CPU Units CP1E E-type CPU Units CP1E N-type CPU Units
App
H0.00 to H1535.15 H0.00 to H49.15 H0.00 to H49.15
Bits allocated Provided. Not provided (function is not Not provided (function is not
to function H512 to H1535 supported). supported).
blocks
Item CP1L CPU Units CP1E E-type CPU Units CP1E N-type CPU Units
High-speed counter Provided (256 interrupts) Provided (16 interrupts) Provided (16 interrupts)
interrupts
Bits allocated to interrupt CIO 0.04 to CIO 0.09 CIO 0.02 to CIO 0.07 CIO 0.02 to CIO 0.07
inputs and quick-response
inputs
Number of interrupt tasks 256 16 16
No.Interrupt task numbers Interrupt inputs: 2 and 3 Interrupt inputs: 1 Interrupt inputs: 1
Input interrupts (direct mode Input interrupts (direct Input interrupts (direct
or counter mode): modeonly; counter mode is modeonly; counter mode is
140 to 145 not supported): 2 to 7 not supported): 2 to 7
High-speed counter High-speed counter High-speed counter
interrupts: 0 to 255 interrupts: 0 to 15 interrupts: 0 to 15
High-speed counter inputs Increment, up/down, or Up/down or pulse plus direc- Up/down inputs: 100 kHz1
(pulse input methods) pulse plus direction inputs: tion inputs: 10 kHz2 counter, 10 kHz1 counter
100 kHz4 counters counters Pulse plus direction inputs:
Differential phases (4): 50 Increment input: 10 kHz6 100 kHz2 counters
kHz2 counters counters Increment input: 100 kHz2
(Internal direction bit added counters, 10 kHz4
for single-phase mode.) counters
Differential phases (4): (Internal direction bit added
5 kHz2 counters for single-phase mode.)
Differential phases (4): 5
kHz1 counter
High-speed Provided. Not provided. Not provided.
Counter Gate
Flag
Frequency Supported. Supported. Supported.
measurement
Measuring rota- Supported. Not supported. Not supported.
tion speed and
accumulative
rotations
Pulse Origin searches Supported. Not supported (because Supported.
outputs S-curve accel- Supported. CPU Units with transistor Not supported.
eration and outputs are not provided,
deceleration only those with relay out-
puts).
CW/CCW Supported. Not supported (pulse +
direction only)
Changing the Supported. Supported only for target
target position/ position.
speed during The target speed cannot be
position control changed.
or speed con-
trol
PWM outputs 2 outputs Not supported (because 1 output
(variable-duty- CPU Units with transistor
factor outputs) outputs are not provided,
only those with relay out-
puts).
Item CP1L CPU Units CP1E E-type CPU Units CP1E N-type CPU Units
App
output. provide a DC power output. provide a DC power output.
CPU Units with 30 or 40 CPU Units with 30 or 40
Points provide a DC power Points provide a DC power
output. output.
Item CP1L CPU Units CP1E E-type CPU Units CP1E N-type CPU Units
Serial communications Host Link,1:N NT Link, No- Not supported. Host Link,1:N NT Link, No-
protocols protocol, Serial PLC Link, protocol, Serial PLC Link,
and Modbus-RTU Easy and Modbus-RTU Easy
Master (A serial gateway is Master (A serial gateway is
used internally.) used internally.)
Note 1 CX-One (e.g., CX-
Programmer) con-
nection is not possi-
ble using the Host
Link protocol.
Unsolicited commu-
nications are not
supported for the
Host Link protocol.
2 Only one PT can be
connected for the
1:N NT Link protocol.
SPMA (screen data
transfer via a PLC)
is not possible
using the 1:N NT
Link protocol.
3 PTs cannot partici-
pate in the Serial
PLC Links.
4 A serial gateway is
provided for the
Modbus-RTU Easy
Master.
The following are supported: Not supported. The following are not sup-
serial gateway (functions for ported: serial gateway (func-
communications with tions for communications
OMRON components with OMRON components
(SAP/Smart FB) including (SAP/Smart FB)), toolbus,
Modbus-RTU Easy Master), 1:1 NT Link, 1:1 Link, PT
toolbus, 1:1 NT Link, 1:1 Programming Console func-
Link, PT Programming Con- tion with an NS-series PT.
sole function with an
NS-series PT.
Inverter positioning Supported. Not supported. Not supported.
functions
App
ACOSD
Timer and Counter MTIM/MTIMX TOCV
ATAND
Instructions Block Programming BPRG
SQRTD
Comparison Instructions MCMP Instructions BEND
EXPD
BCMP2 BPPS