C200H (CPU21 E - 23 E - 31 E) Operation Manual
C200H (CPU21 E - 23 E - 31 E) Operation Manual
C200H (CPU21 E - 23 E - 31 E) Operation Manual
W217–E1–2
SYSMAC
Programmable Controllers
C200H
(CPU21-E/23-E/31-E)
OPERATION MANUAL
C200H Programmable Controllers
Operation Manual
(For CPU21-E/23-E/31-E)
! DANGER Indicates an imminently hazardous situation which, if not avoided, will result in death or
serious injury.
! WARNING Indicates a potentially hazardous situation which, if not avoided, could result in death or
serious injury.
! Caution Indicates a potentially hazardous situation which, if not avoided, may result in minor or
moderate injury, or property damage.
Visual Aids
The following headings appear in the left column of the manual to help you locate different types of
information.
Note Indicates information of particular interest for efficient and convenient operation
of the product.
1, 2, 3... 1. Indicates lists of one sort or another, such as procedures, checklists, etc.
OMRON, 1992
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.
v
TABLE OF CONTENTS
PRECAUTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
1 Intended Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii
2 General Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii
3 Safety Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii
4 Operating Environment Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii
5 Application Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
SECTION 1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1-1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1-2 The Origins of PC Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1-3 PC Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1-4 OMRON Product Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1-5 Overview of PC Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1-6 Peripheral Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1-7 Available Manuals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1-8 LSS Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
SECTION 2
Hardware Considerations . . . . . . . . . . . . . . . . . . . . . . . . . 11
2-1 Indicators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2-2 PC Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2-3 CPU Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
SECTION 3
Memory Areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3-1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3-2 Data Area Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3-3 IR (Internal Relay) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3-4 SR (Special Relay) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3-5 AR (Auxiliary Relay) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3-6 DM (Data Memory) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3-7 HR (Holding Relay) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3-8 TC (Timer/Counter) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3-9 LR (Link Relay) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3-10 Program Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3-11 TR (Temporary Relay) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
SECTION 4
Writing and Inputting the Program . . . . . . . . . . . . . . . . . 41
4-1 Basic Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
4-2 Instruction Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
4-3 Program Capacity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
4-4 Basic Ladder Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
4-5 The Programming Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
4-6 Preparation for Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
4-7 Inputting, Modifying, and Checking the Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
4-8 Controlling Bit Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
4-9 Work Bits (Internal Relays) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
4-10 Programming Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
4-11 Program Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
vii
TABLE OF CONTENTS
SECTION 5
Instruction Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
5-1 Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
5-2 Instruction Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
5-3 Data Areas, Definer Values, and Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
5-4 Differentiated Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
5-5 Coding Right-hand Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
5-6 Instruction Set Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
5-7 Ladder Diagram Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
5-8 Bit Control Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
5-9 INTERLOCK and INTERLOCK CLEAR – IL(02) and ILC(03) . . . . . . . . . . . . . . . . . . . 108
5-10 JUMP and JUMP END – JMP(04) and JME(05) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
5-11 END – END(01) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
5-12 NO OPERATION – NOP(00) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
5-13 Timer and Counter Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
5-14 Data Shifting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
5-15 Data Movement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
5-16 Data Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
5-17 Data Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
5-18 BCD Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
5-19 Binary Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
5-20 Logic Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
5-21 Subroutines and Interrupt Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
5-22 Step Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
5-23 Special Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
5-24 Network Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
SECTION 6
Program Execution Timing . . . . . . . . . . . . . . . . . . . . . . . . 215
6-1 Cycle Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
6-2 Calculating Cycle Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
6-3 Instruction Execution Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
6-4 I/O Response Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
SECTION 7
Program Monitoring and Execution . . . . . . . . . . . . . . . . 229
7-1 Monitoring Operation and Modifying Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
7-2 Program Backup and Restore Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
SECTION 8
Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
8-1 Alarm Indicators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
8-2 Programmed Alarms and Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
8-3 Reading and Clearing Errors and Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
8-4 Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
8-5 Error Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
Appendices
A Standard Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
B Programming Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
C Programming Console Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
D Error and Arithmetic Flag Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
E Data Areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
F Word Assignment Recording Sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
G Program Coding Sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
H Data Conversion Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
I Extended ASCII . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
viii
About this Manual:
This manual describes the operation of the C200H C-series Programmable Controllers using the C200H-
CPU21-E, C200H-CPU23-E, or C200H-CPU31-E CPUs, and it includes the sections described below.
Installation information is provided in the C200H (CPU21-E/23-E/31-E) Programmable Control Installa-
tion Guide. A table of other manuals that can be used in conjunction with this manual is provided at the end
of Section 1 Introduction. Provided at the end of Section 2 Hardware Considerations is a description of the
differences between the older CPUs and the newer CPUs described in this manual.
Please read this manual completely and be sure you understand the information provide before attempt-
ing to operation the C200H.
Section 1 Introduction explains the background and some of the basic terms used in ladder-diagram
programming. It also provides an overview of the process of programming and operating a PC and ex-
plains basic terminology used with OMRON PCs. Descriptions of Peripheral Devices used with the
C200H PCs and a table of other manuals available to use with this manual for special PC applications are
also provided.
Section 2 Hardware Considerations explains basic aspects of the overall PC configuration and de-
scribes the indicators that are referred to in other sections of this manual.
Section 3 Memory Areas takes a look at the way memory is divided and allocated and explains the infor-
mation provided there to aid in programming. It explains how I/O is managed in memory and how bits in
memory correspond to specific I/O points. It also provides information on System DM, a special area in
C200H PCs that provides the user with flexible control of PC operating parameters.
Section 4 Writing and Entering Programs explains the basics of ladder-diagram programming, looking
at the elements that make up the parts of a ladder-diagram program and explaining how execution of this
program is controlled. It also explains how to convert ladder diagrams into mnemonic code so that the
programs can be entered using a Programming Console.
Section 5 Instruction Set describes all of the instructions used in programming.
Section 6 Program Execution Timing explains the cycling process used to execute the program and
tells how to coordinate inputs and outputs so that they occur at the proper times.
Section 7 Program Debugging and Execution explains the Programming Console procedures used to
input and debug the program and to monitor and control operation.
Section 8 Troubleshooting provides information on error indications and other means of reducing
down-time. Information in this section is also useful when debugging programs.
The Appendices provide tables of standard OMRON products available for the C200H PCs, reference
tables of instructions and Programming Console operations, coding sheet to help in programming and
parameter input, and other information helpful in PC operation.
! WARNING Failure to read and understand the information provided in this manual may result in
personal injury or death, damage to the product, or product failure. Please read each
section in its entirety and be sure you understand the information provided in the section
and related sections before attempting any of the procedures or operations given.
ix
PRECAUTIONS
This section provides general precautions for using the C200H Temperature Sensor Unit and related devices.
The information contained in this section is important for the safe and reliable application of the C200H Temperature
Sensor Unit. You must read this section and understand the information contained before attempting to set up or oper-
ate the C200H Temperature Sensor Unit.
xi
Operating Environment Precautions 4
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 relevant 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 ma-
chines, safety equipment, and other systems, machines, and equipment that
may have a serious influence on lives and property if used improperly, consult
your OMRON representative.
Make sure that the ratings and performance characteristics of the product are
sufficient for the systems, machines, and equipment, and be sure to provide the
systems, machines, and equipment with double safety mechanisms.
This manual provides information for programming and operating the Unit. Be
sure to read this manual before attempting to use the Unit and keep this manual
close at hand for reference during operation.
! WARNING It is extremely important that a 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 above-mentioned
applications.
3 Safety Precautions
! WARNING Do not attempt to take any Unit apart while the power is being supplied. Doing so
may result in electric shock.
! WARNING Do not touch any of the terminals or terminal blocks while the power is being
supplied. Doing so may result in electric shock.
! WARNING Do not attempt to disassemble, repair, or modify any Units. Any attempt to do so
may result in malfunction, fire, or electric shock.
xii
Application Precautions 5
! Caution Take appropriate and sufficient countermeasures when installing systems in the
following locations:
! 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 system.
! WARNING Always heed these precautions. Failure to abide by the following precautions
could lead to serious or possibly fatal injury.
• Always ground the system to 100 Ω or less when installing the Units. Not con-
necting to a ground of 100 Ω or less may result in electric shock.
• Always turn OFF the power supply to the PC before attempting any of the fol-
lowing. Not turning OFF the power supply may result in malfunction or electric
shock.
• Mounting or dismounting I/O Units, CPU Units, Memory Units, or any other
Units.
• Assembling the Units.
• Setting DIP switches or rotary switches.
• Connecting cables or wiring the system.
• Connecting or disconnecting the connectors.
! Caution Failure to abide by the following precautions could lead to faulty operation of the
PC or the system, or could damage the PC or PC Units. Always heed these pre-
cautions.
xiii
Application Precautions 5
• Do not apply voltages to the Input Units in excess of the rated input voltage.
Excess voltages may result in burning.
• Do not apply voltages or connect loads to the Output Units in excess of the
maximum switching capacity. Excess voltage or loads may result in burning.
• Disconnect the functional ground terminal when performing withstand voltage
tests. Not disconnecting the functional ground terminal may result in burning.
• Be sure that all the mounting screws, terminal screws, and cable connector
screws are tightened to the torque specified in this manual. Incorrect tighten-
ing torque may result in malfunction.
• Leave the label attached to the Unit when wiring. Removing the label may re-
sult in malfunction if foreign matter enters the Unit.
• Remove the label after the completion of wiring to ensure proper heat dissipa-
tion. Leaving the label attached may result in malfunction.
• Double-check all wiring and switch settings before turning ON the power sup-
ply. Incorrect wiring may result in burning.
• Wire correctly. Incorrect wiring may result in burning.
• Mount Units only after checking terminal blocks and connectors completely.
• Be sure that the terminal blocks, Memory Units, expansion cables, and other
items with locking devices are properly locked into place. Improper locking
may result in malfunction.
• Check the user program for proper execution before actually running it on the
Unit. Not checking the program may result in an unexpected operation.
• Confirm that no adverse effect will occur in the system before attempting any of
the following. Not doing so may result in an unexpected operation.
• Changing the operating mode of the PC.
• Force-setting/force-resetting any bit in memory.
• Changing the present value of any word or any set value in memory.
• Resume operation only after transferring to the new CPU Unit the contents of
the DM Area, HR Area, and other data required for resuming operation. Not
doing so may result in an unexpected operation.
• Do not pull on the cables or bend the cables beyond their natural limit. Doing
either of these may break the cables.
• Do not place objects on top of the cables or other wiring lines. Doing so may
break the cables.
• Use crimp terminals for wiring. Do not connect bare stranded wires directly to
terminals. Connection of bare stranded wires may result in burning.
• When replacing parts, be sure to confirm that the rating of a new part is correct.
Not doing so may result in malfunction or burning.
• Before touching a Unit, be sure to first touch a grounded metallic object in order
to discharge any static built-up. Not doing so may result in malfunction or dam-
age.
xiv
SECTION 1
Introduction
This section gives a brief overview of the history of Programmable Controllers and explains terms commonly used in ladder-
diagram 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 C200H, and a table of other manuals
available to use with this manual for special PC applications, are also provided.
1-1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1-2 The Origins of PC Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1-3 PC Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1-4 OMRON Product Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1-5 Overview of PC Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1-6 Peripheral Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1-7 Available Manuals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1-8 LSS Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1-8-1 Offline Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1-8-2 Online Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1-8-3 Offline and Online Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1
The Origins of PC Logic Section 1-2
1-1 Overview
A PC (Programmable Controller) is basically a CPU (Central Processing Unit)
containing a program and connected to input and output (I/O) devices. The pro-
gram 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 photo-
electric sensors, pushbuttons on control panels, limit switches, or any other de-
vice 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 mo-
tors, or any other devices that can be activated by signals output from the PC.
For example, a sensor detecting a passing product 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, posi-
tioned 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.
To achieve proper control, the C200H uses a form of PC logic called ladder-dia-
gram programming. This manual is written to explain ladder-diagram program-
ming and to prepare the reader to program and operate the C200H.
2
OMRON Product Terminology Section 1-4
1-3 PC Terminology
Although also provided in the Glossary at the back of this manual, the following
terms are crucial to understanding PC operation and are thus explained here.
PC Because the C200H is a Rack PC, there is no one product that is a C200H PC.
That is why we talk about the configuration of the PC, because a PC is a configu-
ration of smaller Units.
To have a functional PC, you would need to have a CPU Rack with at least one
Unit mounted to it that provides I/O points. When we refer to the PC, however, 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 in-
puts and outputs.
If you are not familiar with the terms used above to describe a PC, refer to Sec-
tion 2 Hardware Considerations for explanations.
Inputs and Outputs 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 loca-
tion in memory that reflects its status, i.e., either ON or OFF. This memory loca-
tion is called an input bit. The CPU, in its normal processing cycle, monitors the
status of all input points and turns ON or OFF corresponding input bits accord-
ingly.
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 or OFF according to the status of the
output bits.
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 talking about 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 talking about the signals that enter or leave the PC, one refers to input
signals and output signals, or sometimes just inputs and outputs. It all depends
on what aspect of PC operation is being talked about.
Controlled System and The Control System includes the PC and all I/O devices it uses to control an ex-
Control System ternal 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 sys-
tem, e.g., a motor used to drive a conveyor belt.
3
Overview of PC Operation Section 1-5
High-density I/O Units are designed to provide high-density I/O capability and
include Group 2 High-density I/O Units and Special I/O High-density I/O Units.
Special I/O Units are dedicated Units that are designed to meet specific needs.
These include some of the High-density I/O Units, Position Control Units, High-
speed Counter 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 Remote I/O Units, PC Link
Units, Host Link Units, SYSMAC NET Link Units, and SYSMAC LINK Units.
SYSMAC NET Link and SYSMAC LINK Units can be used with the CPU11 only.
Other product groups include Programming Devices, Peripheral Devices,
and DIN Rail Products.
4
Peripheral Devices Section 1-6
Input/Output Requirements 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 3-3 IR Area for details on I/O capacity and
the allocation of I/O bits to I/O points.
Sequence, Timing, and Next, determine the sequence in which control operations are to occur and the
Relationships 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 a specified number of input signals from the photoelectric switch.
Each of the related tasks must be similarly determined, from the beginning of the
control operation to the end.
Unit Requirements The actual Units that will be mounted or connected to PC Racks must be deter-
mined according to the requirements of the I/O devices. Actual hardware specifi-
cations, such as voltage and current levels, as well as functional considerations,
such as those that require Special I/O Units or Link Systems will need to be con-
sidered. In many cases, Special I/O Units, Intelligent I/O Units, or Link Systems
can greatly reduce the programming burden. Details on these Units and Link
Systems are available in appropriate Operation Manuals and System Manuals.
Once the entire Control System has been designed, the task of programming,
debugging, and operation as described in the remaining sections of this manual
can begin.
5
Peripheral Devices Section 1-6
6
Available Manuals Section 1-7
7
LSS Capabilities Section 1-8
8
LSS Capabilities Section 1-8
9
SECTION 2
Hardware Considerations
This section provides information on hardware aspects of the C200H that are relevant to programming and software opera-
tion. These include indicators on the CPU Unit, basic PC configuration, and CPU capabilities. This information is covered in
detail in the C200H Programmable Controllers (CPU21-E/23-E/31-E) Installation Guide.
2-1 Indicators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2-2 PC Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2-3 CPU Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
11
PC Configuration Section 2-2
2-1 Indicators
CPU indicators provide visual information on the general operation of the PC.
Although not substitutes for proper error programming using the flags and other
error indicators provided in the data areas of memory, these indicators provide
ready confirmation of proper operation.
CPU Indicators CPU indicators are shown below 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.
ALARM/ERROR ALARM: Flashes when a non-fatal error is discovered in error
diagnosis operations. PC operation will continue.
ERROR: Lights when a fatal error is discovered in error diagnosis
operations. 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.
OUT INHIBIT Lights when the Output OFF Bit, SR 25215, is turned ON. All
outputs from the PC will be turned OFF.
RUN POWER
OUT INHIBIT
ALARM/ERROR
2-2 PC Configuration
The basic PC configuration consists of two types of Rack: a CPU Rack and Ex-
pansion I/O Racks. The Expansion I/O Racks are not a required part of the basic
system. They are used to increase the number of I/O points. An illustration of
these Racks is provided in 3-3 IR Area. A third type of Rack, called a Slave Rack,
can be used when the PC is provided with a Remote I/O System.
CPU Racks A C200H CPU Rack consists of four components: (1) The CPU Backplane, to
which the CPU and other Units are mounted. (2) The CPU, which executes the
program and controls the PC. (3) Other Units, such as I/O Units, Special I/O
Units, and Link Units, which provide the physical I/O terminals corresponding to
I/O points.
A C200H CPU Rack can be used alone or it can be connected to other Racks to
provide additional I/O points. The CPU Rack provides three, five, or eight slots to
which these other Units can be mounted depending on the backplane used.
Expansion I/O Racks An Expansion I/O Rack can be thought of as an extension of the PC because it
provides additional slots to which other Units can be mounted. It is built onto an
Expansion I/O Backplane to which a Power Supply and up to eight other Units
are mounted.
An Expansion I/O Rack is always connected to the CPU via the connectors on
the Backplanes, allowing communication between the two Racks. Up to two Ex-
pansion I/O Racks can be connected in series to the CPU Rack.
12
CPU Capabilities Section 2-3
Unit Mounting Position Only I/O Units and Special I/O Units can be mounted to Slave Racks. All I/O
Units, Special I/O Units, Group-2 High-density I/O Units, Remote I/O Master
Units, PC and Host Link Units, can be mounted to any slot on all other Racks,
although mounting to the two rightmost slots on the CPU Rack may interfere with
the mounting of peripheral devices. With the CPU31-E CPU Unit, SYSMAC
LINK and SYSMAC NET Link Units can be mounted to the two rightmost slots on
the CPU Rack.
Refer to the C200H Installation Guide for details about which slots can be used
for which Units and other details about PC configuration. The way in which I/O
points on Units are allocated in memory is described in 3-3 IR Area.
Note 1. The C200H-CPU01-E/CPU03-E cannot use the Memory Units’ clock, and
the C200H-CPU11-E/CPU31-E CPUs have a built-in clock.
2. The C200H-CPU21-E/CPU23-E can use the C200H-MR433/MR833/
ME432/ME832 Memory Units’ clock.
13
SECTION 3
Memory Areas
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 pro-
gram is actually stored. This section describes these areas individually and provides information that will be necessary to use
them. As a matter of convention, the TR area is described in this section, even though it is not strictly a memory area.
3-1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3-2 Data Area Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3-3 IR (Internal Relay) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3-4 SR (Special Relay) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3-4-1 Remote I/O Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3-4-2 Link System Flags and Control Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3-4-3 Forced Status Hold Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3-4-4 I/O Status Hold Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3-4-5 Output OFF Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3-4-6 FAL (Failure Alarm) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3-4-7 Low Battery Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3-4-8 Cycle Time Error Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3-4-9 I/O Verification Error Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3-4-10 First Cycle Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3-4-11 Clock Pulse Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3-4-12 Step Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3-4-13 Group-2 High-density I/O Unit Error Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3-4-14 Instruction Execution Error Flag, ER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3-4-15 Arithmetic Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3-5 AR (Auxiliary Relay) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3-5-1 Slave Rack Error Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3-5-2 Group-2 High-density I/O Unit Error Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3-5-3 Optical I/O Unit Error Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3-5-4 SYSMAC LINK System Data Link Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3-5-5 Error History Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3-5-6 Active Node Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3-5-7 SYSMAC LINK/SYSMAC NET Link System Service Time (CPU31-E Only) . 34
3-5-8 Calendar/Clock Area and Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3-5-9 TERMINAL Mode Key Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3-5-10 Power-OFF Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3-5-11 CPU Low Battery Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3-5-12 SCAN(18) Cycle Time Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3-5-13 Network Parameter Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3-5-14 Link Unit Mounted Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3-5-15 CPU-mounting Device Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3-5-16 FALS-generating Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3-5-17 Cycle Time Indicators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3-6 DM (Data Memory) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3-7 HR (Holding Relay) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3-8 TC (Timer/Counter) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3-9 LR (Link Relay) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3-10 Program Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3-11 TR (Temporary Relay) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
15
Data Area Structure Section 3-2
3-1 Introduction
Details, including the name, acronym, range, and function of each area are sum-
marized in the following table. All but the last three of these areas are data areas.
Data and memory areas are normally referred to by their acronyms.
Area Acronym Range Function
Internal Relay IR Words: 000 to 235 Used to control I/O points, other bits, timers,
Bits: 0000 to 23515 and counters, and to temporarily store data.
Special Relay SR Words: 236 to 255 Contains system clocks, flags, control bits, and
Bits: 23600 to 25507 status information.
Auxiliary Relay AR Words: AR 00 to AR 27 Contains flags and bits for special functions.
Bits: AR 00 to AR 2715 Retains status during power failure.
Data Memory DM Read/write: DM 0000 to DM 0999 Used for internal data storage and manipula-
Read only: DM 1000 to DM 1999 tion.
Holding Relay HR Words: HR 00 to HR 99 Used to store data and to retain the data values
Bits: HR 0000 to HR 9915 when the power to the PC is turned off.
Timer/Counter TC TC 000 to TC 511 (TC numbers used Used to define timers and counters, and to ac-
to access other information) cess completion flags, PV, and SV. In general,
when used as a bit operand, a TC number ac-
cesses the completion flag for the timer or
counter defined using the TC number. When
used as a word operand, the TC number ac-
cesses the present value of the timer or count-
er.
Link Relay LR Words: LR 00 to LR 63 Available for use as work bits.
Bits: LR 0000 to 6315
Temporary Relay TR TR 00 to TR 07 (bits only) Used to temporarily store and retrieve execu-
tion conditions. These bits can only be used in
the Load and Output instructions. Storing and
retrieving execution conditions is necessary
when programming certain types of branching
ladder diagrams.
Program Memory UM UM: Depends on Memory Unit used. Contains the program executed by the CPU.
Work Bits and Words When some bits and words in certain data areas are not being 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 words and
work bits. Most, but not all, unused bits can be used as work bits. Those that can
be used are described area-by-area in the remainder of this section. Actual ap-
plication of work bits and work words is described in Section 4 Writing and Input-
ting the Program.
Flags and Control Bits Some data areas contain flags and/or control bits. Flags are bits that are auto-
matically turned ON and OFF to indicate particular operation status. Although
some flags can be turned ON and OFF by the user, most flags are 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.
16
Data Area Structure Section 3-2
sired data is located. The TC area consists of TC numbers, each of which is used
for a specific timer or counter defined in the program. Refer to 3-8 TC Area for
more details on TC numbers and to 5-13 Timer and Counter Instructions for in-
formation on their application.
The rest of the data areas (i.e., the IR, SR, HR, DM, AR, and LR areas) consist of
words, each of which consists of 16 bits numbered 00 through 15 from right to
left. IR words 000 and 001 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 term least significant bit is often used for rightmost bit; the term most signifi-
cant bit, for leftmost bit. These terms are not used in this manual because a
single data word is often split into two or more parts, with each part used for dif-
ferent parameters or operands. When this is done, the rightmost bits of a word
may actually become the most significant bits, i.e., the leftmost bits in another
word,when combined with other bits to form a new word.
Bit number 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
IR word 000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
IR word 001 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
The DM area is accessible by word only; you cannot designate an individual bit
within a DM word. Data in the IR, SR, HR, AR, and LR areas is accessible either
by word or by bit, 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 two-, three-, or four-digit word address. To designate an area
by bit, the word address is combined with the bit number as a single four- or five-
digit address. The following table show examples of this. The two rightmost dig-
its of a bit designation must indicate a bit between 00 and 15, i.e., the rightmost
digit must be 5 or less the next digit to the left, either 0 or 1.
The same TC number can be used to designate either 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 3-8 TC Area.
Data Structure Word data input as decimal values is stored in binary-coded decimal (BCD);
word data entered as hexadecimal is stored in binary form. Each four bits of a
word represents one digit, either a hexadecimal or decimal digit, numerically
equivalent to the value of the binary bits. One word of data thus contains four
digits, which are numbered from right to left. These digit numbers and the corre-
sponding bit numbers for one word are shown below.
Digit number 3 2 1 0
Bit number 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
Contents 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
When referring to the entire word, the digit numbered 0 is called the rightmost
digit; the one numbered 3, the leftmost digit.
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
17
IR Area Section 3-3
18
IR Area Section 3-3
in 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 instruction will actually be out-
put from the PC.
See 5-14-1 Shift Register – SFT(10) for an example that uses an output bit in two
‘bit-control’ instructions.
Word Allocation for Racks I/O words are allocated to the CPU Rack and Expansion I/O Racks by slot posi-
tion. One I/O word is allocated to each slot, as shown in the following table. Since
each slot is allocated only one I/O word, a 3-slot rack uses only the first 3 words,
a 5-slot rack uses only the first 5 words, and an 8-slot rack uses only the first 8
words. Words that are allocated to unused or nonexistent slots are available as
work words.
← Left side of rack Right side of a 10-slot rack →
Rack Slot 1 Slot 2 Slot 3 Slot 4 Slot 5 Slot 6 Slot 7 Slot 8 Slot 9 Slot 10
CPU IR 000 IR 001 IR 002 IR 003 IR 004 IR 005 IR 006 IR 007 IR 008 IR 009
1st Expansion IR 010 IR 011 IR 012 IR 013 IR 014 IR 015 IR 016 IR 017 IR 018 IR 019
2nd Expansion IR 020 IR 021 IR 022 IR 023 IR 024 IR 025 IR 026 IR 027 IR 028 IR 029
Unused Words Any words allocated to a Unit that does not use them can be used in program-
ming as work words and bits. Units that do not used the words assigned to the
slot they are mounted to include SYSMAC NET Link, SYSMAC LINK, Host Link,
PC Link, Special I/O, Remote I/O Master, High-density I/O, and Auxiliary Power
Supply Units.
Allocation for Special I/O Up to ten Special I/O Units may be mounted in any slot of the CPU Rack or Ex-
Units and Slave Racks pansion I/O Racks. Up to five Slave Racks may be used, whether one or two
Masters are used. IR area words are allocated to Special I/O Units and Slave
Racks by the unit number on the Unit, as shown in the following tables.
Special I/O Units Slave Racks
Unit number IR address Unit number IR address
0 100 to 109 0 050 to 059
1 110 to 119 1 060 to 069
2 120 to 129 2 070 to 079
3 130 to 139 3 080 to 089
4 140 to 149 4 090 to 099
5 150 to 159
6 160 to 169
7 170 to 179
8 180 to 189
9 190 to 199
The C500-RT001/002-(P)V1 Remote I/O Slave Rack may be used, but it re-
quires 20 I/O words, not 10, and therefore occupies the I/O words allocated to 2
C200H Slave Racks, both the words allocated to the unit number set on the rack
and the words allocated to the following unit number. When using a C200H CPU
Unit, do not set the unit number on a C500 Slave Rack to 4, because there is no
unit number 5. I/O words are allocated only to installed Units, from left to right,
and not to slots as in the C200H system.
Allocation for Optical I/O I/O words between IR 200 and IR 231 are allocated to Optical I/O Units by unit
Units number. The I/O word allocated to each Unit is IR 200+n, where n is the unit num-
ber set on the Unit.
Allocation for Remote I/O Remote Master I/O Units, SYSMAC LINK Units, SYSMAC NET Link Units, and
Master and Link Units Host Link Units do not use I/O words, and the PC Link Units use the LR area, so
19
IR Area Section 3-3
words allocated to the slots in which these Units are mounted are available as
work words.
Bit Allocation for I/O Units An I/O Unit may require anywhere from 8 to 16 bits, depending on the model.
With most I/O Units, any bits not used for input or output are available as work
bits. Transistor Output Units C200H-OD213 and C200H-OD411, as well as Triac
Output Unit C200H-OA221, however, uses bit 08 for the Blown Fuse Flag. Tran-
sistor Output Unit C200H-OD214 uses bits 08 to 11 for the Alarm Flag. Bits 08 to
15 of any word allocated to these Units, therefore, cannot be used as work bits.
Allocation for Group-2 Group-2 High-density I/O Units are allocated words between IR 030 and IR 049
High-density I/O Units according to I/O number settings made on them and do not use the words allo-
cated to the slots in which they are mounted. For 32-point Units, each Unit is allo-
cated two words; for 64-point Units, each Unit is allocated four words. The words
allocated for each I/O number are in the following tables. Any words or part of
words not used for I/O can be used as work words or bits in programming.
When setting I/O numbers on the High-density I/O Units, be sure that the set-
tings will not cause the same words to be allocated to more than one Unit. For
example, if I/O number 0 is allocated to a 64-point Unit, I/O number 1 cannot be
used for any Unit in the system.
Group-2 High-density I/O Units are not considered Special I/O Units and do not
affect the limit to the number of Special I/O Units allowed in the System, regard-
less of the number used.
The words allocated to Group-2 High-density I/O Units correspond to the con-
nectors on the Units as shown in the following table.
Note Group-2 High-density I/O Units cannot be mounted to Slave Racks and cannot
be used with the C200H-CPU01-E, C200H-CPU03-E, and C200H-CPU11-E.
20
SR Area Section 3-4
21
SR Area Section 3-4
22
SR Area Section 3-4
Unit involved, and bit 04 will be ON if the Unit is assigned leftmost word bits (08
through 15), and OFF if it is assigned rightmost word bits (00 through 07).
The following bits can be employed as work bits when the PC does not belong to
the Link System associated with them.
Bit Flag
25206 Rack-mounting Host Link Unit Level 1 Error Flag
25207 Rack-mounting Host Link Unit Level 1 Restart Bit
25208 CPU-mounting Host Link Unit Error Flag
25209 CPU-mounting Host Link Unit Restart Bit
25213 Rack-mounting Host Link Unit Level 0 Restart Bit
25311 Rack-mounting Host Link Unit Level 0 Error Flag
Bit Flag
25200 Operating Level 0 SEND(90)/RECV(98) Error Flag
25201 Operating Level 0 SEND(90)/RECV(98) Enable Flag
25202 Operating Level 0 Data Link Operating Flag
25203 Operating Level 1 SEND(90)/RECV(98) Error Flag
25204 Operating Level 1 SEND(90)/RECV(98) Enable Flag
25205 Operating Level 1 Data Link Operating Flag
23
SR Area Section 3-4
SYSMAC NET Link Loop SR 236 contains the SYSMAC NET Link Loop Status Flags. Bits 00 through 07
Status Output are the Loop Status Flags for operating level 0, and bits 08 through 15 are the
Flags for operating level 1. The bit functions are shown below.
Level 0: 07 06 05 04 03 02 01 00
Level 1: 15 14 13 12 11 10 09 08
1 1 1 1
Data Link Status (CPU31-E SYSMAC LINK/SYSMAC NET Link Data link status is output to SR 238 through
Only) SR 241 for the operating level 0 data link, and to SR 242 through SR 245 for the
operating level 1 data link in the SYSMAC NET Link or SYSMAC LINK System.
24
SR Area Section 3-4
The meaning of each bit in these areas differs depending on whether the data
link is in a SYSMAC LINK System or SYSMAC NET Link System, as shown be-
low.
SYSMAC LINK Systems
Level 0 Level 1 Bits
00 to 03 04 to 07 08 to 11 12 to 15
SR 238 SR 242 Node 1 Node 2 Node 3 Node 4
SR 239 SR 243 Node 5 Node 6 Node 7 Node 8
SR 240 SR 244 Node 9 Node 10 Node 11 Node 12
SR 241 SR 245 Node 13 Node 14 Node 15 Node 16
PC Link Systems
PC Link Unit Error and Run When the PC belongs to a PC Link System, words 247 through 250 are used to
Flags monitor the operating status of all PC Link Units connected to the PC Link Sys-
tem. This includes a maximum of 32 PC Link Units. If the PC is in a Multilevel PC
Link System, half of the PC Link Units will be in a PC Link Subsystem in operating
level 0; the other half, in a Subsystem in operating level 1. The actual bit assign-
ments depend on whether the PC is in a Single-level PC Link System or a Multi-
level PC Link System. Refer to the PC Link System Manual for details. Error and
Run Flag bit assignments are described below.
Bits 00 through 07 of each word are the Run flags, which are ON when the PC
Link Unit is in RUN mode. Bits 08 through 15 are the Error flags, which are ON
when an error has occurred in the PC Link Unit. The following table shows bit
assignments for Single-level and Multi-level PC Link Systems.
25
SR Area Section 3-4
Application Example If the PC is in a Multilevel PC Link System and the content of word 248 is 02FF,
then PC Link Units #0 through #7 of in the PC Link Subsystem assigned operat-
26
SR Area Section 3-4
ing level 1 would be in RUN mode, and PC Link Unit #1 in the same Subsystem
would have an error. The hexadecimal digits and corresponding binary bits of
word 248 would be as shown below.
Bit no. 15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 00
Binary 0000 0010 1111 1111
Hex 0 2 F F
27
SR Area Section 3-4
28
SR Area Section 3-4
30 s 30 s .01 s .01 s
1 min. .02 s
0.1 s 0.2 s
Bit 25502
1.0-s clock pulse Caution:
Because the 0.1-second and
0.02-second clock pulse bits have
0.5 s 0.5 s ON times of 50 and 10 ms, respec-
tively, the CPU may not be able to
accurately read the pulses if pro-
1.0 s
gram execution time is too long.
29
AR Area Section 3-5
! Caution These flags are all reset when the END(01) instruction is executed, and there-
fore cannot be monitored from a programming device.
Refer to 5-14 Data Shifting, 5-16 Data Comparison, 5-18 BCD Calculations, and
5-19 Binary Calculations for details.
Carry Flag, CY SR bit 25504 turns ON when there is a carry in the result of an arithmetic opera-
tion or when a rotate or shift instruction moves a “1” into CY. The content of CY is
also used in some arithmetic operations, e.g., it is added or subtracted along
with other operands. This flag can be set and cleared from the program using the
Set Carry and Clear Carry instructions.
Greater Than Flag, GR SR bit 25505 turns ON when the result of a comparison shows the first of two
operands to be greater than the second.
Equal Flag, EQ SR bit 25506 turns ON when the result of a comparison shows two operands to
be equal or when the result of an arithmetic operation is zero.
Less Than Flag, LE SR bit 25507 turns ON when the result of a comparison shows the first of two
operands to be less than the second.
Note The four arithmetic flags are turned OFF when END(01) is executed.
The AR area retains status during power interruptions, when switching from
MONITOR or RUN mode to PROGRAM mode, or when PC operation is
stopped. Bit allocations are shown in the following table and described in the fol-
lowing pages in order of bit number.
30
AR Area Section 3-5
31
AR Area Section 3-5
32
AR Area Section 3-5
The above settings are read every cycle while the SYSMAC LINK System is in
operation.
33
AR Area Section 3-5
Seconds Round-off Bit AR 2113 is turned ON to round the seconds of the Calendar/clock Area to zero,
i.e., if the seconds is 29 or less, it is merely set to 00; if the seconds is 30 or great-
er, the minutes is incremented by 1 and the seconds is set to 00.
Stop Bit AR 2114 is turned OFF to enable the operation of the Calendar/clock Area and
ON to stop the operation.
Set Bit AR 2115 is used to set the Calendar/clock Area as described below. This data
must be in BCD and must be set within the limits for the Calendar/clock Area
given above.
1, 2, 3... 1. Turn ON AR 2114 (Stop Bit).
2. Set the desired date, day, and time, being careful not to turn OFF AR 2114
(Stop Bit) when setting the day of the week (they’re in the same word). (On
the Programming Console, the Bit/Digit Monitor and Force Set/Reset Oper-
ations are the easiest ways to set this data.)
Note A more convenient way is if steps 1 and 2 are executed simulta-
neously as follows.
Set 4000 to 4006 with present value change.
34
AR Area Section 3-5
Clock Accuracy Clock accuracy is affected by the ambient temperature as shown in the following
table.
Ambient Accuracy (loss or
temperature gain per month)
55°C –3 to 0 minutes
25°C ±1 minute
0°C –2 to 0 minutes
Note A clock is built into the C200H-CPU31-E, enabling the clock regardless of the
Memory Unit that is mounted. The following Memory Units must be mounted to
use the clock with other CPUs: C200H-MR433/MR833/ME432/ME832.
35
DM Area Section 3-6
Although composed of 16-bit words like any other data area, all data in any part
of the DM area cannot be specified by bit for use in instructions with bit operands.
DM 0000 to DM 0999 can be written to by the program, but DM 1000 to DM 1999
can only be written to using a peripheral programming device, such as a Pro-
gramming Console, GPC, FIT, or SYSMATE software.
36
DM Area Section 3-6
DM 0324 5555
DM 0325 2506 5555 moved
DM 0326 D541 to LR 00.
Error History Area DM 0969 to DM 0999 are used to store up to 10 records that show the nature,
time, and date of errors that have occurred in the PC. The time and date entries
in these records are only recorded in PCs that are equipped with the calendar/
clock function.
The Error History Area will store system-generated or FAL(06)/FALS(07)-gener-
ated error codes whenever AR 0715 (Error History Enable Bit) is ON. Refer to
Section 8 Troubleshooting for details on error codes.
Area Structure Error records occupy three words each stored between DM 0970 and DM 0999.
The last record that was stored can be obtained via the content of DM 0969 (Er-
ror Record Pointer). The record number, DM words, and pointer value for each of
the ten records are as follows:
Record Addresses Pointer value
None N.A. 0000
1 DM 0970 to DM 0972 0001
2 DM 0973 to DM 0975 0002
3 DM 0976 to DM 0978 0003
4 DM 0979 to DM 0981 0004
5 DM 0982 to DM 0984 0005
6 DM 0985 to DM 0987 0006
7 DM 0988 to DM 0990 0007
8 DM 0991 to DM 0993 0008
9 DM 0994 to DM 0996 0009
10 DM 0997 to DM 0999 000A
Although each of them contains a different record, the structure of each record is
the same: the first word contains the error code; the second and third words, the
day and time. The error code will be either one generated by the system or by
37
DM Area Section 3-6
FAL(06)/FALS(07); the time and date will be the date and time from AR 18 and
AR 19 (Calender/date Area). Also recorded with the error code is an indication of
whether the error is fatal (08) or non-fatal (00). This structure is shown below.
Note A clock is built into the C200H-CPU31-E, ensuring accuracy in the error history
area times regardless of the Memory Unit that is mounted. The following
Memory Units must be mounted to use the clock and ensure accurate times in
the error history area with other CPUs: C200H-MR433/MR833/ME432/ME832.
Operation When the first error code is generated with AR 0715 (Error History Enable Bit)
turned ON, the relevant data will be placed in the error record after the one indi-
cated by the History Record Pointer (initially this will be record 1) and the Pointer
will be incremented. Any other error codes generated thereafter will be placed in
consecutive records until the last one is used. Processing of further error records
is based on the status of AR 0713 (Error History Overwrite Bit).
If AR 0713 is ON and the Pointer contains 000A, the next error will be written into
record 10, the contents of record 10 will be moved to record 9, and so on until the
contents of record 1 is moved off the end and lost, i.e., the area functions like a
shift register. The Record Pointer will remain set to 000A.
If AR 0713 is OFF and the Pointer reaches 000A, the contents of the Error Histo-
ry Error will remain as it is and any error codes generate thereafter will not be
recorded until AR 0713 is turned OFF or until the Error History Area is reset.
The Error History Area can be reset by turning ON and then OFF
AR 0714 (Error History Reset Bit). When this is done, the Record Pointer will be
reset to 0000, the Error History Area will be reset (i.e., cleared), and any further
error codes will be recorded from the beginning of the Error History Area.
AR 0715 (Error History Enable Bit) must be ON to reset the Error History Area.
Special I/O Unit Data The DM area between 1000 and 1999 is allocated to Special I/O Units as shown
below. When not used for this purpose, this area is available for other uses.
Unit Addresses
0 DM 1000 to DM 1099
1 DM 1100 to DM 1199
2 DM 1200 to DM 1299
3 DM 1300 to DM 1399
4 DM 1400 to DM 1499
5 DM 1500 to DM 1599
6 DM 1600 to DM 1699
7 DM 1700 to DM 1799
8 DM 1800 to DM 1899
9 DM 1900 to DM 1999
38
TC Area Section 3-8
39
TR Area Section 3-11
ways an instruction, the second is always a bit, and the third is always a word.
The same is true of all other TC numbers prefixed with TIM or CNT.
40
SECTION 4
Writing and Inputting the Program
This section explains the basic steps and concepts involved in writing a basic ladder diagram program, inputting the program
into memory, and executing it. It introduces the instructions that are used to build the basic structure of the ladder diagram and
control its execution. The entire set of instructions used in programming is described in Section 5 Instruction Set.
41
Instruction Terminology Section 4-2
42
Basic Ladder Diagrams Section 4-4
00100 00002 00003 HR 0050 00007 TIM 001 LR 0515 00403 00405
Instruction
As shown in the diagram above, instruction lines can branch apart and they can
join back together. The vertical pairs of lines are called conditions. Conditions
without diagonal lines through them are called normally open conditions and
correspond to a LOAD, AND, or OR instruction. The conditions with diagonal
lines through them are called normally closed conditions and correspond to a
LOAD NOT, AND NOT, or OR NOT instruction. The number above each condi-
tion indicates the operand bit for the instruction. It is the status of the bit asso-
ciated with each condition that determines the execution condition for following
instructions. The way the operation of each of the instructions corresponds to a
condition is described below. Before we consider these, however, there are
some basic terms that must be explained.
Note When displaying ladder diagrams with a GPC, a FIT, or LSS, a second bus bar
will be shown on the right side of the ladder diagram and will be connected to all
43
Basic Ladder Diagrams Section 4-4
instructions on the right side. This does not change the ladder-diagram program
in any functional sense. No conditions can be placed between the instructions
on the right side and the right bus bar, i.e., all instructions on the right must be
connected directly to the right bus bar. Refer to the GPC, FIT, or LSS Operation
Manual for details.
Execution Conditions In ladder diagram programming, the logical combination of ON and OFF condi-
tions before an instruction determines the compound condition under which the
instruction is executed. This condition, which is either ON or OFF, is called the
execution condition for the instruction. All instructions other than LOAD instruc-
tions have execution conditions.
Operand Bits The operands designated for any of the ladder instructions can be any bit in the
IR, SR, HR, AR, LR, or TC areas. This means that the conditions in a ladder dia-
gram can be determined by I/O bits, flags, work bits, timers/counters, etc. LOAD
and OUTPUT instructions can also use TR area bits, but they do so only in spe-
cial applications. Refer to 4-7-7 Branching Instruction Lines for details.
Logic Blocks The way that conditions correspond to what instructions is determined by the
relationship between the conditions within the instruction lines that connect
them. Any group of conditions that go together to create a logic result is called a
logic block. Although ladder diagrams can be written without actually analyzing
individual logic blocks, understanding logic blocks is necessary for efficient pro-
gramming and is essential when programs are to be input in mnemonic code.
44
Basic Ladder Diagrams Section 4-4
Program Memory Structure The program is input into addresses in Program Memory. Addresses in Program
Memory are slightly different to those in other memory areas because each ad-
dress does not necessarily hold the same amount of data. Rather, each address
holds one instruction and all of the definers and operands (described in more
detail later) required for that instruction. Because some instructions require no
operands, while others require up to three operands, Program Memory address-
es can be from one to four words long.
Program Memory addresses start at 00000 and run until the capacity of Program
Memory has been exhausted. The first word at each address defines the instruc-
tion. Any definers used by the instruction are also contained in the first word.
Also, if an instruction requires only a single bit operand (with no definer), the bit
operand is also programmed on the same line as the instruction. The rest of the
words required by an instruction contain the operands that specify what data is
to be used. When converting to mnemonic code, all but ladder diagram instruc-
tions are written in the same form, one word to a line, just as they appear in the
ladder diagram symbols. An example of mnemonic code is shown below. The
instructions used in it are described later in the manual.
The address and instruction columns of the mnemonic code table are filled in for
the instruction word only. For all other lines, the left two columns are left blank. If
the instruction requires no definer or bit operand, the operand column is left
blank for first line. It is a good idea to cross through any blank data column
spaces (for all instruction words that do not require data) so that the data column
can be quickly scanned to see if any addresses have been left out.
When programming, addresses are automatically displayed and do not have to
be input unless for some reason a different location is desired for the instruction.
When converting to mnemonic code, it is best to start at Program Memory ad-
dress 00000 unless there is a specific reason for starting elsewhere.
45
Basic Ladder Diagrams Section 4-4
LOAD and LOAD NOT The first condition that starts any logic block within a ladder diagram corre-
sponds to a LOAD or LOAD NOT instruction. Each of these instruction requires
one line of mnemonic code. “Instruction” is used as a dummy instruction in the
following examples and could be any of the right-hand instructions described lat-
er in this manual.
00000
When this is the only condition on the instruction line, the execution condition for
the instruction at the right is ON when the condition is ON. For the LOAD instruc-
tion (i.e., a normally open condition), the execution condition will be ON when IR
00000 is ON; for the LOAD NOT instruction (i.e., a normally closed condition), it
will be ON when 00000 is OFF.
AND and AND NOT When two or more conditions lie in series on the same instruction line, the first
one corresponds to a LOAD or LOAD NOT instruction; and the rest of the condi-
tions correspond to AND or AND NOT instructions. The following example
shows three conditions which correspond in order from the left to a LOAD, an
AND NOT, and an AND instruction. Again, each of these instructions requires
one line of mnemonic code.
The instruction will have an ON execution condition only when all three condi-
tions are ON, i.e., when IR 00000 is ON, IR 00100 is OFF, and LR 0000 is ON.
AND instructions in series can be considered individually, with each taking the
logical AND of the execution condition (i.e., the total of all conditions up to that
point) and the status of the AND instruction’s operand bit. If both of these are ON,
an ON execution condition will be produced for the next instruction. If either is
OFF, the result will also be OFF. The execution condition for the first AND in-
struction in a series is the first condition on the instruction line.
Each AND NOT instruction in series takes the logical AND of its execution condi-
tion and the inverse of its operand bit.
OR and OR NOT When two or more conditions lie on separate instruction lines which run in paral-
lel and then join together, the first condition corresponds to a LOAD or LOAD
NOT instruction; the other conditions correspond to OR or OR NOT instructions.
The following example shows three conditions which correspond (in order from
46
Basic Ladder Diagrams Section 4-4
00100
LR 0000
The instruction will have an ON execution condition when any one of the three
conditions is ON, i.e., when IR 00000 is OFF, when IR 00100 is OFF, or when LR
0000 is ON.
OR and OR NOT instructions can be considered individually, each taking the
logical OR between its execution condition and the status of the OR instruction’s
operand bit. If either one of these were ON, an ON execution condition will be
produced for the next instruction.
Combining AND and OR When AND and OR instructions are combined in more complicated diagrams,
Instructions they can sometimes be considered individually, with each instruction performing
a logic operation on the execution condition and the status of the operand bit.
The following is one example. Study this example until you are convinced that
the mnemonic code follows the same logic flow as the ladder diagram.
00000 00001 00002 00003
Instruction
00200
Here, an AND is taken between the status of IR 00000 and that of IR 00001 to
determine the execution condition for an OR with the status of IR 00200. The
result of this operation determines the execution condition for an AND with the
status of IR 00002, which in turn determines the execution condition for an AND
with the inverse (i.e., and AND NOT) of the status of IR 00003.
In more complicated diagrams, however, it is necessary to consider logic blocks
before an execution condition can be determined for the final instruction, and
that’s where AND LOAD and OR LOAD instructions are used. Before we consid-
er more complicated diagrams, however, we’ll look at the instructions required to
complete a simple “input-output” program.
47
Basic Ladder Diagrams Section 4-4
used to control the status of the designated operand bit according to the execu-
tion condition. With the OUTPUT instruction, the operand bit will be turned ON
as long as the execution condition is ON and will be turned OFF as long as the
execution condition is OFF. With the OUTPUT NOT instruction, the operand bit
will be turned ON as long as the execution condition is OFF and turned OFF as
long as the execution condition is ON. These appear as shown below. In mne-
monic code, each of these instructions requires one line.
00000 00001
Instruction
END(01)
Program execution
ends here.
If there is no END instruction anywhere in the program, the program will not be
executed at all.
Now you have all of the instructions required to write simple input-output pro-
grams. Before we finish with ladder diagram basic and go onto inputting the pro-
gram into the PC, let’s look at logic block instruction (AND LOAD and OR LOAD),
which are sometimes necessary even with simple diagrams.
48
Basic Ladder Diagrams Section 4-4
00000 00002
Instruction
00001 00003
The two logic blocks are indicated by dotted lines. Studying this example shows
that an ON execution condition will be produced when: either of the conditions in
the left logic block is ON (i.e., when either IR 00000 or IR 00001 is ON), and
when either of the conditions in the right logic block is ON (i.e., when either IR
00002 is ON or IR 00003 is OFF).
The above ladder diagram cannot, however, be converted to mnemonic code
using AND and OR instructions alone. If an AND between IR 00002 and the re-
sults of an OR between IR 00000 and IR 00001 is attempted, the OR NOT be-
tween IR 00002 and IR 00003 is lost and the OR NOT ends up being an OR NOT
between just IR 00003 and the result of an AND between IR 00002 and the first
OR. What we need is a way to do the OR (NOT)’s independently and then com-
bine the results.
To do this, we can use the LOAD or LOAD NOT instruction in the middle of an
instruction line. When LOAD or LOAD NOT is executed in this way, the current
execution condition is saved in a special buffer and the logic process is re-
started. To combine the results of the current execution condition with that of a
previous “unused” execution condition, an AND LOAD or an OR LOAD instruc-
tion is used. Here “LOAD” refers to loading the last unused execution condition.
An unused execution condition is produced by using the LOAD or LOAD NOT
instruction for any but the first condition on an instruction line.
Analyzing the above ladder diagram in terms of mnemonic instructions, the con-
dition for IR 00000 is a LOAD instruction and the condition below it is an OR in-
struction between the status of IR 00000 and that of IR 00001. The condition at
IR 00002 is another LOAD instruction and the condition below is an OR NOT
instruction, i.e., an OR between the status of IR 00002 and the inverse of the
status of IR 00003. To arrive at the execution condition for the instruction at the
right, the logical AND of the execution conditions resulting from these two blocks
will have to be taken. AND LOAD does this. The mnemonic code for the ladder
diagram is shown below. The AND LOAD instruction requires no operands of its
own, because it operates on previously determined execution conditions. Here
too, dashes are used to indicate that no operands needs designated or input.
OR LOAD The following diagram requires an OR LOAD instruction between the top logic
block and the bottom logic block. An ON execution condition will be produced for
49
Basic Ladder Diagrams Section 4-4
the instruction at the right either when IR 00000 is ON and IR 00001 is OFF, or
when IR 00002 and IR 00003 are both ON. The operation of the OR LOAD in-
struction and its mnemonic code is exactly the same as that for an AND LOAD
instruction, except that the current execution condition is ORed with the last un-
used execution condition.
00000 00001
Instruction
00002 00003
Naturally, some diagrams will require both AND LOAD and OR LOAD instruc-
tions.
Logic Block Instructions in To code diagrams with logic block instructions in series, the diagram must be
Series divided into logic blocks. Each block is coded using a LOAD instruction to code
the first condition, and then AND LOAD or OR LOAD is used to logically combine
the blocks. With both AND LOAD and OR LOAD there are two ways to achieve
this. One is to code the logic block instruction after the first two blocks and then
after each additional block. The other is to code all of the blocks to be combined,
starting each block with LOAD or LOAD NOT, and then to code the logic block
instructions which combine them. In this case, the instructions for the last pair of
blocks should be combined first, and then each preceding block should be com-
bined, working progressively back to the first block. Although either of these
methods will produce exactly the same result, the second method, that of coding
all logic block instructions together, can be used only if eight or fewer blocks are
being combined, i.e., if seven or fewer logic block instructions are required.
The following diagram requires AND LOAD to be converted to mnemonic code
because three pairs of parallel conditions lie in series. The two options for coding
the programs are also shown.
50
Basic Ladder Diagrams Section 4-4
Again, with the method on the right, a maximum of eight blocks can be com-
bined. There is no limit to the number of blocks that can be combined with the
first method.
The following diagram requires OR LOAD instructions to be converted to mne-
monic code because three pairs of series conditions lie in parallel to each other.
00000 00001
00501
00002 00003
00040 00005
The first of each pair of conditions is converted to LOAD with the assigned bit
operand and then ANDed with the other condition. The first two blocks can be
coded first, followed by OR LOAD, the last block, and another OR LOAD; or the
three blocks can be coded first followed by two OR LOADs. The mnemonic
codes for both methods are shown below.
Again, with the method on the right, a maximum of eight blocks can be com-
bined. There is no limit to the number of blocks that can be combined with the
first method.
Combining AND LOAD and Both of the coding methods described above can also be used when using AND
OR LOAD LOAD and OR LOAD, as long as the number of blocks being combined does not
exceed eight.
51
Basic Ladder Diagrams Section 4-4
The following diagram contains only two logic blocks as shown. It is not neces-
sary to further separate block b components, because it can be coded directly
using only AND and OR.
00000 00001 00002 00003
00501
00201
00004
Block Block
a b
Although the following diagram is similar to the one above, block b in the diagram
below cannot be coded without separating it into two blocks combined with OR
LOAD. In this example, the three blocks have been coded first and then OR
LOAD has been used to combine the last two blocks, followed by AND LOAD to
combine the execution condition produced by the OR LOAD with the execution
condition of block a.
When coding the logic block instructions together at the end of the logic blocks
they are combining, they must, as shown below, be coded in reverse order, i.e.,
the logic block instruction for the last two blocks is coded first, followed by the
one to combine the execution condition resulting from the first logic block in-
struction and the execution condition of the logic block third from the end, and on
back to the first logic block that is being combined.
Block
b1 Address Instruction Operands
00000 00001 00002 00003 00000 LD NOT 00000
00502
00001 AND 00001
00004 00202
00002 LD 00002
00003 AND NOT 00003
00004 LD NOT 00004
Block
b2 00005 AND 00202
00006 OR LD —
Block Block 00007 AND LD —
a b
00008 OUT 00502
Complicated Diagrams When determining what logic block instructions will be required to code a dia-
gram, it is sometimes necessary to break the diagram into large blocks and then
continue breaking the large blocks down until logic blocks that can be coded
without logic block instructions have been formed. These blocks are then coded,
combining the small blocks first, and then combining the larger blocks. Either
AND LOAD or OR LOAD is used to combine the blocks, i.e., AND LOAD or OR
LOAD always combines the last two execution conditions that existed, regard-
less of whether the execution conditions resulted from a single condition, from
logic blocks, or from previous logic block instructions.
52
Basic Ladder Diagrams Section 4-4
When working with complicated diagrams, blocks will ultimately be coded start-
ing at the top left and moving down before moving across. This will generally
mean that, when there might be a choice, OR LOAD will be coded before AND
LOAD.
The following diagram must be broken down into two blocks and each of these
then broken into two blocks before it can be coded. As shown below, blocks a
and b require an AND LOAD. Before AND LOAD can be used, however, OR
LOAD must be used to combine the top and bottom blocks on both sides, i.e., to
combine a1 and a2; b1 and b2.
Block Block
a1 b1 Address Instruction Operands
The following type of diagram can be coded easily if each block is coded in order:
first top to bottom and then left to right. In the following diagram, blocks a and b
would be combined using AND LOAD as shown above, and then block c would
be coded and a second AND LOAD would be used to combined it with the execu-
tion condition from the first AND LOAD. Then block d would be coded, a third
AND LOAD would be used to combine the execution condition from block d with
the execution condition from the second AND LOAD, and so on through to block
n.
00500
53
Basic Ladder Diagrams Section 4-4
Although the program will execute as written, this diagram could be drawn as
shown below to eliminate the need for the first OR LOAD and the AND LOAD,
simplifying the program and saving memory space.
The following diagram requires five blocks, which here are coded in order before
using OR LOAD and AND LOAD to combine them starting from the last two
blocks and working backward. The OR LOAD at program address 00008 com-
54
Basic Ladder Diagrams Section 4-4
bines blocks blocks d and e, the following AND LOAD combines the resulting
execution condition with that of block c, etc.
Again, this diagram can be redrawn as follows to simplify program structure and
coding and to save memory space.
The next and final example may at first appear very complicated but can be
coded using only two logic block instructions. The diagram appears as follows:
Block a
00500
Block b Block c
The first logic block instruction is used to combine the execution conditions re-
sulting from blocks a and b, and the second one is to combine the execution con-
dition of block c with the execution condition resulting from the normally closed
condition assigned IR 00003. The rest of the diagram can be coded with OR,
55
The Programming Console Section 4-5
AND, and AND NOT instructions. The logical flow for this and the resulting code
are shown below.
Block a Block b
LD 00000 LD 01000
AND 00001 AND 01001
Address Instruction Operands
OR LD 00000 LD 00000
00001 AND 00001
Block c
00002 LD 01000
00500 00004 00005
00003 AND 01001
00004 OR LD --
OR 00500 LD 00004
AND 00005 00005 OR 00500
00006 AND 00002
00002 00003 00006 00007 AND NOT 00003
00008 LD 00004
AND 00002 LD 00006 00009 AND 00005
AND NOT 00003
00010 OR 00006
AND LD 00011 AND LD --
00012 OUT 00500
00500
56
The Programming Console Section 4-5
57
The Programming Console Section 4-5
The gray keys other than the SHIFT key have either the mnemonic name of the
instruction or the abbreviation of the data area written on them. The functions of
these keys are described below.
4-5-2 PC Modes
The Programming Console is equipped with a switch to control the PC mode. To
select one of the three operating modes—RUN, MONITOR, or PROGRAM—
use the mode switch. The mode that you select will determine PC operation as
well as the procedures that are possible from the Programming Console.
58
The Programming Console Section 4-5
RUN mode is the mode used for normal program execution. When the switch is
set to RUN and the START input on the CPU Power Supply Unit is ON, the CPU
will begin executing the program according to the program written in its Program
Memory. Although monitoring PC operation from the Programming Console is
possible in RUN mode, no data in any of the memory areas can be input or
changed.
MONITOR mode allows you to visually monitor in-progress program execution
while controlling I/O status, changing PV (present values) or SV (set values),
etc. In MONITOR mode, I/O processing is handled in the same way as in RUN
mode. MONITOR mode is generally used for trial system operation and final pro-
gram adjustments.
In PROGRAM mode, the PC does not execute the program. PROGRAM mode
is for creating and changing programs, clearing memory areas, and registering
and changing the I/O table. A special Debug operation is also available within
PROGRAM mode that enables checking a program for correct execution before
trial operation of the system.
TERMINAL mode allows the display of a 32-character message, as well as oper-
ation of the keyboard mapping function. To enter TERMINAL mode, press the
CHG key or execute the TERMINAL Mode Change instruction (TERM(48)).
Mode Changes The factors that determine the PC’s initial operating mode (the mode when the
PC is turned on) are listed below in order of importance.
1, 2, 3... 1. Programming Console Mounted:
If the Programming Console is mounted to the PC when PC power is ap-
plied, the PC will enter the mode set on the Programming Console’s mode
switch.
2. Memory Unit’s Initial Mode Switch ON:
If a Programming Console is not mounted to the PC and the Initial Mode
Switch on the Memory Unit is ON, the PC will enter RUN mode.
3. Bit 01 of P ON:
If a Programming Console is not mounted to the PC, the Initial Mode Switch
on the Memory Unit is OFF, and bit 01 of operand P was ON when SYS(49)
was executed, the PC will enter RUN mode when turned ON.
4. Bit 01 of P OFF:
If a Programming Console is not mounted to the PC, the Initial Mode Switch
on the Memory Unit is OFF, bit 01 of operand P was OFF when SYS(49) was
executed, and no other peripheral devices* are connected to the PC, the PC
will enter RUN mode when turned ON. It will enter PROGRAM mode if a pe-
ripheral device* is connected.
Note *“Other peripheral device” refers to a Peripheral Interface Unit, PROM Writer,
Printer Interface Unit, or Floppy Disk Interface Unit.
If the PC power supply is already turned on when a Peripheral Device is attached
to the PC, the PC will stay in the same mode it was in before the peripheral de-
vice was attached. The mode can be changed with the mode switch on the Pro-
gramming Console once the password has been entered.
If it is necessary to have the PC in PROGRAM mode, (for the PROM Writer,
Floppy Disk Interface Unit, etc.), be sure to select this mode before connecting
the peripheral device; or, alternatively, apply power to the PC after the peripheral
device is connected.
The mode will not change when a peripheral device is removed from the PC after
PC power is turned on.
59
Preparation for Operation Section 4-6
! WARNING Always confirm that the Programming Console is in PROGRAM mode when
turning on the PC with a Programming Console connected unless another mode
is desired for a specific purpose. If the Programming Console is in RUN mode
when PC power is turned on, any program in Program Memory will be executed,
possibly causing a PC-controlled system to begin operation. If the START input
on the CPU Power Supply Unit is ON and there is no device connected to the
CPU, ensure that commencing operation is safe and appropriate before turning
on the PC.
60
Preparation for Operation Section 4-6
<PROGRAM>
PASSWORD
<PROGRAM> BZ
4-6-2 Buzzer
Immediately after the password is input or anytime immediately after the mode
has been changed, SHIFT and then the 1 key can be pressed to turn on and off
the buzzer that sounds when Programming Console keys are pressed. If BZ is
displayed in the upper right corner, the buzzer is operative. If BZ is not displayed,
the buzzer is not operative.
This buzzer also will also sound whenever an error occurs during PC operation.
Buzzer operation for errors is not affected by the above setting.
Before beginning to programming for the first time or when installing a new pro-
gram, all areas should normally be cleared. Before clearing memory, check to
see if a program is already loaded that you need. If you need the program, clear
only the memory areas that you do not need, and be sure to check the existing
program with the program check key sequence before using it. The check se-
quence is provided later in this section. Further debugging methods are pro-
vided in Section 7 Program Monitoring and Execution. To clear all memory areas
press CLR until all zeros are displayed, and then input the keystrokes given in
the top line of the following key sequence. The branch lines shown in the se-
quence are used only when performing a partial memory clear, which is de-
scribed below.
61
Preparation for Operation Section 4-6
Key Sequence
DM area
MEMORY ERR
Continue pressing
I/O VER ERR the CLR key once for
each error message
until “00000” appears
on the display
00000
00000
00000MEM CLR
END HR CNT DM
Partial Clear It is possible to retain the data in specified areas or part of the Program Memory.
To retain the data in the HR and AR, TC, and/or DM areas, press the appropriate
key after entering REC/RESET. HR is pressed to designate both the HR and AR
areas. In other words, specifying that HR is to be retained will ensure that AR is
retained also. If not specified for retention, both areas will be cleared. CNT is
used for the entire TC area. The display will show those areas that will be
cleared.
It is also possible to retain a portion of the Program Memory from the beginning
to a specified address. After designating the data areas to be retained, specify
the first Program Memory address to be cleared. For example, to leave ad-
dresses 00000 to 00122 untouched, but to clear addresses from 00123 to the
end of Program Memory, input 00123.
62
Preparation for Operation Section 4-6
00000
00000
00000
00000MEM CLR ?
HR CNT DM
00000MEM CLR ?
HR DM
00123MEM CLR ?
HR DM
00000MEM CLR
END HR DM
Key Sequence
63
Preparation for Operation Section 4-6
00000
00000
FUN (??)
00000I/OTBL?
?Ć?U=
Register I/O table
00000I/OTBL WRIT
????
00000I/OTBL WRIT
9713
00000I/OTBL WRIT
OK
Key Sequence
Key Sequence
64
Preparation for Operation Section 4-6
Example
00000
00000
FUN (??)
00000I/OTBL?
?Ć?U=
(No errors)
00000I/OTBL VER
OK
00000I/OTBL VER
(An error occurred)
0Ć1U=O*** I***
Meaning of Displays
00000I/OTBL VER
**=R*ĆI R*ĆW
Duplication
00000I/OTBL VER
*Ć*U=**** RMT*
Indicates a Remote I/O Unit
that has not been registered
65
Preparation for Operation Section 4-6
Key Sequence
[0 to 2] [0 to 9]
Rack Unit
number number
Example 00000
00000
FUN (??)
00000I/OTBL ?
R??Ć?U=
(Optical I/O Unit)
00000I/OTBL ?
2??LU=
00000I/OTBL ?
0Ć?U=
00000I/OTBL ?
0Ć5U=
00000I/OTBL READ
0Ć5U=i*** 005
00000I/OTBL READ
0Ć4U=o*** 004
00000I/OTBL READ
0Ć5U=i*** 005
Meaning of Displays
I/O Unit Designations for Displays (see I/O Units Mounted in Remote Slave Racks, next page)
66
Preparation for Operation Section 4-6
Unit number (0 to 9)
Rack number (0 to 2)
67
Preparation for Operation Section 4-6
I: Input Unit
O: Output Unit
Unit number (0 to 9)
Indicates Group-2 High-density I/O Unit
Note Group-2 High-density I/O Units will not be displayed in the I/O table when it is
displayed using a GPC, FIT, or LSS (host computer). Four asterisks (****), indi-
cating no Unit, will be displayed instead.
68
Preparation for Operation Section 4-6
Key Sequence
Example 00000
00000
FUN (??)
00000I/OTBL
?Ć?U=
00000I/OTBL WRIT
????
00000I/OTBL CLR
????
00000I/OTBL CLR
9713
00000I/OTBL CLR
OK
Note When power is applied to a PC which has a copy of a SYSMAC NET Link table
stored in its program memory, the SYSMAC NET Link table of the CPU will be
overwritten. Changes made in the SYSMAC NET Link table do not affect the
copy of the SYSMAC NET Link table in program memory; SYSMAC NET Link
Table Transfer must be repeated to change the copy in program memory.
The SYSMAC NET Link Table Transfer operation will not work if:
• The Memory Unit is not RAM or EEPROM, or the write protect switch is not set
to write.
• There isn’t an END(01) instruction.
• The contents of program memory exceeds 2.3K words with a 4K memory, or
6.4K words with an 8K memory. (To find the size of the contents of program
memory, do an instruction search for END(01).)
SYSMAC NET Link table transfer can only be done in PROGRAM mode.
69
Preparation for Operation Section 4-6
Key Sequence
Example 00000
00000
FUN(??)
00000LINK TBL~UM
(SYSMACĆNET)????
00000LINK TBL~UM
(SYSMACĆNET)9713
00000LINK TBL~UM
OK
The following indicates that the
I/O table cannot be transferred.
00000LINK TBL~UM
DISABLED
70
Inputting, Modifying, and Checking the Program Section 4-7
71
Inputting, Modifying, and Checking the Program Section 4-7
Example If the following mnemonic code has already been input into Program Memory,
the key inputs below would produce the displays shown.
00201READ ON
AND 00001
00202READ OFF
TIM 000
00202
TIM #0123
00203READ ON
LD 00100
72
Inputting, Modifying, and Checking the Program Section 4-7
value and press WRITE. To designate a word, press CLR and then input the
word address as described above.
Designating Instructions The most basic instructions are input using the Programming Console keys pro-
vided for them. All other instructions are entered using function codes. These
function codes are always written after the instruction’s mnemonic. If no function
code is given, there should be a Programming Console key for that instruction.
There are two types of function codes: those for normal instructions and those
for block instructions. Function codes for block instructions are always written
between pointed parentheses <like this>. Both types of function codes are used
in basically the same way, but SHIFT must be pressed before inputting a block
instruction function code.
To designate the differentiated form of an instruction, press NOT after the func-
tion code.
To input an instruction using a function code, set the address, press FUN, press
SHIFT if a block instruction is being entered, input the function code including
any leading zeros, press NOT if the differentiated form of the instruction is de-
sired, input any bit operands or definers required for the instruction, and then
press WRITE.
! Caution Enter function codes with care and be sure to press SHIFT when required.
Key Sequence
73
Inputting, Modifying, and Checking the Program Section 4-7
Example The following program can be entered using the key inputs shown below. Dis-
plays will appear as indicated.
00201READ
NOP (00)
00201
TIM 000
00201 TIM
#0123
00202READ
NOP (00)
00202
FUN (??)
00202
TIMH (15) 001
00202 TIMH
#0500
00203READ
NOP (00)
Error Messages The following error messages may appear when inputting a program. Correct
the error as indicated and continue with the input operation. The asterisks in the
74
Inputting, Modifying, and Checking the Program Section 4-7
displays shown below will be replaced with numeric data, normally an address,
in the actual display.
Key Sequence
To check
up to END(01)
To abort
Check Levels and Error Three levels of program checking are available. The desired level must be des-
Messages ignated to indicate the type of errors that are to be detected. The following table
provides the error types, displays, and explanations of all syntax errors. Check
level 0 checks for type A, B, and C errors; check level 1, for type A and B errors;
and check level 2, for type A errors only.
The address where the error was generated will also be displayed.
75
Inputting, Modifying, and Checking the Program Section 4-7
Many of the following errors are for instructions that have not yet been described
yet. Refer to 4-8 Controlling Bit Status or to Section 5 Instruction Set for details
on these.
Type Message Meaning and appropriate response
Type A ????? The program has been lost. Re-enter the program.
NO END INSTR There is no END(01) in the program. Write END(01) at the final address in the
program.
CIRCUIT ERR The number of logic blocks and logic block instructions does not agree, i.e., either
LD or LD NOT has been used to start a logic block whose execution condition has
not been used by another instruction, or a logic block instruction has been used
that does not have the required number of logic blocks. Check your program.
LOCN ERR An instruction is in the wrong place in the program. Check instruction requirements
and correct the program.
DUPL The same jump number, block number, or subroutine number has been used
twice. Correct the program so that the same number is only used once for each.
(Jump number 00 may be used as often as required.)
SBN UNDEFD SBS(91) has been programmed for a subroutine number that does not exist.
Correct the subroutine number or program the required subroutine.
JME UNDEFD A JME(04) is missing for a JMP(05). Correct the jump number or insert the proper
JME(04).
OPERAND ERR A constant entered for the instruction is not within defined values. Change the
constant so that it lies within the proper range.
STEP ERR STEP(08) with a section number and STEP(08) without a section number have
been used correctly. Check STEP(08) programming requirements and correct the
program.
Type B ILĆILC ERR IL(02) and ILC(03) are not used in pairs. Correct the program so that each IL(02)
has a unique ILC(03). Although this error message will appear if more than one
IL(02) is used with the same ILC(03), the program will executed as written. Make
sure your program is written as desired before proceeding.
JMPĆJME ERR JMP(04) 00 and JME(05) 00 are not used in pairs. Although this error message will
appear if more than one JMP(04) 00 is used with the same JME(05) 00, the
program will be executed as written. Make sure your program is written as desired
before proceeding.
SBNĆRET ERR If the displayed address is that of SBN(92), two different subroutines have been
defined with the same subroutine number. Change one of the subroutine numbers
or delete one of the subroutines. If the displayed address is that of RET(93),
RET(93) has not been used properly. Check requirements for RET(93) and correct
the program.
Type C JMP UNDEFD JME(05) has been used with no JMP(04) with the same jump number. Add a
JMP(04) with the same number or delete the JME(05) that is not being used.
SBS UNDEFD A subroutine exists that is not called by SBS(91). Program a subroutine call in the
proper place, or delete the subroutine if it is not required.
COIL DUPL The same bit is being controlled (i.e., turned ON and/or OFF) by more than one
instruction (e.g., OUT, OUT NOT, DIFU(13), DIFD(14), KEEP(11), SFT(10),
SET<07>). Although this is allowed for certain instructions, check instruction
requirements to confirm that the program is correct or rewrite the program so that
each bit is controlled by only one instruction.
76
Inputting, Modifying, and Checking the Program Section 4-7
Example The following example shows some of the displays that can appear as a result of
a program check.
00000
00000PROG CHK
CHKLEVEL (0Ć2)?
00196COIL DUPL
OUT 00200
00200ILĆILC ERR
ILC (03)
32000NO ENDINSTR
END
00000
00000CYCLE TIME
054.1MS
00000CYCLE TIME
053.9MS
77
Inputting, Modifying, and Checking the Program Section 4-7
78
Inputting, Modifying, and Checking the Program Section 4-7
Example: 00000
Instruction Search
00000
LD 00000
00200SRCH
LD 00000
00202
LD 00000
06000SRCH
END (01)(06.4KW)
00000
00100
00100
TIM 001
00203SRCH
TIM 001
Example: 00000
Bit Search
00000CONT SRCH
CONT 00005
00200CONT SRCH
LD 00005
00203CONT SRCH
AND 00005
06000
END (01)(06.4K)
79
Inputting, Modifying, and Checking the Program Section 4-7
Key Sequences
Example The following mnemonic code shows the changes that are achieved in a pro-
gram through the key sequences and displays shown below.
Original Program
Address Instruction Operands
00000 LD 00100
00001 AND 00101
00002 LD 00201
00003 AND NOT 00102
00004 OR LD -
00005 AND 00103
00006 AND NOT 00104
00007 OUT 00201
00008 END(01) -
00201 00102
00201 00102 Delete
00105
END(01) END(01)
The following key inputs and displays show the procedure for achieving the pro-
gram changes shown above.
80
Inputting, Modifying, and Checking the Program Section 4-7
Inserting an Instruction
00000
00000
OUT 00201 Program After Insertion
Address Instruction Operands
00207SRCH 00000 LD 00100
OUT 00201 00001 AND 00101
00002 LD 00201
00206READ
00003 AND NOT 00102
AND NOT 00104 00004 OR LD -
00005 AND 00103
00206
00006 AND 00105
AND 00000 00007 AND NOT 00104
00008 OUT 00201
00206
00009 END(01) -
AND 00105
00206INSERT?
AND 00105
Insert the
00207INSERT END instruction
AND NOT 00104
00206READ
AND 00105
Deleting an Instruction
00000
00207DELETE END
OUT 00201 Confirm that this is the
instruction to be deleted.
00206READ
AND 00105
81
Inputting, Modifying, and Checking the Program Section 4-7
Branching
00000 point Address Instruction Operands
Instruction 1
00000 LD 00000
00002 00001 Instruction 1
Instruction 2
00002 AND 00002
00003 Instruction 2
Diagram A: Correct Operation
Branching
00000 point 00001
Instruction 1 Address Instruction Operands
00002 00000 LD 00000
Instruction 2
00001 AND 00001
Diagram B: Incorrect Operation 00002 Instruction 1
00003 AND 00002
00004 Instruction 2
If, as shown in diagram A, the execution condition that existed at the branching
point cannot be changed before returning to the branch line (instructions at the
far right do not change the execution condition), then the branch line will be ex-
ecuted correctly and no special programming measure is required.
If, as shown in diagram B, a condition exists between the branching point and the
last instruction on the top instruction line, the execution condition at the branch-
ing point and the execution condition after completing the top instruction line will
sometimes be different, making it impossible to ensure correct execution of the
branch line.
There are two means of programming branching programs to preserve the ex-
ecution condition. One is to use TR bits; the other, to use interlocks
(IL(02)/IL(03)).
TR Bits The TR area provides eight bits, TR 0 through TR 7, that can be used to tempo-
rarily preserve execution conditions. If a TR bit is placed at a branching point, the
current execution condition will be stored at the designated TR bit. When return-
ing to the branching point, the TR bit restores the execution status that was
saved when the branching point was first reached in program execution.
The previous diagram B can be written as shown below to ensure correct execu-
tion. In mnemonic code, the execution condition is stored at the branching point
using the TR bit as the operand of the OUTPUT instruction. This execution con-
82
Inputting, Modifying, and Checking the Program Section 4-7
dition is then restored after executing the right-hand instruction by using the
same TR bit as the operand of a LOAD instruction
In terms of actual instructions the above diagram would be as follows: The status
of IR 00000 is loaded (a LOAD instruction) to establish the initial execution con-
dition. This execution condition is then output using an OUTPUT instruction to
TR 0 to store the execution condition at the branching point. The execution con-
dition is then ANDed with the status of IR 00001 and instruction 1 is executed
accordingly. The execution condition that was stored at the branching point is
then re-loaded (a LOAD instruction with TR 0 as the operand), this is ANDed with
the status of IR 00002, and instruction 2 is executed accordingly.
The following example shows an application using two TR bits.
In this example, TR 0 and TR 1 are used to store the execution conditions at the
branching points. After executing instruction 1, the execution condition stored in
TR 1 is loaded for an AND with the status IR 00003. The execution condition
stored in TR 0 is loaded twice, the first time for an AND with the status of IR
00004 and the second time for an AND with the inverse of the status of IR 00005.
TR bits can be used as many times as required as long as the same TR bit is not
used more than once in the same instruction block. Here, a new instruction block
is begun each time execution returns to the bus bar. If, in a single instruction
block, it is necessary to have more than eight branching points that require the
execution condition be saved, interlocks (which are described next) must be
used.
When drawing a ladder diagram, be careful not to use TR bits unless necessary.
Often the number of instructions required for a program can be reduced and
ease of understanding a program increased by redrawing a diagram that would
otherwise required TR bits. In both of the following pairs of diagrams, the bottom
versions require fewer instructions and do not require TR bits. In the first exam-
ple, this is achieved by reorganizing the parts of the instruction block: the bottom
one, by separating the second OUTPUT instruction and using another LOAD in-
struction to create the proper execution condition for it.
83
Inputting, Modifying, and Checking the Program Section 4-7
Note Although simplifying programs is always a concern, the order of execution of in-
structions is sometimes important. For example, a MOVE instruction may be re-
quired before the execution of a BINARY ADD instruction to place the proper
data in the required operand word. Be sure that you have considered execution
order before reorganizing a program to simplify it.
TR 0
00000 00001
Instruction 1
Instruction 2
00000
Instruction 2
00001
Instruction 1
00000 00003
Instruction 1
TR 0
00001 00002
00004
Instruction 2
00000
00001 00004
Instruction 2
Note TR bits are only used when programming using mnemonic code. They are not
necessary when inputting ladder diagrams directly, as is possible from a GPC.
The above limitations on the number of branching points requiring TR bits, and
considerations on methods to reduce the number of programming instructions,
still hold.
Interlocks The problem of storing execution conditions at branching points can also be
handled by using the INTERLOCK (IL(02)) and INTERLOCK CLEAR (ILC(03))
instructions to eliminate the branching point completely while allowing a specific
execution condition to control a group of instructions. The INTERLOCK and IN-
TERLOCK CLEAR instructions are always used together.
When an INTERLOCK instruction is placed before a section of a ladder pro-
gram, the execution condition for the INTERLOCK instruction will control the ex-
ecution of all instruction up to the next INTERLOCK CLEAR instruction. If the
execution condition for the INTERLOCK instruction is OFF, all right-hand in-
structions through the next INTERLOCK CLEAR instruction will be executed
with OFF execution conditions to reset the entire section of the ladder diagram.
The effect that this has on particular instructions is described in 5-9 INTERLOCK
and INTERLOCK CLEAR – IL(02) and ILC(03).
84
Inputting, Modifying, and Checking the Program Section 4-7
Diagram B can also be corrected with an interlock. Here, the conditions leading
up to the branching point are placed on an instruction line for the INTERLOCK
instruction, all of lines leading from the branching point are written as separate
instruction lines, and another instruction line is added for the INTERLOCK
CLEAR instruction. No conditions are allowed on the instruction line for INTER-
LOCK CLEAR. Note that neither INTERLOCK nor INTERLOCK CLEAR re-
quires an operand.
00000
IL(02) Address Instruction Operands
00001 00000 LD 00000
Instruction 1 00001 IL(02) ---
00002 00002 LD 00001
Instruction 2 00003 Instruction 1
00004 LD 00002
ILC(03) 00005 Instruction 2
00006 ILC(03) ---
00000
IL(02)
Address Instruction Operands
00001 00000 LD 00000
Instruction 1 00001 IL(02) ---
00002 LD 00001
00002
IL(02) 00003 Instruction 1
00004 LD 00002
00003 00004
00005 IL(02) ---
Instruction 2
00006 LD 00003
00005
Instruction 3
00007 AND NOT 00004
00008 Instruction 2
00006
Instruction 4 00009 LD 00005
00010 Instruction 3
00011 LD 00006
ILC(03)
00012 Instruction 4
00013 ILC(03) ---
If IR 00000 in the above diagram is OFF (i.e., if the execution condition for the
first INTERLOCK instruction is OFF), instructions 1 through 4 would be ex-
ecuted with OFF execution conditions and execution would move to the instruc-
tion following the INTERLOCK CLEAR instruction. If IR 00000 is ON, the status
of IR 00001 would be loaded as the execution condition for instruction 1 and then
the status of IR 00002 would be loaded to form the execution condition for the
second INTERLOCK instruction. If IR 00002 is OFF, instructions 2 through 4 will
be executed with OFF execution conditions. If IR 00002 is ON, IR 00003, IR
00005, and IR 00006 will determine the first execution condition in new instruc-
tion lines.
85
Inputting, Modifying, and Checking the Program Section 4-7
4-7-8 Jumps
A specific section of a program can be skipped according to a designated execu-
tion condition. Although this is similar to what happens when the execution con-
dition for an INTERLOCK instruction is OFF, with jumps, the operands for all in-
structions maintain status. Jumps can therefore be used to control devices that
require a sustained output, e.g., pneumatics and hydraulics, whereas interlocks
can be used to control devices that do not required a sustained output, e.g., elec-
tronic instruments.
Jumps are created using the JUMP (JMP(04)) and JUMP END (JME(05)) in-
structions. If the execution condition for a JUMP instruction is ON, the program is
executed normally as if the jump did not exist. If the execution condition for the
JUMP instruction is OFF, program execution moves immediately to a JUMP
END instruction without changing the status of anything between the JUMP and
JUMP END instruction.
All JUMP and JUMP END instructions are assigned jump numbers ranging be-
tween 00 and 99. There are two types of jumps. The jump number used deter-
mines the type of jump.
A jump can be defined using jump numbers 01 through 99 only once, i.e., each of
these numbers can be used once in a JUMP instruction and once in a JUMP
END instruction. When a JUMP instruction assigned one of these numbers is
executed, execution moves immediately to the JUMP END instruction that has
the same number as if all of the instruction between them did not exist. Diagram
B from the TR bit and interlock example could be redrawn as shown below using
a jump. Although 01 has been used as the jump number, any number between
01 and 99 could be used as long as it has not already been used in a different part
of the program. JUMP and JUMP END require no other operand and JUMP END
never has conditions on the instruction line leading to it.
00000
JMP(04) 01 Address Instruction Operands
00001 00000 LD 00000
Instruction 1
00001 JMP(04) 01
00002 00002 LD 00001
Instruction 2
00003 Instruction 1
00004 LD 00002
JME(05) 01
00005 Instruction 2
00006 JME(05) 015
Diagram B: Corrected with a Jump
This version of diagram B would have a shorter execution time when 00000 was
OFF than any of the other versions.
The other type of jump is created with a jump number of 00. As many jumps as
desired can be created using jump number 00 and JUMP instructions using 00
can be used consecutively without a JUMP END using 00 between them. It is
even possible for all JUMP 00 instructions to move program execution to the
same JUMP END 00, i.e., only one JUMP END 00 instruction is required for all
JUMP 00 instruction in the program. When 00 is used as the jump number for a
JUMP instruction, program execution moves to the instruction following the next
JUMP END instruction with a jump number of 00. Although, as in all jumps, no
status is changed and no instructions are executed between the JUMP 00 and
JUMP END 00 instructions, the program must search for the next JUMP END 00
instruction, producing a slightly longer execution time.
Execution of programs containing multiple JUMP 00 instructions for one JUMP
END 00 instruction is similar to that of interlocked sections. The following dia-
gram is the same as that used for the interlock example above, except redrawn
with jumps. The execution of this diagram would differ from that of the diagram
described above (e.g., in the previous diagram interlocks would reset certain
86
Controlling Bit Status Section 4-8
parts of the interlocked section, however, jumps do not affect the status of any bit
between the JUMP and JUMP END instructions).
00000
JMP(04) 00 Address Instruction Operands
00001
00000 LD 00000
Instruction 1 00001 JMP(04) 00
00002 LD 00001
00002
00003 Instruction 1
JMP(04) 00
00004 LD 00002
00003 00004 00005 JMP(04) 00
Instruction 2
00006 LD 00003
00005 00007 AND NOT 00004
Instruction 3
00008 Instruction 2
00006
00009 LD 00005
Instruction 4
00010 Instruction 3
00011 LD 00006
JME(05) 00
00012 Instruction 4
00013 JME(05) 00
Here, IR 00200 will be turned ON for one cycle after IR 00000 goes ON. The next
time DIFU(13) 00200 is executed, IR 00200 will be turned OFF, regardless of the
status of IR 00000. With the DIFFERENTIATE DOWN instruction, IR 00201 will
be turned ON for one cycle after IR 00001 goes OFF (IR 00201 will be kept OFF
until then), and will be turned OFF the next time DIFD(14) 00201 is executed.
87
Work Bits Section 4-9
4-8-2 KEEP
The KEEP instruction is used to maintain the status of the operand bit based on
two execution conditions. To do this, the KEEP instruction is connected to two
instruction lines. When the execution condition at the end of the first instruction
line is ON, the operand bit of the KEEP instruction is turned ON. When the exe-
cution condition at the end of the second instruction line is ON, the operand bit of
the KEEP instruction is turned OFF. The operand bit for the KEEP instruction will
maintain its ON or OFF status even if it is located in an interlocked section of the
diagram.
In the following example, HR 0000 will be turned ON when IR 00002 is ON and IR
00003 is OFF. HR 0000 will then remain ON until either IR 00004 or IR 00005
turns ON. With KEEP, as with all instructions requiring more than one instruction
line, the instruction lines are coded first before the instruction that they control.
88
Work Bits Section 4-9
achieved by using work bits. Sometimes entire words are required for these pur-
poses. These words are referred to as work words.
Work bits are not transferred to or from the PC. They are bits selected by the
programmer to facilitate programming as described above. I/O bits and other
dedicated bits cannot be used as works bits. All bits in the IR area that are not
allocated as I/O bits, and certain unused bits in the AR area, are available for use
as work bits. Be careful to keep an accurate record of how and where you use
work bits. This helps in program planning and writing, and also aids in debugging
operations.
Work Bit Applications Examples given later in this subsection show two of the most common ways to
employ work bits. These should act as a guide to the almost limitless number of
ways in which the work bits can be used. Whenever difficulties arise in program-
ming a control action, consideration should be given to work bits and how they
might be used to simplify programming.
Work bits are often used with the OUTPUT, OUTPUT NOT, DIFFERENTIATE
UP, DIFFERENTIATE DOWN, and KEEP instructions. The work bit is used first
as the operand for one of these instructions so that later it can be used as a con-
dition that will determine how other instructions will be executed. Work bits can
also be used with other instructions, e.g., with the SHIFT REGISTER instruction
(SFT(10)). An example of the use of work words and bits with the SHIFT REGIS-
TER instruction is provided 5-14-1 SHIFT REGISTER – SFT(10).
Although they are not always specifically referred to as work bits, many of the
bits used in the examples in Section 5 Instruction Set use work bits. Understand-
ing the use of these bits is essential to effective programming.
Reducing Complex Work bits can be used to simplify programming when a certain combination of
Conditions conditions is repeatedly used in combination with other conditions. In the follow-
ing example, IR 00000, IR 00001, IR 00002, and IR 00003 are combined in a
logic block that stores the resulting execution condition as the status of IR
24600. IR 24600 is then combined with various other conditions to determine
89
Work Bits Section 4-9
output conditions for IR 00100, IR 00101, and IR 00102, i.e., to turn the outputs
allocated to these bits ON or OFF.
00000 00001
Address Instruction Operands
24600 00000 LD 00000
00001 AND NOT 00001
00002 00002 OR 00002
00003 OR NOT 00003
00004 OUT 24600
00003 00005 LD 24600
00006 AND 00004
00007 AND NOT 00005
24600 00004 00005
00100
00008 OUT 00100
00009 LD 24600
00010 OR NOT 00004
24600 00005
00011 AND 00005
00101
00012 OUT 00101
00013 LD NOT 24600
00004
00014 OR 00006
00015 OR 00007
24600 00016 OUT 00102
00102
00006
00007
Differentiated Conditions Work bits can also be used if differential treatment is necessary for some, but not
all, of the conditions required for execution of an instruction. In this example, IR
00100 must be left ON continuously as long as IR 00001 is ON and both IR
00002 and IR 00003 are OFF, or as long as IR 00004 is ON and IR 00005 is OFF.
It must be turned ON for only one cycle each time IR 00000 turns ON (unless one
of the preceding conditions is keeping it ON continuously).
This action is easily programmed by using IR 22500 as a work bit as the operand
of the DIFFERENTIATE UP instruction (DIFU(13)). When IR 00000 turns ON, IR
22500 will be turned ON for one cycle and then be turned OFF the next cycle by
DIFU(13). Assuming the other conditions controlling IR 00100 are not keeping it
ON, the work bit IR 22500 will turn IR 00100 ON for one cycle only.
00000
Address Instruction Operands
DIFU(13) 22500
00000 LD 00000
22500 00001 DIFU(13) 22500
00100
00002 LD 22500
00001 00002 00003 00003 LD 00001
00004 AND NOT 00002
00004 00005 00005 AND NOT 00003
00006 OR LD ---
00007 LD 00004
00008 AND NOT 00005
00009 OR LD ---
00010 OUT 00100
90
Programming Precautions Section 4-10
00000 00002
Instruction 1
00004
00001 00003
Instruction 2
Diagram A
The number of times any particular bit can be assigned to conditions is not lim-
ited, so use them as many times as required to simplify your program. Often,
complicated programs are the result of attempts to reduce the number of times a
bit is used.
Except for instructions for which conditions are not allowed (e.g., INTERLOCK
CLEAR and JUMP END, see below), every instruction line must also have at
least one condition on it to determine the execution condition for the instruction
at the right. Again, diagram A , below, must be drawn as diagram B. If an instruc-
tion must be continuously executed (e.g., if an output must always be kept ON
while the program is being executed), the Always ON Flag (SR 25313) in the SR
area can be used.
Instruction
Diagram A: Incorrect
25313
Instruction Address Instruction Operands
00000 LD 25313
Diagram B 00001 Instruction
There are a few exceptions to this rule, including the INTERLOCK CLEAR,
JUMP END, and step instructions. Each of these instructions is used as the sec-
ond of a pair of instructions and is controlled by the execution condition of the
91
Program Execution Section 4-11
first of the pair. Conditions should not be placed on the instruction lines leading to
these instructions. Refer to Section 5 Instruction Set for details.
When drawing ladder diagrams, it is important to keep in mind the number of
instructions that will be required to input it. In diagram A, below, an OR LOAD
instruction will be required to combine the top and bottom instruction lines. This
can be avoided by redrawing as shown in diagram B so that no AND LOAD or OR
LOAD instructions are required. Refer to 5-7-2 AND LOAD and OR LOAD for
more details and Section 7 Program Monitoring and Execution for further exam-
ples.
Diagram B
92
SECTION 5
Instruction Set
The C200H PC has a large programming instruction set that allows for easy programming of complicated control processes.
This section explains instructions individually and provides the ladder diagram symbol, data areas, and flags used with each.
The many instructions provided by the C200H are organized in the following subsections by instruction group. These groups
include Ladder Diagram Instructions, Bit Control Instructions, Timer and Counter Instructions, Data Shifting Instructions,
Data Movement Instructions, Data Comparison Instructions, Data Conversion Instructions, BCD Calculation Instructions,
Binary Calculation Instructions, Logic Instructions, Subroutines, Special Instructions, and Network Instructions.
Some instructions, such as Timer and Counter instructions, are used to control execution of other instructions, e.g., a TIM
Completion Flag might be used to turn ON a bit when the time period set for the timer has expired. Although these other
instructions are often used to control output bits through the Output instruction, they can be used to control execution of other
instructions as well. The Output instructions used in examples in this manual can therefore generally be replaced by other
instructions to modify the program for specific applications other than controlling output bits directly.
5-1 Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
5-2 Instruction Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
5-3 Data Areas, Definer Values, and Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
5-4 Differentiated Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
5-5 Coding Right-hand Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
5-6 Instruction Set Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
5-6-1 Function Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
5-6-2 Alphabetic List by Mnemonic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
5-7 Ladder Diagram Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
5-7-1 LOAD, LOAD NOT, AND, AND NOT, OR, and OR NOT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
5-7-2 AND LOAD and OR LOAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
5-8 Bit Control Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
5-8-1 OUTPUT and OUTPUT NOT – OUT and OUT NOT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
5-8-2 DIFFERENTIATE UP and DOWN – DIFU(13) and DIFD(14) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
5-8-3 KEEP – KEEP(11) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
5-9 INTERLOCK and INTERLOCK CLEAR – IL(02) and ILC(03) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
5-10 JUMP and JUMP END – JMP(04) and JME(05) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
5-11 END – END(01) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
5-12 NO OPERATION – NOP(00) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
5-13 Timer and Counter Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
5-13-1 TIMER – TIM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
5-13-2 HIGH-SPEED TIMER – TIMH(15) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
5-13-3 COUNTER – CNT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
5-13-4 REVERSIBLE COUNTER – CNTR(12) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
5-14 Data Shifting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
5-14-1 SHIFT REGISTER – SFT(10) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
5-14-2 REVERSIBLE SHIFT REGISTER – SFTR(84) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
5-14-3 ARITHMETIC SHIFT LEFT – ASL(25) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
5-14-4 ARITHMETIC SHIFT RIGHT – ASR(26) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
5-14-5 ROTATE LEFT – ROL(27) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
5-14-6 ROTATE RIGHT – ROR(28) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
5-14-7 ONE DIGIT SHIFT LEFT – SLD(74) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
5-14-8 ONE DIGIT SHIFT RIGHT – SRD(75) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
5-14-9 WORD SHIFT – WSFT(16) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
5-14-10 REVERSIBLE WORD SHIFT – RWS(17) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
5-15 Data Movement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
5-15-1 MOVE – MOV(21) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
5-15-2 MOVE NOT – MVN(22) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
5-15-3 COLUMN-TO-WORD – CTW(63) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
5-15-4 WORD-TO-COLUMN – WTC(64) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
5-15-5 BLOCK SET – BSET(71) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
5-15-6 BLOCK TRANSFER – XFER(70) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
5-15-7 DATA EXCHANGE – XCHG(73) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
5-15-8 SINGLE WORD DISTRIBUTE – DIST(80) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
5-15-9 DATA COLLECT – COLL(81) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
5-15-10 MOVE BIT – MOVB(82) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
5-15-11 MOVE DIGIT – MOVD(83) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
93
5-16 Data Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
5-16-1 MULTI-WORD COMPARE – MCMP(19) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
5-16-2 COMPARE – CMP(20) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
5-16-3 DOUBLE COMPARE – CMPL(60) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
5-16-4 BLOCK COMPARE – BCMP(68) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
5-16-5 TABLE COMPARE – TCMP(85) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
5-17 Data Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
5-17-1 BCD-TO-BINARY – BIN(23) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
5-17-2 DOUBLE BCD-TO-DOUBLE BINARY – BINL(58) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
5-17-3 BINARY-TO-BCD – BCD(24) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
5-17-4 DOUBLE BINARY-TO-DOUBLE BCD – BCDL(59) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
5-17-5 HOURS-TO-SECONDS – HTS(65) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
5-17-6 SECONDS-TO-HOURS – STH(66) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
5-17-7 4-TO-16 DECODER – MLPX(76) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
5-17-8 16-TO-4 ENCODER – DMPX(77) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
5-17-9 7-SEGMENT DECODER – SDEC(78) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
5-17-10 ASCII CONVERT – ASC(86) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
5-18 BCD Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
5-18-1 INCREMENT – INC(38) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
5-18-2 DECREMENT – DEC(39) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
5-18-3 SET CARRY – STC(40) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
5-18-4 CLEAR CARRY – CLC(41) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
5-18-5 BCD ADD – ADD(30) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
5-18-6 DOUBLE BCD ADD – ADDL(54) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
5-18-7 BCD SUBTRACT – SUB(31) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
5-18-8 DOUBLE BCD SUBTRACT – SUBL(55) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
5-18-9 BCD MULTIPLY – MUL(32) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
5-18-10 DOUBLE BCD MULTIPLY – MULL(56) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
5-18-11 BCD DIVIDE – DIV(33) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
5-18-12 DOUBLE BCD DIVIDE – DIVL(57) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
5-18-13 FLOATING POINT DIVIDE – FDIV(79) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
5-18-14 SQUARE ROOT – ROOT(72) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
5-19 Binary Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
5-19-1 BINARY ADD – ADB(50) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
5-19-2 BINARY SUBTRACT – SBB(51) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
5-19-3 BINARY MULTIPLY – MLB(52) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
5-19-4 BINARY DIVIDE – DVB(53) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
5-20 Logic Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
5-20-1 COMPLEMENT – COM(29) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
5-20-2 LOGICAL AND – ANDW(34) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
5-20-3 LOGICAL OR – ORW(35) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
5-20-4 EXCLUSIVE OR – XORW(36) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
5-20-5 EXCLUSIVE NOR – XNRW(37) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
5-21 Subroutines and Interrupt Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
5-21-1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
5-21-2 SUBROUTINE DEFINE and RETURN – SBN(92)/RET(93) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
5-21-3 SUBROUTINE ENTER – SBS(91) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
5-21-4 INTERRUPT CONTROL – INT(89) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
5-22 Step Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
5-22-1 STEP DEFINE and STEP START–STEP(08)/SNXT(09) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
5-23 Special Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
5-23-1 FAILURE ALARM – FAL(06) and SEVERE FAILURE ALARM – FALS(07) . . . . . . . . . . . . . . . . 197
5-23-2 CYCLE TIME – SCAN(18) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
5-23-3 MESSAGE DISPLAY – MSG(46) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
5-23-4 LONG MESSAGE – LMSG(47) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
5-23-5 TERMINAL MODE – TERM(48) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
5-23-6 SET SYSTEM – SYS(49) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
5-23-7 BIT COUNTER – BCNT(67) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
5-23-8 VALUE CALCULATE – VCAL(69) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
5-23-9 WATCHDOG TIMER REFRESH – WDT(94) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
5-23-10 I/O REFRESH – IORF(97) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
5-23-11 GROUP-2 HIGH-DENSITY I/O REFRESH – MPRF(61) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
5-24 Network Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
5-24-1 NETWORK SEND – SEND(90) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
5-24-2 NETWORK RECEIVE – RECV(98) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
5-24-3 About Network Communications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
94
Data Areas, Definer Values, and Flags Section 5-3
5-1 Notation
In the remainder of this manual, all instructions will be referred to by their mne-
monics. For example, the Output instruction will be called OUT; the AND Load
instruction, AND LD. If you’re not sure of the instruction a mnemonic is used for,
refer to Appendix B Programming Instructions.
If an instruction is assigned a function code, it will be given in parentheses after
the mnemonic. These function codes, which are 2-digit decimal numbers, are
used to input most instructions into the CPU and are described briefly below and
in more detail in 4-7 Inputting, Modifying, and Checking the Program. A table of
instructions listed in order of function codes, is also provided in Appendix B.
An @ before a mnemonic indicates the differentiated version of that instruction.
Differentiated instructions are explained in 5-4 Differentiated Instructions.
! Caution The IR and SR areas are considered as separate data areas. If an operand has
access to one area, it doesn’t necessarily mean that the same operand will have
access to the other area. The border between the IR and SR areas can, howev-
er, be crossed for a single operand, i.e., the last bit in the IR area may be speci-
fied for an operand that requires more than one word as long as the SR area is
also allowed for that operand.
95
Differentiated Instructions Section 5-4
The Flags subsection lists flags that are affected by execution of an instruction.
These flags include the following SR area flags.
Abbreviation Name Bit
ER Instruction Execution Error Flag 25503
CY Carry Flag 25504
GR Greater Than Flag 25505
EQ Equals Flag 25506
LE Less Than Flag 25507
DM 1111 5555
DM 1113 2506 5555 moved
DM 1114 D541 to LR 00.
When using indirect addressing, the address of the desired word must be in BCD
and it must specify a word within the DM area. In the above example, the content
of *DM 0000 would have to be in BCD between 0000 and 1999.
Designating Constants Although data area addresses are most often given as operands, many oper-
ands and all definers are input as constants. The available value range for a
given definer or operand depends on the particular instruction that uses it. Con-
stants must also be entered in the form required by the instruction, i.e., in BCD or
in hexadecimal.
96
Coding Right-hand Instructions Section 5-5
show how this works with MOV(21) and @MOV(21), which are used to move the
data in the address designated by the first operand to the address designated by
the second operand.
00000
Address Instruction Operands
MOV(21)
HR 10
00000 LD 00000
00001 MOV(21)
Diagram A DM 0000
HR 10
DM 0000
00000
@MOV(21) Address Instruction Operands
HR 10 00000 LD 00000
Diagram B DM 0000 00001 @MOV(21)
HR 10
DM 0000
97
Coding Right-hand Instructions Section 5-5
The address and instruction columns of the mnemonic code table are filled in for
the instruction word only. For all other lines, the left two columns are left blank. If
the instruction requires no definer or bit operand, the data column is left blank for
first line. It is a good idea to cross through any blank data column spaces (for all
instruction words that do not require data) so that the data column can be quickly
cycled to see if any addresses have been left out.
If an IR or SR address is used in the data column, the left side of the column is left
blank. If any other data area is used, the data area abbreviation is placed on the
left side and the address is place on the right side. If a constant to be input, the
number symbol (#) is placed on the left side of the data column and the number
to be input is placed on the right side. Any numbers input as definers in the in-
struction word do not require the number symbol on the right side. TC bits, once
defined as a timer or counter, take a TIM (timer) or CNT (counter) prefix.
When coding an instruction that has a function code, be sure to write in the func-
tion code, which will be necessary when inputting the instruction via the Pro-
gramming Console. Also be sure to designate the differentiated instruction with
the @ symbol.
The following diagram and corresponding mnemonic code illustrates the points
described above.
00000 00001
Address Instruction Data
DIFU(13) 22500 00000 LD 00000
00002 00001 AND 00001
00002 OR 00002
00100 00200 22500 00003 DIFU(13) 22500
BCNT(67)
00004 LD 00100
01001 01002 LR 6300 #0001
00005 AND NOT 00200
004
00006 LD 01001
HR 00
00007 AND NOT 01002
00008 AND NOT LR 6300
00005 00009 OR LD --
TIM 000
00010 AND 22500
#0150
00011 BCNT(67) --
TIM 000 # 0001
MOV(21)
004
HR 00
HR 00
LR 00
00012 LD 00005
00013 TIM 000
HR 0015
00500 # 0150
00014 LD TIM 000
00015 MOV(21) --
HR 00
LR 00
00016 LD HR 0015
00017 OUT NOT 00500
Multiple Instruction Lines If a right-hand instruction requires multiple instruction lines (such as KEEP(11)),
all of the lines for the instruction are entered before the right-hand instruction.
Each of the lines for the instruction is coded, starting with LD or LD NOT, to form
98
Coding Right-hand Instructions Section 5-5
‘logic blocks’ that are combined by the right-hand instruction. An example of this
for SFT(10) is shown below.
END(01) When you have finished coding the program, make sure you have placed
END(01) at the last address.
99
Instruction Set Lists Section 5-6
1 SFT KEEP CNTR DIFU DIFD TIMH (@) WSFT (@) RWS (@) SCAN (@) MCMP
SHIFT KEEP REVERS- DIFFEREN- DIFFEREN- HIGH- WORD REVERS- CYCLE TIME MULTI-
REGISTER IBLE TIATE UP TIATE DOWN SPEED SHIFT IBLE WORD WORD
COUNTER TIMER SHIFT COMPARE
2 CMP (@) MOV (@) MVN (@) BIN (@) BCD (@) ASL (@) ASR (@) ROL (@) ROR (@) COM
COMPARE MOVE MOVE NOT BCD TO BINARY TO SHIFT LEFT SHIFT ROTATE ROTATE COMPLE-
BINARY BCD RIGHT LEFT RIGHT MENT
3 (@) ADD (@) SUB (@) MUL (@) DIV (@) ANDW (@) ORW (@) XORW (@) XNRW (@) INC (@) DEC
BCD ADD BCD BCD BCD LOGICAL LOGICAL OR EXCLUSIVE EXCLUSIVE INCREMENT DECRE-
SUBTRACT MULTIPLY DIVIDE AND OR NOR MENT
4 (@) STC (@) CLC (@) MSG (@) LMSG (@) TERM SYS
SET CARRY CLEAR MESSAGE LONG TERMINAL SET
CARRY DISPLAY MESSAGE MODE SYSTEM
5 (@) ADB (@) SBB (@) MLB (@) DVB (@) ADDL (@) SUBL (@) MULL (@) DIVL (@) BINL (@) BCDL
BINARY ADD BINARY BINARY BINARY DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE
SUBTRACT MULTIPLY DIVIDE BCD ADD BCD BCD BCD BCD-TO- BINARY-TO-
SUBTRACT MULTIPLY DIVIDE DOUBLE DOUBLE
BINARY BCD
6 CMPL (@) MPRF (@) CTW (@) WTC (@) HTS (@) STH (@) BCNT (@) BCMP (@) VCAL
DOUBLE GROUP-2 COLUMN- WORD-TO- HOURS-TO- SECONDS- BIT BLOCK VALUE
COMPARE HIGH-DEN- TO-WORD COLUMN SECONDS TO-HOURS COUNTER COMPARE CALCULATE
SITY I/O RE-
FRESH
7 (@) XFER (@) BSET (@) ROOT (@) XCHG (@) SLD (@) SRD (@) MLPX (@) DMPX (@) SDEC (@) FDIV
BLOCK BLOCK SET SQUARE DATA ONE DIGIT ONE DIGIT 4-TO-16 16-TO-4 7-SEGMENT FLOATING
TRANSFER ROOT EXCHANGE SHIFT LEFT SHIFT DECODER ENCODER DECODER POINT
RIGHT DIVIDE
8 (@) DIST (@) COLL (@) MOVB (@) MOVD (@) SFTR (@) TCMP (@) ASC (@) INT
SINGLE DATA MOVE BIT MOVE DIGIT REVERS- TABLE ASCII INTERRUPT
WORD COLLECT IBLE SHIFT COMPARE CONVERT CONTROL
DISTRIBUTE REGISTER
9 (@) SEND (@) SBS SBN RET (@) WDT (@) IORF (@) RECV
NETWORK SUBROU- SUBROU- SUBROU- WATCHDOG I/O NETWORK
SEND TINE TINE TINE TIMER REFRESH RECEIVE
ENTRY DEFINE RETURN REFRESH
100
Instruction Set Lists Section 5-6
101
Ladder Diagram Instructions Section 5-7
5-7-1 LOAD, LOAD NOT, AND, AND NOT, OR, and OR NOT
Ladder Symbols Operand Data Areas
B B: Bit
LOAD – LD
IR, SR, AR, HR, TC, LR, TR
B B: Bit
LOAD NOT – LD NOT
IR, SR, AR, HR, TC, LR
B B: Bit
AND – AND
IR, SR, AR, HR, TC, LR
B B: Bit
AND NOT – AND NOT
IR, SR, AR, HR, TC, LR
B: Bit
OR – OR B
IR, SR, AR, HR, TC, LR
B: Bit
OR NOT – OR NOT B
IR, SR, AR, HR, TC, LR
Limitations There is no limit to the number of any of these instructions, or restrictions in the
order in which they must be used, as long as the memory capacity of the PC is
not exceeded.
Description These six basic instructions correspond to the conditions on a ladder diagram.
As described in Section 4 Writing and Inputting the Program, the status of the
bits assigned to each instruction determines the execution conditions for all
other instructions. Each of these instructions and each bit address can be used
as many times as required. Each can be used in as many of these instructions as
required.
The status of the bit operand (B) assigned to LD or LD NOT determines the first
execution condition. AND takes the logical AND between the execution condi-
102
Bit Control Instructions Section 5-8
tion and the status of its bit operand; AND NOT, the logical AND between the
execution condition and the inverse of the status of its bit operand. OR takes the
logical OR between the execution condition and the status of its bit operand; OR
NOT, the logical OR between the execution condition and the inverse of the
status of its bit operand. The ladder symbol for loading TR bits is different from
that shown above. Refer to 4-4-3 Ladder Instructions for details.
OR LOAD – OR LD
00000 00001
Ladder Symbol
00002 00003
Description When instructions are combined into blocks that cannot be logically combined
using only OR and AND operations, AND LD and OR LD are used. Whereas
AND and OR operations logically combine a bit status and an execution condi-
tion, AND LD and OR LD logically combine two execution conditions, the current
one and the last unused one.
In order to draw ladder diagrams, it is not necessary to use AND LD and OR LD
instructions, nor are they necessary when inputting ladder diagrams directly, as
is possible from the GPC. They are required, however, to convert the program to
and input it in mnemonic form. The procedures for these, limitations for different
procedures, and examples are provided in 4-7 Inputting, Modifying, and Check-
ing the Program.
In order to reduce the number of programming instructions required, a basic un-
derstanding of logic block instructions is required. For an introduction to logic
blocks, refer to 4-4-6 Logic Block Instructions.
103
Bit Control Instructions Section 5-8
B: Bit
B
IR, SR, AR, HR, TC, LR, TR
B: Bit
B
IR, SR, AR, HR, TC, LR
Limitations Any output bit can generally be used in only one instruction that controls its sta-
tus. Refer to 3-3 IR Area for details.
Description OUT and OUT NOT are used to control the status of the designated bit according
to the execution condition.
OUT turns ON the designated bit for an ON execution condition, and turns OFF
the designated bit for an OFF execution condition. With a TR bit, OUT appears at
a branching point rather than at the end of an instruction line. Refer to 4-7-7
Branching Instruction Lines for details.
OUT NOT turns ON the designated bit for a OFF execution condition, and turns
OFF the designated bit for an ON execution condition.
OUT and OUT NOT can be used to control execution by turning ON and OFF bits
that are assigned to conditions on the ladder diagram, thus determining execu-
tion conditions for other instructions. This is particularly helpful and allows a
complex set of conditions to be used to control the status of a single work bit, and
then that work bit can be used to control other instructions.
The length of time that a bit is ON or OFF can be controlled by combining the
OUT or OUT NOT with TIM. Refer to Examples under 5-13-1 TIMER – TIM for
details.
B: Bit
DIFU(13) B
IR, AR, HR, LR
B: Bit
DIFD(14) B
IR, AR, HR, LR
Limitations Any output bit can generally be used in only one instruction that controls its sta-
tus. Refer to 3-3 IR Area for details.
Description DIFU(13) and DIFD(14) are used to turn the designated bit ON for one cycle
only.
Whenever executed, DIFU(13) compares its current execution with the previous
execution condition. If the previous execution condition was OFF and the cur-
rent one is ON, DIFU(13) will turn ON the designated bit. If the previous execu-
104
Bit Control Instructions Section 5-8
tion condition was ON and the current execution condition is either ON or OFF,
DIFU(13) will either turn the designated bit OFF or leave it OFF (i.e., if the desig-
nated bit is already OFF). The designated bit will thus never be ON for longer
than one cycle, assuming it is executed each cycle (see Precautions, below).
Whenever executed, DIFD(14) compares its current execution with the previous
execution condition. If the previous execution condition was ON and the current
one is OFF, DIFD(14) will turn ON the designated bit. If the previous execution
condition was OFF and the current execution condition is either ON or OFF,
DIFD(14) will either turn the designated bit OFF or leave it OFF. The designated
bit will thus never be ON for longer than one cycle, assuming it is executed each
cycle (see Precautions, below).
These instructions are used when differentiated instructions (i.e., those prefixed
with an @) are not available and single-cycle execution of a particular instruction
is desired. They can also be used with non-differentiated forms of instructions
that have differentiated forms when their use will simplify programming. Exam-
ples of these are shown below.
Precautions DIFU(13) and DIFD(14) operation can be uncertain when the instructions are
programmed between IL and ILC, between JMP and JME, or in subroutines. Re-
fer to 5-9 INTERLOCK and INTERLOCK CLEAR – IL(02) and ILC(03), 5-10
JUMP and JUMP END – JMP(04) and JME(05), and 5-21 Subroutines and Inter-
rupt Control for details.
00000
Address Instruction Operands
CMP(20)
00000 LD 00000
HR 10
00001 CMP(20)
Diagram A DM 0000
HR 10
DM 0000
00000
DIFU(13) 22500
Address Instruction Operands
22500 00000 LD 00000
CMP(20)
00001 DIFU(13) 22500
HR 10 00002 LD 22500
Diagram B DM 0000 00003 CMP(20)
HR 10
DM 0000
105
Bit Control Instructions Section 5-8
00000
Address Instruction Operands
DIFU(13) 22500
00000 LD 00000
22500 00001 DIFU(13) 22500
MOV(21) 00002 LD 22500
00001 00002 00003 HR 10 00003 LD 00001
DM 0000 00004 AND NOT 00002
00004 00005 00005 AND NOT 00003
00006 OR LD ---
00007 LD 00004
00008 AND NOT 00005
00009 OR LD ---
00010 MOV(21)
HR 10
DM 0000
KEEP(11) B: Bit
B IR, AR, HR, LR
R
Limitations Any output bit can generally be used in only one instruction that controls its sta-
tus. Refer to 3-3 IR Area for details.
Description KEEP(11) is used to maintain the status of the designated bit based on two exe-
cution conditions. These execution conditions are labeled S and R. S is the set
input; R, the reset input. KEEP(11) operates like a latching relay that is set by S
and reset by R.
When S turns ON, the designated bit will go ON and stay ON until reset, regard-
less of whether S stays ON or goes OFF. When R turns ON, the designated bit
will go OFF and stay OFF until reset, regardless of whether R stays ON or goes
OFF. The relationship between execution conditions and KEEP(11) bit status is
shown below.
S execution condition
R execution condition
Status of B
106
Bit Control Instructions Section 5-8
using KEEP(11) requires one less instruction to program and would maintain
status even in an interlocked program section.
00002
S Address Instruction Operands
KEEP(11) 00000 LD 00002
00001 LD 00003
00003 B
R
00002 KEEP(11) 00500
Precautions Exercise caution when using a KEEP reset line that is controlled by an external
normally closed device. Never use an input bit in an inverse condition on the re-
set (R) for KEEP(11) when the input device uses an AC power supply. The delay
in shutting down the PC’s DC power supply (relative to the AC power supply to
the input device) can cause the designated bit of KEEP(11) to be reset. This situ-
ation is shown below.
Input Unit
A S
KEEP(11)
NEVER A B
R
Bits used in KEEP are not reset in interlocks. Refer to the 5-9 INTERLOCK – and
INTERLOCK CLEAR IL(02) and ILC(03) for details.
Example If a HR bit or an AR bit is used, bit status will be retained even during a power
interruption. KEEP(11) can thus be used to program bits that will maintain status
after restarting the PC following a power interruption. An example of this that can
be used to produce a warning display following a system shutdown for an emer-
gency situation is shown below. Bits 00002, 00003, and 00004 would be turned
ON to indicate some type of error. Bit 00005 would be turned ON to reset the
warning display. HR 0000, which is turned ON when any one of the three bits
107
INTERLOCK and INTERLOCK CLEAR – IL(02) and ILC(03) Section 5-9
HR 0000 Activates
00500 warning
display
KEEP(11) can also be combined with TIM to produce delays in turning bits ON
and OFF. Refer to 5-13-1 TIMER – TIM for details.
Description IL(02) is always used in conjunction with ILC(03) to create interlocks. Interlocks
are used to enable branching in the same way as can be achieved with TR bits,
but treatment of instructions between IL(02) and ILC(03) differs from that with
TR bits when the execution condition for IL(02) is OFF. If the execution condition
of IL(02) is ON, the program will be executed as written, with an ON execution
condition used to start each instruction line from the point where IL(02) is located
through the next ILC(03). Refer to 4-7-7 Branching Instruction Lines for basic
descriptions of both methods.
If the execution condition for IL(02) is OFF, the interlocked section between
IL(02) and ILC(03) will be treated as shown in the following table:
Instruction Treatment
OUT and OUT NOT Designated bit turned OFF.
TIM and TIMH(15) Reset.
CNT, CNTR(12) PV maintained.
KEEP(11) Bit status maintained.
DIFU(13) and DIFD(14) Not executed (see below).
All others Not executed.
IL(02) and ILC(03) do not necessarily have to be used in pairs. IL(02) can be
used several times in a row, with each IL(02) creating an interlocked section
through the next ILC(03). ILC(03) cannot be used unless there is at least one
IL(02) between it and any previous ILC(03).
DIFU(13) and DIFD(14) in Changes in the execution condition for a DIFU(13) or DIFD(14) are not recorded
Interlocks if the DIFU(13) or DIFD(14) is in an interlocked section and the execution condi-
tion for the IL(02) is OFF. When DIFU(13) or DIFD(14) is execution in an inter-
locked section immediately after the execution condition for the IL(02) has gone
ON, the execution condition for the DIFU(13) or DIFD(14) will be compared to
108
INTERLOCK and INTERLOCK CLEAR – IL(02) and ILC(03) Section 5-9
the execution condition that existed before the interlock became effective (i.e.,
before the interlock condition for IL(02) went OFF). The ladder diagram and bit
status changes for this are shown below. The interlock is in effect while 00000 is
OFF. Notice that 01000 is not turned ON at the point labeled A even though
00001 has turned OFF and then back ON.
00000
Address Instruction Operands
IL(02)
00001 00000 LD 00000
DIFU(13) 01000 00001 IL(02)
00002 LD 00001
ILC(03)
00003 DIFU(13) 01000
A 00004 ILC(03)
ON
00000 OFF
ON
00001 OFF
ON
01000 OFF
Example The following diagram shows IL(02) being used twice with one ILC(03).
When the execution condition for the first IL(02) is OFF, TIM 511 will be reset to
1.5 s, CNT 001 will not be changed, and 00502 will be turned OFF. When the
execution condition for the first IL(02) is ON and the execution condition for the
second IL(02) is OFF, TIM 511 will be executed according to the status of 00001,
CNT 001 will not be changed, and 00502 will be turned OFF. When the execution
conditions for both the IL(02) are ON, the program will execute as written.
109
JUMP and JUMP END – JMP(04) and JME(05) Section 5-10
N: Jump number
JMP(04) N
# (00 to 99)
N: Jump number
JME(05) N
# (00 to 99)
Limitations Jump numbers 01 through 99 may be used only once in JMP(04) and once in
JME(05), i.e., each can be used to define one jump only. Jump number 00 can be
used as many times as desired.
Description JMP(04) is always used in conjunction with JME(05) to create jumps, i.e., to skip
from one point in a ladder diagram to another point. JMP(04) defines the point
from which the jump will be made; JME(05) defines the destination of the jump.
When the execution condition for JMP(04) in ON, no jump is made and the pro-
gram is executed consecutively as written. When the execution condition for
JMP(04) is OFF, a jump is made to the JME(05) with the same jump number and
the instruction following JME(05) is executed next.
If the jump number for JMP(04) is between 01 and 99, jumps, when made, will go
immediately to JME(05) with the same jump number without executing any in-
structions in between. The status of timers, counters, bits used in OUT, bits used
in OUT NOT, and all other status bits controlled by the instructions between
JMP(04) and JMP(05) will not be changed. Each of these jump numbers can be
used to define only one jump. Because all of instructions between JMP(04) and
JME(05) are skipped, jump numbers 01 through 99 can be used to reduce cycle
time.
If the jump number for JMP(04) is 00, the CPU will look for the next JME(05) with
a jump number of 00. To do so, it must search through the program, causing a
longer cycle time (when the execution condition is OFF) than for other jumps.
The status of timers, counters, bits used in OUT, bits used in OUT NOT, and all
other status controlled by the instructions between JMP(04) 00 and JMP(05) 00
will not be changed. jump number 00 can be used as many times as desired. A
jump from JMP(04) 00 will always go to the next JME(05) 00 in the program. It is
thus possible to use JMP(04) 00 consecutively and match them all with the same
JME(05) 00. It makes no sense, however, to use JME(05) 00 consecutively, be-
cause all jumps made to them will end at the first JME(05) 00.
DIFU(13) and DIFD(14) in Although DIFU(13) and DIFD(14) are designed to turn ON the designated bit for
Jumps one cycle, they will not necessarily do so when written between JMP(04) and
JMP (05). Once either DIFU(13) or DIFD(14) has turned ON a bit, it will remain
ON until the next time DIFU(13) or DIFD(14) is executed again. In normal pro-
gramming, this means the next cycle. In a jump, this means the next time the
jump from JMP(04) to JME(05) is not made, i.e., if a bit is turned ON by DIFU(13)
or DIFD(14) and then a jump is made in the next cycle so that DIFU(13) or
DIFD(14) are skipped, the designated bit will remain ON until the next time the
execution condition for the JMP(04) controlling the jump is ON.
Precautions When JMP(04) and JME(05) are not used in pairs, an error message will appear
when the program check is performed. Although this message also appears if
JMP(04) 00 and JME(05) 00 are not used in pairs, the program will execute prop-
erly as written.
110
Timer and Counter Instructions Section 5-13
Description END(01) is required as the last instruction in any program. If there are subrou-
tines, END(01) is placed after the last subroutine. No instruction written after
END(01) will be executed. END(01) can be placed anywhere in the program to
execute all instructions up to that point, as is sometimes done to debug a pro-
gram, but it must be removed to execute the remainder of the program.
If there is no END(01) in the program, no instructions will be executed and the
error message “NO END INST” will appear.
Flags END(01) turns OFF the ER, CY, GR, EQ, and LE flags.
111
Timer and Counter Instructions Section 5-13
Note that “TIM 000” is used to designate the TIMER instruction defined with TC
number 000, to designate the Completion Flag for this timer, and to designate
the PV of this timer. The meaning of the term in context should be clear, i.e., the
first is always an instruction, the second is always a bit operand, and the third is
always a word operand. The same is true of all other TC numbers prefixed with
TIM or CNT.
An SV can be input as a constant or as a word address in a data area. If an IR
area word assigned to an Input Unit is designated as the word address, the Input
Unit can be wired so that the SV can be set externally through thumbwheel
switches or similar devices. Timers and counters wired in this way can only be
set externally during RUN or MONITOR mode. All SVs, including those set ex-
ternally, must be in BCD.
N: TC number
Ladder Symbol
# (000 through 511)
TIM N
SV
Operand Data Areas
Limitations SV is between 000.0 and 999.9. The decimal point is not entered.
Although the SV can take values between 0000 and 9999 (BCD; omitting the
decimal point), if the SV = 0, the Completion Flag will turn ON as soon as the
execution condition is satisfied. Also, since the timer accuracy is 0 to –0.1 s, if the
SV = 1 and the accuracy is –0.1, the Completion Flag will, again, turn ON as soon
as the execution condition is satisfied. Therefore, it is recommended that only
values in the range 0002 to 9999 (BCD) are set for the SV.
Each TC number can be used as the definer in only one TIMER or COUNTER
instruction.
TC 000 through TC 015 should not be used in TIM if they are required for
TIMH(15). Refer to 5-13-2 HIGH-SPEED TIMER – TIMH(15) for details.
Description A timer is activated when its execution condition goes ON and is reset (to SV)
when the execution condition goes OFF. Once activated, TIM measures in units
of 0.1 second from the SV.
If the execution condition remains ON long enough for TIM to time down to zero,
the Completion Flag for the TC number used will turn ON and will remain ON
until TIM is reset (i.e., until its execution condition is goes OFF).
The following figure illustrates the relationship between the execution condition
for TIM and the Completion Flag assigned to it.
ON
Execution condition OFF
ON
Completion Flag OFF
SV SV
Precautions Timers in interlocked program sections are reset when the execution condition
for IL(02) is OFF. Power interruptions also reset timers. If a timer that is not reset
112
Timer and Counter Instructions Section 5-13
under these conditions is desired, SR area clock pulse bits can be counted to
produce timers using CNT. Refer to 5-13-3 COUNTER – CNT for details.
Program execution will continue even if a non-BCD SV is used, but timing will not
be accurate.
Examples All of the following examples use OUT in diagrams that would generally be used
to control output bits in the IR area. There is no reason, however, why these dia-
grams cannot be modified to control execution of other instructions.
Example 1: The following example shows two timers, one set with a constant and one set via
Basic Application input word 005. Here, 00200 will be turned ON after 00000 goes ON and stays
ON for at least 15 seconds. When 00000 goes OFF, the timer will be reset and
00200 will be turned OFF. When 00001 goes ON, TIM 001 is started from the SV
provided through IR word 005. Bit 00201 is also turned ON when 00001 goes
ON. When the SV in 005 has expired, 00201 is turned OFF. This bit will also be
turned OFF when TIM 001 is reset, regardless of whether or not SV has expired.
00000
TIM 000
Address Instruction Operands
#0150 015.0 s 00000 LD 00000
00001 TIM 000
TIM 000 # 0150
00200
00002 LD TIM 000
00001 00003 OUT 00200
TIM 001 00004 LD 00001
IR 005 IR 005 00005 TIM 001
005
TIM 001
00201 00006 AND NOT TIM 001
00007 OUT 00200
Example 2: There are two ways to achieve timers that operate for longer than 999.9 sec-
Extended Timers onds. One method is to program consecutive timers, with the Completion Flag of
each timer used to activate the next timer. A simple example with two 900.0-sec-
ond (15-minute) timers combined to functionally form a 30-minute timer.
00000
TIM 001
Address Instruction Operands
#9000 900.0 s 00000 LD 00000
TIM 001 00001 TIM 001
TIM 002 # 9000
#9000 900.0 s 00002 LD TIM 001
00003 TIM 002
TIM 002 # 9000
00200
00004 LD TIM 002
00005 OUT 00200
In this example, 00200 will be turned ON 30 minutes after 00000 goes ON.
TIM can also be combined with CNT or CNT can be used to count SR area clock
pulse bits to produce longer timers. An example is provided in 5-13-3 COUNTER
– CNT.
Example 3: TIM can be combined with KEEP(11) to delay turning a bit ON and OFF in refer-
ON/OFF Delays ence to a desired execution condition. KEEP(11) is described in 5-8-3 KEEP –
KEEP(11).
To create delays, the Completion Flags for two TIM are used to determine the
execution conditions for setting and reset the bit designated for KEEP(11). The
113
Timer and Counter Instructions Section 5-13
00000
TIM 001 Address Instruction Operands
#0050 005.0 s 00000 LD 00000
00500 00000
00001 TIM 001
TIM 002 # 0050
#0030 003.0 s 00002 LD 00500
TIM 001 00003 AND NOT 00000
S
00004 TIM 002
KEEP(11) # 0030
00500
00005 LD TIM 001
TIM 002
R 00006 LD TIM 002
00007 KEEP(11) 00500
00000
00500
5.0 s 3.0 s
Example 4: The length of time that a bit is kept ON or OFF can be controlled by combining
One-Shot Bits TIM with OUT or OUT NO. The following diagram demonstrates how this is pos-
sible. In this example, 00204 would remain ON for 1.5 seconds after 00000 goes
ON regardless of the time 00000 stays ON. This is achieved by using 01000 as a
self-maintaining bit activated by 00000 and turning ON 00204 through it. When
TIM 001 comes ON (i.e., when the SV of TIM 001 has expired), 00204 will be
turned OFF through TIM 001 (i.e., TIM 001 will turn ON which, as an inverse con-
dition, creates an OFF execution condition for OUT 00204).
00000
00204
1.5 s 1.5 s
114
Timer and Counter Instructions Section 5-13
00000
TIM 001
Address Instruction Operands
#0015 001.5 s
00000 LD 00000
00001 OR 00100
00100 TIM 001 00002 TIM 001
00100 # 0015
00003 AND NOT TIM 001
00004 OUT 00100
Example 5: Bits can be programmed to turn ON and OFF at regular intervals while a desig-
Flicker Bits nated execution condition is ON by using TIM twice. One TIM functions to turn
ON and OFF a specified bit, i.e., the Completion Flag of this TIM turns the speci-
fied bit ON and OFF. The other TIM functions to control the operation of the first
TIM, i.e., when the first TIM’s Completion Flag goes ON, the second TIM is
started and when the second TIM’s Completion Flag goes ON, the first TIM is
started.
00000
00205
A simpler but less flexible method of creating a flicker bit is to AND one of the SR
area clock pulse bits with the execution condition that is to be ON when the
flicker bit is operating. Although this method does not use TIM, it is included here
for comparison. This method is more limited because the ON and OFF times
must be the same and they depend on the clock pulse bits available in the SR
area.
In the following example the 1-second clock pulse is used (25502) so that 00206
would be turned ON and OFF every second, i.e., it would be ON for 0.5 seconds
and OFF for 0.5 seconds. Precise timing and the initial status of 00206 would
depend on the status of the clock pulse when 00000 goes ON.
115
Timer and Counter Instructions Section 5-13
N: TC number
Ladder Symbol
# (000 through 015 preferred)
TIMH(15) N
SV
Operand Data Areas
Limitations SV is between 00.00 and 99.99. (Although 00.00 and 00.01 may be set, 00.00
will disable the timer, i.e., turn ON the Completion Flag immediately, and 00.01 is
not reliably cycled.) The decimal point is not entered.
Each TC number can be used as the definer in only one TIMER or COUNTER
instruction.
TC 000 through TC 047 must be used to ensure accuracy if the cycle time is
greater than 10 ms.
Description TIMH(15) operates in the same way as TIM except that TIMH measures in units
of 0.01 second.
The cycle time affects TIMH(15) accuracy if TC 016 through TC 511 are used. If
the cycle time is greater than 10 ms, use TC 000 through TC 015.
Refer to 5-13-1 TIMER – TIM for operational details and examples. Except for
the above, and all aspects of operation are the same.
Precautions Timers in interlocked program sections are reset when the execution condition
for IL(02) is OFF. Power interruptions also reset timers. If a timer that is not reset
under these conditions is desired, SR area clock pulse bits can be counted to
produce timers using CNT. Refer to 5-13-3 COUNTER – CNT for details.
Program execution will continue even if a non-BCD SV is used, but timing will not
be accurate.
N: TC number
Ladder Symbol
# (000 through 511)
CP
CNT N
Limitations Each TC number can be used as the definer in only one TIMER or COUNTER
instruction.
116
Timer and Counter Instructions Section 5-13
Description CNT is used to count down from SV when the execution condition on the count
pulse, CP, goes from OFF to ON, i.e., the present value (PV) will be decre-
mented by one whenever CNT is executed with an ON execution condition for
CP and the execution condition was OFF for the last execution. If the execution
condition has not changed or has changed from ON to OFF, the PV of CNT will
not be changed. The Completion Flag for a counter is turned ON when the PV
reaches zero and will remain ON until the counter is reset.
CNT is reset with a reset input, R. When R goes from OFF to ON, the PV is reset
to SV. The PV will not be decremented while R is ON. Counting down from SV will
begin again when R goes OFF. The PV for CNT will not be reset in interlocked
program sections or by power interruptions.
Changes in execution conditions, the Completion Flag, and the PV are illus-
trated below. PV line height is meant only to indicate changes in the PV.
Execution condition ON
on count pulse (CP) OFF
Execution condition ON
on reset (R) OFF
ON
Completion Flag OFF
SV SV
PV SV – 1 0002
SV – 2 0001
0000
Precautions Program execution will continue even if a non-BCD SV is used, but the SV will
not be correct.
Example 1: In the following example, the PV will be decremented whenever both 00000 and
Basic Application 00001 are ON provided that 00002 is OFF and either 00000 or 00001 was OFF
the last time CNT 004 was executed. When 150 pulses have been counted down
(i.e., when PV reaches zero), 00205 will be turned ON.
00000 00001
CP Address Instruction Operands
CNT 004
00002 00000 LD 00000
R
#0150 00001 AND 00001
00002 LD 00002
CNT 004
00003 CNT 0004
00205
# 0150
00004 LD CNT 004
00005 OUT 00205
Here, 00000 can be used to control when CNT is operative and 00001 can be
used as the bit whose OFF to ON changes are being counted.
117
Timer and Counter Instructions Section 5-13
The above CNT can be modified to restart from SV each time power is turned ON
to the PC. This is done by using the First Cycle Flag in the SR area (25315) to
reset CNT as shown below.
00000 00001
CP Address Instruction Operands
CNT 004
00002 00000 LD 00000
R
#0150 00001 AND 00001
25315 00002 LD 00002
00003 OR 25315
00004 CNT 004
CNT 004
00205 # 0150
00005 LD CNT 004
00006 OUT 00205
Example 2: Counters that can count past 9,999 can be programmed by using one CNT to
Extended Counter count the number of times another CNT has counted to zero from SV.
In the following example, 00000 is used to control when CNT 001 operates. CNT
001, when 00000 is ON, counts down the number of OFF to ON changes in
00001. CNT 001 is reset by its Completion Flag, i.e., it starts counting again as
soon as its PV reaches zero. CNT 002 counts the number of times the Comple-
tion Flag for CNT 001 goes ON. Bit 00002 serves as a reset for the entire ex-
tended counter, resetting both CNT 001 and CNT 002 when it is OFF. The Com-
pletion Flag for CNT 002 is also used to reset CNT 001 to inhibit CNT 001 opera-
tion, once SV for CNT 002 has been reached, until the entire extended counter is
reset via 00002.
Because in this example the SV for CNT 001 is 100 and the SV for CNT 002 is
200, the Completion Flag for CNT 002 turns ON when 100 x 200 or 20,000 OFF
to ON changes have been counted in 00001. This would result in 00203 being
turned ON.
00000 00001
CP Address Instruction Operands
CNT 001
00000 LD 00000
00002 #0100 00001 AND 00001
R
00002 LD NOT 00002
CNT 001
00003 OR CNT 001
00004 OR CNT 002
00005 CNT 001
CNT 002 # 0100
00006 LD CNT 001
CNT 001
00007 LD NOT 00002
CP 00008 CNT 002
CNT 002
# 0200
00002 #0200 00009 LD CNT 002
R
00010 OUT 00203
CNT 002
00203
118
Timer and Counter Instructions Section 5-13
tween when the Completion Flag for TIM 001 goes ON and TIM 001 is reset by
its Completion Flag). TIM 001 is also reset by the Completion Flag for CNT 002
so that the extended timer would not start again until CNT 002 was reset by
00001, which serves as the reset for the entire extended timer.
Because in this example the SV for TIM 001 is 5.0 seconds and the SV for CNT
002 is 100, the Completion Flag for CNT 002 turns ON when 5 seconds x 100
times, i.e., 500 seconds (or 8 minutes and 20 seconds) have expired. This would
result in 00201 being turned ON.
00000 TIM 001 CNT 002
TIM 001
Address Instruction Operands
#0050 005.0 s 00000 LD 00000
TIM 001 00001 AND NOT TIM 001
CP
00002 AND NOT CNT 002
CNT
002 00003 TIM 001
00001
# 0050
#0100
R 00004 LD TIM 001
CNT 002 00005 LD 00001
00201 00006 CNT 002
# 0100
00007 LD CNT 002
00008 OUT 00201
In the following example, CNT 001 counts the number of times the 1-second
clock pulse bit (25502) goes from OFF to ON. Here again, 00000 is used to con-
trol the times when CNT is operating.
Because in this example the SV for CNT 001 is 700, the Completion Flag for
CNT 002 turns ON when 1 second x 700 times, or 11 minutes and 40 seconds
have expired. This would result in 00202 being turned ON.
00000 25502
CP Address Instruction Operands
CNT
001 00000 LD 00000
00001 00001 AND 25502
R
#0700
00002 LD NOT 00001
CNT 001
00003 CNT 001
0202 # 0700
00004 LD CNT 001
00005 OUT 00202
! Caution The shorter clock pulses will not necessarily produce accurate timers because
their short ON times might not be read accurately during longer cycles. In partic-
ular, the 0.02-second and 0.1-second clock pulses should not be used to create
timers with CNT instructions.
N: TC number
Ladder Symbol
# (000 through 511)
II
CNTR(12)
DI N
Operand Data Areas
SV
R
SV: Set value (word, BCD)
119
Timer and Counter Instructions Section 5-13
Limitations Each TC number can be used as the definer in only one TIMER or COUNTER
instruction.
Description The CNTR(12) is a reversible, up/down circular counter, i.e., it is used to count
between zero and SV according to changes in two execution conditions, those in
the increment input (II) and those in the decrement input (DI).
The present value (PV) will be incremented by one whenever CNTR(12) is exe-
cuted with an ON execution condition for II and the last execution condition for II
was OFF. The present value (PV) will be decremented by one whenever
CNTR(12) is executed with an ON execution condition for DI and the last execu-
tion condition for DI was OFF. If OFF to ON changes have occurred in both II and
DI since the last execution, the PV will not be changed.
If the execution conditions have not changed or have changed from ON to OFF
for both II and DI, the PV of CNT will not be changed.
When decremented from 0000, the present value is set to SV and the Comple-
tion Flag is turned ON until the PV is decremented again. When incremented
past the SV, the PV is set to 0000 and the Completion Flag is turned ON until the
PV is incremented again.
CNTR(12) is reset with a reset input, R. When R goes from OFF to ON, the PV is
reset to zero. The PV will not be incremented or decremented while R is ON.
Counting will begin again when R goes OFF. The PV for CNTR(12) will not be
reset in interlocked program sections or by the effects of power interruptions.
Changes in II and DI execution conditions, the Completion Flag, and the PV are
illustrated below starting from part way through CNTR(12) operation (i.e., when
reset, counting begins from zero). PV line height is meant to indicate changes in
the PV only.
Execution condition ON
on increment (II) OFF
Execution condition ON
on decrement (DI) OFF
ON
Completion Flag OFF
SV SV
PV SV – 1 SV – 1
0001
SV – 2 SV – 2
0000 0000
Precautions Program execution will continue even if a non-BCD SV is used, but the SV will
not be correct.
120
Data Shifting Section 5-14
R E: End word
E
Limitations E must be less than or equal to St, and St and E must be in the same data area.
If a bit address in one of the words used in a shift register is also used in an in-
struction that controls individual bit status (e.g., OUT, KEEP(11)), an error
(“COIL DUPL”) will be generated when program syntax is checked on the Pro-
gramming Console or another Programming Device. The program, however,
will be executed as written. See Example 2: Controlling Bits in Shift Registers for
a programming example that does this.
Lost
data Execution
condition I
121
Data Shifting Section 5-14
Example 1: The following example uses the 1-second clock pulse bit (25502) so that the
Basic Application execution condition produced by 00005 is shifted into a 3-word register between
IR 010 and IR 012 every second.
00005
I Address Instruction Operands
SFT(10)
25502 00000 LD 00005
P
010 00001 LD 25502
00006 00002 LD 00006
R
012
00003 SFT(10)
010
012
Example 2: The following program is used to control the status of the 17th bit of a shift regis-
Controlling Bits in Shift ter running from AR 00 through AR 01. When the 17th bit is to be set, 00004 is
Registers turned ON. This causes the jump for JMP(04) 00 not to be made for that one
cycle, and AR 0100 (the 17th bit) will be turned ON. When 12800 is OFF (i.e., at
all times except during the first cycle after 00004 has changed from OFF to ON),
the jump is executed and the status of AR 0100 will not be changed.
00200 00201
I Address Instruction Operands
When a bit that is part of a shift register is used in OUT (or any other instruction
that controls bit status), a syntax error will be generated during the program
check, but the program will executed properly (i.e., as written).
Example 3: The following program controls the conveyor line shown below so that faulty
Control Action products detected at the sensor are pushed down a shoot. To do this, the execu-
tion condition determined by inputs from the first sensor (00001) are stored in a
shift register: ON for good products; OFF for faulty ones. Conveyor speed has
been adjusted so that HR 0003 of the shift register can be used to activate a
pusher (00500) when a faulty product reaches it, i.e., when HR 0003 turns ON,
00500 is turned ON to activate the pusher.
The program is set up so that a rotary encoder (00000) controls execution of
SFT(10) through a DIFU(13), the rotary encoder is set up to turn ON and OFF
each time a product passes the first sensor. Another sensor (00002) is used to
122
Data Shifting Section 5-14
detect faulty products in the shoot so that the pusher output and HR 0003 of the
shift register can be reset as required.
Sensor
(00001)
Pusher
(00500)
Sensor
Rotary Encoder (00002)
(00000)
Chute
HR 0003
Limitations St and E must be in the same data area and St must be less than or equal
to E.
Description SFTR(84) is used to create a single- or multiple-word shift register that can shift
data to either the right or the left. To create a single-word register, designate the
same word for St and E. The control word provides the shift direction, the status
123
Data Shifting Section 5-14
to be put into the register, the shift pulse, and the reset input. The control word is
allocated as follows:
15 14 13 12 Not used.
Shift direction
1 (ON): Left (LSB to MSB)
0 (OFF): Right (MSB to LSB)
Reset
The data in the shift register will be shifted one bit in the direction indicated by bit
12, shifting one bit out to CY and the status of bit 13 into the other end whenever
SFTR(84) is executed with an ON execution condition as long as the reset bit is
OFF and as long as bit 14 is ON. If SFTR(84) is executed with an OFF execution
condition or if SFTR(84) is executed with bit 14 OFF, the shift register will remain
unchanged. If SFTR(84) is executed with an ON execution condition and the re-
set bit (bit 15) is OFF, the entire shift register and CY will be set to zero.
Flags ER: St and E are not in the same data area or ST is greater than E.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
Example In the following example, IR 00005, IR 00006, IR 00007, and IR 00008 are used
to control the bits of C used in @SHIFT(84). The shift register is between LR 20
and LR 21, and it is controlled through IR 00009.
00005
Address Instruction Operands
05012 Direction
00000 LD 00005
00001 OUT 05012
00006 00002 LD 00006
05013 Status to input 00003 OUT 05013
00004 LD 00007
00005 OUT 00514
00007 00006 LD 00008
05014 Shift pulse
00007 OUT 05015
00008 LD 00009
00008 00009 @SFT(10)
05015 Reset 050
LR 20
00009 LR 21
@SFTR(84)
050
LR 20
LR 21
124
Data Shifting Section 5-14
Description When the execution condition is OFF, ASL(25) is not executed. When the execu-
tion condition is ON, ASL(25) shifts a 0 into bit 00 of Wd, shifts the bits of Wd one
bit to the left, and shifts the status of bit 15 into CY.
Bit Bit
CY 15 00
1 0 0 1 1 1 0 0 0 1 0 1 0 0 1 1
0
Description When the execution condition is OFF, ASR(25) is not executed. When the exe-
cution condition is ON, ASR(25) shifts a 0 into bit 15 of Wd, shifts the bits of Wd
one bit to the right, and shifts the status of bit 00 into CY.
Bit Bit
15 00 CY
1 1 0 0 1 0 1 1 0 0 1 1 0 0 1 0
0
125
Data Shifting Section 5-14
Description When the execution condition is OFF, ROL(27) is not executed. When the exe-
cution condition is ON, ROL(27) shifts all Wd bits one bit to the left, shifting CY
into bit 00 of Wd and shifting bit 15 of Wd into CY.
Bit Bit
CY 15 00
0 1 0 1 1 0 0 1 1 1 0 0 0 1 1 0 1
Precautions Use STC(41) to set the status of CY or CLC(41) to clear the status of CY before
doing a rotate operation to ensure that CY contains the proper status before ex-
ecution ROL(27).
Description When the execution condition is OFF, ROR(28) is not executed. When the exe-
cution condition is ON, ROR(28) shifts all Wd bits one bit to the right, shifting CY
into bit 15 of Wd and shifting bit 00 of Wd into CY.
Bit Bit
CY 15 00
0 0 1 0 1 0 1 0 0 0 1 1 1 0 0 0 1
Precautions Use STC(41) to set the status of CY or CLC(41) to clear the status of CY before
doing a rotate operation to ensure that CY contains the proper status before ex-
ecution ROR(28).
126
Data Shifting Section 5-14
Limitations St and E must be in the same data area, and E must be greater than or equal to
St.
Description When the execution condition is OFF, SLD(74) is not executed. When the execu-
tion condition is ON, SLD(74) shifts data between St and E (inclusive) by one
digit (four bits) to the left. 0 is written into the rightmost digit of the St, and the
content of the leftmost digit of E is lost.
E ... St
8 F C 5 D 7 9 1
Lost data 0
Precautions If a power failure occurs during a shift operation across more than 50 words, the
shift operation might not be completed.
Flags ER: The St and E words are in different areas, or St is greater than E.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
Limitations St and E must be in the same data area, and E must be less than or equal to St.
Description When the execution condition is OFF, SRD(75) is not executed. When the exe-
cution condition is ON, SRD(75) shifts data between St and E (inclusive) by one
digit (four bits) to the right. 0 is written into the leftmost digit of St and the right-
most digit of E is lost.
St E
...
3 4 5 2 F 8 C 1
0 Lost data
Precautions If a power failure occurs during a shift operation across more than 50 words, the
shift operation might not be completed.
Flags ER: The St and E words are in different areas, or St is less than E.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
127
Data Shifting Section 5-14
Limitations St and E must be in the same data area, and E must be greater than or equal to
St.
Description When the execution condition is OFF, WSFT(16) is not executed. When the exe-
cution condition is ON, WSFT(16) shifts data between St and E in word units.
Zeros are written into St and the content of E is lost.
E St + 1 St
F 0 C 2 3 4 5 2 1 0 2 9
Lost
0000
E St + 1 St
3 4 5 2 1 0 2 9 0 0 0 0
Flags ER: The St and E words are in different areas, or St is greater than E.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
C: Control word
Ladder Symbols
IR, SR, AR, DM, HR, TC, LR, #
RWS(17) RWS(17) St: Starting word
C C IR, AR, DM, HR, LR
St St
E: End word
E E IR, AR, DM, HR, LR
Limitations St and E must be in the same data area, and E must be less than or equal to St.
Description When the execution condition is OFF, RWS(17) does nothing and the program
moves to the next instruction. When the execution condition is ON, RWS(17) is
used to create and control a reversible asynchronous word shift register be-
tween St and E. This register only shifts words when the next word in the register
is zero, e.g., if no words in the register contain zero, nothing is shifted. Also, only
one word is shifted for each word in the register that contains zero. When the
128
Data Movement Section 5-15
contents of a word are shifted to the next word, the original word’s contents are
set to zero. In essence, when the register is shifted, each zero word in the regis-
ter trades places with the next word. (See Example below.)
The shift direction (i.e. whether the “next word” is the next higher or the next low-
er word) is designated in C. C is also used to reset the register. All of any portion
of the register can be reset by designating the desired portion with St and E.
Control Word Bits 00 through 12 of C are not used. Bit 13 is the shift direction: turn bit 13 ON to
shift down (toward lower addressed words) and OFF to shift up (toward higher
addressed words). Bit 14 is the Shift Enable Bit: turn bit 14 ON to enable shift
register operation according to bit 13 and OFF to disable the register. Bit 15 is the
Reset bit: the register will be reset (set to zero) between St and E when RWS(17)
is executed with bit 15 ON. Turn bit 15 OFF for normal operation.
Flags ER: The St and E words are in different areas, or St is greater than E.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
Example The following example shows instruction RWS(17) used to shift words in an
11-word shift register created between DM 0100 and DM 0110 assuming that
HR 1215 (the Reset Bit in the control word) is ON, the entire register would be set
to 0000. The data changes that would occur for the given register and control
word contents are also shown.
Before After
execution execution
129
Data Movement Section 5-15
Description When the execution condition is OFF, MOV(21) is not executed. When the exe-
cution condition is ON, MOV(21) copies the content of S to D.
Bit status
not changed.
Description When the execution condition is OFF, MVN(22) is not executed. When the exe-
cution condition is ON, MVN(22) transfers the inverted content of S (specified
word or four-digit hexadecimal constant) to D, i.e., for each ON bit in S, the corre-
sponding bit in D is turned OFF, and for each OFF bit in S, the corresponding bit
in D is turned ON.
Bit status
inverted.
130
Data Movement Section 5-15
Description When the execution condition is OFF, CTW(63) is not executed. When the exe-
cution condition is ON, CTW(63) copies bit column C from the 16-word set (S to
S+15) to the 16 bits of word D (00 to 15).
Bit
C Bit
15 00
S 0 0 0 0 1 1 1 0 0 0 1 0 0 0 0 1
S+1 1 1 0 1 0 0 1 0 0 1 1 1 0 0 0 1
S+2 0 0 0 1 1 0 1 1 0 0 1 0 0 1 1 1
S+3 1 0 0 0 0 0 1 1 0 0 0 0 0 1 1 1
. . . .
. . . .
. . . .
S+15 0 1 1 1 0 0 0 1 1 0 0 0 1 0 1 0 Bit Bit
15 00
D 0 . . . 0 1 1 1
Flags ER: The column bit designator C is not BCD, or it is specifying a non-existent
bit (i.e., bit specification must be between 00 and 15).
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
Example The following example shows how to use CTW(63) to move bit column 07 from
the set (IR 100 to IR 115) to DM 0100.
00000
Address Instruction Operands
CTW(63)
100 00000 LD 00000
#0007
00001 CTW(63)
DM 0100
100
# 0007
DM 0100
131
Data Movement Section 5-15
Description When the execution condition is OFF, WTC(64) is not executed. When the exe-
cution condition is ON, WTC(64) copies the 16 bits of word S (00 to 15) to the
column of bits, C, of the 16-word set (D to D+15).
Bit Bit
15 00
S 0 . . . . . . . 0 1 1 1
Bit C Bit
15 00
D 0 0 0 0 1 1 1 0 0 0 1 0 0 0 0 1
D+1 1 1 0 1 0 0 1 0 0 1 1 1 0 0 0 1
D+2 0 0 0 1 1 0 1 1 0 0 1 0 0 1 1 1
D+3 1 0 0 0 0 0 1 1 0 0 0 0 0 1 1 1
. . . .
. . . .
. . . .
D+15 0 1 1 1 0 0 0 1 1 0 0 0 1 0 1 0
Flags ER: The bit designator C is not BCD, or it is specifying a non-existent bit (i.e.,
bit specification must be between 00 and 15).
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
Example The following example shows how to use WTC(64) to move the contents of word
DM 0100 (00 to 15) to bit column 15 of the set (DM 0200 to DM 0215).
00000
WTC(64)
Address Instruction Operands
DM 0100 00000 LD 00000
DM 0200 00001 WTC(64)
#0015 DM 0100
DM 0200
# 0015
132
Data Movement Section 5-15
Limitations St must be less than or equal to E, and St and E must be in the same data area.
Description When the execution condition is OFF, BSET(71) is not executed. When the exe-
cution condition is ON, BSET(71) copies the content of S to all words from St
through E.
S St
3 4 5 2 3 4 5 2
St+1
3 4 5 2
St+2
3 4 5 2
E
3 4 5 2
BSET(71) can be used to change timer/counter PV. (This cannot be done with
MOV(21) or MVN(22).) BSET(71) can also be used to clear sections of a data
area, i.e., the DM area, to prepare for executing other instructions.
Flags ER: St and E are not in the same data area or St is greater than E.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
Example The following example shows how to use BSET(71) to change the PV of a timer
depending on the status of IR 00003 and IR 00004. When IR 00003 is ON, TIM
133
Data Movement Section 5-15
010 will operate as a 50-second timer; when IR 00004 is ON, TIM 010 will oper-
ate as a 30-second timer.
Limitations Both S and D may be in the same data area, but their respective block areas
must not overlap. S and S+N must be in the same data area, as must D and D+N,
Description When the execution condition is OFF, XFER(70) is not executed. When the exe-
cution condition is ON, XFER(70) copies the contents of S, S+1, ..., S+N to D,
D+1, ..., D+N.
S D
3 4 5 2 3 4 5 2
S+1 D+1
3 4 5 1 3 4 5 1
S+2 D+2
3 4 2 2 3 4 2 2
S+N D+N
6 4 5 2 6 4 5 2
134
Data Movement Section 5-15
S and S+N or D and D+N are not in the same data area.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
Description When the execution condition is OFF, XCHG(73) is not executed. When the exe-
cution condition is ON, XCHG(73) exchanges the content of E1 and E2.
E1 E2
If you want to exchange content of blocks whose size is greater than 1 word, use
work words as an intermediate buffer to hold one of the blocks using XFER(70)
three times.
Limitations Of must be a BCD. DBs must be in the same data area as DBs+Of.
Description When the execution condition is OFF, DIST(80) is not executed. When the exe-
cution condition is ON, DIST(80) copies the content of S to DBs+Of, i.e.,Of is
added to DBs to determine the destination word.
S DBs + Of
3 4 5 2 3 4 5 2
Flags ER: The specified offset data is not BCD, or when added to the DBs, the re-
sulting address lies outside the data area of the DBs.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
135
Data Movement Section 5-15
Limitations Of must be a BCD. SBs must be in the same data area as SBs+Of.
Description When the execution condition is OFF, COLL(81) is not executed. When the exe-
cution condition is ON, COLL(81) copies the content of SBs + Of to D, i.e., Of is
added to SBs to determine the source word.
SBs + Of D
3 4 5 2 3 4 5 2
Flags ER: Of is not BCD, or when added to the SBs, or when added to the SBs, the
resulting address lies outside the data area of the SBs.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
Limitations The rightmost two digits and the leftmost two digits of Bi must each be between
00 and 15.
Description When the execution condition is OFF, MOVB(82) is not executed. When the exe-
cution condition is ON, MOVB(82) copies the specified bit of S to the specified bit
136
Data Movement Section 5-15
in D. The bits in S and D are specified by Bi. The rightmost two digits of Bi desig-
nate the source bit; the leftmost two bits designate the destination bit.
Bit Bit
15 00
Bi 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 1
Bi
Bit 1 2 0 1 Bit
MSB 1 2 0 1 LSB
15 00
S 0 1 0 1 0 1 0 0 0 1 1 1 0 0 0 1
Source bit (00 to 15)
Bit Bit
Destination bit (00 to 15) 15 00
D 0 1 0 0 0 1 0 0 0 1 1 1 0 0 0 1
Flags ER: C is not BCD, or it is specifying a non-existent bit (i.e., bit specification
must be between 00 and 15).
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
Digit number: 3 2 1 0
First digit in S (0 to 3)
Number of digits (0 to 3)
0: 1 digit
1: 2 digits
2: 3 digits
3: 4 digits
First digit in D (0 to 3)
Not used.
137
Data Comparison Section 5-16
Digit Designator The following show examples of the data movements for various values of Di.
Di: 0010 Di: 0030
S D S D
0 0 0 0
1 1 1 1
2 2 2 2
3 3 3 3
Flags ER: At least one of the rightmost three digits of Di is not between 0 and 3.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
Flags ER: One of the tables (i.e., TB1 through TB1+15, or TB2 through TB2+15)
exceeds the data area.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
138
Data Comparison Section 5-16
Example The following example shows the comparisons made and the results provided
for MCMP(19). Here, the comparison is made during each cycle when 00000 is
ON.
00000
MCMP(19)
Address Instruction Operands
100 00000 LD 00000
DM 0200 00001 MCMP(19)
DM 0300 100
DM 0200
DM 0300
Limitations When comparing a value to the PV of a timer or counter, the value must be in
BCD.
Description When the execution condition is OFF, CMP(20) is not executed. When the exe-
cution condition is ON, CMP(20) compares Cp1 and Cp2 and outputs the result
to the GR, EQ, and LE flags in the SR area.
Precautions Placing other instructions between CMP(20) and the operation which accesses
the EQ, LE, and GR flags may change the status of these flags. Be sure to ac-
cess them before the desired status is changed.
139
Data Comparison Section 5-16
Example 1: The following example shows how to save the comparison result immediately. If
Saving CMP(20) Results the content of HR 09 is greater than that of 010, 00200 is turned ON; if the two
contents are equal, 00201 is turned ON; if content of HR 09 is less than that of
010, 00202 is turned ON. In some applications, only one of the three OUTs would
be necessary, making the use of TR 0 unnecessary. With this type of program-
ming, 00200, 00201, and 00202 are changed only when CMP(20) is executed.
TR
0
00000
CMP(20)
HR 09
010
25505
00200 Greater Than
25506
00201 Equal
25507
00202 Less Than
Example 2: The following example uses TIM, CMP(20), and the LE flag (25507) to produce
Obtaining Indications outputs at particular times in the timer’s countdown. The timer is started by turn-
during Timer Operation ing ON 00000. When 00000 is OFF, TIM 010 is reset and the second two
CMP(20)s are not executed (i.e., executed with OFF execution conditions). Out-
put 00200 is produced after 100 seconds; output 00201, after 200 seconds; out-
put 00202, after 300 seconds; and output 00204, after 500 seconds.
The branching structure of this diagram is important in order to ensure that
00200, 00201, and 00202 are controlled properly as the timer counts down. Be-
140
Data Comparison Section 5-16
cause all of the comparisons here use to the timer’s PV as reference, the other
operand for each CMP(20) must be in 4-digit BCD.
00000
TIM 010
#5000 500.0 s
CMP(20)
TIM 010
#4000
25507
00200 Output at
100 s.
00200
CMP(20)
TIM 010
#3000
25507
00201 Output at
200 s.
00201
CMP(20)
TIM 010
#2000
25507
Output at
00202
300 s.
TIM 010
00204 Output at
500 s.
141
Data Comparison Section 5-16
Description When the execution condition is OFF, CMPL(60) is not executed. When the exe-
cution condition is ON, CMPL(60) joins the 4-digit hexadecimal content of
Cp1+1 with that of Cp1, and that of Cp2+1 with that of Cp2 to create two 8-digit
hexadecimal numbers, Cp+1,Cp1 and Cp2+1,Cp2. The two 8-digit numbers are
then compared and the result is output to the GR, EQ, and LE flags in the SR
area.
Precautions Placing other instructions between CMPL(60) and the operation which ac-
cesses the EQ, LE, and GR flags may change the status of these flags. Be sure
to access them before the desired status is changed.
Example: The following example shows how to save the comparison result immediately. If
Saving CMPL(60) Results the content of HR 10, HR 09 is greater than that of 011, 010, then 00200 is turned
ON; if the two contents are equal, 00201 is turned ON; if content of HR 10, HR 09
is less than that of 011, 010, then 00202 is turned ON. In some applications, only
one of the three OUTs would be necessary, making the use of TR 0 unnecessary.
With this type of programming, 00200, 00201, and 00202 are changed only
when CMPL(60) is executed.
TR
0
00000
CMPL(60)
HR 09
010
---
25505
00200 Greater Than
25506
00201 Equal
25507
00202 Less Than
142
Data Comparison Section 5-16
Limitations Each lower limit word in the comparison block must be less than or equal to the
upper limit.
Description When the execution condition is OFF, BCMP(68) is not executed. When the exe-
cution condition is ON, BCMP(68) compares CD to the ranges defined by a block
consisting of of CB, CB+1, CB+2, ..., CB+32. Each range is defined by two
words, the first one providing the lower limit and the second word providing the
upper limit. If CD is found to be within any of these ranges (inclusive of the upper
and lower limits), the corresponding bit in R is set. The comparisons that are
made and the corresponding bit in R that is set for each true comparison are
shown below. The rest of the bits in R will be turned OFF.
CB ≤ CD ≤ CB+1 Bit 00
CB+2 ≤ CD ≤ CB+3 Bit 01
CB+4 ≤ CD ≤ CB+5 Bit 02
CB+6 ≤ CD ≤ CB+7 Bit 03
CB+8 ≤ CD ≤ CB+9 Bit 04
CB+10 ≤ CD ≤ CB+11 Bit 05
CB+12 ≤ CD ≤ CB+13 Bit 06
CB+14 ≤ CD ≤ CB+15 Bit 07
CB+16 ≤ CD ≤ CB+17 Bit 08
CB+18 ≤ CD ≤ CB+19 Bit 09
CB+20 ≤ CD ≤ CB+21 Bit 10
CB+22 ≤ CD ≤ CB+23 Bit 12
CB+24 ≤ CD ≤ CB+25 Bit 13
CB+26 ≤ CD ≤ CB+27 Bit 14
CB+28 ≤ CD ≤ CB+29 Bit 15
CB+30 ≤ CD ≤ CB+31 Bit 16
Flags ER: The comparison block (i.e., CB through CB+31) exceeds the data area.
143
Data Comparison Section 5-16
Example The following example shows the comparisons made and the results provided
for BCMP(68). Here, the comparison is made during each cycle when 00000 is
ON.
00000
BCMP(68)
Address Instruction Operands
001 00000 LD 00000
HR 10 00001 BCMP(88)
HR 05 001
HR 10
HR 05
Description When the execution condition is OFF, TCMP(85) is not executed. When the exe-
cution condition is ON, TCMP(85) compares CD to the content of TB, TB+1,
TB+2, ..., and TB+15. If CD is equal to the content of any of these words, the
corresponding bit in R is set, e.g., if the CD equals the content of TB, bit 00 is
turned ON, if it equals that of TB+1, bit 01 is turned ON, etc. The rest of the bits in
R will be turned OFF.
Flags ER: The comparison table (i.e., TB through TB+15) exceeds the data area.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
144
Data Comparison Section 5-16
Example The following example shows the comparisons made and the results provided
for TCMP(85). Here, the comparison is made during each cycle when 00000 is
ON.
145
Data Conversion Section 5-17
Description When the execution condition is OFF, BIN(23) is not executed. When the execu-
tion condition is ON, BIN(23) converts the BCD content of S into the numerically
equivalent binary bits, and outputs the binary value to R. Only the content of R is
changed; the content of S is left unchanged.
BCD S
Binary R
BIN(23) can be used to convert BCD to binary so that displays on the Program-
ming Console or any other programming device will appear in hexadecimal
rather than decimal. It can also be used to convert to binary to perform binary
arithmetic operations rather than BCD arithmetic operations, e.g., when BCD
and binary values must be added.
146
Data Conversion Section 5-17
Description When the execution condition is OFF, BINL(58) is not executed. When the exe-
cution condition is ON, BINL(58) converts an eight-digit number in S and S+1
into 32-bit binary data, and outputs the converted data to R and R+1.
BCD S+1 S
Binary R+1 R
Flags ER: The contents of S and/or S+1 words are not BCD.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
EQ: ON when the result is zero.
Limitations If the content of S exceeds 270F, the converted result would exceed 9999 and
BCD(24) will not be executed. When the instruction is not executed, the content
of R remains unchanged.
Description BCD(24) converts the binary (hexadecimal) content of S into the numerically
equivalent BCD bits, and outputs the BCD bits to R. Only the content of R is
changed; the content of S is left unchanged.
Binary S
BCD R
BCD(24) can be used to convert binary to BCD so that displays on the Program-
ming Console or any other programming device will appear in decimal rather
than hexadecimal. It can also be used to convert to BCD to perform BCD arith-
metic operations rather than binary arithmetic operations, e.g., when BCD and
binary values must be added.
147
Data Conversion Section 5-17
Limitations If the content of S exceeds 05F5E0FF, the converted result would exceed
99999999 and BCDL(59) will not be executed. When the instruction is not exe-
cuted, the content of R and R+1 remain unchanged.
Description BCDL(59) converts the 32-bit binary content of S and S+1 into eight digits of
BCD data, and outputs the converted data to R and R+1.
Binary S+1 S
BCD R+1 R
Limitations S and S+1 must be within the same data area. R and R+1 must be within the
same data area. S and S+1 must be BCD and must be in the proper hours/minu-
tes/seconds format.
Description HTS(65) is used to convert time notation in hours/minutes/seconds to an equiv-
alent in just seconds.
For the source data, the seconds is designated in bits 00 through 07 and the min-
utes is designated in bits 08 through 15 of S. The hours is designated in S+1. The
maximum is thus 9,999 hours, 59 minutes, and 59 seconds.
The results is output to R and R+1. The maximum obtainable value is
35,999,999 seconds.
148
Data Conversion Section 5-17
Flags ER: S and S+1 or R and R+1 are not in the same data area.
S and/or S+1 do not contain BCD.
Number of seconds and/or minutes exceeds 59.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
EQ: Turns ON when the result is zero.
Example When 00000 is OFF (i.e., when the execution condition is ON), the following in-
struction would convert the hours, minutes, and seconds given in HR 12 and HR
13 to seconds and store the results in DM 0100 and DM 0101 as shown.
00000
HTS(65)
Address Instruction Operands
HR 12 00000 LD NOT 00000
DM 0100 00001 HTS(65)
000 HR 12
DM 0100
HR 12 3 2 0 7 2,815 hrs, 32 min, 07 s
000
HR 13 2 8 1 5
DM 0100 5 9 2 7 10,135,927 s
DM 0101 1 0 1 3
Limitations S and S+1 must be within the same data area. R and R+1 must be within the
same data area. S and S+1 must be BCD and must be between 0 and
35,999,999 seconds.
Description STH(66) is used to convert time notation in seconds to an equivalent in hours/mi-
nutes/seconds.
The number of seconds designated in S and S+1 is converted to hours/minutes/
seconds and placed in R and R+1.
For the results, the seconds is placed in bits 00 through 07 and the minutes is
placed in bits 08 through 15 of R. The hours is placed in R+1. The maximum will
be 9,999 hours, 59 minutes, and 59 seconds.
Flags ER: S and S+1 or R and R+1 are not in the same data area.
S and/or S+1 do not contain BCD or exceed 36,000,000 seconds.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
EQ: Turns ON when the result is zero.
149
Data Conversion Section 5-17
Example When 00000 is OFF (i.e., when the execution condition is ON), the following in-
struction would convert the seconds given in HR 12 and HR 13 to hours, min-
utes, and seconds and store the results in DM 0100 and DM 0101 as shown.
00000
STH(66)
Address Instruction Operands
HR 12 00000 LD NOT 00000
DM 0100 00001 STH(66)
000 HR 12
DM 0100
HR 12 5 9 2 7 10,135,927 s
000
HR 13 1 0 1 3
Source word
C
The first digit and the number of digits to be converted are designated in Di. If
more digits are designated than remain in S (counting from the designated first
digit), the remaining digits will be taken starting back at the beginning of S. The
150
Data Conversion Section 5-17
final word required to store the converted result (R plus the number of digits to be
converted) must be in the same data area as R, e.g., if two digits are converted,
the last word address in a data area cannot be designated; if three digits are con-
verted, the last two words in a data area cannot be designated.
Digit Designator The digits of Di are set as shown below.
Digit number: 3 2 1 0
Not used
Some example Di values and the digit-to-word conversions that they produce
are shown below.
Di: 0010 Di: 0030
S S
0 R 0 R
1 R+1 1 R+1
2 2 R+2
3 3 R+3
Flags ER: Undefined digit designator, or R plus number of digits exceeds a data
area.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
151
Data Conversion Section 5-17
Example The following program converts three digits of data from DM 0020 to bit positions
and turns ON the corresponding bits in three consecutive words starting with HR
10.
00000
MLPX(76) Address Instruction Operands
DM 0020 00000 LD 00000
#0021 00001 MLPX(76)
HR 10 DM 00200
# 0021
HR 10
152
Data Conversion Section 5-17
Result word
C
Up to four digits from four consecutive source words starting with S may be en-
coded and the digits written to R in order from the designated first digit. If more
digits are designated than remain in R (counting from the designated first digit),
the remaining digits will be placed at digits starting back at the beginning of R.
The final word to be converted (S plus the number of digits to be converted) must
be in the same data area as SB.
Digit Designator The digits of Di are set as shown below.
Digit numbers: 3 2 1 0
Not used.
Some example Di values and the word-to-digit conversions that they produce
are shown below.
Di: 0011 Di: 0030
R R
S 0 S 0
S+1 1 S+1 1
2 S+2 2
3 S+3 3
Flags ER: Undefined digit designator, or S plus number of digits exceeds a data
area.
Content of a source word is zero.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
Example When 00000 is ON, the following diagram encodes IR words 010 and 011 to the
first two digits of HR 20 and then encodes LR 10 and 11 to the last two digits of
153
Data Conversion Section 5-17
HR 20. Although the status of each source word bit is not shown, it is assumed
that the bit with status 1 (ON) shown is the highest bit that is ON in the word.
00000
DMPX(77) Address Instruction Operands
010 00000 LD 00000
HR 20 00001 DMPX(77)
#0010 010
HR 20
DMPX(77)
# 0010
00002 DMPX(77)
LR 10
LR 10
HR 20
HR 20
#0012
# 0012
IR 010 IR 011
01000 01100
: :
01011 1 01109 1
01012 0 01110 0
: : : : : :
HR 20
01015 0 01115 0
Digit 0 B
Digit 1 9
LR 10 LR 11 Digit 2 1
LR 1000 LR 1100 Digit 3 8
LR 1001 1 :
LR 1002 0 LR 1108 1
: : : LR 1109 0
: : : : : :
LR 1015 0 LR 1115 0
154
Data Conversion Section 5-17
from the designated half of D, each requiring two digits. If more digits are desig-
nated than remain in S (counting from the designated first digit), further digits will
be used starting back at the beginning of S.
Digit Designator The digits of Di are set as shown below.
Digit number: 3 2 1 0
Some example Di values and the 4-bit binary to 7-segment display conversions
that they produce are shown below.
Di: 0011 Di: 0030
S digits D S digits D
0 1st half 0 1st half
1 2nd half 1 2nd half
2 2
3 3 D+1
1st half
2nd half
D+2
1st half
2nd half
Example The following example shows the data to produce an 8. The lower case letters
show which bits correspond to which segments of the 7-segment display. The
155
Data Conversion Section 5-17
table underneath shows the original data and converted code for all hexadeci-
mal digits.
a
Di S D
Bit 00 f b
or g
0 20 0 bit 08 1 a
1 1: Second digit 21 1 1 b
e c
x100 0
0 22 0 1 c
0 23 0 1 d d
0 20 0 1 e
0 21 0 8 1 f
x101 0: One digit 1
0 22 0 1 g
Bit 07
1 23 1 0
or
0 20 0 bit 15
1 21 1
x102 0 or 1: 2
1 bits 00 through 07 or 22 1
08 through 15.
1 23 1
1 20 1
0 x103 3 21 0
Not used.
1 22 1
1 23 1
Flags ER: Incorrect digit designator, or data area for destination exceeded
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
156
Data Conversion Section 5-17
Parity 0: none,
1: even,
2: odd
157
BCD Calculations Section 5-18
Some examples of Di values and the 4-bit binary to 8-bit ASCII conversions that
they produce are shown below.
Di: 0011 Di: 0030
S D S D
0 1st half 0 1st half
1 2nd half 1 2nd half
2 2
3 3 D+1
1st half
2nd half
D+2
1st half
2nd half
Parity The leftmost bit of each ASCII character (2 digits) can be automatically adjusted
for either even or odd parity. If no parity is designated, the leftmost bit will always
be zero.
When even parity is designated, the leftmost bit will be adjusted so that the total
number of ON bits is even, e.g., when adjusted for even parity, ASCII “31”
(00110001) will be “B1” (10110001: parity bit turned ON to create an even num-
ber of ON bits); ASCII “36” (00110110) will be “36” (00110110: parity bit turned
OFF because the number of ON bits is already even). The status of the parity bit
does not affect the meaning of the ASCII code.
When odd parity is designated, the leftmost bit of each ASCII character will be
adjusted so that there is an odd number of ON bits.
Flags ER: Incorrect digit designator, or data area for destination exceeded.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
158
BCD Calculations Section 5-18
lation, and to use the result placed in CY, if required, before it is changed by exe-
cution of any other instruction.
Description When the execution condition is OFF, INC(38) is not executed. When the execu-
tion condition is ON, INC(38) increments Wd, without affecting Carry (CY).
Description When the execution condition is OFF, DEC(39) is not executed. When the exe-
cution condition is ON, DEC(39) decrements Wd, without affecting CY. DEC(39)
works the same way as INC(38) except that it decrements the value instead of
incrementing it.
STC(40) @STC(40)
When the execution condition is OFF, STC(40) is not executed.When the execu-
tion condition is ON, STC(40) turns ON CY (SR 25504).
CLC(41) @CLC(41)
159
BCD Calculations Section 5-18
When the execution condition is OFF, CLC(41) is not executed.When the execu-
tion condition is ON, CLC(41) turns OFF CY (SR 25504).
CLEAR CARRY is used to reset (turn OFF) CY (SR 25504) to “0.”
Description When the execution condition is OFF, ADD(30) is not executed. When the exe-
cution condition is ON, ADD(30) adds the contents of Au, Ad, and CY, and places
the result in R. CY will be set if the result is greater than 9999.
Au + Ad + CY CY R
Example If 00002 is ON, the program represented by the following diagram clears CY with
CLC(41), adds the content of LR 25 to a constant (6103), places the result in DM
0100, and then moves either all zeros or 0001 into DM 0101 depending on the
status of CY (25504). This ensures that any carry from the last digit is preserved
in R+1 so that the entire result can be later handled as eight-digit data.
TR 0
Address Instruction Operands
00002 00000 LR 00002
CLC(41) 00001 OUT TR 0
00002 CLC(41)
ADD(30)
00003 AND(30)
LR 25
LR 25
# 6103
#6103
DM 0100
DM 0100
00004 AND 25504
25504
00005 MOV(21)
MOV(21)
# 0001
#0001
DM 0101
DM 0101
00006 LD TR 0
25504 00007 AND NOT 25504
MOV(21)
00008 MOV(21)
#0000
# 0000
DM 0101
DM 0101
Although two ADD(30) can be used together to perform eight-digit BCD addition,
ADDL(54) is designed specifically for this purpose.
160
BCD Calculations Section 5-18
Description When the execution condition is OFF, ADDL(54) is not executed. When the exe-
cution condition is ON, ADDL(54) adds the contents of CY to the 8-digit value in
Au and Au+1 to the 8-digit value in Ad and Ad+1, and places the result in R and
R+1. CY will be set if the result is greater than 99999999.
Au + 1 Au
Ad + 1 Ad
+ CY
CY R+1 R
161
BCD Calculations Section 5-18
Description When the execution condition is OFF, SUB(31) is not executed. When the exe-
cution condition is ON, SUB(31) subtracts the contents of Su and CY from Mi,
and places the result in R. If the result is negative, CY is set and the 10’s comple-
ment of the actual result is placed in R. To convert the 10’s complement to the
true result, subtract the content of R from zero (see example below).
Mi – Su – CY CY R
! Caution Be sure to clear the carry flag with CLC(41) before executing SUB(31) if its previ-
ous status is not required, and check the status of CY after doing a subtraction
with SUB(31). If CY is ON as a result of executing SUB(31) (i.e., if the result is
negative), the result is output as the 10’s complement of the true answer. To con-
vert the output result to the true value, subtract the value in R from 0.
Example When 00002 is ON, the following ladder program clears CY, subtracts the con-
tents of DM 0100 and CY from the content of 010 and places the result in HR 20.
If CY is set by executing SUB(31), the result in HR 20 is subtracted from zero
(note that CLC(41) is again required to obtain an accurate result), the result is
placed back in HR 20, and HR 2100 is turned ON to indicate a negative result.
If CY is not set by executing SUB(31), the result is positive, the second subtrac-
tion is not performed, and HR 2100 is not turned ON. HR 2100 is programmed as
a self-maintaining bit so that a change in the status of CY will not turn it OFF
when the program is recycled.
In this example, differentiated forms of SUB(31) are used so that the subtraction
operation is performed only once each time 00002 is turned ON. When another
162
BCD Calculations Section 5-18
TR 0
00002
CLC(41)
@SUB(31) First
010
subtraction
DM 0100
HR 20
25504
CLC(41)
@SUB(31) Second
#0000
subtraction
HR 20
Address Instruction Operands
HR 21
00000 LD 00002
25504
HR 2100 00001 OUT TR 0
00002 CLC(41)
HR 2100 Turned ON to indicate 00003 @SUB(31)
negative result. 010
DM 0100
HR 20
00004 AND 25504
00005 CLC(41)
00006 @SUB(31)
# 0000
HR 20
HR 20
00007 LD TR 0
00008 AND 25504
00009 OR HR 2100
00010 OUT HR 2100
The first and second subtractions for this diagram are shown below using exam-
ple data for 010 and DM 0100.
Note The actual SUB(31) operation involves subtracting Su and CY from 10,000 plus
Mi. For positive results the leftmost digit is truncated. For negative results the
10s complement is obtained. The procedure for establishing the correct answer
is given below.
First Subtraction
IR 010 1029
DM 0100 – 3452
CY –0
HR 20 7577 (1029 + (10000 – 3452))
CY 1 (negative result)
Second Subtraction
0000
HR 20 –7577
CY –0
HR 20 2423 (0000 + (10000 – 7577))
CY 1 (negative result)
In the above case, the program would turn ON HR 2100 to indicate that the value
held in HR 20 is negative.
163
BCD Calculations Section 5-18
Description When the execution condition is OFF, SUBL(55) is not executed. When the exe-
cution condition is ON, SUBL(55) subtracts CY and the 8-digit contents of Su
and Su+1 from the 8-digit value in Mi and Mi+1, and places the result in R and
R+1. If the result is negative, CY is set and the 10’s complement of the actual
result is placed in R. To convert the 10’s complement to the true result, subtract
the content of R from zero. Since an 8-digit constant cannot be directly entered,
use the BSET(71) instruction (see 5-15-5 BLOCK SET – BSET(71)) to create an
8-digit constant.
Mi + 1 Mi
Su + 1 Su
– CY
CY R+1 R
The following example works much like that for single-word subtraction. In this
example, however, BSET(71) is required to clear the content of DM 0000 and
164
BCD Calculations Section 5-18
TR 0
00003
CLC(41)
@SUBL(55) First
HR 20 subtraction
120
DM 0100
25504
@BSET(71)
#0000
DM 0000
DM 0001
CLC(41)
@SUBL(55) Second
DM 0000 subtraction
DM 0100
DM 0100
25504
HR 2100
165
BCD Calculations Section 5-18
Description When the execution condition is OFF, MUL(32) is not executed. When the exe-
cution condition is ON, MUL(32) multiplies Md by the content of Mr, and places
the result In R and R+1.
Md
X Mr
R +1 R
Example When IR 00000 is ON with the following program, the contents of IR 013 and DM
0005 are multiplied and the result is placed in HR 07 and HR 08. Example data
and calculations are shown below the program.
00000
Address Instruction Operands
MUL(32)
00000 LD 00000
013
00001 MUL(32)
DM 0005
013
HR 07
DM 00005
HR 07
Md: IR 013
3 3 5 6
Mr: DM 0005
X 0 0 2 5
R+1: HR 08 R: HR 07
0 0 0 8 3 9 0 0
166
BCD Calculations Section 5-18
Description When the execution condition is OFF, MULL(56) is not executed. When the exe-
cution condition is ON, MULL(56) multiplies the eight-digit content of Md and
Md+1 by the content of Mr and Mr+1, and places the result in R to R+3.
Md + 1 Md
x Mr + 1 Mr
Description When the execution condition is OFF, DIV(33) is not executed and the program
moves to the next instruction. When the execution condition is ON, Dd is divided
by Dr and the result is placed in R and R + 1: the quotient in R and the remainder
in R + 1.
Remainder Quotient
R+1 R
Dr Dd
167
BCD Calculations Section 5-18
Example When IR 00000 is ON with the following program, the content of IR 020 is divided
by the content of HR 09 and the result is placed in DM 0017 and DM 0018. Exam-
ple data and calculations are shown below the program.
00000
Address Instruction Operands
DIV(33)
00000 LD 00000
020
00001 DIV(33)
HR 09
020
DM 0017 HR 09
Quotient Remainder DM 0017
R: DM 0017 R + 1: DM 0018
1 1 5 0 0 0 0 2
Description When the execution condition is OFF, DIVL(57) is not executed. When the exe-
cution condition is ON, DIVL(57) the eight-digit content of Dd and D+1 is divided
by the content of Dr and Dr+1 and the result is placed in R to R+3: the quotient in
R and R+1, the remainder in R+2 and R+3.
Remainder Quotient
Dr+1 Dr Dd+1 Dd
168
BCD Calculations Section 5-18
Limitations Dr and Dr+1 cannot contain zero. Dr and Dr+1 must be in the same data area, as
must Dd and Dd+1; R and R+1.
Description When the execution condition is OFF, FDIV(79) is not executed. When the exe-
cution condition is ON, FDIV(79) divides the floating-point value in Dd and Dd+1
by that in Dr and Dr+1 and places the result in R and R+1.
Quotient
R+1 R
Dr+1 Dr Dd+1 Dd
To represent the floating point values, the rightmost seven digits are used for the
mantissa and the leftmost digit is used for the exponent, as shown below. The
mantissa is expressed as a value less than one, i.e., to seven decimal places.
First word
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
1 0 1 0 0 0 0 1 0 0 0 1 0 0 0 1
Second word
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1
= 0.1111111 x 10–2
Example The following example shows how to divide two whole four-digit numbers (i.e.,
numbers without fractions) so that a floating-point value can be obtained.
169
BCD Calculations Section 5-18
First the original numbers must be placed in floating-point form. Because the
numbers are originally without decimal points, the exponent will be 4 (e.g., 3452
would equal 0.3452 x 104). All of the moves are to place the proper data into con-
secutive words for the final division, including the exponent and zeros. Data
movements for Dd and Dd+1 are shown at the right below. Movements for Dr
and Dr+1 are basically the same.The original values to be divided are in DM
0000 and DM 0001. The final division is also shown.
170
BCD Calculations Section 5-18
00000
@MOV(21)
HR 01 HR 00
#0000
0 0 0 0
HR 00
@MOV(21)
0000
#0000
HR 02
@MOV(21)
HR 01 HR 00
#4000
4 0 0 0 0 0 0 0
HR 01
@MOV(21)
4000
#4000
HR 03
DM 0000
@MOVD(83)
3 4 5 2
DM 0000
#0021
HR 01 HR 01 HR 00
4 3 4 5 0 0 0 0
@MOVD(83)
DM 0000
DM 0000
3 4 5 2
#0300
HR 00
HR 01 HR 00
4 3 4 5 2 0 0 0
@MOVD(83)
DM 0001
#0021
HR 03
@MOVD(83)
HR 01 HR 00
DM 0001
4 3 4 5 2 0 0 0
#0300
÷
HR 02 HR 03 HR 02
4 0 0 7 9 0 0 0
@FDIV(79)
HR 00 DM 0003 DM 0002
HR 02 2 4 3 6 9 6 2 0
DM 0002 0.4369620 x 102
171
BCD Calculations Section 5-18
Description When the execution condition is OFF, ROOT(72) is not executed. When the exe-
cution condition is ON, ROOT(72) computes the square root of the eight-digit
content of Sq and Sq+1 and places the result in R. The fractional portion is trun-
cated.
Sq+1 Sq
Example The following example shows how to take the square root of a four-digit number
and then round the result.
First the words to be used are cleared to all zeros and then the value whose
square root is to be taken is moved to Sq+1. The result, which has twice the num-
ber of digits required for the answer (because the number of digits in the original
value was doubled), is placed in DM 0102, and the digits are split into two differ-
ent words, the leftmost two digits to IR 011 for the answer and the rightmost two
digits to DM 0103 so that the answer in IR 011 can be rounded up if required. The
last step is to compare the value in DM 0103 so that IR 011 can be incremented
using the Greater Than flag.
In this example, √6017 = 77.56, and 77.56 is rounded off to 78.
172
BCD Calculations Section 5-18
00000
@BSET(71) DM 0101 DM 0100
#0000 0 0 0 0 0 0 0 0
DM 0100
DM 0101
0000 0000
@MOV(21)
010
6 0 1 7
010
DM 0101
DM 0101 DM 0100
@ROOT(72) 6 0 1 7 0 0 0 0
DM 0100
@MOV(21)
#0000
DM 0103 IR 011
011 0 0 0 0 0 0 0 0
@MOV(21)
#0000 0000 0000
DM 0103
@MOVD(83)
DM 0102
DM 0102
7 7 5 6
#0012
011
@MOVD(83)
IR 011 DM 0103
0 0 7 7 5 6 0 0
DM 0102
#0210
DM 0103
@CMP(20)
DM 0103 5600 > 4900
#4900
25505
@INC(38) IR 011
011
0 0 7 8
173
Binary Calculations Section 5-19
Description When the execution condition is OFF, ADB(50) is not executed. When the ex-
ecution condition is ON, ADB(50) adds the contents of Au, Ad, and CY, and
places the result in R. CY will be set if the result is greater than FFFF.
Au + Ad + CY CY R
Examples The following example shows a four-digit addition with CY used to place either
#0000 or #0001 into R+1 to ensure that any carry is preserved.
174
Binary Calculations Section 5-19
In the case below, A6E2 + 80C5 = 127A7. The result is a 5-digit number, so CY
(SR 25504) = 1, and the content of R + 1 becomes #0001.
Au: IR 010
A 6 E 2
Ad: DM 0100
+ 8 0 C 5
R+1: HR 11 R: HR 10
0 0 0 1 2 7 A 7
00000
CLC(41) Address Instruction Operands
00000 LD 00000
@ADB(50)
00001 CLC(41)
LR 20
00002 @ADB(50)
DM 0200
LR 20
DM 0300
DM 0200
@ADB(50)
DM 0300
LR 21
00003 @ADB(50)
LR 21
DM 0201
DM 0201
DM 0301
DM 0301
@ADB(50) 00004 @ADB(50)
#0000 # 0000
#0000 # 0000
DM 0302 DM 0302
In the case below, 4F52A6E2 + EC3B80C5 = 13B8E27A7. The sum of the lower
4-digit addition is a 5-digit number, so CY (SR 25504) = 1, and the sum of the
higher 4-digit addition is incremented by 1.
Au: LR 20 Au: LR 21
A 6 E 2 4 F 5 2
R: DM 0300 R: DM 0301
2 7 A 7 3 B 8 E
CY = 1
175
Binary Calculations Section 5-19
Description When the execution condition is OFF, SBB(51) is not executed. When the ex-
ecution condition is ON, SBB(51) subtracts the contents of Su and CY from Mi
and places the result in R. If the result is negative, CY is set and the 2’s comple-
ment of the actual result is placed in R.
Mi – Su – CY CY R
Example The following example shows eight-digit subtraction. CY is tested following the
first two subtractions to see if the result is negative. If it is, the first result is sub-
tracted from zero to obtain the true result, which is placed in HR 10 and HR 11,
176
Binary Calculations Section 5-19
In the case below, 20F55A10 – B8A360E3 = 97AE06D3. In the the lower 4-digit
subtraction, Su > Mi, so CY(SR 25504) becomes 1, and the result of the higher
4-digit subtraction is decremented by 1. In the final calculations, #0000 – F9D2 =
0000 + (10000 – F9D2) = 06D3.
177
Binary Calculations Section 5-19
R: HR 10 R: HR 11
F 9 2 D 6 8 5 1
CY = 1
R+2: HR 12 R+1: HR 11 R: HR 10
0 0 0 1 9 7 A E 0 6 D 3
Description When the execution condition is OFF, MLB(52) is not executed. When the ex-
ecution condition is ON, MLB(52) multiplies the content of Md by the contents of
Mr, places the rightmost four digits of the result in R, and places the leftmost four
digits in R+1.
Md
X Mr
R +1 R
178
Logic Instructions Section 5-20
Description When the execution condition is OFF, DVB(53) is not executed. When the ex-
ecution condition is ON, DVB(53) divides the content of Dd by the content of Dr
and the result is placed in R and R+1: the quotient in R, the remainder in R+1.
Quotient Remainder
R R+1
Dr Dd
Description When the execution condition is OFF, COM(29) is not executed. When the ex-
ecution condition is ON, COM(29) clears all ON bits and sets all OFF bits in Wd.
Example 15 00
Original 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1
15 00
Complement 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0
179
Logic Instructions Section 5-20
Description When the execution condition is OFF, ANDW(34) is not executed. When the ex-
ecution condition is ON, ANDW(34) logically AND’s the contents of I1 and I2
bit-by-bit and places the result in R.
Example 15 00
I1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1
15 00
I2 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
15 00
R 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1
180
Logic Instructions Section 5-20
Description When the execution condition is OFF, ORW(35) is not executed. When the ex-
ecution condition is ON, ORW(35) logically OR’s the contents of I1 and I2
bit-by-bit and places the result in R.
Example 15 00
I1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1
15 00
I2 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
15 00
R 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1
Description When the execution condition is OFF, XORW(36) is not executed. When the ex-
ecution condition is ON, XORW(36) exclusively OR’s the contents of I1 and I2
bit-by-bit and places the result in R.
Example 15 00
I1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1
15 00
I2 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
15 00
R 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0
181
Subroutines and Interrupt Control Section 5-21
Description When the execution condition is OFF, XNRW(37) is not executed. When the ex-
ecution condition is ON, XNRW(37) exclusively NOR’s the contents of I1 and I2
bit-by-bit and places the result in R.
15 00
I1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1
15 00
I2 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
15 00
R 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
182
Subroutines and Interrupt Control Section 5-21
In the case of the scheduled interrupt, the time interval between interrupts is set
by the user and is unrelated to the cycle timing of the PC. This capability is useful
for periodic supervisory or executive program execution.
INT(89) is used to control the interrupt signals received from the Interrupt Input
Units, and also to control the scheduling of the scheduled interrupt. INT(89) pro-
vides such functions as masking of interrupts (so that they are recorded but ig-
nored) and clearing of interrupts.
N: Subroutine number
SBN(92) N
# (00 to 99)
RET(93)
Limitations Each subroutine number can be used in SBN(92) once only, i.e., up to 100 sub-
routines may be programmed. Subroutine numbers 00 through 31 are used by
Interrupt Input Units and subroutine number 99 is used for the scheduled inter-
rupt. Refer to 5-21-4 INTERRUPT CONTROL – INT(89) for details.
Description SBN(92) is used to mark the beginning of a subroutine program; RET(93) is
used to mark the end. Each subroutine is identified with a subroutine number, N,
that is programmed as a definer for SBN(92). This same subroutine number is
used in any SBS(91) that calls the subroutine (see next subsection). No subrou-
tine number is required with RET(93).
All subroutines must be programmed at the end of the main program. When one
or more subroutines have been programmed, the main program will be ex-
ecuted up to the first SBN(92) before returning to address 00000 for the next
cycle. Subroutines will not be executed unless called by SBS(91) or activated by
an interrupt.
END(01) must be placed at the end of the last subroutine program, i.e., after the
last RET(93). It is not required at any other point in the program. (Refer to the
next subsection for further details.)
Precautions If SBN(92) is mistakenly placed in the main program, it will inhibit program ex-
ecution past that point, i.e., program execution will return to the beginning when
SBN(92) is encountered.
If either DIFU(13) or DIFU(14) is placed within a subroutine, the operand bit will
not be turned OFF until the next time the subroutine is executed, i.e., the oper-
and bit may stay ON longer than one cycle.
N: Subroutine number
SBS(91) N
# (00 to 99)
Description A subroutine can be executed by placing SBS(91) in the main program at the
point where the subroutine is desired. The subroutine number used in SBS(91)
indicates the desired subroutine. When SBS(91) is executed (i.e., when the ex-
183
Subroutines and Interrupt Control Section 5-21
ecution condition for it is ON), the instructions between the SBN(92) with the
same subroutine number and the first RET(93) after it are executed before ex-
ecution returns to the instruction following the SBS(91) that made the call.
Main program
SBS(91) 00
Main program
SBN(92) 00
Subroutine
RET(93)
END(01)
SBS(91) may be used as many times as desired in the program, i.e., the same
subroutine may be called from different places in the program).
SBS(91) may also be placed into a subroutine to shift program execution from
one subroutine to another, i.e., subroutines may be nested. When the second
subroutine has been completed (i.e., RET(93) has been reached), program ex-
ecution returns to the original subroutine which is then completed before return-
ing to the main program. Nesting is possible to up to sixteen levels. A subroutine
cannot call itself (e.g., SBS(91) 00 cannot be programmed within the subroutine
defined with SBN(92) 00). The following diagram illustrates two levels of nesting.
184
Subroutines and Interrupt Control Section 5-21
The following diagram illustrates program execution flow for various execution
conditions for two SBS(91).
C
A D B C
RET(93)
END(01)
Flags ER: A subroutine does not exist for the specified subroutine number.
A subroutine has called itself.
Subroutines have been nested to more than sixteen levels.
! Caution SBS(91) will not be executed and the subroutine will not be called when ER is
ON.
# (000 to 002)
INT(89) @INT(89)
N: Interrupt designator
CC CC
# (004)
N N
D: Control data
D D
IR, AR, DM, HR, TC, LR, TR, #
Limitations D may be a constant only when CC is 000 or 001. D must be a word address
when CC is 002. See below for details. INT(89) is used only to control the sched-
uled interrupts with the C200H and N must be set to 0004.
! Caution INT(89) cannot be used during execution of step programs or in C2000H Duplex
CPUs. Refer to 5-22 Step Instructions for details on step programs.
185
Subroutines and Interrupt Control Section 5-21
Description INT(89) is used to control the scheduled interrupt. Subroutine 99 can be estab-
lished so that it will be executed repeatedly at a fixed interval through scheduled
interrupts.The actual time at which it is executed is independent of the cycle
time. INT(89) is used to control the scheduled interrupt. If N is 004, CC is used to
designate the desired function as follows:
CC = 000: Setting time interval
001: Setting the time to first scheduled interrupt
002: Reading the current time interval
Scheduling the Interrupt Even when a subroutine 99 has been written, it will not be executed according to
scheduled interrupts unless INT(89) is used to set the proper times. INT(89)
should be used to set both the time interval (CC = 000) for the scheduled inter-
rupt and the time to the first scheduled interrupt (CC = 001. Unstable operation
may result is the time to the first interrupt is not set.
CC = 000 To set the time interval for the scheduled interrupt, set CC to 000 and set D to any
(Interval) value between 00.01 and 99.99 seconds. The decimal point is not input. The
time interval can be changed at any time.
To cancel the scheduled interrupt, set the time interval to 00.00 seconds.
! Caution If the scheduled execution time of the subroutine becomes too large, it will have
a serious effect on the overall execution time of the main program. Therefore,
you should take extra care to write a subroutine that is fast and efficient. INT(89),
with a CC of 000, is used to change the scheduled interrupt time interval, the new
time interval is not effective until after the next scheduled interrupt. (cf. CC = 001
below)
CC = 001 To set the time to the first interrupt, set CC to 001 and set D to any value between
(Time to First Interrupt) 00.01 and 99.99 seconds. The decimal point is not entered. If D is set to 00.00,
the interrupt will not occur.
! Caution INT(89), with a CC code of 001, can be used to change the scheduled interrupt
time interval for one cycle. The new time interval is effective immediately. The
scheduled interrupt may never actually occur if the time to the first interrupt is
changed repeatedly, i.e., before the interrupt has time to occur.
CC = 002 To access the current time interval for the scheduled interrupt, set CC 002. The
(Read Interval) current time interval will be places in D
Example
The following program shows the overall structure and operation of the sched-
uled interrupt.
Here, the scheduled subroutine is started and will be repeated every 20 ms. The
control flow logic of the main program is unaffected by execution of the sched-
uled subroutine, i.e., immediately after the sub
186
Subroutines and Interrupt Control Section 5-21
routine has finished execution, control returns to the point in the main program
where it was suspended.
25315 First Cycle Flag
INT(89)
001
004
#0002
INT(89)
000
004
00000 LD 25315
00001 INT(89) Main program.
001
004 00500 SBN(92) 99
# 0002
00002 INT(89) Subroutine.
000
004 00600 RET(93)
# 0002
187
Step Instructions Section 5-22
B: Control bit
STEP(08) B STEP(08)
IR, AR, HR, LR
Limitations All control bits must be in the same word and must be consecutive.
Description STEP(08) uses a control bit in the IR or HR areas to define the beginning of a
section of the program called a step. STEP(08) does not require an execution
condition, i.e., its execution is controlled through the control bit. To start execu-
tion of the step, SNXT(09) is used with the same control bit as used for
STEP(08). If SNXT(09) is executed with an ON execution condition, the step
with the same control bit is executed. If the execution condition is OFF, the step is
not executed. The SNXT(09) instruction must be written into the program so that
it is executed before the program reaches the step it starts. It can be used at dif-
ferent locations before the step to control the step according to two different exe-
cution conditions (see example 2, below). Any step in the program that has not
been started with SNXT(09) will not be executed.
Once SNXT(09) is used in the program, step execution will continue until
STEP(08) is executed without a control bit. STEP(08) without a control bit must
be preceded by SNXT(09) with a dummy control bit. The dummy control bit may
be any unused IR or HR bit. It cannot be a control bit used in a STEP(08).
Execution of a step is completed either by execution of the next SNXT(09) or by
turning OFF the control bit for the step (see example 3 below). When the step is
completed, all of the IR and HR bits in the step are turned OFF and all timers in
188
Step Instructions Section 5-22
the step are reset to their SVs. Counters, shift registers, and bits used in
KEEP(11) maintain status. Two simple steps are shown below.
00000
SNXT(09) LR 2000 Starts step execution
STEP(08) LR 2000
00001
SNXT(09) LR 2001
STEP(08) LR 2001
00002
SNXT(09) 2002
Steps can be programmed in consecutively. Each step must start with STEP(08)
and generally ends with SNXT(09) (see example 3, below, for an exception).
When steps are programmed in series, three types of execution are possible:
sequential, branching, or parallel. The execution conditions for, and the position-
ing of, SNXT(09) determine how the steps are executed. The three examples
given below demonstrate these three types of step execution.
Precautions Interlocks, jumps, SBN(92), and END(01) cannot be used within step programs.
Bits used as control bits must not be used anywhere else in the program unless
they are being used to control the operation of the step (see example 3, below).
All control bits must be in the same word and must be consecutive.
If IR or LR bits are used for control bits, their status will be lost during any power
interruption. If it is necessary to maintain status to resume execution at the same
step, HR bits must be used.
189
Step Instructions Section 5-22
Flags 25407: Step Start Flag; turns ON for one cycle when STEP(08) is executed and
can be used to reset counters in steps as shown below if necessary.
00000
SNXT(09) 01000 Start
01000
STEP(08) 01000
00100
CP
CNT 01
25407
25407
R #0003
1 cycle
Examples
The following three examples demonstrate the three types of execution control
possible with step programming. Example 1 demonstrates sequential execu-
tion; example 2, branching execution; and example 3, parallel execution.
Example 1: The following process requires that three processes, loading, part installation,
Sequential Execution and inspection/discharge, be executed in sequence with each process being re-
set before continuing on the the next process. Various sensors (SW1, SW2,
SW3, and SW4) are positioned to signal when processes are to start and end.
SW 1
SW 2 SW 4
SW 3
190
Step Instructions Section 5-22
The following diagram demonstrates the flow of processing and the switches
that are used for execution control.
SW1
Process A Loading
SW2
SW3
Process C Inspection/discharge
SW4
The program for this process, shown below, utilizes the most basic type of step
programming: each step is completed by a unique SNXT(09) that starts the next
191
Step Instructions Section 5-22
step. Each step starts when the switch that indicates the previous step has been
completed turns ON.
00001 (SW1)
SNXT(09) 12800 Process A started.
STEP(08) 12800
Process A
00002 (SW2)
Process A reset.
SNXT(09) 12801
Process B started.
STEP(08) 12801
Process B
00003 (SW3)
SNXT(09) 12802 Process B reset.
Process C started.
STEP(08) 12802
Process C
00004 (SW4)
SNXT(09) 12803 Process C reset.
STEP(08)
Example 2: The following process requires that a product is processed in one of two ways,
Branching Execution depending on its weight, before it is printed. The printing process is the same
192
Step Instructions Section 5-22
regardless of which of the first processes is used. Various sensors are posi-
tioned to signal when processes are to start and end.
Printer
SW A1 SW A2
SW D
Process A
Process B
SW B1 SW B2
The following diagram demonstrates the flow of processing and the switches
that are used for execution control. Here, either process A or process B is used
depending on the status of SW A1 and SW B1.
SW A1 SW B1
Process A Process B
SW A2 SW B2
Process C
SW D
End
The program for this process, shown below, starts with two SNXT(09) instruc-
tions that start processes A and B. Because of the way 00001 (SW A1) and
00002 (SB B1) are programmed, only one of these will be executed to start either
193
Step Instructions Section 5-22
process A or process B. Both of the steps for these processes end with a
SNXT(09) that starts the step for process C.
Process A
STEP(08) HR 0001
Process B
STEP(08) HR 0002
Process C
00005 (SW D)
SNXT(09) HR 0003 Process C reset.
STEP(08)
00000 LD 00001
00001 AND NOT 00002 Process B
00002 SNXT(09) HR 0000
00003 LD NOT 00001 00100 LD 00004
00004 AND 00002 00101 SNXT(09) HR 0002
00005 SNXT(09) HR 0001 00102 STEP(08) HR 0002
00006 STEP(08) HR 0000
Process C
Process A
00200 LD 00005
00100 LD 00003 00201 SNXT(09) HR 0003
00101 SNXT(09) HR 0002 00202 STEP(08) ---
00102 STEP(08) HR 0001
194
Step Instructions Section 5-22
Example 3: The following process requires that two parts of a product pass simultaneously
Parallel Execution through two processes each before they are joined together in a fifth process.
Various sensors are positioned to signal when processes are to start and end.
Process B
Process E
Process D
Process C
SW4
SW2 SW6
The following diagram demonstrates the flow of processing and the switches
that are used for execution control. Here, process A and process C are started
together. When process A finishes, process B starts; when process C finishes,
process D starts. When both processes B and D have finished, process E starts.
Process A Process C
SW3 SW4
Process B Process D
Process E
SW7
End
The program for this operation, shown below, starts with two SNXT(09) instruc-
tions that start processes A and C. These instructions branch from the same in-
struction line and are always executed together, starting steps for both A and C.
When the steps for both A and C have finished, the steps for process B and D
begin immediately.
When both process B and process D have finished (i.e., when SW5 and SW6
turn ON), processes B and D are reset together by the SNXT(09) at the end of
the programming for process B. Although there is no SNXT(09) at the end of
process D, the control bit for it is turned OFF by executing SNXT(09) LR 0004.
This is because the OUT for LR 0003 is in the step reset by SNXT(09) LR 0004,
i.e., LR 003 is turned OFF when SNXT(09) LR 0004 is executed Process B is
thus reset directly and process D is reset indirectly before executing the step for
process E.
195
Step Instructions Section 5-22
STEP(08) LR 0000
Process A
00002 (SW3)
SNXT(09) LR 0001 Process A reset.
Process B started.
STEP(08) LR 0001
Process B
01101 Used to
LR 0003 turn off
process D.
00004 (SW5 and SW6)
SNXT(09) LR 0004 Process E started.
STEP(08) LR 0002
Process C
00003 (SW4)
SNXT(09) LR 0003 Process C reset.
Process D started.
STEP(08) LR 0003
Process D
STEP(08) LR 0004
Process E
00005 (SW7)
SNXT(09) LR 0005 Process E reset.
STEP(08)
196
Special Instructions Section 5-23
N: FAL number
FAL(06) N @FAL(06) N
# (00 to 99)
N: FAL number
FALS(07) N
# (01 to 99)
Description FAL(06) and FALS(07) are provided so that the programmer can output error
numbers for use in operation, maintenance, and debugging. When executed
with an ON execution condition, either of these instructions will output a FAL
number to bits 00 to 07 of SR 253. The FAL number that is output can be be-
tween 01 and 99 and is input as the definer for FAL(06) or FALS(07). FAL(06)
with a definer of 00 is used to reset this area (see below).
FAL Area
25307 25300
X101 X100
FAL(06) produces a non-fatal error and FAL(07) produces a fatal error. When
FAL(06) is executed with an ON execution condition, the ALARM/ERROR indi-
cator on the front of the CPU will flash, but PC operation will continue. When
FALS(07) is executed with an ON execution condition, the ALARM/ERROR indi-
cator will light and PC operation will stop.
197
Special Instructions Section 5-23
--- ---
---: Not used.
--- ---
Limitations Mi must be BCD. Only the rightmost three digits of Mi are used.
Description SCAN(18) is used to set a minimum cycle time. Mi is the minimum cycle time that
will be set in milliseconds, e.g., if Mi is 120, the minimum cycle time will be 120
ms. The possible setting range is from 0 to 999 seconds.
If the actual cycle time is less than the cycle time set with SCAN(18) the CPU will
wait until the designated time has elapsed before starting the next cycle. If the
actual cycle time is greater than the set time, the set time will be ignored and the
program will be executed to completion.
Description When executed with an ON execution condition, MSG(46) reads eight words of
extended ASCII code from FM to FM+7 and displays the message on the Pro-
gramming Console, GPC, or FIT. The displayed message can be up to 16 char-
acters long, i.e., each ASCII character code requires eight bits (two digits). Refer
to Appendix I for the extended ASCII codes. Japanese katakana characters are
included in this code.
198
Special Instructions Section 5-23
If not all eight words are required for the message, it can be stopped at any point
by inputting “OD.” When OD is encountered in a message, no more words will be
read and the words that normally would be used for the message can be used for
other purposes.
Message Buffering and Up to three messages can be buffered in memory. Once stored in the buffer, they
Priority are displayed on a first in, first out basis. Since it is possible that more than three
MSG(46)s may be executed within a single cycle, there is a priority scheme,
based on the area where the messages are stored, for the selection of those
messages to be buffered.
The priority of the data areas is as follows for message display:
LR > IR (I/O) > IR (not I/O) > HR > AR > TC > DM
In handling messages from the same area, those with the lowest ad-
dress values have higher priority.
In handling indirectly addressed messages (i.e. *DM), those with the
lowest DM address values have higher priority.
Clearing Messages To clear a message, execute FAL(06) 00 or clear it via a Programming Console
using the procedure in 4-6-5 Clearing Error Messages.
If the message data changes while the message is being displayed, the display
will also change.
Example The following example shows the display that would be produced for the instruc-
tion and data given when 00000 was ON. If 00001 goes ON, a message will be
cleared.
00000
Address Instruction Operands
MSG(46)
00000 LD 00000
DM 0010
00001 MSG(46)
00001
FAL(06) 00 DM 0010
00002 LD 00001
00003 FAL(06) 00
DM contents ASCII
equivalent
DM 0010 4 1 4 2 A B
DM 0011 4 3 4 4 C D MSG
DM 0012 4 5 4 6 E F ABCDEFGHIJKLMNOP
DM 0013 4 7 4 8 G H
DM 0014 4 9 4 A I J
DM 0015 4 B 4 C K L
DM 0016 4 D 4 E M N
DM 0017 4 F 5 0 O P
199
Special Instructions Section 5-23
Limitations S through S+15 must be in the same data area and must be in ASCII. The mes-
sage will be truncated if a null character (00) is contained between S and S+15.
Description LMSG(47) is used to output a 32-character message to a Programming Con-
sole. The message to be output must be in ASCII beginning in word S and end-
ing in S+15, unless a shorter message is desired. A shorter message can be pro-
duced by placing a null character (00) into the string; no characters from the null
character on will be output.
D designates the destination of the output. For the C200H, 000 designates the
Programming Console.
To output to the Programming Console, it must be set in TERMINAL mode. Al-
though LMSG(47) will be executed as normal, the message will not appear cor-
rectly on the Programming Console unless TERMINAL mode is set.
Flags ER: S and S+15 are not in the same data area.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
Example Although the display is longer and there is a choice of output devices, the coding
LMSG(47) is the same as that for MSG(46). Refer to Example under the pre-
vious section for an example using MSG(46).
TERM(48) @TERM(48)
--- ---
--- ---
--- ---
Description When the execution condition is OFF, TERM(48) is not executed. When the exe-
cution condition is ON, the Programming Console can be switched to TERMI-
NAL mode by pressing the CHG key on the Programming Console. The Pro-
gramming Console will enter the CONSOLE mode when the CHG key is
pressed again. Instructions MSG(46), LMSG(47), and the keyboard mapping
function are executed in the CONSOLE mode.
200
Special Instructions Section 5-23
--- ---
---: Not used.
Limitations Only specific values are valid for P (see Content of Operand P below).
SYS(49) must be programmed at program address 00001 with LD AR 1001 at
program address 00000.
Description SYS(49) is used to control the following 4 operating parameters. All four of these
parameters can be set at the same time using a single SYS(49) instruction.
1, 2, 3... 1. The battery check in system error checks. If SYS(49) is executed and bit 00
of P is ON, the battery check will be excluded from system error checks
when PC power is turned ON.
2. The initial operating mode. If SYS(49) is executed and bit 01 of P is ON, the
PC will enter MONITOR mode when it is turned ON unless the Initial Mode
Switch on the PC or a Peripheral Device is controlling the mode. Refer to
Initial Operating Mode, below, for the conditions controlling the initial PC
mode.
3. The Force Status Hold Bit (SR 25211). If SYS(49) is executed and bit 06 of P
is ON, the Force Status Hold Bit (SR 25211) will be turned ON when PC pow-
er is turned ON.
4. The I/O Status Hold Bit (SR 25212). If SYS(49) is executed and bit 07 of P is
ON, the I/O Status Hold Bit (SR 25212) will be turned ON when PC power is
turned ON.
Content of Operand P The leftmost 8 bits of P must contain A3. The status of bits 00, 01, 06, and 07 are
used to control the operating parameters.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 0 1 0 0 0 1 1 1 1 0 0 0 0 1 1
Initial Operating Mode The factors that determine the PC’s initial operating mode are listed below in or-
der of priority.
1, 2, 3... 1. Programming Console
If a Programming Console is mounted to the PC, the PC will start in the mode
set on the Programming Console’s mode switch regardless of any other
conditions.
2. Memory Unit’s Initial Mode Switch
If a Programming Console is not mounted to the PC and the Initial Mode
Switch on the Memory Unit is turned ON, the PC will start in RUN mode re-
gardless of any other conditions.
201
Special Instructions Section 5-23
3. SYS(49)
If a Programming Console is not mounted to the PC and the Initial Mode
Switch on the Memory Unit is OFF, the PC will start in MONITOR mode if
SYS(49) is executed with bit 01 of P turned ON.
4. Other Peripheral Devices
If a Programming Console is not mounted to the PC, the Initial Mode Switch
on the Memory Unit is OFF, and the initial mode is not set with SYS(49) (bit
01 of P OFF or SYS(49) not executed), the PC will start in PROGRAM mode
if any other peripheral device (Peripheral Interface Unit, PROM Writer, Print-
er Interface Unit, or Floppy Disk Interface Unit) is connected.
If none of the above conditions is met, the PC will start in RUN mode.
Limitations N cannot be 0.
Description When the execution condition is OFF, BCNT(67) is not executed. When the exe-
cution condition is ON, BCNT(67) counts the total number of bits that are ON in
all words between SB and SB+(N–1) and places the result in D.
Flags ER: N is not BCD, or N is 0; SB and SB+(N–1) are not in the same area.
The resulting count value exceeds 9999.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
EQ: ON when the result is 0.
Limitations For trigonometric functions, x, the content of S, must be in BCD form and satisfy
the condition 0000 ≤ x ≤ 0900 (0°≤Θ≤ 90°).
Description When the execution condition is OFF, VCAL(69) is not executed. When the exe-
cution condition is ON, the operation of VCAL(69) depends on the control word
C. If C is #0000 or #0001, VCAL(69) computes sin(x) or cos(x)*. If C is an ad-
202
Special Instructions Section 5-23
Cosine Function The following example demonstrates the use of the VCAL(69) cosine function to
calculate the cosine of 30°. The cosine function is specified when C is #0001.
Linear Approximation VCAL(69) linear approximation is specified when C is a memory address. Word
C is the first word of the continuous block of memory containing the linear ap-
proximation data.
The content of word C specifies the number of line segments in the approxima-
tion, and whether the input and output are in BCD or BIN form. Bits 00 to 07 con-
tain the number of line segments less 1, m–1, as binary data. Bits 14 and 15 de-
termine, respectively, the output and input forms: 0 specifies BCD and 1 speci-
fies BIN.
203
Special Instructions Section 5-23
Enter the coordinates of the m+1 end-points, which define the m line segments,
Y as shown in the following table. Enter all coordinates in BIN form. Do not allow
the data block to overlap the RAM and EEPROM sections of the DM area. The
Ym EEPROM section begins at DM1000.
Word Coordinate
Y4
C+1 Xm (max. X value)
Y3 C+2 Y0
Y1 C+3 X1
C+4 Y1
Y2 C+5 X2
C+6 Y2
Y0
X ↓ ↓
X0 X1 X2 X3 X4 Xm C+(2m+1) Xm
C+(2m+2) Ym
204
Special Instructions Section 5-23
In this case, the input data word, IR 010, contains #0014, and f(0014) = #0726 is
output to R, IR 011.
Y
$1F20
$0F00
(x,y)
$0726
$0402
(0,0) X
$0005 $0014 $001A $05F0
Description When the execution condition is OFF, WDT(94) is not executed. When the exe-
cution condition is ON, WDT(94) extends the setting of the watchdog timer (nor-
mally set by the system to 130 ms) by 100 ms times T.
Timer extension = 100 ms x T.
Precautions If the cycle time is longer than the time set for the watchdog timer, 9F will be out-
put to the FAL area and the CPU will stop.
If the cycle time exceeds 6,500 ms, a FALS 9F will be generated and the system
will stop.
Timers might not function properly when the cycle time exceeds 100 ms. When
using WDT(94), the same timer should be repeated in the program at intervals
that are less than 100 ms apart. TIMH(15) should be used only in a scheduled
interrupt routine executed at intervals of 10 ms or less.
Limitations IORF(97) can be used to refresh I/O words allocated to only I/O Units (IR 000 to
IR 030) and Special I/O Units (IR 100 to IR 199) mounted to the CPU or Expan-
sion I/O Racks. It cannot be used for other I/O words, such as I/O Units on Slaves
Racks or Group-2 High-density I/O Units.
205
Special Instructions Section 5-23
Limitations MPRF(61) can be used to refresh I/O words allocated to Group-2 High-density
I/O Units (IR 030 to IR 049) only. It cannot be used for other I/O words.
St and E must be between #0000 and #0009. St must be less than or equal to E.
Description When the execution condition is OFF, MPRF(61) is not executed. When the ex-
ecution condition is ON, the I/O words allocated to Group-2 High-density I/O
Units with I/O numbers St through E will be refreshed.This will be in addition to
the normal I/O refresh performed during the CPU’s cycle.
It is not possible to specify the I/O words by address, only by the I/O number of
the Unit to which they are allocated.
206
Network Instructions Section 5-24
Limitations Can be performed with the CPU31-E only. C through C+2 must be within the
same data area and must be within the values specified below. To be able to use
SEND(90), the system must have a SYSMAC NET Link or SYSMAC LINK Unit
mounted.
Description When the execution condition is OFF, SEND(90) is not executed. When the exe-
cution condition is ON, SEND(90) transfers data beginning at word S, to ad-
dresses specified by D in the designated node on the SYSMAC NET Link/SYS-
MAC LINK System. The control words, beginning with C, specify the number of
words to be sent, the destination node, and other parameters. The contents of
the control data depends on whether a transmission is being sent in a SYSMAC
NET Link System or a SYSMAC LINK System.
The status of bit 15 of C+1 determines whether the instruction is for a SYSMAC
NET Link System or a SYSMAC LINK System.
Control Data
SYSMAC NET Link Systems The destination port number is always set to 0. Set the destination node number
to 0 to send the data to all nodes. Set the network number to 0 to send data to a
node on the same Subsystem (i.e., network). Refer to the SYSMAC NET Link
System Manual for details.
Word Bits 00 to 07 Bits 08 to 15
C Number of words (0 to 1000 in 4-digit hexadecimal, i.e., 0000hex to 03E8hex)
C+1 Network number (0 to 127 in 2-digit Bit 14 ON: Operating level 0
hexadecimal, i.e., 00hex to 7Fhex) OFF: Operating level 1
Bits 08 to 13 and 15: Set to 0.
C+2 Destination node (0 to 126 in 2-digit Destination port
hexadecimal, i.e., 00hex to 7Ehex)* NSB: 00
NSU: 01/02
*The node number of the PC executing the send may be set.
207
Network Instructions Section 5-24
SYSMAC LINK Systems Set the destination node number to 0 to send the data to all nodes. Refer to the
SYSMAC LINK System Manual for details.
Word Bits 00 to 07 Bits 08 to 15
C Number of words (0 to 256 in 4-digit hexadecimal, i.e., 0000hex to 0100hex)
C+1 Response time limit (0.1 and 25.4 Bits 08 to 11:
seconds in 2-digit hexadecimal No. of retries (0 to 15 in
without decimal point, i.e., 00hex to hexadecimal,
FFhex) i.e., 0hex to Fhex)
Note: The response time will be Bit 12: Set to 0.
2 seconds if the limit is set to 0hex. Bit 13 ON: Response not returned.
There will be no time limit if the OFF: Response returned.
time limit is set to FFhex. Bit 14 ON: Operating level 0
OFF: Operating level 1
Bit 15: Set to 1.
C+2 Destination node (0 to 62 in 2-digit Set to 0.
hexadecimal, i.e., 00hex to 3Ehex)*
*The node number of the PC executing the send cannot be set.
Examples This example is for a SYSMAC NET Link System. When 00000 is ON, the follow-
ing program transfers the content of IR 001 through IR 005 to LR 20 through LR
24 on node 10.
00000
Address Instruction Operands
SEND(90)
00000 LD 00000
001
00001 SEND(90)
LR 20
001
DM 0010
LR 20
DM 0010
15 0 Node 10
DM 0010 0 0 0 5 IR 001 LR 20
DM 0011 0 0 0 0 IR 002 LR 21
DM 0012 0 0 0 A IR 003 LR 22
IR 004 LR 23
IR 005 LR 24
Flags ER: The specified node number is greater than 126 in a SYSMAC NET Link
System or greater than 62 in a SYSMAC LINK System.
The sent data overruns the data area boundaries.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
There is no SYSMAC NET Link/SYSMAC LINK Unit.
208
Network Instructions Section 5-24
Limitations Can be performed with the CPU31-E only. C through C+2 must be within the
same data area and must be within the values specified below. To be able to use
RECV(98), the system must have a SYSMAC NET Link or SYSMAC LINK Unit
mounted.
Description When the execution condition is OFF, RECV(98) is not executed. When the exe-
cution condition is ON, RECV(98) transfers data beginning at S from a node on
the SYSMAC NET Link/SYSMAC LINK System to words beginning at D. The
control words, beginning with C, provide the number of words to be received, the
source node, and other transfer parameters.
The status of bit 15 of C+1 determines whether the instruction is for a SYSMAC
NET Link System or a SYSMAC LINK System.
Control Data
SYSMAC NET Link Systems The source port number is always set to 0. Set the network number to 0 to re-
ceive data to a node on the same Subsystem (i.e., network). Refer to the SYS-
MAC NET Link System Manual for details.
Word Bits 00 to 07 Bits 08 to 15
C Number of words (0 to 1000 in 4-digit hexadecimal, i.e., 0000hex to 03E8hex)
C+1 Network number (0 to 127 in 2-digit Bit 14 ON: Operating level 0
hexadecimal, i.e., 00hex to 7Fhex) OFF: Operating level 1
Bits 08 to 13 and 15:
Set to 0.
C+2 Source node (1 to 126 in 2-digit Source port
hexadecimal, i.e., 01hex to 7Ehex) NSB: 00
NSU: 01/02
SYSMAC LINK Systems Refer to the SYSMAC LINK System Manual for details.
Word Bits 00 to 07 Bits 08 to 15
C Number of words (0 to 256 in 4-digit hexadecimal, i.e., 0000hex to 0100hex)
C+1 Response time limit (0.1 and 25.4 Bits 08 to 11:
seconds in 2-digit hexadecimal No. of retries (0 to 15 in
without decimal point, i.e., 00hex to hexadecimal, i.e., 0hex to
FFhex) Fhex)
Note: The response time will be Bit 12: Set to 0.
2 seconds if the limit is set to 0hex. Bit 13: Set to 0.
There will be no time limit if the Bit 14 ON: Operating level 0
time limit is set to FFhex. OFF: Operating level 1
Bit 15: Set to 1.
C+2 Source node (0 to 62 in 2-digit Set to 0.
hexadecimal, i.e., 00hex to 3Ehex)
209
Network Instructions Section 5-24
Examples This example is for a SYSMAC NET Link System. When 00000 is ON, the follow-
ing program transfers the content of IR 001 through IR 005 to LR 20 through LR
24 on node 10.
00000
Address Instruction Operands
RECV(98)
00000 LD 00000
001
00001 RECV(98)
LR 20
001
DM 0010
LR 20
DM 0010
15 0 Node 10
DM 0010 0 0 0 5 IR 001 LR 20
DM 0011 0 0 0 0 IR 002 LR 21
DM 0012 0 0 0 A IR 003 LR 22
IR 004 LR 23
IR 005 LR 24
Flags ER: The specified node number is greater than 126 in a SYSMAC NET Link
System or greater than 62 in a SYSMAC LINK System.
The received data overflows the data area boundaries.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
There is no SYSMAC NET Link/SYSMAC LINK Unit.
210
Network Instructions Section 5-24
Timing
Successful
send/receive
execution
Send/receive
error
Data Processing for Data is transmitted for SEND(90) and RECV(98) for all PCs when
SEND(90)/RECV(98) SEND(90)/RECV(98) is executed. Final processing for transmissions/recep-
tions is performed during servicing of peripheral devices and Link Units.
Programming Example: To ensure successful SEND(90)/RECV(98) operations, your program must use
Multiple the SEND(90)/RECV(98) Enable Flags and SEND(90)/RECV(98) Error Flags to
SEND(90)/RECV(98) confirm that execution is possible. The following program shows one example of
how to do this for a SYSMAC NET Link System.
211
Network Instructions Section 5-24
12800
@MOV(21)
#000A
DM 0000
@MOV(21)
#0000
DM 0001
Data is placed into control data words to
@MOV(21) specify the 10 words to be transmitted to
#0003 node 3 in operating level 1 of network 00
(NSB).
DM 0002
XFER(70)
#0010
000
DM 0010
@SEND(90)
DM 0010
DM 0020
DM 0000
SEND(90)/RECV(98) Error Flag
12800 25203
00200
Turns ON to indicate transmission error.
12800 25204
DIFU(13) 12801 Resets 12800, above.
00001 25204 12800
S
12802 prevents execution of RECV(98)
KEEP(11)
when SEND(90) above has not completed.
12803
R 12802 IR 00001 is turned ON to start transmission.
12802 25204 25203
XFER(70)
#0016
Transmitted data moved into words
beginning at DM 0030 for storage.
000
DM 0030
12802
@MOV(21)
#0010
DM 0003
DM 0005
@RECV(98)
HR 10
LR 10
12802 25203
00201
Turns ON to indicate reception error.
12802 25204
DIFU(13) 12803 Resets 12802, above.
212
Network Instructions Section 5-24
213
SECTION 6
Program Execution Timing
The timing of various operations must be considered both when writing and debugging a program. The time required to ex-
ecute the program and perform other CPU operations is important, as is the timing of each signal coming into and leaving the
PC in order to achieve the desired control action at the right time. This section explains the cycle and shows how to calculate
the cycle time and I/O response times.
I/O response times in Link Systems are described in the individual System Manuals. These are listed at the end of Section 1
Introduction.
215
Cycle Time Section 6-1
216
Cycle Time Section 6-1
Power application
NO
Check OK?
YES
Resets watchdog timer and
program address counter
Sets error flags and turns
ON or flashes indicator
Program
execution
ALARM/ERROR Executes program
ALARM
(Flashing)
ERROR
(Solid ON) End of program? PC
NO
cycle
YES time
SCAN(18)
executed? NO
YES Cycle time
Resets watchdog timer and waits calculation
until the set cycle time has elapsed
Peripheral
device
Services Peripheral devices
servicing
SYSMAC LINK
Services SYSMAC LINK and and SYSMAC
SYSMAC NET Link Units NET Link Unit
(C200H-CPU31-E only) servicing
217
Cycle Time Section 6-1
The first three operations immediately after power application are performed
only once each time the PC is turned on. The rest of the operations are per-
formed in cyclic fashion, with each scan forming one cycle. The cycle time is the
time that is required for the CPU to complete one of these cycles. This cycle in-
cludes basically seven types of operation.
1, 2, 3... 1. Overseeing
2. Program execution
4. I/O refreshing
The cycle time is the total time required for the PC to perform all of the above
operations, in the order 4, 5, 6, 7, 1, 2.
218
Cycle Time Section 6-1
Special I/O Units in Remote Remote I/O Master Units are serviced only once each cycle. When Special I/O
I/O Slave Racks Units are mounted in Remote I/O Slave Racks, the Remote I/O transmission
time may exceed the cycle time. There may be cycles in which there is no I/O
refresh between the Master and the PC. Inaccurate signals may be sent, espe-
cially when differential instructions are turned ON and OFF.
Watchdog Timer and Long Within the PC, the watchdog timer measures the cycle time and compares it to a
Cycle Times set value. If the cycle time exceeds the set value of the watchdog timer, a FALS
9F error is generated and the CPU stops. WDT(94) can be used to extend the set
value for the watchdog timer.
219
Calculating Cycle Time Section 6-2
Even if the cycle time does not exceed the set value of the watchdog timer, a long
cycle time can adversely affect the accuracy of system operations as shown in
the following table.
Cycle time (ms) Possible adverse affects
10 or greater TIMH(15) inaccurate when TC 016 through TC 511 are used.
20 or greater 0.02-second clock pulse not accurately readable.
100 or greater 0.1-second clock pulse not accurately readable and Cycle
Timer Error Flag (25309) turns ON.
200 or greater 0.2-second clock pulse not accurately readable.
6,500 or greater FALS code 9F generated regardless of watchdog timer setting
and the system stops.
CPU Rack
Calculations The equation for the cycle time from above is as follows:
Cycle time = overseeing time + program execution time
+ I/O refreshing time + peripheral device servicing time
The overseeing time is fixed at 3.1 ms.
220
Calculating Cycle Time Section 6-2
The Programming Console is mounted to the PC and the total cycle time of oper-
ations 1, 2, 4, and 5 is less than 13 ms, so the peripheral device servicing time is
0.8 ms.
The cycle time would thus be 3.1 ms + 4.7 ms+ 0.9 ms + 0.8 ms = 9.5 ms
CPU Rack
Computer
Slave Rack
16-point 12-point
Input Units Output Units
(8 points x 3) x 70 µs + (8 points x 3) x 40 µs
+ 1.3 ms + 8 Units x 0.2 ms = 3.23 ms
8 points
221
Instruction Execution Times Section 6-3
A Host Link Unit is mounted, so the Host Link Unit servicing time is 8.0 ms.
The Programming Console is mounted to the PC and the total cycle time, T, of
operations 1, 2, 4, and 5 is greater than 13 ms, so the peripheral device servicing
time is (0.06 x T) ms = (0.06 x 19) ms = 1.14 ms.
The cycle time is 3.1 ms + 8.0 ms + 1.14 ms + 4.7 ms + 3.23 ms = 20.2 ms.
222
Instruction Execution Times Section 6-3
223
Instruction Execution Times Section 6-3
224
Instruction Execution Times Section 6-3
225
Instruction Execution Times Section 6-3
226
I/O Response Time Section 6-4
00000
00200
Minimum I/O Response The PC responds most quickly when it receives an input signal just prior to the
Time I/O refresh period in the cycle. Once the input bit corresponding to the signal has
been turned ON, the program will have to be executed once to turn ON the out-
put bit for the desired output signal and then the I/O refresh operation would
have to be repeated to refresh the output bit. The I/O response time in this case
is thus found by adding the input ON-delay time, the cycle time, and the output
ON-delay time. This situation is illustrated below.
I/O refresh
Input
signal
CPU reads
input signal
Input
ON delay
Output ON delay
Output
signal
Minimum I/O response time = input ON delay + cycle time + I/O refresh time +
output ON delay
Maximum I/O Response The PC takes longest to respond when it receives the input signal just after the
Time I/O refresh phase of the cycle. In this case the CPU does not recognize the input
signal until the end of the next cycle. The maximum response time is thus one
cycle longer than the minimum I/O response time, except that the I/O refresh
227
I/O Response Time Section 6-4
time would not need to be added in because the input comes just after it rather
than before it.
I/O refresh
Input
signal
CPU reads
input signal
Input
ON delay
Output
ON delay
Output
signal
228
SECTION 7
Program Monitoring and Execution
This section provides the procedures for monitoring and controlling the PC through a Programming Console. If you are using
a GPC, a FIT, or a computer running LSS, refer to the Operation Manual for procedures on these.
229
Monitoring Operation and Modifying Data Section 7-1
230
Monitoring Operation and Modifying Data Section 7-1
Key Sequence
Clears leftmost
address
Cancels monitor
operation
Examples The following examples show various applications of this monitor operation.
Program Read then Monitor
00100
00100READ
TIM 000
T000
1234
T0001
â0000
Indicates Completion flag is ON
231
Monitoring Operation and Modifying Data Section 7-1
Bit Monitor
00000
00000
LD 00001
00001
^ ON
00000
CONT 00001
Word Monitor
00000
00000
CHANNEL 000
00000
CHANNEL LR 01
cL01
FFFF
cL00
0000
232
Monitoring Operation and Modifying Data Section 7-1
00000
00000
TIM 000
T000
0100
00000 T000
0100
00001 T000
0100
00001 T000
OFF 0100
D000000001 T000
^OFF 0100
D000000001 T000
10FF^ OFF 0100
T000D000000001
0100 10FF^ OFF
0001
OFF
00000
CONT 00001
0000000001
S ONR OFF
233
Monitoring Operation and Modifying Data Section 7-1
Bit status will remain ON or OFF only as long as the key is held down; the original
status will return as soon as the key is released. If a timer is started, the comple-
tion flag for it will be turned ON when SV has been reached.
SHIFT and PLAY/SET or SHIFT and REC/RESET can be pressed to maintain
the status of the bit after the key is released. The bit will not return to its original
status until the NOT key is pressed, or one of the following conditions is met.
1. The Force Status Clear operation is performed.
2. The PC mode is changed.
3. Operation stops due to a fatal error or power interruption.
4. The I/O Table Registration operation is performed.
This operation can be used in MONITOR mode to check wiring of outputs from
the PC prior to actual program execution. This operation cannot be used in RUN
mode.
Note The forced set/reset bit status will be maintained when switching from PRO-
GRAM to MONITOR mode if the Force Status Hold Flag is ON and has been
enabled with the SET SYSTEM instruction (SYS(49)).
Key Sequence
Example The following example shows how either bits or timers can be controlled with the
Force Set/Reset operation. The displays shown below are for the following pro-
gram section.
00002
TIM 000 012.3 s
#0123
TIM 000
00500
00200 LD 00002
# 0123
The following displays show what happens when TIM 000 is set with 00100 OFF
(i.e., 00500 is turned ON) and what happens when TIM 000 is reset with 00100
234
Monitoring Operation and Modifying Data Section 7-1
ON (i.e., timer starts operation, turning OFF 00500, which is turned back ON
when the timer has finished counting down the SV).
0010000500 Monitoring
00100 and
^ OFF^ OFF 00500.
0010000500
á ON^ OFF
0010000500
á OFF^ OFF
T0000010000500
^ OFF^ OFF
T0000010000500 Monitoring
0123^ OFF^ OFF TIM 000.
T0000010000500
á0123^ ON^ OFF Timer starts timing, turning
00500 OFF.*
T0000010000500
0122^ ON^ OFF
Key Sequence
When the PLAY/SET and REC/RESET keys are pressed, a beeper will sound. If
you mistakenly press the wrong key, then press CLR and start again from the
beginning.
235
Monitoring Operation and Modifying Data Section 7-1
Example The following example shows the displays that appear when Restore Status is
carried out normally.
00000
00000
00000FORCE RELE?
00000FORCE RELE
END
236
Monitoring Operation and Modifying Data Section 7-1
Example The following example shows the effects of changing the PV of a timer.
This example is in MONITOR mode
00000
00000
TIM 000
T000
0122
Timing
00000PRES VAL?
PV changed
T000 0119 ????
Timing
00000PRES VAL?
T000 0100 0200
Timing
T000
0199
Timing
237
Monitoring Operation and Modifying Data Section 7-1
Key Sequence
Word currently
displayed.
Example 00000
00000
CH DM 0000
D0000
4412
D0000
AB
D0000
4142
238
Monitoring Operation and Modifying Data Section 7-1
Key Sequence
Example 00000
00000
CHANNEL DM 0000
D0000
89AB
D0002D0001D0000
0123 4567 89AB
D0003D0002D0001
ABCD 0123 4567
D0004D0003D0002
EF00 ABCD 0123
D0005D0004D0003
1111 EF00 ABCD
D0004D0003D0002
EF00 ABCD 0123
D0002
0123
Key Sequence
3 words currently
displayed [ Data ]
239
Monitoring Operation and Modifying Data Section 7-1
Example
D0002 3CHCHANG?
á0001 4567 89AB
D0002 3CHCHANG?
0001á4567 89AB
D0002 3CHCHANG?
0001á2345 89AB
D0002D0001D0000
0001 2345 89AB
Key Sequence
[Word]
Binary
monitor clear
All monitor
clear
240
Monitoring Operation and Modifying Data Section 7-1
Example 00000
00000
CHANNEL 000
c000 MONTR
0000000000001111
c001 MONTR
0000010101010100
00000
CHANNEL 001
00000
00000
CHANNEL DM 0000
D0000
FFFF
D0000 MONTR
1111111111111111
D0000
FFFF
00000
CHANNEL DM 0000
0000S0100R0110SR
241
Monitoring Operation and Modifying Data Section 7-1
Key Sequence
Word currently
displayed in binary.
242
Monitoring Operation and Modifying Data Section 7-1
Example 00000
00000
CHANNEL 000
00000
CHANNEL 001
c001 MONTR
0000010101010101
c001 CHG?
á000010101010101
c001 CHG?
1á00010101010101
c001 CHG?
10á0010101010101
c001 CHG?
100á010101010101
c001 CHG?
100Sá10101010101
c001 CHG?
100á010101010101
c001 CHG?
10áS010101010101
c001 CHG?
1áRS010101010101
c001 MONTR
10RS010101010101
IR bit 00115 IR bit 00100
243
Monitoring Operation and Modifying Data Section 7-1
Key Sequence
Example The following examples show inputting a new constant, changing from a con-
stant to an address, and incrementing to a new constant.
00201SRCH
TIM 000
00201 DATA?
T000 #0123 c???
00201 DATA?
T000 #0123 c010
244
Monitoring Operation and Modifying Data Section 7-1
00000
TIM 000
00201SRCH
TIM 000
00201DATA ? U/D
T000 #0123 #0123
Current SV (during
change operation)
00201DATA ?
T000 #0123 #0122
00201DATA ?
T000 #0123 #0123
00201DATA ?
T000 #0123 #0124
00201DATA ?
T000 #0124 #????
245
Program Backup and Restore Operations Section 7-2
Note UM and DM can be recorded together in a single cassette if the file number
of the UM is different from that of the DM and also if the capacity of the cas-
sette permits.
Error Messages The following error messages may appear during cassette tape operations.
246
Program Backup and Restore Operations Section 7-2
Key Sequence
A
CLR EXT 0 [File no.] WRITE [Start address]
**These times take the cassette leader tape into consideration according to the following:
a) When recording to tape, the leader tape needs to be allowed to pass before the data
transmission to the tape player starts.
247
Program Backup and Restore Operations Section 7-2
b) When restoring from tape or comparing data, the Programming Console needs to be ready to
receive data before the data is transfered from the tape.
Example 00000
00000MT
UM:0 DM:1
Selecting
00000MT Program Memory
FILE NO.00000000
00000MT
FILE NO.86031400
00000MT
START ADDR 00000
Starting address of
00000MT data to be recorded
START ADDR 00345
Last address
00345MT
STOP ADDR 03890
Stop address
00345MT specified
STOP ADDR 05789
Start recording
Continue within 5 seconds
Recording in progress
02420MT RECORD á
FILE NO.86031400
04801MT RECORD á
END (01)(05.6KW)
04801MT DISCONTD
END (01)(05.6KW)
05789RECORD END
END (01)(06.8KW)
248
Program Backup and Restore Operations Section 7-2
A
CLR EXT 0 [File no.] WRITE [Start address]
**These times take the cassette leader tape into consideration according to the following:
a) When recording to tape, the leader tape needs to be allowed to pass before the data
transmission to the tape player starts.
b) When restoring from tape or comparing data, the Programming Console needs to be ready to
receive data before the data is transfered from the tape.
249
Program Backup and Restore Operations Section 7-2
Example
00000
00000MT
UM:0 DM:1
00000MT
FILE NO.00000000
00000MT
FILE NO.86031400
00000MT
START ADDR 00000
00000MT
START ADDR 00345
250
Program Backup and Restore Operations Section 7-2
CLR is pressed to cancel. Refer to the relevant operation in the preceding sec-
tions for details. An example for each operation is given below.
Key Sequence
B REC
Start tape recorder Saving
CLR EXT 1 [File no.] SHIFT
recording. RESET
VER
Comparing
**These times take the cassette leader tape into consideration according to the following:
a) When recording to tape, the leader tape needs to be allowed to pass before the data
transmission to the tape player starts.
b) When restoring from tape or comparing data, the Programming Console needs to be ready to
receive data before the data is transfered from the tape.
00000MT
UM:0 DM:1
D0000MT
FILE NO.00000012
Start recording
D0127MT DISCONTD
FILE NO.00000012
Recording stops at the end.
D1999 OK
FILE NO.00000012
251
Program Backup and Restore Operations Section 7-2
00000MT
UM:0 DM:1
Selecting the
D0000MT DM area
FILE NO.00000000
D0000MT
FILE NO.00000012
Start tape playback
Within 5 seconds
D0127MT DISCONTD
FILE NO.00000012
Restoring stopped at the end.
D1999MT END
FILE NO.00000012
252
Program Backup and Restore Operations Section 7-2
00000MT
UM:0 DM:1
Selecting the
D0000MT DM area
FILE NO.00000000
D0000MT
FILE NO.00000012
Start tape playback
Within 5 seconds
253
SECTION 8
Troubleshooting
The C200H provides self-diagnostic functions to identify many types of abnormal system conditions. These functions mini-
mize downtime and enable quick, smooth error correction.
This section provides information on hardware and software errors that occur during PC operation. Program input errors are
described in 4-7 Inputting, Modifying, and Checking the Program. Although described in Section 3 Memory Areas, flags and
other error information provided in SR and AR areas are listed in 8-5 Error Flags.
255
Error Messages Section 8-4
! Caution The PC will turn ON the ALARM/ERROR indicator, stop program execution, and
turn OFF all outputs from the PC for most hardware errors, for certain fatal soft-
ware errors, or when FALS(07) is executed in the program (see tables on follow-
ing pages). PC operation will continue for all other errors. It is the user’s respon-
sibility to take adequate measures to ensure that a hazardous situation will not
result from automatic system shutdown for fatal errors and to ensure that proper
actions are taken for errors for which the system is not automatically shut down.
System flags and other system and/or user-programmed error indications can
be used to program proper actions.
256
Error Messages Section 8-4
these are also indicated by FAL number being transferred to the FAL area of the
SR area.
The type of error can be quickly determined from the indicators on the CPU, as
described below for the three types of errors. If the status of an indicator is not
mentioned in the description, it makes no difference whether it is lit or not.
After eliminating the cause of an error, clear the error message from memory
before resuming operation.
Asterisks in the error messages in the following tables indicate variable numeric
data. An actual number would appear on the display.
Initialization Errors The following error messages appear before program execution has been
started. The POWER indicator will be lit and the RUN indicator will not be lit for
either of these. The RUN output will be OFF for each of these errors.
Error and message FAL no. Probable cause Possible correction
Waiting for start input None Start input on CPU Power Short start input terminals
Unit is OFF. on CPU Power Unit.
CPU WAITãG
Waiting for Special I/O, None A Special I/O Unit has not Perform the I/O Table Read
High-density I/O Units initialized. operation to check unit
numbers. Replace Unit if it
CPU WAITãG is indicated by “$” only in
the I/O table.
(High-density I/O Units will
not appear on I/O Table
Read display for all
peripheral devices.)
Waiting for Remote I/O None Power to Remote I/O Unit is Check power supply to
off or terminator cannot be Remote I/O Units,
CPU WAITãG found. connections between
Remote I/O Units, and
terminator setting.
257
Error Messages Section 8-4
Non-fatal Operating Errors The following error messages appear for errors that occur after program execu-
tion has been started. PC operation and program execution will continue after
one or more of these errors have occurred. For each of these errors, the
POWER and RUN indicators will be lit and the ALARM/ERROR indicator will be
flashing. The RUN output will be ON.
Error and message FAL no. Probable cause Possible correction
01 to 99 FAL(06) has been executed Correct according to cause
FAL error in program. Check the FAL indicated by FAL number
SYS FAIL FAL** number to determine (set by user).
conditions that would cause
execution (set by user).
I/O table verification error E7 Unit has been removed or Use I/O Table Verify
replaced by a different kind Operation to check I/O table
I/O VER ERR
of Unit, making I/O table and either connect dummy
incorrect. Units or register the I/O
table again.
Remote I/O error B0 or B1 Error occurred in Check transmission line
transmissions between between PC and Master
RMTE I/O ERR *
Remote I/O
Remote I/O Units. and between Remote I/O
Master Unit number Units.
Fatal Operating Errors The following error messages appear for errors that occur after program execu-
tion has been started. PC operation and program execution will stop and all out-
puts from the PC will be turned OFF when any of the following errors occur. No
CPU indicators will be lit for the power interruption error. For all other fatal oper-
ating errors, the POWER and ALARM/ERROR indicators will be lit. The RUN
output will be OFF.
258
Error Messages Section 8-4
Power interruption None Power has been Check power supply voltage
No message. interrupted for at least and power lines. Try to
10 ms. power-up again.
I/O bus error C0 to C2 Error has occurred in The rightmost digit of the FAL
the bus line between the number will indicate the number
I/O BUS ERR *
Rack no. CPU and I/O Units. of the Rack where the error was
detected. Check cable
connections between the I/O
Units and Racks.
Too many Units E1 Two or more Special I/O Perform the I/O Table Read
Units are set to the operation to check unit
I/O UNIT OVER same unit number or two numbers, and eliminate
or more Group-2 duplications. (High-density I/O
High-density I/O Units Units other than Group-2 are
are set to the same I/O Special I/O Units, too.)
number or I/O word. Set unit numbers of 64-pt
The I/O number of a Group-2 High-density I/O Units
64-pt Group-2 to numbers other than 9.
High-density I/O Unit is Check the SYSMAC NET Link
set to 9. and SYSMAC LINK Unit
Two SYSMAC NET Link operating levels and eliminate
or SYSMAC LINK Units duplications.
share the same
operating level.
Input-output I/O table error E0 Input and output word Check the I/O table with I/O
designations registered Table Verification operation and
I/O SET ERROR
in I/O table do no agree check all Units to see that they
with input/output words are in correct configuration.
required by Units When the system has been
actually mounted. confirmed, register the I/O table
again.
259
Error Flags Section 8-5
Other Error Messages A number of other error messages are detailed within this manual. Errors in pro-
gram input and debugging can be examined in Section 4 Writing and Inputting
the Program and errors in cassette tape operation are detailed in 7-2 Program
Backup and Restore Operations.
260
Error Flags Section 8-5
AR Area
Address(es) Function
0000 to 0009 Special I/O or PC Link Unit Error Flags
0010 SYSMAC LINK/SYSMAC NET Link Level 1 System
Error Flags
0011 SYSMAC LINK/SYSMAC NET Link Level 0 System
Error Flags
0012 Rack-mounting Host Link Unit Level 1 Error Flag
0013 Rack-mounting Host Link Unit Level 0 Error Flag
0014 Remote I/O Master Unit 1 Error Flag
0015 Remote I/O Master Unit 0 Error Flag
0200 to 0204 Error Flags for Slave Racks 0 to 4
0205 to 0214 Group-2 High-density I/O Unit Error Flags
(Indicate I/O number of problem Units. Bits AR 0205
to AR 0214 correspond to I/O numbers 0 to 9.)
0300 to 0315 Optical I/O Units (0 to 7) Error Flags
0400 to 0415 Optical I/O Units (8 to 15) Error Flags
0500 to 0515 Optical I/O Units (16 to 23) Error Flags
0600 to 0615 Optical I/O Units (24 to 31) Error Flags
0713 to 0715 Error History Bits
1114 Communications Controller Error Flag Level 0
1115 EEPROM Error Flag for operating level 0
1514 Communications Controller Error Flag Level 1
1515 EEPROM Error Flag for operating level 1
2404 CPU Low Battery Flag
(If SR 25308 is ON and this flag is OFF, the Memory
Unit battery is low.)
2500 to 2515 FALS-generating address or cycle time error (BCD)
261
Appendix A
Standard Models
C200H Racks
Name Specifications Model number
Backplane (same for all Racks) 10 slots C200H-BC101-V2
8 slots C200H-BC081-V2
5 slots C200H-BC051-V2
3 slots C200H-BC031-V2
CPU Rack CPUs w/built-in power supply (100 to 120/200 to 240 VAC); C200H-CPU21-E
Output current: 4.6 A (3.2 A to I/O Units)
w/built-in power supply (24 VDC); C200H-CPU23-E
Output current: 3 A (1.6 A to I/O Units)
w/built-in power supply (100 to 120/200 to 240 VAC); C200H-CPU31-E
Output current: 4.6 A (3.0 A to I/O Units);
Can support SYSMAC NET Link/SYSMAC LINK Units.
Memory Units CMOS-RAM Units; battery back-up UM: 3K words; C200H-MR431
DM: 1K words
UM: 7K words; C200H-MR831
DM: 1K words
CMOS-RAM Units; battery back-up; UM: 3K words; C200H-MR433
with clock DM: 1K words
UM: 7K words; C200H-MR833
DM: 1K words
CMOS-RAM Units; capacitor back-up UM: 3K words; C200H-MR432
DM: 1K words
UM: 7K words; C200H-MR832
DM: 1K words
EPROM Unit UM: 7K words; C200H-MP831
(EPROM ordered separately) DM: 1K words
EEPROM Units UM: 3K words; C200H-ME431
DM: 1K words
UM: 7K words; C200H-ME831
DM: 1K words
EEPROM Units with clock UM: 3K words; C200H-ME432
DM: 1K words
UM: 7K words; C200H-ME832
DM: 1K words
EPROM 27128; 150 ns; write voltage: 12.5 V ROM-ID-B
Expansion I/O Power Supply 100 to 120/200 to 240 VAC (selectable) C200H-PS221
I/O Racks Units 24 VDC C200H-PS211
I/O Connecting 30 cm C200H-CN311
Cables (max. total 70 cm C200H-CN711
length: 12 m)
2m C200H-CN221
5m C200H-CN521
10 m C200H-CN131
263
Standard Models Appendix A
Note 1. C200H-OD212 Transistor Output Unit and C200H-OC225 Contact Output Unit must be mounted to ei-
ther a C200H-BC031-V2, C200H-BC051-V2, C200H-BC081-V2, or C200H-BC101-V2 Backplane.
2. The C200H-OC225 might overheat if more than 8 outputs are turned ON simultaneously.
264
Standard Models Appendix A
265
Standard Models Appendix A
Note For Read/Write Head and Data Carrier combinations, refer to the V600 FA ID System R/W Heads and EE-
PROM Data Carriers Operation Manual and Supplement or V600 FA ID System R/W Heads and SRAM
Data Carriers Operation Manual and Supplement.
Optional Products
Name Specifications Model number
I/O Unit Cover Cover for 10-pin terminal block C200H-COV11
Terminal Block Covers Short protection for 10-pin terminal block (package of 10 cov- C200H-COV02
ers); 8 pts
266
Standard Models Appendix A
Note 1. When ordering, specify the model name (any component of which is not sold separately).
2. Order the pressfit tool from the manufacturer.
Optical Units
Name Specifications Model no.
Optical I/O No-voltage Input Units 8 pts. 100 to 120 VAC APF/PCF 3G5A2-ID001-PE
Units power supply PCF 3G5A2-ID001-E
AC/DC Input Units 12 to 24 VAC/DC 8 pts. APF/PCF 3G5A2-IM211-PE
PCF 3G5A2-IM211-E
AC Input Units 100 to 120 VAC 8 pts. APF/PCF 3G5A2-IA121-PE
PCF 3G5A2-IA121-E
200 to 240 VAC 8 pts. 100 to 120/200 to APF/PCF 3G5A2-IA221-PE
240 VAC power PCF 3G5A2-IA221-E
supply
Relay Output Units 2A, 250 VAC/24 VDC APF/PCF 3G5A2-OC221-PE
(w/relay socket) 8 pts. PCF 3G5A2-OC221-E
Triac Output Units 1A, 100 to 120/200 to APF/PCF 3G5A2-OA222-PE
240 VAC (w/built-in
surge killer) 8 pts. PCF 3G5A2-OA222-E
Transistor Output Unit 0.3 A, 12 to 48 VDC APF/PCF 3G5A2-OD411-PE
8 pts.
Repeater Units Connected between 32nd and 33rd Units APF/PCF 3G5A2-RPT01-PE
when connecting more than 33 Units in a
Remote Subsystem; power supply: 85 to PCF 3G5A2-RPT01-E
250 VAC.
267
Standard Models Appendix A
Link Adapters
Name Specifications Model no.
Link Adapters 3 RS-422 connectors 3G2A9-AL001
3 optical connectors (APF/PCF) 3G2A9-AL002-PE
3 optical connectors (PCF) 3G2A9-AL002-E
1 connector for RS-232C; 2 for RS-422 3G2A9-AL003
1 connector each for APF/PCF, RS-422, and RS-232C 3G2A9-AL004-PE
1 connector each for PCF, RS-422, and RS-232C 3G2A9-AL004-E
1 connector each for APF/PCF and APF 3G2A9-AL005-PE
1 connector each for PCF and AGF 3G2A9-AL005-E
1 connector for APF/PCF; 2 for AGF 3G2A9-AL006-PE
1 connector for PCF; 2 for AGF 3G2A9-AL006-E
O/E converter; 1 connector for RS-485, 1 connector each for APF/PCF B500-AL007-PE
Used for on-line removal of FIT or SYSMAC NET Link Units from the B700-AL001
SYSMAC NET Link System, SYSMAC NET Optical Link Adapter 3
connectors for APF/PCF.
DIN Products
Name Specifications Model number
DIN Track Mounting Bracket 1 set (2 included) C200H-DIN01
DIN Track Length: 50 cm; height: 7.3 cm PFP-50N
Length: 1 m; height: 7.3 cm PFP-100N
Length: 1 m; height: 16 mm PFP-100N2
End Plate --- PFP-M
Spacer --- PFP-S
268
Standard Models Appendix A
Plastic-Clad Optical Fiber Cable (PCF) PCF stands for “Plastic-Clad Fiber.”
This cable can be used to connect any Units. The maximum length for Units hav-
ing the suffix “–P” in their model number is 200 m. The maximum length for Units
without the suffix “–P” in their model number is 800 m.
Product Description Model no.
Optical Fiber Cables 0.1 m, w/connector Ambient temperature: –10° to 70°C 3G5A2-OF011
(for indoors) 1 m, w/connector 3G5A2-OF101
2 m, w/connector 3G5A2-OF201
3 m, w/connector 3G5A2-OF301
5 m, w/connector 3G5A2-OF501
10 m, w/connector 3G5A2-OF111
20 m, w/connector 3G5A2-OF211
30 m, w/connector 3G5A2-OF311
40 m, w/connector 3G5A2-OF411
50 m, w/connector 3G5A2-OF511
Optical Fiber Cable 1 to 500 m (Order in Units of 10 m) Ambient temperature: –10° to 70°C 3G5A2-OF002
(for outdoors) 501 to 800 m (Order in Units of 10 m) Ambient temperature: 0° to 55°C
(Must not be subjected to direct
sunlight)
Crystal Optical Fiber Cable (AGF) AGF stands for “All-Glass Fiber.” Crystal
optical fiber cable is not available from OMRON.
Cable Length The connectors may be difficult to attach to the cables. Therefore,
always leave a little extra length when cutting the cable. The lengths given for
pre-assembled cables are as shown below.
Peripheral Devices
Name Specifications Model number
Hand-held Programming Vertical, w/backlight C200H-PRO27-E
Console Connecting cable required; sold separately
Data Access Console Vertical, w/backlight C200H-DAC01-E
Connecting cable required; sold separately
Programming and Data For handheld console, 2 m C200H-CN222
Access Console Connecting
Cables For handheld console, 4 m C200H-CN422
Panel Mounting Bracket Mounts Hand-held Programming Console or Data Access Con- C200H-ATT01
sole to a panel.
Programming Console Used to mount 16- or 32-point I/O Units to 29-mm height C200H-BP001
Bases rightmost two slots when mounting periph-
erals directly to CPU. 49-mm height C200H-BP002
Data Setting Console Used for data input and process value display for the C200H-DSC01
C200H-TCjjj/C200H-TVjjj/C200H-PIDjj.
Data Setting Console Con- For C200H-DSC01 2m C200H-CN225
necting Cables
4m C200H-CN425
PROM Writer Applicable to all C-series PCs. C500-PRW06
Write voltages: 12.5 or 21 V
269
Standard Models Appendix A
270
Appendix B
Programming Instructions
This appendix provides tables listing the programming instructions used with C200H PCs. The first table summa-
rizes all instructions and gives page references where more detailed information can be found in the body of the
manual. The second table gives the execution times for the instructions for both ON and OFF execution condi-
tions. The third part is divided into two tables and summarizes the instructions, giving the ladder diagram symbol, a
brief description, and the applicable data areas. In all tables, the entries are listed alphanumerically. Instructions
without function codes are given first in alphabetical order, according to the mnemonic. These are followed by the
instructions with function codes which are listed numerically, according to the function code.
A PC instruction is entered either using the appropriate Programming Console key(s) (e.g., LD, AND, OR, NOT),
or by using function codes. To input an instruction using its function code, press FUN, the function code, and then
WRITE.
Function Code Name Mnemonic Page
–– AND AND 102
–– AND LOAD AND LD 103
–– AND NOT AND NOT 102
–– COUNTER CNT 116
–– LOAD LD 102
–– LOAD NOT LD NOT 102
–– OR OR 102
–– OR LOAD OR LD 103
–– OR NOT OR NOT 102
–– OUTPUT OUT 104
–– OUTPUT NOT OUT NOT 104
–– TIMER TIM 112
00 NO OPERATION NOP 111
01 END END 111
02 INTERLOCK IL 108
03 INTERLOCK CLEAR ILC 108
04 JUMP JMP 110
05 JUMP END JME 110
06 FAILURE ALARM FAL 197
07 SEVERE FAILURE ALARM FALS 197
08 STEP DEFINE STEP 188
09 STEP START SNXT 188
10 SHIFT REGISTER SFT 121
11 KEEP KEEP 106
12 REVERSIBLE COUNTER CNTR 119
13 DIFFERENTIATE UP DIFU 104
14 DIFFERENTIATE DOWN DIFD 104
15 HIGH-SPEED TIMER TIMH 116
16 WORD SHIFT WSFT 128
17 REVERSIBLE WORD SHIFT RWS 128
18 CYCLE TIME SCAN 198
19 MULTI-WORD COMPARE MCMP 138
20 COMPARE CMP 139
21 MOVE MOV 130
22 MOVE NOT MVN 130
271
Programming Instructions Appendix B
272
Programming Instructions Appendix B
273
Programming Instructions Appendix B
Execution times for most instructions depend on whether they are executed with an ON or an OFF execution con-
dition. Exceptions are the ladder diagram instructions OUT and OUT NOT, which require the same time regardless
of the execution condition. The OFF execution time for an instruction can also vary depending on the circum-
stances, i.e., whether it is in an interlocked program section and the execution condition for IL is OFF, whether it is
between JMP(04) 00 and JME(05) 00 and the execution condition for JMP(04) 00 is OFF, or whether it is reset by
an OFF execution condition. “R,” “IL,” and “JMP” are used to indicate these three times.
274
Programming Instructions Appendix B
275
Programming Instructions Appendix B
276
Programming Instructions Appendix B
277
Programming Instructions Appendix B
278
Programming Instructions Appendix B
Basic Instructions
Name Symbol Function Operand Data Areas
Mnemonic
AND Logically ANDs the status of the desig- B:
AND B nated bit with the current execution condi- IR
tion. SR
HR
AR
LR
TC
AND LOAD Logically ANDs the resultant execution None
AND LD conditions of the preceding logic blocks.
Data Areas
These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers.
IR SR HR TR AR LR TC DM #
00000 to 23515 23600 to 25507 HR 0000 to 9915 TR 0 to 7 AR 0000 to 2715 LR 0000 to 6315 TC 000 to 511 Read/Wr: DM 0000 to DM 0999 0000 to 9999
Rd only: DM 1000 to DM 1999 or 0000 to FFFF
279
Programming Instructions Appendix B
Data Areas
These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers.
IR SR HR TR AR LR TC DM #
00000 to 23515 23600 to 25507 HR 0000 to 9915 TR 0 to 7 AR 0000 to 2715 LR 0000 to 6315 TC 000 to 511 Read/Wr: DM 0000 to DM 0999 0000 to 9999
Rd only: DM 1000 to DM 1999 or 0000 to FFFF
280
Programming Instructions Appendix B
Special Instructions
Name Symbol Function Operand Data Areas
Mnemonic
NO OPERATION Nothing is executed and program opera- None
NOP(00) tion moves to the next instruction.
None
00000 to 23515 23600 to 25507 HR 0000 to 9915 TR 0 to 7 AR 0000 to 2715 LR 0000 to 6315 TC 000 to 511 Read/Wr: DM 0000 to DM 0999 0000 to 9999
Rd only: DM 1000 to DM 1999 or 0000 to FFFF
281
Programming Instructions Appendix B
SHIFT REGISTER Creates a bit shift register for data from the St/E:
SFT(10) I starting word (St) through to the ending IR
word (E). I: input bit; P: shift pulse; R: reset HR
P SFT(10)
input. St must be less than or equal to E. St AR
ST
and E must be in the same data area. LR
R E
15 00 15 00
E ST IN
Data Areas
These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers.
IR SR HR TR AR LR TC DM #
00000 to 23515 23600 to 25507 HR 0000 to 9915 TR 0 to 7 AR 0000 to 2715 LR 0000 to 6315 TC 000 to 511 Read/Wr: DM 0000 to DM 0999 0000 to 9999
Rd only: DM 1000 to DM 1999 or 0000 to FFFF
282
Programming Instructions Appendix B
Data Areas
These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers.
IR SR HR TR AR LR TC DM #
00000 to 23515 23600 to 25507 HR 0000 to 9915 TR 0 to 7 AR 0000 to 2715 LR 0000 to 6315 TC 000 to 511 Read/Wr: DM 0000 to DM 0999 0000 to 9999
Rd only: DM 1000 to DM 1999 or 0000 to FFFF
283
Programming Instructions Appendix B
x101 x161
x102 x162
x103 x163
ARITHMETIC SHIFT Each bit within a single word of data (Wd) Wd:
LEFT is shifted one bit to the left, with zero written IR
(@)ASL(25) to bit 00 and bit 15 moving to CY. HR
ASL(25) AR
Wd 15 00 LR
CY Wd 0 DM
ARITHMETIC SHIFT Each bit within a single word of data (Wd) Wd:
RIGHT is shifted one bit to the right, with zero writ- IR
(@)ASR(26) ten to bit 15 and bit 00 moving to CY. HR
ASR(26) AR
Wd 15 00 LR
0 Wd CY DM
ROTATE LEFT Each bit within a single word of data (Wd) Wd:
(@)ROL(27) is moved one bit to the left, with bit 15 mov- IR
ing to carry (CY), and CY moving to bit 00. HR
ROL(27) AR
Wd 15 00 LR
Wd CY DM
Data Areas
These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers.
IR SR HR TR AR LR TC DM #
00000 to 23515 23600 to 25507 HR 0000 to 9915 TR 0 to 7 AR 0000 to 2715 LR 0000 to 6315 TC 000 to 511 Read/Wr: DM 0000 to DM 0999 0000 to 9999
Rd only: DM 1000 to DM 1999 or 0000 to FFFF
284
Programming Instructions Appendix B
BCD ADD Adds two 4-digit BCD values (Au and Ad) Au/Ad: R:
(@)ADD(30) and content of CY, and outputs the result to IR IR
ADD(30) the specified result word (R). SR HR
Au HR AR
Ad Au + Ad + CY R CY AR LR
R LR DM
TC
DM
#
BCD SUBTRACT Subtracts both the 4-digit BCD subtrahend Mi/Su: R:
(@)SUB(31) (Su) and content of CY, from the 4-digit IR IR
SUB(31) SR HR
BCD minuend (Mi) and outputs the result
Mi to the specified result word (R). HR AR
Su AR LR
R LR DM
Mi – Su – CY R CY TC
DM
#
BCD MULTIPLY Multiplies the 4-digit BCD multiplicand Md/Mr: R:
(@)MUL(32) (Md) and 4-digit BCD multiplier (Mr), and IR IR
MUL(32) outputs the result to the specified result SR HR
Md words (R and R + 1). R and R + 1 must be HR AR
in the same data area. AR LR
Mr
LR DM
R TC
Md x Mr R+1 R
DM
#
BCD DIVIDE Divides the 4-digit BCD dividend (Dd) by Dd/Dr: R:
(@)DIV(33) the 4-digit BCD divisor (Dr), and outputs IR IR
DIV(33) the result to the specified result words. R SR HR
Dd receives the quotient; R + 1 receives the HR AR
Dr remainder. R and R + 1 must be in the AR LR
R same data area. LR DM
TC
Dd ÷ Dr R+1 R DM
#
LOGICAL AND Logically ANDs two 16-bit input words (I1 I1/I2: R:
(@)ANDW(34) and I2) and sets the bits in the result word IR IR
ANDW(34) (R) if the corresponding bits in the input SR HR
I1 words are both ON. HR AR
I2 AR LR
R LR DM
TC
DM
#
Data Areas
These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers.
IR SR HR TR AR LR TC DM #
00000 to 23515 23600 to 25507 HR 0000 to 9915 TR 0 to 7 AR 0000 to 2715 LR 0000 to 6315 TC 000 to 511 Read/Wr: DM 0000 to DM 0999 0000 to 9999
Rd only: DM 1000 to DM 1999 or 0000 to FFFF
285
Programming Instructions Appendix B
SET CARRY Sets the Carry Flag (i.e., turns CY ON). None
(@)STC(40)
STC(40)
CLEAR CARRY Clears the Carry Flag (i.e, turns CY OFF). None
(@)CLC(41)
CLC(41)
Data Areas
These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers.
IR SR HR TR AR LR TC DM #
00000 to 23515 23600 to 25507 HR 0000 to 9915 TR 0 to 7 AR 0000 to 2715 LR 0000 to 6315 TC 000 to 511 Read/Wr: DM 0000 to DM 0999 0000 to 9999
Rd only: DM 1000 to DM 1999 or 0000 to FFFF
286
Programming Instructions Appendix B
FM+ 7 D P
ABCD........DP
Data Areas
These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers.
IR SR HR TR AR LR TC DM #
00000 to 23515 23600 to 25507 HR 0000 to 9915 TR 0 to 7 AR 0000 to 2715 LR 0000 to 6315 TC 000 to 511 Read/Wr: DM 0000 to DM 0999 0000 to 9999
Rd only: DM 1000 to DM 1999 or 0000 to FFFF
287
Programming Instructions Appendix B
CY
CY
Quotient R
Remainder R+1
Quotient R
Remainder R+ 1
Data Areas
These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers.
IR SR HR TR AR LR TC DM #
00000 to 23515 23600 to 25507 HR 0000 to 9915 TR 0 to 7 AR 0000 to 2715 LR 0000 to 6315 TC 000 to 511 Read/Wr: DM 0000 to DM 0999 0000 to 9999
Rd only: DM 1000 to DM 1999 or 0000 to FFFF
288
Programming Instructions Appendix B
+ Ad+ 1 Ad
+ CY
CY R+ 1 R
– Su + 1 Su
– CY
CY R+ 1 R
X Mr+ 1 Md
Data Areas
These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers.
IR SR HR TR AR LR TC DM #
00000 to 23515 23600 to 25507 HR 0000 to 9915 TR 0 to 7 AR 0000 to 2715 LR 0000 to 6315 TC 000 to 511 Read/Wr: DM 0000 to DM 0999 0000 to 9999
Rd only: DM 1000 to DM 1999 or 0000 to FFFF
289
Programming Instructions Appendix B
÷ Dr + 1 Dr
Quotient R+1 R
S+1 R+1
S R
S+1 R+1
Data Areas
These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers.
IR SR HR TR AR LR TC DM #
00000 to 23515 23600 to 25507 HR 0000 to 9915 TR 0 to 7 AR 0000 to 2715 LR 0000 to 6315 TC 000 to 511 Read/Wr: DM 0000 to DM 0999 0000 to 9999
Rd only: DM 1000 to DM 1999 or 0000 to FFFF
290
Programming Instructions Appendix B
Bit C D
S 0 0 00
S+1 1 1 01
S+15 0 0 15
1 1 D
00
1 1
01 D+1
0 0
15 D+15
Data Areas
These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers.
IR SR HR TR AR LR TC DM #
00000 to 23515 23600 to 25507 HR 0000 to 9915 TR 0 to 7 AR 0000 to 2715 LR 0000 to 6315 TC 000 to 511 Read/Wr: DM 0000 to DM 0999 0000 to 9999
Rd only: DM 1000 to DM 1999 or 0000 to FFFF
291
Programming Instructions Appendix B
CB+30 CB+31 0
Data Areas
These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers.
IR SR HR TR AR LR TC DM #
00000 to 23515 23600 to 25507 HR 0000 to 9915 TR 0 to 7 AR 0000 to 2715 LR 0000 to 6315 TC 000 to 511 Read/Wr: DM 0000 to DM 0999 0000 to 9999
Rd only: DM 1000 to DM 1999 or 0000 to FFFF
292
Programming Instructions Appendix B
Ym
Y4
Y3
Y1
Y2
Y0
X
X1 X2 X3 X4 Xm
Output
data m–1, where m is the
format number of data points
Input whose coordinates are
data specified in the table
format
14 08 07
15 000000 00
C
Xm (max. x-coordinate for this table)
C+1
Y0
C+2
X1
C+3
Y1
C+4
X2
C+5
Y2
C+6
Xm
C+(2m+1)
Ym
C+(2m+2)
Data Areas
These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers.
IR SR HR TR AR LR TC DM #
00000 to 23515 23600 to 25507 HR 0000 to 9915 TR 0 to 7 AR 0000 to 2715 LR 0000 to 6315 TC 000 to 511 Read/Wr: DM 0000 to DM 0999 0000 to 9999
Rd only: DM 1000 to DM 1999 or 0000 to FFFF
293
Programming Instructions Appendix B
S D
No. of
S+1 D+1
Words
S+N–1 D+N–1
Data Areas
These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers.
IR SR HR TR AR LR TC DM #
00000 to 23515 23600 to 25507 HR 0000 to 9915 TR 0 to 7 AR 0000 to 2715 LR 0000 to 6315 TC 000 to 511 Read/Wr: DM 0000 to DM 0999 0000 to 9999
Rd only: DM 1000 to DM 1999 or 0000 to FFFF
294
Programming Instructions Appendix B
St + 1
ONE DIGIT SHIFT Shifts all data, between starting word (St) St/E:
RIGHT and ending word (E), one digit (four bits) to IR
(@)SRD(75) the right, writing zero into the leftmost digit HR
SRD(75) of the ending word. St and E must be in the AR
E same data area. LR
St DM
E
E–1
0 St
S 0 to F
R 0 to F
Data Areas
These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers.
IR SR HR TR AR LR TC DM #
00000 to 23515 23600 to 25507 HR 0000 to 9915 TR 0 to 7 AR 0000 to 2715 LR 0000 to 6315 TC 000 to 511 Read/Wr: DM 0000 to DM 0999 0000 to 9999
Rd only: DM 1000 to DM 1999 or 0000 to FFFF
295
Programming Instructions Appendix B
D 0 to F
Dd + 1 Dd
÷ Dr + 1 Dr
R+1 R
SINGLE WORD Moves one word of source data (S) to the S: DBs: Of:
DISTRIBUTE destination word whose address is given IR IR IR
(@)DIST(80) DIST(80) by the destination base word (DBs) plus SR HR HR
S offset (Of). HR AR AR
DBs AR LR LR
Of LR TC TC
S Base (DBs) TC DM DM
+ DM #
Offset (OF) #
Data Areas
These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers.
IR SR HR TR AR LR TC DM #
00000 to 23515 23600 to 25507 HR 0000 to 9915 TR 0 to 7 AR 0000 to 2715 LR 0000 to 6315 TC 000 to 511 Read/Wr: DM 0000 to DM 0999 0000 to 9999
Rd only: DM 1000 to DM 1999 or 0000 to FFFF
296
Programming Instructions Appendix B
(SBs+Of) (D)
15 00
S
Data Areas
These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers.
IR SR HR TR AR LR TC DM #
00000 to 23515 23600 to 25507 HR 0000 to 9915 TR 0 to 7 AR 0000 to 2715 LR 0000 to 6315 TC 000 to 511 Read/Wr: DM 0000 to DM 0999 0000 to 9999
Rd only: DM 1000 to DM 1999 or 0000 to FFFF
297
Programming Instructions Appendix B
1 0 1 0
5 E 0 5 St 0
IN
CY
1 0 1 0
5 0 5 0
E St
IN
CY
TABLE COMPARE Compares a 4-digit hexadecimal value CD: TB/R:
(@)TCMP(85) (CD) with values in table consisting of 16 IR IR
TCMP(85) SR HR
words (TB: is the first word of the compari-
CD son table). If the value of CD falls within HR AR
TB any of the comparison ranges, corre- AR LR
R sponding bits in result word (R) are set (1 LR TC
for agreement, and 0 for disagreement). TC DM
The table must be entirely within the one DM
data area. #
R
CD Tb 0
Tb+1 1
0
Tb+13 1
Tb+14 0
Tb+15 1
1: agreement
0: disagreement
Data Areas
These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers.
IR SR HR TR AR LR TC DM #
00000 to 23515 23600 to 25507 HR 0000 to 9915 TR 0 to 7 AR 0000 to 2715 LR 0000 to 6315 TC 000 to 511 Read/Wr: DM 0000 to DM 0999 0000 to 9999
Rd only: DM 1000 to DM 1999 or 0000 to FFFF
298
Programming Instructions Appendix B
S 0 to F
D 8-bit
data
15 08 07 00
002 Copies the mask status of the Copies the time inter-
designated IIU to D. val data to D.
Data Areas
These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers.
IR SR HR TR AR LR TC DM #
00000 to 23515 23600 to 25507 HR 0000 to 9915 TR 0 to 7 AR 0000 to 2715 LR 0000 to 6315 TC 000 to 511 Read/Wr: DM 0000 to DM 0999 0000 to 9999
Rd only: DM 1000 to DM 1999 or 0000 to FFFF
299
Programming Instructions Appendix B
SYSMAC NET
C n: no. of words to be transmitted (0 to 1000)
SYSMAC LINK
C n: no. of words to be transmitted, 0 to 1000
S D
S+1 D+1
S+n–1 D+n–1
Data Areas
These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers.
IR SR HR TR AR LR TC DM #
00000 to 23515 23600 to 25507 HR 0000 to 9915 TR 0 to 7 AR 0000 to 2715 LR 0000 to 6315 TC 000 to 511 Read/Wr: DM 0000 to DM 0999 0000 to 9999
Rd only: DM 1000 to DM 1999 or 0000 to FFFF
300
Programming Instructions Appendix B
Data Areas
These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers.
IR SR HR TR AR LR TC DM #
00000 to 23515 23600 to 25507 HR 0000 to 9915 TR 0 to 7 AR 0000 to 2715 LR 0000 to 6315 TC 000 to 511 Read/Wr: DM 0000 to DM 0999 0000 to 9999
Rd only: DM 1000 to DM 1999 or 0000 to FFFF
301
Programming Instructions Appendix B
SYSMAC LINK
S D
S+1 D+1
S+n–1 D+n–1
Data Areas
These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers.
IR SR HR TR AR LR TC DM #
00000 to 23515 23600 to 25507 HR 0000 to 9915 TR 0 to 7 AR 0000 to 2715 LR 0000 to 6315 TC 000 to 511 Read/Wr: DM 0000 to DM 0999 0000 to 9999
Rd only: DM 1000 to DM 1999 or 0000 to FFFF
302
Appendix C
Programming Console Operations
The table below lists the Programming Console operations, a brief description, and the page on which they appear
in the body of this manual. All operations are described briefly, and the key sequence for inputting them given, in
the tables which form the second part of this appendix.
303
Programming Console Operations Appendix C
System Operations
Operation/Description Modes* Key sequence
Password Input RMP
Controls access to the PC’s pro- CLR MONTR CLR
gramming functions. To gain ac-
cess to the system once “PASS-
WORD” has been displayed,
press CLR, MONTR, and then
CLR.
Buzzer ON/OFF RMP B
The buzzer can be switched to SHIFT 1
operate whenever Programming
Console keys are pressed (as
well as for the normal error indi-
cation). BZ is displayed in the up-
per right corner when the buzzer
is operative. The buzzer can be
enabled by pressing SHIFT and
then 1 immediately after entering
the password, or after changing
the mode.
Data Clear P PLAY REC All Clear
Unless otherwise specified, this CLR NOT MONTR
SET RESET
operation will clear all erasable
memory in Program Memory and
Partial
IR, HR, AR, DM, and TC areas. [Address]
Clear
To clear EPROM memory the
write enable switch must be ON HR
(i.e., enabled). The branch lines
shown are used only when per- Retained if
CNT
forming a partial memory clear, pressed
with each of the memory areas
entered being retained. Specify- DM
ing an address will result in the
Program Memory after and in-
cluding that address being de-
leted. All memory up to that ad-
dress will be retained.
I/O Table Register P CH B D
Whenever I/O Unit changes are CLR FUN SHIFT CHG 9 7 1 3 WRITE
*
made that affect the operation of
the system, the I/O table needs to
be corrected to reflect the
changes. This includes the initial
registration once the system has
been established.
I/O Table Verify RPM CH
Used to check that the registered CLR FUN SHIFT VER VER
*
I/O Table matches the actual ar-
rangement of I/O Units. Pressing
VER displays the next inconsis-
tency.
304
Programming Console Operations Appendix C
WRITE
305
Programming Console Operations Appendix C
Programming Operations
Operation/Description Modes* Key sequence
Address Designation RPM
Displays the specified address. CLR [Address]
Can be used to start program-
ming from a non-zero address or
to access an address for editing.
Leading zeros need not be en-
tered. The contents of the ad-
dress will not be displayed until
the down key is pressed. The up
and down keys can then be used
to scroll through the Program
Memory.
Program Input P
Used to enter or edit program in- Address [Instruction [Operand]
displayed word]
structions. This operation over-
writes the contents of the
memory at the displayed ad-
dress. Once at the desired ad-
dress, enter the new instruction
word and then press WRITE
(preceded by NOT for differen-
tiated instructions). Input the re-
quired operands, and press
WRITE after each.
Program Read RPM
Address
Allows the user to scroll through currently
the program address-by-ad- displayed
dress. If the Program Memory is
read in RUN or MONITOR mode,
the ON/OFF status of each dis-
played bit is also shown.
Program Search RPM
Allows the program to be CLR [Instruction] SRCH SRCH
searched for occurrences of any
designated instruction or data
area address. To designate a bit Scroll through mul-
address, press SHIFT, CONT/#, ti-word instruc-
and then input the address. Then tions
CNT
306
Programming Console Operations Appendix C
307
Programming Console Operations Appendix C
308
Programming Console Operations Appendix C
309
Programming Console Operations Appendix C
310
Programming Console Operations Appendix C
311
Programming Console Operations Appendix C
312
Appendix D
Error and Arithmetic Flag Operation
The following table shows the instructions that affect the ER, CY, GT, LT and EQ flags. In general, ER indicates that
operand data is not within requirements. CY indicates arithmetic or data shift results. GR indicates that a com-
pared value is larger than some standard, LE that it is smaller, and EQ, that it is the same. EQ also indicates a result
of zero for arithmetic operations. Refer to Section 5 Instruction Set for details.
Vertical arrows in the table indicate the flags that are turned ON and OFF according to the result of the instruction.
Although ladder diagram instructions,TIM, and CNT are executed when ER is ON, other instructions with a vertical
arrow under the ER column are not executed if ER is ON. All of the other flags in the following table will also not
operate when ER is ON.
These flags are turned OFF with the END instruction and so cannot be monitored from the Programming Device.
The statuses of the flags will show the results of the most recently executed instruction. With a differentiated
instruction, flag statuses will be changed only in the first scan when the execution condition of the instruction is
satisfied; during all other scans, the differentiated instruction will not affect the statuses of the flags determined by
the previous instruction (i.e., until the execution condition is satisfied again.)
Instructions not shown do not affect any of the flags in the table. Although only the non-differentiated form of each
instruction is shown, differentiated instructions affect flags in exactly the same way.
Instructions 25503 (ER) 25504 (CY) 25505 (GR) 25506 (EQ) 25507 (LE)
TIM Unaffected Unaffected Unaffected Unaffected
CNT
END(01) OFF OFF OFF OFF OFF
STEP(08) Unaffected Unaffected Unaffected Unaffected Unaffected
SNXT(09)
CNTR(12) Unaffected Unaffected Unaffected Unaffected
TIMH(15)
WSFT(16)
RWS(17)
SCAN(18)
MCMP(19) Unaffected
CMP(20)
MOV(21) Unaffected Unaffected Unaffected
MVN(22)
BIN(23)
BCD(24)
ASL(25) Unaffected Unaffected
ASR(26)
ROL(27)
ROR(28)
COM(29) Unaffected Unaffected Unaffected
ADD(30) Unaffected Unaffected
SUB(31)
MUL(32) Unaffected Unaffected Unaffected
DIV(33)
ANDW(34)
ORW(35)
XORW(36)
XNRW(37)
INC(38)
DEC(39)
313
Error and Arithmetic Flag Operation Appendix D
Instructions 25503 (ER) 25504 (CY) 25505 (GR) 25506 (EQ) 25507 (LE)
STC(40) Unaffected ON Unaffected Unaffected Unaffected
CLC(41) Unaffected OFF Unaffected Unaffected Unaffected
MSG(46) Unaffected Unaffected Unaffected Unaffected
LMSG(47)
TERM(48) Unaffected Unaffected Unaffected Unaffected Unaffected
SYS(49)
ADB(50) Unaffected Unaffected
SBB(51)
MLB(52) Unaffected Unaffected Unaffected
DVB(53)
ADDL(54) Unaffected Unaffected
SUBL(55)
MULL(56) Unaffected Unaffected Unaffected
DIVL(57)
BINL(58)
BCDL(59)
CMPL(60) Unaffected
MPRF(61) Unaffected Unaffected Unaffected Unaffected Unaffected
CTW(63) Unaffected Unaffected Unaffected
WTC(64)
HTS(65)
STH(66)
BCNT(67)
BCMP(68)
VCAL(69)
XFER(70) Unaffected Unaffected Unaffected Unaffected
BSET(71)
ROOT(72) Unaffected Unaffected Unaffected
XCHG(73) Unaffected Unaffected Unaffected Unaffected
SLD(74)
SRD(75)
MLPX(76)
DMPX(77)
SDEC(78)
FDIV(79)
DIST(80)
COLL(81)
MOVB(82)
MOVD(83)
SFTR(84) Unaffected Unaffected Unaffected
TCMP(85) Unaffected Unaffected Unaffected
ASC(86) Unaffected Unaffected Unaffected Unaffected
INT(89)
SEND(90)
SBS(91)
314
Error and Arithmetic Flag Operation Appendix D
Instructions 25503 (ER) 25504 (CY) 25505 (GR) 25506 (EQ) 25507 (LE)
SBN(92) Unaffected Unaffected Unaffected Unaffected Unaffected
RET(93)
WDT(94)
BPRG(96)
IORF(97)
RECV(98) Unaffected Unaffected Unaffected Unaffected
315
Appendix E
Data Areas
The data areas in the C200H are summarized below. Prefixes are included with bit and word addresses when
inputting them is required to designate the area, i.e., bits/words input without a prefix are considered to be IR or SR
bits/words.
Area Bits Words Notes
IR 00000 to 23515 000 to 235 Words 000 through 029 are allocated to I/O Units on the
CPU and Expansion I/O Racks as needed.
Words 030 through 049 are allocated to Group-2
High-density I/O Units as needed.
Words 050 through 231 are allocated to Special I/O Units
and Units on Remote I/O Racks as needed.
When any of these words are not needed, they are
available for use as work bits.
SR 23600 to 25507 236 to 255 Bits 25200 to 25507 are dedicated for specific purposes
and can not be used for other purposes. Bits 23600 to
25115 are available when not used for their assigned
purposes. In designating operands, the SR area is
considered as a continuation of the IR area. See tables of
dedicated bits following this table.
HR HR 0000 to HR 00 to HR 99 HR bits are available for general data storage and
HR 9915 manipulation. The HR area maintains bit status when PC
power is turned off.
AR AR 0000 to AR 00 to AR 27 AR bits are mostly dedicated for specific purposes.
AR 2715 Unused AR bits may be used as works bits. See tables of
dedicated bits following this table.
LR LR 0000 to LR 6315 LR 00 to LR 63 LR bits are used for data exchange in PC Link Systems.
When the PC does not include a PC Link System, LR bits
may be used for data links in SYSMAC LINK or SYSMAC
NET Link Systems. LR bits may be used as work bits when
not used for data links.
DM Not accessible as Read/write: DM 0000 through DM 0999 are generally used for data
bits. DM 0000 to DM 0999 storage. DM 1000 through DM 1999 are read-only and
Read only: used for Special I/O Units.
DM 1000 to DM 1999 In the CPU31-E, DM 0969 through DM 0999 are used in
the Error History function and also for data links in
SYSMAC LINK or SYSMAC NET Link Systems.
TC (TC 000 to TC 511) (TC 000 to TC 511) The TC area consists of TC numbers used to manipulate
and access timers and counters. When used as a bit
operand, a TC number accesses the Completion Flag for
the timer or counter defined using the TC number. When
used as a word operand, the TC number accesses the
present value of the timer or counter.
TR (TR 0 to TR 7) Not accessible as words. TR bits can only be used in the LOAD and OUTPUT
instructions to store and retrieve execution conditions.
Storing and retrieving execution conditions is necessary
when programming certain types of branching ladder
diagrams.
317
Data Areas Appendix E
Dedicated Bits
Most of the bits in the SR and AR area are dedicated for specific purposes. These are summarized in the following
tables. Refer to 3-4 SR Area and 3-5 AR Area for details.
SR Allocations
As a rule, SR area bits can be used only for the purposes for which they are dedicated. The SR area contains flags
and control bits used for monitoring PC operation, accessing clock pulses, and signalling errors. SR area word
addresses range from 236 through 255; bit addresses, from 23600 through 25507.
Word(s) Bit(s) Function
236 00 to 07 Node loop status output area for operating level 0 of SYSMAC NET Link System
08 to 15 Node loop status output area for operating level 1 of SYSMAC NET Link System
237 00 to 07 Completion code output area for operating level 0 following execution of SEND(90)/RECV(98)
SYSMAC LINK/SYSMAC NET Link System
08 to 15 Completion code output area for operating level 1 following execution of SEND(90)/RECV(98)
SYSMAC LINK/SYSMAC NET Link System
238 to 241 00 to 15 Data link status output area for operating level 0 of SYSMAC LINK or SYSMAC NET Link
System
242 to 245 00 to 15 Data link status output area for operating level 1 of SYSMAC LINK or SYSMAC NET Link
System
246 00 to 15 Not used.
247 to 250 00 to 07 PC Link Unit Run Flags or data link status for operating level 1
08 to 15 PC Link Unit Error Flags or data link status for operating level 1
251 00 to 15 Remote I/O Error Flags
252 00 SEND(90)/RECV(98) Error Flag for operating level 0 of SYSMAC LINK/SYSMAC NET Link
System
01 SEND(90)/RECV(98) Enable Flag for operating level 0 of SYSMAC LINK/SYSMAC NET Link
System
02 Operating Level 0 Data Link Operating Flag
03 SEND(90)/RECV(98) Error Flag for operating level 1 of SYSMAC LINK/SYSMAC NET Link
System
04 SEND(90)/RECV(98) Enable Flag for operating level 1 of SYSMAC LINK/SYSMAC NET Link
System
05 Operating Level 1 Data Link Operating Flag
06 Host Computer to Rack-mounting Host Link Unit Level 1 Error Flag
07 Rack-mounting Host Link Unit Level 1 Restart Bit
08 CPU-mounting Host Link Unit Error Flag
09 CPU-mounting Host Link Unit Restart Bit
10 Not used.
11 Forced Status Hold Bit
12 Data Retention Control Bit
13 Rack-mounting Host Link Unit Level 0 Restart Bit
14 Not used.
15 Output OFF Bit
253 00 to 07 FAL number output area.
08 Low Battery Flag (for batteries in RAM or EEPROM Memory Units, or the CPU31-E CPU)
09 Cycle Time Error Flag
10 I/O Verification Error Flag
11 Host Computer to rack-mounting Host Link Unit Level 0 Error Flag
12 Remote I/O Error Flag
13 Normally ON Flag
14 Normally OFF Flag
15 First cycle
318
Data Areas Appendix E
AR Word Allocations
AR word addresses extend from AR 00 to AR 27; AR bit addresses extend from AR 0000 to AR 2715. Most AR
area words and bits are dedicated to specific uses, such as transmission counters, flags, and control bits, and
words AR 00 through AR 06 and AR 23 through AR 27 cannot be used for any other purpose. Words and bits from
AR 07 to AR 22 are available as work words and work bits if not used for the following assigned purposes.
Word Use
AR 07 Error History Area
AR 07 to 15 SYSMAC LINK Units
AR 16, AR 17 SYSMAC LINK and SYSMAC NET Link Units
AR 18 to AR 21 Calendar/Clock Area
AR 07, AR 22 TERMINAL Mode Key Bits
AR Bit Allocations
Word(s) Bit(s) Function
00 00 to 09 Error Flags for Special I/O Units 0 to 9 (also function as Error Flags for PC Link Units)
10 Error Flag for operating level 1 of SYSMAC LINK or SYSMAC NET Link System
11 Error Flag for operating level 0 of SYSMAC LINK or SYSMAC NET Link System
12 Host Computer to Rack-mounting Host Link Unit Level 1 Error Flag
13 Host Computer to Rack-mounting Host Link Unit Level 0 Error Flag
14/15 Remote I/O Master Unit 1/Unit 0 Error Flags
01 00 to 09 Restart Bits for Special I/O Units 0 to 9 (also function as Restart Bits for PC Link Units)
10 Restart Bit for operating level 1 of SYSMAC LINK or SYSMAC NET Link System
11 Restart Bit for operating level 0 of SYSMAC LINK or SYSMAC NET Link System
12, 13 Not used.
14/15 Remote I/O Master Unit 1/Unit 0 Restart Bits
02 00 to 04 Error Flags for Slave Racks 0 to 4
05 to 14 Error Flags for Group-2 High-density I/O Units 0 to 9
15 Error Flag for an unrecognized Group-2 High-density I/O Unit
03 00 to 15 Error Flags for Optical I/O Units 0 to 7
04 00 to 15 Error Flags for Optical I/O Units 8 to 15
05 00 to 15 Error Flags for Optical I/O Units 16 to 23
06 00 to 15 Error Flags for Optical I/O Units 24 to 31
319
Data Areas Appendix E
320
Appendix F
Word Assignment Recording Sheets
This appendix contains sheets that can be copied by the programmer to record I/O bit allocations and terminal
assignments, as well as details of work bits, data storage areas, timers, and counters.
321
I/O Bits
322
Work Bits
323
Data Storage
324
Timers and Counters
325
Appendix G
Program Coding Sheet
The following page can be copied for use in coding ladder diagram programs. It is designed for flexibility, allowing
the user to input all required addresses and instructions.
When coding programs, be sure to specify all function codes for instructions and data areas (or # for constant) for
operands. These will be necessary when inputting programs though a Programming Console or other Peripheral
Device.
327
Program Coding Sheet
328
Appendix H
Data Conversion Table
329
Appendix I
Extended ASCII
Programming Console and Data Access Console Displays
Bits 0 to 3 Bits 4 to 7
BIN 0000 0001 0010 0011 0100 0101 0110 0111 1010 1011 1100 1101 1110 1111
HEX 0 1 2 3 4 5 6 7 A B C D E F
0000 0 NUL DLE Space 0 @ P ` p 0 @ P ` p
0001 1 SOH DC1 ! 1 A Q a q ! 1 A Q a q
0010 2 STX DC2 " 2 B R b r " 2 B R b r
0011 3 ETX DC3 # 3 C S c s # 3 C S c s
0100 4 EOT DC4 $ 4 D T d t $ 4 D T d t
0101 5 ENQ NAK % 5 E U e u % 5 E U e u
0110 6 ACK SYN & 6 F V f v & 6 F V f v
0111 7 BEL ETB ' 7 G W g w ' 7 G W g w
1000 8 BS CAN ( 8 H X h x ( 8 H X h x
1001 9 HT EM ) 9 I Y i y ) 9 I Y i y
1010 A LF SUB * : J Z j z * : J Z j z
1011 B VT ESC + ; K [ k { + ; K [ k {
1100 C FF FS , < L \ l | , < L \ l |
1101 D CR GS Ć = M ] m } Ć = M ] m }
1110 E S0 RS . > N ^ n « . > N ^ n
1111 F S1 US / ? O _ o ~ / ? O _ o ~
331
Glossary
address The location in memory where data is stored. For data areas, an address con-
sists of a two-letter data area designation and a number that designates the
word and/or bit location. For the UM area, an address designates the instruction
location (UM area). In the FM area, the address designates the block location,
etc.
allocation The process by which the PC assigns certain bits or words in memory for various
functions. This includes pairing I/O bits to I/O points on Units.
AND A logic operation whereby the result is true if and only if both premises are true.
In ladder-diagram programming the premises are usually ON/OFF states of bits
or the logical combination of such states called execution conditions.
AR area A PC data area allocated to flags, control bits, and work bits.
arithmetic shift A shift operation wherein the carry flag is included in the shift.
ASCII Short for American Standard Code for Information Interchange. ASCII is used to
code characters for output to printers and other external devices.
ASCII Unit An Intelligent I/O Unit used to program in BASIC. When connected to an NSU on
a Net Link System, commands can be sent to other nodes.
Backplane A base onto which Units are mounted to form a Rack. Backplanes provide a se-
ries of connectors for these Units along with wiring to connect them to the CPU.
Backplanes also provide connectors used to connect them to other Backplanes.
In some Systems, different Backplanes are used for different Racks; in other
Systems, Racks differ only according to the Units mounted to them.
BCD calculation An arithmetic calculation that uses numbers expressed in binary-coded deci-
mal.
binary A number system where all numbers are expressed to the base 2, i.e., any num-
ber can be written using only 1’s or 2’s. Each group of four binary bits is equiva-
lent to one hexadecimal digit.
binary-coded decimal A system used to represent numbers so that each group of four binary bits is
numerically equivalent to one decimal digit.
bit A binary digit; hence a unit of data in binary notation. The smallest unit of infor-
mation that can be electronically stored in a PC. The status of a bit is either ON or
OFF. Different bits at particular addresses are allocated to special purposes,
such as holding the status input from external devices, while other bits are avail-
able for general use in programming.
bit address The location in memory where a bit of data is stored. A bit address must specify
(sometimes by default) the data area and word that is being addressed, as well
as the number of the bit.
333
Glossary
bit designator An operand that is used to designate the bit or bits of a word to be used by an
instruction.
bit number A number that indicates the location of a bit within a word. Bit 00 is the rightmost
(least-significant) bit; bit 15 is the leftmost (most-significant) bit.
bus bar The line leading down the left and sometimes right side of a ladder diagram. In-
struction execution proceeds down the bus bar, which is the starting point for all
instruction lines.
call A process by which instruction execution shifts from the main program to a sub-
routine. The subroutine may be called by an instruction or by an interrupt.
carry flag A flag that is used with arithmetic operations to hold a carry from an addition or
multiplication operation, or to indicate that the result is negative in a subtraction
operation. The carry flag is also used with certain types of shift operations.
clock pulse A pulse available at a certain bit in memory for use in timing operations. Various
clock pulses are available with different pulse widths.
clock pulse bit A bit in memory that supplies a pulse that can be used to time operations. Vari-
ous clock pulse bits are available with different pulse widths, and therefore differ-
ent frequencies.
common data Data that is stored in the LR Area of a PC and which is shared by other PCs in the
same the same system. Each PC has a specified section of the LR Area allo-
cated to it. This allocation is the same in each LR Area of each PC.
condition An message placed in an instruction line to direct the way in which the terminal
instructions, on the right side, are to be executed. Each condition is assigned to a
bit in memory that determines its status. The status of the bit assigned to each
condition determines, in turn, the execution condition for each instruction up to a
terminal instruction on the right side of the ladder diagram.
constant An operand for which the actual numeric value is specified by the user, and
which is then stored in a particular address in the data memory.
control bit A bit in a memory area that is set either through the program or via a Program-
ming Device to achieve a specific purpose, e.g., a Restart bit is turned ON and
OFF to restart a Unit.
Control System All of the hardware and software components used to control other devices. A
Control System includes the PC System, the PC programs, and all I/O devices
that are used to control or obtain feedback from the controlled system.
control signal A signal sent from the PC to effect the operation of the controlled system.
counter A dedicated group of digits or words in memory used to count the number of
times a specific process has occurred, or a location in memory accessed
334
Glossary
through a TC bit and used to count the number of times the status of a bit or an
execution condition has changed from OFF to ON.
CPU An acronym for central processing unit. In a PC System, the CPU executes the
program, processes I/O signals, communicates with external devices, etc.
CPU Rack Part of a building-block PC, the CPU Rack contains the CPU, a power supply,
and other Units. With most PCs, the CPU Rack is the only Rack that provides
linkable slots.
cycle The process used to execute a ladder-diagram program. The program is ex-
amined sequentially from start to finish and each instruction is executed in turn
based on execution conditions.
cycle time The time required for a single cycle of the ladder-diagram program.
data area An area in the PC’s memory that is designed to hold a specific type of data, e.g.,
the LR area is designed to hold common data in a PC Link System. Memory
areas that hold programs are not considered data areas.
data area boundary The highest address available within a data area. When designating an operand
that requires multiple words, it is necessary to ensure that the highest address in
the data area is not exceeded.
data sharing An aspect of PC Link Systems and of Data Links in Net Link Systems in which
common data areas or common data words are created between two or more
PCs.
decimal A number system where all numbers are expressed to the base 10. In a PC all
data is ultimately stored in binary form, four binary bits are often used to repre-
sent one decimal digit, via a system called binary-coded decimal.
default A value automatically set by the PC when the user omits to set a specific value.
Many devices will assume such default conditions upon the application of power.
definer A number used as an operand for an instruction but that serves to define the in-
struction itself, rather that the data on which the instruction is to operate. Defin-
ers include jump numbers, subroutine numbers, etc.
delay In tracing, a value that specifies where tracing is to begin in relationship to the
trigger. A delay can be either positive or negative, i.e., can designate an offset on
either side of the trigger.
destination The location where an instruction is to place the data on which it is operating, as
opposed to the location from which data is taken for use in the instruction. The
location from which data is taken is called the source.
335
Glossary
differentiated instruction An instruction that is executed only once each time its execution condition goes
from OFF to ON. Nondifferentiated instructions are executed each cycle as long
as the execution condition stays ON.
differentiation instruction An instruction used to ensure that the operand bit is never turned ON for more
than one cycle after the execution condition goes either from OFF to ON for a
Differentiate Up instruction or from ON to OFF for a Differentiate Down instruc-
tion.
digit designator An operand that is used to designate the digit or digits of a word to be used by an
instruction.
distributed control An automation concept in which control of each portion of an automated system
is located near the devices actually being controlled, i.e., control is decentralized
and ‘distributed’ over the system. Distributed control is one of the fundamental
concepts of PC Systems.
DM area A data area used to hold only word data. Words in the DM area cannot be ac-
cessed bit by bit.
electrical noise Random variations of one or more electrical characteristics such as voltage, cur-
rent, and data, which might interfere with the normal operation of a device.
error code A numeric code generated to indicate that an error exists, and something about
the nature of the error. Some error codes are generated by the system; others
are defined in the program by the operator.
exclusive OR A logic operation whereby the result is true if one, and only one, of the premises
is true. In ladder-diagram programming the premises are usually the ON/OFF
states of bits, or the logical combination of such states, called execution condi-
tions.
exclusive NOR A logic operation whereby the result is true if both of the premises are true or both
of the premises are false. In ladder-diagram programming the premises are usu-
ally the ON/OFF states of bits, or the logical combination of such states, called
execution conditions.
exection condition The ON or OFF status under which an instruction is executed. The execution
condition is determined by the logical combination of conditions on the same in-
struction line and up to the instruction currently being executed.
execution time The time required for the CPU to execute either an individual instruction or an
entire program.
Expansion I/O Backplane A Backplane which is used to create an Expansion I/O Rack.
Expansion I/O Rack Part of a building-block PC, an Expansion I/O Rack is connected to either a CPU
Rack or another Expansion I/O Rack to increase the number of slots available
for mounting Units.
extended counter A counter created in a program by using two or more count instructions in suc-
cession. Such a counter is capable of counting higher than any of the standard
counters provided by the individual instructions.
336
Glossary
extended timer A timer created in a program by using two or more timers in succession. Such a
timer is capable of timing longer than any of the standard timers provided by the
individual instructions.
Factory Intelligent Terminal A programming device provided with advanced programming and debugging
capabilities to facilitate PC operation. The Factory Intelligent Terminal also pro-
vides various interfaces for external devices, such as floppy disk drives.
fatal error An error that stops PC operation and requires correction before operation can
continue.
flag A dedicated bit in memory that is set by the system to indicate some type of oper-
ating status. Some flags, such as the carry flag, can also be set by the operator
or via the program.
flicker bit A bit that is programmed to turn ON and OFF at a specific frequency.
floating point decimal A decimal number expressed as a number between 0 and 1 (the mantissa) multi-
plied by a power of 10, e.g., 0.538 x 10-5.
Floppy Disk Interface Unit A Unit used to interface a floppy disk drive to a PC so that programs and/or data
can be stored on floppy disks.
force reset The process of forcibly turning OFF a bit via a programming device. Bits are usu-
ally turned OFF as a result of program execution.
force set The process of forcibly turning ON a bit via a programming device. Bits are usu-
ally turned ON as a result of program execution.
function code A two-digit number used to input an instruction into the PC.
Graphic Programming A programming device with advanced programming and debugging capabilities
Console to facilitate PC operation. A Graphic Programming Console is provided with a
large display onto which ladder-diagram programs can be written directly in lad-
der-diagram symbols for input into the PC without conversion to mnemonic
form.
hardware error An error originating in the hardware structure (electronic components) of the PC,
as opposed to a software error, which originates in software (i.e., programs).
hexadecimal A number system where all numbers are expressed to the base 16. In a PC all
data is ultimately stored in binary form, however, displays and inputs on Pro-
gramming Devices are often expressed in hexadecimal to simplify operation.
Each group of four binary bits is numerically equivalent to one hexadecimal digit.
Host Link System A system with one or more host computers connected to one or more PCs via
Host Link Units so that the host computer can be used to transfer data to and
from the PC(s). Host Link Systems enable centralized management and control
of PC Systems.
Host Link Unit An interface used to connect a PC to a host computer in a Host Link System.
host computer A computer that is used to transfer data or programs to from a PC in a Host Link
System. The host computer is used for data management and overall system
control. Host computers are generally personal or business computers.
337
Glossary
HR area A data area used to store and manipulate data, and to preserve data when pow-
er to the PC is turned OFF.
indirect address An address whose contents indicates another address. The contents of the sec-
ond address will be used as the operand. Indirect addressing is possible in the
DM area only.
initialization error An error that occurs either in hardware or software during the PC System star-
tup, i.e., during initialization.
initialize Part of the startup process whereby some memory areas are cleared, system
setup is checked, and default values are set.
input The signal coming from an external device into the PC. The term input is often
used abstractly or collectively to refer to incoming signals.
input bit A bit in the IR area that is allocated to hold the status of an input.
input device An external device that sends signals into the PC System.
input point The point at which an input enters the PC System. Input points correspond phys-
ically to terminals or connector pins.
input signal A change in the status of a connection entering the PC. Generally an input signal
is said to exist when, for example, a connection point goes from low to high volt-
age or from a nonconductive to a conductive state.
instruction A direction given in the program that tells the PC of an action to be carried out,
and which data is to be used in carrying out the action. Instructions can be used
to simply turn a bit ON or OFF, or they can perform much more complex actions,
such as converting and/or transferring large blocks of data.
instruction block A group of instructions that is logically related in a ladder-diagram program. Al-
though any logically related group of instructions could be called an instruction
block, the term is generally used to refer to blocks of instructions called logic
blocks that require logic block instructions to relate them to other instructions or
logic blocks.
instruction execution time The time required to execute an instruction. The execution time for any one in-
struction can vary with the execution conditions for the instruction and the oper-
ands used within it.
instruction line A group of conditions that lie together on the same horizontal line of a ladder dia-
gram. Instruction lines can branch apart or join together to form instruction
blocks.
interface An interface is the conceptual boundary between systems or devices and usual-
ly involves changes in the way the communicated data is represented. Interface
devices such as NSBs perform operations like changing the coding, format, or
speed of the data.
338
Glossary
interrupt (signal) A signal that stops normal program execution and causes a subroutine to be run.
Interrupt Input Unit A Rack-mounting Unit used to input external interrupts into a PC System.
inverse condition A condition that produces an ON execution condition when the bit assigned to it
is OFF, and an OFF execution condition when the bit assigned to it is ON.
I/O capacity The number of inputs and outputs that a PC is able to handle. This number
ranges from around one hundred for smaller PCs to two thousand for the largest
ones.
I/O Control Unit A Unit mounted to the CPU Rack in certain PCs to monitor and control I/O points
on Expansion I/O Units.
I/O devices The devices to which terminals on I/O Units, Special I/O Units, or Intelligent I/O
Units are connected. I/O devices may be either part of the Control System, if they
function to help control other devices, or they may be part of the controlled sys-
tem.
I/O Interface Unit A Unit mounted to an Expansion I/O Rack in certain PCs to interface the Expan-
sion I/O Rack to the CPU Rack.
I/O Link Created in an Optical Remote I/O System to enable input/output of one or two IR
words directly between PCs. The words are input/output between the PC con-
trolling the Master and a PC connected to the Remote I/O System through an I/O
Link Unit or an I/O Link Rack.
I/O Link Unit A Unit used with certain PCs to create an I/O Link in an Optical Remote I/O Sys-
tem.
I/O point The place at which an input signal enters the PC System, or at which an output
signal leaves the PC System. In physical terms, I/O points correspond to termi-
nals or connector pins on a Unit; in terms of programming, an I/O points corre-
spond to I/O bits in the IR area.
I/O response time The time required for an output signal to be sent from the PC in response to an
input signal received from an external device.
I/O table A table created within the memory of the PC that lists the IR area words allocated
to each Unit in the PC System. The I/O table can be created by, or modified from,
a Programming Device.
I/O Unit The most basic type of Unit mounted to a backplane to create a Rack. I/O Units
include Input Units and Output Units, each of which is available in a range of
specifications. I/O Units do not include Special I/O Units, Link Units, etc.
I/O word A word in the IR area that is allocated to a Unit in the PC System.
IR area A data area whose principal function is to hold the status of inputs coming into
the system and that of outputs that are to be set out of the system. Bits and words
in the IR that are used this way are called I/O bits and I/O words. The remaining
bits in the IR area are work bits.
jump A type of programming where execution moves directly from one point in a pro-
gram to another, without sequentially executing any instructions inbetween.
Jumps are usually conditional on an execution condition.
339
Glossary
jump number A definer used with a jump that defines the points from and to which a jump is to
be made.
ladder diagram (program) A form of program arising out of relay-based control systems that uses cir-
cuit-type diagrams to represent the logic flow of programming instructions. The
appearance of the program is similar to a ladder, and thus the name.
ladder instruction An instruction that represents the ‘rung’ portion of a ladder-diagram program.
The other instructions in a ladder diagram fall along the right side of the diagram
and are called terminal instructions.
Ladder Support Software A software package that provides most of the functions of the Factory Intelligent
Terminal on an IBM AT, IBM XT, or compatible computer.
leftmost (bit/word) The highest numbered bits of a group of bits, generally of an entire word, or the
highest numbered words of a group of words. These bits/words are often called
most-significant bits/words.
Link Adapter A Unit used to connect communications lines, either to branch the lines or to con-
vert between different types of cable. There are two types of Link Adapter:
Branching Link Adapters and Converting Link Adapters.
link A hardware or software connection formed between two Units. “Link” can refer
either to a part of the physical connection between two Units (e.g., optical links in
Wired Remote I/O Systems) or a software connection created to data existing at
another location (Network Data Links).
linkable slot A slot on either a CPU or Expansion I/O Backplane to which a Link Unit can be
mounted. Backplanes differ in the slots to which Link Units can be mounted.
Link System A system that includes one or more of the following systems: Remote I/O Sys-
tem, PC Link System, Host Link System, or Net Link System.
Link Unit Any of the Units used to connect a PC to a Link System. These are Remote I/O
Units, I/O Link Units, PC Link Units, Host Link Units, and Net Link Units.
load The processes of copying data either from an external device or from a storage
area to an active portion of the system such as a display buffer. Also, an output
device connected to the PC is called a load.
local area network A network consisting of nodes or positions in a loop arrangement. Each node
can be any one of a number of devices, which can transfer data to and from each
other.
logic block A group of instructions that is logically related in a ladder-diagram program and
that requires logic block instructions to relate it to other instructions or logic
blocks.
logic block instruction An instruction used to locally combine the execution condition resulting from a
logic block with a current execution condition. The current execution condition
could be the result of a single condition, or of another logic block. AND Load and
OR Load are the two logic block instructions.
logic instruction Instructions used to logically combine the content of two words and output the
logical results to a specified result word. The logic instructions combine all the
340
Glossary
same-numbered bits in the two words and output the result to the bit of the same
number in the specified result word.
loop A group of instructions that can be executed more than once in succession (i.e.,
repeated) depending on an execution condition or bit status.
LR area A data area that is used in a PC Link System so that data can be transferred be-
tween two or more PCs. If a PC Link System is not used, the LR area is available
for use as work bits.
masking ‘Covering’ an interrupt signal so that the interrupt is not effective until the mask is
removed.
memory area Any of the areas in the PC used to hold data or programs.
mnemonic code A form of a ladder-diagram program that consists of a sequential list of the in-
structions without using a ladder diagram. Mnemonic code is required to input a
program into a PC when using a Programming Console.
MONITOR mode A mode of PC operation in which normal program execution is possible, and
which allows modification of data held in memory. Used for monitoring or debug-
ging the PC.
NC input An input that is normally closed, i.e., the input signal is considered to be present
when the circuit connected to the input opens.
nest Programming one loop within another loop, programming a call to a subroutine
within another subroutine, or programming an IF-ELSE programming section
within another IF-ELSE section.
Net Link System An optical LAN formed from PCs connected through Net Link Units. A Net Link
System also normally contains nodes interfacing computers and other periph-
eral devices. PCs in the Net Link System can pass data back and forth, receive
commands from any interfaced computer, and share any interfaced peripheral
device.
Net Link Unit The Unit used to connect PCs to a Net Link System. The full name is “SYSMAC
Net Link Unit.”
Network Service Board A device with an interface to connect devices other than PCs to a Net Link Sys-
tem.
Network Service Unit A Unit that provides two interfaces to connect peripheral devices to a Net Link
System.
node One of the positions in a LAN. Each node incorporates a device that can commu-
nicate with the devices at all of the other nodes. The device at a node is identified
by the node number. One loop of a Net Link System (OMRON’s LAN) can consist
of up to 126 nodes. Each node is occupied by a Net Link Unit mounted to a PC or
a device providing an interface to a computer or other peripheral device.
341
Glossary
NO input An input that is normally open, i.e., the input signal is considered to be present
when the circuit connected to the input closes.
nonfatal error A hardware or software error that produces a warning but does not stop the PC
from operating.
normal condition A condition that produces an ON execution condition when the bit assigned to it
is ON, and an OFF execution condition when the bit assigned to it is OFF.
NOT A logic operation which inverts the status of the operand. For example, AND
NOT indicates an AND operation with the opposite of the actual status of the op-
erand bit.
OFF The status of an input or output when a signal is said not to be present. The OFF
state is generally represented by a low voltage or by non-conductivity, but can be
defined as the opposite of either.
OFF delay The delay between the time when a signal is switched OFF (e.g., by an input
device or PC) and the time when the signal reaches a state readable as an OFF
signal (i.e., as no signal) by a receiving party (e.g., output device or PC).
ON The status of an input or output when a signal is said to be present. The ON state
is generally represented by a high voltage or by conductivity, but can be defined
as the opposite of either.
ON delay The delay between the time when an ON signal is initiated (e.g., by an input de-
vice or PC) and the time when the signal reaches a state readable as an ON sig-
nal by a receiving party (e.g., output device or PC).
one-shot bit A bit that is turned ON or OFF for a specified interval of time which is longer than
one cycle.
on-line removal Removing a Rack-mounted Unit for replacement or maintenance during PC op-
eration.
operand Bit(s) or word(s) designated as the data to be used for an instruction. An operand
can be input as a constant expressing the actual numeric value to be used or as
an address to express the location in memory of the data to be used.
operating error An error that occurs during actual PC operation as opposed to an initialization
error, which occurs before actual operations can begin.
Optical I/O Unit A Unit that is connected in an Optical Remote I/O System to provide 8 I/O points.
Optical I/O Units are not mounted to a Rack.
Optical Slave Rack A Slave Rack connected through an Optical Remote I/O Slave Unit.
OR A logic operation whereby the result is true if either of two premises is true, or if
both are true. In ladder-diagram programming the premises are usually ON/OFF
342
Glossary
states of bits or the logical combination of such states called execution condi-
tions.
output The signal sent from the PC to an external device. The term output is often used
abstractly or collectively to refer to outgoing signals.
output bit A bit in the IR area that is allocated to hold the status to be sent to an output de-
vice.
output device An external device that receives signals from the PC System.
output point The point at which an output leaves the PC System. Output points correspond
physically to terminals or connector pins.
output signal A signal being sent to an external device. Generally an output signal is said to
exist when, for example, a connection point goes from low to high voltage or from
a nonconductive to a conductive state.
overseeing Part of the processing performed by the CPU that includes general tasks re-
quired to operate the PC.
overwrite Changing the content of a memory location so that the previous content is lost.
parity Adjustment of the number of ON bits in a word or other unit of data so that the
total is always an even number or always an odd number. Parity is generally
used to check the accuracy of data after being transmitted by confirming that the
number of ON bits is still even or still odd.
PC configuration The arrangement and interconnections of the Units that are put together to form
a functional PC.
PC Link System A system in which PCs are connected through PC Link Units to enable them to
share common data areas, i.e., each of the PCs writes to certain words in the LR
area and receives the data of the words written by all other PC Link Units con-
nected in series with it.
PC System With building-block PCs, all of the Racks and independent Units connected di-
rectly to them up to, but not including the I/O devices. The boundaries of a PC
System are the PC and the program in its CPU at the upper end; and the I/O
Units, Special I/O Units, Optical I/O Units, Remote Terminals, etc., at the lower
end.
peripheral device Devices connected to a PC System to aid in system operation. Peripheral de-
vices include printers, programming devices, external storage media, etc.
present value The current value registered in a device at any instant during its operation. Pres-
ent value is abbreviated as PV.
343
Glossary
printed circuit board A board onto which electrical circuits are printed for mounting into a computer or
electrical device.
Printer Interface Unit A Unit used to interface a printer so that ladder diagrams and other data can be
printed out.
program The list of instructions that tells the PC the sequence of control actions to be car-
ried out.
Programmable Controller A computerized device that can accept inputs from external devices and gener-
ate outputs to external devices according to a program held in memory. Pro-
grammable Controllers are used to automate control of external devices. Al-
though single-component Programmable Controllers are available, build-
ing-block Programmable Controllers are constructed from separate compo-
nents. Such building-block Programmable Controllers are formed only when
enough of these separate components are assembled to form a functional as-
sembly, i.e., no one individual Unit is called a PC.
programmed alarm An alarm given as a result of execution of an instruction designed to generate the
alarm in the program, as opposed to one generated by the system.
programmed error An error arising as a result of the execution of an instruction designed to gener-
ate the error in the program, as opposed to one generated by the system.
Programming Console The simplest form or programming device available for a PC. Programming
Consoles are available both as hand-held models and as CPU-mounting mod-
els.
Programming Device A peripheral device used to input a program into a PC or to alter or monitor a
program already held in the PC. There are dedicated programming devices,
such as Programming Consoles, and there are non-dedicated devices, such as
a host computer.
PROGRAM mode A mode of operation that allows inputting and debugging of programs to be car-
ried out, but that does not permit normal execution of the program.
PROM Writer A peripheral device used to write programs and other data into a ROM for per-
manent storage and application.
prompt A message or symbol that appears on a display to request input from the opera-
tor.
refresh The process of updating output status sent to external devices so that it agrees
with the status of output bits held in memory and of updating input bits in memory
so that they agree with the status of inputs from external devices.
relay-based control The forerunner of PCs. In relay-based control, groups of relays are intercon-
nected to form control circuits. In a PC, these are replaced by programmable cir-
cuits.
344
Glossary
Remote I/O Master Unit The Unit in a Remote I/O System through which signals are sent to all other Re-
mote I/O Units. The Remote I/O Master Unit is mounted either to a CPU Rack or
an Expansion I/O Rack connected to the CPU Rack. Remote I/O Master Unit is
generally abbreviated to Master.
Remote I/O Slave Unit A Unit mounted to a Backplane to form a Slave Rack. Remote I/O Slave Unit is
generally abbreviated to Slave.
Remote I/O System A system in which remote I/O points are controlled through a Master mounted to
a CPU Rack or an Expansion I/O Rack connected to the CPU Rack.
Remote I/O Unit Any of the Units in a Remote I/O System. Remote I/O Units include Masters,
Slaves, Optical I/O Units, I/O Link Units, and Remote Terminals.
remote I/O word An I/O word allocated to a Unit in a Remote I/O System.
reset The process of turning a bit or signal OFF or of changing the present value of a
timer or counter to its set value or to zero.
return The process by which instruction execution shifts from a subroutine back to the
main program (usually the point from which the subroutine was called).
reversible counter A counter that can be both incremented and decremented depending on the
specified conditions.
reversible shift register A shift register that can shift data in either direction depending on the specified
conditions.
rightmost (bit/word) The lowest numbered bits of a group of bits, generally of an entire word, or the
lowest numbered words of a group of words. These bits/words are often called
least-significant bits/words.
rotate register A shift register in which the data moved out from one end is placed back into the
shift register at the other end.
RUN mode The operating mode used by the PC for normal control operations.
scheduled interrupt An interrupt that is automatically generated by the system at a specific time or
program location specified by the operator. Scheduled interrupts result in the ex-
ecution of specific subroutines that can be used for instructions that must be ex-
ecuted repeatedly for a specified period of time.
self diagnosis A process whereby the system checks its own operation and generates a warn-
ing or error if an abnormality is discovered.
self-maintaining bit A bit that is programmed to maintain either an OFF or ON status until set or reset
by specified conditions.
servicing The process whereby the PC provides data to or receives data from external de-
vices or remote I/O Units, or otherwise handles data transactions for Link Sys-
tems.
set value The value from which a decrementing counter starts counting down or to which
an incrementing counter counts up (i.e., the maximum count), or the time from
which or for which a timer starts timing. Set value is abbreviated SV.
345
Glossary
shift register One or more words in which data is shifted a specified number of units to the right
or left in bit, digit, or word units. In a rotate register, data shifted out one end is
shifted back into the other end. In other shift registers, new data (either specified
data, zero(s) or one(s)) is shifted into one end and the data shifted out at the oth-
er end is lost.
Slave Rack A Rack containing a Remote I/O Slave Unit and controlled through a Remote I/O
Master Unit. Slave Racks are generally located away from the CPU Rack.
software protect A means of protecting data from being changed that uses software as opposed
to a physical switch or other hardware setting.
source The location from which data is taken for use in an instruction, as opposed to the
location to which the result of an instruction is to be written. The latter is called
the destination.
Special I/O Unit A dedicated Unit that is designed for a specific purpose. Special I/O Units in-
clude Position Control Units, High-Speed Counter Units, Analog I/O Units, etc.
SR area A data area in a PC used mainly for flags, control bits, and other information pro-
vided about PC operation. The status of only certain SR bits may be controlled
by the operator, i.e., most SR bits can only be read.
subroutine A group of instructions placed after the main program and executed only if called
from the main program or activated by an interrupt.
subroutine number A definer used to identify the subroutine that a subroutine call or interrupt acti-
vates.
switching capacity The maximum voltage/current that a relay can safely switch on and off.
syntax error An error in the way in which a program is written. Syntax errors can include
‘spelling’ mistakes (i.e., a function code that does not exist), mistakes in specify-
ing operands within acceptable parameters (e.g., specifying reserved SR bits as
a destination), and mistakes in actual application of instructions (e.g., a call to a
subroutine that does not exist).
system error An error generated by the system, as opposed to one resulting from execution of
an instruction designed to generate an error.
system error message An error message generated by the system, as opposed to one resulting from
execution of an instruction designed to generate a message.
TC area A data area that can be used only for timers and counters. Each bit in the TC area
serves as the access point for the SV, PV, and Completion flag for the timer or
counter defined with that bit.
TC number A definer that corresponds to a bit in the TC area and used to define the bit as
either a timer or a counter.
346
Glossary
terminal instruction An instruction placed on the right side of a ladder diagram that uses the final ex-
ecution conditions of an instruction line.
terminator The code comprising an asterisk and a carriage return (* CR) which indicates the
end of a block of data, whether it is a single-frame or multi-frame block. Frames
within a multi-frame block are separated by delimiters.
timer A location in memory accessed through a TC bit and used to time down from the
timer’s set value. Timers are turned ON and reset according to their execution
conditions.
TR area A data area used to store execution conditions so that they can be reloaded later
for use with other instructions.
trace An operation whereby the program is executed and the resulting data is stored in
TM memory to enable step-by-step analysis and debugging.
transfer The process of moving data from one location to another within the PC, or be-
tween the PC and external devices. When data is transferred, generally a copy
of the data is sent to the destination, i.e., the content of the source of the transfer
is not changed.
trigger address An address in the program that defines the beginning point for tracing. The ac-
tual beginning point can be altered from the trigger by defining either a positive or
negative delay.
UM area The memory area used to hold the active program, i.e., the program that is being
currently executed.
Unit In OMRON PC terminology, the word Unit is capitalized to indicate any product
sold for a PC System. Though most of the names of these products end with the
word Unit, not all do, e.g., a Remote Terminal is referred to in a collective sense
as a Unit. Context generally makes any limitations of this word clear.
unit number A number assigned to some Link Units and Special I/O Units to facilitate identifi-
cation when assigning words or other operating parameters to it.
watchdog timer A timer within the system that ensures that the cycle time stays within specified
limits. When limits are reached, either warnings are given or PC operation is
stopped depending on the particular limit that is reached.
Wired Slave Rack A Slave Rack connected through a Wired Remote I/O Slave Unit.
word A unit of data storage in memory that consists of 16 bits. All data areas consists
of words. Some data areas can be accessed only by words; others, by either
words or bits.
word address The location in memory where a word of data is stored. A word address must
specify (sometimes by default) the data area and the number of the word that is
being addressed.
word multiplier A value between 0 and 3 that is assigned to a Master in a Remote I/O System so
that words can be allocated to non-Rack-mounting Units within the System. The
347
Glossary
word setting made on the Unit is added to 32 times the word multiplier to arrive at
the actual word to be allocated.
work word A word that can be used for data calculation or other manipulation in program-
ming, i.e., a ‘work space’ in memory. A large portion of the IR area is always re-
served for work words. Parts of other areas not required for special purposes
may also be used as work words, e.g., LR words not used in a PC Link or Net Link
System.
348
Index
A counters
bits in TC area, 39
changing SV, 243
addresses, in data area, 17 conditions when reset, 117, 120
applications, precautions, xiii creating extended timers, 118
extended, 118
AR area, 30–36 inputting SV, 72
arithmetic flags, 96 Power-OFF, 35
reversible counters, 119
arithmetic operations, flags, 30
CPU
ASCII, converting data, 157 Device Mounted Flag, 36
operational flow, 216–217
B
CPU indicators, 12
CPU Rack, definition, 12
backup cycle, First Cycle Flag, 29
DM area data, 250 cycle time, 216–220
program, 246–248 calculating, 220–222
controlling, 198
battery
Cycle Time Indicators, 36
CPU31 Low Battery Flag, 35
displaying on Programming Console, 77
Low Battery Flag, 28
error flag, 28
BCD flag for SCAN(18), 35
calculations, 158–173
converting, 17
definition, 17
D
binary data
calculations, 174 comparison instructions, 138–145
definition, 17 converting, 18, 146–158
decrementing, 159
bits incrementing, 159
controlling, 103 modifying, 239
forced set/reset, 233 modifying binary data, 241
monitoring, 230–233 modifying hex/BCD, 236
moving, 129–138
buzzer, 61
data area, definition, 15
C
data areas, structure, 16
Data Link table, transferring, 69
calendar/clock, dedicated bits, 34 data retention
in AR area, 30
canceling, forced set/reset, 235 in HR area, 39
in IR area, 18
cassette tape operation, 246–253
in LR area, 40
comparing Program Memory data, 249–250
in SR area, 21
error messages, 246
in TC area, 39
restoring Program Memory data, 249–250
in TR area, 40
saving Program Memory data, 246
decrementing, 159
channel. See word
definers, definition, 95
clock pulse bits, 29 differentiated instructions, 96
comparing Program Memory data, 249–250 function codes, 95
constants, operands, 96 digit, monitoring, 230
digit numbers, 17
control bit
definition, 16 displays
Output OFF, 28 converting between hex and ASCII, 237
I/O Unit designations, 66
Control System, definition, 3 Programming Console, English/Japanese switch, 60
controlled system, definition, 3 DM area, saving, restoring, and comparing, 250–253
349
Index
E function codes, 95
F I/O table
clearing, 68
reading, 66
Factory Intelligent Terminal. See peripheral devices
registration, 63
FAL area, 28, 197 verification, 64
Verification Error flag, 28
FAL code, FALS-generating Address, 36
I/O Units. See Units
fatal operating errors, 258
I/O word
FIT. See peripheral devices
allocation, 19
flag definition, 18
AR and SR area error flags, 260 limits, 18
arithmetic, 30 incrementing, 159
programming example, 140, 142
CPU-mounting Device, 36 indirect addressing, 96
CY input bit
clearing, 159 application, 18
setting, 159 definition, 3
Cycle Time Error, 28
definition, 16 input device, definition, 3
First Cycle, 29 input point, definition, 3
I/O Verification Error, 28
Instruction Execution Error, 30 input signal, definition, 3
Link Units, 36 installation, precautions, xiii
Low Battery, 28
instruction set
Low Battery (CPU31), 35
ADB(50), 174
Network Parameter, 36
ADD(30), 160
Optical I/O Error, 32
ADDL(54), 161
Step, 29
AND, 46, 102
floating-point decimal, division, 169 combining with OR, 47
AND LD, 49, 103
Floppy Disk Interface Unit. See peripheral devices
combining with OR LD, 51
forced set/reset, 233 use in logic blocks, 50
canceling, 235–236 AND NOT, 46, 102
Forced Status Hold Bit, 27 ANDW(34), 180
350
Index
J-L
MULL(56), 166
MVN(22), 130
NOP(00), 111
NOT, 44 jump numbers, 110
operands, 42 jumps, 110–111
351
Index
ladder diagram
branching, 82 N
IL(02) and ILC(03), 84
nesting, subroutines, 184
using TR bits, 82
controlling bit status NET Link System, LR area application. See SYSMAC NET
using DIFU(13) and DIFD(14), 87, 104–106 Link System
using KEEP(11), 106–112 non-fatal operating errors, 258
using OUT and OUT NOT, 47
converting to mnemonic code, 44–56 normally closed condition, definition, 44
display via GPC, FIT, or LSS, 43 NOT, definition, 44
instructions
combining, AND LD and OR LD, 51
controlling bit status O
using KEEP(11), 88
using OUT and OUT NOT, 104 operand bit, 44
format, 95 operands, 95
notation, 95 allowable designations, 95
structure, 43 requirements, 95
using logic blocks, 49
operating environment, precautions, xii
ladder diagram instructions, 102–103
operating modes, 58
Ladder Support Software
operating parameters, setting, 201
See also peripheral devices
capabilities. See peripheral devices operation, preparations, 60–70
logic block instructions, converting to mnemonic code, 49–56 output point, definition, 3
output signal, definition, 3
logic blocks. See ladder diagram
logic instructions, 179–182
LR area, 40
P
password, entering on Programming Console, 60
LSS
See also peripheral devices PC
capabilities. See peripheral devices configuration, 12
definition, 3
M
PC Link Systems
error bits and flags, 25–27
LR area application, 40
memory all clear, 62 peripheral devices, 5
memory areas Factory Intelligent Terminal (FIT), 6
clearing, 61 Floppy Disk Interface Unit, 6
definition, 15 Graphic Programming Console (GPC), 5
Ladder Support Software (LSS), 5
memory partial clear, 62 capabilities, 8
Printer Interface Unit, 6
messages, programming, 198, 200
Programming Console, 5, 56–60
mnemonic code, converting, 44–56 PROM Writer, 6
modifying data, hex/binary, 236 power supply, Power-OFF Counter, 35
monitoring precautions, xi
binary, 240 applications, xiii
monitoring 3 words, 238 general, xii
operating environment, xii
mounting Units, location, 13 safety, xii
352
Index
R
bits in TC area, 39
changing SV, 243
conditions when reset, 112, 116
Racks, types, 12 example using CMP(20), 140
extended timers, 113
Remote I/O Systems, error bits and flags, 22
flicker bits, 115
response times, I/O, 227–228 inputting SV, 72
ON/OFF delays, 113
rightmost, definition, 17
one-shot bits, 114
TR area, 40
S TR bits, use in branching, 82
353
Revision History
A manual revision code appears as a suffix to the catalog number on the front cover of the manual.
Revision code
The following table outlines the changes made to the manual during each revision. Page numbers refer to the
previous version.
355