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 the product.
DANGER!Indicates information that, if not heeded, is likely to result in loss of life or serious injury.
!
WARNINGIndicates information that, if not heeded, could possibly result in loss of life or serious injury .
!
CautionIndicates 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 anything 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 permission of OMRON.
No patent liability is assumed with respect to the use of the information contained herein. Moreover, because OMRON is
constantly striving to improve its high–quality products, the information contained in this manual is subject to change
without notice. Every precaution has been taken in the preparation of this manual. 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.
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.
ii
About this Manual:
The OMRON P-type Programmable Controllers offer an effective way to automate processing. manufacturing, 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 supervision 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 systems.
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 attempting 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 section 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 operation.
s provide tables of standard OMRON products available for the P-types, reference
provides information on system error indications and other means of re-
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.
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 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.
4
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.
3Safety 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.
4Operating 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
CautionThe 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 installation and remains within the specified conditions during the life of the system.
5Application 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 following. 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.
5
CautionFailure 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 precautions.
• Use the Units only with the power supplies and voltages specified in the operation 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.
CautionThe 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.
A Programmable Controller (PC) is basically a central processing unit (CPU)
containing a program and connected to input and output (I/O) devices (I/ODevices). The program controls the PC so that when an input signal from an
input device turns ON, the appropriate response is made. The response normally 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 indicator lamps, relays turning on motors, or any other devices that can be activated 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. Another 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 example 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 operate the P-type PCs.
1–2Relay 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 operation proceeds as if those discrete devices were still in place. PC control, however, 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 programming 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 relay 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 termPC equivalent
contactinput or condition
coiloutput or work bit
NO relaycondition
NC relayinverse condition
2
PC TerminologySection 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–3PC 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 inputdevice; 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 memory location is called an inputbit. 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 output 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 memory, 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 connector 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 controlled system, e.g., a motor used to drive a conveyor belt.
3
Overview of PC OperationSection 1–5
1–4OMRON Product Terminology
OMRON products are divided into several functional groups that have generic 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 variety 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 larger 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–5Overview 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 explain 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 situations. (
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
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 understanding of the system that is to be controlled. The first step in designing a
Control System is thus determining the requirements of the controlled system.
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 signal from the PC. Keep in mind that the number of I/O points available depends 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 between 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 specifications, such as voltage and current levels, as well as functional considerations, 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 programming 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 DevicesSection 1–6
1–6Peripheral 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 descriptions.
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 OMRON PCs. Although a Programming Console Adapter is sometimes required, 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, orPrinter Interface Unit can be directly mounted to the GPC to output programs 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 capabilities.
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 programs in either mnemonic or ladder-diagram form.
Available ManualsSection 1–7
1–7Available 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.
NameCat. no. Contents
Installation GuideW167Hardware specifications
GPC Operation ManualW84Programming procedures for the GPC (Graphics Program-
ming Console)
FIT Operation ManualW150Programming procedures for using the FIT (Factory Intelligent
Terminal
LSS Operation ManualW113Programming procedures for using LSS (Ladder Support Soft-
ware)
Printer Interface Unit Operation GuideW107Procedures for interfacing a PC to a printer
PROM Writer Operation GuideW155Procedures for writing programs to EPROM chips
Floppy Disk Interface Unit Operation GuideW119Procedures for interfacing a PC to a floppy disk drive
Optical Remote I/O System ManualW136Information on building an Optical Remote I/O System to en-
able remote I/O capability
Host Link System ManualW143Information on building a Host Link System to manage PCs
from a ‘host’ computer
K-type Analog I/O Units Operation GuideW122Hardware and software information on using Analog I/O Units
This section provides information on hardware aspects of P-type PCs that
are relevant to programming and software operation. These include indicators on the CPU and basic PC configuration. This information is covered in
detail in the
Installation Guide
.
2–2Indicators
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.
IndicatorFunction
POWERLights when power is supplied to the CPU.
RUNLights when the CPU is operating normally .
ERRLights when an error is discovered in system error diagnosis op-
ALARMLights when an error is discovered in system error diagnosis op-
2–3PC Configuration
The Units from which P-type PCs can be built are shown below.
Unit typeNameWords
CPUC20P212 points8 points
Expansion I/O UnitC4K24 input points or 4 output points
Special I/O UnitsAnalog Timer Unit24 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.
C4K Analog Input Unit 24 analog inputs
C1K Analog Input Unit 21 analog input
Analog Output Unit21 analog output
I/O Link Unit216 input and 16 output bits
provided
Outputs
provided
10
Each PC is connected in series starting with a CPU and, if required, continuing 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
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 accessible 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 access 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 intended 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. Actual 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 aspects 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–2Data 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 consecutively, the word or bit addresses are sufficient to differentiate these two areas.
12
Data Area StructureSection 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 defined 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 content 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 000000000000000000
IR word 010000000000000000
15141312111009080706050403020100
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 different 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 significant bits, i.e., the leftmost bits, of a value with other bits, i.e., the least significant 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 between 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 Completion Flag for the timer or counter. This is explained in more detail in
TC Area
AreaWord designationBit designation
IR000015 (leftmost bit in word 00)
SR191900 (rightmost bit in word 19)
DMDM 10Not possible
TCTC 46 (designates PV)TC 46 (designates Completion Flag)
.
3–7
13
Data Area StructureSection 3–2
Data Structure
Digit number3210
Bit number
Contents0000000000000000
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.
15141312111009080706050403020100
When referring to the entire word, the digit numbered 0 is called the rightmost 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 between two whole words and sometimes between one word and part of another 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 binary 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. Binary 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 corresponding 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 notation. The binary bits 1011 are of course allowed in hexadecimal and they are
equivalent to the hexadecimal digit C.
IR AreaSection 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 appendices for reference.
for details. Tables of
Decimal Points
Digits Not used here.154
Bit number
Contents000101010100
3–3IR Area
Decimal points are also not stored directly in memory, although some of the
parameters contained in data areas have assumed decimal points. For example, 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 seconds. If the value was 15.4 decimal, the corresponding BCD bits in memory
would be as shown below.
15141312111009080706050403020100
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 manipulate 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 typeI/O wordsI/O bits
InputIR 00
through IR
04
OutputIR 05
through IR
09
WorkIR 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 output, 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 program 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 AreaSection 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 actually 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 number 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 programming as work bits.
16
IR AreaSection 3–3
I/O Bits Available in CPUs
ModelInput 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
00
01
02
03
04
05
06
07
IR 00
00
01
02
03
04
05
06
07
IR 00
00
01
02
03
04
05
06
07
IR 00
00
01
02
03
04
05
06
07
08
09
10
11
Cannot
be used
08
09
10
11
12
13
14
15
08
09
10
11
12
13
14
15
08
09
10
11
12
13
14
15
IR 01
00
01
02
03
04
05
06
07
IR 01
00
01
02
03
04
05
06
07
Cannot
be used
08
09
10
11
12
13
14
15
IR 05
00
01
02
03
04
05
06
07
IR 05
00
01
02
03
04
05
06
07
IR 05
00
01
02
03
04
05
06
07
IR 05
00
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
08
09
10
11
12
13
14
15
IR 06
00
01
02
03
04
05
06
07
IR 06
00
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
08
09
10
11
12
13
14
15
08
09
10
11
12
13
14
15
08
09
10
11
12
13
14
15
17
IR AreaSection 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 Expansion 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.
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.
ModelInput bitsOutput bits
C1K–AD
C4K–AD
C1K–DA
C20–LK
011(–P)
C4K–TM
IR (n + 1)
00
01
02
03
04
05
06
07
IR (n + 1)
00
01
02
03
04
05
06
07
IR (n + 1)
Cannot
be used
IR (n + 1)
00
01
02
03
04
05
06
07
IR (n + 1)
00
01
02
03
Cannot
be used
Cannot
be
used
08
09
10
11
12
13
14
15
08
09
10
11
12
13
14
15
IR (n + 6)
00
01
02
03
04
05
06
07
IR (n + 6)
00
01
02
03
04
05
06
07
IR (n + 6)
00
01
02
03
04
05
06
07
IR (n + 6)
00
01
02
03
04
05
06
07
IR (n + 6)
00
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
08
09
10
11
12
13
14
15
08
09
10
11
12
13
14
15
08
09
10
11
12
13
14
15
08
09
10
11
12
13
14
15
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 AreaSection 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) determines whether the input or output word is used.
The symbols used in the table represent the following:
C20P/C28P
InputOutput
C40P/C60P
InputOutput
C4K/C16P
Input or Output
C20P/C28P/TU/AN/LU
InputOutput
C20P or C28P CPU Unit
InputOutput
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