OMRON C20P, C28P, C40P, C60P User Manual

Cat. No. W168-E1-1B
SYSMAC Programmable Controllers
C20P/C28P/C40P/C60P
P–type Programmable Controllers
OPERATION MANUAL
Revised January 1997
Notice:
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 dam­age to the product.
DANGER! Indicates information that, if not heeded, is likely to result in loss of life or serious injury.
!
WARNING Indicates information that, if not heeded, could possibly result in loss of life or serious injury .
!
Caution Indicates information that, if not heeded, could result in relatively serious or minor injury,
!
damage to the product, or faulty operation.
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 “PC” means Programmable Controller and is not used as an abbreviation for any­thing else.
Visual Aids
The following headings appear in the left column of the manual to help you locate different types of information.
OMRON, 1989
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form, or by any means, mechanical, electronic, photocopying, recording, or otherwise, without the prior written permis­sion of OMRON.
No patent liability is assumed with respect to the use of the information contained herein. Moreover, because OMRON is constantly striving to improve its high–quality products, the information contained in this manual is subject to change without notice. Every precaution has been taken in the preparation of this manual. Nevertheless, OMRON assumes no responsibility for errors or omissions. Neither is any liability assumed for damages resulting from the use of the informa­tion contained in this publication.
Note Indicates information of particular interest for efficient and convenient operation
of the product.
1, 2, 3...
1. Indicates lists of one sort or another, such as procedures, checklists, etc.
About this Manual:
The OMRON P-type Programmable Controllers offer an effective way to automate processing. man­ufacturing, assembly, packaging, and many other processes can be automated to save time and money. Distributed control systems can also be designed to allow centralized monitoring and supervi­sion of several separate controlled systems. Monitoring and supervising can be done through a host computer, connecting the controlled system to a data bank. It is thus possible to have adjustments in system operation made automatically to compensate for requirement changes.
The P-type Units can utilize a number of additional Units including dedicated Special I/O Units that can be used for specific tacks and Link Units that can be used to build more highly integrated sys­tems.
The P-types are equipped with large programming instruction sets, data areas, and other features to control processing directly. Programming utilizes ladder-diagram programming methods, which are described in detail for those unfamiliar with them.
This manual describes the characteristics and abilities of the P-types, programming operations and instructions, and other aspects of operation and preparation that demand attention. Before attempting to operate the PC, thoroughly familiarize yourself with the information contained herein. Hardware information is provided in detail in the combination with this manual is provided at the end of
Installation Guide
. A table of other manuals that can be used in
Section 1 Background
.
Section 1 Precautions
The information contained in this section is important for the safe and reliable application of the PC. You must read this section and understand the information contained before attempt­ing to set up or operate a PC system.
Section 2 Background
programming. It also provides an overview of the process of programming and operating a PC and explains basic terminology used with OMRON PCs. Descriptions of peripheral devices used with the P-types and a table of other manuals available to use with this manual for special PC applications are also provided.
Section 3 Hardware Considerations
scribes the indicators that are referred to in other sections of this manual.
Section 4 Memory Areas
information provided there to aid in programming. It also explains how I/O is managed in memory and how bits in memory correspond to specific I/O points.
Section 5 Programming
ments that make up the ‘ladder’ part of a ladder-diagram program and explaining how execution of this program is controlled.
ection 6 Instruction Set
S
gramming.
Section 7 Program Execution Timing
and tells how to coordinate inputs and outputs so that they occur at the proper times.
provides general precautions for using the Programmable Controller (PC).
explains the background and some of the basic terms used in ladder-diagram
explains basic aspects of the overall PC configuration and de-
takes a look at the way memory is divided and allocated and explains the
explains the basics of ladder-diagram programming, looking at the ele-
then goes on to describe individually all of the instructions used in pro-
explains the scanning process used to execute the program
Section 8 Program Input, Debugging, and Execution
into mnemonic code so that it can be input into the CPU through a Programming Console. This sec­tion also provides the Programming Console procedures used to input and debug the program and to monitor and control system operation.
Section 9 Troubleshooting
ducing system down time. Information in this section is also necessary when debugging a program.
Appendice
The tables of instructions and Programming Console operations, and other information helpful in PC op­eration.
s provide tables of standard OMRON products available for the P-types, reference
provides information on system error indications and other means of re-
explains how to convert a ladder diagram
iii

TABLE OF CONTENTS

PRECAUTIONS ix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1 Intended Audience x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2 General Precautions x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3 Safety Precautions x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4 Operating Environment Precautions x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5 Application Precautions xi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SECTION 1 – Background 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1–1 Introduction 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1–2 Relay Circuits: The Roots of PC Logic 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1–3 PC Terminology 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1–4 OMRON Product Terminology 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1–5 Overview of PC Operation 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1–6 Peripheral Devices 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1–7 Available Manuals 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SECTION 2 – Hardware Considerations 9 . . . . . . . . . . . . . . . . . . . . . . . . . . .
2–1 Introduction 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2–2 Indicators 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2–3 PC Configuration 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SECTION 3 – Memory Areas 11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–1 Introduction 12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–2 Data Area Structure 12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–3 IR Area 15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–4 SR Area 24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–4–1 Battery Alarm Flag 24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–4–2 Scan Time Error Flag 24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–4–3 High-speed Drum Counter Reset 24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–4–4 Clock Pulse Bits 24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–4–5 Error Flag ER 25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–4–6 Always OFF and Always ON Flags 25 . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–4–7 First Scan Flag 25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–4–8 Arithmetic Flags 25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–5 DM Area 26 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–6 HR Area 26 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–7 TC Area 26 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–8 TR Area 27 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SECTION 4 – Programming 29 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4–1 Introduction 30 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4–2 Instruction Terminology 30 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4–3 The Ladder Diagram 30 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4–3–1 Basic Terms 31 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4–3–2 Ladder Instructions 32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4–3–3 Logic Block Instructions 33 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4–3–4 Branching Instruction Lines 34 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4–3–5 Jumps 39 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
v
Table of contents
4–4 Controlling Bit Status 40 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4–4–1 OUT and OUT NOT 40 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4–4–2 Differentiate Up and Differentiate Down 41 . . . . . . . . . . . . . . . . . . . . . .
4–4–3 Keep 41 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4–4–4 Self-maintaining Bits 42 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4–5 The End Instruction 42 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4–6 Programming Precautions 43 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4–7 Program Execution 44 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SECTION 5 – Instruction Set 45 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–1 Introduction 46 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–2 Notation 46 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–3 Instruction Format 46 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–4 Data Areas, Definer Values, and Flags 47 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–5 Ladder Diagram Instructions 47 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–5–1 Load, Load NOT, AND, AND NOT, OR, and OR NOT 48 . . . . . . . . . .
5–5–2 AND Load and OR Load 49 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–6 Bit Control Instructions 49 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–6–1 Output and Output NOT – OUT and OUT NOT 49 . . . . . . . . . . . . . . . . .
5–6–2 Differentiate Up and Down – DIFU(13) and DIFD(14) 50 . . . . . . . . . . .
5–6–3 Keep – KEEP(11) 51 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–7 Interlock and Interlock Clear – IL(02) and ILC(03) 53 . . . . . . . . . . . . . . . . . . . . . .
5–8 Jump and Jump End – JMP(04) and JME(05) 55 . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–9 End – END(01) 56 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–10 No Operation – NOP(00) 56 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–11 Timer and Counter Instructions 56 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–11–1 Timer – TIM 57 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–11–2 High-speed Timer – TIMH(15) 61 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–11–3 Analog Timer Unit 61 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–11–4 Counter – CNT 64 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–11–5 Reversible Counter – CNTR(12) 67 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–11–6 High-speed Counter – HDM(98) 68 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–12 Data Shifting 77 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–12–1 Shift Register – SFT(10) 78 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–12–2 Word Shift – WSFT(16) 80 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–13 Data Movement 81 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–13–1 Move – MOV(21) 81 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–13–2 Move NOT – MVN(22) 82 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–14 Data Compare – CMP(20) 82 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–15 Data Conversion 84 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–15–1 BCD to Binary – BIN(23) 84 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–15–2 Binary to BCD – BCD(24) 85 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–15–3 4-to-16 Decoder – MLPX(76) 85 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–15–4 16-to-4 Encoder – DMPX(77) 87 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–16 BCD Calculations 89 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–16–1 BCD Add – ADD(30) 90 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–16–2 BCD Subtract – SUB(31) 92 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–16–3 Set Carry – STC(40) 93 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5–16–4 Clear Carry – CLC(41) 93 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vi
SECTION 6 – Program Execution Timing 95 . . . . . . . . . . . . . . . . . . . . . . . . . .
6–1 Introduction 96 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–2 Scan Time 96 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–3 Calculating Scan Time 98 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–3–1 Single PC Unit 98 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–3–2 PC with Additional Units 99 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–4 Instruction Execution Times 100 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6–5 I/O Response Time 102 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table of contents
SECTION 7 – Program Input, Debugging and Execution 105 . . . . . . . . . . . . .
7–1 Introduction 106 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–2 Converting to Mnemonic Code 106 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–2–1 Program Memory Structure 106 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–2–2 Ladder Instructions 106 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–2–3 Logic Block Instructions 107 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–2–4 Coding Other Instructions 116 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–3 The Programming Console 121 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–3–1 The Keyboard 121 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–3–2 PC Modes 123 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–4 Preparation for Operation 124 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–4–1 Entering the Password 125 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–4–2 Clearing Memory 126 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–5 Inputting, Modifying, and Checking the Program 128 . . . . . . . . . . . . . . . . . . . . . . . .
7–5–1 Setting and Reading from Program Memory Address 128 . . . . . . . . . . . .
7–5–2 Inputting or Overwriting Programs 129 . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–5–3 Checking the Program 132 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–5–4 Displaying the Scan Time 133 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–5–5 Program Searches 134 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–5–6 Inserting and Deleting Instructions 136 . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–6 Program Backup and Restore Operations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–6–1Saving Program Memory Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–6–2Restoring or Comparing Program Memory Data. . . . . . . . . . . . . . . .
7–7 Debugging. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–8 Monitoring Operation and Modifying Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–8–1Bit/Digit Monitor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–8–2Force Set/Reset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–8–3Hexadecimal/BCD Data Modification. . . . . . . . . . . . . . . . . . . . . . . .
7–8–4Changing Timer/Counter SV. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
140
140
141 143 144
145
148
151
151
SECTION 8 – Troubleshooting 153 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8–1 Introduction 154 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8–2 Reading and Clearing Errors and Messages 154 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8–3 Error Messages 154 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8–4 Error Flags 156 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Appendix 157 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A – Standard Models 157 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B – Programming Instructions 165 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
C – Programming Console Operations 171 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
D – Error and Arithmetic Flag Operation 181 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E – Binary–Hexadecimal–Decimal Table 183 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
F – Word Assignment Recording Sheets 185 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
G – Program Coding Sheet 191 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Glossary 193 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Index 207 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vii

PRECAUTIONS

This section provides general precautions for using the Programmable Controller (PC) and related devices.
The information contained in this section is important for the safe and reliable application of the PC. You must read this section and understand the information contained before attempting to set up or operate a PC system.
1 Intended Audience x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2 General Precautions x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3 Safety Precautions x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4 Operating Environment Precautions x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5 Application Precautions xi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ix
Operating Environment Precautions
1 Intended Audience
This manual is intended for the following personnel, who must also have knowl­edge 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.
2 General 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 OMRON PCs. Be sure to read this manual before attempting to use the software and keep this manual close at hand for reference during operation.
WARNING It is extreme important that a PC and all PC Units be used for the specified
!
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 PC System to the abovementioned applications.
3 Safety Precautions
WARNING Never attempt to disassemble any Units while power is being supplied. Doing so
!
may result in serious electrical shock or electrocution.
WARNING Never touch any of the terminals while power is being supplied. Doing so may
!
result in serious electrical shock or electrocution.
4 Operating Environment Precautions
Do not operate the control system in the following places.
Where the PC is exposed to direct sunlight.
Where the ambient temperature is below 0°C or over 55°C.
Where the PC may be affected by condensation due to radical temperature
changes.
Where the ambient humidity is below 10% or over 90%.
Where there is any corrosive or inflammable gas.
Where there is excessive dust, saline air, or metal powder.
Where the PC is affected by vibration or shock.
Where any water, oil, or chemical may splash on the PC.
x
Application Precautions
Caution The operating environment of the PC System can have a large effect on the lon-
!
gevity and reliability of the system. Improper operating environments can lead to malfunction, failure, and other unforeseeable problems with the PC System. Be sure that the operating environment is within the specified conditions at installa­tion and remains within the specified conditions during the life of the system.
5 Application Precautions
Observe the following precautions when using the PC.
WARNING Failure to abide by the following precautions could lead to serious or possibly
!
fatal injury. Always heed these precautions.
Always ground the system to 100 or less when installing the system to pro- tect against electrical shock.
Always turn off the power supply to the PC before attempting any of the follow­ing. Performing any of the following with the power supply turned on may lead to electrical shock:
Mounting o r removing any Units (e.g., I/O Units, CPU Unit, etc.) or memory cassettes.
Assembling any devices or racks.
Connecting or disconnecting any cables or wiring.
Caution Failure to abide by the following precautions could lead to faulty operation or the
!
PC or the system or could damage the PC or PC Units. Always heed these pre­cautions.
Use the Units only with the power supplies and voltages specified in the opera­tion manuals. Other power supplies and voltages may damage the Units.
Take measures to stabilize the power supply to conform to the rated supply if it is not stable.
Provide circuit breakers and other safety measures to provide protection against shorts in external wiring.
Do not apply voltages exceeding the rated input voltage to Input Units. The Input Units may be destroyed.
Do not apply voltages exceeding the maximum switching capacity to Output Units. The Output Units may be destroyed.
Always disconnect the LG terminal when performing withstand voltage tests.
Install all Units according to instructions in the operation manuals. Improper
installation may cause faulty operation.
Provide proper shielding when installing in the following locations:
Locations subject to static electricity or other sources of noise.
Locations subject to strong electromagnetic fields.
Locations subject to possible exposure to radiation.
Locations near to power supply lines.
Be sure to tighten Backplane screws, terminal screws, and cable connector
screws securely.
Do not attempt to take any Units apart, to repair any Units, or to modify any Units in any way.
Caution The following precautions are necessary to ensure the general safety of the sys-
!
tem. Always heed these precautions.
Provide double safety mechanisms to handle incorrect signals that can be generated by broken signal lines or momentary power interruptions.
Provide external interlock circuits, limit circuits, and other safety circuits in addition to any provided within the PC to ensure safety.
xi
SECTION 1 Background
1–1 Introduction 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1–2 Relay Circuits: The Roots of PC Logic 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1–3 PC Terminology 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1–4 OMRON Product Terminology 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1–5 Overview of PC Operation 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1–6 Peripheral Devices 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1–7 Available Manuals 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1
Relay Circuits: The Roots of PC Logic Section 1–2
1–1 Introduction
A Programmable Controller (PC) is basically a central processing unit (CPU) containing a program and connected to input and output (I/O) devices (I/O Devices). The program controls the PC so that when an input signal from an input device turns ON, the appropriate response is made. The response nor­mally involves turning ON an output signal to some sort of output device. The input devices could be photoelectric sensors, pushbuttons on control panels, limit switches, or any other device that can produce a signal that can be input into the PC. The output devices could be solenoids, switches activating indi­cator lamps, relays turning on motors, or any other devices that can be acti­vated by signals output from the PC.
For example, a sensor detecting a product passing by turns ON an input to the PC. The PC responds by turning ON an output that activates a pusher that pushes the product onto another conveyor for further processing. An­other sensor, positioned higher than the first, turns ON a different input to indicate that the product is too tall. The PC responds by turning on another pusher positioned before the pusher mentioned above to push the too-tall product into a rejection box.
Although this example involves only two inputs and two outputs, it is typical of the type of control operation that PCs can achieve. Actually even this exam­ple is much more complex than it may at first appear because of the timing that would be required, i.e., “How does the PC know when to activate each pusher?” Much more complicated operations, however, are also possible. The problem is how to get the desired control signals from available inputs at appropriate times.
Desired control sequences are input to the P-type PCs using a form of PC logic called ladder-diagram programming. This manual is written to explain ladder-diagram programming and to prepare the reader to program and oper­ate the P-type PCs.
1–2 Relay Circuits: The Roots of PC Logic
PCs historically originate in relay-based control systems. And although the integrated circuits and internal logic of the PC have taken the place of the discrete relays, timers, counters, and other such devices, actual PC opera­tion proceeds as if those discrete devices were still in place. PC control, how­ever, also provides computer capabilities and consistency to achieve a great deal more flexibility and reliability than is possible with relays.
The symbols and other control concepts used to describe PC operation also come from relay-based control and form the basis of the ladder-diagram pro­gramming method. Most of the terms used to describe these symbols and concepts, however, originated as computer terminology.
Relay vs. PC Terminology
The terminology used throughout this manual is somewhat different from re­lay terminology, but the concepts are the same. The following table shows the relationship between relay terms and the PC terms used for OMRON PCs.
Relay term PC equivalent
contact input or condition coil output or work bit NO relay condition NC relay inverse condition
2
PC Terminology Section 1–3
Actually there is not a total equivalence between these terms, because the term condition is used only to describe ladder diagram programs in general and is specifically equivalent to one of certain basic instructions. The terms input and output are not used in programming per se, except in reference to I/O bits that are assigned to input and output signals coming into and leaving the PC. Conditions and inverse conditions are explained in
Diagram
.
4–3 The Ladder
1–3 PC Terminology
PC
Inputs and Outputs
Although also provided in the ing terms are crucial to understanding PC operation and are thus explained here as well.
When we refer to the PC, we are generally talking about the CPU and all of the Units directly controlled by it through the program. This does not include the I/O devices connected to PC inputs and outputs.
If you are not familiar with the terms used above to describe a PC, refer to
Hardware Considerations
A device connected to the PC that sends a signal to the PC is called an input device; the signal it sends is called an input signal. A signal enters the PC through terminals or through pins on a connector on a Unit. The place where a signal enters the PC is called an input point. This input point is allocated a location in memory that reflects its status, i.e., either ON or OFF. This mem­ory location is called an input bit. The CPU in its normal processing cycle monitors the status of all input points and turns ON and OFF corresponding input bits accordingly.
There are also output bits in memory that are allocated to output points on Units through which output signals are sent to output devices, i.e., an out­put bit is turned ON to send a signal to an output device through an output point. The CPU periodically turns output points ON and OFF according to the status of the output bits.
Glossary
for explanations.
at the back of this manual, the follow-
2
Controlled System and Control System
These terms are used when describing different aspects of PC operation. When programming, one is concerned with what information is held in mem­ory, and so I/O bits are referred to. When describing the Units that connect the PC to the controlled system and the places on these Units where signals enter and leave the PC, I/O points are referred to. When wiring these I/O points, the physical counterparts of the I/O points, either terminals or connec­tor pins, are referred to. When describing the signals that enter or leave the system, reference is made to input signals and output signals, or sometimes just inputs and outputs.
The Control System includes the PC and all I/O devices it uses to control an external system. A sensor that provides information to achieve control is an input device that is clearly part of the Control System. The controlled system is the external system that is being controlled by the PC program through these I/O devices. I/O devices can sometimes be considered part of the con­trolled system, e.g., a motor used to drive a conveyor belt.
3
Overview of PC Operation Section 1–5
1–4 OMRON Product Terminology
OMRON products are divided into several functional groups that have ge­neric names. A The term Unit is used to refer to all OMRON PC products, depending on the context.
The largest group of OMRON products is I/O Units. I/O Units come in a vari­ety of point quantities and specifications.
Special I/O Units are dedicated Units that are designed to meet specific needs. These include Analog Timer Units and Analog I/O Units.
Link Units are used to create Link Systems that link more than one PC or link a single PC to remote I/O points. Link Units include I/O Link Units that are used to connect P-type PCs to Remote I/O Systems controlled by a larg­er PC (e.g. C1000H) and Host Link Units.
Other product groups include Programming Devices, Peripheral Devices, and DIN Rail Products.
ppendix A Standard Models
list products by these groups.
1–5 Overview of PC Operation
The following are the basic steps involved in programming and operating a P-type PC. Assuming you have already purchased one or more of these PCs, you must have a reasonable idea of the required information for steps one and two, which are discussed briefly below. This manual is written to ex­plain steps three through six, eight, and nine. The section(s) of this manual that provide relevant information are listed with each of these steps.
1, 2, 3...
1. Determine what the controlled system must do, in what order, and at
what times.
2. Determine what Units will be required. Refer to the
a Link System is required, refer to the required
3. On paper, assign all input and output devices to I/O points on Units and
determine which I/O bits will be allocated to each. If the PC includes Special I/O Units or Link Systems, refer to the individual
or
Manuals Memory Areas)
4. Using relay ladder symbols, write a program that represents the se-
quence of required operations and their inter-relationships. Be sure to also program appropriate responses for all possible emergency situ­ations. (
Program Execution Timing)
5. Input the program and all required operating parameters into the PC.
Section 7 Program Input, Debugging, and Execution
(
6. Debug the program, first to eliminate any syntax errors and then to elim-
inate execution errors. (
cution
7. Wire the PC to the controlled system. This step can actually be started
as soon as step 3 has been completed. Refer to the and to Units.
8. Test the program in an actual control situation and fine tune it if required.
Section 7 Program Input, Debugging, and Execution
(
Troubleshooting
9. Record two copies of the finished program on masters and store them
safely in different locations. (
Execution
System Manuals
Section 4 Programming, Section 5 Instruction Set, Section 6
and
Section 8 Troubleshooting
Operation Manuals
)
)
for details on I/O bit allocation. (
Section 7 Program Input, Debugging, and Exe-
)
and
System Manuals
Section 7 Program Input, Debugging, and
Installation Guide
System Manual(s)
Operation
Section 3
)
Installation Guide
for details on individual
and
Section 8
. If
.
4
Overview of PC Operation Section 1–5
Control System Design
Input/Output Requirements
Sequence, Timing, and Relationships
Designing the Control System is the first step in automating any process. A PC can be programmed and operated only after the overall Control System is fully understood. Designing the Control System requires a thorough under­standing of the system that is to be controlled. The first step in designing a Control System is thus determining the requirements of the controlled sys­tem.
The first thing that must be assessed is the number of input and output points that the controlled system will require. This is done by identifying each device that is to send an input signal to the PC or which is to receive an output sig­nal from the PC. Keep in mind that the number of I/O points available de­pends on the configuration of the PC. Refer to capacity and assigning I/O bits to I/O points.
Next, determine the sequence in which control operations are to occur and the relative timing of the operations. Identify the physical relationships be­tween the I/O devices as well as the kinds of responses that should occur between them.
For instance, a photoelectric switch might be functionally tied to a motor by way of a counter within the PC. When the PC receives an input from a start switch, it could start the motor. The PC could then stop the motor when the counter has received five input signals from the photoelectric switch.
Each of the related tasks must be similarly determined, throughout the entire control operation.
3–3 IR Area
for details on I/O
Unit Requirements
The actual Units that will be mounted must be determined according to the requirements of the I/O devices. This will include actual hardware specifica­tions, such as voltage and current levels, as well as functional considera­tions, such as those that require Special I/O Units or Link Systems. In many cases, Special I/O Units or Link Systems can greatly reduce the program­ming burden. Details on these Units and Link Systems are available in indi-
Operation Manuals
vidual Once the entire Control System has been designed, the task of program-
ming, debugging, and operation as described in the remaining sections of this manual can begin.
and
System Manuals.
5
Peripheral Devices Section 1–6
1–6 Peripheral Devices
The following peripheral devices can be used in programming, either to input/ debug/monitor the PC program or to interface the PC to external devices to output the program or memory area data. Model numbers for all devices listed below are provided in names have been placed in bold when introduced in the following descrip­tions.
Appendix A Standard Models
. OMRON product
Programming Console
Graphic Programming Console: GPC
Ladder Support Software: LSS
Factory Intelligent Terminal: FIT
A Programming Console is the simplest form of programming device for OM­RON PCs. Although a Programming Console Adapter is sometimes re­quired, all Programming Consoles are connected directly to the CPU without requiring a separate interface. The Programming Console also functions as an interface to output programs to a standard cassette tape recorder.
Various types of Programming Console are available, including both CPU-mounting and Hand-held models. Programming Console operations are described later in this manual.
A Peripheral Interface Unit is required to interface the GPC to the PC. The GPC also functions as an interface to output programs directly to a stan-
dard cassette tape recorder. A PROM Writer, Floppy Disk Interface Unit, or Printer Interface Unit can be directly mounted to the GPC to output pro­grams directly to an EPROM chip, floppy disk drive, or printing device.
LSS is designed to run on IBM AT/XT compatibles to enable nearly all of the operations available on the GPC. It also offers extensive documentation ca­pabilities.
A Host Link Unit is required to interface a computer running LSS to the PC.
The FIT is an OMRON computer with specially designed software that allows you to perform all of the operations that are available with the GPC or LSS. Programs can also be output directly to an EPROM chip, floppy disk drive, or printing device without any additional interface units. The FIT has an EPROM writer and a 3.5” floppy disk drive built in.
PROM Writer
Floppy Disk Interface Unit
Printer Interface Unit
6
A Peripheral Interface Unit or Host Link Unit is required to interface the FIT to the PC. Using an Optical Host Link Unit also enables the use of optical fiber cable to connect the FIT to the PC. Wired Host Link Units are available when desired. (Although FIT does not have optical connectors, conversion to optical fiber cable is possible by using Converting Link Adapters.)
Other than its applications described above, the PROM Writer can be mounted to the PC’s CPU to write programs to EPROM chips.
Other than its applications described above, the Floppy Disk Interface Unit can be mounted to the PC’s CPU to interface a floppy disk drive and write programs onto floppy disks.
Other than its applications described above, the Printer Interface Unit can be mounted to the PC’s CPU to interface a printer or X–Y plotter to print out pro­grams in either mnemonic or ladder-diagram form.
Available Manuals Section 1–7
1–7 Available Manuals
The following table lists other manuals that may be required to program and/ or operate the P-type PCs.
Operation Manuals
also provided with individual Units and are required for wiring and other specifications.
Name Cat. no. Contents
Installation Guide W167 Hardware specifications GPC Operation Manual W84 Programming procedures for the GPC (Graphics Program-
ming Console)
FIT Operation Manual W150 Programming procedures for using the FIT (Factory Intelligent
Terminal
LSS Operation Manual W113 Programming procedures for using LSS (Ladder Support Soft-
ware) Printer Interface Unit Operation Guide W107 Procedures for interfacing a PC to a printer PROM Writer Operation Guide W155 Procedures for writing programs to EPROM chips Floppy Disk Interface Unit Operation Guide W119 Procedures for interfacing a PC to a floppy disk drive Optical Remote I/O System Manual W136 Information on building an Optical Remote I/O System to en-
able remote I/O capability Host Link System Manual W143 Information on building a Host Link System to manage PCs
from a ‘host’ computer K-type Analog I/O Units Operation Guide W122 Hardware and software information on using Analog I/O Units
with the P-type PCs.
and/or
Operation Guides
are
7

SECTION 2

Hardware Considerations
2–1 Introduction 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2–2 Indicators 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2–3 PC Configuration 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9
PC Configuration Section 2–3
2–1 Introduction
This section provides information on hardware aspects of P-type PCs that are relevant to programming and software operation. These include indica­tors on the CPU and basic PC configuration. This information is covered in detail in the
Installation Guide
.
2–2 Indicators
CPU indicators provide visual information on the general operation of the PC. Using the flags and other error indicators provided in the memory data areas, although not a substitute for proper error programming, provides ready confirmation of proper operation.
CPU Indicators
CPU indicators are located on the front right hand side of the PC adjacent to the I/O expansion slot and are described in the following table.
Indicator Function
POWER Lights when power is supplied to the CPU. RUN Lights when the CPU is operating normally . ERR Lights when an error is discovered in system error diagnosis op-
ALARM Lights when an error is discovered in system error diagnosis op-
2–3 PC Configuration
The Units from which P-type PCs can be built are shown below.
Unit type Name Words
CPU C20P 2 12 points 8 points
Expansion I/O Unit C4K 2 4 input points or 4 output points
Special I/O Units Analog Timer Unit 2 4 timer inputs
erations. When this indicator lights, the RUN indicator will go off, CPU operation will be stopped, and all outputs from the PC will be turned OFF.
erations. PC operation will continue.
Inputs
occupied
C28P 2 16 points 12 points C40P 4 24 points 16 points C60P 4 32 points 24 points
C20P 2 12 points 8 points C28P 2 16 points 12 points C40P 4 24 points 16 points C60P 4 32 points 24 points
C4K Analog Input Unit 2 4 analog inputs C1K Analog Input Unit 2 1 analog input Analog Output Unit 2 1 analog output I/O Link Unit 2 16 input and 16 output bits
provided
Outputs
provided
10
Each PC is connected in series starting with a CPU and, if required, continu­ing on with Expansion I/O or Special I/O Units. All other Units are connected in series following the CPU and can be in any order desired except for the I/O Link Unit, which must always come last. Up to five Units, including the CPU can be connected as long as the total number of words occupied does not exceed ten. Refer to
Section 3–3 IR Area
for configuration examples.

SECTION 3

Memory Areas
3–1 Introduction 12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–2 Data Area Structure 12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–3 IR Area 15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–4 SR Area 24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–4–1 Battery Alarm Flag 24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–4–2 Scan Time Error Flag 24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–4–3 High-speed Drum Counter Reset 24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–4–4 Clock Pulse Bits 24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–4–5 Error Flag ER 25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–4–6 Always OFF and Always ON Flags 25 . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–4–7 First Scan Flag 25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–4–8 Arithmetic Flags 25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–5 DM Area 26 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–6 HR Area 26 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–7 TC Area 26 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–8 TR Area 27 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11
Data Area Structure Section 3–2
3–1 Introduction
Various types of data are required to achieve effective and correct control. To facilitate managing this data, the PC is provided with various memory areas for data, each of which performs a different function. The areas generally ac­cessible by the user for use in programming are classified as data areas. The other memory area is the Program Memory, where the user’s program is actually stored.
This section describes these areas individually and provides information that will be necessary to use them. The name, acronym, range, and function of each area are summarized in the following table. All but the last one of these are data areas. All memory areas are normally referred to by their acronyms.
Area
Internal Relay area
Special Relay area
Data Memory area
Holding Relay area
Timer/Counter area
Temporary Relay area
Program Memory
Acronym
IR
SR
DM
HR
TC
TR
UM
Work Bits and Words
Range
Words: 00 to 18 (right half) Bits: 0000 to 1807
Words: 18 (left half) and 19 Bits: 1808 to 1907
DM 00 to DM 63 (words only)
Words: HR 0 to HR 9 Bits: HR 000 to HR 915
TC 00 to TC 47 (TC numbers are used to access other information)
TR 00 to TR 07 (bits only)
UM: 1,194 words.
Function
Used to manage I/O points, control other bits, timers, and counters, to temporarily store data.
Contains system clocks, flags, control bits, and status information.
Used for internal data storage and manipulation.
Used to store data and to retain the data values when the power to the PC is turned off.
Used to define timers and counters and to ac­cess Completion Flags, PV, and SV for them.
Used to temporarily store execution conditions.
Contains the program executed by the CPU.
When some bits and words in certain data areas are not used for their in­tended purpose, they can be used in programming as required to control other bits. Words and bits available for use in this fashion are called work bits and work words. Most, but not all, unused bits can be used as work bits. Those that can be are specified by area in the remainder of this section. Ac­tual application of work bits and work words is described in
gramming
.
Section 4 Pro-
Flags and Control Bits
Some data areas contain flags and/or control bits. Flags are bits that are automatically turned ON and OFF to indicate status of one form or another. Although some flags can be turned ON and OFF by the user, most flags can be read only; they cannot be controlled directly.
Control bits are bits turned ON and OFF by the user to control specific as­pects of operation. Any bit given a name using the word bit rather than the word flag is a control bit, e.g., Restart Bits are control bits.
3–2 Data Area Structure
When designating a data area, the acronym for the area is always required for any but the IR and SR areas. Although the acronyms for the IR and SR areas are often given for clarity, they are not required and not input when programming. Any data area designation without an acronym is assumed to be in either the IR and SR area. Because IR and SR addresses run consecu­tively, the word or bit addresses are sufficient to differentiate these two areas.
12
Data Area Structure Section 3–2
An actual data location within any data area but the TC area is designated by its address. The address designates the bit and/or word within the area where the desired data is located. The TR area consists of individual bits used to store execution conditions at branching points in ladder diagrams. The use of TR bits is described in
Section 4 Programming.
sists of TC numbers, each of which is used for a specific timer or counter de­fined in the program. Refer to and to
5–11 Timer and Counter Instructions
3–7 TC Area
for more details on TC numbers
for information on actual applica-
tion. The rest of the data areas (i.e., the IR, SR, HR and DM areas) consist of
words, each of which consists of 16 bits numbered 00 through 15 from right to left. IR words 00 and 01 are shown below with bit numbers. Here, the con­tent of each word is shown as all zeros. Bit 00 is called the rightmost bit; bit 15, the leftmost bit.
The TC area con-
Bit number IR word 00 0000000000000000 IR word 01 0000000000000000
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
The term least significant is often used for rightmost; the term most signifi-
Note
cant, for leftmost. These terms have not been used in this manual because a single word is often split into two or more parts, with each part used for differ­ent parameters or operands, sometimes even with bits in another word. When this is done, the rightmost bits in a word may actually be the most sig­nificant bits, i.e., the leftmost bits, of a value with other bits, i.e., the least sig­nificant bits, contained in another word.
The DM area is accessible by word only; you cannot designate an individual bit within a DM word. Data in the IR, SR and HR areas is accessible either by bit or by word, depending on the instruction in which the data is being used.
To designate one of these areas by word, all that is necessary is the acronym (if required) and the one or two-digit word address. To designate an area by bit, the word address is combined with the bit number as a single three- or four-digit address. The examples in the following table should make this clear. The two rightmost digits of a bit designation must indicate a bit be­tween 00 and 15.
The same TC number can be used to designate either a word containing the present value (PV) of the timer or counter or a bit that functions as the Com­pletion Flag for the timer or counter. This is explained in more detail in
TC Area
Area Word designation Bit designation
IR 00 0015 (leftmost bit in word 00) SR 19 1900 (rightmost bit in word 19) DM DM 10 Not possible TC TC 46 (designates PV) TC 46 (designates Completion Flag)
.
3–7
13
Data Area Structure Section 3–2
Data Structure
Digit number 3210
Bit number Contents 0000000000000000
Word data input as decimal values is stored in binary-coded decimal (BCD) code; word data input as hexadecimal is stored in binary form. Because each word contains 16 bits, each four bits of a word represents one digit: either a hexadecimal digit equivalent numerically to the binary bits or decimal. One word of data thus contains four digits, which are numbered from right to left. These digit numbers and the corresponding
bit numbers for one word are shown below.
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
When referring to the entire word, the digit numbered 0 is called the right­most digit; the one numbered 3, the leftmost digit.
A piece of data in memory does not necessarily require exactly one word. If a piece of data is in 3-digit BCD, for example, only 12 bits will be required to express it (see decimal point example below). These would most likely be in the same word and occupy either the rightmost or leftmost three digits. Data requiring more than four digits must be split between words: sometimes be­tween two whole words and sometimes between one word and part of an­other word.
Converting Different Forms of Data
When inputting data into data areas, it must be input in the proper form for the intended purpose. This is no problem when designating individual bits, which are merely turned ON (equivalent to a binary value of 1) or OFF (a bi­nary value of 0). When inputting word data, however, it is important to input it either as decimal or as hexadecimal, depending on what is called for by the instruction it is to be used for.
Section 5 Instruction Set
specifies when a par-
ticular form of data is required for an instruction.
Binary and hexadecimal can be easily converted back and forth because each four bits of a binary number is numerically equivalent to one digit of a hexadecimal number. The binary number 0101111101011111 is converted to hexadecimal by considering each set of four bits in order from the right. Bi­nary 1111 is hexadecimal F; binary 0101 is hexadecimal 5. The hexadecimal
3
equivalent would thus be 5F5F, or 24,415 in decimal (16
x 5 + 162 x 15 + 16
x 5 + 15). Decimal and BCD can also be easily converted back and forth. In this case,
each BCD digit (i.e., each four BCD bits) is numerically equivalent of the cor­responding decimal digit. The BCD bits 0101011101010111 are converted to decimal by considering each four bits from the right. Binary 0101 is decimal 5; binary 0111 is decimal 7. The decimal equivalent would thus be 5,757. Note that this is not the same numeric value as the hexadecimal equivalent of 0101011101010111, which would be 5,757 hexadecimal, or 22,359 in deci-
3
mal (16
x 5 + 162 x 7 + 16 x 5 + 7).
14
Because the numeric equivalent of each four BCD binary bits must be equivalent to a decimal value, any four bit combination numerically greater then 9 cannot be used, e.g., 1011 is not allowed because it is numerically equivalent to 11, which cannot be expressed as a single digit in decimal nota­tion. The binary bits 1011 are of course allowed in hexadecimal and they are equivalent to the hexadecimal digit C.
IR Area Section 3–3
There are instructions provided to convert data in either direction between BCD and hexadecimal. Refer to
5–15 Data Conversion
binary equivalents to hexadecimal and BCD digits are provided in the appen­dices for reference.
for details. Tables of
Decimal Points
Digits Not used here. 1 5 4
Bit number Contents 000101010100
3–3 IR Area
Decimal points are also not stored directly in memory, although some of the parameters contained in data areas have assumed decimal points. For ex­ample, if a value is said to be in 3-decimal hexadecimal to the tenths of an second and it occupies the rightmost three digits in a specified word (i.e., bits 00 through 11), the rightmost digit (bits 00 through 03) would contain tenths of a second and the other two digits would contain the number of whole sec­onds. If the value was 15.4 decimal, the corresponding BCD bits in memory would be as shown below.
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
The IR area is used both to control I/O points and as work bits to manipulate and store data internally. It is accessible both by bit and by word. Those words that can be used to control I/O points are called I/O words. Bits in I/O words are called I/O bits.
The number of I/O words varies between the P-type PCs. As shown, the IR area is comprised of three main sections. These are input words, output words and work words (work bits). Work bits are used in programming to ma­nipulate data and control other bits. IR area work bits are reset when power is interrupted or PC operation is stopped.
I/O Words
Input Bit Usage
Word type I/O words I/O bits
Input IR 00
through IR 04
Output IR 05
through IR 09
Work IR 10
through IR 18
I/O bits are assigned to input or output points as described in
.
tions
IR 0000 through IR 0415
IR 0500 through IR 0915
IR 1000 through IR 1807
Word Alloca-
If a Unit brings inputs into the PC, the bit assigned to it is an input bit; if the Unit sends an output from the PC, the bit is an output bit. To turn on an out­put, the output bit assigned to it must be turned ON. When an input turns on, the input bit assigned to it also turns ON. These facts can be used in the pro­gram to access input status and control output status through I/O bits.
I/O bits that are not assigned to I/O points can be used as work bits, unless otherwise specified in
Word Allocations
.
Input bits can directly input external signals to the PC and can be used in any order in programming. Each input bit can also be used in as many instruc-
15
IR Area Section 3–3
tions as required to achieve effective and proper control. They cannot be used in instructions that control bit status, e.g., the Output, Differentiation Up, and Keep instructions.
Output Bit Usage
Word Allocations
Output bits are used to output program execution results and can be used in any order in programming. Because outputs are refreshed only once during each scan (i.e., once each time the program is executed), any output bit can be used only one instruction that controls its status, including OUT, KEEP(11), DIFU(13), DIFD(14) and SFT(10). If an output bit is used in more than one such instruction, only the status determined by the last one will ac­tually be output from the PC.
As outputs are refreshed only once during each scan (i.e. once each time the program is executed), any output bit can be used in only one instruction that controls its status, including OUT, OUT NOT, KEEP(11), DIFU(13), DIFD(14), and SFT(10). If an output bit is used in more than one such instruction, only the status determined by the last instruction will actually be output from the PC. See
The maximum number of words available for I/O within the IR area is 10, numbered 00 through 09. The remaining words (10 through 18) are to be used for work bits. (Note that with word 18, only the bits 00 through 07 are available for work bits although some of the remaining bits are required for special purposes when RDM(98) is used).
The actual number of bits that can be used as I/O bits is determined by the model of the CPU and the PC configuration. There are different models of Expansion I/O Units and Special I/O Units and I/O Link Units which can be connected to any of the CPUs. Each CPU model provides a particular num­ber of I/O bits and each Expansion I/O Unit, Special I/O Unit or I/O Link Unit provides a particular number of I/O bits. Configuration charts for the possible combinations of CPUs and Units are included later in this section. Refer to those to determine the actual available I/O bits.
5–12–1 Shift Register – SFT(10)
for an exception to this rule.
With P-type PCs, IR 00 through IR 04 are always input bits and IR 05 through IR 09 are always outputs bits. These are allocated in order from IR 00 (input) and IR 05 (output) beginning from the CPU. Each Unit is allocated either one input word and one output word or, for the C40P/C60P Units, two input words and two output words. If the words or bits within a word are not need by the Unit, they are not allocated to any other Unit. Unallocated input bits cannot be used for any purpose, but unallocated output bits can be used in program­ming as work bits.
16
IR Area Section 3–3
I/O Bits Available in CPUs
Model Input bits
C20K
C28K
C40K
C60K
The following table shows which bits can be used as I/O bits in each of the P-type CPUs. Bits in the shaded areas can be used as work bits but not as output bits. IR 0000 and IR 0001 are used by HDM(98).
Output bits
IR 00
IR 00
IR 00
IR 00
Cannot be used
IR 01
IR 01
Cannot be used
IR 05
IR 05
IR 05
IR 05
IR 06
IR 06
17
IR Area Section 3–3
I/O Bits Available in Expansion I/O Units
The following table shows which bits can be used as I/O bits in each of the Expansion I/O Units. Bits in the shaded areas can be used as work bits but not as output bits. The word addresses depend on the Unit(s) that the Expan­sion I/O Unit is coupled to. In all cases the first Expansion I/O Unit address for input and output words is one more than the last address for input and output words used by the Unit to which the Expansion I/O Unit is attached. For example, if the last word address was IR 03, the first input or output word address for the Expansion I/O Units will be IR 04. In the tables below “n” is the word allocated prior to the Expansion I/O Unit.
Model Input bits Output bits Model Input bits Output bits
IR (n + 1)
IR (n + 1)
Cannot be used
IR (n + 1)
Cannot be used
IR (n + 1)
Cannot be used
IR (n + 6)
11
11
IR (n + 6)
11
IR (n + 6)
11
IR (n + 6)
11
C20P
C28P
C40P
C60P
IR (n+1)
IR (n+1)
IR (n+1)
IR (n+1)
Cannot be used
IR (n + 2)
IR (n + 2)
Cannot be used
11 12 13 14 15
IR (n + 6)
IR (n + 6)
IR (n + 6)
IR (n + 6)
IR (n + 4)
IR (n + 4)
11 12 13 14 15
11 12 13 14 15
C16P Input
C16P Output
C4K Input
C4K Output
18
IR Area Section 3–3
I/O Bits Available in Special I/O Units
The following table shows which bits are allocated to each of the Special I/O Units. Bits in the shaded areas can be used as work bits but not as output bits. The word addresses depend on the Unit(s) that the Special I/O Unit is coupled to. In all cases the first Special I/O Unit address for input and output words is one more than the last address for input and output words used by the Unit to which the Special I/O Unit is attached. For example, if the last word address was IR 03, the first input or output word address for the Special I/O Units will be IR 04. In the tables below “n” is the word allocated prior to the Special I/O Unit.
Model Input bits Output bits
C1K–AD
C4K–AD
C1K–DA
C20–LK 011(–P)
C4K–TM
IR (n + 1)
IR (n + 1)
IR (n + 1)
Cannot be used
IR (n + 1)
IR (n + 1)
Cannot be used
Cannot be used
11 12 13 14 15
IR (n + 6)
IR (n + 6)
IR (n + 6)
IR (n + 6)
IR (n + 6)
PC Configuration and I/O Word Allocation
A P-type PC consists of a CPU Unit plus one or more of the following Units: Expansion I/O Units, Analog Timer Units, Analog I/O Units, or an I/O Link Unit. All of these Units are connected in series with the CPU Unit at one end. An I/O Link Unit, if included, must be on the other end (meaning only one I/O
19
IR Area Section 3–3
Link Unit can be used) and an Analog Timer Unit cannot be used with. The rest of the Units can be in any order desired.
The tables on the following pages show the possible configurations for a P-type PC. Although the tables branch to show the various possibilities at any one point, there can be no branching in the actual PC connections. You can choose either branch at any point and go as far as required, i.e., you can break off at any point to create a smaller PC System.When implementing a system there is a physical restriction on the total cable length allowable. The sum of the lengths of all cables in the system must be limited to less than 1.2 meters.
The tables also show which words will be input words and which words will be output words. All of these are determined by the position of the Unit. With the C4P and C16P Expansion I/O Units, the type of Unit (input or output) de­termines whether the input or output word is used.
The symbols used in the table represent the following:
C20P/C28P
Input Output
C40P/C60P
Input Output
C4K/C16P
Input or Output
C20P/C28P/TU/AN/LU
Input Output
C20P or C28P CPU Unit
Input Output
C40P or C60P CPU or Expansion I/O Unit
C4K or C16P Expansion I/O Unit
C20P Expansion I/O Unit, C28P Expansion I/O Unit, Analog Timer Unit, Analog I/O Unit, or I/O Link Unit
20
IR Area Section 3–3
IR 00 IR 05 IR 01 IR 06 IR 02 IR 07 IR 03 IR 08 IR 04 IR 09
C20P/C28P
Input Output
C4K/C16P
Input or Output
C4K/C16P
Input or Output
C20P/C28P/TU/AN/LU
Input Output
C4K/C16P
Input or Output
C4K/C16P
Input or Output
C20P/C28P/TU/AN/LU
Input Output
C20P/C28P/TU/AN/LU
Input Output
C4K/C16P
Input or Output
C20P/C28P/TU/AN/LU
Input Output
C40P/C60P
Input Output Input Output
C4K/C16P
Input or Output
C4K/C16P
Input or Output
C20P/C28P/TU/AN/LU
Input Output
C20P/C28P/TU/AN/LU
Input Output
C4K/C16P
Input or Output
C20P/C28P/TU/AN/LU
Input Output
C20P/C28P/TU/AN/LU
Input Output
Input Output Input Output
C40P/C60P
Input Output Input Output
C4K/C16P
Input or Output
C4K/C16P
Input or Output
C20P/C28P/TU/AN/LU
Input Output
Input Output Input Output
C40P/C60P
C4K/C16P
Input or Output
C20P/C28P/TU/AN/LU
Input Output
C4K/C16P
Input or Output
C20P/C28P/TU/AN/LU
Input Output
C4K/C16P
Input or Output
C20P/C28P/TU/AN/LU
Input Output
C40P/C60P
21
Loading...
+ 181 hidden pages