Omron SYSMAC CP Series User Manual
Hide thumbs Also See for SYSMAC CP Series:
Table of Contents

Advertisement

Quick Links

Cat. No. W614-E1-01
SYSMAC CP Series
CP2E-E
CP2E-S
CP2E-N
CP2E CPU Unit Software
D -
D -
D -
USER'S MANUAL

Advertisement

Table of Contents
loading

Summary of Contents for Omron SYSMAC CP Series

  • Page 1 Cat. No. W614-E1-01 SYSMAC CP Series CP2E-E CP2E-S CP2E-N CP2E CPU Unit Software USER’S MANUAL...
  • Page 2 No patent liability is assumed with respect to the use of the information contained herein. Moreover, because OMRON is constantly striving to improve its high-quality products, the information contained in this manual is subject to change without notice. Every precaution has been taken in the preparation of this manual. Neverthe- less, OMRON assumes no responsibility for errors or omissions.
  • Page 4 SYSMAC CP Series CP2E-E CP2E-S CP2E-N CP2E CPU Unit Software User’s Manual Produced September 2019...
  • Page 5 Introduction Thank you for purchasing a SYSMAC CP-series CP2E Programmable Controller. This manual contains information required to use the CP2E. Read this manual completely and be sure you understand the contents before attempting to use the CP2E. Intended Audience This manual is intended for the following personnel, who must also have knowledge of electrical sys- tems (an electrical engineer or the equivalent).
  • Page 6 CP2E CPU Unit Manuals Information on the CP2E CPU Units is provided in the following manuals. Refer to the appropriate manual for the information that is required. This Manual CP2E CPU Unit Hardware CP2E CPU Unit Software CP1E/CP2E CPU Unit Instructions User’s Manual(Cat.
  • Page 7 Manual Configuration The CP2E CPU manuals are organized in the sections listed in the following tables. Refer to the appro- priate section in the manuals as required. CP2E CPU Unit Software User’s Manual (Cat. No. W614) (This Manual) Section Contents Section 1 Overview This section gives an overview of the CP2E, describes its application procedures.
  • Page 8 CP2E CPU Unit Hardware User’s Manual (Cat. No. W613) Section Contents Section 1 Overview and Specifica- This section gives an overview of the CP2E, describes its features, and tions provides its specifications. Section 2 Basic System Configura- This section describes the basic system configuration and unit models tion and Devices of the CP2E.
  • Page 9 Manual Structure Page Structure and Icons The following page structure and icons are used in this manual. Level 1 heading 5 Installation and wiring Level 2 heading Level 3 heading Installation Level 2 heading Gives the current headings. Level 3 heading 5-2-1 Installation Location DIN Track Installation...
  • Page 10 Terminology and Notation Term Description E-type CPU Unit An essential model of CPU Unit that supports connections to Programmable Terminals and basic control applications using instructions such as basic, movement, arithmetic, and comparison instructions. Essential models of CPU Units are called “E -type CPU Units”...
  • Page 11 Sections in this Manual Overview High-speed Counters Internal Memory Pulse Outputs in the CPU Unit CPU Unit Operation PWM Outputs Understanding Serial Programming Communications I/O Memory Ethernet I/O Allocation Other Functions Analog PLC Setup Option Board Overview of Built-in Programming Functions and Device Operations Allocations...
  • Page 12 CONTENTS Introduction ....................... 1 CP2E CPU Unit Manuals ................... 2 Manual Structure ....................... 5 Terms and Conditions Agreement................. 15 Safety Precautions ....................17 Precautions for Safe Use..................19 Regulations and Standards..................21 Software Licenses and Copyrights ............... 22 Related Manuals ...................... 23 Section 1 Overview CP2E Overview ........................
  • Page 13 Function Blocks........................4-8 4-3-1 Overview of Function Blocks....................... 4-8 4-3-2 Advantages of Function Blocks ....................4-8 4-3-3 Function Block Specifications ....................4-10 4-3-4 ST Language..........................4-12 Programming Instructions....................4-14 4-4-1 Basic Understanding of Instructions ..................4-14 4-4-2 Operands ..........................4-15 4-4-3 Instruction Variations.........................
  • Page 14 7-2-3 Input Constants Settings ......................7-4 7-2-4 Serial Option Port 1/Built-in RS-232C Port ................. 7-5 7-2-5 Serial Option Port 2/Built-in RS-485 Port ..................7-9 7-2-6 Serial Option Port 1 (EX) ......................7-13 7-2-7 Built-in Inputs ..........................7-16 7-2-8 Pulse Output 0 Settings ......................7-18 7-2-9 Pulse Output 1 Settings ......................
  • Page 15 11-5 Application Example ......................11-26 Section 12 Pulse Outputs 12-1 Overview..........................12-3 12-1-1 Overview........................... 12-3 12-1-2 Flow of Operation ........................12-4 12-1-3 Specifications.......................... 12-15 12-2 Positioning Control ......................12-16 12-2-1 Positioning Control Configuration ................... 12-16 12-2-2 Relative Positioning and Absolute Positioning ................ 12-16 12-2-3 Application Example .......................
  • Page 16 15-1-1 Connecting the CX-Programmer to PLCs Online via Ethernet ..........15-4 15-1-2 Exchanging Data between OMRON PLCs using Ethernet ............15-5 15-1-3 Creating an Original Communications Procedure Using TCP/IP(UDP/IP) for the Host Application or Communicating with PLCs from Another Manufacturer ........15-6 15-1-4 Automatically Adjusting the PLC’s Internal Clock at Regular Intervals ........
  • Page 17 15-6 Automatic Clock Adjustment and Specifying Servers by Host Name ......15-54 15-6-1 Automatic Clock Adjustment Function ..................15-54 15-6-2 Specifying Servers by Host Name ..................15-54 15-6-3 Procedure for Using the Automatic Clock Adjustment Function ..........15-55 15-6-4 PLC Setup for DNS and Automatic clock Adjustment............. 15-55 15-6-5 Auxiliary Area Allocations .......................
  • Page 18 18-2-3 Help............................18-6 18-3 Creating a Ladder Program ....................18-7 18-3-1 Inputting a Ladder Program ...................... 18-7 18-3-2 Saving and Reading Ladder Programs ................... 18-14 18-3-3 Editing Ladder Programs ......................18-16 18-4 Connecting Online to the CP2E and Transferring the Program ........18-18 18-4-1 Connecting Online........................
  • Page 19 Omron’s exclusive warranty is that the Products will be free from defects in materials and workman- ship for a period of twelve months from the date of sale by Omron (or such other period expressed in writing by Omron). Omron disclaims all other warranties, express or implied.
  • Page 20 Disclaimers Performance Data Data presented in Omron Company websites, catalogs and other materials is provided as a guide for the user in determining suitability and does not constitute a warranty. It may represent the result of Omron’s test conditions, and the user must correlate it to actual application requirements. Actual perfor- mance is subject to the Omron’s Warranty and Limitations of Liability.
  • Page 21 Safety Precautions Definition of Precautionary Information 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. Indicates an imminently hazardous situation which, WARNING if not avoided, will result in death or serious injury.
  • Page 22 Caution Caution Be sure to sufficiently confirm the safety at the destination when you transfer the program or I/O memory or perform procedures to change the I/O memory. Devices connected to PLC outputs may incorrectly operate regardless of the operat- ing mode of the CPU Unit.
  • Page 23 Precautions for Safe Use Observe the following precautions when using a CP-series PLC. Handling • Set the Unit properly as specified in the operation manual. Improper setting of the Unit may result in malfunction. • Check that the DIP switches and data memory (DM) are properly set before starting operation. •...
  • Page 24 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.
  • Page 25 Regulations and Standards Trademarks SYSMAC is a registered trademark for Programmable Controllers made by OMRON Corporation. CX-One is a registered trademark for Programming Software made by OMRON Corporation. Windows is a registered trademark of Microsoft Corporation. Other system names and product names in this document are the trademarks or registered trademarks of their respective companies.
  • Page 26 Software Licenses and Copyrights This product incorporates certain third party software. The license and copyright information associated with this software is shown at the following. Copyright (c) 2001-2004 Swedish Institute of Computer Science. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1.
  • Page 27 The following manuals are related to the CP2E. Use them together with this manual. Manual name Cat. No. Model numbers Application Contents SYSMAC CP Series W614 CP2E-E To learn the software Describes the following information for CP2E CP2E CPU Unit Soft- specifications of the PLCs.
  • Page 28 Manual name Cat. No. Model numbers Application Contents CXONE-AL D-V4 To install the soft- Describes the overview of the CX-One FA Inte- CX-One FA Integrated W463 ware provided in the grated Tool Package, and how to install and Tool Package Setup CX-One uninstall the CX-One.
  • Page 29 Overview This section gives an overview of the CP2E and describes its specifications. 1-1 CP2E Overview ..........1-2 1-1-1 Overview of Features .
  • Page 30 CP2E Overview 1-1-1 Overview of Features The SYSMAC CP2E Programmable Controller is a package-type PLC made by OMRON that is designed for easy application. The CP2E includes E -type CPU Units (essential models) that support connec- tions to Programmable Terminals and basic control applications using basic, movement, arithmetic, and...
  • Page 31 1 Overview Basic Operating Procedure In general, use the following procedure. 1. Setting Devices and Hardware Connect the CPU Unit, Expansion I/O Units, and Expansion Units. Set the DIP switches on the Option Board and Expansion Units as required. Refer to Section 3 Part Names and Functions and Section 5 Installation and Wiring in the CP2E CPU Unit Hardware User’s Manual (Cat.
  • Page 32 1 Overview CP2E CPU Unit Software User's Manual(W614)
  • Page 33: Table Of Contents

    Internal Memory in the CPU Unit This section describes the types of internal memory in a CP2E CPU Unit and the data that is stored. 2-1 Internal Memory in the CPU Unit ........2-2 2-1-1 CPU Unit Memory Backup Structure .
  • Page 34: Internal Memory In The Cpu Unit

    2 Internal Memory in the CPU Unit Internal Memory in the CPU Unit 2-1-1 CPU Unit Memory Backup Structure The internal memory in the CPU Unit consists of built-in RAM, built-in non-volatile RAM and built-in Flash Memory. The built-in RAM and built-in non-volatile RAM are used as execution memory and the built-in Flash Memory is used as backup memory.
  • Page 35: Memory Areas And Stored Data

    2 Internal Memory in the CPU Unit Built-in Flash Memory The built-in Flash Memory is the backup memory for user program, parameters, program source, com- ment and Data Memory backed up using control bits in the Auxiliary Area. Data is retained even if the power supply is interrupted. 2-1-2 Memory Areas and Stored Data The following table lists the CPU Unit memory areas and the data stored in each area.
  • Page 36: Transferring Data From A Programming Device

    2 Internal Memory in the CPU Unit 2-1-3 Transferring Data from a Programming Device Data that has been created using the CX-Programmer or CX-Integrator is transferred to the internal memory in the CPU Unit as shown in the following diagram. CX-Programmer CPU Unit User-created Programs...
  • Page 37 CPU Unit Operation This section describes the operation of the CP2E CPU Unit. Make sure that you under- stand the contents of this section completely before writing ladder programs. 3-1 CPU Unit Operation..........3-2 3-1-1 Overview of CPU Unit Operation .
  • Page 38: Cpu Unit Operation

    3 CPU Unit Operation CPU Unit Operation This section gives an overview of the CPU Unit operation, describes the operating modes, and explains how the Unit operates when there is a power interruption. 3-1-1 Overview of CPU Unit Operation The CPU Unit reads and writes data to the internal I/O memory areas while executing user ladder pro- grams by executing the instructions in order one at a time from the start to the end.
  • Page 39: Cpu Unit Operating Modes

    3 CPU Unit Operation 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. I/O Memory These are the PLC memory areas that are accessed by the ladder programs. SYSMAC PLCs refer to these areas as the I/O memory.
  • Page 40 3 CPU Unit Operation Changing the Operating Mode after Startup Use one of the following procedures. • Select PROGRAM, MONITOR, or RUN from the Startup Mode Menu. • Right-click the PLC in the project tree, and then select PROGRAM, MONITOR, or RUN from the Startup Mode Menu.
  • Page 41: Backing Up Memory

    3 CPU Unit Operation Backing Up Memory This section describes backing up the CP2E CPU Unit memory areas. 3-2-1 CPU Unit Memory Configuration Data backup to the CP2E CPU Unit’s built-in memory describes as below. Ladder Programs and Parameter Area Automatically backed up to the built-in Flash Memory whenever changed.
  • Page 42: Backing Up Ladder Programs And Parameter Area

    3 CPU Unit Operation 3-2-2 Backing Up Ladder Programs and Parameter Area Ladder programs and the parameter area are automatically backed up to and restored from the built-in Flash Memory. Backing Up Memory Ladder programs and parameter area are backed up to the built-in Flash Memory by transferring them from the CX-Programmer or writing them using online editing.
  • Page 43: Initializing I/O Memory At Startup

    3 CPU Unit Operation 3-2-4 Initializing I/O Memory at Startup For CP2E CPU Units, the held areas in I/O memory (Holding Area, Counter PVs, Counter Completion Flags and DM Area) are automatically retained in the built-in non-volatile RAM with no battery installed. Use the following way to clear these areas when the power supply is turned ON.
  • Page 44 3 CPU Unit Operation CP2E CPU Unit Software User’s Manual(W614)
  • Page 45 Understanding Programming This section provides basic information on ladder programming for CP2E CPU Units. 4-1 Programming..........4-2 4-1-1 User Programs .
  • Page 46: Programming

    4 Understanding Programming Programming 4-1-1 User Programs Structure of User Programs User programs are created by using the CX-Programmer. The user programs consist of the following parts. • Programs A program consists of more than one instruction and ends with an END instruction. •...
  • Page 47: Program Capacity

    4 Understanding Programming 4-1-2 Program Capacity The maximum program capacities of the CP2E CPU Units for all ladder programs (including symbol table and comments) are given in the following table. The total number of steps must not exceed the maximum program capacity. Unit type Model numbers Program capacity...
  • Page 48 4 Understanding Programming Number of Times Bits Can be Used and Connection Method • 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 to make the programs easier to understand and maintain even if it means using more input bits.
  • Page 49 4 Understanding Programming • A location error will occur if an instruction is not connected directly to the right bus bar. An input condition cannot be inserted after an OUT instruction or other output instruction. The input condition must be inserted before an OUT instruction or other output instruction. If it is inserted after an output instruction, then a location error will occur during the program check in the CX-Programmer.
  • Page 50: Tasks, Sections, And Symbols

    4 Understanding Programming Tasks, Sections, and Symbols 4-2-1 Overview of Tasks There are basically two types of tasks. Task settings must be made to use interrupt tasks with a CP2E CPU Unit. Applicable Task type Description programming Execution condition language Cyclic task Executed once per cycle Ladder diagram Only one for the CP2E.
  • Page 51 4 Understanding Programming Addresses are allocated to symbols using one of the following methods. • User Specified allocation • Automatic allocation using the CX-Programmer 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.
  • Page 52: Function Blocks

    4 Understanding Programming Function Blocks Function blocks can be used in programming SYSMAC CP-series PLCs. 4-3-1 Overview of Function Blocks A function block is a basic program element containing a standard processing function that has been defined in advance. Once the function block has been defined, the user just has to insert the function block in the program and set the I/O in order to use the function.
  • Page 53 4 Understanding Programming Structured Programming Structured programs created with function blocks have better design quality and required less devel- opment time. Easy-to-read “Block Box” Design The I/O operands are displayed as local variable names in the program, so the program is like a “black box”...
  • Page 54: Function Block Specifications

    4 Understanding Programming 4-3-3 Function Block Specifications Item Specifications Defining and creat- Number of function 64 max. ing function blocks block definitions Function block 32 characters max. names Variables Variable names 15,000 characters max. Variable types Input variables (Inputs), output variables (Outputs), internal vari- ables (Internals), and external variables (Externals)
  • Page 55 4 Understanding Programming Data Types that Can be Used in Function Blocks Availability in CP2E Data type Content Size Inputs Outputs In Out Internals Externals BOOL Bit data Integer DINT Double integer LINT Long (4-word) integer UINT Unsigned integer Unsigned double UDINT integer Unsigned long (4-word)
  • Page 56: St Language

    4 Understanding Programming 4-3-4 ST Language CP2E can use the ST (Structured Text) language within function blocks. The standard control statements, operators, and functions make the ST language ideal for mathemati- cal processing that is difficult to write in ladder programming. Additional Information For details on ST programming specifications, notation, and input procedures, refer to the CX- Programmer Operation Manual: Function Blocks and Structured Text (Cat.
  • Page 57 Data Type Conversion Functions Number-String Conversion Functions Data Shift Functions Data Control Functions Data Selection Functions * Only MOD Function is available. OMRON Expansion Functions Function type Availability in CP2E Memory Card Functions Communications Functions Angle Conversion Functions Timer/Counter Functions CP2E CPU Unit Software User’s Manual(W614)
  • Page 58: Programming Instructions

    4 Understanding Programming Programming Instructions 4-4-1 Basic Understanding of Instructions Structure of Instructions Programs consist of instructions. The conceptual structure of the inputs to and outputs from an instruc- tion is shown in the following diagram. Power flow (P.F., execution condition) * Power flow (P.F., execution condition) Instruction condition * Instruction condition...
  • Page 59: Operands

    4 Understanding Programming 4-4-2 Operands Operands specify preset instruction parameters that are used to specify I/O memory area contents or constants. Operands are given in boxes in the ladder programs. Addresses and constants are entered for the operands to enable executing the instructions. Operands are classified as source, destination, or number operands.
  • Page 60: Instruction Variations

    4 Understanding Programming 4-4-3 Instruction Variations The following variations are available for instructions to differentiate executing conditions and to refresh data when the instruction is executed (immediate refreshing). Variation Symbol Description − No variation used. These instructions are executed once every cycle while the execution condition is satisfied.
  • Page 61 4 Understanding Programming Input-differentiated Instructions Upwardly Differentiated Instructions (Instructions Preceded by @) • Output Instructions The instruction is executed only during the cycle in which the execution condition changes from OFF to ON. The instruction is not executed in the following cycle. 1.02 Example: @ Upwardly...
  • Page 62: Specifying Data In Operands

    4 Understanding Programming 4-4-5 Specifying Data in Operands Specifying Addresses Application Operand Description Example examples Specifying The word address and bit number are speci- 1.02 . 02 fied directly to specify a bit. Bit number 02 addresses Word address CIO 1 Bit number (00 to 15) Word address...
  • Page 63 4 Understanding Programming Application Operand Description Example examples Specifying An offset from the beginning of the DM Area MOV #0001 @D300 @D300 indirect DM is specified. The contents of the address will addresses in be treated as binary data (E -type CPU Contents &256 decimal...
  • Page 64: Data Formats

    4 Understanding Programming Operand Description Notation Application examples Auto- The contents of IR is incremented ,IR0++ LD ,IR0 ++ increment by +1 or +2 after referencing the Increments the contents of IR0 by 2 after value as an PLC memory address. the bit with the PLC memory address in IR0 +1: Specify ,IR + is loaded.
  • Page 65 4 Understanding Programming 4-digit Decimal Type Data format hexadeci- equivalent BCD (binary #0 to #9999 #0000 to coded deci- #9999 mal) BCD → Decimal → 0 to 9 0 to 9 0 to 9 0 to 9 − Single-preci- sion floating- point decimal Sign of Exponent...
  • Page 66: I/O Refresh Timing

    4 Understanding Programming 4-4-7 I/O Refresh Timing The following methods are used to refresh external I/O. • Cyclic refreshing • Immediate refreshing (instructions with the ! variation and IORF) Cyclic Refreshing I/O is all refreshed after ladder programs are executed. Start LD1.01 CIO 0001...
  • Page 67: Constants

    4 Understanding Programming Constants Overview Constants are numeric values expressed in 16 or 32 bits and can be specified as instruction operands. The following types of constants are supported. • Bit Strings or Numeric Values (Integers) Decimal values (with & symbol), hexadecimal values (with # symbol), BCD values (with # symbol), or signed decimal values (with + or - symbol) •...
  • Page 68 4 Understanding Programming Signed Binary Data type Decimal values Hexadecimal values Notation Signed + or - With # symbol FFF6 Decimal value Hexadecimal value using 0 to F (integer) Hexadecimal symbol + or - sign Application MOV -10 D0 MOV # FFF6 D0 example Stores 10 decimal (#FFF6 hex) in D0.
  • Page 69 4 Understanding Programming Using Operands to Specify Numbers Data type Decimal values Hexadecimal values or BCD values Notation No symbol (value only) Not possible. Number only Application SBS 0 example Jumps to subroutine 0. Precautions for An error will occur and the left bus bar correct use will be displayed in red if a decimal value is input with &...
  • Page 70 4 Understanding Programming Index Registers 4-6-1 What are Index Registers? Index Registers function as pointers to specify PLC memory addresses, which are absolute memory addresses in I/O memory. After storing a PLC memory address in an Index Register with MOVR or MOVRW, input the Index Register as an operand in other instructions to indirectly address the stored PLC memory address.
  • Page 71 4 Understanding Programming • Instructions for Direct Addressing of Index Registers: BINARY ADD (+L), BINARY SUBTRACT (−L), DOUBLE INCREMENT BINARY (++L), DOUBLE DECREMENT BINARY (−−L) Example: Stores the PLC memory MOVR(560) m IR0 Instruction A m address of m in IR0. Instruction A m+1 Repeats the process Instruction A ,IR0+...
  • Page 72 4 Understanding Programming The input condition is OFF (P_Off is the Always OFF Flag), so the SET instruction is not exe- cuted. Therefore, IR0 is not incremented and the value stored in IR0 remains PLC memory address CIO 0.13. • The following instructions are executed even when the interlock is active. Therefore, when indi- rect memory addresses are specified using auto-incrementing or auto-decrementing (,IR+ or ,IR-) in an operand of any of these instructions, the value in the Index Register (IR) is refreshed each cycle regardless of the input condition (increases or decreases one every...
  • Page 73 4 Understanding Programming Application Example for Index Registers The data in D0 to D99 (augend data) is added to the data in D100 to D199 (addend data) and the addi- tion results are output to D200 to D299. The operands of a single addition instruction are specified by index registers and the addition operations are performed by incrementing the index registers and repeatedly executing the addition instruction.
  • Page 74 4 Understanding Programming Direct Addressing of Index Registers The size of an index registers is two words per register for Index Registers IR0 to IR15, so use a double-word instruction (with an “L” in the mnemonic). Instruction group Instruction name Mnemonic Primary function Data Movement Instructions...
  • Page 75 4 Understanding Programming Example Note Be sure to use PLC memory addresses in Index Registers. IR storage words for task 1 D1000 Task 1 D1001 MOVL D1001 and D1000 stored in IR0 D1000 0000C000Hex MOVR Actual memory address of CIO D1000 C 0 0 0 0000...
  • Page 76: Specifying Offsets For Addresses

    4 Understanding Programming Specifying Offsets for Addresses 4-7-1 Overview When an address is specified for an instruction operand, it is possible to change the specified address by specifying in brackets an offset for the specified address. 0.00[W0] When the start address When the start Examples of is CIO 0.00 and W0 is...
  • Page 77 4 Understanding Programming Examples: a [2] 10.02 10.0 [2] 10.02 Offset (decimal value) Offset (decimal value) Start bit address; symbol a = 10.0 Start bit address (bit symbol named a) (bit address in I/O memory) 10.00 [W0] 10.02 a [b] 10.02 Offset when W0 = &2 Offset;...
  • Page 78: Application Examples For Address Offsets

    4 Understanding Programming Caution Program so that the memory area of the start address is not exceeded when using a word address or symbol for the offset. For example, write the program so that processing is executed only when the indirect specification does not cause the final address to exceed the memory area by using an input comparison instruction or other instruction.
  • Page 79: Ladder Programming Precautions

    4 Understanding Programming Ladder Programming Precautions 4-8-1 Special Program Sections For CP2E CPU Units, programs have special program sections that will control instruction conditions. The following special program sections are available. Instruction Program sections Instructions Status conditions Subroutine sections SBS, SBN, and RET instruc- Subroutine program The subroutine program tions...
  • Page 80 4 Understanding Programming Instructions not Supported in Subroutines The following instructions cannot be used in a subroutine. Classification Mnemonic Instruction by function Step Ladder STEP STEP DEFINE Instructions SNXT STEP NEXT Instructions not Supported in Step Ladder Program Sections The following instructions cannot be used in step ladder program sections. Classification Mnemonic Instruction...
  • Page 81 I/O Memory This section describes the types of I/O memory areas in a CP2E CPU Unit and the details. Be sure you understand the information in the section before attempting to write ladder diagrams. Refer to the CP1E/CP2E CPU Unit Instructions Reference Manual (Cat. No. W483) for detailed information on programming instructions.
  • Page 82: Overview Of I/O Memory Areas

    5 I/O Memory Overview of I/O Memory Areas This section describes the I/O memory areas in a CP2E CPU Unit. 5-1-1 I/O Memory Areas Data can be read and written to I/O memory from the ladder programs. I/O memory consists of an area for I/O with external devices, user areas, and system areas.
  • Page 83 5 I/O Memory User Areas These areas can be used freely by the user. Work Area (W) The Word 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.
  • Page 84 5 I/O Memory Counter Area (C) There are two parts to the Counter Area: the Counter Completion Flags and the Counter Present Values (PVs). Up to 256 counters with counter numbers C0 to C255 can be used. 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.
  • Page 85: I/O Memory Area Address Notation

    5 I/O Memory 5-1-2 I/O Memory Area Address Notation An I/O memory can be addressed using word addresses or bit addresses. The word addresses and bit addresses are given in decimal format. Word Addresses Specifies a16-bit word. I/O memory area The word number within designator the area given in decimal...
  • Page 86 5 I/O Memory 5-1-3 I/O Memory Areas Name No. of bits Word addresses Remarks Reference − CIO Area Input Bits 1,600 bits CIO 0 to CIO 99 Refer to 5-2 I/O Bits. (100 words) − Output Bits 1,600 bits CIO 100 to CIO 199 (100 words) −...
  • Page 87: I/O Bits

    5 I/O Memory I/O Bits Overview These words are allocated to built-in I/O terminals of CP2E CPU Units, CP-series Expansion Units and Expansion I/O Units. Notation 0 . 02 Bit number: 02 Word number: 0 I/O memory area designator: None on CX-Programmer, “CIO”...
  • Page 88: Work Area (W)

    5 I/O Memory Work Area (W) 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 20 .
  • Page 89: Holding Area (H)

    5 I/O Memory Holding Area (H) 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.
  • Page 90 5 I/O Memory Details • Bits in the Holding Area can be force-set and force-reset. • When a self-maintaining bit is programmed with a Holding Area bit, the self-maintaining bit will not be cleared even when the power is reset. •...
  • Page 91: Data Memory Area (D)

    5 I/O Memory Data Memory Area (D) Overview The DM area is used for general data storage and manipulation and is accessible only by word (16 bits). These words retain their contents when the PLC is turned ON or the operating mode is switched between PROGRAM mode and RUN or MONITOR mode.
  • Page 92 5 I/O Memory Applications The DM Area is for storing numeric data. It can be used for data exchange with Programmable Termi- nals, serial communications devices, such as Inverters, and Analog I/O Units or Temperature I/O Units. Details Bits in the DM Area cannot be addressed individually. Backing Up to the Built-in Flash Memory •...
  • Page 93: Timer Area (T)

    5 I/O Memory Timer Area (T) Overview The Timer Area contains Timer Completion Flags (1 bit each) and timer PVs (16 bits each). The Com- pletion Flag is turned ON when a decrementing timer PV reaches 0 (counting out) or an increment- ing/decrementing timer PV reaches the set value or 0.
  • Page 94 5 I/O Memory Timer PV Refresh Method Timer num- Timer PV refresh method bers T0 to T255 The timer PV is refreshed when the instruction is executed. This can cause a delay depending on the cycle time. • When the cycle time is longer than 100 ms, delay is generated by the TIM/TIMX instruction. •...
  • Page 95: Counter Area (C)

    5 I/O Memory Counter Area (C) Overview The Counter Area contains Completion Flags (1 bit each) and counter PVs (16 bits each). A Comple- tion Flag is turned ON when the counter PV reaches the set value (counting out). Completion Flags and counter PVs are automatically retained in the built-in non-volatile RAM even if the power supply is interrupted.
  • Page 96 5 I/O Memory Precautions for Correct Use Precautions for Correct Use It is not recommended to use the same counter number in two counter instructions because the counters will not operate correctly if they are counting simultaneously. If two or more counter instructions use the same counter number, an error will be generated dur- ing the program check.
  • Page 97: Index Registers (Ir)

    5 I/O Memory Index Registers (IR) Overview The sixteen Index Registers (IR0 to IR15) are used for indirect addressing. Each Index Register can hold a single PLC memory address, which is the absolute memory address of a word in I/O memory. These are different from the I/O memory area addresses in the CIO Area, DM Area, etc.
  • Page 98 5 I/O Memory I/O Memory Pointer Set to a base value with MOVR(560) or MOVRW(561). Index Register Initialization The Index Registers will be cleared in the following cases: • The operating mode is changed from PROGRAM mode to RUN/MONITOR mode or vice-versa and the IOM Hold Bit is OFF.
  • Page 99 5 I/O Memory Example This example shows how to store the PLC memory address of a word (CIO 2) in an Index Register (IR0), use the Index Register in an instruction, and use the auto-increment variation. MOVR 2 Stores the PLC memory address of CIO 2 in IR0. #0001 ,IR0 Writes #0001 to the PLC memory address contained in IR0.
  • Page 100 5 I/O Memory Precautions for Correct Use Precautions for Correct Use • Always set the value of an index register (IR) before using the index register. Operation will not be dependable if an index register is used without first setting its value. •...
  • Page 101: Data Registers (Dr)

    5 I/O Memory Data Registers (DR) Overview The sixteen Data Registers (DR0 to DR15) are used to offset the PLC memory addresses in Index Reg- isters when addressing words indirectly. The Data Registers can be used to specify an offset to add to an Index Register when addressing words indirectly.
  • Page 102 5 I/O Memory Range of Values The contents of Data Registers are treated as signed binary data and thus have a range of –32,768 to 32,767. Hexadecimal content Decimal equivalent 8000 to FFFF –32,768 to –1 0000 to 7FFF 0 to 32,767 The content of Data Registers cannot be accessed (read or written) from the CX-Programmer.
  • Page 103: Auxiliary Area (A)

    5 I/O Memory 5-10 Auxiliary Area (A) Overview The words and bits in this area have preassigned functions. Specific addresses (error log, clock area) at startup are automatically retained in the built-in non-volatile RAM even if the power supply is interrupted. Refer to A-2 Auxiliary Area Allocations by Address for details.
  • Page 104 5 I/O Memory 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.
  • Page 105 5 I/O Memory 5-11 Condition Flags Overview These flags include the flags that indicate the results of instruction execution, as well as the Always ON and Always OFF Flags. These bits are specified with symbols rather than addresses. The CX-Programmer treats condition flags as system-defined symbols (global symbols) beginning with P_. Notation P_ ER Condition flag name: ER...
  • Page 106 5 I/O Memory Name in CX- Name Function Programmer Less Than Flag P_LT Turned ON when the first operand of a Comparison Instruction is less than the second or a value is below a specified range. Negative Flag 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...
  • Page 107 5 I/O Memory 5-12 Clock Pulses Overview The Clock Pulses are turned ON and OFF by the CPU Unit’s internal timer. These bits are specified with symbols rather than addresses. The CX-Programmer treats condition flags as system-defined symbols (global symbols) beginning with P_. Notation P_ 0_02s Clock pulse name: 0_02s...
  • Page 108 5 I/O Memory Using the Clock Pulses The following example turns a bit ON and OFF at 0.5-s intervals. 100.00 P_1s Instruction Operand P_1s 100.00 100.00 0.5s 0.5s 5-28 CP2E CPU Unit Software User’s Manual(W614)
  • Page 109 I/O Allocation This section describes I/O allocation used to exchange data between the CP2E CPU Unit and other units. Be sure you understand the information in the section before attempting to write ladder diagrams. 6-1 Allocation of Input Bits and Output Bits ......6-2 6-1-1 I/O Allocation .
  • Page 110 This section describes the allocation of input bits and output bits. 6-1-1 I/O Allocation OMRON calls allocating I/O bits in memory “I/O allocation.” The I/O on Expansion I/O Units are allocated I/O bits in the words following the allocated words to the built-in I/O on the CPU Units.
  • Page 111 6 I/O Allocation 6-1-2 I/O Allocation Concepts The CPU Unit automatically allocates I/O bits to the Expansion I/O Units and Expansion Units, if con- nected when the power supply is turned ON. It is not necessary to specify I/O bits allocation. 6-1-3 Allocations on the CPU Unit Input bits are allocated from CIO 0 and output bits are allocated from CIO 100...
  • Page 112 6 I/O Allocation 6-1-4 Allocations to Expansion Units and Expansion I/O Units Expansion Units and Expansion I/O Units connected to the CPU Unit are automatically allocated input bits and output bits in words following those allocated to the CPU Unit. For example, if a CPU Unit with 40 I/O points is used, CIO 0 and CIO 1 are allocated for inputs and CIO 100 and CIO 101 are allocated for outputs.
  • Page 113 6 I/O Allocation I/O Bits Allocation with Expansion I/O Units Connected Allocation Example: Expansion I/O Unit with 40 I/O Points (CP1W-40ED ) Twenty-four input bits in two words are allocated (bits 00 to 11 in CIO m and bits 00 to 11 CIO m+1). Sixteen output bits in two words are allocated in two words (bits 00 to 07 in CIO n and bits 00 to 07 in CIO n+1).
  • Page 114 6 I/O Allocation Allocations for Expansion Units I/O Word Allocations to Expansion Units m: Indicates the next input word after the input word allocated to the Expansion Unit, Expansion I/O Unit, or CPU Unit connected to the left of the current Unit. n: Indicates the next output word after the output word allocated to the Expansion Unit, Expansion I/O Unit, or CPU Unit connected to the left of the current Unit.
  • Page 115 6 I/O Allocation I/O Word Allocations to Expansion Units Allocation Example: CPU Unit with 40 I/O Points + Temperature Senser Unit (TS002) + Analog Output Unit (DA041) + Expansion I/O Unit with 40 I/O points 3rd Unit: 1st Unit: 2nd Unit: Expansion I/O Unit with 40 CP1W-TS002 CP1W-DA041...
  • Page 116 6 I/O Allocation CP2E CPU Unit Software User’s Manual(W614)
  • Page 117 PLC Setup This section describes the parameters in the PLC Setup, which are used to make basic settings for the CP2E CPU Unit. 7-1 Overview of the PLC Setup ........7-2 7-2 PLC Setup Settings .
  • Page 118: Overview Of The Plc Setup

    7 PLC Setup Overview of the PLC Setup The PLC Setup contains basic CPU Unit software parameter settings that the user can change to cus- tomize PLC operation. These settings can be changed from a CX-Programmer. Change the PLC Setup in the following case. There is no need to reset, if the default (initial) settings are correct.
  • Page 119: Plc Setup Settings

    7 PLC Setup PLC Setup Settings 7-2-1 Startup and CPU Unit Settings Startup Data Read Setting When setting is read by Name Default Possible settings CPU Unit Clear retained memory area (HR/DM/CNT) Do not clear. Do not clear. When power is turned ON Clear.
  • Page 120: Timing And Interrupt Settings

    7 PLC Setup 7-2-2 Timing and Interrupt Settings Timing and Interrupt Settings When setting is read by Name Default Possible settings CPU Unit Watch Cycle Time No setting (1s) Setting At start of operation 1: 1 × 10 ms 100: 100 × 10 ms Constant Cycle Time No setting (variable) Setting...
  • Page 121: Serial Option Port 1/Built-In Rs-232C Port

    7 PLC Setup 7-2-4 Serial Option Port 1/Built-in RS-232C Port The settings are applicable to the N -type CPU Units with Serial Option port 1, and the E/S -type CPU units with built-in RS-232C port. Since this setting is reflected by power OFF and ON, the PLC Setup and the actual operation settings may be different.
  • Page 122 7 PLC Setup When setting is read by Name Default Possible settings CPU Unit RS-232C (No-protocol) Settings 2-3-1 Baud 9,600 bps 1,200 bps When power is turned ON 2,400 bps 4,800 bps 9,600 bps 19,200 bps 38,400 bps 57,600 bps 115,200 bps 2-3-2 Format...
  • Page 123 7 PLC Setup When setting is read by Name Default Possible settings CPU Unit 2-5-2 Format 7 bits, 2 bits, even 7 bits, 2 bits, even When power is turned ON (data length, stop bits, par- 7 bits, 2 bits, odd ity) 7 bits, 2 bits, no parity 7 bits, 1 bit, even...
  • Page 124 7 PLC Setup When setting is read by Name Default Possible settings CPU Unit Modbus RTU Slave Settings 1,200 bps 2-8-1 Baud 9,600 bps When power is turned ON 2,400 bps 4,800 bps 9,600 bps 19,200 bps 38,400 bps 57,600 bps 115,200 bps 8 bits, 1 bit, even 2-8-2...
  • Page 125: Serial Option Port 2/Built-In Rs-485 Port

    7 PLC Setup 7-2-5 Serial Option Port 2/Built-in RS-485 Port The settings are applicable to the N30/40/60 CPU Units with Serial Option port 2, and the S30/40/60 CPU units with built-in RS-485 port. Since this setting is reflected by power OFF and ON, the PLC Setup and the actual operation settings may be different.
  • Page 126 7 PLC Setup When setting is read by Name Default Possible settings CPU Unit RS-232C (No-protocol) Settings 2-3-1 Baud 9,600 bps 1,200 bps When power is turned ON 2,400 bps 4,800 bps 9,600 bps 19,200 bps 38,400 bps 57,600 bps 115,200 bps 2-3-2 Format...
  • Page 127 7 PLC Setup When setting is read by Name Default Possible settings CPU Unit 2-5-2 Format 7 bits, 2 bits, even 7 bits, 2 bits, even When power is turned ON (data length, stop bits, par- 7 bits, 2 bits, odd ity) 7 bits, 2 bits, no parity 7 bits, 1 bit, even...
  • Page 128 7 PLC Setup When setting is read by Name Default Possible settings CPU Unit Modbus RTU Slave Settings 1,200 bps 2-8-1 Baud 9,600 bps When power is turned ON 2,400 bps 4,800 bps 9,600 bps 19,200 bps 38,400 bps 57,600 bps 115,200 bps 8 bits, 1 bit, even 2-8-2...
  • Page 129: Serial Option Port 1 (Ex)

    7 PLC Setup 7-2-6 Serial Option Port 1 (EX) The settings are applicable to the N -type CPU Units when Serial Option Board CP2W-CIFD with 2 ports is mounted. Since this setting is reflected by power OFF and ON, the PLC Setup and the actual operation settings- may be different.
  • Page 130 7 PLC Setup When setting is read by Name Default Possible settings CPU Unit 2-1-6 Received Bytes (set- 256 bytes 256 bytes When power is turned ON ting) 1 byte 255 bytes 2-1-7 Set End Code (setting) 00 Hex 00 Hex When power is turned ON FF Hex 2-1-8...
  • Page 131 7 PLC Setup When setting is read by Name Default Possible settings CPU Unit PC Link (Master) Settings 2-5-1 Baud 9,600 bps 1,200 bps When power is turned ON 2,400 bps 4,800 bps 9,600 bps 19,200 bps 38,400 bps 57,600 bps 115,200 bps 2-5-2 Link Words...
  • Page 132: Built-In Inputs

    7 PLC Setup 7-2-7 Built-in Inputs High-speed Counter Settings When setting is read by Name Default Possible settings CPU Unit Use high-speed counter 0 Do not use. Do not use. When power is turned ON Use. Counting mode Linear mode Linear mode At start of operation Circular mode...
  • Page 133 7 PLC Setup When setting is read by Name Default Possible settings CPU Unit Use high-speed counter 3 Do not use. Do not use. When power is turned ON Use. Counting mode Linear mode Linear mode At start of operation Circular mode 4-1-1 Circular Max.
  • Page 134: Pulse Output 0 Settings

    7 PLC Setup When setting is read by Name Default Possible settings CPU Unit IN8: CIO 0.08 Normal Normal When power is turned ON (N20/30/40/60 CPU Unit only) Interrupt Quick IN9: CIO 0.09 Normal Normal When power is turned ON (N20/30/40/60 CPU Unit only) Interrupt Quick...
  • Page 135: Pulse Output 1 Settings

    7 PLC Setup When setting is read by Name Default Possible settings CPU Unit Origin Compensation Value 0 pps -2,147,483,648 At start of operation +2,147,483,647 1-10 Origin Search Acceleration Ratio 0 (disabled) 1 (pulse/4 ms) At start of operation (Rate) 65,535 (pulse/4 ms) 1-11 Origin Search Deceleration Ratio...
  • Page 136 7 PLC Setup Origin Search Settings When setting is read by Name Default Possible settings CPU Unit Use define origin operation Do not use. Do not use. When power is turned ON Use. Search Direction At start of operation Detection Method Method 0 Method 0 At start of operation...
  • Page 137: Pulse Output 2 Settings

    7 PLC Setup Origin Return Settings When setting is read by Name Default Possible settings CPU Unit Speed 0 pps (disabled) 1 pps At start of operation 100,000 pps Acceleration Ratio (rate) 0 (disabled) 1 (pulse/4 ms) At start of operation 65,535 (pulse/4 ms) Deceleration rate 0 (disabled)
  • Page 138: Pulse Output 3 Settings

    7 PLC Setup When setting is read by Name Default Possible settings CPU Unit Search High Speed 0 pps (disabled) 1 pps At start of operation 100,000 pps Search Proximity Speed 0 pps (disabled) 1 pps At start of operation 100,000 pps Origin Compensation Value 0 pps...
  • Page 139 7 PLC Setup Origin Search Settings When setting is read by Name Default Possible settings CPU Unit Use define origin operation Do not use. Do not use. When power is turned ON Use. Search Direction At start of operation Detection Method Method 0 Method 0 At start of operation...
  • Page 140: Built-In Ethernet Settings

    7 PLC Setup Origin Return Settings When setting is read by Name Default Possible settings CPU Unit Speed 0 pps (disabled) 1 pps At start of operation 100,000 pps Acceleration Ratio (rate) 0 (disabled) 1 (pulse/4 ms) At start of operation 65,535 (pulse/4 ms) Deceleration rate 0 (disabled)
  • Page 141 7 PLC Setup When Setting is read by Name Default Possible Settings CPU Unit FINS/TCP Connection Setting FINS/TCP Connection No.1 FINS/TCP Server/Client Mode Server Server When power is turned ON or when Ethernet is reset Client Connection IP Address 0.0.0.0 0.0.0.0 When power is turned ON or when Ethernet is reset...
  • Page 142 7 PLC Setup FINS/UDP Settings When Setting is read by Name Default Possible Settings CPU Unit FINS/UDP Port Number Mode 9600 Default (9600) When power is turned ON or when Ethernet is reset User FINS/UDP Port Number (User) 9600 0 (9600) When power is turned ON or when Ethernet is reset (Default value: 0)
  • Page 143 7 PLC Setup When setting is read by Name Default Possible Settings CPU Unit 15-3 SNTP Port Number 0 (123) When power is turned ON or when Ethernet is reset (Default value: 0) 65,535 15-4 Retry Time 0 (10s) When power is turned ON or when Ethernet is reset (Default value: 0) 255s...
  • Page 144 7 PLC Setup 7-28 CP2E CPU Unit Software User’s Manual(W614)
  • Page 145 Overview of Built-in Functions and Allocations This section describes the built-in functions, overall procedure, and allocations for func- tions of the CP2E. 8-1 Built-in Functions ..........8-2 8-2 Overall Procedure for Using CP2E Built-in Functions.
  • Page 146: Built-In Functions

    8 Overview of Built-in Functions and Allocations Built-in Functions The following built-in functions are provided by the CP2E CPU Units. Type CP2E E -type CPU Units CP2E S -type CPU Units CP2E N -type CPU Units Reference Function Appearance Quick-response inputs 6 inputs 6 inputs N14 CPU Units: 6 inputs...
  • Page 147: Overall Procedure For Using Cp2E Built-In Functions

    8 Overview of Built-in Functions and Allocations Overall Procedure for Using CP2E Built-in Functions The overall procedure for using built-in CP2E functions is described in this section. Select the functions to use. Select Functions Example: Interrupts, high-speed counter inputs, and pulse outputs. Set the functions with the applicable numbers Refer to Section 7 using the CX-Programmer.
  • Page 148: Terminal Allocations For Built-In Functions

    8 Overview of Built-in Functions and Allocations Terminal Allocations for Built-in Functions 8-3-1 Specifying the Functions to Use A CP2E CPU Unit uses the same built-in I/O terminals for different functions. Allocate the I/O terminals in advance, making sure that each terminal is used for only one function. Specify the input functions in the PLC Setup from the CX-Programmer, and specify the output functions in PLC Setup and programming instructions.
  • Page 149 8 Overview of Built-in Functions and Allocations • 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. Select the Use define origin operation Check Box.
  • Page 150: Allocating Built-In Input Terminals

    8 Overview of Built-in Functions and Allocations 8-3-3 Allocating Built-in Input Terminals Allocating Functions to Built-in Input Terminals Input terminals are allocated functions by setting parameters in the PLC Setup. Set the PLC Setup so that each terminal is used for only one function. E20/30/40/60, S30/40/60 or N20/30/40/60 CPU Units PLC Setup Origin search...
  • Page 151 8 Overview of Built-in Functions and Allocations E14 or N14 CPU Units PLC Setup Origin search Interrupt input settings on Built-in Input Tab High-speed counter 0 to 5 settings on settings on Pulse Terminal Page Built-in Input Tab Page Output 0/1 Tab Page Terminal block number...
  • Page 152: Allocating Built-In Output Temrinals

    8 Overview of Built-in Functions and Allocations 8-3-4 Allocating Built-in Output Temrinals Allocating Functions to Built-in Output Terminals 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. PLC Setup When a pulse output instruc- When the PWM...
  • Page 153 Quick-response Inputs This section describes the quick-response inputs that can be used to read signals that are shorter than the cycle time. 9-1 Quick-response Inputs ......... . 9-2 9-1-1 Overview.
  • Page 154 9 Quick-response Inputs Quick-response Inputs Quick-response inputs can be used with any model of CP2E CPU Unit. 9-1-1 Overview The quick-response inputs can read pulses with an ON time as short as 50 µs even if they are shorter than the cycle time. Use the quick-response inputs to read signals shorter than the cycle time, such as inputs from photomicrosensors.
  • Page 155 9 Quick-response Inputs 9-1-2 Flow of Operation • Set IN2 to IN9 for quick-response inputs on the Built-in Input PLC Setup Tab Page of the PLC Setup using the CX-Programmer. • The terminals 02 to 09 of CIO 0 can be used for quick- response inputs.
  • Page 156 9 Quick-response Inputs Note 1 The power supply must be restarted after the PLC Setup is transferred in order to validate the quick- response input settings. 2 IN8 and IN9 are only supported by N20/30/40/60 CPU Units. Quick-response Input Terminal The following terminals can be used for quick-response inputs.
  • Page 157 Interrupts This section describes the interrupts that can be used with CP2E PLCs, including input interrupts and scheduled interrupts. 10-1 Interrupts ........... 10-2 10-1-1 Overview .
  • Page 158: Interrupts

    10 Interrupts 10-1 Interrupts 10-1-1 Overview CP2E CPU Units normally repeat processes in the following order: overseeing processes, program exe- cution, I/O refreshing, peripheral servicing. During the program execution stage, cyclic tasks (ladder programs) are executed. The interrupt function, on the other hand, allows a specified condition to interrupt a cycle and execute a specified program.
  • Page 159: Input Interrupts

    10 Interrupts 10-2 Input Interrupts Input interrupts can be used with any model of CP2E CPU Unit. 10-2-1 Overview A corresponding interrupt task can be executed when a built-in input on the CPU Unit turns ON or turns OFF. Interrupt input Built-in input Interrupt input bit turns ON or OFF Interrupt task...
  • Page 160: Flow Of Operation

    10 Interrupts 10-2-2 Flow of Operation • Set IN2 to IN9 for interrupt inputs on the Built-in Input PLC Setup Tab Page of the PLC Setup using the CX-Programmer. • Terminals 02 to 09 on the CIO 0 terminal block can be used for interrupt inputs.
  • Page 161 10 Interrupts Built-in Input Tab Page Corresponding Input interrupt Interrupt input settings bit address task Select Interrupt for CIO 0.02 IN2 to IN9. CIO 0.03 CIO 0.04 CIO 0.05 CIO 0.06 CIO 0.07 CIO 0.08 CIO 0.09 Note 1 The power supply must be restarted after the PLC Setup is transferred in order to enable the interrupt input settings.
  • Page 162 10 Interrupts Execute MSKS Instruction in a Cyclic Task Execute the MSKS instruction from the ladder program in a cyclic task to use input interrupts. MSKS has the following two functions and two of this instruction are normally used in combination. (1)Specifying whether to detect ON or OFF signals.
  • Page 163 10 Interrupts (2)Enabling the Input Interrupt Operand N Operand C PLC Setup on Corresponding Interrupt Terminal Built-in Input Interrupt bit address task number Enable/Disable Tab Page identifier 02 on CIO 0 CIO 0.02 Interrupt input #0000: terminal block Enable interrupt 03 on CIO 0 CIO 0.03 Interrupt input...
  • Page 164: Application Example

    10 Interrupts 10-2-3 Application Example In this example, bent parts are detected in a moving workpiece, such as an IC component. When the sensor input (terminal 02 on terminal block 0CH = CIO 0.02) changes from OFF to ON, the interrupt task is executed.
  • Page 165 10 Interrupts Programming Example Cyclic Task P_First_Cycle Interrupt input 2 The MSKS instruction is used to specify an interrupt when the Specifies executing input turns ON and then it is interrupt when input used to unmask the input turns ON. interrupt.
  • Page 166: Scheduled Interrupts

    10 Interrupts 10-3 Scheduled Interrupts Scheduled interrupts can be used with any model of CP2E CPU Unit. 10-3-1 Overview Scheduled interrupts can be used to execute interrupt tasks at fixed time intervals measured by the CPU Unit’s internal timer. Minimum interval: 1 ms Specified interval Interrupt task Cyclic tasks...
  • Page 167: Flow Of Operation

    10 Interrupts 10-3-2 Flow of Operation Write the program for the corresponding interrupt task 1 (fixed). Interrupt task Create ladder Use MSKS to specify the scheduled interrupt interval. Execute MSKS program The setting can be 1 ms or longer. instruction in a cyclic Set N to 4 or 14 in the MSKS instruction.
  • Page 168 10 Interrupts Specifying MSKS Operands (N and C) MSKS Operands MSKS Operands Interrupt number Scheduled interrupt interval Scheduled interrupt (interrupt 0 decimal: Disable interrupt (stop internal timer) task 1)* 10 to 9,999 decimal:Enable interrupt (Reset internal timer 14: Reset and restart and then start timer with interrupt interval between 1.0 4: Reset and restart and 999.9 ms)
  • Page 169: Precautions For Using Interrupts

    10 Interrupts 10-4 Precautions for Using Interrupts 10-4-1 Interrupt Task Priority and Order of Execution The priority of interrupt tasks is the same order for input interrupts, scheduled interrupts and high-speed counter interrupts. Therefore, if interrupt task A (an input interrupt, for example) is being executed when interrupt task B (a scheduled interrupt, for example) occurs, task A execution will not be interrupted.
  • Page 170 10 Interrupts 10-14 CP2E CPU Unit Software User’s Manual(W614)
  • Page 171 High-speed Counters This section describes the high-speed counter inputs, high-speed counter interrupts, and the frequency measurement function. 11-1 Overview ........... . 11-2 11-1-1 Overview .
  • Page 172: Overview

    11 High-speed Counters 11-1 Overview High-speed counters can be used with any model of CP2E CPU Unit. 11-1-1 Overview High-speed counters are used to measure high-speed pulse input signals that cannot be measured by counter (CNT) instructions. Applications • Detecting the position or length of a workpiece with an input from an incremental rotary encoder. •...
  • Page 173: Flow Of Operation

    11 High-speed Counters 11-1-2 Flow of Operation • Enable the required high-speed counters. PLC Setup • Select the Use high speed counter Check Box for high- speed counters 0 to 5. Set the input setting, counting mode and reset method on the Built-in Input Tab Page of the PLC Setup using the CX-Programmer.
  • Page 174 11 High-speed Counters Built-in Input Tab Page Item Setting Use high Use high-speed Select Use high speed counter for each counter to be used. speed counter counter 0 Counting Mode Select Linear mode or Circular mode. to 5 Circular Max. Count If circular mode is selected, set the maximum ring count.
  • Page 175 11 High-speed Counters Input terminal block Pulse input method (Counting mode) Other functions that cannot be used at the same time Terminal Differential phase Pulse/ Origin searches Increment Interrupt Quick-response block Terminal ×4 or up/down direction Normal input for pulse out- pulse input input input...
  • Page 176 11 High-speed Counters Wiring Example for High-speed Counter Input Terminals Using a 24-VDC Open-collector Encoder The following example shows the connections of an encoder with phase-A, phase-B, and phase-Z inputs to high-speed counter 0. CP2E CPU Unit (Differential Phase Input Mode) (High-speed counter 0: Phase A 0 V) Black Phase A 0.00...
  • Page 177: Specifications

    11 High-speed Counters 11-1-3 Specifications Item Description Pulse input method Increment pulse Differential phase Up/down pulse Pulse + direction (Counting mode) inputs inputs (×4) inputs inputs Input signal Increment Phase-A Up pulse Pulse − Phase-B Down pulse Direction − Phase-Z Reset Reset Frequency...
  • Page 178: High-Speed Counter Inputs

    11 High-speed Counters 11-2 High-speed Counter Inputs 11-2-1 Pulse Input Methods Settings There are four pulse input methods for high-speed counters. • Increment pulse input • Differential phase input (4×) • Up/Down pulse input • Pulse+direction input Increment Pulse Input The Increment Pulse Input counts signals on a single-phase pulse input.
  • Page 179 11 High-speed Counters Pulse + Direction Input The Pulse + Direction Input uses a direction signal and a pulse signal. The count is incremented or dec- remented depending on the status (ON or OFF) of the direction signal. Conditions for Incrementing/ Decrementing the Count Pulse Direction...
  • Page 180: Counting Ranges Settings

    11 High-speed Counters 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.
  • Page 181: Reset Methods

    11 High-speed Counters Circular (Ring) Mode Input pulses are counted in a loop within the set range. • If the count is incremented from the maximum ring count, the count will be reset to 0 automatically and incrementing will continue. •...
  • Page 182: Reading The Present Value

    11 High-speed Counters Software Reset The high-speed counter’s PV is reset when the corresponding High-speed Counter Reset Bit (A531.00 to A531.05) goes from OFF to ON. The CPU Unit recognizes the OFF-to-ON transition of the High-speed Counter Reset Bit only at the begin- ning of the PLC cycle during the overseeing processes.
  • Page 183: Frequency Measurement

    11 High-speed Counters 11-2-5 Frequency Measurement Overview This function measures the frequency of the high-speed counter (input pulses.) The input pulse frequency can be read by executing the PRV instruction. The measured frequency is output in 8-digit hexadecimal and expressed in Hz. The frequency measurement function can be used with high-speed counter 0 only.
  • Page 184: High-Speed Counter Interrupts

    11 High-speed Counters 11-3 High-speed Counter Interrupts High-speed counter interrupts can be used with any model of CP2E CPU Unit. 11-3-1 Overview This function counts input pulses with the CPU Unit’s built-in high-speed counter and executes an inter- rupt task when the count reaches the preset value or falls within a preset range (target-value or zone comparison).
  • Page 185 11 High-speed Counters Flow of Operation • Enable the required high-speed counters. PLC Setup • Select the Use high speed counter Check Box for high-speed counters 0 to 5. Set the input setting, counting mode and reset method on the Built-in Tab Page of the PLC Setup using the CX-Pro- grammer.
  • Page 186 11 High-speed Counters 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. Refer to 11-1-2 Flow of Operation in Page 11-3 for details. Determining High-speed Counter High-speed counters 0 to 5 can be used for high-speed counter interrupts.
  • Page 187: Present Value Comparison

    11 High-speed Counters Execution of CTBL and INI Instructions for Cyclic Task Execute the instructions in the following order. Register the comparison table with the CTBL (COMPARISON Register the comparison table TABLE LOAD) instruction. Specify the interrupt tasks to be started in this step.
  • Page 188 11 High-speed Counters Example 2 High-speed counter PV Comparison table Number of values = 4 Target value 1 (when counting up) Target value 1 Target value 2 Interrupt task = 0 Comparison is Target value 2 (when counting down) executed according Interrupt task = 1 to the order of the Target value 3...
  • Page 189 11 High-speed Counters Precautions for Correct Use Precautions for Correct Use • There are restrictions on the maximum response frequencies of the high-speed counters when using target matching. Use the counters for target matching under the frequencies in the following table. If the pulse frequencies input to the high-speed counters are higher than those in the table, target matching may be omitted.
  • Page 190: High-Speed Counter Interrupt Instruction

    11 High-speed Counters Precautions for Correct Use Precautions for Correct Use 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.
  • Page 191 11 High-speed Counters Contents of the Comparison Table • Target-value Comparison Table Depending on the number of target values in the table, the target-value comparison table requires a continuous block of 4 to 19 words. 0001 to 0006 hex (1 to 6 target values) Number of target values Lower word of target value 1 00000000 to FFFFFFFF hex...
  • Page 192 11 High-speed Counters • Changing the PV of a High-speed Counter Execution condition @INI C1: Port specifier C2: Control data S: First word of new PV Operand Settings Port specifier #0010 High-speed counter 0 #0015 High-speed counter 5 Control data #0000 Start comparison.
  • Page 193 11 High-speed Counters Use the CTBL instruction to start the comparison operation with high-speed counter 0 and inter- rupt tasks 10 and 11. W0.00 @CTBL Use high-speed counter 0. #0000 Register a target-value comparison #0000 table and start comparison operation. D1000 First comparison table word.
  • Page 194 11 High-speed Counters Set the range comparison table starting at word D2000. Even though range 1 is the only range being used, all 30 words must still be dedicated to the range comparison table. Word Setting Function D2000 #61A8 Rightmost 4 digits of range 1 lower Lower limit value: 25,000 limit D2001...
  • Page 195: Related Auxiliary Area Bits And Words

    11 High-speed Counters 11-4 Related Auxiliary Area Bits and Words Bits and Words Allocated in the Auxiliary Area High- High- High- High- High- High- Contents speed speed speed speed speed speed counter 0 counter 1 counter 2 counter 3 counter 4 counter 5 High-speed Leftmost 4 digits...
  • Page 196: Application Example

    11 High-speed Counters 11-5 Application Example Using a Rotary Encoder to Measure Positions Functions Used: High-speed Counting for a Built-in Input A high-speed counter input can be used by connecting a rotary encoder to a built-in input. A CP2E CPU Unit is equipped with more than one high-speed counter input, making it possible to control devices for multiple axes with a single PLC.
  • Page 197 11 High-speed Counters System Configuration Wiring Example Encoder (power Phase A Black supply: 24 VDC) 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 CP2E-N20DR-A Motor running: CIO 100.00 Error stop Motor low speed output: CIO 100.01 position output:...
  • Page 198 11 High-speed Counters Select the Use high speed counter 0 Check Box for high-speed counter 0. Select Linear Mode for the counting mode. Select Software reset (comparing) for the reset method. Select Differential phase input for the input setting. Close the PLC Settings Dialog Box. Restart the PLC.
  • Page 199 11 High-speed Counters When the PV of the high-speed counter matches target value 1 (3000), interrupt task 4 is executed. Interrupt task 4 Turns ON the motor low speed output When the present vale of the high-speed counter matches target value 2 (3500), interrupt task 5 is executed.
  • Page 200 11 High-speed Counters 11-30 CP2E CPU Unit Software User’s Manual(W614)
  • Page 201 Pulse Outputs This section describes positioning functions such as trapezoidal control, jogging, and origin searches. 12-1 Overview ........... . 12-3 12-1-1 Overview.
  • Page 202 12 Pulse Outputs 12-9 Application Examples ......... 12-46 12-9-1 Vertically Conveying PCBs (Multiple Progressive Positioning).
  • Page 203: Overview

    12 Pulse Outputs 12-1 Overview Pulse outputs can be used only with the CP2E N/S -type CPU Unit with transistor outputs. 12-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 to perform origin searches or origin returns.
  • Page 204: Flow Of Operation

    12 Pulse Outputs Wiring for S -type CPU Unit An external power supply is required for S -type CPU Units when using the PWM output. Provide a DC24V external power supply to V+ and V- terminals as follows. Wiring Example Sinking outputs COM(V-) Although V- and COM(V-) are connected internally, also wire them externally.
  • Page 205 12 Pulse Outputs PLC Setup To perform an origin search or to use a Limit Input Signal as an input to a function other than origin search, set the parameters on the Pulse Output 0 to 3 Tab Pages in the PLC Setup. Pulse Output 0 to 3 Tab Page Item Setting...
  • Page 206 12 Pulse Outputs Setting the Pulse Output Port Number, Assigning Pulse Output Terminals, and Wiring Pulse Output Method Only the following pulse output plus a direction output can be used as the pulse output method. Pulses ON (=CW) OFF (=CCW) Direction Pulse Output Port Number and Output Terminals The following terminals are used for pulse outputs according to the pulse output port number.
  • Page 207 12 Pulse Outputs Origin Searches Use the following input and output terminals for origin searches. Input Terminals • N20/30/40/60 or S30/40/60 CPU Units Input terminal block Setting in PLC Setup Other functions that cannot be used at the same time High-speed Terminal counter setting...
  • Page 208 12 Pulse Outputs Output Terminals Other functions that cannot Output terminal block Setting in PLC Setup be used at the same time Terminal Terminal Enable origin searches for pulse Normal outputs block label number outputs 0 and 1 CIO 100 Pulse 0, Error counter reset output Normal output 4 (Note 2) Pulse 1, Error counter reset output...
  • Page 209 12 Pulse Outputs Connections for Pulse Output 1 Terminal block Origin search Terminal Addresses Signal Terminal block Operating mode 0 Operating mode 1 Operating mode 2 number label CIO 100 CIO 100.01 Stored in A278 Pulse Connect to Servo Drive’s pulse input (PULS). and A279 CIO 100.03 Direction...
  • Page 210 12 Pulse Outputs Connections for Pulse Output 3 (Only for N30/40/60 CPU Units) Terminal block Origin search Terminal Addresses Signal Terminal block Operating mode 0 Operating mode 1 Operating mode 2 number label CIO 101 CIO 101.01 Stored in A54 Pulse Connect to Servo Drive’s pulse input (PULS).
  • Page 211 12 Pulse Outputs Pulse Output Wiring -type (Example: Sinking outputs) 24-VDC power CP2E CPU Unit built-in output terminals supply Servo Drive for 24-VDC input PULS ( + ) PULS 100.00 100.01 Pulse output ( + ) 100.02 100.03 Direction output Instruction pulse mode = feed pulse and forward/reverse signal -type (Example: Sinking outputs)
  • Page 212 12 Pulse Outputs Connecting to OMRON Servo Drives Use the following cables to connect to an OMRON Servo Drive. Cable mode: Indicates the cable length OMRON Servo Drive (1m or 2m) G5 Series General-purpose Input Type (R88D-KT) R88A-CPG Set the Servo Drive’s command pulse mode to feed pulse and forward/reverse signals because the method of pulse output from a CP2E CPU Unit is pulse + direction.
  • Page 213 12 Pulse Outputs R88A-CPG S Cables for G5-series Servo Drives Wire Wire Symbol Symbol Mark Colors Mark Colors Orange/Red (1) +24VCW White/Red (3) Orange/Black (1) +24VCCW Pink/Black (3) Gray/Red (1) +CW/+PULS/+FA White/Black (3) Gray/Black (1) -CW/-PULS/-FA Yellow/Red (3) White/Red (1) +CCW/+SIGN/+FB Pink/Red (3) White/Black (1)
  • Page 214 12 Pulse Outputs Executing Pulse Control Instructions in a Ladder Program The pulse outputs are used by executing pulse control instructions in the ladder program. Applicable Instructions The following instructions are used. Purpose Overview Instruction Reference Performing trapezoidal control Performs trapezoidal pulse output PLS2: PULSE Refer to 12-2 control with independent accelera-...
  • Page 215: Specifications

    12 Pulse Outputs 12-1-3 Specifications Item Specifications Output mode Continuous mode (for speed control) or independent mode (for position con- trol) Positioning (independent mode) instruc- PULS and SPED, PULS and ACC, or PLS2 tions Speed control (continuous mode) SPED or ACC instructions Origin (origin search and origin return) instructions...
  • Page 216: Positioning Control

    12 Pulse Outputs 12-2 Positioning Control This section describes how to use pulse outputs with trapezoidal acceleration and deceleration when using the PLS2 instruction. 12-2-1 Positioning Control Configuration If the target frequency, starting frequency, acceleration and deceleration rate, direction are set before- hand, the following time chart will perform trapezoidal positioning control.
  • Page 217 12 Pulse Outputs Relationship between the Coordinate System and Pulse Specification The following table shows the pulse output operation for the four possible combinations of the coor- dinate systems (absolute or relative) and the pulse output (absolute or relative) specified when the PULS or PLS2 instruction is executed.
  • Page 218: Application Example

    12 Pulse Outputs Precautions for Correct Use Precautions for Correct Use The absolute pulse cannot be specified with the origin undefined. Please specify them when the origin is defined by performing the origin searches. Additional Information The origin position is undefined in the following case. Please define the origin position by per- forming the origin searches again.
  • Page 219 12 Pulse Outputs DM Area Settings • Settings for PLS2 Instruction (D0 to D7) Setting Address Data Acceleration rate: 300 Hz/4 ms #012C Deceleration rate: 200 Hz/4 ms #00C8 Target frequency: 50,000 Hz #C350 #0000 Number of output pulses: 600,000 #27C0 pulses #0009...
  • Page 220: Jogging

    12 Pulse Outputs 12-3 Jogging Jogging can be performed by using the SPED (SPEED OUTPUT) and ACC (ACCELERATION CON- TROL) instructions. This section describes the steps for jogging. 12-3-1 High-speed Jogging Start pulse output with acceleration or deceleration using the ACC instruction. In this case, acceleration and deceleration rate must be the same.
  • Page 221 12 Pulse Outputs Target frequency 1,000Hz Pulse frequency CW low-speed jogging (CIO 0.00) CCW low-speed jogging (CIO 0.01) The example shows jogging with acceleration and deceleration executed using an ACC instruction. It is used for high-speed jogging. • Clockwise high-speed jogging will be executed from pulse output 1 while CIO 0.04 is ON. •...
  • Page 222 12 Pulse Outputs Ladder Program 0.00 A281.04 SPED ← Pulse output 1 #0001 Low-speed Pulse Output ← Specifies Pulse + Direction output method, CW, and continuous mode. #0100 CW Start in Progress ← Target frequency SET W0.00 W0.00 0.00 SPED Low-speed #0001 Low-speed...
  • Page 223: Implementing Interrupt Feeding

    12 Pulse Outputs 12-4 Implementing Interrupt Feeding This section describes how to use interrupt feeding when using the IFEED instruction. 12-4-1 Interrupt Feeding Interrupt feeding is performed with the IFEED instruction. IFEED controls interrupt feeding by combin- ing the specified pulse output and interrupt input. An interrupt input is used as a trigger during speed control to switch to position control and then move a specified amount before decelerating to a stop.
  • Page 224: Application Example

    12 Pulse Outputs 12-4-3 Application Example Pulse output 0 and interrupt input 6 are used. PLC Setup Pulse Ouptput Interrupt Input Pulse Ouptput 0 Pulse Ouptput 1 Pulse Ouptput 2* Pulse Ouptput 3* * Pulse output 2 and pulse output 3 can be used with N30/40/60 CPU unit. 12-24 CP2E CPU Unit Software User’s Manual(W614)
  • Page 225 12 Pulse Outputs Ladder Program The IFEED instruction is executed after turning interrupt input 6 to OFF with the MSKS instruction. W0.00 @MSKS Interruptinput 6 #0001 Input signal OFF detection Execution condition @IFEED Interrupt input 6 and pulse output 0 #0100 Pulse + direction and CW direction #0000...
  • Page 226: Positioning Linear Interpolation

    12 Pulse Outputs 12-5 Positioning Linear Interpolation This section describes how to position linear interpolation when using the ITPL instruction. Linear interpolation can be used only with the CP2E N -type CPU Unit with transistor outputs. 12-5-1 Positioning Linear Interpolation Linear interpolation positioning is performed with the ITPL instruction.
  • Page 227: Positioning Linear Interpolation Configuration

    12 Pulse Outputs 12-5-2 Positioning Linear Interpolation Configuration The target frequency, starting frequency, acceleration and deceleration rate, the number of output pulses are set beforehand, and linear interpolation positioning control is performed by executing the instruction. The following example shows the two-axis linear interpolation. Port 1 position Target position (S+6, S+8)
  • Page 228: Application Example

    12 Pulse Outputs Additional Information • The ITPL instruction can not be executed when the pulse output port specified by the axis specifier of the ITPL instruction is already outputting pulses by the SPED, ACC, PLS2, ORG, IFEED and ITPL instructions. P_ER flag turns ON. •...
  • Page 229 12 Pulse Outputs Related Auxiliary Area Flags There is no special related auxiliary area flags for linear interpolation positioning. The actions of the pulse output related auxiliary area flags during the linear interpolation positioning are as follows. Name Action Pulse Output PV Storage Words Current value is stored.
  • Page 230: Defining Origin Position

    12 Pulse Outputs 12-6 Defining Origin Position The CP2E CPU Units have two methods that can be used to define the origin position. • Origin Search The ORG instruction outputs pulses to turn the motor according to the pattern specified in the origin search parameters.
  • Page 231: Flow Of Operation

    12 Pulse Outputs 12-6-2 Flow of Operation • Set the origin search parameters in the PLC Setup Pulse Output 0 to 3 Tab Pages of the PLC Setup using the CX-Programmer. • Set pulse output 0 to 3. Ladder Cyclic task, •...
  • Page 232 12 Pulse Outputs Pulse Output 0 to 3 Tab Page Item Selection Description Base Undefined Hold When a Limit Input Signal is input, the pulse output is stopped Settings Origin and the previous status is held. Undefined When a Limit Input Signal is input, the pulse output is stopped and origin becomes undefined.
  • Page 233 12 Pulse Outputs Item Selection Description Define Search High Sets the motor’s target speed when the origin search is executed. Specify the speed in Origin Speed the number of pulses per second (pps). Opera- Setting range: 1 to 100k pps tion The origin search will not be performed in these cases: Settings...
  • Page 234: Origin Search Instructions

    12 Pulse Outputs 12-6-4 Origin Search Instructions Origin Search Instruction: ORG Execute the ORG instruction in the ladder program to perform an origin search with the specified parameters. C1:Port specifier Pulse output 0: #0000 Pulse output 1: #0001 Pulse output 2: #0002 Pulse output 3: #0003 C2:Control data Origin search and pulse + direction output method: #0100...
  • Page 235: Origin Search Operations

    12 Pulse Outputs 12-6-5 Origin Search Operations Operating Mode The operating mode parameter specifies the kind of I/O signals that are used in the origin search. I/O signal Mode 0 Mode 1 Mode 2 Driver Servomotor Stepping motor Operation Origin Input Inputs signals are arranged Even if an Origin Input Signal is received during Signal...
  • Page 236 12 Pulse Outputs Operations Detecting the Origin during Deceleration from High Speed Operating Mode 0 (without Error Counter Reset Output, without Positioning Completed Input) Connect the sensor’s open-collector output signal to the Origin Input Signal. The Origin Input Sig- nal’s response time is 0.1 ms when set as NO contacts. 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.
  • Page 237 12 Pulse Outputs 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.
  • Page 238 12 Pulse Outputs Operating Mode 2 (with Error Counter Reset Output, with Positioning Completed Input) This operating mode is the same as mode 1, except the Positioning Completed Signal (INP) from the Servo Drive is used. Connect the Positioning Completed Signal from the Servo Drive to a normal input.
  • Page 239 12 Pulse Outputs Origin Detection Method 1: Origin Proximity Input Signal Reversal Not Required Deceleration starts when Origin Proximity Input Signal turns ON. Origin Proximity Input Signal After the Origin Proximity Input Signal turns ON, the motor is stopped when the Origin Input Signal turns ON.
  • Page 240 12 Pulse Outputs Operation Patterns for Origin Search Operating Mode and Origin Detection Method Settings The following examples show how the operation patterns are affected by the origin detection method and origin search operating mode. These examples have a CW origin search direction. (The search direction and Limit Input Signal direc- tion would be different for an origin search in the CCW direction.) Method 0 is the recommended method for reversal mode 1 (Inverse 1).
  • Page 241 12 Pulse Outputs Using Reversal Mode 2 (Inverse 2) Origin search operation Reversal mode 2 (Inverse 2) Origin detection method 0: Origin Proximity Input Signal Origin Proximity reversal required. Input Signal Origin Input Signal Pulse output Start Stop Stop CW Limit Input Signal (See note.) Start Start Limit stop...
  • Page 242: Origin Return

    12 Pulse Outputs 12-6-6 Origin Return It is the function to move the origin to the defined position by origin searches or changing PVs. An origin return operation moves the motor to the origin position from any other position. The origin return operation is controlled by ORG.
  • Page 243: Changing The Present Value Of The Pulse Output

    12 Pulse Outputs 12-6-7 Changing the Present Value of the Pulse Output 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 New origin Present origin...
  • Page 244: Reading The Pulse Output Present Value

    12 Pulse Outputs 12-7 Reading the Pulse Output Present Value The present value of a pulse output can be read in the following two ways. • Value refreshed at the I/O refresh timing Read PV from Auxiliary Area. • Value updated when a program is executed Read PV by executing a PRV instruction.
  • Page 245 12 Pulse Outputs 12-8 Related Auxiliary Area Flags Auxiliary Area Allocations Pulse Pulse Pulse Pulse Name Description Values output 0 output 1 output 2 output 3 Pulse Output PV PV range: 8000 0000 to 7FFF FFFF hex Leftmost 4 digits A277 A279 Storage Words...
  • Page 246: Application Examples

    12 Pulse Outputs 12-9 Application Examples 12-9-1 Vertically Conveying PCBs (Multiple Progressive Positioning) Specifications and Operation Outline (1) PCBs with components mounted are stored in a stocker. (2) When a stocker becomes full, it is moved to the conveyance point. Positioning Operation for Vertical Conveyor Stocker conveyance position...
  • Page 247 12 Pulse Outputs Wiring Example Using G5-series Servo Drive Origin Search Start Switch (CIO 0.00) Emergency Stop Switch (CIO 0.01) Stocker Moved (CIO 100.01) PCB Storage Completed (CIO 0.03) Stocker Movement Completed PCB Storage Enabled (CIO 100.03) (CIO 0.04) G5-series Servo Drive R88A-CPG CP2E N/S...
  • Page 248 12 Pulse Outputs Preparations PLC Setup Setting Use define origin operation for pulse output 0. Note The Use define origin operation setting is read from the PLC Setup when the power supply is turned ON. DM Area Settings • Settings for PLS2 for Fixed-distance Positioning (D0 to D7) Setting details Address Data...
  • Page 249 12 Pulse Outputs Ladder Program Jog Operation W0.00 0.00 W0.01 Origin search in progress Origin search Origin search start switch completed @ORG W0.00 #0000 #0100 Origin search W0.01 in progress A280.05 Origin search completed No-origin Flag 100.03 W0.01 W0.02 PCB storage enabled Origin search Lift positioning completed...
  • Page 250 12 Pulse Outputs When the stocker is not full (C0 = OFF), store PCB, and repeat lift positioning after PCB storage is completed. W0.05 W0.04 C000 PCB stored Lift positioning Stocker full completed When the stocker is full (C0 = ON), move the stocker, and start lower positioning after stocker movement is completed.
  • Page 251: Feeding Wrapping Material: Interrupt Feeding

    12 Pulse Outputs 12-9-2 Feeding Wrapping Material: Interrupt Feeding Specifications and Operation Feeding Wrapping Material in a Vertical Pillow Wrapper Start switch (CIO 0.00) Emergency stop switch (CIO 0.01) Marker sensor Speed (input 0.06) control Position control Pulse output Operation Pattern Speed control is used to feed wrapping material to the initial position.
  • Page 252 12 Pulse Outputs Preparations PLC Setup Setting Enable using built-in input IN6 as an interrupt input. Note The interrupt input setting is read from the PLC Setup when the power supply is turned ON. DM Area Settings • Speed Control Settings to Feed Wrapping Material to Initial Position and Positioning Control Set- tings for Wrapping Material Setting Address...
  • Page 253 12 Pulse Outputs 12-9-3 Palletize: Two-axis Multipoint Positioning Specifications and Operation Overview Origin Search Start Switch (CIO 0.00) Cylinder Y axis X axis Immediate Stop Switch (CIO 0.01) Limit input Pulse output 0 CW (CIO 1.00) Pulse output 0 CCW (CIO 1.01) Pulse output 1 CW (CIO 1.02) Pulse output 1 CCW (CIO 1.03) Workpiece is...
  • Page 254 12 Pulse Outputs Operation An origin search of X axis (pulse output 0) and Y axis (pulse output 1) is performed using the Ori- gin Search Start Switch (CIO 0.00). When the origin search is finished, the following operations are performed continuously using lin- ear interpolation 0.
  • Page 255 12 Pulse Outputs DM Area Settings • ITPL(893) Settings to Move from Origin to Position A Address Data Setting Acceleration rate: 2,000 pps/4 ms & 2,000 Deceleration rate: 2,000 pps/4 ms & 2,000 Target frequency: 50,000 pps D12, D13 & 50,000 Starting frequency: 0 pps D14, D15 &...
  • Page 256 12 Pulse Outputs Ladder Program Origin Search for X and Y Axes 0.00 Setting Origin Search Switch Bit address W0.00 W1.14 W0.00 Origin search start W1.15 RSET Resetting Origin search completed W0.00 Bit address Operation 1: Positioning to A W0.00 Setting W0.01 Bit address...
  • Page 257 12 Pulse Outputs Operation 3: Positioning to A W0.04 Setting W0.05 Bit address W3.01 W0.05 Positioning to A start W2.00 RSET Resetting Positioning to A completed W0.05 Bit address Operation 4: Positioning to D W0.05 Setting W0.06 Bit address W1.03 W0.06 Positioning to D start W2.03...
  • Page 258 12 Pulse Outputs Positioning to B Start and Completion for X and Y Axes W1.01 @ITPL (893) Linear interpolation Positioning to Port specifier: Linear interpolation 0 #0030 B start #0101 Control data First word of setting table W2.01 A280.03 A281.03 Positioning to B completed Pulse output completed Pulse output completed Positioning to C Start and Completion for X and Y Axes...
  • Page 259: 12-10Precautions When Using Pulse Outputs

    12 Pulse Outputs 12-10Precautions when Using Pulse Outputs Movement Direction when Specifying Absolute Pulses When operating with the absolute pulse specification, the movement direction (CW/CCW) is selected automatically based on the relationship between the pulse output PV when the instruction is executed and the specified target position.
  • Page 260 12 Pulse Outputs Differences between Set Frequencies and Actual Frequencies Source clock frequency: 15 MHz Set frequency (kHz) Actual frequency (kHz) 99.668 to 100.000 100.000 99.010 to 99.667 99.338 49.917 to 50.083 50.000 49.752 to 49.916 49.834 49.587 to 49.751 49.669 9.997 to 10.003 10.000...
  • Page 261 12 Pulse Outputs *1 SPED (Independent) to SPED (Independent) • The number of output pulses cannot be changed. • The frequency can be changed. *2 SPED (Continuous) to SPED (Continuous) • The frequency can be changed. *3 SPED (Independent) to ACC (Independent) •...
  • Page 262 12 Pulse Outputs Related Auxiliary Area Flags Pulse Pulse Pulse Pulse Function Settings output 0 output 1 output 2 output 3 Output Stopped Error Flags 0: No error A280.07 A281.07 A56.07 A57.07 ON when an error occurred while outputting 1: Stop error pulses in the origin search function.
  • Page 263 12 Pulse Outputs Error Operation after Error name Likely cause Corrective action code error Origin Proxim- 0206 • When an origin search with Check the installation positions of the Origin Immediate stop ity Input Signal reversal at the limit is being Proximity Input Signal, Origin Input Signal, No effect on other Origin...
  • Page 264: 12-11Pulse Output Pattern

    12 Pulse Outputs 12-11Pulse Output Pattern The CP2E CPU Unit’s pulse output function enables operation in Continuous Mode, for which the num- ber of output pluses is not specified, or in Independent Mode, for which the number of output pulses is specified.
  • Page 265 12 Pulse Outputs Procedure Example Operation Frequency changes Description application Instruction Settings Changing the Changes the • Port Acceleration/ Pulse frequency deceleration rate n speed in a acceleration or (Continuous) • Continuous Acceleration/ Target frequency polyline curve deceleration deceleration rate 2 ↓...
  • Page 266: Positioning Control (Independent Mode)

    12 Pulse Outputs 12-11-2 Positioning Control (Independent Mode) The following operations can be performed in Independent Mode by combining instructions. Starting a Pulse Output Procedure Example Operation Frequency changes Description Instruc- application Settings tion Output with Positioning Starts outputting PULS •...
  • Page 267 12 Pulse Outputs * Triangular Control If the specified number of pulses is less than the number required just to reach the target frequency and return to zero, the function will automatically reduce the acceleration/deceleration time and perform triangu- lar control (acceleration and deceleration only.) An error will not occur. Pulse frequency Pulse frequency Specified number of pulses...
  • Page 268 12 Pulse Outputs Procedure Example Operation Frequency changes Description application Instruction Settings Change Changing PLS2 can be exe- PULS • Number of Pulse frequency Specified number of pulses speed the target (Specified with PULS.) cuted during posi- pulses ↓ New target frequency smoothly speed (fre- tioning to change...
  • Page 269 12 Pulse Outputs Procedure Example Operation applica- Frequency changes Description Instruc- Settings tion tion Change Change PLS2 can be executed PULS • Number of Number of pulses target posi- the target during positioning to pulses ↓ Pulse frequency Specified number changed with PLS2.
  • Page 270 12 Pulse Outputs Stopping a Pulse Output Procedure Example Operation Frequency changes Description application Instruction Settings Stop pulse Immediate Stops the pulse output immedi- PULS Stop pulse Pulse frequency output stop ately and clears the number of output ↓ (Number of output pulses setting.
  • Page 271 12 Pulse Outputs Switching from Speed Control (Continuous Mode) to Positioning (Independent Mode) Procedure Example Frequency changes Description application Instruction Settings Change PLS2 can be executed • Port Outputs the number of pulses from speed during a speed control (Continuous) specified in PLS2 (Both relative and •...
  • Page 272 12 Pulse Outputs 12-72 CP2E CPU Unit Software User’s Manual(W614)
  • Page 273 PWM Outputs This section describes the PWM Outputs (variable-duty-factor pulse outputs). 13-1 PWM Outputs (Variable-duty-factor Pulse Outputs) ....13-2 13-1-1 Flow of Operation ..........13-4 13-1-2 Ladder Program Example.
  • Page 274 13 PWM Outputs 13-1 PWM Outputs (Variable-duty-factor Pulse Outputs) PWM outputs can be used only with the CP2E N/S -type CPU Unit with transistor outputs. A PWM (Pulse Width Modulation) pulse can be output with a specified duty factor. The duty factor is the ratio of the pulse’s ON time and OFF time in one pulse cycle.
  • Page 275 13 PWM Outputs Wiring for S -type CPU Unit An external power supply is required for S -type CPU Units when using the PWM output. Provide a DC24V external power supply to V+ and V- terminals as follows. Wiring Example Sinking outputs COM(V-) COM Although V- and COM(V-) are connected internally, also wire them externally.
  • Page 276 13 PWM Outputs 13-1-1 Flow of Operation Terminal 01 on terminal block CIO100 is used for PWM Setting pulse output port number, output 0. assigning pulse output terminals, and wiring. • The PWM instruction is used to control PWM outputs. Greate ladder Cyclic task, •...
  • Page 277 13 PWM Outputs Applicable Instructions Preparations PLC Setup There are no settings that need to be made in the PLC Setup. DM Area Settings • PWM Operand Settings (D0 and D1) Setting Operand Data Frequency: 2,000.0 Hz #4E20 Duty factor: 40.0% #0190 Ladder Diagram 0.00...
  • Page 278 13 PWM Outputs 13-6 CP2E CPU Unit Software User’s Manual(W614)
  • Page 279 Serial Communications This section describes communications with Programmable Terminals (PTs) without using communications programming, no-protocol communications with general compo- nents, and connections with a Modbus-RTU Easy Master, Modbus-RTU slave, Serial PLC Link, and host computer. 14-1 Serial Communications ........14-3 14-1-1 Types of CPU Units and Serial Ports .
  • Page 280 14 Serial Communications 14-7-2 Flow of Operation ..........14-43 14-7-3 PLC Setup .
  • Page 281 14 Serial Communications 14-1 Serial Communications Serial communications can be used with any model of CP2E CPU Unit. 14-1-1 Types of CPU Units and Serial Ports Serial Ports -type CPU Unit E14/20/30/40/60 CPU Units have only one built-in RS-232C port. There are no option slots. S30/40/60 CPU Units have one built-in RS-232C port and one built-in RS-485 port.
  • Page 282 14 Serial Communications Serial Ports and Compatible Protocols Serial Port Serial Port 1 Serial Port 2 Serial Port 1 (EX) Protocol Built-in RS-232C Built-in RS-485 Host Link Supported Supported Not supported 1:N NT Link Supported Supported Not supported Serial PLC Links (Master) Supported Supported Supported...
  • Page 283 14 Serial Communications 14-1-2 Overview of Serial Communications The CP2E CPU Units support the following types of serial communications. Built-in Built-in Serial Communications RS-232C/ RS-485/ Connected devices Description Port 1 protocol Serial Serial (EX) Port 1 Port 2 Programmable Terminal Data can be exchanged Host Link or 1:N with PTs without using a...
  • Page 284 14 Serial Communications Built-in Built-in Serial Communications RS-232C/ RS-485/ Connected devices Description Port 1 protocol Serial Serial (EX) Port 1 Port 2 Host computers PLC data can be read by Host Link the host computer or writ- ten to the PLC from the computer.
  • Page 285 14 Serial Communications 14-2 Program-free Communications with Programmable Terminals 14-2-1 Overview Communications without special communications programming is possible between a CP2E CPU Unit and a Programmable Terminal (PT) by using the Host Link or 1:N NT Link protocol. Connect the serial port of the CP2E CPU Unit and PT with Host Link or NT Link (1:N) communication mode, and connect the CP2E CPU Unit and PT 1:1 as shown below.
  • Page 286 14 Serial Communications 14-2-2 Flow of Connection CP2E CPU Unit PT (e.g. NB-series) Select Built-in RS-232C, Built-in RS-485 Create a project using the or Serial Port in the PLC Setup of the NB-Designer and select COM1 or CX-Designer CP2E CPU Unit using the COM2 in the communications PLC Setup CX-Programmer.
  • Page 287 14 Serial Communications Built-in RS-232C, Built-in RS-485 or Serial Port Tab Page Parameter Setting Communications Settings Select the Custom Option and set the baud rate to 115,200 and the format to 7,2,E. (It is not necessary to change the format setting when connecting to NS-series with 1:N NT Link.) Mode Select Host Link.
  • Page 288 14 Serial Communications 14-3 No-protocol Communications with General Components 14-3-1 Overview CP2E CPU Units and general devices with serial communications ports can be used for no-protocol communications. No-protocol communications enable sending and receiving data using the TRANSMIT (TXD) and RECEIVE (RXD) instructions without using a protocol and without data conversion (e.g., no retry pro- cessing, data type conversion, or process branching based on received data).
  • Page 289 14 Serial Communications 2 The following serial communication ports cannot control RS and ER signals or monitor CS and DR signals. • ER and DR signals are not supported by the built-in RS-232C port on the E/S -type CPU Unit. •...
  • Page 290 14 Serial Communications Built-in RS-232C, Built-in RS-485 or Serial Port Tab Page Parameter Setting Communications Set the communications settings to the same values as the connected device. Settings If the connected device is set to 9,600 bps, two stop bits, and even parity, select the Custom Option, set the baud rate to 9,600 and format to 7,2,E.
  • Page 291 14 Serial Communications Address Name Details A392.15 Serial Port 2/Built-in RS-485 ON when a data overflow occurred during reception through the serial Port Reception Overflow Flag port 2 or built-in RS-485 port in no-protocol mode. (No-protocol Mode) • When the number of bytes was specified: ON when more data is received after the reception was completed but before RXD was executed.
  • Page 292 Slave address Function code Communications data Modbus-RTU Modbus-RTU Master Execution Bit for Port 1 A640.00 OMRON Inverters 3G3MX2-V1, 3G3RX2, 3G3RX-V1 CP2E CPU Unit 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.
  • Page 293 14 Serial Communications 14-4-3 Setting and Word Allocation DM fixed allocation words and Auxiliary Area words are allocated for the Modbus-RTU Easy Master according to the CPU Unit type and connected port as shown below. CP2E CPU Unit serial port DM fixed allocation words Auxiliary Area bits CP2E E...
  • Page 294 14 Serial Communications 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.
  • Page 295 14 Serial Communications Word Port Contents A638 Serial Port 1 (EX) of CP2E Modbus-RTU Master Execution Error Flag -type CPU Unit ON: Execution error. OFF: Execution normal or still in progress. Modbus-RTU Master Execution Normal Flag ON: Execution normal. OFF: Execution error or still in progress. Modbus-RTU Master Execution Bit Turned ON: Execution started ON: Execution in progress.
  • Page 296 14 Serial Communications 14-4-4 Programming Examples A bobbin winder on a spinning machine will be used in the following example. The speed of the bobbin winder must be controlled as the thread is wound because the speed of the thread is constant. Constant thread speed Fast rotation Slow rotation...
  • Page 297 14 Serial Communications Wiring Examples The OMRON 3G3MX2-V1 Inverter is connected to the option slot 2 of the CP2E N -type CPU Unit or the built-in RS-485 port of the CP2E S -type CPU Unit using RS-485 for frequency and start/stop control.
  • Page 298 14 Serial Communications 3G3MX2-V1 Settings Set the following parameters according to the communication specifications. As for C071, C074 and C075, modified data are not reflected until the power is reconnected or a reset is performed. To perform a reset, turn the reset terminal (18: RS) OFF, ON and then OFF again.
  • Page 299 14 Serial Communications PLC Setup Click the Built-in RS-232C, Built-in RS-485 or Serial Port Tab in the PLC Settings Dialog Box. Built-in RS-232C, Built-in RS-485 or Serial Port Tab Page Parameter Settings Communications Set the Modbus communications settings to match those of the Settings Inverter.
  • Page 300 14 Serial Communications Programming Example W0.00 MOV(021) Initial Slave address Frequency 01 Hex Setting D1300 MOV(021) FUNCTION code 06 Hex D1301 MOV(021) Frequency setting at operation startup Communication data Write 60.00 Hz (1770 Hex) 4 bytes (Hex) to register number 0002 D1302 (Hex) MOV(021)
  • Page 301 14 Serial Communications W0.01 MOV(021) Frequency Slave address Setting A 01 Hex D1300 MOV(021) FUNCTION code 06 Hex D1301 MOV(021) Frequency setting A Communication data Write 55.00 Hz (157C Hex) 4 bytes (Hex) to register number 0002 (Hex) D1302 MOV(021) Register number 0002 Hex (Register number -1) 0001 Hex...
  • Page 302 14 Serial Communications W1.00 MOV(021) Slave address Command 01 Hex D1300 MOV(021) FUNCTION code 05 Hex D1301 MOV(021) Stop operation Communication data Write OFF (0000 Hex) to 4 bytes (Hex) coil number 0001 (Hex) D1302 MOV(021) Register number 0001 Hex (Register number -1) 0001 Hex D1303...
  • Page 303 14 Serial Communications Flags for Modbus-RTU Easy Master for Serial Port 2 or Built-in RS-485 Port A641.00 Execution Bit A641.01 Execution Normal Flag A641.02 Execution Error Flag (1)Turn ON A641.00 (Execution Bit) to send command data stored starting at D1300. For details, refer to Data Memory (DM) Area Settings on page 14-26.
  • Page 304 14 Serial Communications Data Memory (DM) Area Settings DM Fixed Allocation Words for Modbus-RTU Easy Master The settings are changed by the MOV instruction, and are used to change, start and stop frequency reference. RUN Command (Example of coil writing) Communication data Slave FUNCTION...
  • Page 305 14 Serial Communications 14-5 Serial PLC Links 14-5-1 Overview Serial PLC Links enable exchanging data between CP2E CPU Units, CP1H/CP1L/CP1E CPU Units, or CJ2M CPU Units without using special programming. The serial communications mode is set to Serial PLC Links. Up to 9 PLCs can be linked. Configuration Connecting CP2E, CP1H, CP1L, CP1E or CJ2M CPU Units 1:N (8 Nodes Maximum)
  • Page 306 14 Serial Communications 14-5-2 Flow of Operation Connect the CP2E CPU Unit and other CPU Units using Wiring communications RS-232C or RS-422A/485 ports. Set Built-in RS-232C, Built-in RS-485 or Serial Port in PLC Setup the PLC Setup and transfer the PLC Setup from the CX- Programmer to the CP2E CPU Unit.
  • Page 307 14 Serial Communications Built-in RS-232C, Built-in RS-485 or Serial Port Tab Page Parameter Setting Communications Settings Set the communications settings to the same values as the connected PLCs. If the connected PLCs are set to 115,200 bps, select the Custom Option, set the baud rate to 115200.
  • Page 308 14 Serial Communications 14-5-4 Operating Specifications Serial PLC Links can be used for all the serial communication ports for CP2E CPU Units. However, three serial ports cannot be used simultaneously for Serial PLC Links. Item Specifications Applicable PLCs CP2E, CP1H, CP1L, CP1E, CJ2M Baud rate 38,400 bps, 115,200 bps Applicable serial ports...
  • Page 309 14 Serial Communications Complete Link The data from all nodes in the Serial PLC Links are reflected in both the Polling Unit and the Polled Units. The only exceptions are the addresses of Polled Units that are not present in the network. These data areas are undefined in all nodes.
  • Page 310 14 Serial Communications Polling Unit Link Method The data for all the Polled Units in the Serial PLC Links are reflected in the Polling Unit only, and each Polled Unit reflects the data of the Polling Unit only. The advantage of the Polling Unit link method is that the addresses allocated for the local Polled Unit data are the same in each Polled Unit, allowing data to be accessed using common ladder program- ming.
  • Page 311 14 Serial Communications Allocated Words Complete Link Method Address Link words 1 word 2 words 3 words 10 words CIO 200 Polling Unit CIO 200 CIO 200 to CIO 200 to CIO 200 to Polled Unit CIO 201 CIO 202 to CIO 203 to CIO 210 to No.
  • Page 312 14 Serial Communications Related Auxiliary Area Bits and Words Serial Port1/Built-in RS-232C Port Name Address Details Read/write Refresh timing Serial Port 1/Built-in A393.00 to When the serial port 1 or built-in Read • Cleared when power is turned ON. RS-232C Port Com- A393.07 RS-232C port is being used in NT •...
  • Page 313 14 Serial Communications Serial Port 2/Built-in RS-485 Port Name Address Details Read/write Refresh timing Serial Port 2/ A394.00 to When the serial port 2 or built-in Read • Cleared when power is turned ON. Built-in RS-485 Port A394.07 RS-485 port is being used in NT •...
  • Page 314 14 Serial Communications Serial Port 1 (EX) Name Address Details Read/write Refresh timing Serial Port 1 (EX) A51.00 to When the serial port 1 (EX) is being Read • Cleared when power is turned ON. Communication with A51.07 used in PLC link mode, the bit cor- •...
  • Page 315 14 Serial Communications 14-5-5 Example Application Operation The present temperature information is exchanged between the boilers. This information is used to adjust the temperature control of one boiler depending on the status of the other boilers and for moni- toring individual boilers. Boiler A Boiler B Boiler C...
  • Page 316 14 Serial Communications PLC Setup Item Boiler A (Polling Unit) Boiler B (Polled Unit No. 0) Boiler C (Polled Unit No. 1) Communications Settings Custom Baud Rate 115200bps Parameters 7.2.E (default) Mode PC Link (Master) PC link (Slave) − − Link words 10 (default) −...
  • Page 317 14 Serial Communications 14-6 Connecting the Host Computer 14-6-1 Overview Commands are sent from a host computer to the CP2E CPU Unit to read and write data. The serial communications mode is set to Host Link. Note Because the built-in RS-485 port of the S -type CPU Unit and the RS-485 port of CP2W-CIFD2/CIFD3 use 2-wire connections, so they can only communicate in half duplex.
  • Page 318 14 Serial Communications 14-6-3 Command/response Format and List of Commands The outline of command/response format and each command are listed below. For the details of the host link commands and FINS commands, refer to Communication Instructions Reference Manual (Cat.No.W342). List of C Mode Commands C mode commands (host link commands) are shown below.
  • Page 319 14 Serial Communications List of FINS commands FINS commands are shown below. Command Type Name Function code I/O memory I/O memory area read Read the contents of continuous I/O memory area area access I/O memory area write Write the contents of continuous I/O memory area I/O memory area write all at once Replenish the specified ranges of I/O memory area with the same data...
  • Page 320 14 Serial Communications 14-7 Modbus-RTU Slave Function 14-7-1 Overview Modbus-RTU Slave enables to read and write CP2E data from Modbus-compatible masters, such as host PLCs or host computers, using serial communications. The serial communication mode is set to Modbus-RTU Slave. Modbus-RTU master device CP2E CPU Unit Function...
  • Page 321 14 Serial Communications 14-7-2 Flow of Operation Connect CP2E CPU Unit and Modbus-RTU master Wiring communications device using RS-232C or RS-422A/485 ports. Select Built-in RS232C, Built-in RS485 or Serial Port in PLC Setup the PLC Setup and transfer the PLC Setup from the CX- Programmer to the CP2E CPU Unit.
  • Page 322 14 Serial Communications 14-7-4 Operation Specifications Modbus has the following four common data models. CP2E allocates each area of these data models to an I/O Memory area. CP2E CPU unit Modbus data model Data type Read/Write I/O Memory allcation Discrete Inputs read None Coils...
  • Page 323 14 Serial Communications 14-7-5 Command and Response Details Supported Command List The CP2E CPU unit supports the following Modbus-RTU commands. Function Code Modbus Name Function 01 Hex Read Coils Reads multiple bits from the Auxiliary Area (W) of I/O Memory 03 Hex Read Holding Registers Reads multiple words from the Data Memory (D)
  • Page 324 14 Serial Communications Example: Reading 19 bits from W1.04 to W2.06 Command (Modbus-RTU Master) Response (CP2E) Field name Data Field name Data Function code 01 Hex Function code 01 Hex Coil starting address (H) 00 Hex Byte count 03 Hex Coil starting address (L) 14 Hex Coil status 27 to 20...
  • Page 325 14 Serial Communications Example: Reading 3 words from D1000 to D1002 Command (Modbus-RTU Master) Response (CP2E) Field name Data Field name Data Function code 03 Hex Function code 03 Hex Register starting address 03 Hex Byte count 06 Hex Register starting address E8 Hex Register value (H) AB Hex...
  • Page 326 14 Serial Communications Example: Writing 3AC5 Hex to D2000 Command (Modbus-RTU Master) Response (CP2E) Field name Data Field name Data Function code 06 Hex Function code 06 Hex Register address (H) 07 Hex Register address (H) 07 Hex Register address (L) D0 Hex Register address (L) D0 Hex...
  • Page 327 14 Serial Communications Example: Writing 10 bits (xxxx xx11 1100 1101) from W1.04 to W1.13 Command (Modbus-RTU Master) Response (CP2E) Field name Data Field name Data Function code 06 Hex Function code 0F Hex Starting address (H) 00 Hex Starting address (H) 00 Hex Starting address (L) 14 Hex...
  • Page 328 14 Serial Communications Example: Writing 3AC5, 9713 Hex to 2 Words, D1000 and D1001 Command (Modbus-RTU Master) Response (CP2E) Field name Data Field name Data Function code 10 Hex Function code 10 Hex Starting address (H) 03 Hex Starting address (H) 03 Hex Starting address (L) E8 Hex...
  • Page 329 14 Serial Communications 14-7-6 Related special auxiliary relay Address Name Content A392.04 Built-in RS-232C Turns ON when a communication error (framing error, parity Port/Serial Port 1 error, overrun error, CRC error) occurs in the built-in RS- Communication Error Flag 232C port or serial port 1. If this flag occurs, it is necessary to restart the port.
  • Page 330 14 Serial Communications 14-8 Precautions on the usage of RS-485 When using 2-wire RS-485 with the built-in RS-485 of the S -type CPU Unit, or the RS422A/485 Option Board CP1W-CIF11/CIF12-V1 and CP2W-CIFD2/CIFD3 Option Board with two ports, pay atten- tion to the following precautions and construct application. When using the RS-485 (2-wire), it can only communicate in half duplex.
  • Page 331 Connecting the CX-Programmer to PLCs Online via Ethernet ... . 15-4 15-1-2 Exchanging Data between OMRON PLCs using Ethernet ....15-5 15-1-3...
  • Page 332 15 Ethernet 15-6 Automatic Clock Adjustment and Specifying Servers by Host Name. . . 15-54 15-6-1 Automatic Clock Adjustment Function ......15-54 15-6-2 Specifying Servers by Host Name .
  • Page 333 A variety of protocols make available a wide range of applications for use on an Ethernet network. The protocols can be selected include sending and receiving data by TCP/IP or UDP/IP (socket services), sending and receiving commands by OMRON’s standard protocol FINS, and automatically adjusting the PLC’s internal clock by SNTP.
  • Page 334 Connecting within the Same Segment Use the UDP/IP version of the FINS communications service (i.e., FINS/UDP). FINS/UDP is supported by many OMRON products and is compatible with earlier OMRON Ethernet Units. The CX-Programmer can be connected and used with FINS/UDP.
  • Page 335 FINS/TCP is supported by many OMRON products and is compati- ble with earlier OMRON Ethernet Units. It provides automatic recovery at the TCP/IP layer from com- munications errors (such as packet loss) that occur during multilevel routing.
  • Page 336 15 Ethernet 15-1-3 Creating an Original Communications Procedure Using TCP/IP (UDP/IP) for the Host Application or Communicating with PLCs from Another Manufacturer Communications by UDP/IP and TCP/IP (Socket Services Function) The standard Ethernet protocols, UDP/IP and TCP/IP, are supported, making it possible to communi- cate with a wide range of devices, workstations, computers, and Ethernet Units from other manufactur- ers.
  • Page 337 15 Ethernet 15-2 Specifications 15-2-1 General Specifications (Ethernet) Item Specifications Type 100/10Base-TX (Auto-MDIX) Transfer Media access method CSMA/CD Modulation method Baseband Transmission paths Star form Baud rate 100 Mbit/s (100Base-TX) 10 Mbit/s (10Base-T) • Half/full auto-negotiation for each port • Link speed auto-sensing for each port Transmission media •...
  • Page 338 15 Ethernet 15-2-2 Comparison with Previous Models (Ethernet Related) Model CP2E N -type CPU CP1W-CIF41 CS1W-ETN21 Units CJ1W-ETN21 Local IP address 192.168.250.FINS node 192.168.250.1 192.168.250.FINS node address address FINS node address Set in PLC setup Set in system settings Set by rotary switch Physical layer 100/10Base-TX 100/10Base-TX...
  • Page 339 15 Ethernet Improved FINS Message Communications from CP1W-CIF41 The following functions have been maintained according to the existing Ethernet Unit models for CP1W- CIF41. • The maximum number of nodes is 254. • Communications are enabled even if the host computer’s IP address is dynamic. •...
  • Page 340 15 Ethernet 15-3 Basic Setting for Ethernet 15-3-1 Overview of Startup Procedure Refer to Ethernet Units Construction of Networks Operation Manual for CS/CJ Series Determine the local IP address (Cat. No. W420) SECTION 5 Determining IP Addresses. and address conversion method. Refer to CP2E CPU Unit Hardware User’s Manual (Cat.
  • Page 341 15 Ethernet 15-3-2 PLC Setup Procedure Use the CX-Programmer (Ver. 9.72 or higher) for the CP2E N -type CPU Unit Setup, and follow the procedure described below. Connect the CX-Programmer online. The CX-Programmer can be connected to the PLC in the following ways: Connect the personal computer to the PLC by Ethernet.
  • Page 342 15 Ethernet Transfer the settings to the PLC. Click on Yes in the following dialog box. In order for the Ethernet Setup to go into effect, the Ethernet Port must be restarted. Please use the following way to reset the Ethernet Port. After the LNK/ACT indicator has turned OFF and then turned ON again (Ethernet cable should be connected), the Ethernet port will recognize the new settings.
  • Page 343 15 Ethernet 15-3-3 Basic Settings The following items comprise the basic settings in the PLC’s Ethernet port setup. Basic Setting CX-Programmer tab Settings Built-in Ethernet IP address Subnet mask Broadcast TCP/IP keep-alive IP router table CX-Programmer Setup Move the cursor to the Settings and double click. Select the Built-in Ethernet Tab in PLC setup dialog. Item Contents Default...
  • Page 344 15 Ethernet Note 1 Make settings using the PLC settings function in the CX-Programmer (to be included in version 9.72 and higher). 2 For details, refer to 2-9 Basic Settings in the Ethernet Units Construction of Networks Operation Manual (Cat. No. W420). IP Router Table An IP router table is a table of correspondences for finding IP addresses for the IP routers that relay tar- get segments when the Unit communicates via IP routers with nodes on other IP network segments.
  • Page 345 15 Ethernet 15-3-4 Communications Test If the basic settings (in particular the IP address and subnet mask) have been made correctly, then it should be possible to communicate with nodes on the Ethernet. The following describes how to use the PING command to perform communications testing between CP2E N -type CPU Units.
  • Page 346 15 Ethernet 15-4 FINS Communications 15-4-1 FINS Communications Service Specifications Item Specification Number of nodes Message Length 1016 bytes max. Date Length (See note 1.) 1004 bytes max. Number of buffer Protocol name FINS/UDP method FINS/TCP method Protocol used UDP/IP TCP/IP The selection of UDP/IP or TCP/IP is made by means of the FINS/UDP or FINS/TCP button in Built-in Ethernet Tab in the CX-Programmer's PLC Setup.
  • Page 347 15 Ethernet 15-4-2 FINS Communications Service FINS commands can be sent to or received from other PLCs or computers on the same Ethernet net- work by executing SEND(090), RECV(098), or CMND(490) instructions in the ladder diagram program. This enables various control operations such as the reading and writing of I/O memory between PLCs, mode changes.
  • Page 348 15 Ethernet Procedure for Using FINS/TCP 1. Make the basic settings. Refer to 15-3-3 Basic Settings. 2. Make the settings for FINS/TCP in the PLC Setup with CX-Programmer. 3. Make the routing table settings and transfer them to each PLC. (See note.) Set the routing tables with CX-Integrator, and transfer it to each PLC.
  • Page 349 15 Ethernet CX-Programmer Setup FINS/UDP Move the cursor to the Settings and double click. Select the Built-in Ethernet Tab. Click the FINS/UDP Setting button to display the FINS/UDP setup dialog. Built-in Ethernet Tab Item Contents Default Fins Node No. Set the node address of the CP2E N -type CPU Unit.
  • Page 350 15 Ethernet Item Contents Default FINS/UDP Port Specify the local UDP port number to be used for the FINS communica- 0 (9,600) tions service. The UDP port number is the number used for UDP identifi- cation of the application layer (i.e., the FINS communications service in this case).
  • Page 351 15 Ethernet Item Contents Default FINS/TCP Port Specify the local TCP port number to be used for the FINS communications 0 (9,600) service. The TCP port number is the number used for TCP identification of the application layer (i.e., the FINS communications service in this case). •...
  • Page 352 15 Ethernet 15-4-5 Auxiliary Area Allocations The following table and descriptions cover the words and bits in the Auxiliary Area of PLC memory that are related to the FINS/UDP and FINS/TCP. Address Bit(s) Name Status Unit operation Access FINS/TCP Turned ON by the Unit when a connection is estab- Read only Connection lished.
  • Page 353 15 Ethernet Response Code List Response codes are 2-byte codes which indicate the results of command execution. They are returned in the response following the command code. The first byte of a response code is the MRES (main response code), which categorizes the results of command execution.
  • Page 354 15 Ethernet Command/Response Reference This section describes the FINS commands that can be sent to PLC’s Ethernet module and the responses to each command. The command, response, and (where applicable) the results storage blocks are given with the com- mands in graphic form as shown in the following diagram. If the data is fixed, it is included in the blocks. If the data is variable, it is described following the blocks.
  • Page 355 15 Ethernet Precautions for Correct Use Precautions for Correct Use No response will be returned if the command ends normally. A response will be returned only if an error occurs. In some cases, send requests (SEND/RECV instructions) made from the PLC to the built-in Ethernet port just before execution of the RESET command may not be executed.
  • Page 356 15 Ethernet 0 Bit Broadcast address setting IP address conversion method FINS/UDP port No. setting FINS/TCP port No. setting FINS/UDP destination IP mode SNTP server specification method • Broadcast Address Setting 0: Broadcast with host number set to all ones (4.3BSD specifications) 1: Broadcast with host number set to all zeroes (4.2BSD specifications) •...
  • Page 357 15 Ethernet New FINS Commands Addressed to CPU Port (0x00) Command Code List This section describes the new FINS commands that can be sent to the CPU port and the responses that are returned. The command codes listed in the following table can be sent to the CPU port. The destination unit address (DA2) in FINS frame should be set as 0x00.
  • Page 358 15 Ethernet Response Codes Response code Description 0000 Normal 0105 Node address setting error Local IP address setting error 1004 Command format error 1100 Connection number not set from 1 to 3 Remote IP address set to 0 Remote TCP port number set to 0 2230 Connection already established with specified remote node 2231...
  • Page 359 15 Ethernet Remote TCP Port Number (Response) Specifies the TCP port number for the remote node. TCP Transitions (Response) Specifies the TCP connection status using the following numbers. For details on TCP status changes, refer to A-6-1 TCP Status Transitions. Number Status Meaning...
  • Page 360 15 Ethernet IP Address Table Records (Command) Specify the IP address table records. The number of records specified must be provided. The total number of bytes in the IP address table records is calculated as the number of records × 6 bytes/record.
  • Page 361 15 Ethernet Parameters Number of Records (Command) The number of records to write is specified in hexadecimal between 0000 and 0008 in the com- mand. If this value is set to 0, the IP router table will be cleared so that no records are registered. IP Router Table Records (Command) Specify the IP router table records.
  • Page 362 15 Ethernet Parameters Number of Records (Command, Response) The number of records to read is specified between 0000 and 0020 (0 to 32 decimal) in the com- mand. If this value is set to 0, the number of stored records is returned but the IP address table records are not returned.
  • Page 363 15 Ethernet Response Block 27 61 8 bytes 8 bytes Command Response Maximum IP router IP router Number Number code code number of stored of records table records table records of stored records records Parameters Number of Records (Command, Response) The number of records to read is specified between 0000 and 0008 (0 to 8 decimal) in the com- mand.
  • Page 364 15 Ethernet 15-4-7 CMND/SEND/RECV Instructions The data and FINS commands can be transmitted between the CP2E N -type CPU Unit and other devices using the CMND, SEND or RECV instuction. Setting the network address and the node address of the instrction in the CP2E N -type CPU Unit ladder program, it is possible to send the data and FINS commands to another device, or receive data from another device.
  • Page 365 15 Ethernet 15-4-8 Restrictions When Using FINS Communication Services CP2E CPU Unit does not support network relay function. The PTs and host computers connected to the CP2E N -type CPU Unit cannot communicate (such as FINS message communication, remote programming or monitoring by the CX-Programmer) with the PLCs or computers on the network by Host Link.
  • Page 366 15 Ethernet 15-5 Socket Services The socket services allow devices on the Ethernet to send and receive various data using either the UDP or TCP protocol. 15-5-1 Overview of Socket Service The way to use socket services is to set the required parameters in the parameter area allocated in the DM Area, and then to request particular UDP or TCP socket services by turning ON dedicated control bits in the AR Area.
  • Page 367 15 Ethernet Precautions for Correct Use Precautions for Correct Use A Socket Service Parameter Area cannot be used for other sockets once open processing has been successfully completed for it. Check the socket status before attempting to open a socket. TCP socket status is provided in words m+4 to m+6 in the DM Area for sockets 1 to 3.
  • Page 368 15 Ethernet 15-5-4 PLC Setup for Socket Services Socket Services Setting CX-Programmer tab Setting Built-in Ethernet TCP/IP keep-alive Item Contents Default TCP/IP keep-alive Set the liveness-checking interval. When socket services using either FINS/TCP or TCP/IP are used, the connection will be terminated if there (120 minutes) is no response from the remote node (either a server or client) within the time set here.
  • Page 369 15 Ethernet 15-5-5 Auxiliary Area Allocations The following table and descriptions cover the words and bits in the Auxiliary Area of PLC memory that are related to the socket services. Ethernet Service Request Address Bit(s) Name Status Unit operation Access A566 Socket Force- All sockets are forcibly closed when this bit...
  • Page 370 15 Ethernet Flag Status Manipulated Unit operation Access Opening Flag Unit ON during open processing. (Turns ON when Read only open request is received.) Unit OFF when open processing has been com- pleted. Receiving Flag Unit ON during receive processing. (Turns ON when receive request is received.) Unit OFF when receive processing has been com-...
  • Page 371 15 Ethernet Switch Status Manipulated Unit operation Access UDP Open Request User UDP socket opened when switch is turned Read/Write Switch Unit Unit turns OFF switch when open processing has been completed (i.e., when a connection has been made). TCP Passive Open User Passive TCP socket opened when switch is Request Switch...
  • Page 372 15 Ethernet 15-5-6 Data Memory Area Allocations The memory allocation about socket service is shown in the following diagram. These data will be allo- cated to the DM area of the PLC. Beginning word m = 16000 Offset Word 08 07 D16000 TCP Socket No.
  • Page 373 15 Ethernet Socket Services Parameter Area 1 to 3 Offset Socket Socket No. 1 No. 3 15 14 13 12 11 10 9 m+28 Socket option UDP/TCP socket number (1 to 3) m+29 Local UDP/TCP port number (0000 to FFFF Hex) m+10 m+30 Remote IP address...
  • Page 374 15 Ethernet TCP Socket Services Parameter No. of Range Socket service words (decimal values in parentheses) passive active receive send close open open Socket option Specified bit UDP/TCP socket 0001 to 0003 hexadecimal (1 to 3) Local UDP/TCP port 0000 to FFFF hexadecimal (0 to 65,535) Remote IP address 00000000 to FFFFFFFF...
  • Page 375 15 Ethernet Remote IP Address Specify the IP address of the remote device. • Offset +2 in the Socket Service Parameter Area contains the upper bytes of the Remote IP Address, and offset +3 contains the lower bytes. Example: The contents of offsets +2 and +3 would be as shown below when the Remote IP Address is 196.36.32.55 (C4.24.20.37 hexadecimal).
  • Page 376 15 Ethernet Send/Receive Data Address Specify the address of the first word to send or the address of the first word where data is to be received. Always set the bit number to 00 hexadecimal. Offset Area Leftmost 2 digits designation of word address Rightmost 2 digits...
  • Page 377 15 Ethernet UDP Socket Receive Request Response code Meaning 0000 Normal end 0302 CPU Unit error; cannot execute. 1100 Number of bytes to receive is not in allowable range. 1101 The area designation of the Send/Receive Data Address is not inallowable range. 1103 The bit number in the Send/Receive Data Address is not 00.
  • Page 378 15 Ethernet TCP Socket Passive Open Request Response Meaning code 0000 Normal end 0105 Local IP address setting error. 1100 TCP socket number is not 1 to 8 or local TCP port number is 0. 110C Request Switch turned ON during other processing. 220F Specified socket is already open or already processing an openrequest.
  • Page 379 15 Ethernet TCP Socket Receive Request Response Meaning code 0000 Normal end 0302 CPU Unit error; cannot execute. 1100 Number of receive bytes not in allowable range. 1101 The area designation of the Send/Receive Data Address is not inallowable range. 1103 The bit number in the Send/Receive Data Address is not 00.
  • Page 380 15 Ethernet TCP Socket Close Request Responsecode Meaning 0000 Normal end 0302 CPU Unit error; cannot execute. 2210 The specified socket is not been connected. 2607 Specified Socket Service Parameter Area is already being used foranother socket. Note These response codes will be returned only on large, multilevel networks. For details, refer to SECTION 6 Socket Services in the Ethernet Units Construction of Applications Operation Manual (Cat.
  • Page 381 15 Ethernet Basic Operations • W0.00 is turned ON to request opening a TCP socket from the Ethernet Unit. • W0.01 is turned ON to request closing the TCP socket from the Ethernet Unit. • W0.02 is turned ON to request sending data from the Ethernet Unit. Data (100 bytes) is sent beginning at D00000.
  • Page 382 15 Ethernet Programming Example W0.00 TCP Passive Open @RSET When the TCP Open Bit (W0.00) turns ON, the TCP W1.00 Open Error Flag (W1.00) is turned OFF and the TCP Opening Flag (W2.00) is turned ON to initialize @SET processing. W2.00 W0.00 W2.00...
  • Page 383 15 Ethernet Continued from previous page. W0.02 TCP Send When the TCP Send Bit (W0.02) turns ON, the TCP Send Error @RSET W1.02 Flag (W1.02) is turned OFF and the TCP Sending Flag (W2.02) is turned ON to initialize processing. @SET W2.02 W0.02...
  • Page 384 15 Ethernet 15-6 Automatic Clock Adjustment and Specifying Servers by Host Name 15-6-1 Automatic Clock Adjustment Function The built-in clock of the PLC connected to the Ethernet can be automatically adjusted, with the SNTP server clock taken as the standard. Automatic adjustments through the entire system enable the vari- ous records generated by production equipment to be managed according to clock information and analyzed.
  • Page 385 15 Ethernet 15-6-3 Procedure for Using the Automatic Clock Adjustment Function 1. Make the basic settings. Refer to 15-3-3 Basic Settings. 2. With the CX-Programmer online, set the following items in the PLC Setup. • SNTP server specification (required) • Access to the SNTP server is enabled when writing clock information from the SNTP server to the CPU Unit when the Automatic Clock Adjustment Switch is turned from OFF to ON and at a set automatic adjustment time.
  • Page 386 15 Ethernet CX-Programmer Setup DNS Setting Move the cursor to the Settings and double click. Select the Built-in Ethernet Tab. Click the DNS Setting button to display the DNS setup dialog. Item Contents Default IP Address Set the IP address for the DNS server. None The DNS server is required when specifying the SNTP servers by host name.
  • Page 387 15 Ethernet Item Contents Default Obtain clock If this option is selected, the CPU Unit’s clock is set to the time at Not checked data from SNTP the SNTP server’s clock. server Auto Adjust- Set the time at which the SNTP server is to be accessed to syn- 0:0:0 ment chronize the clocks.
  • Page 388 15 Ethernet 15-6-5 Auxiliary Area Allocations The following table and descriptions cover the words and bits in the Auxiliary Area of PLC memory that are related to the Automatic Clock Adjustment and Specifying Servers by Host Name function. Service Status Address Bit(s) Name...
  • Page 389 15 Ethernet 15-7 Status Allocations of Bulit-in Ethernet Port The following table and descriptions cover the words and bits in the Auxiliary Area of PLC memory that are related to the status of built-in Ethernet port. Address Bit(s) Name Status Unit operation Access A40 to A44 ---...
  • Page 390 15 Ethernet Address Bit(s) Name Status Unit operation Access FINS/TCP Con- Turned ON by the Unit when a connection is Read only nection Flag 1 established. Turned OFF by the Unit when the connection is terminated. FINS/TCP Con- Turned ON by the Unit when a connection is nection Flag 2 established.
  • Page 391 Other Functions This section describes PID temperature control, clock functions, DM backup functions, security functions. 16-1 PID Temperature Control ........16-2 16-1-1 Overview .
  • Page 392 16 Other Functions 16-1 PID Temperature Control PID temperature control can be used with any model of CP2E CPU Unit. 16-1-1 Overview The CP2E CPU Unit supports PID instructions with the autotuning function. Ladder programs can be written to perform PID temperature control. •...
  • Page 393 16 Other Functions 16-1-2 Flow of Operation Set the temperature range with the rotary switch on Setting the Temperature the front panel. Sensor Unit • Connect the temperature sensor to the Tempera- Wiring I/O ture Sensor Unit. • Connect the SSR to the transistor output. Set parameters with the MOV instruction or other Setting PIDAT and TPO instructions.
  • Page 394 16 Other Functions Autotuning Procedure Automatically Executing Autotuning When PIDAT Is Executed To automatically autotune the PID constants, turn ON the AT Command Bit when the PIDAT instruc- tion is executed. 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.
  • Page 395 16 Other Functions • The Temperature Sensor Unit’s 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. •...
  • Page 396 16 Other Functions 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.
  • Page 397 16 Other Functions 16-2 Clock The clock can be used only with the CP2E N/S -type CPU Unit. The current data is stored in the following words in the Auxiliary Area. Name Address Function Clock data A351 to A354 The seconds, minutes, hour, day of month, month, year, and day of week are stored each cycle.
  • Page 398 16 Other Functions Time-related Instructions Name Mnemonic Function CALENDAR ADD CADD Adds time to the calendar data in the specified words. CALENDAR SUBTRACT CSUB Subtracts time from the calendar data in the specified words. CLOCK ADJUSTMENT DATE Changes the internal clock setting to the setting in the speci- fied source words.
  • Page 399 16 Other Functions 16-3 DM Backup Function This section describes the function that saves specified words from the DM Area in the built-in Flash Memory. 16-3-1 Backing Up and Restoring DM Area Data Overview The contents of the DM Area (D) can be saved when the user needs it. The contents of the specified words in the DM Area data can be backed up from I/O memory to the built-in Flash Memory during operation by turning ON a bit in the Auxiliary Area.
  • Page 400 16 Other Functions Number of Words to Back Up The number of words to back up starting from D0 is set in the Number of CH of DM for backup Box in the Startup Data Read Area in the PLC Setup. Restoring DM Backup Data to the I/O Memory When Power is Turned ON The DM backup data can be restored to the I/O memory when power is turned ON by selecting the Restore D0- from backup memory Check Box in the Startup Data Read Area in the PLC Setup.
  • Page 401 16 Other Functions 16-3-2 Procedure Perform the following procedure to save the DM data to the built-in Flash Memory during operation or while stopped. Check the Restore D0- from backup memory Check Box in the Startup Data Read Area of the PLC Setup from the CX-Programmer.
  • Page 402 16 Other Functions Precautions for Safe Use Power Interruptions during Backup The BKUP indicator on the front of the CPU Unit will be lit when DM Area data is being saved to the built-in Flash Memory. Do not turn OFF the power supply to the PLC while the indicator is lit. If the power supply to the PLC is turned OFF while the BKUP indicator is lit, data will not be backed up.
  • Page 403 16 Other Functions 16-4 Security Functions The Security function can be used with any model of CP2E CPU Unit. 16-4-1 Ladder Program Read Protection Read Protection With the CX-Programmer, it is possible to set read protection using a password for the whole ladder program.
  • Page 404 16 Other Functions • Extend Password Protection It is possible to use longer passwords for UM read protection. Click the Protection Tab in the PLC Properties Dialog Box, select the Extend protection password Check Box, and enter the pass- words. The limits to the password text string lengths are 16 characters.
  • Page 405 16 Other Functions Auxiliary Area Bits Related to Password Protection Status after Startup Name Description mode hold address change settings UM Read Protection A99.00 Indicates whether or not the whole ladder pro- Hold Hold Status grams are read-protected. OFF: UM read protection is not set. ON: UM read protection is set.
  • Page 406 16 Other Functions (2) The following instructions will create a fatal error to prevent the program from being executed when the lot number does not end in 05. A200.11 (First Cycle Flag) ANDL(610) A310 #00FF0000 <> L(306) FALS(007) #50000 D100 (3) The following instructions will create a fatal error to prevent the program from being executed when the lot number does not begin with 23Y.
  • Page 407 Analog Input/Output Option Board This section describes an overview of the Analog Option Board, describes its installa- tion and setting methods, memory allocations, startup operation, refresh time, trouble- shooting and how to use the Analog Option Board. 17-1 General Specifications ......... 17-2 17-2 Part Names .
  • Page 408 17 Analog Input/Output Option Board 17-1 General Specifications CP1 series Analog Option Boards are non-isolated analog units which allow you to easily realize analog input/output function for CP2E N -type CPU Unit. Voltage Input Current Input Voltage Output 0V~10V 0mA~20mA 0V~10V Analog Option Board (Resolution:...
  • Page 409 17 Analog Input/Output Option Board 17-2 Part Names Error LED (red) Analog I/O terminal Terminal Arrangement CP1W-ADB21 CP1W-DAB21V CP1W-MAB221 Note Two COM are connected in inner circuit. LED pattern Color Description Status Remark Fault condition indicator Flash A communication error with CPU Unit has occurred at the unit.
  • Page 410 17 Analog Input/Output Option Board 17-3 Installation and Setting 17-3-1 Installation The following processing explains how to install and remove an Analog Option Board. Precautions for Correct Use Precautions for Correct Use Always turn OFF the power supply to the CPU Unit and wait until all the operation indicators go out before installing or removing the Analog Option Board.
  • Page 411 17 Analog Input/Output Option Board 17-3-2 Setting To use the analog option board on CP2E N -type CPU Unit, it is necessary to set the serial commu- nication settings in the PLC Settings. Connect the CX-Programmer to the CPU Unit, and then change the PLC Settings as follows. Serial Port Tab Page Parameter Setting...
  • Page 412 17 Analog Input/Output Option Board 17-4 Memory Allocation 17-4-1 CIO Area Allocation The memory allocation about analog conversion in the CIO area of PLC is shown as the following diagram. The range of the CIO area is CIO80 to CIO89. The details of allocated CIO channels are described in the following table.
  • Page 413 17 Analog Input/Output Option Board Option board error detail information: A424 Option board CPU Unit AR bits Content Error Process slot CP2E Option board slot A424.00 Option board error 0: Cleared at the timing when N30/N40/N60 1 (left) detail information the cause is released.
  • Page 414 17 Analog Input/Output Option Board 17-5 Analog Input Option Board Each CP1W-ADB21 Analog Input Option Board provides two analog inputs. • The analog input signal ranges are 0 to 10 V (with a resolution 1/4,000) and 0 to 20 mA (with a reso- lution 1/2,000).
  • Page 415 17 Analog Input/Output Option Board 0 to 20 mA The 0 to 20 mA range corresponds to the hexadecimal values 0000 to 07D0 (0 to 2000). The possi- ble data range is 0000 to 0FFF (0 to 4095). But it is strongly suggested that the input current must not exceed 30 mA.
  • Page 416 17 Analog Input/Output Option Board Applicable Cables and Terminal Wiring Applicable Cables Solid wire or ferrules can be used. • Recommended solid wire Wire type Wire size Solid Wire 0.2mm to 0.5mm (AWG24 to AWG20) • Recommended ferrules Manufacturer Model Applicable wire Phoenix Contact AI-0.25-12...
  • Page 417 17 Analog Input/Output Option Board Wiring for Analog Inputs To prevent noise, 2-core shielded twisted-pair cable should be used. 2-core shielded 2-core shielded twisted-pair cable twisted-pair cable V IN V IN Analog Analog Analog Analog device with Input Input device with I IN I IN voltage...
  • Page 418 17 Analog Input/Output Option Board 17-6 Analog Output Option Board Each CP1W-DAB21V Analog Output Option Board provides two analog outputs. • The analog output signal range is 0 to 10 V (with a resolution 1/4,000). 17-6-1 Main Specifications Specifications Item Voltage Output Current Output Output signal range...
  • Page 419 17 Analog Input/Output Option Board Analog Output Terminal Arrangement Voltage Output 1 Voltage Output 2 Output Common 17-6-3 Wiring Internal Circuits V O 1 Analog output 1 V O 2 Analog output 2 COM(−) Analog ground Applicable Cables and Terminal Wiring Applicable Cables Solid wire or ferrules can be used.
  • Page 420 17 Analog Input/Output Option Board Terminal Wiring When wiring the analog I/O terminal block, treat either solid or stranded wires directly. 2-conductor shielded twisted-pair cable Release button • To make the connection, press the release button in with a small flat blade screwdriver and push the line in while the lock is released.
  • Page 421 17 Analog Input/Output Option Board Precautions for Correct Use Precautions for Correct Use When connecting the analog option board to an outside analog device, either ground the 0 V side of the PLC’s external power supply or do not ground the PLC’s external power supply at all. Otherwise the PLC’s external power supply may be shorted depending on the connection meth- ods of the outside analog device.
  • Page 422 17 Analog Input/Output Option Board 17-7 Analog I/O Option Board Each CP1W-MAB221 Analog I/O Option Board provides two analog inputs and two analog outputs. • The analog input signal ranges are 0 to 10 V (with a resolution 1/4,000) and 0 to 20 mA (with a reso- lution 1/2,000).
  • Page 423 17 Analog Input/Output Option Board 17-7-2 Analog I/O Signal Ranges The analog values depend on the I/O signal ranges, as shown in the following diagrams. Note When the input exceeds the specified range, the A/D conversion data will be fixed at either the lower limit or upper limit.
  • Page 424 17 Analog Input/Output Option Board Analog Ouput Signal Ranges 0 to 10 V The hexadecimal values 0000 to 0FA0 (0 to 4000) correspond to an analog voltage range of 0 to 10 V. The entire output range is 10 to 10.24 V. 10.24V Converted Data FFFF...
  • Page 425 17 Analog Input/Output Option Board 17-7-3 Wiring Internal Circuits Analog input Analog output 180 kΩ V O 1 V I 1 56 kΩ 250 Ω Analog output 1 I I 1 Analog input 1 180 kΩ V O 2 V I 2 250 Ω...
  • Page 426 17 Analog Input/Output Option Board • To make the connection, press the release button in with a small flat blade screwdriver and push the line in while the lock is released. Remove the screwdriver and lock it inside. • To disconnect the wiring, press the release button in with a small flat blade screwdriver and pull the line out while the lock is released.
  • Page 427 17 Analog Input/Output Option Board Precautions for Correct Use Precautions for Correct Use When connecting the analog option board to an outside analog device, either ground the 0 V side of the PLC’s external power supply or do not ground the PLC’s external power supply at all. Otherwise the PLC’s external power supply may be shorted depending on the connection meth- ods of the outside analog device.
  • Page 428 17 Analog Input/Output Option Board 17-8 Startup Operation After the power is turned ON, analog option board starts the initialization process. If the initialization fin- ishes normally, the initialization completed flag in related status area (Refer to 17-4-2 Auxiliary Area Allocation: A435) will be set.
  • Page 429 17 Analog Input/Output Option Board 17-9 Analog Option Board Refresh Time The inner conversion time of the Analog Option Board is 2ms/point. The refresh time of data conversion in the CPU Unit is shown as follows. The refresh time differs in accordance with the cycle time. Below are typical values for reference only.
  • Page 430 17 Analog Input/Output Option Board 17-10Trouble Shooting Trouble-shooting with Indicators Probably Auxiliary Area Error Correction AD/DA function Indicator Cause Allocations CPU Unit ser- Service from Check and cor- A435.14, AD/DA conversion will stop. vice monitoring the CPU Unit rect the CPU A435.15 will be The analog input conver- error...
  • Page 431 17 Analog Input/Output Option Board 17-11The Use of Analog Option Board 17-11-1 Procedure Mount the Analog Option Board into the option port. Mount the Analog Option Board Connect to the analog input/output device. Connection with the analog input/output device Set communication protocol in PLC Settings to Host Link, 115200bps, 7,2,E. Connection with the analog input/output device Turn the power of the CPU Unit OFF and ON again.
  • Page 432 17 Analog Input/Output Option Board 17-11-2 Program Example Use the analog option board to carry out 2CH AD inputs and 1CH DA output at the same time. The ranges of AD/DA are as follows: Analog input1: 0~10V Analog input2: 0~20mA Analog output1: 0~10V System composing: CP2E-N + CP1W-MAB221...
  • Page 433 Programming Device Operations This section describes the use of the CX-Programmer to create a ladder programs to operate the CP2E, transfer the program to the CP2E, and debug the program. It also describes other basic functions of the CX-Programmer. 18-1 Programming Devices Usable with the CP2E..... . . 18-2 18-2 Overview of CX-Programmer .
  • Page 434 18 Programming Device Operations 18-1 Programming Devices Usable with the CP2E Refer to Section 4 Programming Device in the CP2E CPU Unit Hardware User’s Manual (Cat. No. W613) for the connection method with a CP2E CPU Unit. Precautions for Correct Use Precautions for Correct Use •...
  • Page 435 For details on the operation of the CX-Programmer, refer to the CX-Programmer Online Help. 18-2-2 CX-Programmer Flow from Startup to Operation The flow of using the CX-Programmer from startup through starting PLC operation is shown below. Select Start - Programs - OMRON - CX-One - CX-Programmer - Start CX-Programmer CX-Programmer.
  • Page 436 18 Programming Device Operations Start CX-Programmer Select Start - Programs - OMRON - CX-One - CX-Programmer. The CX-Programmer will start. The title display will appear, followed by the Main Window. Names and Functions of Parts of the Main Window This section describes the names and functions of each part of the Main Window of the CX-Programmer.
  • Page 437 18 Programming Device Operations (1)Title Bar Displays the name of the project. (2)Main Menu Displays the menus from which commands are selected. (3)Toolbar Displays the icons for executing commands. (4)Project Tree and (6) Project Workspace Used to manage programs and settings. (5)Sections Allow ladder programming to be split up into a number of parts.
  • Page 438 18 Programming Device Operations 18-2-3 Help The CX-Programmer Help describes all the operations of CX-Programmer. It provides an introduction to the various windows and panes and describes basic operations, ladder program creation, and moni- toring. It also describes each of the instructions, including operand notation and contents. Accessing CX-Programmer Help Press the F1 Key from the CX-Programmer.
  • Page 439 18 Programming Device Operations 18-3 Creating a Ladder Program This section describes the use of CX-Programmer to create a ladder program. 18-3-1 Inputting a Ladder Program This section shows how to input a ladder program for an example application using the CX-Programmer commands.
  • Page 440 18 Programming Device Operations Click the Settings Button. The PLC Type Settings Dialog Box will be displayed. Select a CPU Unit model in the CPU Type box, and then click the OK But- ton. The PLC Type Settings Dialog Box will close. Confirm that “USB”...
  • Page 441 18 Programming Device Operations Entering NO and NC Input Conditions • For a NO input condition using the LD instruction, press the L or C Key and select LD. For an OR input condition, press the O or W Key and select OR. •...
  • Page 442 18 Programming Device Operations Additional Information • The following instruction variations can be input. • Upward differentiation (@) • Downward differentiation (%) • Immediate refreshing (!) Example: Immediate refreshing (!) specified. The symbols indicating these instruction variations will be added to the beginning of the instruc- tion whenever they are input regardless of whether the cursor is before (example: |LD), in the middle (example:L|D), or at the end (example: LD|) of the instruction.
  • Page 443 18 Programming Device Operations For an address other than CIO 100.00, input the address from the keyboard. Here, “100.02” has been input. Press the Enter Key. This completes inputting the OUT- PUT instruction. Inputting Instructions A mnemonic can be entered directly as a character string. When you enter the first letter, a list of candidate mnemonics will be displayed.
  • Page 444 18 Programming Device Operations Press the Enter Key. This completes inputting the TIM instruction. Copying Rungs Using the Automatic Address Increment Function When rungs are copied and then pasted, it is possible to automatically increment the addresses by the specified number when pasting the rungs. Example: When the following rung is copied, the bit addresses can be incremented by +16, and the word address can be incremented by +10 when pasting the rung.
  • Page 445 18 Programming Device Operations Addresses are automatically incremented when the rung is pasted. · Bits: Example: Incrementing by +16 Bits (One Word) Example: CIO 0.00 is incremented to CIO 1.00. · Words: Example: Incrementing by +10 Words Example: D100 is incremented to D110. Automatic Creation of Symbol Names and I/O Comments If there are symbol names or I/O comments in the rung that was copied, executing the Address Increment Copy Command will automatically create symbol names and I/O comments.
  • Page 446 18 Programming Device Operations Other rules may also be applicable. Click the Advanced Button to select options. The options are enabled when the Paste Button is clicked. Target Automatic creation rule Description Symbol names Increment the numbers found The symbol name is searched for a number starting from from head.
  • Page 447 18 Programming Device Operations If an error was found, double-click the error message displayed in the Output Window. The cursor will move to the location of the error. Correct the ladder pro- gram as required. Note When there is more than one error, press the Shift + J keys to search for errors in order.
  • Page 448 18 Programming Device Operations 18-3-3 Editing Ladder Programs A ladder program can be edited in the CX-Programmer. Also, I/O comments and rung comments can be input. Inputting and Editing I/O Comments Inputting an I/O Comment with the Ladder Editor In Smart Input Mode, an I/O comment can be input after an operand has been input using the Com- ment Dialog Box.
  • Page 449 18 Programming Device Operations Inputting Rung Comments Comments can be added to rungs in the program. Double-click the header of the rung to which a comment is to be attached. The Rung Properties Dialog Box will be displayed. Input a comment into the Comment Field on the General Tab Page.
  • Page 450 18 Programming Device Operations 18-4 Connecting Online to the CP2E and Transferring the Program This section describes how to make an online connection between the CX-Programmer and the CP2E, and then transfer a ladder program to the CP2E. 18-4-1 Connecting Online To enable transferring programs from the CX-Programmer to the CP2E, it is first necessary to place the CX-Programmer online with the CP2E.
  • Page 451 18 Programming Device Operations Once the online connection has been established, the color of the Ladder Section Window will change to light gray. Additional Information Refer to Section 4 Programming Device in the CP2E CPU Unit Hardware User’s Manual (Cat. No.
  • Page 452 18 Programming Device Operations Additional Information Change to PROGRAM mode before transferring the PLC Setup and ladder program. 18-4-3 Transferring a Ladder Program and the PLC Setup A ladder program created with the CX-Programmer can be transferred to the CP2E. Change to PROGRAM mode, select Operating Mode - Program from the PLC Menu, and then click the Yes Button.
  • Page 453 18 Programming Device Operations Additional Information For details on the transfer options, refer to the CX-Programmer Online Help. Click the Yes Button. Click the OK Button. This completes transferring the lad- der program. 18-4-4 Starting Operation To start operation, turn ON the power or change the operating mode to RUN mode. Precautions for Correct Use Precautions for Correct Use To start operation when the power is turned ON, set the operation mode at startup in the PLC...
  • Page 454 18 Programming Device Operations Select Operating Mode - Run from the PLC Menu. A dialog box to confirm changing the operating mode will be displayed. Click the Yes Button. The CP2E will change to RUN mode, and operation will start. Additional Information PROGRAM mode cannot be changed to MONITOR or RUN mode when the user program, PLC Setup settings and DM area data in the CPU Units are being backed up.
  • Page 455 18 Programming Device Operations 18-5 Online Monitoring and Debugging This section describes how to use CX-Programmer to monitor and debug a ladder program. 18-5-1 Monitoring Status Displaying Execution Status It is possible to display the execution status of a ladder program. This enables checking the execution of the ladder program.
  • Page 456 18 Programming Device Operations Window Frames You can drag the frames in the window to display different views of the program in the Ladder Sec- tion Window. The window can be split into up to four sections. Monitoring Specified Addresses You can specify addresses to check bit status and word contents.
  • Page 457 18 Programming Device Operations 18-5-2 Force-set/Reset Bits Input bits can be controlled from CX-Programmer regardless of input status from the input devices. This is used to establish input and output conditions when performing trial operation, or to see the effect of establishing conditions when debugging.
  • Page 458 18 Programming Device Operations Right-click and select Force - On. The input bit will be force-set. A symbol indicating the force-set sta- tus will be displayed at the input con- dition. Additional Information • Select On to turn ON a bit and Off to turn OFF a bit. •...
  • Page 459 18 Programming Device Operations Online Editing Procedure Change the CP2E’s operating mode to MONITOR or PROGRAM mode. Click the header of the rung to be edited. Select Online Edit - Begin from the PLC Menu. The gray color will be cleared from the Ladder Section Window to indi- cate that the ladder program can be edited.
  • Page 460 18 Programming Device Operations 18-28 CP2E CPU Unit Software User’s Manual(W614)
  • Page 461 Appendices A-1 Instruction Functions ......... . A-2 A-1-1 Sequence Input Instructions .
  • Page 462 Appendices Instruction Functions The CP2E CPU Units support the following instructions. Refer to the CP1E/CP2E CPU Unit Instructions Reference Manual (Cat. No. W483) for details. A-1-1 Sequence Input Instructions Instruction Mnemonic Variations Symbol/Operand Function LOAD @/%/!/!@/!% Indicates a logical start and creates an ON/OFF execution condi- Bus bar tion based on the ON/OFF status of the specified operand bit.
  • Page 463 Appendices Instruction Mnemonic Variations Symbol/Operand Function Reverses the execution condition. CONDITION UP(521) turns ON the execution condition for one cycle when the UP(521) execution condition goes from OFF to ON. CONDITION DOWN DOWN(522) turns ON the execution condition for one cycle when DOWN(522) the execution condition goes from ON to OFF.
  • Page 464 Appendices Instruction Mnemonic Variations Symbol/Operand Function DIFFERENTI- DIFU DIFU(013) turns the designated bit ON for one cycle when the DIFU(013) ATE UP execution condition goes from OFF to ON (rising edge). Execution B: Bit condition Status of B One cycle DIFFERENTI- DIFD DIFD(014) turns the designated bit ON for one cycle when the...
  • Page 465 Appendices A-1-3 Sequence Control Instructions Instruction Mnemonic Variations Symbol/Operand Function Indicates the end of a program. END(001) NO OPERA- This instruction has no function. (No processing is performed for TION NOP(000).) INTERLOCK Interlocks all outputs between IL(002) and ILC(003) when the exe- IL(002) cution condition for IL(002) is OFF.
  • Page 466 Appendices Instruction Mnemonic Variations Symbol/Operand Function CONDITIONAL The operation of CJP(510) is the basically the opposite of CJP(510) JUMP JMP(004). When the execution condition for CJP(510) is ON, pro- gram execution jumps directly to the first JME(005) in the program with the same jump number.
  • Page 467 Appendices A-1-4 Timer and Counter Instructions Instruction Mnemonic Variations Symbol/Operand Function HUNDRED-MS TIM/TIMX(550) operates a decrementing timer with units of 0.1-s. TIMER (BCD) The setting range for the set value (SV) is 0 to 999.9 s for TIM(BCD) and 0 to 6,553.5 s for TIMX(Binary). Timer input N: Timer number S: Set value...
  • Page 468 Appendices Instruction Mnemonic Variations Symbol/Operand Function ACCUMULA- TTIM TTIM(087)/TTIMX(555) operates an incrementing timer with units Timer TTIM(087) TIVE TIMER (BCD) of 0.1-s. The setting range for the set value (SV) is 0 to 999.9 s for input TTIM(BCD) and 0 to 6,553.5 s for TTIMX(Binary). Timer input Reset input...
  • Page 469 Appendices Instruction Mnemonic Variations Symbol/Operand Function REVERSIBLE CNTR CNTR(012)/CNTRX(548) operates a reversible counter. Increment CNTR(012) COUNTER (BCD) input Decrement input Increment input Reset input N: Counter number Decrement input S: Set value Counter PV CNTRX Increment CNTRX(548) (Binary) input Decrement input Counter PV Reset...
  • Page 470 Appendices A-1-5 Comparison Instructions Instruction Mnemonic Variations Symbol/Operand Function Symbol Com- LD, AND, OR + Input comparison instructions compare two values (constants parison =, <>, <, <=, >, and/or the contents of specified words) and create an ON execu- (Unsigned) >= tion condition when the comparison condition is true.
  • Page 471 Appendices Instruction Mnemonic Variations Symbol/Operand Function DOUBLE CMPL Compares two double unsigned binary values (constants and/or CMPL(060) UNSIGNED the contents of specified words) and outputs the result to the Arith- COMPARE metic Flags in the Auxiliary Area. Unsigned binary comparison S1+1 S2+1 S1: Comparison data 1...
  • Page 472 Appendices Instruction Mnemonic Variations Symbol/Operand Function AREA RANGE Compares the 16-bit unsigned binary value in CD (word contents ZCP(088) COMPARE or constant) to the range defined by LL and UL and outputs the results to the Arithmetic Flags in the Auxiliary Area. CD: Comparison data (1 word) LL: Lower limit of range UL: Upper limit of range...
  • Page 473 Appendices Instruction Mnemonic Variations Symbol/Operand Function MOVE BIT MOVB Transfers the specified bit. MOVB(082) S: Source word or data C: Control word D: Destination word C: Control Word Source bit: 00 to 0F (0 to 15 decimal) Destination bit: 00 to 0F (0 to 15 decimal) MOVE DIGIT MOVD...
  • Page 474 Appendices Instruction Mnemonic Variations Symbol/Operand Function BLOCK XFER Transfers the specified number of consecutive words. XFER(070) TRANSFER N words − S+(N 1) − D+(N 1) N: Number of words N: Number of Words S: 1st source word D: 1st destination word The possible range for N is 0000 to FFFF (0 to 65,535 decimal).
  • Page 475 Appendices Instruction Mnemonic Variations Symbol/Operand Function MOVE TIMER/ MOVRW Sets the PLC memory address of the specified timer or counter's MOVRW(561) COUNTER PV PV in the specified Index Register. TO REGISTER Internal I/O memory address of S S: Source (desired TC number) Timer/counter PV only D: Destination (Index Register) Index Register...
  • Page 476 Appendices Instruction Mnemonic Variations Symbol/Operand Function ARITHMETIC Shifts the contents of Wd one bit to the right. ASR(026) SHIFT RIGHT Wd: 100CH 1 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 Wd: Word 1 0 0 1 0 0 0 1 0 0 0 1 0 0 0 DOUBLE ASRL...
  • Page 477 Appendices Instruction Mnemonic Variations Symbol/Operand Function SHIFT N-BITS NASL Shifts the specified 16 bits(NASL) or 32 bits(NSLL) of word data to NASL(580) LEFT the left by the specified number of bits. Shift n-bits D: Shift word C: Control word DOUBLE NSLL NSLL(582) SHIFT N-BITS...
  • Page 478 Appendices Instruction Mnemonic Variations Symbol/Operand Function SHIFT N-BITS NASR Shifts the specified 16 bits(NASR) or 32 bits(NSRL) of word data NASR(581) RIGHT to the right by the specified number of bits. D: Shift word Contents of C: Control word "a" or "0" shifted in Lost DOUBLE...
  • Page 479 Appendices Instruction Mnemonic Variations Symbol/Operand Function DOUBLE ++BL Increments the 8-digit BCD content of the specified words by 1. ++BL(595) INCREMENT Wd+1 Wd+1 Wd: 1st word − −B DECREMENT Decrements the 4-digit BCD content of the specified word by 1. −...
  • Page 480 Appendices Instruction Mnemonic Variations Symbol/Operand Function BCD ADD Adds 4-digit (single-word) BCD data and/or constants. +B(404) WITHOUT (BCD) CARRY (BCD) CY will turn (BCD) ON when Au: Augend word there is a Ad: Addend word carry. R: Result word DOUBLE BCD Adds 8-digit (double-word) BCD data and/or constants.
  • Page 481 Appendices Instruction Mnemonic Variations Symbol/Operand Function − C SIGNED Subtracts 4-digit (single-word) hexadecimal data and/or constants −C(412) BINARY SUB- with the Carry Flag (CY). TRACT WITH (Signed binary) CARRY (Signed binary) − Mi: Minuend word Su: Subtrahend word CY will turn R: Result word ON when (Signed binary)
  • Page 482 Appendices Instruction Mnemonic Variations Symbol/Operand Function SIGNED Multiplies 4-digit signed hexadecimal data and/or constants. *(420) BINARY MUL- (Signed binary) TIPLY × (Signed binary) Md: Multiplicand word (Signed binary) R +1 Mr: Multiplier word R: Result word DOUBLE Multiplies 8-digit signed hexadecimal data and/or constants. *L(421) SIGNED BINARY MUL-...
  • Page 483 Appendices Instruction Mnemonic Variations Symbol/Operand Function DOUBLE Divides 8-digit (double-word) signed hexadecimal data and/or con- /L(431) SIGNED stants. BINARY DIVIDE (Signed binary) Dd + 1 ÷ Dr + 1 (Signed binary) Dd: 1st dividend word Dr: 1st divisor word R + 3 R + 2 R + 1 (Signed binary)
  • Page 484 Appendices A-1-10 Conversion Instructions Instruction Mnemonic Variations Symbol/Operand Function BCD-TO-BINA Converts BCD data to binary data. BIN(023) (BCD) (BIN) S: Source word R: Result word DOUBLE BINL Converts 8-digit BCD data to 8-digit hexadecimal (32-bit binary) BINL(058) BCD-TO-DOU- data. BLE BINARY (BCD) (BIN) (BCD)
  • Page 485 Appendices Instruction Mnemonic Variations Symbol/Operand Function DATA MLPX Reads the numerical value in the specified digit (or byte) in the MLPX(076) DECODER source word, 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).
  • Page 486 Appendices Instruction Mnemonic Variations Symbol/Operand Function DATA DMPX FInds the location of the first or last ON bit within the source word DMPX(077) ENCODER (or 16-word range), and writes that value to the specified digit (or byte) in the result word. 16-to-4 bit conversion FInds leftmost bit (Highest bit address)
  • Page 487 Appendices Instruction Mnemonic Variations Symbol/Operand Function ASCII CON- Converts 4-bit hexadecimal digits in the source word into their ASC(086) VERT 8-bit ASCII equivalents. First digit to convert S: Source word Di: Digit designator D: 1st destination word Number of digits (n+1) Left (1) Right (0) DI: Digit Designator...
  • Page 488 Appendices A-1-11 Logic Instructions Instruction Mnemonic Variations Symbol/Operand Function LOGICAL AND ANDW Takes the logical AND of corresponding bits in single words of ANDW(034) word data and/or constants. →R I1: Input 1 I2: Input 2 R: Result word DOUBLE ANDL Takes the logical AND of corresponding bits in double words of ANDL(610) word data and/or constants.
  • Page 489 Appendices Instruction Mnemonic Variations Symbol/Operand Function COMPLE- Turns OFF all ON bits and turns ON all OFF bits in Wd. COM(029) MENT Wd → Wd: 1 → 0 and 0 → 1 Wd: Word DOUBLE COML Turns OFF all ON bits and turns ON all OFF bits in Wd and Wd+1. COML(614) COMPLE- (Wd+1, Wd) →...
  • Page 490 Appendices Instruction Mnemonic Variations Symbol/Operand Function 32-BIT TO FLTL Converts a 32-bit signed binary value to 32-bit floating-point data FLTL(453) FLOATING and places the result in the specified result words. Signed binary data (32 bits) S: 1st source word Floating-point data R: 1st result word (32 bits) FLOATING-...
  • Page 491 Appendices Instruction Mnemonic Variations Symbol/Operand Function FLOATING LD, AND, or OR Compares the specified single-precision data (32 bits) or con- Using LD: SYMBOL stants and creates an ON execution condition if the comparison COMPARISON result is true. Symbol, option =F, <>F, <F, <=F, >F, or >=F LD connection ON execution condition when...
  • Page 492 Appendices A-1-14 Table Data Processing Instructions Instruction Mnemonic Variations Symbol/Operand Function SWAP BYTES SWAP Switches the leftmost and rightmost bytes in all of the words in the SWAP(637) range. Byte position is swapped. N: Number of words R1: 1st word in range FIND MAXI- Finds the maximum value in the range.
  • Page 493 Appendices A-1-15 Data Control Instructions Instruction Mnemonic Variations Symbol/Operand Function PID CON- PIDAT Executes PID control according to the specified parameters. The PIDAT(191) TROL WITH PID constants can be auto-tuned with PIDAT(191). AUTOTUNING C: First Parameter Word Set value (SV) Proportional band (P) S: Input word Integral constant (Tik)
  • Page 494 Appendices Instruction Mnemonic Variations Symbol/Operand Function TIME-PRO- Inputs the duty ratio or manipulated variable from the specified TPO (685) PORTIONAL word, converts the duty ratio to a time-proportional output based OUTPUT on the specified parameters, and outputs the result from the spec- ified output.
  • Page 495 Appendices Instruction Mnemonic Variations Symbol/Operand Function SCALING 2 SCL2 Converts signed binary data into signed BCD data according to SCL2(486) the specified linear function. An offset can be input in defining the linear function. Positive Offset Negative Offset R (signed BCD) R (signed BCD) S: Source word P1: 1st parameter word...
  • Page 496 Appendices Instruction Mnemonic Variations Symbol/Operand Function SCALING 3 SCL3 Converts signed BCD data into signed binary data according to SCL3(487) the specified linear function. An offset can be input in defining the linear function. Positive Offset Negative Offset R (signed binary) R (signed binary) Max conversion S: Source word...
  • Page 497 Appendices Instruction Mnemonic Variations Symbol/Operand Function AVERAGE Calculates the average value of an input word for the specified AVG(195) number of cycles. S: Source word S: Source word N: Number of cycles N: Number of cycles R: Result word Pointer R + 1 Average Valid Flag Average...
  • Page 498 Appendices A-1-17 Interrupt Control Instructions Instruction Mnemonic Variations Symbol/Operand Function SET INTER- MSKS Sets up interrupt processing for I/O interrupts or scheduled inter- MSKS(690) RUPT MASK rupts. Both I/O interrupt tasks and scheduled interrupt tasks are masked (disabled) when the PC is first turned on. MSKS(690) can be used to unmask or mask I/O interrupts and set the time inter- vals for scheduled interrupts.
  • Page 499 Appendices A-1-18 High-speed Counter/Pulse Output Instructions Instruction Mnemonic Variations Symbol/Operand Function MODE CON- INI(880) can be used to execute the following operations INI(880) TROL • To start or stop comparison of a high-speed counter's PV to the comparison table registered with CTBL(882). •...
  • Page 500 Appendices Instruction Mnemonic Variations Symbol/Operand Function HIGH-SPEED Reads the High-speed counter PV and pulse output PV. PRV(881) COUNTER PV P: Port Specifier READ 0000 hex Pulse output 0 0001 hex Pulse output 1 0002 hex Pulse output 2* P: Port specifier C: Control data 0003 hex Pulse output 3*...
  • Page 501 Appendices Instruction Mnemonic Variations Symbol/Operand Function REGISTER CTBL Registers a comparison table and performs comparisons for a PV CTBL(882) COMPARISON of high-speed counter 0 to 5. An interrupt task between 0 to 15 will TABLE be executed when an execution condition is turned ON. Rotary Encoder Built-in input P: Port specifier...
  • Page 502 Appendices Instruction Mnemonic Variations Symbol/Operand Function REGISTER CTBL • For range comparison, the comparison table always contains CTBL(882) COMPARISON six ranges. The table is 30 words long, as shown below. If it is TABLE not necessary to set six ranges, set the interrupt task number to FFFF hex for all unused ranges.
  • Page 503 Appendices Instruction Mnemonic Variations Symbol/Operand Function SET PULSES PULS Sets the number of output pulses.Actual output of the pulses is PULS(886) started later in the program using SPED(885) or ACC(888) in independent mode. P: Port specifier 0000 hex Pulse output 0 P: Port specifier 0001 hex Pulse output 1...
  • Page 504 Appendices Instruction Mnemonic Variations Symbol/Operand Function PULSE OUT- PLS2 Performs trapezoidal positioning control as the following time PLS2(887) chart. Sets the target frequency, starting frequency, acceleration and deceleration rate and direction. Target frequency Acceleration Deceleration rate rate Specified number P: Port specifier of pulses M: Output mode Starting frequency...
  • Page 505 Appendices Instruction Mnemonic Variations Symbol/Operand Function ACCELERA- Outputs pulses to the specified output port at the specified fre- ACC(888) TION CON- quency using the specified acceleration and deceleration rate. TROL Acceleration Target frequency deceleration rate P: Port specifier M: Output mode S: First word of settings table Pulse output started Pulse output stopped...
  • Page 506 Appendices Instruction Mnemonic Variations Symbol/Operand Function ORIGIN Performs an origin search or origin return operation. ORG(889) SEARCH Origin Proximity Input Signal Origin Input Signal Pulse frequency Origin search high speed Origin search deceleration rate P: Port specifier C: Control data Origin search acceleration rate Origin search low speed...
  • Page 507 Appendices Instruction Mnemonic Variations Symbol/Operand Function PULSE WITH Outputs pulses with the specified duty factor from the specified PWM(891) VARIABLE port. DUTY FACTOR P: Port specifier F: Frequency D: Duty factor Built-in output PWM output 100% Period is determined by frequency Duty factor:15% Duty factor:50% P: Port Specifier...
  • Page 508 Appendices Instruction Mnemonic Variations Symbol/Operand Function INTERRUPT IFEED IFEED(892) uses an input interrupt as a trigger to switch from IFEED(892) FEEDING speed control to position control and move the specified number of pulses. Pulse frequency P: Port Specifier Input interrupt occurs C: Control Data Target S: First word of settings table...
  • Page 509 Appendices Instruction Mnemonic Variations Symbol/Operand Function LINEAR ITPL ITPL(893) outputs a 2 to 4 axes linear interpolation to the specified ITPL(893) INTERPOLA- port. TION C1: Port Specifier Linear interpolation 0 (Only can be used in 0030 hex CP2E N -type CPU Unit) C1: Port Specifier C2: Control Data Linear interpolation 0 (Only can be used in...
  • Page 510 Appendices A-1-19 Step Instructions Instruction Mnemonic Variations Symbol/Operand Function STEP DEFINE STEP When defining the beginning of a STEP(008) functions in following 2 ways, depending on its position step, a control bit is specified as and whether or not a control bit has been specified. follows: (1)Starts a specific step.
  • Page 511 Appendices Instruction Mnemonic Variations Symbol/Operand Function DIGITAL Reads the value set on an external digital switch (or thumbwheel DSW (210) SWITCH switch) connected to an Input Unit or Output Unit and stores the INPUT 4-digit or 8-digit BCD data in the specified words. I: Input Word (Data Line D0 to D3 Inputs) Specify the input word allocated to the Input Unit and connect the digital switch’s D0 to D3 data lines to the Input Unit as shown...
  • Page 512 Appendices Instruction Mnemonic Variations Symbol/Operand Function Inputs up to 64 signals from an 8 × 8 matrix connected to an Input MATRIX INPUT MTR (213) Unit and Output Unit (using 8 input points and 8 output points) and stores that 64-bit data in the 4 destination words. I: Input Word Specify the input word allocated to the Input Unit and connect the 8 input signal lines to the Input Unit as shown in the following...
  • Page 513 Appendices Instruction Mnemonic Variations Symbol/Operand Function 7-SEGMENT 7SEG Converts the source data (either 4-digit or 8-digit BCD) to 7-seg- 7SEG (214) DISPLAY OUT- ment display data, and outputs that data to the specified output word. O: Output Word (Data and Latch Outputs) Specify the output word allocated to the Output Unit and con- nect the 7-segment display to the Output Unit as shown in the following diagram.
  • Page 514 Appendices A-1-21 Serial Communications Instructions Instruction Mnemonic Variations Symbol/Operand Function TRANSMIT Outputs the specified number of bytes of data without conversion TXD(236) from the RS-232C port or RS-485 port built into the CPU Unit or the serial Option Board according to the start code and end code specified for no-protocol mode in the PLC Setup.
  • Page 515 Appendices A-1-22 Network Instructions Instruction Mnemonic Variations Symbol/Operand Function NETWORD SEND Sends data to a node in the Ethernet network. SEND(090) SEND Local node Destination node Number of words to trans- mission S: First source word (local node) D: First destination word (remote node) C: First control word NETWORD RECV...
  • Page 516 Appendices A-1-23 Clock Instructions Instruction Mnemonic Variations Symbol/Operand Function CALENDAR CADD Adds time to the calendar data in the specified words. CADD(730) Seconds Minutes Hour Month Year C: 1st calendar word T: 1st time word R: 1st result word Minutes Seconds Hours Seconds...
  • Page 517 Appendices A-1-24 Failure Diagnosis Instructions Instruction Mnemonic Variations Symbol/Operand Function FAILURE Generates or clears user-defined non-fatal errors. Non-fatal errors FAL(006) ALARM do not stop PC operation. Also generates non-fatal errors with the system. FAL Error Flag ON Corresponding Executed Execution of N: FAL number FAL Number Flag ON FAL(006)
  • Page 518 Appendices Auxiliary Area Allocations by Address The following table lists the data provided in the Auxiliary Area in order of the addresses of the data. A-2-1 Read-only Words Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words...
  • Page 519 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change Ethernet Link Status Ethernet port of N14/20 CPU unit and ON: Ethernet link is Cleared Refreshed Flag (N14/20 Ethernet port A of N30/40/60 CPU unit will be established when the port, N30/40/60...
  • Page 520 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change Serial Port 1 (EX) ON when a communication error has ON: Error Retained Cleared Refreshed Communication Error occurred at the Serial Port 1 (EX). when error OFF: Normal Flag...
  • Page 521 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change Pulse Output 2 This flag will be ON when pulses are ON: Accelerating or Cleared Refreshed Accel/Decel Flag being output from pulse output 2 decelerating each cycle according to an ORG, ACC, PLS2,...
  • Page 522 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change Pulse Output 3 This flag will be ON when pulses are ON: Accelerating or Cleared Refreshed Accel/Decel Flag being output from pulse output 3 decelerating each cycle according to an ORG, ACC, PLS2,...
  • Page 523 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change UM Read Protection Indicates whether all of the ladder ON: UM read- Retained Retained When Status programs in the PLC are protected.
  • Page 524 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A202 00 to Communications Port ON when a communication instruction ON: Network Cleared • Refreshed Enabled Flags (SEND, RECV, or CMND) can be communication when com- executed with the corresponding port...
  • Page 525 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A270 High-speed Counter 0 Contains the PV of high-speed counter Cleared Cleared • Refreshed to A271 0. A271 contains the upper 4 digits and each cycle A270 contains the lower 4 digits.
  • Page 526 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A274 High-speed Counter 0 This flag indicates whether the ON: Incrementing Cleared Setting used Count Direction high-speed counter 0 is currently being for high-speed OFF: Decrementing incremented or decremented.
  • Page 527 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A280 Pulse Output 0 This flag will be ON when pulses are ON: Accelerating or Cleared Refreshed Accel/Decel Flag being output from pulse output 0 decelerating each cycle according to an ORG, ACC, PLS2,...
  • Page 528 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A281 Pulse Output 1 This flag will be ON when pulses are ON: Accelerating or Cleared Refreshed Accel/Decel Flag being output from pulse output 1 decelerating each cycle according to an ORG, ACC, PLS2,...
  • Page 529 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A294 Task Number when This word contains the task number of Cyclic tasks: 0000 Cleared Cleared When program A298/ Program Stopped the task that was being executed when error occurs.
  • Page 530 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A295 Task Error Flag ON when a task error has occurred. A ON: Error Cleared Cleared When program A294, task error will occur when there is no error occurs.
  • Page 531 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A313 Error Contents for An error content is registered when a For details of the Cleared Cleared Refreshed A315.10 Ethernet Errors built-in Ethernet error or Ethernet error contents, refer when a...
  • Page 532 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A320 High-speed Counter 2 These flags indicate whether the PV is ON: PV in range Cleared Cleared • Refreshed Range 1 Comparison within the specified ranges when each cycle OFF: PV not in range...
  • Page 533 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A321 High-speed Counter 3 This flag indicates when an overflow or ON: Overflow or Cleared Cleared • Refreshed Overflow/Underflow underflow has occurred in the underflow when an Flag...
  • Page 534 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A326 High-speed Counter 4 This flag indicates when an overflow or ON: Overflow or Cleared Cleared • Refreshed Overflow/Underflow underflow has occurred in the underflow when an Flag...
  • Page 535 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A351 to Calendar/Clock Area These words contain the CPU Unit’s Retained Retained Written every A354 internal clock data in BCD. The clock cycle can be set from the CX-Programmer, with the DATE instruction, or with a...
  • Page 536 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A392 Serial Port 1/ ON when an error has occurred at the ON: Error Retained Cleared Refreshed Built-in RS-232C Port serial port 1 or built-in RS-232C port. when error OFF: Normal Error Flag...
  • Page 537 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A393 00 to Serial Port 1/ The corresponding bit will be ON when ON: Communicating Retained Cleared Refreshed Built-in RS-232C Port the serial port 1 or built-in RS-232C when there is a OFF: Not...
  • Page 538 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A401 Program Error Flag ON when program contents are ON: Error Cleared Cleared Refreshed A294, (fatal error) incorrect. CPU Unit operation will stop when error A295, OFF: Normal...
  • Page 539 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A402 Other Non-Fatal Error ON when a non-fatal error that is not ON: Other non-fatal Cleared Cleared Refreshed A315 Flag defined for A402.01 to A402.15 occurs. error when error Detailed information is output to the...
  • Page 540 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A424 00 to Error Option Board The bit corresponding to the option slot ON: Error Cleared Cleared Refreshed A353.13 Flags turns ON when an error occurs in an when error OFF: Normal Option Board (A315.13 will be ON).
  • Page 541 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A444 Pulse Output 0 If a Pulse Output Stop Error occurs for Retained Cleared • Refreshed Stop Error Code pulse output 0, the error code is written when origin to this word.
  • Page 542 Appendices A-2-2 Read/Write Words Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A500 Ethernet Communica- Turn this bit ON to clear Ethernet com- Retained Cleared tion Error Clear Flag munication error. After clearing, the system automati- cally returns to OFF.
  • Page 543 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A512 Power Interruption These words contain the time at which See Function col- Retained Retained Written at Time the power was interrupted. The con- umn.
  • Page 544 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A518 Operation End Time The time that operation stopped as a See Function col- Retained Retained See Function result of changing the operating mode umn.
  • Page 545 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A528 Serial Port 1/ These flags indicate what kind of error Bits 00 and 01: Not Retained Cleared Refreshed Built-in RS-232C Port has occurred at the serial port 1 or used.
  • Page 546 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A540 Pulse Output 0 Reset The pulse output 0 PV (contained in OFF to ON: Cleared Retained Cleared A276 and A276 and A277) will be cleared when A277 this bit is turned ON.
  • Page 547 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A543 Pulse Output 3 Reset The pulse output 3 PV (contained in OFF to ON: Cleared Retained Cleared A54 and A54 and A55) will be cleared when this bit is turned ON.
  • Page 548 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change ON: During open A567 Open Processing Flag Flag keeps ON during open Cleared Refreshed at processing for Socket No.1 processing of socket No.1. the start or OFF: Open Finish open process, and then flag...
  • Page 549 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change ON: During open A568 Open Processing Flag Flag keeps ON during open Cleared Refreshed at processing for Socket No.2 processing of socket No.2. the start or OFF: Open Finish open process, and then flag...
  • Page 550 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change ON: During open A569 Open Processing Flag Flag keeps ON during open Cleared Refreshed at processing for Socket No.3 processing of socket No.3. the start or OFF: Open Finish open process, and then flag...
  • Page 551 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A571 UDP Open Request When the flag changes from OFF to OFF to ON: UDP Cleared Switch for Socket ON, UDP open processing is open No.2 executed.
  • Page 552 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A583 I/O Memory Backup The flag will be ON when the I/O ON: I/O memory Retained Retained Refreshed A403.14 Error Flag memory is not held at power ON.
  • Page 553 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A617 Serial Port 1/ Display the present communication Parity Retained Refreshed Built-in RS232C Port settings of the serial port 1 or built-in Function when power is 0: Even...
  • Page 554 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A618 Serial Port 2 Built-in Display the present communication Communication Retained Refreshed RS-485 Port Commu- settings of the serial port 2 or Built-in speed Function when power is...
  • Page 555 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A640 Serial Port 1/ Turn ON this bit to send a command Turned ON: Execu- Retained Cleared DM Area Built-in RS-232C Port and receive a response for the serial tion started words for...
  • Page 556 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A723 Power ON Clock Data These words contain the time at which See at left. Retained Retained Written when the power was turned ON two times power is A725 before the startup time stored in words...
  • Page 557 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A738 Power ON Clock Data These words contain the time at which See at left. Retained Retained Written when the power was turned ON seven times power is A740 before the startup time stored in words...
  • Page 558 Appendices Address Status Related after Status at Write Name Function Settings flags, mode startup timing Words Bits settings change A751 DM Backup Restore ON when DM backup data could not ON: Restore failed Retained Cleared Written when Failed Flag be restored normally. If this flag turns fail to restore.
  • Page 559 Appendices Response Performance A-3-1 I/O Response Time The I/O response time is the time it takes from when an input turns ON, the data is recognized by the CPU Unit, and the ladder programs are executed, up to the time for the result to be output to an output terminal.
  • Page 560 Appendices Calculation Example Conditions: Input ON delay: 1 ms (normal input 0.08 to 0.11 with input constant set to 0 ms) Output ON delay: 0.1 ms (transistor output) Cycle time: 20 ms Minimum I/O response time = 1 ms + 20 ms + 0.1 ms = 21.1 ms Maximum I/O response time = 1 ms + (20 ms ×...
  • Page 561 Appendices A-3-2 Interrupt Response Time Interrupt Response Time for Input Interrupt Tasks The interrupt response time for input interrupt tasks is the time taken from when a built-in input has turned ON (or OFF) until the input interrupt task has actually been executed. The length of the interrupt response time for input interrupt tasks depends on the total of the hard- ware interrupt response time and software interrupt response time.
  • Page 562 Appendices Interrupt Response Time for Scheduled Interrupt Tasks The interrupt response time for scheduled interrupt tasks is the time taken from after the scheduled time specified by the MSKS instruction has elapsed until the interrupt task has actually been exe- cuted.
  • Page 563 Appendices A-3-4 Pulse Output Start Time The pulse output start time is the time required from executing a pulse output instruction until pulses are output externally. This time depends on the pulse output instruction that is used and operation that is performed. Instruction Start time execution...
  • Page 564 Appendices PLC Operation for Power Interruptions Overview of Operation for Power Interruptions Power Supply Voltage Drop If the power supply voltage falls below the specified value (85% of rated voltage) while the CPU Unit is in RUN or MONITOR mode, operation will be stopped and all outputs will be turned OFF. Detection of Momentary Power Interruptions The system will continue to run if the momentary power interruption lasts less than 10 ms (2ms for DC power supply).
  • Page 565 Appendices Power OFF Timing Chart Operation always stopped at this point Power supply voltage: 85% Holding time for 5 V internal power supply after power OFF detection: 1 ms Power OFF detection Power OFF Detection Time AC: 10ms Power OFF DC: 2ms detected signal Program execution...
  • Page 566 Appendices Power supply Power OFF detected voltage: 85% Power OFF Power OFF detection time detected singal AC: 10 ms min. DC: 2 ms min. Program execution Cyclic task or interrupt task status CPU reset signal External power supply input Input signal to CP2E If the external power supply input turns OFF before the power interruption is detected, the CPU Unit will read the...
  • Page 567 Appendices A-5 Memory Map PLC Memory Addresses PLC memory addresses are set in Index Registers (IR00 to IR15) to indirectly address I/O memory. Normally, use the MOVE TO REGISTER (MOVR(560)) and MOVE TIMER/COUNTER PV TO REGIS- TER (MOVRW(561)) instructions to set PLC memory addresses into the Index Registers. Some instructions, such as FIND MAXIMUM (MAX(182)), and FIND MINIMUM (MIN(183)), output the results of processing to an Index Register to indicate an PLC memory address.
  • Page 568 Appendices Memory Map PLC memory address Classification User addresses Area (hex) I/O memory 0 to 0174F Reserved for system areas 01750 to 0176F T00 to T31 Timer Completion Flags 01770 to 0178F C00 to C31 Counter Completion Flags 01790 to 017BF Reserved for system 017C0 to 0197F A0 to A447...
  • Page 569 Appendices A-6 Ethernet Functions A-6-1 TCP Status Transitions CLOSED ACTIVE OPEN snd SYN CLOSE Passive OPEN LISTEN CLOSE rcv SYN SEND snd SYN, ACK snd SYN rcv SYN RECEIVED SENT snd ACK rcv ACK of SYN rcv SYN, ACK snd ACK CLOSE ESTABLISHED snd FIN...
  • Page 570 Appendices A-6-2 Ethernet Network Parameters Parameter Value Description Hold timer 18 s The hold timer is used for active open processing of TCP sockets. An ETIMEDOUT error will occur if connection is not completed within 18 s. Resend timer The resend timer is used to monitor completion of reception of arrival confirmations when transferring data via socket services.
  • Page 571 Index Symbols Closing Flag ...............15-40 CMND(490) instruction ..........15-17 *D(Specifying indirect addresses commands in BCD Mode)..........4-19, 5-12 FINS commands...........15-27 @D(Specifying indirect addresses Communications settings ......7-5, 7-9, 7-13 in Binary Mode)..........4-19, 5-12 Condition Flags .............5-4, 5-25 Numerics Connecting the Servo Drive and external sensors..12-8 Constants..............4-23 1:N NT Links ............14-5, 14-7 CONTROLLER DATA READ ........15-25...
  • Page 572 Equals Flag(P_EQ) ............. 5-25 CPU Unit..............6-3 Error Flag(P_ER)............5-25 Expansion I/O Unit........... 6-4 Ethernet communications Expansion Unit............6-6 addresses I/O allocations reading from Unit ........15-25 DM Area............... 15-42 exchanging data between PLCs ......15-5 I/O memory............. 3-3, 5-2 Ethernet Unit Setup ...........
  • Page 573 P_CY(Carry Flag) ............5-25 P_EQ(Equals Flag) ............5-25 keep-alive field ............15-21 P_ER(Error Flag) ............5-25 P_GE(Greater Than or Equals Flag) ......5-26 P_GT(Greater Than Flag)..........5-25 Ladder program P_LE(Less than or Equals Flag) ........5-26 Editing ..............18-16 P_LT(Less Than Flag)..........5-26 Input ............... 18-7 P_N(Negative Flag)............5-26 Saving and reading ..........
  • Page 574 Reading the pulse output present value ....12-44 sockets Related Auxiliary Area ......... 12-45 status ..............15-39 Specifications ............12-15 TCP sockets Speed control (continuous mode)......12-64 status ..........15-42, A-109 Triangular control ..........12-67 Software reset ............11-12 Writing the ladder program ........12-14 Specifying addresses ..........
  • Page 575 Revision History A manual revision code appears as a suffix to the catalog number on the front cover of the manual. Cat. No. W614-E1-01 Revision code Revision code Date Revised content September 2019 Original production CP2E CPU Unit Software User’s Manual(W614) Revision-1...
  • Page 576 Revision-2 CP2E CPU Unit Software User’s Manual(W614)
  • Page 578 The Netherlands Hoffman Estates, IL 60169 U.S.A. Tel: (31)2356-81-300/Fax: (31)2356-81-388 Tel: (1) 847-843-7900/Fax: (1) 847-843-7787 © OMRON Corporation 2019 All Rights Reserved. OMRON (CHINA) CO., LTD. OMRON ASIA PACIFIC PTE. LTD. In the interest of product improvement, Room 2211, Bank of China Tower, No.

Table of Contents