1. Offer; Acceptance. These terms and conditions (these "Terms") are deemed
part of all quotes, agreements, purchase orders, acknowledgments, price lists,
catalogs, manuals, brochures and other documents, whether electronic or in
writing, relating to the sale of products or services (collectively, the "Products
by Omron Electronics LLC and its subsidiary companies (“Omron
objects to any terms or conditions proposed in Buyer’s purchase order or other
documents which are inconsistent with, or in addition to, these Terms.
2. Prices; Payment Terms.
out notice by Omron. Omron reserves the right to increase or decrease prices
on any unshipped portions of outstanding orders. Payments for Products are
due net 30 days unless otherwise stated in the invoice.
3. Discounts.
sent to Buyer after deducting transportation charges, taxes and duties, and will
be allowed only if (i) the invoice is paid according to Omron’s payment terms
and (ii) Buyer has no past due amounts.
4. Interest.
the maximum legal rate, whichever is less, on any balance not paid within the
stated terms.
5. Orders
6. Governmental Approvals.
costs involved in, obtaining any government approvals required for the importation or sale of the Products.
7. Taxes
real property and income taxes), including any interest or penalties thereon,
imposed directly or indirectly on Omron or required to be collected directly or
indirectly by Omron for the manufacture, production, sale, delivery, importation, consumption or use of the Products sold hereunder (including customs
duties and sales, excise, use, turnover and license taxes) shall be charged to
and remitted by Buyer to Omron.
8. Financial.
to Omron, Omron reserves the right to stop shipments or require satisfactory
security or payment in advance. If Buyer fails to make payment or otherwise
comply with these Terms or any related agreement, Omron may (without liability and in addition to other remedies) cancel any unshipped portion of Products sold hereunder and stop any Products in transit until Buyer pays all
amounts, including amounts payable hereunder, whether or not then due,
which are owing to it by Buyer. Buyer shall in any event remain liable for all
unpaid accounts.
9. Cancellation; Etc.
unless Buyer indemnifies Omron against all related costs or expenses.
10. Force Majeure
resulting from causes beyond its control, including earthquakes, fires, floods,
strikes or other labor disputes, shortage of labor or materials, accidents to
machinery, acts of sabotage, riots, delay in or lack of transportation or the
requirements of any government authority.
11. Shipping; Delivery.
a. Shipments shall be by a carrier selected by Omron; Omron will not drop ship
b. Such carrier shall act as the agent of Buyer and delivery to such carrier shall
c. All sales and shipments of Products shall be FOB shipping point (unless oth-
d. Delivery and shipping dates are estimates only; and
e. Omron will package Products as it deems proper for protection against nor-
12. Claims.
Products occurring before delivery to the carrier must be presented in writing
to Omron within 30 days of receipt of shipment and include the original transportation bill signed by the carrier noting that the carrier received the Products
from Omron in the condition claimed.
13. Warranties
Products will be free from defects in materials and workmanship 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.
(b) Limitations
EXPRESS OR IMPLIED, ABOUT NON-INFRINGEMENT, MERCHANTABIL-
Cash discounts, if any, will apply only on the net amount of invoices
Omron, at its option, may charge Buyer 1-1/2% interest per month or
. Omron will accept no order less than $200 net billing.
. All taxes, duties and other governmental charges (other than general
If the financial position of Buyer at any time becomes unsatisfactory
except in “break down” situations.
constitute delivery to Buyer;
erwise stated in writing by Omron), at which point title and risk of loss shall
pass from Omron to Buyer; provided that Omron shall retain a security interest in the Products until the full purchase price is paid;
mal handling and extra charges apply to special conditions.
Any claim by Buyer against Omron for shortage or damage to the
. (a) Exclusive Warranty. Omron’s exclusive warranty is that the
All prices stated are current, subject to change with-
Buyer shall be responsible for, and shall bear all
Orders are not subject to rescheduling or cancellation
. Omron shall not be liable for any delay or failure in delivery
Unless otherwise expressly agreed in writing by Omron:
. OMRON MAKES NO WARRANTY OR REPRESENTATION,
”). Omron
ITY OR FITNESS FOR A PARTICULAR PURPOSE OF THE PRODUCTS.
BUYER ACKNOWLEDGES THAT IT ALONE HAS DETERMINED THAT THE
PRODUCTS WILL SUITABLY MEET THE REQUIREMENTS OF THEIR
")
INTENDED USE. Omron further disclaims all warranties and responsibility of
any type for claims or expenses based on infringement by the Products or otherwise of any intellectual property right. (c) Buyer Remedy
gation hereunder shall be, at Omron’s election, to (i) replace (in the form
originally shipped with Buyer responsible for labor charges for removal or
replacement thereof) the non-complying Product, (ii) repair the non-complying
Product, or (iii) repay or credit Buyer an amount equal to the purchase price of
the non-complying Product; provided that in no event shall Omron be responsible for warranty, repair, indemnity or any other claims or expenses regarding
the Products unless Omron’s analysis confirms that the Products were properly handled, stored, installed and maintained and not subject to contamination, abuse, misuse or inappropriate modification. Return of any Products by
Buyer must be approved in writing by Omron before shipment. Omron Companies shall not be liable for the suitability or unsuitability or the results from the
use of Products in combination with any electrical or electronic components,
circuits, system assemblies or any other materials or substances or environments. Any advice, recommendations or information given orally or in writing,
are not to be construed as an amendment or addition to the above warranty.
See http://oeweb.omron.com or contact your Omron representative for published information.
14. Limitation on Liability; Etc
FOR SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
LOSS OF PROFITS OR PRODUCTION OR COMMERCIAL LOSS IN ANY
WAY CONNECTED WITH THE PRODUCTS, WHETHER SUCH CLAIM IS
BASED IN CONTRACT, WARRANTY, NEGLIGENCE OR STRICT LIABILITY.
Further, in no event shall liability of Omron Companies exceed the individual
price of the Product on which liability is asserted.
15. Indemnities
their employees from and against all liabilities, losses, claims, costs and
expenses (including attorney's fees and expenses) related to any claim, investigation, litigation or proceeding (whether or not Omron is a party) which arises
or is alleged to arise from Buyer's acts or omissions under these Terms or in
any way with respect to the Products. Without limiting the foregoing, Buyer (at
its own expense) shall indemnify and hold harmless Omron and defend or settle any action brought against such Companies to the extent based on a claim
that any Product made to Buyer specifications infringed intellectual property
rights of another party.
16. Property; Confidentiality.
sive property of Omron Companies and Buyer shall not attempt to duplicate it
in any way without the written permission of Omron. Notwithstanding any
charges to Buyer for engineering or tooling, all engineering and tooling shall
remain the exclusive property of Omron. All information and materials supplied
by Omron to Buyer relating to the Products are confidential and proprietary,
and Buyer shall limit distribution thereof to its trusted employees and strictly
prevent disclosure to any third party.
17. Export Controls.
licenses regarding (i) export of products or information; (iii) sale of products to
“forbidden” or other proscribed persons; and (ii) disclosure to non-citizens of
regulated technology or information.
18. Miscellaneous
and no course of dealing between Buyer and Omron shall operate as a waiver
of rights by Omron. (b) Assignment
without Omron's written consent. (c) Law.
law of the jurisdiction of the home office of the Omron company from which
Buyer is purchasing the Products (without regard to conflict of law principles). (d) Amendment
Buyer and Omron relating to the Products, and no provision may be changed
or waived unless in writing signed by the parties. (e) Severability
sion hereof is rendered ineffective or invalid, such provision shall not invalidate
any other provision. (f) Setoff
against the amount owing in respect of this invoice. (g) Definitions
herein, “including” means “including without limitation”; and “Omron Companies” (or similar words) mean Omron Corporation and any direct or indirect
subsidiary or affiliate thereof.
. Buyer shall indemnify and hold harmless Omron Companies and
Buyer shall comply with all applicable laws, regulations and
. (a) Waiver. No failure or delay by Omron in exercising any right
. OMRON COMPANIES SHALL NOT BE LIABLE
Any intellectual property in the Products is the exclu-
. Buyer may not assign its rights hereunder
These Terms are governed by the
. These Terms constitute the entire agreement between
. Buyer shall have no right to set off any amounts
. Omron’s sole obli-
. If any provi-
. As used
Certain Precautions on Specifications and Use
1. Suitability of Use. Omron Companies shall not be responsible for conformity
with any standards, codes or regulations which apply to the combination of the
Product in the Buyer’s application or use of the Product. At Buyer’s request,
Omron will provide applicable third party certification documents identifying
ratings and limitations of use which apply to the Product. This information by
itself is not sufficient for a complete determination of the suitability of the Product in combination with the end product, machine, system, or other application
or use. Buyer shall be solely responsible for determining appropriateness of
the particular Product with respect to Buyer’s application, product or system.
Buyer shall take application responsibility in all cases but the following is a
non-exhaustive list of applications for which particular attention must be given:
(i) Outdoor use, uses involving potential chemical contamination or electrical
interference, or conditions or uses not described in this document.
(ii) Use in consumer products or any use in significant quantities.
(iii) Energy control systems, combustion systems, railroad systems, aviation
systems, medical equipment, amusement machines, vehicles, safety equipment, and installations subject to separate industry or government regulations.
(iv) Systems, machines and equipment that could present a risk to life or property. Please know and observe all prohibitions of use applicable to this Product.
NEVER USE THE PRODUCT FOR AN APPLICATION INVOLVING SERIOUS
RISK TO LIFE OR PROPERTY OR IN LARGE QUANTITIES WITHOUT
ENSURING THAT THE SYSTEM AS A WHOLE HAS BEEN DESIGNED TO
ADDRESS THE RISKS, AND THAT THE OMRON’S PRODUCT IS PROPERLY RATED AND INSTALLED FOR THE INTENDED USE WITHIN THE
OVERALL EQUIPMENT OR SYSTEM.
2. Programmable Products.
user’s programming of a programmable Product, or any consequence thereof.
3. Performance Data
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 performance is subject to the Omron’s Warranty and Limitations
of Liability.
4. Change in Specifications
changed at any time based on improvements and other reasons. It is our practice to change part numbers when published ratings or features are changed,
or when significant construction changes are made. However, some specifications of the Product may be changed without any notice. When in doubt, special part numbers may be assigned to fix or establish key specifications for
your application. Please consult with your Omron’s representative at any time
to confirm actual specifications of purchased Product.
5. Errors and Omissions.
checked and is believed to be accurate; however, no responsibility is assumed
for clerical, typographical or proofreading errors or omissions.
Omron Companies shall not be responsible for the
. Data presented in Omron Company websites, catalogs
. Product specifications and accessories may be
Information presented by Omron Companies has been
Page 5
Notice:
r
f
OMRON products are manufactured for use according to proper procedures
by a qualified operator and only for the purposes described in this manual.
The following conventions are used to indicate and classify precautions in this
manual. Always heed the information provided with them. Failure to heed precautions can result in injury to people or damage to property.
!DANGERIndicates an imminently hazardous situation which, if not avoided, will result in death or
serious injury. Additionally, there may be severe property damage.
!WARNINGIndicates a potentially hazardous situation which, if not avoided, could result in death or
serious injury. Additionally, there may be severe property damage.
!CautionIndicates a potentially hazardous situation which, if not avoided, may result in minor or
moderate injury, or property damage.
OMRON Product References
All OMRON products are capitalized in this manual. The word “Unit” is also
capitalized when it refers to an OMRON product, regardless of whether or not
it appears in the proper name of the product.
The abbreviation “Ch,” which appears in some displays and on some OMRON
products, often means “word” and is abbreviated “Wd” in documentation in
this sense.
The abbreviation “PLC” means Programmable Controller. “PC” is used, however, in some Programming Device displays to mean Programmable Controller.
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form, o
by any means, mechanical, electronic, photocopying, recording, or otherwise, without the prior written permission o
OMRON.
No patent liability is assumed with respect to the use of the information contained herein. Moreover, because OMRON is constantly striving to improve its high-quality products, the information contained in this manual is subject to change without
notice. Every precaution has been taken in the preparation of this manual. Nevertheless, OMRON assumes no responsibility
for errors or omissions. Neither is any liability assumed for damages resulting from the use of the information contained in
this publication.
The following headings appear in the left column of the manual to help you
locate different types of information.
Note Indicates information of particular interest for efficient and convenient opera-
tion of the product.
1,2,3...1. Indicates lists of one sort or another, such as procedures, checklists, etc.
v
Page 6
Unit Versions of CS/CJ-series CPU Units
Unit VersionsA “unit version” has been introduced to manage CPU Units in the CS/CJ
Series according to differences in functionality accompanying Unit upgrades.
This applies to the CS1-H, CJ1-H, CJ1M, and CS1D CPU Units.
Notation of Unit Versions
on Products
CS/CJ-series CPU Unit
The unit version is given to the right of the lot number on the nameplate of the
products for which unit versions are being managed, as shown below.
Product nameplate
CS1H-CPU67H
CPU UNIT
Lot No.
Lot No. 040715 0000 Ver.3.0
OMRON Corporat ionMADE IN JAPA N
Unit version
Example for Unit version 3.0
• CS1-H, CJ1-H, and CJ1M CPU Units (except for low-end models) manufactured on or before November 4, 2003 do not have a unit version given
on the CPU Unit (i.e., the location for the unit version shown above is
blank).
• The unit version of the CS1-H, CJ1-H, and CJ1M CPU Units, as well as
the CS1D CPU Units for Single-CPU Systems, begins at version 2.0.
• The unit version of the CS1D CPU Units for Duplex-CPU Systems, begins
at version 1.1.
• CPU Units for which a unit version is not given are called Pre-Ver. @.@CPU Units, such as Pre-Ver. 2.0 CPU Units and Pre-Ver. 1.1 CPU Units.
Confirming Unit Versions
with Support Software
CX-Programmer version 4.0 can be used to confirm the unit version using one
of the following two methods.
• Using the PLC Information
• Using the Unit Manufacturing Information (This method can be used for
Special I/O Units and CPU Bus Units as well.)
Note CX-Programmer version 3.3 or lower cannot be used to confirm unit versions.
PLC Information
• If you know the device type and CPU type, select them in the Change
PLC Dialog Box, go online, and select PLC - Edit - Information from the
menus.
• If you don't know the device type and CPU type, but are connected
directly to the CPU Unit on a serial line, select PLC - Auto Online to go
online, and then select PLC - Edit - Information from the menus.
In either case, the following PLC Information Dialog Box will be displayed.
vi
Page 7
Unit version
Use the above display to confirm the unit version of the CPU Unit.
Unit Manufacturing Information
In the IO Table Window, right-click and select Unit Manufacturing information - CPU Unit.
The following Unit Manufacturing information Dialog Box will be displayed.
vii
Page 8
Unit version
Use the above display to confirm the unit version of the CPU Unit connected
online.
Using the Unit Version
Labels
The following unit version labels are provided with the CPU Unit.
These labels can be attached to the front of previous CPU Units to differentiate between CPU Units of different unit versions.
viii
Page 9
Unit Version Notation
In this manual, the unit version of a CPU Unit is given as shown in the following table.
Product nameplate
Meaning
Designating individual
CPU Units (e.g., the
CS1H-CPU67H)
Designating groups of
CPU Units (e.g., the
CS1-H CPU Units)
Designating an entire
series of CPU Units
(e.g., the CS-series CPU
Units)
CPU Units on which no unit version is
given
Lot No. XXXXXX XXXX
OMRON CorporationMADE IN JAPAN
Pre-Ver. 2.0 CS1-H CPU UnitsCS1H-CPU67H CPU Unit Ver. @.@
Pre-Ver. 2.0 CS1-H CPU UnitsCS1-H CPU Units Ver. @.@
Pre-Ver. 2.0 CS-series CPU UnitsCS-series CPU Units Ver. @.@
Downloading and Uploading Individual Tasks---OK
Improved Read Protection Using Passwords---OK
Write Protection from FINS Commands Sent to CPU Units via Net-
works
Online Network Connections without I/O Tables---OK
Communications through a Maximum of 8 Network Levels---OK
Connecting Online to PLCs via NS-series PTsOK from lot number
Setting First Slot WordsOK for up to 8 groupsOK for up to 64 groups
Automatic Transfers at Power ON without a Parameter File---OK
Automatic Detection of I/O Allocation Method for Automatic Transfer
at Power ON
Operation Start/End Times---OK
New Applica-
tion Instructions
MILH, MILR, MILC---OK
=DT, <>DT, <DT, <=DT, >DT, >=DT---OK
BCMP2---OK
GRYOK from lot number
TPO---OK
DSW, TKY, HKY, MTR, 7SEG---OK
EXPLT, EGATR, ESATR, ECHRD, ECHWR---OK
Reading/Writing CPU Bus Units with IORD/IOWR OK from lot number
PRV2------
---OK
030201
------
030201
030418
CPU Units Ver. 2.0
OK
OK
OK
xi
Page 12
CS1D CPU Units
FunctionCS1D CPU Units for Duplex-CPU Systems
Pre-Ver. 1.1 CPU
Functions
unique to
CS1D CPU
Units
Downloading and Uploading Individual Tasks------OK
Improved Read Protection Using Passwords------OK
Write Protection from FINS Commands Sent
to CPU Units via Networks
Online Network Connections without I/O
Ta bl e s
Communications through a Maximum of 8
Network Levels
Connecting Online to PLCs via NS-series PTs ------OK
Setting First Slot Words------OK for up to 64
Automatic Transfers at Power ON without a
Parameter File
Automatic Detection of I/O Allocation Method
for Automatic Transfer at Power ON
Operation Start/End Times---OKOK
New Applica-
tion Instructions
Duplex CPU UnitsOKOK--Online Unit ReplacementOKOKOK
Duplex Power Supply UnitsOKOKOK
Duplex Controller Link UnitsOKOKOK
Duplex Ethernet Units---OKOK
Write Protection from FINS
Commands Sent to CPU Units
via Networks
Online Network Connections
without I/O Tables
Communications through a
Maximum of 8 Network Levels
Connecting Online to PLCs via
NS-series PTs
Setting First Slot Words---OK---OKOK
Automatic Transfers at Power
ON without a Parameter File
Automatic Detection of I/O Allo-
cation Method for Automatic
Transfer at Power ON
Operation Start/End Times---OK---OKOK
New
Application
Instructions
MILH, MILR, MILC ---OK---OKOK
=DT, <>DT, <DT,
<=DT, >DT, >=DT
BCMP2---OKOKOKOK
GRYOK from lot
TPO---OK---OKOK
DSW, TKY, HKY,
MTR, 7SEG
EXPLT, EGATR,
ESATR, ECHRD,
ECHWR
Reading/Writing
CPU Bus Units with
IORD/IOWR
PRV2---------OK, but only for
---OK---OKOK
---OK---OKOK
---OK---OKOK
OK, but only if
I/O table allocation at power
ON is set
OK for up to 8
groups
OK from lot
number 030201
---OK---OKOK
---OK---OKOK
---OK---OKOK
number 030201
---OK---OKOK
---OK---OKOK
---OK---OKOK
(CJ1@-CPU@@H)
Pre-Ver. 2.0
CPU Units
CPU Units Ver.
2.0
OKOK, but only if
OK for up to 64
groups
OKOK from lot
OKOK from lot
I/O table allocation at power
ON is set
OK for up to 8
groups
number 030201
number 030201
CJ1M CPU Units,
except low-end models
(CJ1M-CPU@@)
Pre-Ver. 2.0
CPU Units
CPU Units Ver.
OKOK
OK for up to 64
groups
OKOK
OKOK
models with
built-in I/O
2.0
CJ1M CPU
Units, low-end
models
(CJ1M-
CPU11/21)
CPU Units Ver.
2.0
OK for up to 64
groups
OK, but only for
models with
built-in I/O
xiii
Page 14
Functions Supported by Unit Version 3.0 or Later
CS1-H CPU Units (CS1@-CPU@@H)
FunctionUnit version
Pre-Ver. 2.0, Ver. 2.0Ver. 3.0
Function blocks (supported for CX-Programmer Ver. 5.0 or higher)---OK
Serial Gateway (converting FINS commands to CompoWay/F com-
mands at the built-in serial port)
Comment memory (in internal flash memory)---OK
Expanded simple backup data---OK
New Applica-
tion Instructions
Additional
instruction functions
TXDU(256), RXDU(255) (support no-protocol
communications with Serial Communications
Units with unit version 1.2 or later)
Model conversion instructions: XFERC(565),
DISTC(566), COLLC(567), MOVBC(568),
BCNTC(621)
Special function block instructions: GETID(286)---OK
TXD(235) and RXD(236) instructions (support no-
protocol communications with Serial Communications Boards with unit version 1.2 or later)
CS1D CPU UnitsUnit version 3.0 is not supported.
CJ1-H/CJ1M CPU Units (CJ1@-CPU@@H, CJ1G-CPU@@P, C J1 M- CP U @@)
FunctionUnit version
Function blocks (supported for CX-Programmer Ver. 5.0 or higher)---OK
Serial Gateway (converting FINS commands to CompoWay/F com-
mands at the built-in serial port)
Comment memory (in internal flash memory)---OK
Expanded simple backup data---OK
New Applica-
tion Instructions
Additional
instruction functions
TXDU(256), RXDU(255) (support no-protocol
communications with Serial Communications
Units with unit version 1.2 or later)
Model conversion instructions: XFERC(565),
DISTC(566), COLLC(567), MOVBC(568),
BCNTC(621)
Special function block instructions: GETID(286)---OK
PRV(881) and PRV2(883) instructions: Added
high-frequency calculation methods for calculating pulse frequency. (CJ1M CPU Units only)
---OK
---OK
---OK
---OK
Pre-Ver. 2.0, Ver. 2.0Ver. 3.0
---OK
---OK
---OK
---OK
xiv
Page 15
Unit Versions and Programming Devices
CX-Programmer version 4.0 or higher must be used to enable using the functions added for CPU Unit version 2.0.
CX-Programmer version 5.0 or higher must be used to enable using function
blocks added for CPU Unit version 3.0.
The following tables show the relationship between unit versions and CX-Programmer versions.
Unit Versions and Programming Devices
CPU Unit FunctionsCX-ProgrammerProgram-
CJ1M CPU Units,
low-end models,
unit Ver. 2.0
CS1-H, CJ1-H,
and CJ1M CPU
Units except lowend models, unit
Ver. 2. 0
CS1D CPU Units
for Single-CPU
Systems, unit Ver.
2.0
CS1D CPU Units
for Duplex-CPU
Systems, unit
Ver.1.
CS/CJ-series unit
Ver. 3. 0
Functions added
for unit version
2.0
Functions added
for unit version
2.0
Functions added
for unit version
2.0
Functions added
for unit version
1.1
Function block
functions added
for unit version
3.0
Ver. 3.2
or lower
Using new functions------OKOKNo
Not using new functions---OKOKOK
Using new functions------OKOK
Not using new functionsOKOKOKOK
Using new functions------OKOK
Not using new functionsOK
Using new functions------OKOK
Not using new functionsOKOKOKOK
Using function blocks---------OK
Not using function blocks OKOKOKOK
Ver. 3.3 Ver. 4.0Ver. 5.0
or higher
ming Con-
sole
restrictions
Note As shown above, there is no need to upgrade to CX-Programmer version 4.0
as long as the functions added for unit version 2.0 or unit version 1.1 are not
used.
Device Type SettingThe unit version does not affect the setting made for the device type on the
CX-Programmer. Select the device type as shown in the following table
regardless of the unit version of the CPU Unit.
SeriesCPU Unit groupCPU Unit modelDevice type setting on
CS SeriesCS1-H CPU Units
CS1D CPU Units for Duplex-CPU Systems CS1D-CPU@@HCS1D-H (or CS1H-H)
CS1D CPU Units for Single-CPU Systems
CJ SeriesCJ1-H CPU Units
CJ1M CPU Units
CS1G-CPU@@HCS1G-H
CS1H-CPU@@H CS1H-H
CS1D-CPU@@SCS1D-S
CJ1G-CPU@@HCJ1G-H
CJ1H-CPU@@H CJ1H-H
CJ1M-CPU@@CJ1M
CX-Programmer Ver. 4.0 or higher
xv
Page 16
Troubleshooting Problems with Unit Versions on the CX-Programmer
ProblemCauseSolution
After the above message is displayed, a compiling
error will be displayed on the Compile Tab Page in the
Output Window.
“????” is displayed in a program transferred from the
PLC to the CX-Programmer.
An attempt was made using CXProgrammer version 4.0 or higher
to download a program containing instructions supported only by
CPU Units Ver. 2.0 or later to a
Pre-Ver. 2.0 CPU Units.
An attempt was made using CXProgrammer version 4.0 or higher
to download a PLC Setup containing settings supported only by
CPU Units Ver. 2.0 or later (i.e.,
not set to their default values) to a
Pre-Ver. 2.0 CPU Units.
CX-Programmer version 3.3 or
lower was used to upload a program containing instructions supported only by CPU Units Ver. 2.0
or later from a CPU Unit Ver. 2.0
or later.
Check the program or change
the CPU Unit being downloaded to a CPU Unit Ver. 2.0
or later.
Check the settings in the PLC
Setup or change the CPU Unit
being downloaded to a CPU
Unit Ver. 2.0 or later.
The new instructions cannot
be uploaded using CX-Programmer version 3.3 or lower.
Use CX-Programmer version
This manual describes the programming of the CPU Units for CS/CJ-series Programmable Controllers
(PLCs) and includes the sections described on the following page. The CS Series and CJ Series are
subdivided as shown in the following table.
UnitCS SeriesCJ Series
CPU UnitsCS1-H CPU Units: CS1H-CPU@@H
CS1 CPU Units:CS1H-CPU@@-EV1
CS1D CPU Units:
CS1D CPU Units for Duplex-CPU System:
CS1D-CPU@@H
CS1D CPU Units for Single-CPU System:
CS1D-CPU@@S
CS1D Process CPU Units:
CS1D-CPU@@P
Basic I/O UnitsCS-series Basic I/O UnitsCJ-series Basic I/O Units
Special I/O UnitsCS-series Special I/O UnitsCJ-series Special I/O Units
CPU Bus UnitsCS-series CPU Bus UnitsCJ-series CPU Bus Units
Power Supply UnitsCS-series Power Supply UnitsCJ-series Power Supply Units
Please read this manual and all related manuals listed in the table on the next page and be sure you
understand information provided before attempting to install or use CS/CJ-series CPU Units in a PLC
System.
This manual contains the following sections.
Section 1 describes the basic structure and operation of the CPU Unit.
Section 2 describes basic information required to write, check, and input programs.
Section 3 outlines the instructions that can be used to write user programs.
Section 4 describes the operation of tasks.
Section 5 describes the functions used to manipulate file memory.
Section 6 provides details on advanced functions: Cycle time/high-speed processing, index registers,
serial communications, startup and maintenance, diagnostic and debugging, Programming Devices,
and CJ Basic I/O Unit input response time settings.
Section 7 describes the processes used to transfer the program to the CPU Unit and the functions that
can be used to test and debug the program.
The Appendices provide a comparison of CS/CJ-series, restrictions in using C200H Special I/O Units,
and changes made to Host Link Systems.
CS1G-CPU@@H
CS1G-CPU@@-EV1
CJ1-H CPU Units: CJ1H-CPU@@H
CJ1G-CPU@@H
CJ1G-CPU@@P
CJ1 CPU Units:CJ1G-CPU@@-EV1
CJ1M CPU Units: CJ1M-CPU@@
SYSMAC CS/CJ Series
CQM1H-PRO01-E, C200H-PRO27-E, CQM1-PRO01-E
Programming Consoles Operation Manual
SYSMAC CS/CJ Series
CS1G/H-CPU@@-EV1, CS1G/H-CPU@@H, CS1DCPU@@H, CS1D-CPU@@
CPU@@H, CJ1G-CPU@@P, C J 1 M - CP U @@, CS1WSCB21-V1/41-V1, CS1W-SCU21-V1, CJ1W-SCU21-V1/
41-V1
Communications Commands Reference Manual
SYSMAC WS02-CXP@@-E
CX-Programmer Operation Manual Version 3.@
SYSMAC WS02-CXP@@-E
CX-Programmer Operation Manual Version 4.@
SYSMAC WS02-CXP@@-E
CX-Programmer Operation Manual Version 5.@
SYSMAC WS02-CXP@@-E
CX-Programmer Operation Manual Function Blocks
S, CJ1G-CPU
@@, CJ1G/H-
W394This manual describes programming and other
methods to use the functions of the CS/CJ-series
PLCs. (This manual)
W339Provides an outlines of and describes the design,
installation, maintenance, and other basic operations for the CS-series PLCs.
W393Provides an outlines of and describes the design,
installation, maintenance, and other basic operations for the CJ-series PLCs.
W395Describes the functions of the built-in I/O for
CJ1M CPU Units.
W405Provides an outline of and describes the design,
installation, maintenance, and other basic operations for a Duplex System based on CS1D CPU
Units.
W340Describes the ladder diagram programming
instructions supported by CS/CJ-series PLCs.
W341Provides information on how to program and
operate CS/CJ-series PLCs using a Programming
Console.
W342Describes the C-series (Host Link) and FINS
communications commands used with CS/CJseries PLCs.
W414Provides information on how to use the CX-Pro-
grammer, a programming device that supports the
W425
W437
W438Describes specifications and operation methods
CS/CJ-series PLCs, and the CX-Net contained
within CX-Programmer.
related to function blocks. This information is
required only when using function blocks with the
combination of CX-Programmer Ver. 5.0 and
CS1-H/CJ1-H/CJ1M CPU Unit Ver. 3.0. Refer to
CX-Programmer Operation Manual Version 5.@
(W437) for details on other operations for CX-Pro-
grammer Ver. 5.0.
xx
Page 21
NameCat. No.Contents
SYSMAC CS/CJ Series
CS1W-SCB21-V1/41-V1, CS1W-SCU21-V1, CJ1WSCU21-V1/41-V1
Serial Communications Boards/Units Operation Manual
SYSMAC WS02-PSTC1-E
CX-Protocol Operation Manual
W336Describes the use of Serial Communications Unit
and Boards to perform serial communications
with external devices, including the usage of standard system protocols for OMRON products.
W344Describes the use of the CX-Protocol to create
protocol macros as communications sequences
to communicate with external devices.
!WARNING Failure to read and understand the information provided in this manual may result in per-
sonal injury or death, damage to the product, or product failure. Please read each section
in its entirety and be sure you understand the information provided in the section and
related sections before attempting any of the procedures or operations given.
xxi
Page 22
xxii
Page 23
Read and Understand this Manual
Please read and understand this manual before using the product. Please consult your OMRON
representative if you have any questions or comments.
Warranty and Limitations of Liability
WARRANTY
OMRON's exclusive warranty is that the products are free from defects in materials and workmanship for a
period of one year (or other period if specified) from date of sale by OMRON.
OMRON MAKES NO WARRANTY OR REPRESENTATION, EXPRESS OR IMPLIED, REGARDING NONINFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR PARTICULAR PURPOSE OF THE
PRODUCTS. ANY BUYER OR USER ACKNOWLEDGES THAT THE BUYER OR USER ALONE HAS
DETERMINED THAT THE PRODUCTS WILL SUITABLY MEET THE REQUIREMENTS OF THEIR
INTENDED USE. OMRON DISCLAIMS ALL OTHER WARRANTIES, EXPRESS OR IMPLIED.
LIMITATIONS OF LIABILITY
OMRON SHALL NOT BE RESPONSIBLE FOR SPECIAL, INDIRECT, OR CONSEQUENTIAL DAMAGES,
LOSS OF PROFITS OR COMMERCIAL LOSS IN ANY WAY CONNECTED WITH THE PRODUCTS,
WHETHER SUCH CLAIM IS BASED ON CONTRACT, WARRANTY, NEGLIGENCE, OR STRICT
LIABILITY.
In no event shall the responsibility of OMRON for any act exceed the individual price of the product on which
liability is asserted.
IN NO EVENT SHALL OMRON BE RESPONSIBLE FOR WARRANTY, REPAIR, OR OTHER CLAIMS
REGARDING THE PRODUCTS UNLESS OMRON'S ANALYSIS CONFIRMS THAT THE PRODUCTS
WERE PROPERLY HANDLED, STORED, INSTALLED, AND MAINTAINED AND NOT SUBJECT TO
CONTAMINATION, ABUSE, MISUSE, OR INAPPROPRIATE MODIFICATION OR REPAIR.
xxiii
Page 24
Application Considerations
SUITABILITY FOR USE
OMRON shall not be responsible for conformity with any standards, codes, or regulations that apply to the
combination of products in the customer's application or use of the products.
At the customer's request, OMRON will provide applicable third party certification documents identifying
ratings and limitations of use that apply to the products. This information by itself is not sufficient for a
complete determination of the suitability of the products in combination with the end product, machine,
system, or other application or use.
The following are some examples of applications for which particular attention must be given. This is not
intended to be an exhaustive list of all possible uses of the products, nor is it intended to imply that the uses
listed may be suitable for the products:
• Outdoor use, uses involving potential chemical contamination or electrical interference, or conditions or
uses not described in this manual.
• Nuclear energy control systems, combustion systems, railroad systems, aviation systems, medical
equipment, amusement machines, vehicles, safety equipment, and installations subject to separate
industry or government regulations.
• Systems, machines, and equipment that could present a risk to life or property.
Please know and observe all prohibitions of use applicable to the products.
NEVER USE THE PRODUCTS FOR AN APPLICATION INVOLVING SERIOUS RISK TO LIFE OR
PROPERTY WITHOUT ENSURING THAT THE SYSTEM AS A WHOLE HAS BEEN DESIGNED TO
ADDRESS THE RISKS, AND THAT THE OMRON PRODUCTS ARE PROPERLY RATED AND
INSTALLED FOR THE INTENDED USE WITHIN THE OVERALL EQUIPMENT OR SYSTEM.
PROGRAMMABLE PRODUCTS
OMRON shall not be responsible for the user's programming of a programmable product, or any
consequence thereof.
xxiv
Page 25
Disclaimers
CHANGE IN SPECIFICATIONS
Product specifications and accessories may be changed at any time based on improvements and other
reasons.
It is our practice to change model numbers when published ratings or features are changed, or when
significant construction changes are made. However, some specifications of the products may be changed
without any notice. When in doubt, special model numbers may be assigned to fix or establish key
specifications for your application on your request. Please consult with your OMRON representative at any
time to confirm actual specifications of purchased products.
DIMENSIONS AND WEIGHTS
Dimensions and weights are nominal and are not to be used for manufacturing purposes, even when
tolerances are shown.
PERFORMANCE DATA
Performance data given in this manual is provided as a guide for the user in determining suitability and does
not constitute a warranty. It may represent the result of OMRON's test conditions, and the users must
correlate it to actual application requirements. Actual performance is subject to the OMRON Warranty and
Limitations of Liability.
ERRORS AND OMISSIONS
The information in this manual has been carefully checked and is believed to be accurate; however, no
responsibility is assumed for clerical, typographical, or proofreading errors, or omissions.
xxv
Page 26
xxvi
Page 27
PRECAUTIONS
This section provides general precautions for using the CS/CJ-series Programmable Controllers (PLCs) and related devices.
The information contained in this section is important for the safe and reliable application of Programmable
Controllers. You must read this section and understand the information contained before attempting to set up or
operate a PLC system.
This manual is intended for the following personnel, who must also have
knowledge of electrical systems (an electrical engineer or the equivalent).
• Personnel in charge of installing FA systems.
• Personnel in charge of designing FA systems.
• Personnel in charge of managing FA systems and facilities.
2General Precautions
The user must operate the product according to the performance specifications described in the operation manuals.
Before using the product under conditions which are not described in the
manual or applying the product to nuclear control systems, railroad systems,
aviation systems, vehicles, combustion systems, medical equipment, amusement machines, safety equipment, and other systems, machines, and equipment that may have a serious influence on lives and property if used
improperly, consult your OMRON representative.
Make sure that the ratings and performance characteristics of the product are
sufficient for the systems, machines, and equipment, and be sure to provide
the systems, machines, and equipment with double safety mechanisms.
This manual provides information for programming and operating the Unit. Be
sure to read this manual before attempting to use the Unit and keep this manual close at hand for reference during operation.
!WARNING It is extremely important that a PLC and all PLC Units be used for the speci-
fied purpose and under the specified conditions, especially in applications that
can directly or indirectly affect human life. You must consult with your OMRON
representative before applying a PLC System to the above-mentioned applications.
3Safety Precautions
!WARNING The CPU Unit refreshes I/O even when the program is stopped (i.e., even in
PROGRAM mode). Confirm safety thoroughly in advance before changing the
status of any part of memory allocated to I/O Units, Special I/O Units, or CPU
Bus Units. Any changes to the data allocated to any Unit may result in unexpected operation of the loads connected to the Unit. Any of the following operation may result in changes to memory status.
• Transferring I/O memory data to the CPU Unit from a Programming
Device.
• Changing present values in memory from a Programming Device.
• Force-setting/-resetting bits from a Programming Device.
• Transferring I/O memory files from a Memory Card or EM file memory to
the CPU Unit.
• Transferring I/O memory from a host computer or from another PLC on a
network.
xxviii
!WARNING Do not attempt to take any Unit apart while the power is being supplied. Doing
so may result in electric shock.
Page 29
Safety Precautions3
!WARNING Do not touch any of the terminals or terminal blocks while the power is being
supplied. Doing so may result in electric shock.
!WARNING Do not attempt to disassemble, repair, or modify any Units. Any attempt to do
so may result in malfunction, fire, or electric shock.
!WARNING Provide safety measures in external circuits (i.e., not in the Programmable
Controller), including the following items, to ensure safety in the system if an
abnormality occurs due to malfunction of the PLC or another external factor
affecting the PLC operation. Not doing so may result in serious accidents.
• Emergency stop circuits, interlock circuits, limit circuits, and similar safety
measures must be provided in external control circuits.
• The PLC will turn OFF all outputs when its self-diagnosis function detects
any error or when a severe failure alarm (FALS) instruction is executed.
As a countermeasure for such errors, external safety measures must be
provided to ensure safety in the system.
• The PLC outputs may remain ON or OFF due to deposition or burning of
the output relays or destruction of the output transistors. As a countermeasure for such problems, external safety measures must be provided
to ensure safety in the system.
• When the 24-V DC output (service power supply to the PLC) is overloaded or short-circuited, the voltage may drop and result in the outputs
being turned OFF. As a countermeasure for such problems, external
safety measures must be provided to ensure safety in the system.
!Caution Confirm safety before transferring data files stored in the file memory (Mem-
ory Card or EM file memory) to the I/O area (CIO) of the CPU Unit using a
peripheral tool. Otherwise, the devices connected to the output unit may malfunction regardless of the operation mode of the CPU Unit.
!Caution Fail-safe measures must be taken by the customer to ensure safety in the
event of incorrect, missing, or abnormal signals caused by broken signal lines,
momentary power interruptions, or other causes. Abnormal operation may
result in serious accidents.
!Caution The CS1-H, CJ1-H, CJ1M, and CS1D CPU Units automatically back up the
user program and parameter data to flash memory when these are written to
the CPU Unit. I/O memory (including the DM, EM, and HR Areas), however, is
not written to flash memory. The DM, EM, and HR Areas can be held during
power interruptions with a battery. If there is a battery error, the contents of
these areas may not be accurate after a power interruption. If the contents of
the DM, EM, and HR Areas are used to control external outputs, prevent inappropriate outputs from being made whenever the Battery Error Flag (A40204)
is ON.
!Caution Execute online edit only after confirming that no adverse effects will be
caused by extending the cycle time. Otherwise, the input signals may not be
readable.
!Caution Confirm safety at the destination node before transferring a program to
another node or changing contents of the I/O memory area. Doing either of
these without confirming safety may result in injury.
xxix
Page 30
Operating Environment Precautions4
!Caution Tighten the screws on the terminal block of the AC Power Supply Unit to the
torque specified in the operation manual. The loose screws may result in
burning or malfunction.
!Caution Do not touch the Power Supply Unit when power is being supplied or immedi-
ately after the power supply is turned OFF. The Power Supply Unit will be hot
and you may be burned.
!Caution Be careful when connecting personal computers or other peripheral devices
to a PLC to which is mounted a non-insulated Unit (CS1W-CLK12/52(-V1) or
CS1W-ETN01) connected to an external power supply. A short-circuit will be
created if the 24 V side of the external power supply is grounded and the 0 V
side of the peripheral device is grounded. When connecting a peripheral
device to this type of PLC, either ground the 0 V side of the external power
supply or do not ground the external power supply at all.
4Operating Environment Precautions
!Caution Do not operate the control system in the following locations:
• Locations subject to direct sunlight.
• Locations subject to temperatures or humidity outside the range specified
in the specifications.
• Locations subject to condensation as the result of severe changes in temperature.
• Locations subject to corrosive or flammable gases.
• Locations subject to dust (especially iron dust) or salts.
• Locations subject to exposure to water, oil, or chemicals.
• Locations subject to shock or vibration.
!Caution Take appropriate and sufficient countermeasures when installing systems in
the following locations:
• Locations subject to static electricity or other forms of noise.
• Locations subject to strong electromagnetic fields.
• Locations subject to possible exposure to radioactivity.
• Locations close to power supplies.
!Caution The operating environment of the PLC System can have a large effect on the
longevity and reliability of the system. Improper operating environments can
lead to malfunction, failure, and other unforeseeable problems with the PLC
System. Be sure that the operating environment is within the specified conditions at installation and remains within the specified conditions during the life
of the system.
5Application Precautions
Observe the following precautions when using the PLC System.
• You must use the CX-Programmer (programming software that runs on
Windows) if you need to program more than one task. A Programming
Console can be used to program only one cyclic task plus interrupt tasks.
xxx
Page 31
Application Precautions5
A Programming Console can, however, be used to edit multitask programs originally created with the CX-Programmer.
!WARNING Always heed these precautions. Failure to abide by the following precautions
could lead to serious or possibly fatal injury.
• Always connect to a ground of 100
connecting to a ground of 100
• A ground of 100
terminals on the Power Supply Unit.
• Always turn OFF the power supply to the PLC before attempting any of
the following. Not turning OFF the power supply may result in malfunction
or electric shock.
• Mounting or dismounting Power Supply Units, I/O Units, CPU Units, Inner Boards, or any other Units.
• Assembling the Units.
• Setting DIP switches or rotary switches.
• Connecting cables or wiring the system.
• Connecting or disconnecting the connectors.
!Caution Failure to abide by the following precautions could lead to faulty operation of
the PLC or the system, or could damage the PLC or PLC Units. Always heed
these precautions.
• The user program and parameter area data in the CS1-H, CS1D, CJ1-H,
and CJ1M CPU Units are backed up in the built-in flash memory. The
BKUP indicator will light on the front of the CPU Unit when the backup
operation is in progress. Do not turn OFF the power supply to the CPU
Unit when the BKUP indicator is lit. The data will not be backed up if
power is turned OFF.
• When using a CS-series CS1 CPU Unit for the first time, install the
CS1W-BAT1 Battery provided with the Unit and clear all memory areas
from a Programming Device before starting to program. When using the
internal clock, turn ON power after installing the battery and set the clock
from a Programming Device or using the DATE(735) instruction. The clock
will not start until the time has been set.
• When the CPU Unit is shipped from the factory, the PLC Setup is set so
that the CPU Unit will start in the operating mode set on the Programming
Console mode switch. When a Programming Console is not connected, a
CS-series CS1 CPU Unit will start in PROGRAM mode, but a CS1-H,
CS1D, CJ1, CJ1-H, or CJ1M CPU Unit will start in RUN mode and operation will begin immediately. Do not advertently or inadvertently allow operation to start without confirming that it is safe.
• When creating an AUTOEXEC.IOM file from a Programming Device (a
Programming Console or the CX-Programmer) to automatically transfer
data at startup, set the first write address to D20000 and be sure that the
size of data written does not exceed the size of the DM Area. When the
data file is read from the Memory Card at startup, data will be written in
the CPU Unit starting at D20000 even if another address was set when
the AUTOEXEC.IOM file was created. Also, if the DM Area is exceeded
(which is possible when the CX-Programmer is used), the remaining data
will be written to the EM Area.
Ω or less must be installed when shorting the GR and LG
Ω or less when installing the Units. Not
Ω or less may result in electric shock.
xxxi
Page 32
Application Precautions5
• Always turn ON power to the PLC before turning ON power to the control
system. If the PLC power supply is turned ON after the control power supply, temporary errors may result in control system signals because the
output terminals on DC Output Units and other Units will momentarily turn
ON when power is turned ON to the PLC.
• Fail-safe measures must be taken by the customer to ensure safety in the
event that outputs from Output Units remain ON as a result of internal circuit failures, which can occur in relays, transistors, and other elements.
• Fail-safe measures must be taken by the customer to ensure safety in the
event of incorrect, missing, or abnormal signals caused by broken signal
lines, momentary power interruptions, or other causes.
• Interlock circuits, limit circuits, and similar safety measures in external circuits (i.e., not in the Programmable Controller) must be provided by the
customer.
• Do not turn OFF the power supply to the PLC when data is being transferred. In particular, do not turn OFF the power supply when reading or
writing a Memory Card. Also, do not remove the Memory Card when the
BUSY indicator is lit. To remove a Memory Card, first press the memory
card power supply switch and then wait for the BUSY indicator to go out
before removing the Memory Card.
• If the I/O Hold Bit is turned ON, the outputs from the PLC will not be
turned OFF and will maintain their previous status when the PLC is
switched from RUN or MONITOR mode to PROGRAM mode. Make sure
that the external loads will not produce dangerous conditions when this
occurs. (When operation stops for a fatal error, including those produced
with the FALS(007) instruction, all outputs from Output Unit will be turned
OFF and only the internal output status will be maintained.)
• The contents of the DM, EM, and HR Areas in the CPU Unit are backed
up by a Battery. If the Battery voltage drops, this data may be lost. Provide
countermeasures in the program using the Battery Error Flag (A40204) to
re-initialize data or take other actions if the Battery voltage drops.
• When supplying power at 200 to 240 V AC with a CS-series PLC, always
remove the metal jumper from the voltage selector terminals on the Power
Supply Unit (except for Power Supply Units with wide-range specifications). The product will be destroyed if 200 to 240 V AC is supplied while
the metal jumper is attached.
• Always use the power supply voltages specified in the operation manuals.
An incorrect voltage may result in malfunction or burning.
• Take appropriate measures to ensure that the specified power with the
rated voltage and frequency is supplied. Be particularly careful in places
where the power supply is unstable. An incorrect power supply may result
in malfunction.
• Install external breakers and take other safety measures against short-circuiting in external wiring. Insufficient safety measures against short-circuiting may result in burning.
• Do not apply voltages to the Input Units in excess of the rated input voltage. Excess voltages may result in burning.
• Do not apply voltages or connect loads to the Output Units in excess of
the maximum switching capacity. Excess voltage or loads may result in
burning.
xxxii
Page 33
Application Precautions5
• Separate the line ground terminal (LG) from the functional ground terminal (GR) on the Power Supply Unit before performing withstand voltage
tests or insulation resistance tests. Not doing so may result in burning.
• Install the Units properly as specified in the operation manuals. Improper
installation of the Units may result in malfunction.
• With CS-series PLCs, be sure that all the Unit and Backplane mounting
screws are tightened to the torque specified in the relevant manuals.
Incorrect tightening torque may result in malfunction.
• Be sure that all terminal screws, and cable connector screws are tightened to the torque specified in the relevant manuals. Incorrect tightening
torque may result in malfunction.
• Leave the label attached to the Unit when wiring. Removing the label may
result in malfunction if foreign matter enters the Unit.
• Remove the label after the completion of wiring to ensure proper heat dissipation. Leaving the label attached may result in malfunction.
• Use crimp terminals for wiring. Do not connect bare stranded wires
directly to terminals. Connection of bare stranded wires may result in
burning.
• Wire all connections correctly.
• Double-check all wiring and switch settings before turning ON the power
supply. Incorrect wiring may result in burning.
• Mount Units only after checking terminal blocks and connectors completely.
• Be sure that the terminal blocks, Memory Units, expansion cables, and
other items with locking devices are properly locked into place. Improper
locking may result in malfunction.
• Check switch settings, the contents of the DM Area, and other preparations before starting operation. Starting operation without the proper settings or data may result in an unexpected operation.
• Check the user program for proper execution before actually running it on
the Unit. Not checking the program may result in an unexpected operation.
• Confirm that no adverse effect will occur in the system before attempting
any of the following. Not doing so may result in an unexpected operation.
• Changing the operating mode of the PLC (including the setting of the
startup operating mode).
• Force-setting/force-resetting any bit in memory.
• Changing the present value of any word or any set value in memory.
• Do not pull on the cables or bend the cables beyond their natural limit.
Doing either of these may break the cables.
• Do not place objects on top of the cables or other wiring lines. Doing so
may break the cables.
• Do not use commercially available RS-232C personal computer cables.
Always use the special cables listed in this manual or make cables
according to manual specifications. Using commercially available cables
may damage the external devices or CPU Unit.
• Never connect pin 6 (5-V power supply) on the RS-232C port on the CPU
Unit to any device other than an NT-AL001 or CJ1W-CIF11 Adapter.The
external device or the CPU Unit may be damaged.
xxxiii
Page 34
Conformance to EC Directives6
• When replacing parts, be sure to confirm that the rating of a new part is
correct. Not doing so may result in malfunction or burning.
• Before touching a Unit, be sure to first touch a grounded metallic object in
order to discharge any static build-up. Not doing so may result in malfunction or damage.
• When transporting or storing circuit boards, cover them in antistatic material to protect them from static electricity and maintain the proper storage
temperature.
• Do not touch circuit boards or the components mounted to them with your
bare hands. There are sharp leads and other parts on the boards that
may cause injury if handled improperly.
• Do not short the battery terminals or charge, disassemble, heat, or incinerate the battery. Do not subject the battery to strong shocks. Doing any
of these may result in leakage, rupture, heat generation, or ignition of the
battery. Dispose of any battery that has been dropped on the floor or otherwise subjected to excessive shock. Batteries that have been subjected
to shock may leak if they are used.
• UL standards required that batteries be replaced only by experienced
technicians. Do not allow unqualified persons to replace batteries.
• With a CJ-series PLC, the sliders on the tops and bottoms of the Power
Supply Unit, CPU Unit, I/O Units, Special I/O Units, and CPU Bus Units
must be completely locked (until they click into place). The Unit may not
operate properly if the sliders are not locked in place.
• With a CJ-series PLC, always connect the End Plate to the Unit on the
right end of the PLC. The PLC will not operate properly without the End
Plate
• Unexpected operation may result if inappropriate data link tables or
parameters are set. Even if appropriate data link tables and parameters
have been set, confirm that the controlled system will not be adversely
affected before starting or stopping data links.
• CPU Bus Units will be restarted when routing tables are transferred from
a Programming Device to the CPU Unit. Restarting these Units is
required to read and enable the new routing tables. Confirm that the system will not be adversely affected before allowing the CPU Bus Units to
be reset.
6Conformance to EC Directives
6-1Applicable Directives
•EMC Directives
• Low Voltage Directive
6-2Concepts
EMC Directives
OMRON devices that comply with EC Directives also conform to the related
EMC standards so that they can be more easily built into other devices or the
overall machine. The actual products have been checked for conformity to
EMC standards (see the following note). Whether the products conform to the
standards in the system used by the customer, however, must be checked by
the customer.
EMC-related performance of the OMRON devices that comply with EC Directives will vary depending on the configuration, wiring, and other conditions of
xxxiv
Page 35
Conformance to EC Directives6
the equipment or control panel on which the OMRON devices are installed.
The customer must, therefore, perform the final check to confirm that devices
and the overall machine conform to EMC standards.
Note Applicable EMC (Electromagnetic Compatibility) standards are as follows:
EMS (Electromagnetic Susceptibility):
CS Series: EN61131-2 and EN61000-6-2
CJ Series: EN61000-6-2
EMI (Electromagnetic Interference):
EN61000-6-4
(Radiated emission: 10-m regulations)
Low Voltage Directive
Always ensure that devices operating at voltages of 50 to 1,000 V AC and 75
to 1,500 V DC meet the required safety standards for the PLC (EN61131-2).
6-3Conformance to EC Directives
The CS/CJ-series PLCs comply with EC Directives. To ensure that the
machine or device in which the CS/CJ-series PLC is used complies with EC
Directives, the PLC must be installed as follows:
1,2,3...1. The CS/CJ-series PLC must be installed within a control panel.
2. You must use reinforced insulation or double insulation for the DC power
supplies connected to DC Power Supply Units and I/O Units.
3. CS/CJ-series PLCs complying with EC Directives also conform to the
Common Emission Standard (EN61000-6-4). Radiated emission characteristics (10-m regulations) may vary depending on the configuration of the
control panel used, other devices connected to the control panel, wiring,
and other conditions. You must therefore confirm that the overall machine
or equipment complies with EC Directives.
6-4Relay Output Noise Reduction Methods
The CS/CJ-series PLCs conforms to the Common Emission Standards
(EN61000-6-4) of the EMC Directives. However, noise generated by relay output switching may not satisfy these Standards. In such a case, a noise filter
must be connected to the load side or other appropriate countermeasures
must be provided external to the PLC.
Countermeasures taken to satisfy the standards vary depending on the
devices on the load side, wiring, configuration of machines, etc. Following are
examples of countermeasures for reducing the generated noise.
Countermeasures
(Refer to EN61000-6-4 for more details.)
Countermeasures are not required if the frequency of load switching for the
whole system with the PLC included is less than 5 times per minute.
Countermeasures are required if the frequency of load switching for the whole
system with the PLC included is more than 5 times per minute.
xxxv
Page 36
Conformance to EC Directives6
Countermeasure Examples
When switching an inductive load, connect an surge protector, diodes, etc., in
parallel with the load or contact as shown below.
CircuitCurrentCharacteristicRequired element
ACDC
CR method
C
Power
supply
R
Diode method
Power
supply
Varistor method
Power
supply
YesYesIf the load is a relay or solenoid, there is
a time lag between the moment the circuit is opened and the moment the load
is reset.
If the supply voltage is 24 or 48 V, insert
Inductive
load
the surge protector in parallel with the
load. If the supply voltage is 100 to
200 V, insert the surge protector
between the contacts.
NoYesThe diode connected in parallel with
the load changes energy accumulated
by the coil into a current, which then
flows into the coil so that the current will
be converted into Joule heat by the
Inductive
load
resistance of the inductive load.
This time lag, between the moment the
circuit is opened and the moment the
load is reset, caused by this method is
longer than that caused by the CR
method.
YesYesThe varistor method prevents the impo-
sition of high voltage between the contacts by using the constant voltage
characteristic of the varistor. There is
time lag between the moment the cir-
Inductive
load
cuit is opened and the moment the load
is reset.
If the supply voltage is 24 or 48 V, insert
the varistor in parallel with the load. If
the supply voltage is 100 to 200 V,
insert the varistor between the contacts.
The capacitance of the capacitor must
be 1 to 0.5 μF per contact current of
1 A and resistance of the resistor must
be 0.5 to 1 Ω per contact voltage of 1 V.
These values, however, vary with the
load and the characteristics of the
relay. Decide these values from experiments, and take into consideration that
the capacitance suppresses spark discharge when the contacts are separated and the resistance limits the
current that flows into the load when
the circuit is closed again.
The dielectric strength of the capacitor
must be 200 to 300 V. If the circuit is an
AC circuit, use a capacitor with no
polarity.
The reversed dielectric strength value
of the diode must be at least 10 times
as large as the circuit voltage value.
The forward current of the diode must
be the same as or larger than the load
current.
The reversed dielectric strength value
of the diode may be two to three times
larger than the supply voltage if the
surge protector is applied to electronic
circuits with low circuit voltages.
---
xxxvi
When switching a load with a high inrush current such as an incandescent
lamp, suppress the inrush current as shown below.
Countermeasure 1Countermeasure 2
OUT
R
COM
Providing a dark current of
approx. one-third of the rated
value through an
incandescent lamp
OUT
COM
Providing a limiting resistor
R
Page 37
CPU Unit Operation
This section describes the basic structure and operation of the CPU Unit.
Battery InstallationBefore using a CS1CPU Unit, you must install the Battery Set in the CPU Unit
using the following procedure.
1,2,3...1. Insert a flat-blade screwdriver in the small gap at the bottom of the battery
compartment and flip the cover upward to open it.
2
Page 39
Initial Setup (CS1 CPU Units Only)Section 1-1
2. Hold the Battery Set with the cable facing outward and insert it into the battery compartment.
Battery compartment
3. Connect the battery connector to the battery connector terminals. Connect
the red wire to the top and the white wire to the bottom terminal. There are
two sets of battery connector terminals; connect the battery to either one.
It does not matter whether the top terminals or bottom terminals are used.
Red
Battery connector terminals
(Connect to either set of terminals.)
White
3
Page 40
Initial Setup (CS1 CPU Units Only)Section 1-1
4. Fold in the cable and close the cover.
Clearing MemoryAfter installing the battery, clear memory using the memory clear operation to
initialize the RAM inside the CPU Unit.
Programming Console
Use the following procedure from a Programming Console.
Initial display
NOT
SETRESET
MON
(or
0
0
1
MON
)
Note You cannot specify more than one cyclic task when clearing memory from a
Programming Console. You can specify one cyclic task and one interrupt task,
or one cyclic task and no interrupt task. Refer to the Operation Manual for
more information on the memory clear operation. Refer to
Unit Operation
and SECTION 4 Tasks for more information on tasks.
SECTION 1 CPU
CX-Programmer
Memory can also be cleared from the CX-Programmer. Refer to the CX-Programmer Operation Manual for the actual procedure.
Clearing ErrorsAfter clearing memory, clear any errors from the CPU Unit, including the low
battery voltage error.
Programming Console
Use the following procedure from a Programming Console.
Initial display
MONFUNMON
(Displayed error will be cleared.)
MON
(Returns to the initial display.)
CX-Programmer
Errors can also be cleared from the CX-Programmer. Refer to the CX-Programmer Operation Manual for the actual procedure.
Note When an Inner Board is mounted, an Inner Board routing table error may con-
tinue even after you have cancelled the error using the CX-Programmer.
(A42407 will be ON for a Serial Communications Board.) If this occurs, either
reset the power or restart the Inner Board, then cancel the error again.
4
Page 41
Using the Internal Clock (CS1 CPU Units Only)Section 1-2
1-2Using the Internal Clock (CS1 CPU Units Only)
The internal clock of the CPU Unit is set to “00 year, 01 month, 01 day (00-01-
01), 00 hours, 00 minutes, 00 seconds (00:00:00), and Sunday (SUN)” when
the Battery Set is mounted in the CS-series CPU Unit.
When using the internal clock, turn ON the power supply after mounting the
Battery Set and 1) use a Programming Device (Programming Console or CXProgrammer) to set the clock time, 2) execute the CLOCK ADJUSTMENT
(DATE) instruction, or 3) send a FINS command to start the internal clock from
the correct current time and date.
The Programming Console operation used to set the internal clock is shown
below.
Key Sequence
Initial display
FUN
SHIFT
MON
0
CHG
↑
Data
WRITE
↓
Specify: Yr Mo Day Hr Min S
5
Page 42
Internal Structure of the CPU UnitSection 1-3
1-3Internal Structure of the CPU Unit
1-3-1Overview
The following diagram shows the internal structure of the CPU Unit.
CPU Unit
User program
Automatic
backup
Flash
memory
(CS1-H, CS1D, CJ1-H,
or CJ1M CPU Units only)
EM file memory
Automatic
backup
I/O memory
PLC Setup
and other
parameters
Access
Task 1
Task 2
Task n
Memory Card
DIP switch
The programm is divided
into tasks and the tasks
are executed in order by
task number.
I/O memory, PC Setup,
programs and the EM area
can be saved as files.
The User ProgramThe user program is created from up to 288 program tasks, including interrupt
tasks. The tasks are transferred to the CPU Unit from the CX-Programmer
programming software.
There are two types of tasks. The first is a cyclic task that is executed once
per cycle (maximum of 32) and the other is an interrupt task that is executed
only when the interrupt conditions occur (maximum of 256). Cyclic tasks are
executed in numerical order.
Note1. With a CS1-H, CJ1-H, CJ1M, or CS1D CPU Unit, interrupt tasks can be
executed cyclically in the same way as cyclic tasks. These are called “extra
cyclic tasks.” The total number of tasks that can be executed cyclically
must be 288 or less.
2. When using the CX-Programmer, use version 2.1 or higher for a CS1-H or
CJ1-H CPU Unit and version 3.0 or higher for a CJ1M CPU Unit (except for
low-end models), or CS1D CPU Units for Duplex-CPU Systems. When using a low-end CJ1M CPU Unit (CJ1M-CPU11/CPU21), use CX-Programmer version 3.3 or higher. When using a CS1-H, CJ1-H, CJ1M, or CS1D
CPU Unit Ver. 2.0 or later, use CX-Programmer version 4.0 or higher.
Program instructions read and write to I/O memory and are executed in order
starting at the top of the program. After all cyclic tasks are executed, the I/O
for all Units are refreshed, and the cycle repeats again starting at the lowest
cyclic task number.
Refer to the section on CPU Unit operation in the CS/CJ Series OperationManual for details on refreshing I/O.
6
Page 43
Internal Structure of the CPU UnitSection 1-3
I/O MemoryI/O memory is the RAM area used for reading and writing from the user pro-
gram. It is comprised of one area that is cleared when power is turned ON and
OFF, and another area that will retain data.
I/O memory is also partitioned into an area that exchanges data with all Units
and an area strictly for internal use. Data is exchanged with all Units once per
program execution cycle and also when specific instructions are executed.
PLC SetupThe PLC Setup is used to set various initial or other settings through software
switches.
DIP SwitchesDIP switches are used to set initial or other settings through hardware
switches.
Memory CardsMemory Cards are used as needed to store data such as programs, I/O mem-
ory data, the PLC Setup, and I/O comments created by Programming
Devices. Programs and various system settings can be written automatically
from the Memory Card when power is turned ON (automatic transfer at startup).
Flash Memory (CS1-H,
CJ1-H, CJ1M, or CS1D
CPU Unit Only)
With a CS1-H, CJ1-H, CJ1M, or CS1D CPU Unit, the user program and
parameter area data, such as the PLC Setup, are automatically backed up in
the built-in flash memory whenever the user writes data to the CPU Unit. This
enables battery-free operation without using a Memory Card. I/O memory,
including most of the DM Area, are not backed up without a battery.
1-3-2Block Diagram of CPU Unit Memory
CPU Unit memory (RAM) is comprised of the following blocks in the CS/CJ
Series:
• Parameter area (PLC Setup, registered I/O table, routing table, and CPU
Bus Unit settings)
• I/O memory areas
• The user program
Data in the parameter area and I/O memory areas is backed up by a Battery
(CS Series: CS1W-BAT01, CJ1-H: CPM2A-BAT01), and will be lost if battery
power is low.
The CS1-H, CJ1-H, CJ1M, or CS1D CPU Units, however, provide a built-in
flash memory for data backup. The user program and parameter area data
are automatically backed up in the built-in flash memory whenever the user
writes data to the CPU Unit from a Programming Device (e.g., CX-Programmer or Programming Console), including the following operations: Data transfers, online editing, transfers from Memory Cards, etc. This means that the
user program and parameter area data will not be lost even if the battery voltage drops.
7
Page 44
Internal Structure of the CPU UnitSection 1-3
CPU Unit
Built-in RAM
I/O memory area
Flash Memory
(CS1-H, CJ1-H, CJ1M, or
CS1D CPU Units only)
User program
Parameter area
Comment memory
area
FB program memory
area
Drive 1: EM file memory
(See note 2.)
Automatic
write
Automatic
write
User program
Parameter area
(See note 1.)
Backup
A newly mounted battery will be good up to
five years at an ambient temperature of 25°C
Drive 0: Memory Card
(flash memory)
File memory
Automatically backed up to flash memory whenever a write
operation for the user memory area (user program or parameter
area) is performed from a Programming Device.
Used to store symbol table files, comment files, and program
index files. CPU Units with unit version 3.0 or later, Memory
Card, EM file memory, or comment memory can be selected as
the destination when transferring projects from CX-Programmer
Ver. 5.0.
When transferring projects containing function blocks from the
CX-Programmer for CPU Units with unit version 3.0 or later,
the function block program information is automatically stored
in the FB program memory area.
Battery
Note1. The parameter area and user program (i.e., the user memory) can be
write-protected by turning ON pin 1 of the DIP switch on the front of the
CPU Unit.
2. EM file memory is part of the EM Area that has been converted to file
memory in the PLC Setup. All EM banks from the specified bank to the end
of the EM Area can be used only as file memory for storage of data and
program files.
3. Be sure to install the battery provided (CS1W-BAT01) before using a CS1
CPU Unit for the first time. After installing the battery, use a Programming
Device to clear the PLC’s RAM (parameter area, I/O memory area, and
user program).
4. A Battery is mounted to a CS1-H, CJ1, CJ1-H, CJ1M, or CS1D CPU Unit
when it is shipped from the factory. There is no need to clear memory or
set the time.
5. The BKUP indicator on the front of the CPU Unit will light while data is being written to flash memory. Do not turn OFF the power supply to the CPU
Unit until the backup operation has been completed (i.e., until the BKUP
indicator goes out). Refer to
6-6-11 Flash Memory for details.
8
Page 45
Operating ModesSection 1-4
1-4Operating Modes
1-4-1Description of Operating Modes
The following operating modes are available in the CPU Unit. These modes
control the entire user program and are common to all tasks.
PROGRAM ModeProgram execution stops in PROGRAM mode, and the RUN indicator is not lit.
This mode is used when editing the program or making other preparations
operation, such as the following:
• Registering the I/O table.
• Changing PLC Setup and other settings.
• Transferring and checking programs.
• Force-setting and resetting bits to check wiring and bit allocation.
In this mode, all cyclic and interrupt tasks are non-executing (INI), that is they
stop. See
I/O refreshing is performed in PROGRAM mode. Refer to the Operation Man-ual for information on refreshing I/O.
!WARNING The CPU Unit refreshes I/O even when the program is stopped (i.e., even in
PROGRAM mode). Confirm safety thoroughly in advance before changing the
status of any part of memory allocated to I/O Units, Special I/O Units, or CPU
Bus Units. Any changes to the data allocated to any Unit may result in unexpected operation of the loads connected to the Unit. Any of the following operation may result in changes to memory status.
1-6 Description of Tasks for more details on tasks.
• Transferring I/O memory data to the CPU Unit from a Programming
Device.
• Changing present values in memory from a Programming Device.
• Force-setting/-resetting bits from a Programming Device.
• Transferring I/O memory files from a Memory Card or EM file memory to
the CPU Unit.
• Transferring I/O memory from a host computer or from another PLC on a
network.
MONITOR ModeThe following operations can be performed through Programming Devices
while the program is executing in MONITOR mode. The RUN indicator will be
lit. This mode is used to make test runs or other adjustments.
• Online Editing.
• Force-setting and force-resetting bits.
• Changing values in I/O memory.
In this mode, the cyclic tasks specified for execution at startup (see note) and
those are made executable by TKON(820) will be executed when program
execution reaches their task number. Interrupt tasks will be executed if their
interrupt conditions occur.
Note The tasks that are executed at startup are specified in the program properties
from the CX-Programmer.
RUN ModeThis mode is used for normal program execution. The RUN indicator will be lit.
Some Programming Device operations like online editing, force-set/forcereset, and changing I/O memory values are disabled in this mode, but other
9
Page 46
Operating ModesSection 1-4
Programming Device operations like monitoring the status of program execution (monitoring programs and monitoring I/O memory) are enabled.
Use this mode for normal system operation. Task execution is the same as in
MONITOR mode.
See 10-2 CPU Unit Operating Modes in the Operation Manual for more details
on operations that are available in each operating mode.
1-4-2Initialization of I/O Memory
The following table shows which data areas will be cleared when the operating mode is changed from PROGRAM mode to RUN/MONITOR mode or viceversa.
Mode changeNon-held Areas
(Note 1)
RUN/MONITOR → PROGRAMClear (Note 3)Retained
PROGRAM → RUN/MONITORClear (Note 3)Retained
RUN ↔ MONITORRetainedRetained
Flags, Index Registers, Data Registers, Task Flags, and Condition Flags.
(The statuses of some addresses in the Auxiliary Area are held and others
are cleared.)
2. Held areas: Holding Area, DM Area, EM Area, Counter PVs, and Counter
Completion Flags.
3. Data in I/O memory will be retained when the IOM Hold Bit (A50012) is ON.
When the IOM Hold Bit (A50012) is ON and operation is stopped due to a
fatal error (including FALS(007)), the contents of I/O memory will be retained but outputs on Output Units will all be turned OFF.
Held Areas
(Note 2)
10
Page 47
Operating ModesSection 1-4
1-4-3Startup Mode
Refer to the Operation Manual for details on the Startup Mode setting for the
CPU Unit.
Note With CJ1, CS1-H, CJ1-H, CJ1M, or CS1D CPU Units, the CPU Unit will start
in RUN Mode if a Programming Console is not connected. This differs from
the default operation for a CS1 CPU Unit, which will start in PROGRAM Mode
by default if a Programming Console is not connected.
ConditionsCS1 CPU UnitCJ1, CS1-H, CJ1-H,
PLC Setup is set to start according to
the mode set on the Programming Console, but a Programming Console is not
connected.
Power turned ON.
PLC Setup set
for mode on
Programming
Console?
Ye s
Programming
Console
connected?
No
No
Ye s
CJ1M, or CS1D
CPU Unit
PROGRAM modeRUN mode
The CPU Unit will start in
the mode set in the PLC
Setup.
The CPU Unit will start in
the mode set on the
Programming Console.
CJ1, CS1-H, CJ1-H, or CJ1M
CPU Unit: CPU Unit starts in
RUN mode.
CS1 CPU Unit: CPU Unit
starts in PROGRAM mode.
11
Page 48
Programs and TasksSection 1-5
1-5Programs and Tasks
Tasks specify the sequence and interrupt conditions under which individual
programs will be executed. They are broadly grouped into the following types:
1,2,3...1. Tasks executed sequentially that are called cyclic tasks.
2. Tasks executed by interrupt conditions that are called interrupt tasks.
Note With the CS1-H, CJ1-H, CJ1M, or CS1D CPU Units, interrupt tasks can be
executed cyclically in the same way as cyclic tasks. These are called “extra
cyclic tasks.”
Programs allocated to cyclic tasks will be executed sequentially by task number and I/O will be refreshed once per cycle after all tasks (more precisely
tasks that are in executable status) are executed. If an interrupt condition
goes into effect during processing of the cyclic tasks, the cyclic task will be
interrupted and the program allocated to the interrupt task will be executed.
Refer to the section on CPU Unit operation in the CS/CJ Series OperationManual for information in refreshing I/O.
Program A
Cyclic
task 0
Cyclic
task 1
Cyclic
task n
I/O refreshing
Interrupt condition
goes into effect
Allocation
Allocation
Allocation
Interrupt
task 100
Program B
Allocation
Program C
Program D
In the above example, programming would be executed in the following order:
start of A, B, remainder of A, C, and then D. This assumes that the interrupt
condition for interrupt task 100 was established during execution of program
A. When execution of program B is completed, the rest of program A would be
executed from the place where execution was interrupted.
With earlier OMRON PLCs, one continuous program is formed from several
continuous parts. The programs allocated to each task are single programs
that terminate with an END instruction, just like the single program in earlier
PLCs.
12
Page 49
Programs and TasksSection 1-5
One feature of the cyclic tasks is that they can be enabled (executable status)
and disabled (standby status) by the task control instructions. This means that
several program components can be assembled as a task, and that only specific programs (tasks) can then be executed as needed for the current product
model or process being performed (program step switching). Therefore performance (cycle time) is greatly improved because only required programs will
be executed as needed.
Earlier system
One continuous
subprogram
I/O refreshing
CS/CJ Series
Task 1
Allocation
Task 2
Task 3
I/O refreshing
Tasks can be put into nonexecuting (standby) status.
A task that has been executed will be executed in subsequent cycles, and a
task that is on standby will remain on standby in subsequent cycles unless it is
executed again from another task.
Note Unlike earlier programs that can be compared to reading a scroll, tasks can
be compared to reading through a series of individual cards.
• All cards are read in a preset sequence starting from the lowest number.
• All cards are designated as either active or inactive, and cards that are
inactive will be skipped. (Cards are activated or deactivated by task control instructions.)
13
Page 50
Description of TasksSection 1-6
• A card that is activated will remain activated and will be read in subsequent sequences. A card that is deactivated will remain deactivated and
will be skipped until it is reactivated by another card.
Earlier program:
Like a scroll
CS/CJ-series program:
Like a series of cards that can be activated
or deactivated by other cards.
ActivatedDeactivated
1-6Description of Tasks
Tasks are broadly grouped into the following types:
1,2,3...1. Cyclic tasks (32 max.)
Tasks that will be executed once per cycle if executable. Execution can
also be disabled for cyclic tasks if required.
2. Interrupt tasks
Tasks that are executed when the interrupt occurs whether or not a cyclic
task is being executed. Interrupt tasks (see notes 1 and 2) are grouped into
the following four types (five types including the extra cyclic tasks for CS1H, CJ1-H, CJ1M, or CS1D CPU Units):
a) Power OFF interrupt task (Not supported by CS1D CPU Units for Du-
plex-CPU Systems):
Executed when power is interrupted. (1 max.)
b) Scheduled interrupt task (Not supported by CS1D CPU Units for Du-
plex-CPU Systems):
Executed at specified intervals. (2 max.).
c) I/O interrupt task (Not supported by CJ1 or CS1D CPU Units for Du-
plex-CPU Systems):
Executed when an Interrupt Input Unit input turns ON (32 max.).
d) External interrupt task (Not supported by CJ1 or CS1D CPU Units for
Duplex-CPU Systems):
Executed (256 max.) when requested by an Special I/O Unit, CPU
Bus Unit, or Inner Board (CS Series only).
e) Extra cyclic tasks (Supported only by CS1-H, CJ1-H, CJ1M, and
CS1D CPU Units):
Interrupt tasks that are treated as cyclic tasks. Extra cyclic tasks
are executed once every cycle as long as they are in an executable
condition.
A total of 288 tasks with 288 programs can be created and controlled with the
CX-Programmer. These include up to 32 cyclic tasks and 256 interrupt tasks.
14
Page 51
Description of TasksSection 1-6
n
Note1. CJ1 CPU Units do not currently support I/O interrupt tasks and external in-
terrupt tasks. The maximum number of tasks for a CJ1 CPU Unit is thus
35, i.e., 32 cyclic tasks and 3 interrupt tasks. The total number of programs
that can be created and managed is also 35.
2. The CS1D CPU Units do not support any interrupt tasks. Interrupt tasks,
however, can be used as extra cyclic tasks with CS1D CPU Units.
Each program is allocated 1:1 to a task through individual program property
settings set with the CX-Programmer.
Cyclic task 0
Interrupt task 5
Executed in order starting
from the lowest number.
Cyclic task 1
Interrupt occurs
Cyclic task 2
Note Condition Flags (ER, >, =, etc.) and instruction co
(interlock ON, etc.) are cleared at the beginning of
task.
I/O refreshing
Peripheral processing
Program StructureStandard subroutine programs can be created and allocated to tasks as
needed to create programs. This means that programs can be created in
modules (standard components) and that tasks can be debugged individually.
15
Page 52
Description of TasksSection 1-6
p
Standard subroutine programs
User program ABCUser program ABD
Task 1 (A)
Task 1 (A)
Executable and Standby
Status
Program
Task 0 (control task)
Task 1
Task 2
Task 3
Task 2 (B)
Task 3 (C)
Task 2 (B)
Task 3 (D)
When creating modular programs, addresses can be specified by symbols to
facilitate standardization.
The TASK ON and TASK OFF instructions (TKON(820) and TKOF(821)) can
be executed in one task to place another task in executable or standby status.
Instructions in tasks that are on standby will not be executed, but their I/O status will be maintained. When a task is returned to executable status, instructions will be executed with the I/O status that was maintained.
Example: Programming with a Control Task
In this example, task 0 is a control task that is executed first at the start of
operation. Other tasks can be set from the CX-Programmer (but not a Programming Console) to start or not to start at the beginning of operation.
Once program execution has been started, tasks can be controlled with
TKON(820) and TKOF(821).
Task 0
16
Example:
Task 0 is set to be executed at the start of operation
(set in the program properties from the CX-Programmer).
Task 1 is executable when a is ON.
Task 1 is put on standby when b is ON.
Tasks 2 and 3 are executable when c is ON.
Tasks 2 and 3 are
ut on standby when d is ON.
Page 53
Description of TasksSection 1-6
Program
Task 0
Task 1
Task 0
Task 1
Task 2
Task 3
Task 0
Task 1
Task 2
Task 3
Start task 1
when a is
ON.
Start tasks
2 and 3
when c is
ON.
Task 0
Task 1
Task 2
Task 3
Task 0
Task 1
Task 2
Task 3
Put task 1 on
standby when
b is ON.
Put tasks 2
and 3 on
standby
when d is
ON.
Task 0
Task 1
Task 2
Task 3
Task 0
Task 1
Task 2
Task 3
Example: Each Task Controlled by Another Task
In this example, each task is controlled by another task.
Program for task 0
Task 2
Start task 1
when a is
Task 0
Task 1
Task 2
TKOF(821) can be used in a task to put that
Note
task itself on standby.
ON.
Example:
Task 0
Task 1
Task 2
Program for task 1
Task 1 is set to be executed at the start of
operation unconditionally.
Task 1 executable when a is ON.
Task 1 put on standby when b is ON.
Task 2 is executable when c is ON and task 1 has
been executed.
Put task 1
on standby
when b is
ON.
If task 1 executed
Start
task 2
when c
is ON.
Task 0
Task 1
Task 2
Task 0
Task 1
Task 2
17
Page 54
Description of TasksSection 1-6
Task Execution TimeWhile a task is on standby, instructions in that task are not executed, so their
OFF instruction execution time will not be added to the cycle time.
Note From this standpoint, instructions in a task that is on standby are just like
instructions in a jumped program section (JMP-JME).
Since instructions in a non-executed task do not add to the cycle time, the
overall system performance can be improved significantly by splitting the system into an overall control task and individual tasks that are executed only
when necessary.
Earlier system
CS/CJ-series PLCs
Most instructions
are executed.
(Instructions in
subroutines and
jumps are
executed only
when
necessary.)
Task 0
Task 1
Task 2
Task 3
Instructions are
executed only
when necessary.
18
Page 55
This section basic information required to write, check, and input programs.
CS/CJ-series PLCs execute ladder-diagram programs contained in tasks. The
ladder-diagram program in each task ends with an END(001) instruction just
as with conventional PLCs.
Tasks are used to determine the order for executing the ladder-diagram programs, as well as the conditions for executing interrupts.
Program A
Allocated
Cyclic
task 1
Interrupt condition met.
Interrupt
task
Allocated
Program B
Each ladder-diagram
program ends with an
END(001) instruction.
Cyclic
task n
I/O refresh
Allocated
Program C
This section describes the basic concepts required to write CS/CJ-series programs. See
SECTION 4 Tasks for more information on tasks and their rela-
tionship to ladder-diagram programs.
Note Tasks and Programming Devices
Tasks are handled as described below on the Programming Devices. Refer to
4-4 Programming Device Operations for Tasks and to the CS/CJ-series Pro-
gramming Consoles Operation Manual (W341) and CX-Programmer Operation Manual for more details.
CX-Programmer
The CX-Programmer is used to designate task types and task numbers as
attributes for individual programs.
Programming Console
Programs are accessed and edited on a Programming Console by specifying
CT00 to CT 31 for cyclic tasks and IT00 to IT255 for interrupt tasks. When the
memory clear operation is performed with a Programming Console, only
cyclic task 0 (CT00) can be written in a new program. Use CX-Programmer to
create cyclic tasks 1 through 31 (CT01 through CT31).
20
Page 57
Basic ConceptsSection 2-1
2-1-2Basic Information on Instructions
Programs consist of instructions. The conceptual structure of the inputs to and
outputs from an instruction is shown in the following diagram.
*
Power flow (P.F., execution condition)
Instruction condition
Instruction
Power flow (P.F., execution condition)
2
Instruction condition
*
1
Flags
Operands
(sources)
Operands
(destinations)
Memory
Flag
*1: Input instructions only.
*2: Not output for all instructions.
Power Flow
The power flow is the execution condition that is used to control the execute
and instructions when programs are executing normally. In a ladder program,
power flow represents the status of the execution condition.
Input Instructions• Load instructions indicate a logical start and outputs the execution condi-
tion.
Outputs the
execution condition.
• Intermediate instructions input the power flow as an execution condition
and output the power flow to an intermediate or output instruction.
Outputs the
execution condition.
=
D00000
#1215
Output InstructionsOutput instructions execute all functions, using the power flow as an execution
condition.
LD power flow
Input block
Output block
Power flow for
output instruction
Instruction Conditions
Instruction conditions are special conditions related to overall instruction execution that are output by the following instructions. Instruction conditions have
a higher priority than power flow (P.F.) when it comes to deciding whether or
not to execute an instruction. An instruction may become not be executed or
may act differently depending on instruction conditions. Instruction conditions
21
Page 58
Basic ConceptsSection 2-1
are reset (canceled) at the start of each task, i.e., they are reset when the task
changes.
The following instructions are used in pairs to set and cancel certain instruction conditions. These paired instructions must be in the same task.
Instruction
condition
InterlockedAn interlock turns OFF part of the program. Special conditions, such as
turning OFF output bits, resetting timers, and holding counters are in
effect.
BREAK(514)
execution
Block program
execution
Ends a FOR(512) - NEXT(513) loop during execution. (Prevents execution of all instructions until to the NEXT(513) instruction.)
Executes a JMP0(515) to JME0(516) jump.JMP0(515)JME0(516)
Executes a program block from BPRG(096) to BEND(801).BPRG(096)BEND(801)
DescriptionSetting
Flags
In this context, a flag is a bit that serves as an interface between instructions.
Input flagsOutput flags
• Differentiation Flags
Differentiation result flags. The status of these
flags are input automatically to the instruction for
all differentiated up/down output instructions and
the DIFU(013)/DIFD(014) instructions.
•Carry (CY) Flag
The Carry Flag is used as an unspecified operand
in data shift instructions and addition/subtraction
instructions.
• Flags for Special Instructions
These include teaching flags for FPD(269) instructions and network communications enabled flags
• Differentiation Flags
Differentiation result flags. The status of these flags are output
automatically from the instruction for all differentiated up/down
output instructions and the UP(521)/DOWN(522) instruction.
• Condition Flags
Condition Flags include the Always ON/OFF Flags, as well as
flags that are updated by results of instruction execution. In user
programs, these flags can be specified by labels, such as ER,
CY, >, =, A1, A0, rather than by addresses.
• Flags for Special Instructions
These include memory card instruction flags and MSG(046)
execution completed flags.
instruction
IL(002)ILC(003)
BREAK(514)NEXT(513)
Canceling
instruction
Operands
Operands specify preset instruction parameters (boxes in ladder diagrams)
that are used to specify I/O memory area contents or constants. An instruction
can be executed entering an address or constant as the operands. Operands
are classified as source, destination, or number operands.
Example
Operand typesOperand
SourceSpecifies the address of the data
Destination
(Results)
NumberSpecifies a particular number used
to be read or a constant.
Specifies the address where data
will be written.
in the instruction, such as a jump
number or subroutine number.
S (source)
D (destination)
symbol
SSource Oper-
and
CControl dataCompound data in a source oper-
D (R)---
N---
Description
Source operand other than control
data (C)
and that has different meanings
depending bit status.
N (number)
22
Page 59
Basic ConceptsSection 2-1
Note Operands are also called the first operand, second operand, and so on, start-
ing from the top of the instruction.
First operand
Second operand
2-1-3Instruction Location and Execution Conditions
The following table shows the possible locations for instructions. Instructions
are grouped into those that do and those do not require execution conditions.
See
SECTION 3 Instruction Functions Instructions for details on individual
instructions.
Instruction typePossible locationExecution
Input instructionsLogical start (Load
instructions)
Intermediate
instructions
Output instructionsConnected directly
Connected directly
to the left bus bar
or is at the beginning of an instruction block.
Between a logical
start and the output instruction.
to the right bus
bar.
Note1. There is another group of instruction that executes a series of mnemonic
instructions based on a single input. These are called block programming
instructions. Refer to the CS/CJ Series CPU Units Instruction ReferenceManual for details on these block programs.
2. If an instruction requiring an execution condition is connected directly to
the left bus bar without a logical start instruction, a program error will occur
when checking the program on a Programming Device (CX-Programmer
or Programming Console).
condition
DiagramExamples
Not required.LD, LD TST(350),
LD > (and other
symbol comparison instructions)
Required.AND, OR, AND
TEST(350), AND
> (and other ADD
symbol comparison instructions),
UP(521),
DOWN(522),
NOT(520), etc.
Required.Most instructions
including OUT and
MOV(021).
Not required.END(001),
JME(005),
FOR(512),
ILC(003), etc.
23
Page 60
Basic ConceptsSection 2-1
.
2-1-4Addressing I/O Memory Areas
Bit Addresses
@@@@ @@
Bit number (00 to 15)
Indicates the word address
Example: The address of bit 03 in word 0001 in the CIO Area would be as
shown below. This address is given as “CIO 000103” in this manual.
0001 03
Bit number (03)
Word address: 0001
Word Addresses
Word
Bit: CIO 000103
15141312 111008070605040309020100
0000
0001
0002
@@@@
Indicates the word address
Example: The address of bits 00 to 15 in word 0010 in the CIO Area would be
as shown below. This address is given as “CIO 0010” in this manual.
0010
Word address
DM and EM Areas addresses are given with “D” or “E” prefixes, as shown
below for the address D00200.
24
D00200
Word address
Page 61
Basic ConceptsSection 2-1
Example: The address of word 2000 in the current bank of the Extended Data
Memory would be as follows:
E00200
Word address
The address of word 2000 in the bank 1 of the Extended Data Memory would
be as follows:
E1_00200
Word address
Bank number
2-1-5Specifying Operands
OperandDescriptionNotationApplication
Specifying bit
addresses
Specifying
word
addresses
The word and bit numbers are specified
directly to specify a bit (input input bits).
@@@@ @@
Bit number
(00 to 15)
Indicates the word address.
The same addresses are used to access
Note
timer/counter Completion Flags and
Present Values. There is also only one
address for a Task Flag.
The word number is specified directly to specify the 16-bit word.
@@@@
Indicates the word address.
0001 02
Bit number (02)
Word number: 0001
0003
Word number: 0003
D00200
Word number: 00200
examples
0001
02
MOV 0003
D00200
25
Page 62
Basic ConceptsSection 2-1
OperandDescriptionNotationApplication
examples
Specifying
indirect DM/
EM addresses
in Binary
Mode
The offset from the beginning of the area is
specified. The contents of the address will be
treated as binary data (00000 to 32767) to
specify the word address in Data Memory (DM)
or Extended Data Memory (EM). Add the @
symbol at the front to specify an indirect address in Binary Mode.
@D@@@@@
Contents
D
00000 to 32767
(0000 Hex to
7FFF Hex in BIN)
1) D00000 to D32767 are specified if
@D(@@@@@) contains 0000 Hex to 7FFF
Hex (00000 to 32767).
2) E0 _00000 to E0 _32767 of bank 0 in
Extended Data Memory (EM) are specified
if @D(@@@@@) contains 8000 Hex to
FFFF Hex (32768 to 65535).
@D00300
0 1 0 0
Binary: 256
Specifies D00256.
Add the @ symbol.
@D00300
8 0 0 1
Binary: 32769
MOV #0001
@00300
Contents
Contents
Specifies E0 00001.
3) E@_00000 to E@_32767 in the specified
bank are specified if @E@_@@@@@ contains 0000 Hex to 7FFF Hex (00000 to
32767).
4) E(@+1)_00000 to E(@+1)_32767 in the
bank following the specified bank @ are
specified if @E@_@@@@@ contains
8000 Hex to FFFF Hex (32768 to 65535).
@E1_00200
0 1 0 1
Binary: 257
Specifies E1_00257.
@E1_00200
8 0 0 2
Binary: 32770
Specifies E2_00002.
Contents
Contents
MOV #0001
@E1_00200
Note When specifying an indirect address in Binary Mode, treat Data Memory (DM) and Extended Data
Memory (EM) (banks 0 to C) as one series of addresses. If the contents of an address with the @
symbol exceeds 32767, the address will be assumed to be an address in the Extended Data Memory (EM) continuing on from 00000 in bank No. 0.
Example: If the Data Memory (DM) word contains 32768, E1_00000 in bank 0 in Extended Data Mem-
ory (EM) would be specified.
Note If the Extended Data Memory (EM) bank number is specified as “n” and the contents of the word
exceeds 32767, the address will be assumed to be an address in the Extended Data Memory (EM)
continuing on from 00000 in bank N+1.
Example: If bank 2 in Extended Data Memory (EM) contains 32768, E3_00000 in bank number 3 in
Extended Data Memory (EM) would be specified.
26
Page 63
Basic ConceptsSection 2-1
(*)
OperandDescriptionNotationApplication
examples
Specifying
indirect DM/
EM addresses
in BCD Mode
The offset from the beginning of the area is
specified. The contents of the address will be
treated as BCD data (0000 to 9999) to specify
the word address in Data Memory (DM) or Extended Data Memory (EM). Add an asterisk (*)
at the front to specify an indirect address in
BCD Mode.
*D@@@@@
Contents
D
00000 to 9999
(BCD)
*D00200
0 1 0 0
Specifies D0100
Add an asterisk
Contents
.
MOV #0001
*D00200
OperandDescriptionNotationApplication examples
Specifying a
register
directly
An index register (IR) or a data register (DR) is specified directly by specifying IR@ (@: 0 to 15) or DR@
(@: 0 to 15).
IR0
IR1
MOVR 000102 IR0
Stores the PLC memory address for
CIO 0010 in IR0.
MOVR 0010 IR1
Stores the PLC memory address for
CIO 0010 in IR1.
Specifying
an indirect
address
using a register
Indirect
address
(No offset)
The bit or word with the PLC memory
address contained in IR@ will be specified.
Specify ,IR@ to specify bits and words
for instruction operands.
,IR0
,IR1
LD ,IR0
Loads the bit with the PLC memory
address in IR0.
MOV #0001 ,IR1
Stores #0001 in the word with the PLC
memory in IR1.
Constant
offset
The bit or word with the PLC memory
address in IR@ + or – the constant is
specified.
Specify +/– constant ,IR@. Constant off-
sets range from –2048 to +2047 (decimal). The offset is converted to binary
+5,IR0
+31,IR1
LD +5 ,IR0
Loads the bit with the PLC memory
address in IR0 + 5.
MOV #0001 +31 ,IR1
Stores #0001 in the word with the PLC
memory address in IR1 + 31
data when the instruction is executed.
DR offsetThe bit or word with the PLC memory
address in IR@ + the contents of DR@ is
specified.
Specify DR@ ,IR@. DR (data register)
contents are treated as signed-binary
data. The contents of IR@ will be given a
negative offset if the signed binary value
DR0 ,IR0
DR0 ,IR1
LD DR0 ,IR0
Loads the bit with the PLC memory
address in IR0 + the value in DR0.
MOV #0001 DR0 ,IR1
Stores #0001 in the word with the PLC
memory address in IR1 + the value in
DR0.
is negative.
Auto Increment
The contents of IR@
is incremented by
+1 or +2 after referencing the value as
an PLC memory address.
+1: Specify ,IR
@+
+2: Specify ,IR@ + +
,IR0 ++
,IR1 +
LD ,IR0 ++
Increments the contents of IR0 by 2
after the bit with the PLC memory
address in IR0 is loaded.
MOV #0001 ,IR1 +
Increments the contents of IR1 by 1
after #0001 is stored in the word with
the PLC memory address in IR1.
Auto Decrement
The contents of IR@ is decremented by
–1 or –2 after referencing the value as
an PLC memory address.
–1: Specify ,–IR@
–2: Specify ,– –IR@
,– –IR0
,–IR1
LD ,– –IR0
After decrementing the contents of IR0
by 2, the bit with the PLC memory
address in IR0 is loaded.
MOV #0001 ,–IR1
After decrementing the contents of IR1
by 1, #0001 is stored in the word with
the PLC memory address in IR1.
27
Page 64
Basic ConceptsSection 2-1
DataOperandData formSymbolRangeApplication example
16-bit constant
32-bit constant
Text stringDescriptionSymbolExamples---
All binary data or
a limited range of
binary data
All BCD data or a
limited range of
BCD data
All binary data or
a limited range of
binary data
All BCD data or a
limited range of
BCD data
Text string data is stored in ASCII
(one byte except for special characters) in order from the leftmost to the
rightmost byte and from the rightmost (smallest) to the leftmost word.
00 Hex (NUL code) is stored in the
rightmost byte of the last word if
there is an odd number of characters.
0000 Hex (2 NUL codes) is stored in
the leftmost and rightmost vacant
bytes of the last word + 1 if there is
an even number of characters.
Unsigned binary ##0000 to #FFFF--Signed decimal±–32768 to
Unsigned decimal
BCD##0000 to #9999---
Unsigned binary ##00000000 to
Signed binary+–2147483648 to
Unsigned decimal
BCD##00000000 to
+32767
& (See Note.)&0 to &65535---
#FFFFFFFF
+2147483647
& (See Note.)&0 to
---
&429467295
#99999999
'ABCDE'
---
---
---
---
---
'A''B'
'D'
'C'
'E'
NUL
41
42
44
43
45
00
'ABCD'
'B'
'A'
'C'
'D'
NUL
NUL
MOV$ D00100 D00200
41
D00100
D00101
D00102
D00200
D00201
D00202
42
43
44
45
00
4142
43
44
00
45
28
41
42
43
44
00
00
ASCII characters that can be used in a text string includes alphanumeric characters, Katakana and symbols (except for special characters). The characters are shown in the following table.
Note Unsigned decimal notation if used for the CX-Programmer only.
Note This format conforms to IEEE754 standards for single-precision floating-point
data and is used only with instructions that convert or calculate floating-point
data. It can be used to set or monitor from the I/O memory Edit and Monitor
Screen on the CX-Programmer (not supported by the Programming Consoles)
As such, users do not need to know this format although they do need to know
that the formattin
63 62 6152 51 50 49 48 47 463210
Exponent
Value = (−1)
Sign (bit 31)
Mantissa
Exponent
Sign
x 1.[Mantissa] x 2
1: negative or 0: positive
The 23 bits from bit 00 to bit 22 contain the mantissa,
i.e., the portion below the decimal point in 1.@@@.....,
in binary.
The 8 bits from bit 23 to bit 30 contain the exponent.
The exponent is expressed in binary as 127 plus n in
n
.
2
takes up two words.
Binary
Mantissa
Exponent
------
floatingpoint decimal
Sign of
mantissa
Exponent Mantissa
Binary
Value = (−1)
Sign (bit 63)
Mantissa
Exponent
This format conforms to IEEE754 standards for double-precision floating-point
Note
data and is used only with instructions that convert or calculate floating-point
data. It can be used to set or monitor from the I/O memory Edit and Monitor
Screen on the CX-Programmer (not supported by the Programming Consoles).
As such, users do not need to know this format although they do need to know
that the formatting takes up four words.
Sign
x 1.[Mantissa] x 2
1: negative or 0: positive
The 52 bits from bit 00 to bit 51 contain the mantissa,
i.e., the portion below the decimal point in 1.@@@.....,
in binary.
The 11 bits from bit 52 to bit 62 contain the exponent
The exponent is expressed in binary as 1023 plus n
n
.
in 2
Exponent
Signed Binary Data
In signed binary data, the leftmost bit indicates the sign of binary 16-bit data.
The value is expressed in 4-digit hexadecimal.
Positive Numbers: A value is positive or 0 if the leftmost bit is 0 (OFF). In 4digit hexadecimal, this is expressed as 0000 to 7FFF Hex.
Negative Numbers: A value is negative if the leftmost bit is 1 (ON). In 4-digit
hexadecimal, this is expressed as 8000 to FFFF Hex. The absolute of the
negative value (decimal) is expressed as a two’s complement.
Example: To treat –19 in decimal as signed binary, 0013 Hex (the absolute
value of 19) is subtracted from FFFF Hex and then 0001 Hex is added to yield
FFED Hex.
31
Page 68
Basic ConceptsSection 2-1
FFFF
111111111111
1111
True number
−
)
+)
Two's complement
001
0000000000010011
FFEC
111111111110
000
0000000000000001
FFED
1111111111101101
3
1100
1
Complements
Generally the complement of base x refers to a number produced when all
digits of a given number are subtracted from x – 1 and then 1 is added to the
rightmost digit. (Example: The ten’s complement of 7556 is 9999 – 7556 + 1 =
2444.) A complement is used to express a subtraction and other functions as
an addition.
Example: With 8954 – 7556 = 1398, 8954 + (the ten’s complement of 7556) =
8954 + 2444 = 11398. If we ignore the leftmost bit, we get a subtraction result
of 1398.
Two’s Complements
A two’s complement is a base-two complement. Here, we subtract all digits
from 1 (2 – 1 = 1) and add one.
Example: The two’s complement of binary number 1101 is 1111 (F Hex) –
1101 (D Hex) + 1 (1 Hex) = 0011 (3 Hex). The following shows this value
expressed in 4-digit hexadecimal.
The two’s complement b Hex of a Hex is FFFF Hex – a Hex + 0001 Hex =
b Hex. To determine the two’s complement b Hex of “a Hex,” use b Hex =
10000 Hex – a Hex.
Example: to determine the two’s complement of 3039 Hex, use 10000 Hex –
3039 Hex = CFC7 Hex.
Similarly use a Hex = 10000 Hex – b Hex to determine the value a Hex from
the two’s complement b Hex.
Example: To determine the real value from the two’s complement CFC7 Hex
use 10000 Hex – CFC7 Hex = 3039 Hex.
The CS/CJ Series has two instructions: NEG(160)(2’S COMPLEMENT) and
NEGL(161) (DOUBLE 2’S COMPLEMENT) that can be used to determine the
two’s complement from the true number or to determine the true number from
the two’s complement.
32
Signed BCD Data
Signed BCD data is a special data format that is used to express negative
numbers in BCD. Although this format is found in applications, it is not strictly
defined and depends on the specific application. The CS/CJ Series supports
the following instructions to convert the data formats: SIGNED BCD-TOBINARY: BINS(470), DOUBLE SIGNED BCD-TO-BINARY: BISL(472),
Page 69
Basic ConceptsSection 2-1
SIGNED BINARY-TO-BCD: BCDS(471), and DOUBLE SIGNED BINARY-TOBCD: BDSL(473). Refer to the CS/CJ-series Programmable ControllersInstructions Reference Manual (W340) for more information.
+200020002
+100010001
000000000
–1Cannot be expressed.FFFF
–2FFFE
.
.
.
–32,7678001
–32,7688000
.
.
.
.
.
.
Signed binary (4-digit
hexadecimal)
33
Page 70
Basic ConceptsSection 2-1
2-1-7Instruction Variations
The following variations are available for instructions to differentiate executing
conditions and to refresh data when the instruction is executed (immediate
refresh).
VariationSymbolDescription
Differentiation ON@Instruction that differentiates when the execu-
tion condition turns ON.
OFF %Instruction that differentiates when the execu-
tion condition turns OFF.
Immediate refreshing!Refreshes data in the I/O area specified by
@
the operands or the Special I/O Unit words
when the instruction is executed.
(Immediate refreshing is not supported by the
CS1D CPU Units
Instruction (mnemonic)
Differentiation variation
Immediate refresh variation
for Duplex-CPU Systems.)
2-1-8Execution Conditions
Non-differentiated Instructions
Non-differentiated
output instruction
Non-differentiated input instruction
The CS/CJ Series offers the following types of basic and special instructions.
• Non-differentiated instructions executed every cycle
• Differentiated instructions executed only once
Output instructions that required execution conditions are executed once
every cycle while the execution condition is valid (ON or OFF).
Example
Input instructions that create logical starts and intermediate instructions read
bit status, make comparisons, test bits, or perform other types of processing
every cycle. If the results are ON, power flow is output (i.e., the execution condition is turned ON).
Example
34
Page 71
Basic ConceptsSection 2-1
Input-differentiated Instructions
Upwardly Differentiated Instructions (Instruction Preceded by @)
• Output Instructions: The instruction is executed only during the cycle in
which the execution condition turned ON (OFF
cuted in the following cycles.
Example
→ ON) and are not exe-
(@) Upwardly-differ
entiated instruction
Executes the MOV instruction once when
CIO 000102 goes OFF → ON.
@MOV
• Input Instructions (Logical Starts and Intermediate Instructions): The
instruction reads bit status, makes comparisons, tests bits, or perform
other types of processing every cycle and will output an ON execution
condition (power flow) when results switch from OFF to ON. The execution condition will turn OFF the next cycle.
Example
Upwardly differentiated input instruction
ON execution condition created for one
cycle only when CIO 000103 goes
from OFF to ON.
• Input Instructions (Logical Starts and Intermediate Instructions): The
instruction reads bit status, makes comparisons, tests bits, or perform
other types of processing every cycle and will output an OFF execution
condition (power flow stops) when results switch from OFF to ON. The
execution condition will turn ON the next cycle.
Example
Upwardly differentiated input instruction
0001
03
Downwardly Differentiated Instructions (Instruction preceded by %)
• Output instructions: The instruction is executed only during the cycle in
which the execution condition turned OFF (ON
cuted in the following cycles.
Example
(%) Downwardly differentiated instruction
OFF execution condition created for one
cycle only when CIO 00103 goes from
OFF to ON.
→ OFF) and is not exe-
%SET
Executes the SET instruction once
when CIO 000102 goes ON to OFF.
35
Page 72
Basic ConceptsSection 2-1
• Input Instructions (Logical Starts and Intermediate Instructions): The
instruction reads bit status, makes comparisons, tests bits, or perform
other types of processing every cycle and will output the execution condition (power flow) when results switch from ON to OFF. The execution condition will turn OFF the next cycle.
Downwardly differentiated instruction
Note Unlike the upwardly differentiated instructions, downward differentia-
tion variation (%) can only be added to LD, AND, OR, SET and RSET
instructions. To execute downward differentiation with other instructions, combine the instructions with a DIFD or a DOWN instruction.
NOT can be added to instructions only when using a CS1-H, CJ1-H,
CJ1M, or CS1D CPU Unit.
• Input Instructions (Logical Starts and Intermediate Instructions): The
instruction reads bit status, makes comparisons, tests bits, or perform
other types of processing every cycle and will output an OFF execution
condition (power flow stops) when results switch from ON to OFF. The
execution condition will turn ON the next cycle.
Downwardly differentiated input instruction
Example
Will turn ON when the CIO 000103 switches from
ON → OFF and will turn OFF after one cycle.
Example
0001
03
OFF execution condition created for one
cycle only when CIO 00103 goes from
ON to OFF.
36
Page 73
Basic ConceptsSection 2-1
2-1-9I/O Instruction Timing
The following timing chart shows different operating timing for individual
instructions using a program comprised of only LD and OUT instructions.
Input
Input
read
Input
read
Input read
read
Input
read
Input
read
A
B1
Input
read
A
B2
Input
read
A
A
!
A
!
A
A
A
A
A
!
A
!
A
B3
B4
B5
B6
B7
B8
B9
B10
B11
B12
Input
read
Input
read
Input
!
read
Input
!
!
!
!
!
read
Differentiated Instructions
CPU processing
Instruction
executed.
I/O refresh
• A differentiated instruction has an internal flag that tells whether the previous value is ON or OFF. At the start of operation, the previous value flags
for upwardly differentiated instruction (DIFU and @ instructions) are set to
ON and the previous value flags for downwardly differentiated instructions
(DIFD and % instructions) are set to OFF. This prevents differentiation
outputs from being output unexpectedly at the start of operation.
• An upwardly differentiated instruction (DIFU or @ instruction) will output
ON only when the execution condition is ON and flag for the previous
value is OFF.
37
Page 74
Basic ConceptsSection 2-1
• Use in Interlocks (IL - ILC Instructions)
In the following example, the previous value flag for the differentiated
instruction maintains the previous interlocked value and will not output a
differentiated output at point A because the value will not be updated
while the interlock is in effect.
0000
00
0000
01
(002)
IL
(013)
DIFU 001000
(003)
ILC
IL is
executing
IL is
executing
• Use in Jumps (JMP - JME Instructions): Just as for interlocks, the previous value flag for a differentiated instruction is not changed when the
instruction is jumped, i.e., the previous value is maintained. Upwardly and
downwardly differentiate instructions will output the execution condition
only when the input status has changed from the status indicated by the
previous value flag.
Note a) Do not use the Always ON Flag or A20011 (First Cycle Flag) as
the input bit for an upwardly differentiated instruction. The instruction will never be executed.
b) Do not use Always OFF Flag as the input bit for a downwardly dif-
ferentiated instruction. The instruction will never be executed.
38
Page 75
Basic ConceptsSection 2-1
2-1-10 Refresh Timing
The following methods are used to refresh external I/O.
Refer to the section on CPU Unit operation in the CS/CJ Series OperationManual for details on the I/O refresh.
Cyclic Refresh
Every program allocated to a ready cyclic task or a task where interrupt condition has been met will execute starting from the beginning program address
and will run until the END(001) instruction. After all ready cyclic tasks or tasks
where interrupt condition have been met have executed, cyclic refresh will
refresh all I/O points at the same time.
Note Programs can be executed in multiple tasks. I/O will be refreshed after the
final END(001) instruction in the program allocated to the highest number
(among all ready cyclic tasks) and will not be refreshed after the END(001)
instruction in programs allocated to other cyclic tasks.
To p
150
! LD 000101
! OUT 000209
CIO 0001
CIO 0002
150
16-bit units
Immediate Refresh
Instructions with Refresh
Variation (!)
END
To p
CIO 0003
! MOV 0003
CIO 0004
END
Cyclic refresh
(batch processing)
I/O refresh
150
16-bit units
150
All real data
Execute an IORF instruction for all required words prior to the END(001)
instruction if I/O refreshing is required in other tasks.
I/O will be refreshed as shown below when an instruction is executing if an
real I/O bit is specified as an operand.
UnitsRefreshed data
C200H Basic I/O Units (CS Series only)I/O will be refreshed for the 16 bits conCJ Basic I/O Units
taining the bit.
39
Page 76
Basic ConceptsSection 2-1
• When a word operand is specified for an instruction, I/O will be refreshed
for the 16 bits that are specified.
• Inputs will be refreshed for input or source operand just before an instruction is executed.
• Outputs will be refreshed for outputs or destination (D) operands just after
an instruction is execute.
Add an exclamation mark (!) (immediate refresh option) in front of the instruction.
Note Immediate refreshing is not supported by the CS1D CPU Units for Duplex-
CPU Systems, but they do support refreshing for IORF(097) and DLNK(226)
instructions.
Units Refreshed for I/O REFRESH Instruction
LocationCPU or Expansion I/O Rack (but not SYSMAC BUS Slave Racks)
Units Basic I/O UnitsCS/CJ-series Basic I/O
Units
C200H Basic I/O Unit (See
note.)
C200H Group-2 High-den-
sity I/O Units (See note.)
Special I/O UnitsNot refreshed
Refreshed
Refreshed
Not refreshed
Note C200H I/O Units cannot be mounted to CJ-series PLCs.
Top
.
.
.
!LD 000101
.
.
.
!OUT 000209
.
.
.
END
Top
.
.
.
!MOV
.
.
.
END
I/O refresh
0003
0004
Immediate refresh
Input
Output
S
D
150
CIO 0001
150
CIO 0002
150
CIO 0003
150
CIO 0004
16-bit units
16-bit units
40
I/O refresh
Cyclic refresh
(batch processing)
All real I/O
Page 77
Basic ConceptsSection 2-1
Units Refreshed for
IORF(097) or DLNK(226)
An I/O REFRESH (IORF(097)) instruction that refreshes real I/O data in a
specified word range is available as a special instruction. All or just a specified
range of real I/O data can be refreshed during a cycle with this instruction.
IORF can also be used to refresh words allocated to Special I/O Units.
Another instruction, CPU BUS UNIT REFRESH (DLNK(226)) is available to
refresh the words allocated to CPU Bus Units in the CIO and DM Areas, as
well as to perform special refreshing for the Unit, such as refreshing data
links. DLNK(226) is supported only by CS1-H, CJ1-H, CJ1M, or CS1D CPU
Units.
Units Refreshed for IORF(097)
LocationCPU or Expansion I/O Rack (but not SYSMAC BUS Slave Racks)
Units Basic I/O UnitsCS/CJ-series Basic I/O Units Refreshed
C200H Basic I/O Units Refreshed
C200H Group-2 High-den-
sity I/O Units
Special I/O UnitsRefreshed
CPU Bus UnitsNot refreshed
A
C
B
R1
E
D
R2
Refreshed
A
CE
ACE
Units Refreshed for DLNK(226)
LocationCPU or Expansion I/O Rack (but not SYSMAC BUS Slave Racks)
Units Basic I/O UnitsNot refreshed
Special I/O UnitsNot refreshed
CPU Bus Units
Words allocated to the Unit in CIO Area
Words allocated to the Unit in DM Area
Special refreshing for the Unit (data links for
Controller Link Units and SYSMAC Link Units
or remote I/O for DeviceNet Units)
Words allocated in
CIO Area and DM
Area and any
special refreshing
DLNK
#F
CPU Bus Unit with
unit number F.
Refreshed
41
Page 78
Basic ConceptsSection 2-1
2-1-11 Program Capacity
The maximum program capacities of the CS/CJ-series CPU Units for all user
programs (i.e., the total capacity of all tasks) are given in the following table.
All capacities are given as the maximum number of steps. The capacities
must not be exceeded, and writing the program will be disabled if an attempt
is made to exceed the capacity.
Each instruction is from 1 to 7 steps long. Refer to 10-5 Instruction ExecutionTimes and Number of Steps in the Operation Manual for the specific number
of steps in each instruction. (The length of each instruction will increase by 1
step if a double-length operand is used.)
Note Memory capacity for CS/CJ-series PLCs is measured in steps, whereas
memory capacity for previous OMRON PLCs, such as the C200HX/HG/HE
and CV-series PLCs, was measured in words. Refer to the information at the
end of10-5 Instruction Execution Times and Number of Steps in the OperationManual for your PLC for guidelines on converting program capacities from
previous OMRON PLCs.
2-1-12 Basic Ladder Programming Concepts
Instructions are executed in the order listed in memory (mnemonic order). The
basic programming concepts as well as the execution order must be correct.
42
Page 79
Basic ConceptsSection 2-1
General Structure of the
Ladder Diagram
Left bus bar
Input bit
Connecting line
A ladder diagram consists of left and right bus bars, connecting lines, input
bits, output bits, and special instructions. A program consists of one or more
program runs. A program rung is a unit that can be partitioned when the bus is
split horizontally. In mnemonic form, a rung is all instructions from a LD/LD
NOT instruction to the output instruction just before the next LD/LD NOT
instructions. A program rung consists of instruction blocks that begin with an
LD/LD NOT instruction indicating a logical start.
Special
instruction
Output bit
Right bus bar
Rungs
Instruction blocks
MnemonicsA mnemonic program is a series of ladder diagram instructions given in their
mnemonic form. It has program addresses, and one program address is
equivalent to one instruction. Program addresses contain six digits starting
from 000000.
1,2,3...1. When ladder diagrams are executed by PLCs, the signal flow (power flow)
is always from left to right. Programming that requires power flow from right
to left cannot be used. Thus, flow is different from when circuits are made
up of hard-wired control relays. For example, when the circuit “a” is implemented in a PLC program, power flows as though the diodes in brackets
were inserted and coil R2 cannot be driven with contact D included. The
actual order of execution is indicated on the right with mnemonics. To
achieve operation without these imaginary diodes, the circuit must be rewritten. Also, circuit “b” power flow cannot be programmed directly and
must be rewritten.
Circuit "a"
(1)
A
Signal flow
(2) ((3))(4)
CD
((8))
(9)
E
((5))
(6)
B
R1
R2
Order of execution (mnemonic)
(7)
(1) LD A
(2) LD C
(3) OUT TR0
(4) AND D
(5) OR LD
(10)
(6) AND B
(7) OUT R1
(8) LD TR0
(9) AND E
(10) OUT R2
Circuit " b"
AB
R1
E
CD
R2
In circuit “a,” coil R2 cannot be driven with contact D included.
In circuit “b,” contact E included cannot be written in a ladder diagram. The
program must be rewritten.
2. There is no limit to the number of I/O bits, work bits, timers, and other input
bits that can be used. Rungs, however, should be kept as clear and simple
as possible even if it means using more input bits to make them easier to
understand and maintain.
3. There is no limit to the number of input bits that can be connected in series
or in parallel in series or parallel rungs.
4. Two or more output bits can be connected in parallel.
44
0000
00
0000
05
TIM 0000#0100
0002
00
Page 81
Basic ConceptsSection 2-1
5. Output bits can also be used as input bits.
0002
00
0002
00
Restrictions
1,2,3...1. A ladder program must be closed so that signals (power flow) will flow from
the left bus bar to the right bus bar. A rung error will occur if the program is
not closed (but the program can be executed).
2. Output bits, timers, counters and other output instructions cannot be connected directly to the left bus bar. If one is connected directly to the left bus
bar, a rung error will occur during the programming check by a Programming Device. (The program can be executed, but the OUT and MOV(021)
will not be executed.)
Input condition must be provided.
MOV
Insert an unused N.C. work bit or the ON Condition Flag (Always ON Flag) if
the input must be kept ON at all times.
Unused work bit
ON (Always ON Flag)
MOV
45
Page 82
Basic ConceptsSection 2-1
3. An input bit must always be inserted before and never after an output instruction like an output bit. If it is inserted after an output instruction, then
a location error will occur during a Programming Device program check.
0000
00
0000
01
0002
01
0000
03
0002
01
0000
04
4. The same output bit cannot be programmed in an output instruction more
than once. Instructions in a ladder program are executed in order from the
top rung in a single cycle, so the result of output instruction in the lower
rungs will be ultimately reflected in the output bit and the results of any previous instructions controlling the same bit will be overwritten and not output.
(Output bit)
0000
00
(Output bit)
0000
00
5. An input bit cannot be used in an OUTPUT instruction (OUT).
(Input bit)
0000
00
6. An END(001) instruction must be inserted at the end of the program in
each task.
• If a program without an END(001) instruction starts running, a program
error indicating No End Instruction will occur, the ERR/ALM LED on the
front of the CPU Unit will light, and the program will not be executed.
• If a program has more than one END(001) instruction, then the program
will only run until the first END(001) instruction.
46
Page 83
Basic ConceptsSection 2-1
• Debugging programs will run much smoother if an END(001) instruction is
inserted at various break points between sequence rungs and the
END(001) instruction in the middle is deleted after the program is
checked.
Task (program)
000000
000001
END
Task (program)
000000
000001
END
Task (program)
000000
000001
END
2-1-13 Inputting Mnemonics
A logical start is accomplished using an LD/LD NOT instruction. The area
from the logical start until the instruction just before the next LD/LD NOT
instruction is considered a single instruction block.
Create a single rung consisting of two instruction blocks using an AND LD
instruction to AND the blocks or by using an OR LD instruction to OR the
blocks. The following example shows a complex rung that will be used to
explain the procedure for inputting mnemonics (rung summary and order).
Task (program)
000000
000001
END
END
Task (program)
000000
000001
END
END
Task (program)
000000
000001
END
Will not be executed.
Will not be executed.
47
Page 84
Basic ConceptsSection 2-1
1,2,3...1. First separate the rung into small blocks (a) to (f).
0000000000
01
0010
0010
00
01
0005
00
0000000000
(a)
0010000010
(b)
(c)
(1)
0005
(2)
0000
0000
03
02
01
01
(d)
0000
02
0000040000
0000
06
0000
03
05
0000040000
(e)
0005
00
05
(5)
0000
(f)
06
00
(4)
(3)
48
Page 85
Basic ConceptsSection 2-1
• Program the blocks from top to bottom and then from left to right.
0000
(a)
00
LD 000000
AND 000001
0000
01
OR LD
0010
(b)
00
LD 001000
AND 001001
0010
01
(1)
(2)
0005
(c)
00
OR 000500
0000
(a)
AND 000002
AND NOT 000003
Address
000200 LD 000000
(a)
000201 AND 000001
000202 LD 001000
(b)
000203 AND 001001
0000
02
03
Instruction Operand
000204 OR LD ---
(c)
000205 OR 000500
000206 AND 000002
(d)
000207 AND NOT 000003
000208 LD 000004
(e)
000209 AND 000005
(f)
000210 OR 000006
000211 AND LD ---
000212 OUT 000500
AND LD
0005
00
OUT 000500
(3)
(1)
(c)
0000040000
LD 000004
AND 000005
(f)
OR 000006
(2)
0000
06
05
(5)
(4)
(3)
(5)
(4)
49
Page 86
Basic ConceptsSection 2-1
2-1-14 Program Examples
1,2,3...1. Parallel/Series Rungs
0000000000010000
0002
00
ab
A blockB block
Program the parallel instruction in the A block and then the B block.
2. Series/Parallel Rungs
0000
0000
01
00
ab
A block
02
0000
02
0002
01
0000
04
B block
0000
0000
03
03
0002
0002
01
00
Instruction Operands
LD
AND
OR
AND
AND NOT
OUT
000000
000001
000200
000002
000003
000200
Instruction Operands
LD
AND NOT
LD
AND
OR
OR
000000
000001
000002
000003
000201
000004
a
b
a
b
AND LD --OUT
000201
• Separate the rung into A and B blocks, and program each individually.
• Connect A and B blocks with an AND LD.
• Program A block.
Instruction Operands
LD NOT
AND
LD
AND NOT
LD NOT
AND
000000
000001
000002
000003
000004
000202
OR LD --AND LD --OUT
000202
0000000000010000
B1 block
02
0000
04
B2 block
ab
A block
b
1
0000
03
0002
02
b
2
B block
0002
02
• Program B1 block and then program B2 block.
• Connect B
1 and B2 blocks with an OR LD and then A and B blocks with
an AND LD.
a
b
1
b
2
b1 + b
a b
2
50
Page 87
Basic ConceptsSection 2-1
3. Example of series connection in a series rung
a
1
A1 block
0000
00
0000
02
a
2
0000
01
0002
03
b
1
B1 block
0000
04
0002
06
b
2
0000
05
0002
07
0002
03
A2 blockB2 block
ab
A blockB block
Program A
1 block, program A2 block, and and then connect A
blocks with an OR LD.
Program B
1 and B2 the same way.
Connect A block and B block with an AND LD.
Repeat for as many A to n blocks as are present.
Instruction Operands
LD
AND NOT
LD NOT
AND
000000
000001
000002
000003
OR LD --LD
AND
LD
AND
000004
000005
000006
000007
OR LD --AND LD --OUT
000203
and A
1
a
1
a
2
a1 + a
b
1
b
2
b1 + b
a b
2
2
2
0005
00
ab
cn
A blockB blockC blockn block
51
Page 88
Basic ConceptsSection 2-1
4. Complex Rungs
0000
00
0000
04
0000
06
0000
01
0000
02
0000
05
0000
07
0000
03
0002
04
Instruction Operand
LD
LD
LD
AND
000000
000001
000002
000003
OR LD --AND LD --LD
AND
000004
000005
OR LD ---
LD
AND
000006
000007
OR LD --OUT
000204
0000
00
Z
The diagram above is based on the diagram below.
0000
00
A simpler program can be written by rewriting
this as shown below.
If a holding bit is in use, the ON/OFF status would
be held in memory even if the power is turned OFF,
and the error signal would still be in effect when
power is turned back ON.
5. Rungs Requiring Caution or Rewriting
OR and OL LD Instructions
With an OR or OR NOT instruction, an OR is taken with the results of the ladder logic from the LD or LD NOT instruction to the OR or OR NOT instruction,
so the rungs can be rewritten so that the OR LD instruction is not required.
0000
00
0000
01
0002
07
0002
07
0000
01
0000
00
0002
07
0002
07
Example: An OR LD instruction will be needed if the rungs are programmed
as shown without modification. A few steps can be eliminated by rewriting the
rungs as shown.
Output Instruction Branches
A TR bit will be needed if there is a branch before an AND or AND NOT
instruction. The TR bit will not be needed if the branch comes at a point that is
connected directly to output instructions and the AND or AND NOT instruction
or the output instructions can be continued as is.
Output instruction 1
0000
00
TR0
0000
01
0002
08
0002
09
0000
00
0000
01
0002
09
0002
08
Output instruction 2
Example: A temporary storage bit TR0 output instruction and load (LD)
instruction are needed at a branch point if the rungs are programmed without
modification. A few steps can be eliminated by rewriting the rungs.
53
Page 90
Basic ConceptsSection 2-1
Mnemonic Execution Order
PLCs execute ladder programs in the order the mnemonics are entered so
instructions may not operate as expected, depending on the way rungs are
written. Always consider mnemonic execution order when writing ladder diagrams.
0000
00
0010
00
0010
00
0002
10
0000
00
0000
00
0010
00
0002
10
0010
00
Example: CIO 000210 in the above diagram cannot be output. By rewriting
the rung, as shown above, CIO 000210 can be turned ON for one cycle.
Rungs Requiring Rewriting
PLCs execute instructions in the order the mnemonics are entered so the signal flow (power flow) is from left to right in the ladder diagram. Power flows
from right to left cannot be programmed.
0000
00
0000
01
TR0
0000
02
0000
04
0000030002
11
0002
12
0000
01
0000
00
0000
01
0000
02
0000
04
0000
0002
03
11
0002
12
Example: The program can be written as shown in the diagram at the left
where TR0 receives the branch. The same value is obtained, however, by the
rungs at the right, which are easier to understand. It is recommended, therefore, that the rungs at the left be rewritten to the rungs at the right.
Rewrite the rungs on the left below. They cannot be executed.
The arrows show signal flow (power flow) when the rungs consist of control
relays.
A
A
C
B
R1
E
D
R2
C
ACE
E
B
R1
D
R2
54
Page 91
PrecautionsSection 2-2
2-2Precautions
2-2-1Condition Flags
Using Condition FlagsConditions flags are shared by all instructions, and will change during a cycle
depending on results of executing individual instructions. Therefore, be sure
to use Condition Flags on a branched output with the same execution condition immediately after an instruction to reflect the results of instruction execution. Never connect a Condition Flag directly to the bus bar because this will
cause it to reflect execution results for other instructions.
Example: Using Instruction A Execution Results
Correct Use
Mnemonic
Condition Flag
Example: =
Instruction A
Reflects instruction A
execution results.
Instruction B
Instruction Operand
LD a
Instruction
D=
AN
Instruction
A
B
The same execution condition (a) is used for instructions A and B to execute
instruction B based on the execution results of instruction A. In this case,
instruction B will be executed according to the Condition Flag only if instruction A is executed.
Incorrect Use
Preceding rung
Instruction A
Reflects the execution results of
the preceding rung if instruction
Condition Flag
Example: =
A is not executed.
Instruction B
If the Condition Flag is connected directly to the left bus bar, instruction B will
be executed based on the execution results of a previous rung if instruction A
is not executed.
Note Condition Flags are used by all instruction within a single program (task) but
they are cleared when the task switches. Therefore execution results in the
preceding task will not be reflected later tasks. Since conditions flags are
shared by all instructions, make absolutely sure that they do not interfere with
each other within a single ladder-diagram program. The following is an example.
55
Page 92
PrecautionsSection 2-2
Using Execution Results in N.C. and N.C. Inputs
The Condition Flags will pick up instruction B execution results as shown in
the example below even though the N.C. and N.O. input bits are executed
from the same output branch.
Instruction A
Incorrect
Use
Condition Flag
Example: =
Condition Flag
Example: =
Make sure each of the results is picked up once by an OUTPUT instruction to
ensure that execution results for instruction B will be not be picked up.
Reflects instruction A execution
results.
Instruction B
Reflects instruction B execution
results.
Correct
Use
Reflects instruction A
execution results.
Condition Flag
Example: =
Condition Flag
Example: =
Instruction A
Reflects instruction A
execution results.
Instruction B
56
Page 93
PrecautionsSection 2-2
Example: The following example will move #0200 to D00200 if D00100 con-
tains #0010 and move #0300 to D00300 if D00100 does not contain #0010.
Incorrect
Use
The Equals Flag will turn ON if D00100 in the rung above contains #0010.
#0200 will be moved to D00200 for instruction (1), but then the Equals Flag
will be turned OFF because the #0200 source data is not 0000 Hex. The MOV
instruction at (2) will then be executed and #0300 will be moved to D0300. A
rung will therefore have to be inserted as shown below to prevent execution
results for the first MOVE instruction from being picked up.
Reflects CMP execution results.
(1)
Reflects MOV execution results.
(2)
Correct
Use
Reflects CMP execution results.
57
Page 94
PrecautionsSection 2-2
Using Execution Results from Differentiated Instructions
With differentiated instructions, execution results for instructions are reflected
in Condition Flags only when execution condition is met, and results for a previous rung (rather than execution results for the differentiated instruction) will
be reflected in Condition Flags in the next cycle. You must therefore be aware
of what Condition Flags will do in the next cycle if execution results for differentiated instructions to be used.
In the following for example, instructions A and B will execute only if execution
condition C is met, but the following problem will occur when instruction B
picks up execution results from instruction A. If execution condition C remains
ON in the next cycle after instruction A was executed, then instruction B will
unexpectedly execute (by the execution condition) when the Condition Flag
goes from OFF to ON because of results reflected from a previous rung.
Previous rung
Incorrect
Use
Instruction A
Reflects execution results for instruction A
when execution condition is met.
Condition Flag
Example: =
Reflects execution results for a previous
rung in the next cycle.
Instruction B
In this case then, instructions A and B are not differentiated instructions, the
DIFU (of DIFD) instruction is used instead as shown below and instructions A
and B are both upwardly (or downwardly) differentiated and executed for one
cycle only.
Previous rung
Correct
Use
Instruction A
Reflects instruction A execution results.
Condition Flag
Example: =
Instruction B
Note The CS1-H, CJ1-H, CJ1M, or CS1D CPU Units support instructions to save
and load the Condition Flag status (CCS(282) and CCL(283)). These can be
used to access the status of the Condition Flags at other locations in a task or
in a different task.
Main Conditions Turning ON Condition Flags
Error Flag
The ER Flag will turn ON under special conditions, such as when operand
data for an instruction is incorrect. The instruction will not be executed when
the ER Flag turns ON.
58
Page 95
PrecautionsSection 2-2
When the ER Flag is ON, the status of other Condition Flags, such as the <,
>, OF, and UF Flags, will not change and status of the = and N Flags will vary
from instruction to instruction.
Refer to the descriptions of individual instructions in the CS/CJ-series Pro-grammable Controllers Instructions Reference Manual (W340) for the conditions that will cause the ER Flag to turn ON. Caution is required because
some instructions will turn OFF the ER Flag regardless of conditions.
Note The PLC Setup Settings for when an instruction error occurs determines
whether operation will stop when the ER Flag turns ON. In the default setting,
operation will continue when the ER Flag turns ON. If Stop Operation is specified when the ER Flag turns ON and operation stops (treated as a program
error), the program address at the point where operation stopped will be
stored at in A298 to A299. At the same time, A29508 will turn ON.
Equals Flag
The Equals Flag is a temporary flag for all instructions except when comparison results are equal (=). It is set automatically by the system, and it will
change. The Equals Flag can be turned OFF (ON) by an instruction after a
previous instruction has turned it ON (OFF). The Equals Flag will turn ON, for
example, when MOV or another move instruction moves 0000 Hex as source
data and will be OFF at all other times. Even if an instruction turns the Equals
Flag ON, the move instruction will execute immediately and the Equals Flag
will turn ON or OFF depending on whether the source data for the move
instruction is 0000 Hex or not.
Carry Flag
The CY Flag is used in shift instructions, addition and subtraction instructions
with carry input, addition and subtraction instruction borrows and carries, as
well as with Special I/O Unit instructions, PID instructions, and FPD instructions. Note the following precautions.
Note1. The CY Flag can remain ON (OFF) because of execution results for a cer-
tain instruction and then be used in other instruction (an addition and subtraction instruction with carry or a shift instruction). Be sure to clear the
Carry Flag when necessary.
2. The CY Flag can be turned ON (OFF) by the execution results for a certain
instruction and be turned OFF (ON) by another instruction. Be sure the
proper results are reflected in the Carry Flag when using it.
Less Than and Greater Than Flags
The < and > Flags are used in comparison instruction, as well as in the LMT,
BAND, ZONE, PID and other instructions.
The < or > Flag can be turned OFF (ON) by another instruction even if it is
turned ON (OFF) by execution results for a certain instruction.
Negative Flag
The N Flag is turned OFF when the leftmost bit of the instruction execution
results word is “1” for certain instructions and it is turned OFF unconditionally
for other instruction.
Specifying Operands for Multiple Words
With the CS/CJ-series PLCs, an instruction will be executed as written even if
an operand requiring multiple words is specified so that all of the words for the
operand are not in the same area. In this case, words will be taken in order of
the PLC memory addresses. The Error Flag will not turn ON.
59
Page 96
PrecautionsSection 2-2
As an example, consider the results of executing a block transfer with
XFER(070) if 20 words are specified for transfer beginning with W500. Here,
the Work Area, which ends at W511, will be exceeded, but the instruction will
be executed without turning ON the Error Flag. In the PLC memory
addresses, the present values for timers are held in memory after the Work
Area, and thus for the following instruction, W500 to W511 will be transferred
to D00000 to D00011 and the present values for T0000 to T0007 will be transferred to D00012 to D00019.
Note Refer to the appendix Memory Map of PLC Memory Addresses for specific
PLC memory addresses.
&10
Number of words
First source word
First destination word
W500
to
W511
T0000
to
to
to
Transferred.
to
to
to
to
2-2-2Special Program Sections
CS/CJ-series programs have special program sections that will control
instruction conditions. The following special program sections are available.
Program sectionInstructionsInstruction conditionStatus
SubroutineSBS, SBN and RET instruc-
tions
IL - ILC sectionIL and ILC instructionsSection is interlockedThe output bits are turned
Step Ladder sectionSTEP S instructions and
STEP instructions
FOR-NEXT loopFOR instructions and NEXT
instructions
JMP0 - JME0 sectionJMP0 instructions and JME0
instructions
Block program sectionBPRG instructions and
BEND instructions
Subroutine program is executed.
Break in progress.Looping
Block program is executing.The block program listed in
The subroutine program section between SBN and RET
instructions is executed.
OFF and timers are reset.
Other instructions will not be
executed and previous status
will be maintained.
Jump
mnemonics between the
BPRG and BEND instructions is executed.
Instruction Combinations
The following table shows which of the special instructions can be used inside
other program sections.
Not possible.OKNot possible.Not possible.OKNot possible.
OKOKNot possible.OKOKNot possible.
OKOKOKNot possible.OKNot possible.
section
Step ladder
section
FOR - NEXT
loop
JMP0 - JME0
section
Block program
section
60
Page 97
PrecautionsSection 2-2
Note Instructions that specify program areas cannot be used for programs in other
tasks. Refer to
SubroutinesPlace all the subroutines together just before the END(001) instruction in all
programs but after programming other than subroutines. (Therefore, a subroutine cannot be placed in a step ladder, block program, FOR - NEXT, or JMP0 JME0 section.) If a program other than a subroutine program is placed after a
subroutine program (SBN to RET), that program will not be executed.
4-2-2 Task Instruction Limitations for details.
Program
Subroutine
Program
Instructions Not Available
in Subroutines
Note Block Program Sections
Subroutine
The following instructions cannot be placed in a subroutine.
FunctionMnemonicInstruction
Process Step ControlSTEP(008)Define step ladder section
SNXT(009)Step through the step lad-
der
A subroutine can include a block program section. If, however, the block program is in WAIT status when execution returns from the subroutine to the
main program, the block program section will remain in WAIT status the next
time it is called.
61
Page 98
PrecautionsSection 2-2
Instructions Not Available
in Step Ladder Program
Sections
FunctionMnemonicInstruction
Sequence ControlFOR(512), NEXT(513), and
BREAK(514)
END(001)END
IL(002) and ILC(003)INTERLOCK and INTER-
JMP(004) and JME(005)JUMP and JUMP END
CJP(510) and CJPN(511)CONDITIONAL JUMP and
JMP0(515) and JME0(516)MULTIPLE JUMP and MULTI-
SubroutinesSBN(092) and RET(093)SUBROUTINE ENTRY and
Block ProgramsIF(802) (NOT), ELSE(803),
and IEND(804)
BPRG(096) and BEND(801)BLOCK PROGRAM BEGIN/
EXIT(806) (NOT) CONDITIONAL BLOCK EXIT
LOOP(809) and LEND(810)
(NOT)
WAIT(805) (NOT)ONE CYCLE WAIT (NOT)
TIMW(813)TIMER WAIT
TMHW(815)HIGH-SPEED TIMER WAIT
CNTW(814)COUNTER WAIT
BPPS(811) and BPRS(812)BLOCK PROGRAM PAUSE
FOR, NEXT, and BREAK
LOOP
LOCK CLEAR
CONDITIONAL JUMP NOT
PLE JUMP END
SUBROUTINE RETURN
Branching instructions
END
(NOT)
Loop control
and RESTART
Note1. A step ladder program section can be used in an interlock section (be-
tween IL and ILC). The step ladder section will be completely reset when
the interlock is ON.
2. A step ladder program section can be used between MULTIPLE JUMP
(JMP0) and MULTIPLE JUMP END (JME0).
62
Page 99
PrecautionsSection 2-2
Instructions Not Available
in Block Program Sections
The following instructions cannot be placed in block program sections.
Classification by
Function
Sequence ControlFOR(512), NEXT(513),
and BREAK(514)
END(001)END
IL(002) and ILC(003)INTERLOCK and INTER-
JMP0(515) and JME0(516) MULTIPLE JUMP and
Sequence InputUP(521)CONDITION ON
DOWN(522)CONDITION OFF
Sequence OutputDIFUDIFFERENTIATE UP
DIFDDIFFERENTIATE DOWN
KEEPKEEP
OUTOUTPUT
OUT NOTOUTPUT NOT
Data ShiftSFTSHIFT
Ladder Step ControlSTEP(008) and
SNXT(009)
Data ControlPIDPID CONTROL
Block ProgramBPRG(096)BLOCK PROGRAM
Damage DiagnosisFPD(269)FAILURE POINT DETEC-
MnemonicInstruction
FOR, NEXT, and BREAK
LOOP
LOCK CLEAR
MULTIPLE JUMP END
and SUBROUTINE
RETURN
STEP DEFINE and STEP
START
BEGIN
TION
Note1. Block programs can be used in a step ladder program section.
2. A block program can be used in an interlock section (between IL and ILC).
The block program section will not be executed when the interlock is ON.
3. A block program section can be used between MULTIPLE JUMP (JMP0)
and MULTIPLE JUMP END (JME0).
4. A JUMP instruction (JMP) and CONDITIONAL JUMP instruction (CJP/
CJPN) can be used in a block program section. JUMP (JMP) and JUMP
END (JME) instructions, as well as CONDITIONAL JUMP (CJP/CJPN)
and JUMP END (JME) instructions cannot be used in the block program
section unless they are used in pairs. The program will not execute properly unless these instructions are paired.
63
Page 100
Checking ProgramsSection 2-3
2-3Checking Programs
CS/CJ-series programs can be checked at the following stages.
• Input check during Programming Console input operations
• Program check by CX-Programmer
• Instruction check during execution
• Fatal error check (program errors) during execution
2-3-1Errors during Programming Device Input
Programming Console
Errors at the following points will be displayed on the Programming Console
during input.
Error displayCause
CHK MEMPin 1 on the DIP switch on the CPU Unit is set to ON (write-protect).
IO No. ERRAn illegal I/O input has been attempted.
CX-Programmer
The program will be automatically checked by the CX-Programmer at the following times.
All operands for all instructions and all programming patterns
Models supported by the CS/CJ Series and all operands for all
instructions
Capacity, etc.
The results of checking are output to the text tab of the Output Window. Also,
the left bus bar of illegal program sections will be displayed in red in ladder
view.
2-3-2Program Checks with the CX-Programmer
The errors that are detected by the program check provided by the CX-Programmer are listed in the following table.
The CX-Programmer does not check range errors for indirectly addressed
operands in instructions. Indirect addressing errors will be detected in the program execution check and the ER Flag will turn ON, as described in the next
section. Refer to the CS/CJ-series Programmable Controllers InstructionsReference Manual (W340) for details.
When the program is checked on the CX-Programmer, the operator can specify program check levels A, B, and C (in order of the seriousness of the error),
as well as a custom check level.
AreaCheck
Illegal data: Ladder
diagramming
Instruction support
by PLC
Instruction locations
I/O lines
Connections
Instruction and operation completeness
Instructions and operands supported by PLC
Instruction variations (NOT, !, @, and %)
Object code integrity
64
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.