OMRON C200H CPU21-E, CPU23-E, CPU31-E Programmable Controller Operation Manual
Publicité
Publicité
C200H Programmable Controllers
Operation Manual
(For CPU21-E/23-E/31-E)
Revised March 2000
3440
SYSMAC C200H (CPU21-E, CPU22-E, CPU23-E, CPU31-E) Programmable Controllers
Operation Manual
Precautions when Operating without a Battery
Cat. No.: W217-E1-02
Thank you for purchasing an OMRON product.
Please observe the following precautions when operating a SYSMAC C200H PLC (C200H-CPU21,
-CPU22, -CPU23, -CPU31).
In the following cases, DM (DM 0000 to DM 0999), HR, AR, CNT, and SR area data is not retained in the
CPU Unit’s internal RAM when the power is turned OFF.
• When a RAM Unit without battery backup is used and the backup time has been exceeded for the backup capacitor.
• When a RAM Unit with battery backup is used, but the battery is low.
Because this data is not retained, the Output OFF Bit (SR 25215) and the Data Retention Control Bit (SR
25212) are not reliable when the power is turned ON. If the Output OFF Bit is ON, the outputs from all of the Output Units are turned OFF.
To ensure that the outputs from all of the Output Units are not turned OFF when the power is turned ON, take a preventive measure, such as writing the following instruction into the ladder program.
First Cycle Flag
(25315)
ANDW(34)
#6FFF
252
252
1/1
Notice:
OMRON products are manufactured for use according to proper procedures by a qualified operator and only for the purposes described in this manual.
The following conventions are used to indicate and classify precautions in this manual. Always heed the information provided with them. Failure to heed precautions can result in injury to people or damage to property.
!
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.
OMRON Product References
All OMRON products are capitalized in this manual. The word “Unit” is also capitalized when it refers to an OMRON product, regardless of whether or not it appears in the proper name of the product.
The abbreviation “Ch,” which appears in some displays and on some OMRON products, often means
“word” and is abbreviated “Wd” in documentation in this sense.
The abbreviation “PC” means Programmable Controller and is not used as an abbreviation for anything else.
Visual Aids
The following headings appear in the left column of the manual to help you locate different types of information.
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 permission of OMRON.
No patent liability is assumed with respect to the use of the information contained herein. Moreover, because OMRON is constantly striving to improve its high-quality products, the information contained in this manual is subject to change without notice. Every precaution has been taken in the preparation of this manual. Nevertheless, OMRON assumes no responsibility for errors or omissions. Neither is any liability assumed for damages resulting from the use of the information contained in this publication.
v
TABLE OF CONTENTS
PRECAUTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1 Intended Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2 General Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3 Safety Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4 Operating Environment Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5 Application Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SECTION 1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-2 The Origins of PC Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-3 PC Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-4 OMRON Product Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-5 Overview of PC Operation
1-6 Peripheral Devices
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-7 Available Manuals
1-8 LSS Capabilities
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SECTION 2
Hardware Considerations . . . . . . . . . . . . . . . . . . . . . . . . .
2-1 Indicators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-2 PC Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-3 CPU Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SECTION 3
Memory Areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-2 Data Area Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-3 IR (Internal Relay) Area
3-4 SR (Special Relay) Area
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-5 AR (Auxiliary Relay) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-6 DM (Data Memory) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-7 HR (Holding Relay) Area
3-8 TC (Timer/Counter) Area
3-9 LR (Link Relay) Area
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-10 Program Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-11 TR (Temporary Relay) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SECTION 4
Writing and Inputting the Program . . . . . . . . . . . . . . . . .
4-1 Basic Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-2 Instruction Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-3 Program Capacity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-4 Basic Ladder Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-5 The Programming Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-6 Preparation for Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-7 Inputting, Modifying, and Checking the Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-8 Controlling Bit Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-9 Work Bits (Internal Relays) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-10 Programming Precautions
4-11 Program Execution
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15
30
36
39
39
40
40
40
16
16
18
21
41
42
42
43
43
56
60
71
87
88
91
92 xi xii xii xii xii xiii
1
7
8
4
5
3
3
2
2
11
12
12
13 vii
viii
TABLE OF CONTENTS
SECTION 5
Instruction Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-1 Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-2 Instruction Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-3 Data Areas, Definer Values, and Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-4 Differentiated Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-5 Coding Right-hand Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-6 Instruction Set Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-7 Ladder Diagram Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-8 Bit Control Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-9 INTERLOCK and INTERLOCK CLEAR – IL(02) and ILC(03)
5-10 JUMP and JUMP END – JMP(04) and JME(05)
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-11 END – END(01) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-12 NO OPERATION – NOP(00) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-13 Timer and Counter Instructions
5-14 Data Shifting
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-15 Data Movement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-16 Data Comparison
5-17 Data Conversion
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-18 BCD Calculations
5-19 Binary Calculations
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-20 Logic Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-21 Subroutines and Interrupt Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-22 Step Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-23 Special Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-24 Network Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SECTION 6
Program Execution Timing . . . . . . . . . . . . . . . . . . . . . . . .
6-1 Cycle Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6-2 Calculating Cycle Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6-3 Instruction Execution Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6-4 I/O Response Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SECTION 7
Program Monitoring and Execution . . . . . . . . . . . . . . . .
7-1 Monitoring Operation and Modifying Data
7-2 Program Backup and Restore Operations
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SECTION 8
Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8-1 Alarm Indicators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8-2 Programmed Alarms and Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8-3 Reading and Clearing Errors and Messages
8-4 Error Messages
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8-5 Error Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Appendices
A Standard Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B Programming Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
C Programming Console Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
D Error and Arithmetic Flag Operation
E Data Areas
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
F Word Assignment Recording Sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
G Program Coding Sheet
H Data Conversion Table
I Extended ASCII
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
215
216
220
222
227
229
230
246
255
256
256
256
256
260
263
271
303
313
317
321
327
329
331
93
179
182
188
197
207
111
121
129
138
146
158
174
100
102
103
108
110
111
111
95
95
95
96
97
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 attempting 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 explains 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 describes 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 information 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 operate the C200H Temperature Sensor Unit.
1 Intended Audience
2 General Precautions
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3 Safety Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4 Operating Environment Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5 Application Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii xii xii xii xiii xi
Operating Environment Precautions
1
2
Intended Audience
4
This manual is intended for the following personnel, who must also have knowledge of electrical systems (an electrical engineer or the equivalent).
•
Personnel in charge of installing FA systems.
•
Personnel in charge of designing FA systems.
•
Personnel in charge of managing FA systems and facilities.
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 machines, safety equipment, and other systems, machines, and equipment that may have a serious influence on lives and property if used improperly, consult your OMRON representative.
Make sure that the ratings and performance characteristics of the product are sufficient for the systems, machines, and equipment, and be sure to provide the systems, machines, and equipment with double safety mechanisms.
This manual provides information for programming and operating the Unit. Be sure to read this manual before attempting to use the Unit and keep this manual close at hand for reference during operation.
!
WARNING It is extremely important that a 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.
4
!
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.
Operating Environment Precautions
!
Caution Do not operate the control system in the following locations:
•
Locations subject to direct sunlight.
•
Locations subject to temperatures or humidity outside the range specified in the specifications.
•
Locations subject to condensation as the result of severe changes in temperature.
xii
Application Precautions 5
•
Locations subject to corrosive or flammable gases.
•
Locations subject to dust (especially iron dust) or salts.
•
Locations subject to exposure to water, oil, or chemicals.
•
Locations subject to shock or vibration.
!
Caution Take appropriate and sufficient countermeasures when installing systems in the following locations:
•
Locations subject to static electricity or other forms of noise.
•
Locations subject to strong electromagnetic fields.
•
Locations subject to possible exposure to radioactivity.
•
Locations close to power supplies.
!
Caution The operating environment of the PC system can have a large effect on the longevity and reliability of the system. Improper operating environments can lead to malfunction, failure, and other unforeseeable problems with the PC system. Be sure that the operating environment is within the specified conditions at installation and remains within the specified conditions during the life of the system.
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 connecting 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 following. 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 precautions.
•
Fail-safe measures must be taken by the customer to ensure safety in the event of incorrect, missing, or abnormal signals caused by broken signal lines, momentary power interruptions, or other causes.
•
Always use the power supply voltages specified in this manual. An incorrect voltage may result in malfunction or burning.
•
Take appropriate measures to ensure that the specified power with the rated voltage and frequency is supplied. Be particularly careful in places where the power supply is unstable. An incorrect power supply may result in malfunction.
•
Install external breakers and take other safety measures against short-circuiting in external wiring. Insufficient safety measures against short-circuiting may result in burning.
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 tightening torque may result in malfunction.
•
Leave the label attached to the Unit when wiring. Removing the label may result in malfunction if foreign matter enters the Unit.
•
Remove the label after the completion of wiring to ensure proper heat dissipation. Leaving the label attached may result in malfunction.
•
Double-check all wiring and switch settings before turning ON the power supply. 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 damage.
xiv
SECTION 1
Introduction
This section gives a brief overview of the history of Programmable Controllers and explains terms commonly used in ladderdiagram 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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-2 The Origins of PC Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-3 PC Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-4 OMRON Product Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-5 Overview of PC Operation
1-6 Peripheral Devices
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-7 Available Manuals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-8 LSS Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-8-1 Offline Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-8-2 Online Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-8-3 Offline and Online Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4
5
7
3
3
2
2
9
9
8
8
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 program controls the PC so that when an input signal from an input device turns ON, the appropriate response is made. The response normally involves turning ON an output signal to some sort of output device. The input devices could be photoelectric sensors, pushbuttons on control panels, limit switches, or any other device that can produce a signal that can be input into the PC. The output devices could be solenoids, switches activating indicator lamps, relays turning on motors, or any other devices that can be activated by signals output from the PC.
For example, a sensor detecting a 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, positioned higher than the first, turns ON a different input to indicate that the product is too tall. The PC responds by turning on another pusher positioned before the pusher mentioned above to push the too-tall product into a rejection box.
Although this example involves only two inputs and two outputs, it is typical of the type of control operation that PCs can achieve. Actually even this example is much more complex than it may at first appear because of the timing that would be required, i.e., “How does the PC know when to activate each pusher?” Much more complicated operations, however, are also possible. The problem is how to get the desired control signals from available inputs at appropriate times.
To achieve proper control, the C200H uses a form of PC logic called ladder-diagram programming. This manual is written to explain ladder-diagram programming and to prepare the reader to program and operate the C200H.
1-2 The Origins of PC Logic
PCs historically originate in relay-based control systems. And although the integrated circuits and internal logic of the PC have taken the place of the discrete relays, timers, counters, and other such devices, actual PC operation proceeds as if those discrete devices were still in place. PC control, however, also provides computer capabilities and accuracy to achieve a great deal more flexibility and reliability than is possible with relays.
The symbols and other control concepts used to describe PC operation also come from relay-based control and form the basis of the ladder-diagram programming method. Most of the terms used to describe these symbols and concepts, however, have come in from computer terminology.
Relay vs. PC Terminology The terminology used throughout this manual is somewhat different from relay terminology, but the concepts are the same.
The following table shows the relationship between relay terms and the PC terms used for OMRON PCs.
Relay term contact coil
NO relay
NC relay
PC equivalent input or condition output or work bit normally open condition normally closed condition
Actually there is not a total equivalence between these terms. The term condition is only used to describe ladder diagram programs in general and is specifically equivalent to one of certain set of basic instructions. The terms input and output are not used in programming per se, except in reference to I/O bits that are assigned to input and output signals coming into and leaving the PC. Normally open conditions and normally closed conditions are explained in 4-4 Basic
Ladder Diagrams.
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
Inputs and Outputs
Controlled System and
Control System
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 configuration 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 inputs 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.
A device connected to the PC that sends a signal to the PC is called an input
device; the signal it sends is called an input signal. A signal enters the PC through terminals or through pins on a connector on a Unit. The place where a signal enters the PC is called an input point. This input point is allocated a location in memory that reflects its status, i.e., either ON or OFF. This memory location 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 accordingly.
There are also output bits in memory that are allocated to output points on
Units through which output signals are sent to output devices, i.e., an output bit is turned ON to send a signal to an output device through an output point. The
CPU periodically turns output points ON 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.
The Control System includes the PC and all I/O devices it uses to control an external system. A sensor that provides information to achieve control is an input device that is clearly part of the Control System. The controlled system is the external system that is being controlled by the PC program through these I/O devices. I/O devices can sometimes be considered part of the controlled system, e.g., a motor used to drive a conveyor belt.
1-4 OMRON Product Terminology
OMRON products are divided into several functional groups that have generic names. Appendix A Standard Models list products according to these groups.
The term Unit is used to refer to all of the OMRON PC products. Although a Unit is any one of the building blocks that goes together to form a C200H PC, its meaning is generally, but not always, limited in context to refer to the Units that are mounted to a Rack. Most, but not all, of these products have names that end with the word Unit.
The largest group of OMRON products is the I/O Units. These include all of the
Rack-mounting Units that provide non-dedicated input or output points for general use. I/O Units come with a variety of point connections and specifications.
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, Highspeed 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.
1-5 Overview of PC Operation
The following are the basic steps involved in programming and operating a
C200H. Assuming you have already purchased one or more of these PCs, you must have a reasonable idea of the required information for steps one and two, which are discussed briefly below. This manual is written to explain steps three through six, eight, and nine. The relevant sections of this manual that provide more information are listed with each of these steps.
1, 2, 3...
1. Determine what the controlled system must do, in what order, and at what times.
2. Determine what Racks and what Units will be required. Refer to the C200H
Installation Guide. If a Link System is required, refer to the appropriate Sys-
tem Manual.
3. On paper, assign all input and output devices to I/O points on Units and determine which I/O bits will be allocated to each. If the PC includes Special I/O
Units or Link Systems, refer to the individual Operation Manuals or System
Manuals for details on I/O bit allocation. (Section 3 Memory Areas)
4. Using relay ladder symbols, write a program that represents the sequence of required operations and their inter-relationships. Be sure to also program appropriate responses for all possible emergency situations. (Section 4
Writing ana Inputting the Program, Section 5 Instruction Set, Section 6 Program Execution Timing)
5. Input the program and all required operating parameters into the PC. (Sec-
tion 4-7 Inputting, Modifying, and Checking the Program.)
6. Debug the program, first to eliminate any syntax errors, and then to find execution errors. (Section 4-7 Inputting, Modifying, and Checking the Pro-
gram, Section 7 Program Monitoring and Execution, and Section 8
Troubleshooting)
7. Wire the PC to the controlled system. This step can actually be started as soon as step 3 has been completed. Refer to the C200H Installation Guide and to Operation Manuals and System Manuals for details on individual
Units.
8. Test the program in an actual control situation and carry out fine tuning as required. (Section 7 Program Monitoring and Execution and Section 8
Troubleshooting)
9. Record two copies of the finished program on masters and store them safely in different locations. (Section 4-7 Inputting, Modifying, and Checking the
Program)
Control System Design Designing the Control System is the first step in automating any process. A PC can be programmed and operated only after the overall Control System is fully understood. Designing the Control System requires, first of all, a thorough understanding of the system that is to be controlled. The first step in designing a
Control System is thus determining the requirements of the controlled system.
4
Peripheral Devices Section 1-6
Input/Output Requirements
Sequence, Timing, and
Relationships
Unit 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.
Next, determine the sequence in which control operations are to occur and the relative timing of the operations. Identify the physical relationships between the
I/O devices as well as the kinds of responses that should occur between them.
For instance, a photoelectric switch might be functionally tied to a motor by way of a counter within the PC. When the PC receives an input from a start switch, it could start the motor. The PC could then stop the motor when the counter has received 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.
The actual Units that will be mounted or connected to PC Racks must be determined according to the requirements of the I/O devices. Actual hardware specifications, such as voltage and current levels, as well as functional considerations, such as those that require Special I/O Units or Link Systems will need to be considered. 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.
1-6 Peripheral Devices
The following peripheral devices can be used in programming, either to input/ debug/monitor the PC program or to interface the PC to external devices to output the program or memory area data. Model numbers for all devices listed below are provided in Appendix A Standard Models. OMRON product names have been placed in bold when introduced in the following descriptions.
Programming Console
Graphic Programming
Console: GPC
Ladder Support Software:
LSS
A Programming Console is the simplest form of programming device for OM-
RON PCs. All Programming Consoles are connected directly to the CPU without requiring a separate interface. The Programming Console also functions as an interface to transfer programs to a standard cassette tape recorder.
Various types of Programming Console are available, including both
CPU-mounting and Hand-held models. Programming Console operations are described later in this manual.
The GPC allows you to perform all the operations of the Programming Console as well as many additional ones. PC programs can be written on-screen in ladder-diagram form as well as in mnemonic form. As the program is written, it is displayed on a liquid crystal display, making confirmation and modification quick and easy. Syntax checks may also be performed on the programs before they are downloaded to the PC. Many other functions are available, depending on the
Memory Pack used with the GPC.
A Peripheral Interface Unit is required to interface the GPC to the PC.
The GPC also functions as an interface to copy programs directly to a standard cassette tape recorder. A PROM Writer, Floppy Disk Interface Unit, or Printer
Interface Unit can be directly mounted to the GPC to output programs directly to an EPROM chip, floppy disk drive, or printing device, respectively.
LSS is designed to run on IBM AT/XT compatibles to enable all of the operations available on the GPC.
5
Peripheral Devices Section 1-6
Factory Intelligent Terminal:
FIT
PROM Writer
Floppy Disk Interface Unit
Printer Interface Unit
A Peripheral Interface Unit or Host Link Unit is required to interface a computer running LSS to the PC. Using an Optical Host Link Unit also enables the use of optical fiber cable to connect the FIT to the PC. Wired Host Link Units are available when desired. (Although FIT does not have optical connectors, conversion to optical fiber cable is possible by using converting Link Adapters.)
The FIT is an OMRON computer with specially designed software that allows you to perform all of the operations that are available with the GPC or LSS. Programs can also be output directly to an EPROM chip, floppy disk drive, or printing device without any additional interface. The FIT has an EPROM writer and two 3.5” floppy disk drives built in.
A Peripheral Interface Unit or Host Link Unit is required to interface the FIT to the PC. Using an Optical Host Link Unit also enables the use of optical fiber cable to connect the FIT to the PC. Wired Host Link Units are available when desired.
(Although FIT does not have optical connectors, conversion to optical fiber cable is possible by using converting Link Adapters.)
Other than its applications described above, the PROM Writer can be mounted to the PC’s CPU to write programs to EPROM chips.
Other than its applications described above, the Floppy Disk Interface Unit can be mounted to the PC’s CPU to interface a floppy disk drive and write programs onto floppy disks.
Other than its applications described above, the Printer Interface Unit can be mounted to the PC’s CPU to interface a printer or X-Y plotter to print out programs in either mnemonic or ladder-diagram form.
6
Available Manuals Section 1-7
1-7 Available Manuals
The following table lists other manuals that may be required to program and/or operate the C200H. Operation Manuals and/or Operation Guides are also provided with individual Units and are required for wiring and other specifications.
Operation Manual
Name
GPC Operation Manual
FIT Operation Manual
LSS Operation Manual
SSS Operation Manual: Basic
SSS Operation Manual: C series PCs
Data Access Console Operation Guide
Printer Interface Unit Operation Guide
PROM Writer Operation Guide
Floppy Disk Interface Unit Operation Guide
Wired Remote I/O System Manual
(SYSMAC BUS)
Optical Remote I/O System Manual
(SYSMAC BUS)
PC Link System Manual
Host Link System Manual
(SYSMAC WAY)
W107
W155
W143
SYSMAC NET Link Unit Operation Manual W114
SYSMAC LINK System Manual
Analog Input Unit Operation Manual
Temperature Sensor Unit Operation Guide
ASCII Unit Operation Manual
ID Sensor Unit Operation Guide
Voice Unit Operation Manual
Fuzzy Logic Unit Operation Manual
Fuzzy Support Software Operation Manual
Temperature Control Unit Operation Manual
Heat/Cool Temperature Control Unit
W84
W150
W237
W247
W248
W173
W119
W120
W136
W135
W174
W229
W124
W165
W153
W172
W208
W210
W225
W240
Cat. No.
Contents
Programming procedures for the GPC
(Graphics Programming Console)
Programming procedures for using the FIT
(Factory Intelligent Terminal
Programming procedures for using LSS
(Ladder Support Software)
Programming procedures for using SSS
(SYSMAC Support Software)
Data area monitoring and data modification procedures for the Data Access Console
Procedures for interfacing a PC to a printer
Procedures for writing programs to EPROM chips
Procedures for interfacing a PC to a floppy disk drive
Information on building a Wired Remote I/O
System to enable remote I/O capability
Information on building an Optical Remote I/O
System to enable remote I/O capability
Information on building a PC Link System to automatically transfer data between PCs
Information on building a Host Link System to manage PCs from a ‘host’ computer
Information on building a SYSMAC NET Link
System and thus create an optical LAN integrating PCs with computers and other peripheral devices
Information on building a SYSMAC LINK
System to enable automatic data transfer, programming, and programmed data transfer between the PCs in the System
Information on High-speed Counter Unit High-speed Counter Unit Operation Manual CT001V1/CT002: W141
CT021: W311
Position Control Unit Operation Manuals NC111: W137
NC112: W128
NC211: W166
Analog I/O Units Operation Guide W127
Information on Position Control Unit
Information on the C200H-AD001,
C200H-DA001 Analog I/O Units
Information on the C200H-AD002 Analog
Input Unit
Information on Temperature Sensor Unit
Information on ASCII Unit
Information on ID Sensor Unit
Information on Voice Unit
Information on Fuzzy Logic Unit
Information on the Fuzzy Support Software which supports the Fuzzy Logic Units
Information on Temperature Control Unit
Information on Heating and Cooling
Temperature Control Unit
7
LSS Capabilities Section 1-8
Name
PID Control Unit Operation Manual
Cam Positioner Unit Operation Manual
W241
W224
Cat. No.
Contents
Information on PID Control Unit
Information on Cam Positioner Unit
1-8 LSS Capabilities
The LSS is a complete programming and control package designed for C-series
PCs. It provides not only programming capabilities, but also advanced debugging, monitoring, and program/data management. The following tables provide only a brief introduction to the capabilities of the LSS. For further information and actual operating procedures, please refer to the Ladder Support Software Op-
eration Manual.
1-8-1 Offline Operations
Group
General
Programming
PROGRAMMING
Description
General programming operations feature function keys to easily read, write, and store programs.
SAVE PROGRAM
RETRIEVE PROGRAM
CHANGE DISPLAY
Writes all or part of the user program to a data disk.
Retrieves all or part of the user program from on a data disk.
Switches the display between four display modes: Ladder, Ladder with Comments, Mnemonic 1 (function key and numeric key input mode) and Mnemonic 2 (alphanumeric key input mode).
SEARCH INSTRUCTION Searches for instructions including specified operands.
I/O COMMENT Creates, reads, modifies, and searches for I/O comments.
BLOCK COMMENT
LINE COMMENT
Creates, edits, and searches for block comments for output instructions.
Creates, searches for, and edits line comments.
CUT AND PASTE
EDIT I/O COMMENT
Edits programs by copying, moving, or deleting instruction blocks.
Displays 32 I/O comments at once to write, edit, and search.
RETRIEVE COMMENTS Retrieves comments from programs stored on a data disk.
MEMORY USAGE Displays the used capacity of user program memory, comments, and internal memory.
CLEAR MEMORY Clears the user program memory.
I/O TABLE
CHECK PROGRAM
DM (data memory) DM operations are used to edit DM data in hexadecimal or ASCII form. There are also features for copying, filling and printing DM data, as well as data disk save and retrieve operations.
I/O TABLE is used to edit, check, and print I/O tables. It also provides data disk save and retrieve operations.
Checks whether the user program contains syntax errors. The check can be performed in three levels.
UTILITY DATA AREA LISTS Displays lists of such items as used areas and cross-references
(i.e., instructions that use specified operands).
CHANGE ADDRESSES Globally changes bit and word addresses in the user program.
PRINT LISTS Prints lists, ladder diagrams, and mnemonics.
EPROM FUNCTIONS Writes, reads, and compares the user program between the PROM
Writer and system work disk.
C500
→
C2000H Converts the program format from C500 to C2000H
NETWORK DATA LINKS Creates a data link table.
CREATE LIBRARY FILE Formats a floppy disk or hard disk for use with the LSS.
TIME CHART MONITOR Accesses the time chart monitor displays produced online.
SET INSTRUCTIONS Used to assign instructions to function codes in instructions tables and to save/retrieve instructions tables to/from data disk files.
RETRIEVE/SAVE INSTR Used to save and retrieve expansion instruction sets to and from data disk files.
PC SETUP Used to set the PC operating parameters in the PC Setup and to save and retrieve PC Setups to and from data disk files.
8
LSS Capabilities Section 1-8
1-8-2 Online Operations
Group
ON-LINE
DM
I/O TABLE
UTILITY
Function name Description
MONITOR DATA Used to monitor up to 20 bits/words during program execution. The status of bits and contents of words being monitored can also be controlled.
TRANSFER PROGRAM Transfers and compares the user program between the LSS and PC.
ON-LINE EDIT Edits the PC program during MONITOR mode execution.
READ CYCLE TIME
CLEAR DATA AREAS
Reads and displays the cycle time of the PC.
Clears the PC data areas such as HR, CNT, AR, and DM (to zero).
MEMORY USAGE Displays the used capacity of program memory area, comments, and internal memory.
Operations are also available to change display modes and search for instructions and comments.
DM area operations are available to transfer and compare DM data between the PC, LSS, and data disks, and to monitor DM contents in the PC.
I/O TABLE operations are used to write, transfer, and compare I/O tables between the PC and LSS.
FILE MEMORY Displays file memory lists; transfers file memory contents between PC and LSS; clears file memory; transfers file memory contents between PC and File Memory Unit; saves or retrieves file memory contents to or from floppy disk; and edits file memory data.
XFER DATA LINK TBL
CLOCK
Transfers and compares data link tables between the PC and computer.
Used to read and set the internal clock in the PC.
TRANSFER INSTR Used to transfer the expansion instruction set from the PC to the LSS.
TRANSFER PC SETUP Used to transfer the PC Setup between the PC and the LSS
1-8-3 Offline and Online Operations
Group
SYSTEM SETUP
Description
The SYSTEM SETUP provides settings for the operating environment of the LSS, including the
PC that’s being communicated with (including network and interface settings) and disk drive, comment, printer, PROM Writer, and monitor settings. It also provides settings for transfer of
I/O table and data link tables to UM.
FILE MANAGEMENT FILE MANAGEMENT operations include basic file management features so that files can be manipulated directly from the LSS. It also provides a feature for merging program files.
9
SECTION 2
Hardware Considerations
This section provides information on hardware aspects of the C200H that are relevant to programming and software operation. 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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-2 PC Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-3 CPU Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12
12
13
11
PC Configuration
2-1 Indicators
CPU Indicators
Section 2-2
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 are shown below and are described in the following table.
Indicator
POWER
RUN
Function
Lights when power is supplied to the CPU.
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.
OUT INHIBIT
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.
Lights when the Output OFF Bit, SR 25215, is turned ON. All outputs from the PC will be turned OFF.
RUN POWER
ALARM/ERROR
OUT INHIBIT
2-2 PC Configuration
The basic PC configuration consists of two types of Rack: a CPU Rack and Expansion 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
Expansion I/O 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.
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 Expansion I/O Racks can be connected in series to the CPU Rack.
12
CPU Capabilities
Unit Mounting Position
Section 2-3
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.
2-3 CPU Capabilities
The C200H-CPU21-E/CPU23-E/CPU31-E CPUs are based on the C200H-
CPU11-E CPU, except only the CPU31-E supports Network Instructions. All of the CPUs covered in this manual also support a group of High-density I/O Units called Group-2 High-density I/O Units. Group-2 High-density I/O Units are classified by themselves and are not classified as Special I/O Units.
The following table lists the capabilities of the various C200H CPUs.
Function
Compatible with Group-2 High-density I/O Units
(C200H-ID216/ID217/OD218/OD219)
Can process GROUP-2 HIGH-DENSITY I/O
REFRESH – MPRF(61)
Compatible with C200H-MR433/MR833/ME432
Memory Units
Compatible with C200H-ME832 Memory Unit
Error history
Clock/calendar
Forced Status Hold Bit (SR 25211)
Can set TERMINAL mode for Programming
Console
Additional instructions:
REVERSIBLE WORD SHIFT – RWS(17)
CYCLE TIME – SCAN(18)
MULTI-WORD COMPARE – MCMP(19)
LONG MESSAGE – LMSG(47)
TERMINAL MODE – TERM(48)
SET SYSTEM – SET(49)
DOUBLE COMPARE – CMPL(60)
COLUMN-TO-WORD – CTW(63)
WORD-TO-COLUMN – WTC(64)
HOURS-TO-SECONDS – HTS(65)
SECONDS-TO-HOURS – STH(66)
VALUE CALCULATE – VCAL(69)
Network Instructions:
NETWORK SEND – SEND(90)
NETWORK RECEIVE – RECV(98)
Power Supply
CPU01-E CPU03-E CPU11-E CPU21-E CPU23-E CPU31-E
No No No Yes Yes Yes
No
Yes 1
No
No
No
No
No
No
No
AC
No
Yes
No
No
No
No
No
No
No
DC
1
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
AC
1
Yes
Yes
Yes
Yes
Yes 2
Yes
Yes
Yes
No
AC
Yes
Yes
Yes
Yes
Yes 2
Yes
Yes
Yes
No
DC
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
AC
1
1
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 program 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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-2 Data Area Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-3 IR (Internal Relay) Area
3-4 SR (Special Relay) Area
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-4-1 Remote I/O Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-4-2 Link System Flags and Control Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-4-3 Forced Status Hold Bit
3-4-4 I/O Status Hold Bit
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-4-5 Output OFF Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-4-6 FAL (Failure Alarm) Area
3-4-7 Low Battery Flag
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-4-8 Cycle Time Error Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-4-9 I/O Verification Error Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-4-10 First Cycle Flag
3-4-11 Clock Pulse Bits
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-4-12 Step Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-4-13 Group-2 High-density I/O Unit Error Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-4-14 Instruction Execution Error Flag, ER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-4-15 Arithmetic Flags
3-5 AR (Auxiliary Relay) Area
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-5-1 Slave Rack Error Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-5-2 Group-2 High-density I/O Unit Error Flags
3-5-3 Optical I/O Unit Error Flags
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-5-4 SYSMAC LINK System Data Link Settings
3-5-5 Error History Bits
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-5-6 Active Node Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-5-7 SYSMAC LINK/SYSMAC NET Link System Service Time (CPU31-E Only)
3-5-8 Calendar/Clock Area and Bits
.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-5-9 TERMINAL Mode Key Bits
3-5-10 Power-OFF Counter
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-5-11 CPU Low Battery Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-5-12 SCAN(18) Cycle Time Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-5-13 Network Parameter Flags
3-5-14 Link Unit Mounted Flags
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-5-15 CPU-mounting Device Flag
3-5-16 FALS-generating Address
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-5-17 Cycle Time Indicators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-6 DM (Data Memory) Area
3-7 HR (Holding Relay) Area
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-8 TC (Timer/Counter) Area
3-9 LR (Link Relay) Area
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-10 Program Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-11 TR (Temporary Relay) Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
35
35
36
36
34
34
35
35
36
36
36
32
32
32
32
29
30
30
30
33
33
36
39
39
40
40
40
28
28
28
29
27
27
28
28
29
29
16
16
18
21
22
23
15
Data Area Structure Section 3-2
3-1 Introduction
Area
Internal Relay
Special Relay
Auxiliary Relay
Data Memory
Holding Relay
Timer/Counter
Link Relay
Acronym
IR
SR
AR
DM
HR
TC
LR
Temporary Relay TR
Program Memory UM
Details, including the name, acronym, range, and function of each area are summarized 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.
Range
Words: 000 to 235
Bits: 0000 to 23515
Words: 236 to 255
Bits: 23600 to 25507
Words: AR 00 to AR 27
Bits: AR 00 to AR 2715
Read/write: DM 0000 to DM 0999
Read only: DM 1000 to DM 1999
Words: HR 00 to HR 99
Bits: HR 0000 to HR 9915
TC 000 to TC 511 (TC numbers used to access other information)
Function
Used to control I/O points, other bits, timers, and counters, and to temporarily store data.
Contains system clocks, flags, control bits, and status information.
Contains flags and bits for special functions.
Retains status during power failure.
Used for internal data storage and manipulation.
Used to store data and to retain the data values when the power to the PC is turned off.
Used to define timers and counters, and to access completion flags, PV, and SV. In general, 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.
Available for use as work bits.
Words: LR 00 to LR 63
Bits: LR 0000 to 6315
TR 00 to TR 07 (bits only) Used to temporarily store and retrieve execution 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.
UM: Depends on Memory Unit used.
Contains the program executed by the CPU.
Work Bits and Words
Flags and Control Bits
When some bits and words in certain data areas are not being used for their intended purpose, they can be used in programming as required to control other bits. Words and bits available for use in this fashion are called work 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 application of work bits and work words is described in Section 4 Writing and Input-
ting the Program.
Some data areas contain flags and/or control bits. Flags are bits that are automatically 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.
3-2 Data Area Structure
When designating a data area, the acronym for the area is always required for any but the IR and SR areas. Although the acronyms for the IR and SR areas are often given for clarity in text explanations, they are not required, and not entered, when programming. Any data area designation without an acronym is assumed to be in either the IR or SR area. Because IR and SR addresses run consecutively, the word or bit addresses are sufficient to differentiate these two areas.
An actual data location within any data area but the TC area is designated by its address. The address designates the bit or word within the area where the de-
16
Data Area Structure
Bit number
IR word 000
IR word 001
Data Structure
Digit number
Bit number
Contents
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 information 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 significant 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 different 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.
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
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 fivedigit address. The following table show examples of this. The two rightmost digits 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.
Area
IR
SR
DM
TC
LR
Word designation
000
252
DM 1250
TC 215 (designates PV)
LR 12
Bit designation
00015 (leftmost bit in word 000)
25200 (rightmost bit in word 252)
Not possible
TC 215 (designates completion flag)
LR 1200
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 corresponding bit numbers for one word are shown below.
3 2 1 0
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
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
Converting Different Forms of Data
Decimal Points are merely turned ON (equivalent to a binary value of 1) or OFF (a binary value of
0). When inputting word data, however, it is important to input it either as decimal or as hexadecimal, depending on what is called for by the instruction it is to be used for. Section 5 Instruction Set specifies when a particular form of data is required for an instruction.
Binary and hexadecimal can be easily converted back and forth because each four bits of a binary number is numerically equivalent to one digit of a hexadecimal number. The binary number 0101111101011111 is converted to hexadecimal by considering each set of four bits in order from the right. Binary 1111 is hexadecimal F; binary 0101 is hexadecimal 5. The hexadecimal equivalent would thus be 5F5F, or 24,415 in decimal (16
3
x 5 + 16
2
x 15 + 16 x 5 + 15).
Decimal and BCD are easily converted back and forth. In this case, each BCD digit (i.e., each group of four BCD bits) is numerically equivalent of the corresponding decimal digit. The BCD bits 0101011101010111 are converted to decimal by considering each four bits from the right. Binary 0101 is decimal 5; binary
0111 is decimal 7. The decimal equivalent would thus be 5,757. Note that this is not the same numeric value as the hexadecimal equivalent of
0101011101010111, which would be 5,757 hexadecimal, or 22,359 in decimal
(16 3 x 5 + 16 2 x 7 + 16 x 5 + 7).
Because the numeric equivalent of each four BCD binary bits must be numerically equivalent to a decimal value, any four bit combination numerically greater then 9 cannot be used, e.g., 1011 is not allowed because it is numerically equivalent to 11, which cannot be expressed as a single digit in decimal notation. The binary bits 1011 are of course allowed in hexadecimal are a equivalent to the hexadecimal digit C.
There are instructions provided to convert data either direction between BCD and hexadecimal. Refer to 5-17 Data Conversion for details. Tables of binary equivalents to hexadecimal and BCD digits are provided in the appendices for reference.
Decimal points are used in timers only. The least significant digit represents tenths of a second. All arithmetic instructions operate on integers only.
3-3 IR (Internal Relay) Area
The IR area is used both as data to control I/O points, and as work bits to manipulate and store data internally. It is accessible both by bit and by word. In the
C200H PC, the IR area is comprised of words 000 to 235.
Words in the IR area that are used to control I/O points are called I/O words. Bits in I/O words are called I/O bits. Bits in the IR area which are not assigned as I/O bits can be used as work bits. IR area work bits are reset when power is interrupted or PC operation is stopped.
I/O Words
Input Bit Usage
Output Bit Usage
If a Unit brings inputs into the PC, the bit assigned to it is an input bit; if the Unit sends an output from the PC, the bit is an output bit. To turn on an output, the output bit assigned to it must be turned ON. When an input turns on, the input bit assigned to it also turns ON. These facts can be used in the program to access input status and control output status through I/O bits.
Input bits can be used to directly input external signals to the PC and can be used in any order in programming. Each input bit can also be used in as many instructions as required to achieve effective and proper control. They cannot be used in instructions that control bit status, e.g., the OUTPUT, DIFFERENTIATION UP, and KEEP instructions.
Output bits are used to output program execution results and can be used in any order in programming. Because outputs are refreshed only once during each cycle (i.e., once each time the program is executed), any output bit can be used
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 output 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 position. 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
CPU
1 st
Expansion
2 nd Expansion
Unused Words
Slot 1 Slot 2 Slot 3 Slot 4 Slot 5 Slot 6 Slot 7 Slot 8 Slot 9 Slot 10
IR 000 IR 001 IR 002 IR 003 IR 004 IR 005 IR 006 IR 007 IR 008 IR 009
IR 010 IR 011 IR 012 IR 013 IR 014 IR 015 IR 016 IR 017 IR 018 IR 019
IR 020 IR 021 IR 022 IR 023 IR 024 IR 025 IR 026 IR 027 IR 028 IR 029
Allocation for Special I/O
Units and Slave Racks
Any words allocated to a Unit that does not use them can be used in programming 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.
Up to ten Special I/O Units may be mounted in any slot of the CPU Rack or Expansion 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.
4
5
6
2
3
7
8
9
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
120 to 129 2
130 to 139 3
140 to 149 4
150 to 159
160 to 169
170 to 179
180 to 189
190 to 199
070 to 079
080 to 089
090 to 099
Allocation for Optical I/O
Units
Allocation for Remote I/O
Master and Link Units
The C500-RT001/002-(P)V1 Remote I/O Slave Rack may be used, but it requires 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.
I/O words between IR 200 and IR 231 are allocated to Optical I/O Units by unit number. The I/O word allocated to each Unit is IR 200+n, where n is the unit number set on the Unit.
Remote Master I/O Units, SYSMAC LINK Units, SYSMAC NET Link Units, and
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. Transistor 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
High-density I/O Units
Group-2 High-density I/O Units are allocated words between IR 030 and IR 049 according to I/O number settings made on them and do not use the words allocated to the slots in which they are mounted. For 32-point Units, each Unit is allocated 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.
7
8
5
6
9
3
4
1
2
32-point Units
I/O number
0
Words
IR 30 to IR 31
IR 32 to IR 33
IR 34 to IR 35
IR 36 to IR 37
IR 38 to IR 39
IR 40 to IR 41
IR 42 to IR 43
IR 44 to IR 45
IR 46 to IR 47
IR 48 to IR 49
7
8
5
6
9
3
4
1
2
64-point Units
I/O number
0
Words
IR 30 to IR 33
IR 32 to IR 35
IR 34 to IR 37
IR 36 to IR 39
IR 38 to IR 41
IR 40 to IR 43
IR 42 to IR 45
IR 44 to IR 47
IR 46 to IR 49
Cannot be used.
When setting I/O numbers on the High-density I/O Units, be sure that the settings 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, regardless of the number used.
The words allocated to Group-2 High-density I/O Units correspond to the connectors on the Units as shown in the following table.
Unit
32-point Units
64-point Units
First
Second
First
Second
Third
Forth
Word Connector/row
Row A
Row B
CN1, row A
CN1, row B
CN2, row A
CN2, row B
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
3-4 SR (Special Relay) Area
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.
The following table lists the functions of SR area flags and control bits. Most of these bits are described in more detail following the table. Descriptions are in order by bit number except that Link System bits are grouped together.
Unless otherwise stated, flags are OFF until the specified condition arises, when they are turned ON. Restart bits are usually OFF, but when the user turns one
ON then OFF, the specified Link Unit will be restarted. Other control bits are OFF until set by the user.
Word(s)
236
237
Bit(s) Function
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
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
251
08 to 15 PC Link Unit Error Flags or data link status for operating level 1
00 to 15 Remote I/O Error Flags
252 00
01
02
03
04
05
06
SEND(90)/RECV(98) Error Flag for operating level 0 of
SYSMAC LINK or SYSMAC NET Link System
SEND(90)/RECV(98) Enable Flag for operating level 0 of
SYSMAC LINK or SYSMAC NET Link System
Operating Level 0 Data Link Operating Flag
SEND(90)/RECV(98) Error Flag for operating level 1 of
SYSMAC LINK or SYSMAC NET Link System
SEND(90)/RECV(98) Enable Flag for operating level 1 of
SYSMAC LINK or SYSMAC NET Link System
Operating Level 1 Data Link Operating Flag
Host Computer to Rack-mounting Host Link Unit Level 1
Error Flag
Rack-mounting Host Link Unit Level 1 Restart Bit 07
08
09
10
11
12
CPU-mounting Host Link Unit Error Flag
CPU-mounting Host Link Unit Restart Bit
Not used.
Forced Status Hold Bit
Data Retention Control Bit
13
14
15
Rack-mounting Host Link Unit Level 0 Restart Bit
Not used.
Output OFF Bit
21
SR Area Section 3-4
Word(s)
253
254
255
03
04
05
06
07
Bit(s)
00 to 07 FAL number output area.
Function
08
09
Low Battery Flag
Cycle Time Error Flag
10
11
I/O Verification Error Flag
Host Computer to rack-mounting Host Link Unit Level 0
Error Flag
Remote I/O Error Flag 12
13
14
15
00
Normally ON Flag
Normally OFF Flag
First cycle
1-minute clock pulse bit
01 0.02-second clock pulse bit
02 to 06 Reserved for function expansion. Do not use.
00
01
02
07 Step Flag
08 to 13 Reserved for function expansion. Do not use.
14
15
Group-2 High-density I/O Unit error Flag
Special Unit Error Flag (Special I/O, PC Link, Host Link,
Remote I/O Master, SYSMAC NET Link, and SYSMAC
LINK)
0.1-second clock pulse bit
0.2-second clock pulse bit
1.0-second clock pulse bit
Instruction Execution Error (ER) Flag
Carry (CY) Flag
Greater Than (GR) Flag
Equals (EQ) Flag
Less Than (LE) Flag
3-4-1 Remote I/O Systems
SR 25312 turns ON to indicate an error has occurred in Remote I/O Systems.
The ALARM/ERROR indicator will flash, but PC operation will continue. SR 251, as well as AR 0014 and AR 0015, contain information on the source and type of error. The function of each bit is described below. Refer to Optical and Wired Re-
mote I/O System Manuals for details.
Bit 00 – Error Check Bit
Bits 01 and 02
If there are errors in more than one Remote I/O Unit, word 251 will contain error information for only the first one. Data for the remaining Units will be stored in memory and can be accessed by turning the Error Check bit ON and OFF. Be sure to record data for the first error, which will be cleared when data for the next error is displayed.
Not used.
Bit 03
Bits 04 to 15
Remote I/O Error Flag: Bit 03 turns ON when an error has occurred in a Remote
I/O Unit.
The content of bits 04 to 06 is a 3-digit binary number (04: 2
0
, 05: 2
1
, 06: 2
2
) and the content of bits 08 to 15 is a 2-digit hexadecimal number (08 to 11: 16 0 , 12 to
15: 16 1 ).
If the content of bits 12 through 15 is B, an error has occurred in a Remote I/O
Master or Slave Unit, and the content of bits 08 through 11 will indicate the unit number, either 0 or 1, of the Master involved. In this case, bits 04 to 06 contain the unit number of the Slave Rack involved.
If the content of bits 12 through 15 is a number from 0 to 31, an error has occurred in an Optical I/O Unit. The number is the unit number of the Optical I/O
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).
3-4-2 Link System Flags and Control Bits
Use of the following SR bits depends on the configuration of any Link Systems to which your PC belongs. These flags and control bits are used when Link Units, such as PC Link Units, SYSMAC LINK Units, Remote I/O Units, SYSMAC NET
Link Units, or Host Link Units, are mounted to the PC Racks or to the CPU. For additional information, consult the System Manual for the particular Units involved.
The following bits can be employed as work bits when the PC does not belong to the Link System associated with them.
Host Link Systems
Both Error flags and Restart bits are provided for Host Link Systems. Error flags turn ON to indicate errors in Host Link Units. Restart bits are turned ON and then
OFF to restart a Host Link Unit. SR bits used with Host Link Systems are summarized in the following table. Rack-mounting Host Link Unit Restart bits are
not effective for the Multilevel Rack-mounting Host Link Units. Refer to the
Host Link System Manual for details.
25206
25207
25208
25209
25213
25311
Bit Flag
Rack-mounting Host Link Unit Level 1 Error Flag
Rack-mounting Host Link Unit Level 1 Restart Bit
CPU-mounting Host Link Unit Error Flag
CPU-mounting Host Link Unit Restart Bit
Rack-mounting Host Link Unit Level 0 Restart Bit
Rack-mounting Host Link Unit Level 0 Error Flag
SYSMAC NET Link and SYSMAC LINK Systems
SR 25200 turns ON to indicate an error has occurred in level 0, while using
SEND(90) or RECV(98) to transfer data in either a SYSMAC NET Link or SYS-
MAC LINK System. SR 25203 indicates an error has occurred in level 1. Turning
ON SR 25201 enables SEND(90) and RECV(98) in level 0 in these Systems.
Turning ON SR 25204 enables SEND(90) and RECV(98) in level 1. SR 25202 turns ON when a data link is active in operating level 0 of either of these Systems and SR 25205 turns ON with a data link is active in operating level 1. These flags and corresponding SR bits are shown below.
Bit
25200
25201
25202
25203
25204
25205
Flag
Operating Level 0 SEND(90)/RECV(98) Error Flag
Operating Level 0 SEND(90)/RECV(98) Enable Flag
Operating Level 0 Data Link Operating Flag
Operating Level 1 SEND(90)/RECV(98) Error Flag
Operating Level 1 SEND(90)/RECV(98) Enable Flag
Operating Level 1 Data Link Operating Flag
23
SR Area
SYSMAC NET Link Loop
Status Output
Section 3-4
SR 236 contains the SYSMAC NET Link Loop Status Flags. Bits 00 through 07 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
Central Power Supply Unit:
0: Power supply connected.
1: Power supply not connected.
Loop status:
11: Normal loop
10: Lower back loop
01: Upper back loop
00: Loop error
Transmission status:
0: Reception possible
1: Reception not possible
Communications
Completion Code (CPU31-E
Only)
When SEND(90) or RECV(98) is used in a SYSMAC LINK System, a completion code is output to SR 23700 through SR 23707 for level 0, or SR 23708 through
SR 23715 for level 0, to indicate whether or not the data transfer was completed successfully and to indicate the nature of the error when communications are not completed successfully. These error codes are as follows.
03
04
05
06
07
SYSMAC LINK Systems
00
01
Completion code
02
08
09
Name Meaning
Normal end
Parameter error
Data transfer was completed successfully.
SEND(90)/RECV(98) instruction operands are not within specified ranges.
Transmission impossible The System was reset during execution of the instruction or the destination node is not in the System.
Destination not in System The destination node is not in the System.
Busy error
Response timeout
Response error
Communications controller error
Setting error
CPU error
The destination node is busy and cannot receive the transfer.
A response was not received within the time limit.
An error response was received from the destination node.
An error occurred in the communications controller.
The node address was set incorrectly.
A CPU error occurred in the PC of the destination node.
SYSMAC NET Link Systems
03
04
05
06
00
Completion code
01
02
Name
Normal end
Parameter error
Transmission impossible
Busy error
Transmission error
Loop error
No response
Meaning
Data transfer was completed successfully.
SEND(90)/RECV(98) instruction operands are not within specified ranges.
The System was reset during execution of the instruction or the destination node is not in the System.
The destination node is busy and cannot receive the transfer.
The line server token was not received.
An error occurred in the transmission loop.
Destination node does not exist or response was not received within the time limit.
Incorrect response format.
07 Response error
Data Link Status (CPU31-E
Only)
SYSMAC LINK/SYSMAC NET Link Data link status is output to SR 238 through
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 below.
SYSMAC LINK Systems
Level 0
SR 238
SR 239
SR 240
SR 241
Level 1
SR 242
SR 243
SR 244
SR 245
00 to 03
Node 1
Node 5
Node 9
Node 13
04 to 07
Node 2
Node 6
Node 10
Node 14
Bits
08 to 11
Node 3
Node 7
Node 11
Node 15
12 to 15
Node 4
Node 8
Node 12
Node 16
Each of the above sets of four bits operates as shown below.
Leftmost bit Middle bits
ON when data link is active.
ON when there is a data communications error.
ON when there is a PC error.
Rightmost bit
ON when PC is in RUN mode.
SYSMAC NET Link Systems
Level 0 Level 1
SR 238 SR 242
Bit numbers in header/Registration number in the data link table
PC Run Flags PC Error Flags
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
SR 239
SR 240
SR 241
SR 243
SR 244
SR 245
9 10 11 12 13 14 15 16 9 10 11 12 13 14 15 16
17 18 19 20 21 22 23 24 17 18 19 20 21 22 23 24
25 26 27 28 29 30 31 32 25 26 27 28 29 30 31 32
PC Link Systems
PC Link Unit Error and Run
Flags
When the PC belongs to a PC Link System, words 247 through 250 are used to monitor the operating status of all PC Link Units connected to the PC Link System. 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 assignments depend on whether the PC is in a Single-level PC Link System or a Multilevel 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
Single-level PC Link Systems
Flag type
Run flags
07
Error flags 08
09
10
11
12
13
14
15
03
04
05
06
00
Bit no.
01
02
Multilevel PC Link Systems
Application Example
SR 247
Unit #24
Unit #25
Unit #26
Unit #27
Unit #28
Unit #29
Unit #30
Unit #31
Unit #24
Unit #25
Unit #26
Unit #27
Unit #28
Unit #29
Unit #30
Unit #31
SR 248
Unit #16
Unit #17
Unit #18
Unit #19
Unit #20
Unit #21
Unit #22
Unit #23
Unit #16
Unit #17
Unit #18
Unit #19
Unit #20
Unit #21
Unit #22
Unit #23
SR 249
Unit #8
Unit #9
Unit #10
Unit #11
Unit #12
Unit #13
Unit #14
Unit #15
Unit #8
Unit #9
Unit #10
Unit #11
Unit #12
Unit #13
Unit #14
Unit #15
Flag type
Run flags 00
Bit no.
01
02
03
04
05
06
07
Error flags 08
09
10
11
12
13
14
15
SR 247
Unit #15, level 1
Unit #8, level 1
Unit #9, level 1
Unit #10, level 1
Unit #11, level 1
Unit #12, level 1
Unit #13, level 1
Unit #14, level 1
Unit #15, level 1
Unit #8, level 1
Unit #9, level 1
Unit #10, level 1
Unit #11, level 1
Unit #12, level 1
Unit #13, level 1
Unit #14, level 1
SR 249
Unit #15, level 0
Unit #8, level 0
Unit #9, level 0
Unit #10, level 0
Unit #11, level 0
Unit #12, level 0
Unit #13, level 0
Unit #14, level 0
Unit #15, level 0
Unit #8, level 0
Unit #9, level 0
Unit #10, level 0
Unit #11, level 0
Unit #12, level 0
Unit #13, level 0
Unit #14, level 0
SR 248
Unit #7, level 1
Unit #0, level 1
Unit #1, level 1
Unit #2, level 1
Unit #3, level 1
Unit #4, level 1
Unit #5, level 1
Unit #6, level 1
Unit #7, level 1
Unit #0, level 1
Unit #1, level 1
Unit #2, level 1
Unit #3, level 1
Unit #4, level 1
Unit #5, level 1
Unit #6, level 1
SR 250
Unit #7, level 0
Unit #0, level 0
Unit #1, level 0
Unit #2, level 0
Unit #3, level 0
Unit #4, level 0
Unit #5, level 0
Unit #6, level 0
Unit #7, level 0
Unit #0, level 0
Unit #1, level 0
Unit #2, level 0
Unit #3, level 0
Unit #4, level 0
Unit #5, level 0
Unit #6, level 0
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-
Unit #7
Unit #0
Unit #1
Unit #2
Unit #3
Unit #4
Unit #5
Unit #6
Unit #7
SR 250
Unit #0
Unit #1
Unit #2
Unit #3
Unit #4
Unit #5
Unit #6
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.
Binary
Hex
15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 00
0 0 0 0 0 0 1 0 1 1 1 1 1 1 1 1
0 2 F F
3-4-3 Forced Status Hold Bit
SR 25211 determines whether or not the status of bits that have been force-set or force-reset is maintained when switching between PROGRAM and MONI-
TOR mode to start or stop operation. If SR 25211 is ON, bit status will be maintained; if SR 25211 is OFF, all bits will return to default status when operation is started or stopped. The Force Status Hold Bit is only effective when enabled with the Set System instruction (SYS(49)).
The status of SR 25211 in not affected by a power interruption unless the I/O table is registered; in that case, SR 25211 will go OFF.
SR 25211 is not effective when switching to RUN mode.
SR 25211 should be manipulated from a Peripheral Device, e.g., a Programming Console or FIT.
Maintaining Status during
Startup
The status of SR 25211 and thus the status of force-set/force-reset bits can be maintained when power is turned off and on by inserting the Set System instruction (SYS(49)) in the program as step 00000 with the proper operand. If SYS(49) is used in this way, the status of SR 25211 will be preserved when power is turned off and on. If this is done and SR 25211 is ON, then the status of force-set/ force-reset bits will also be preserved, as shown in the following table. The use of
SYS(49) does not affect operation when switching to run mode, i.e., force-set/ force-reset bits always return to default status when switching to RUN mode.
OFF
Status before shutdown
ON
SR 25211 SYS(49)
Executed
Not executed
Executed
Not executed
Status at next startup
ON
SR 25211
OFF
OFF
OFF
Force-set/reset bits
Status maintained
Default status
Default status
Default status
Refer to Section 5 Instruction Set for details on SYS(49).
3-4-4 I/O Status Hold Bit
SR 25212 determines whether or not the status of IR and LR area bits is maintained when operation is started or stopped, when operation begins by switching from PROGRAM mode to MONITOR or RUN modes. If SR 25212 is ON, bit status will be maintained; if SR 25212 is OFF, all IR and LR area bits will be reset.
The I/O Status Hold Bit is effective only if enabled with the Set System instruction
(SYS(49)).
The status of SR 25211 in not affected by a power interruption unless the I/O table is registered; in that case, SR 25211 will go OFF.
SR 25212 can be turned ON from the program using the Output instruction, or it can be turned ON from a Peripheral Device.
Maintaining Status during
Startup
The status of SR 25212 and thus the status of IR and LR area bits can be maintained when power is turned off and on by inserting the System Operation instruction (SYS(49)) into the program as step 00000 with the proper operand. If
SYS(49) is used in this way, the status of SR 25212 will be preserved when power is turned off and on. If this is done and SR 25212 is ON, then the status of IR and LR area bits will also be preserved, as shown in the following table.
27
SR Area Section 3-4
OFF
Status before shutdown
SR 25212
ON
SYS(49)
Executed
Not executed
Executed
Not executed
Status at next startup
ON
SR 25212
OFF
OFF
OFF
IR and LR bits
Status maintained
Reset
Reset
Reset
Refer to Section 5 Instruction Set for details on SYS(49).
The status of the Data Retention Control bit is maintained for power interruptions or when PC operation is stopped.
3-4-5 Output OFF Bit
SR bit 25215 is turned ON to turn OFF all outputs from the PC. The OUT INHIBIT indicator on the front panel of the CPU will light. When the Output OFF Bit is OFF, all output bits will be refreshed in the usual way.
The status of the Output OFF Bit is maintained for power interruptions or when
PC operation is stopped, unless the I/O table has been registered, or the I/O table has been registered and either the Force Status Hold Bit or the I/O Status
Hold Bit has not been enabled with SYS(49).
3-4-6 FAL (Failure Alarm) Area
A 2-digit BCD FAL code is output to bits 25300 to 25307 when the FAL or FALS instruction is executed. These codes are user defined for use in error diagnosis, although the PC also outputs FAL codes to these bits, such as one caused by battery voltage drop.
This area can be reset by executing the FAL instruction with an operand of 00 or by performing a Failure Read Operation from the Programming Console.
3-4-7 Low Battery Flag
SR bit 25308 turns ON if the voltage of the RAM Unit, EEPROM Unit, or
CPU31-E backup battery drops. The ALARM/ERROR indicator on the front of the CPU will also flash.
AR bit 2404 is a separate Low Battery Flag for the CPU31-E only. It is therefore possible to determine which backup battery is low, that of the RAM Unit or
CPU31-E, by checking the status of AR 2404.
This bit can be programmed to activate an external warning for a low battery voltage.
The Set System instruction (SYS(49)) can be used to turn off the operation of the battery alarm if desired, e.g., when DM 1000 to DM 1999 is placed in ROM and a battery is not used in operation. Refer to Section 5 Instruction Set for details.
3-4-8 Cycle Time Error Flag
SR bit 25309 turns ON if the cycle time exceeds 100 ms. The ALARM/ERROR indicator on the front of the CPU will also flash. Program execution will not stop, however, unless the maximum time limit set for the watchdog timer is exceeded.
Timing may become inaccurate after the cycle time exceeds 100 ms.
3-4-9 I/O Verification Error Flag
SR bit 25310 turns ON when the Units mounted in the system disagree with the
I/O table registered in the CPU. The ALARM/ERROR indicator on the front of the
CPU will also flash, but PC operation will continue.
To ensure proper operation, PC operation should be stopped, Units checked, and the I/O table corrected whenever this flag goes ON.
28
SR Area Section 3-4
3-4-10 First Cycle Flag
SR bit 25315 turns ON when PC operation begins and then turns OFF after one cycle of the program. The First Cycle Flag is useful in initializing counter values and other operations. An example of this is provided in 5-13 Timer and Counter
Instructions.
3-4-11 Clock Pulse Bits
Five clock pulses are available to control program timing. Each clock pulse bit is
ON for the first half of the rated pulse time, then OFF for the second half. In other words, each clock pulse has a duty factor of 50%.
These clock pulse bits are often used with counter instructions to create timers.
Refer to 5-13 Timer and Counter Instructions for an example of this.
Pulse width
Bit
1 min
25400
0.02 s
25401
0.1 s
25500
0.2 s
25501
1.0 s
25502
Bit 25400
1-min clock pulse
Bit 25401
0.02-s clock pulse
30 s 30 s
1 min.
Bit 25500
0.1-s clock pulse
.01 s .01 s
.02 s
Bit 25501
0.2-s clock pulse
.05 s .05 s
0.1 s
Bit 25502
1.0-s clock pulse
0.5 s
1.0 s
0.5 s
0.1 s 0.1 s
0.2 s
Caution:
Because the 0.1-second and
0.02-second clock pulse bits have
ON times of 50 and 10 ms, respectively, the CPU may not be able to accurately read the pulses if program execution time is too long.
3-4-12 Step Flag
SR bit 25407 turns ON for one cycle when step execution is started with the
STEP(08) instruction.
3-4-13 Group-2 High-density I/O Unit Error Flag
SR bit 25414 turns ON for any of the following errors for Group-2 High-density
I/O Units: the same I/O number set twice, the same words allocated to more than one Unit, refresh errors. If one of these errors occurs, the Unit will stop operation and the ALARM indicator will flash, but the overall PC will continue operation.
When the Group-2 High-density I/O Unit Error Flag is ON, the number of the Unit with the error will be provided in AR 0205 to AR 0214. If the Unit cannot be started properly even though the I/O number is set correctly and the Unit is installed properly, a fuse may be blown or the Unit may contain a hardware failure. If this should occur, replace the Unit with a spare and try to start the system again.
There is also an error flag for High-density I/O Units in the AR area, AR 0215.
29
AR Area Section 3-5
3-4-14 Instruction Execution Error Flag, ER
SR bit 25503 turns ON if an attempt is made to execute an instruction with incorrect operand data. Common causes of an instruction error are non-BCD operand data when BCD data is required, or an indirectly addressed DM word that is non-existent. When the ER Flag is ON, the current instruction will not be executed.
3-4-15 Arithmetic Flags
The following flags are used in data shifting, arithmetic calculation, and comparison instructions. They are generally referred to only by their two-letter abbreviations.
!
Caution These flags are all reset when the END(01) instruction is executed, and therefore cannot be monitored from a programming device.
Carry Flag, CY
Greater Than Flag, GR
Equal Flag, EQ
Less Than Flag, LE
Refer to 5-14 Data Shifting, 5-16 Data Comparison, 5-18 BCD Calculations, and
5-19 Binary Calculations for details.
SR bit 25504 turns ON when there is a carry in the result of an arithmetic operation 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.
SR bit 25505 turns ON when the result of a comparison shows the first of two operands to be greater than the second.
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.
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.
3-5 AR (Auxiliary Relay) Area
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
AR 0713 to AR 0715
AR 07 to AR 15
AR 16, AR 17
AR 18 to AR 21
AR 0708, AR 22
Use
Error History Area
SYSMAC LINK Units
SYSMAC LINK and SYSMAC NET Link Units
Calendar/clock Area
TERMINAL Mode Key Bits
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 following pages in order of bit number.
30
AR Area Section 3-5
AR Area Flags and Control Bits
00
Word(s)
01
02
03
04
05
06
07
08 to 11
12 to 15
16
17
18 to 21
22
23
24
25
Bit(s) Function
00 to 09 Error Flags for Special I/O Units 0 to 9 (also function as Error Flags for PC Link Units)
10
11
12
13
14
Error Flag for operating level 1 of SYSMAC LINK or SYSMAC NET Link System
Error Flag for operating level 0 of SYSMAC LINK or SYSMAC NET Link System
Host Computer to Rack-mounting Host Link Unit Level 1 Error Flag
Host Computer to Rack-mounting Host Link Unit Level 0 Error Flag
Remote I/O Master Unit 1 Error Flag
15 Remote I/O Master Unit 0 Error Flag
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
12, 13
Restart Bit for operating level 0 of SYSMAC LINK or SYSMAC NET Link System
Not used.
14 Remote I/O Master Unit 1 Restart Bit
15 Remote I/O Master Unit 0 Restart Bit
00 to 04 Slave Rack Error Flags
05 to 15 Group-2 High-density I/O Unit Error Flags
00 to 15 Error Flags for Optical I/O Units 0 to 7
00 to 15 Error Flags for Optical I/O Units 8 to 15
00 to 15 Error Flags for Optical I/O Units 16 to 23
00 to 15 Error Flags for Optical I/O Units 24 to 31
00 to 03 Data Link setting for operating level 0 of SYSMAC LINK System
04 to 07 Data Link setting for operating level 1 of SYSMAC LINK System
08 TERMINAL Mode Input Cancel Bit
09 to 12 Not used.
13 Error History Overwrite Bit
14
15
Error History Reset Bit
Error History Enable Bit
00 to 15 Active Node Flags for SYSMAC LINK System nodes of operating level 0
00 to 15 Active Node Flags for SYSMAC LINK System nodes of operating level 1
05
06
07
08
09
00 to 15 SYSMAC LINK/SYSMAC NET Link System operating level 0 service time per cycle
00 to 15 SYSMAC LINK/SYSMAC NET Link System operating level 1 service time per cycle
00 to 15 Calendar/clock Area
00 to 15 TERMINAL Mode Key Bits
00 to 15 Power Off Counter
00 to 03 Not used.
04 CPU Unit Low Battery Flag (only for the C200H-CPU31-E)
Cycle Time Flag
SYSMAC LINK System Network Parameter Flag for operating level 1
SYSMAC LINK System Network Parameter Flag for operating level 0
SYSMAC/SYSMAC NET Link Unit Level 1 Mounted Flag
SYSMAC/SYSMAC NET Link Unit Level 0 Mounted Flag
10
11
12
Not used.
PC Link System Level 1 Mounted Flag
PC Link System Level 0 Mounted Flag
13
14
Rack-mounting Host Link Unit Level 1 Mounted Flag
Rack-mounting Host Link Unit Level 0 Mounted Flag
15 CPU-mounting Device Mounted Flag
00 to 15 FALS-generating Address
31
AR Area
26
27
Word(s) Bit(s)
00 to 15 Maximum Cycle Time
00 to 15 Present Cycle Time
Function
Section 3-5
3-5-1 Slave Rack Error Flags
AR bits 0200 to AR 0204 correspond to the unit numbers of Remote I/O Slave
Units #0 to 4. These flags will turn ON if the same number is allocated to more then one Slave or if a transmission error occurs when starting the System. Refer to SR 251 for errors that occur after the System has started normally.
3-5-2 Group-2 High-density I/O Unit Error Flags
AR bits 0205 to AR 0215 correspond to Group-2 High-density I/O Units 0 to 9
(I/O numbers) and will turn ON when the same number is set for more than one
Unit, when the same word is allocated to more than one Unit, when I/O number 9 is set for a 64-point Unit, or when the fuse burns out in a Transistor High-density
I/O Unit. AR bit 0215 will turn ON when a Unit is not recognized as a Group-2
High-density I/O Unit.
3-5-3 Optical I/O Unit Error Flags
AR 03 through AR 06 contain the Error Flags for Optical I/O Units. An error indicates a duplication of a unit number. Up to 64 Optical I/O Units can be connected to the PC. Units are distinguished by unit number, 0 through 31, and a letter, L or
H. Bits are allocated as shown in the following table.
12
13
14
15
08
09
10
11
04
05
06
07
00
01
02
03
Bits
4 L
4 H
5 L
5 H
2 L
2 H
3 L
3 H
6 L
6 H
7 L
7 H
AR03 allocation
0 L
0 H
1 L
1 H
10 L
10 H
11 L
11 H
12 L
12 H
13 L
13 H
AR04 allocation
8 L
8 H
9 L
9 H
14 L
14 H
15 L
15 H
18 L
18 H
19 L
19 H
20 L
20 H
21 L
21 H
AR05 allocation
16 L
16 H
17 L
17 H
22 L
22 H
23 L
23 H
26 L
26 H
27 L
27 H
28 L
28 H
29 L
29 H
AR06 allocation
24 L
24 H
25 L
25 H
30 L
30 H
31 L
31 H
3-5-4 SYSMAC LINK System Data Link Settings
AR 0700 to AR 0703 and AR 0704 to AR 0707 are used to designate word allocations for operating levels 0 and 1 of the SYSMAC LINK System. Allocation can be set to occur either according to settings from an FIT or automatically in the LR
32
AR Area Section 3-5
External/Automatic Allocation and/or DM areas. If automatic allocation is designated, the number of words to be allocated to each node is also designated. These settings are shown below.
Operating level 0 Operating level 1
0
1
0
1
AR 0700 AR 0701 AR 0704 AR 0705
0
0
0
1
0
0
1
1
0
1
1
1
Setting
Words set externally (FIT)
Automatic LR area only allocation DM area only
LR and DM areas
Words per Node
The following setting is necessary if automatic allocation is designated above.
0
1
0
1
Operating level 0 Operating level 1 Words per node Max. no.
AR 0702 AR 0703 AR 0706 AR 0707 LR area DM area of nodes
0
0
1
1
0
1
0
1
0
0
1
1
4
8
16
32
8
16
32
64
16
8
4
2
The above settings are read every cycle while the SYSMAC LINK System is in operation.
3-5-5 Error History Bits
AR 0713 (Error History Overwrite Bit) is turned ON or OFF by the user to control overwriting of records in the Error History Area in the DM area. Turn AR 0713 ON to overwrite the oldest error record each time an error occurs after 10 have been recorded. Turn OFF AR 0713 to store only the first 10 records that occur each time after the history area is cleared.
AR 0714 (Error History Reset Bit) is turned ON and then OFF by the user to reset the Error Record Pointer (DM 0969) and thus restart recording error records at the beginning of the history area.
AR 0715 (Error History Enable Bit) is turned ON by the user to enable error history storage and turned OFF to disable error history storage.
Refer to 3-6 DM Area for details on the Error History Area.
Error history bits are refreshed each cycle.
3-5-6 Active Node Flags
AR 08 through AR 11 and AR 12 through AR 15 provide flags that indicate which nodes are active in the SYSMAC LINK System at the current time. These flags are refreshed every cycle while the SYSMAC LINK System is operating.
The body of the following table show the node number assigned to each bit. If the bit is ON, the node is currently active.
Level 0
AR 08
AR 09
AR 10
AR 11
Level 1
AR 12
AR 13
AR 14
AR 15
1
Bit (body of table shows node numbers)
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
17
33
49
18
34
50
*Communication Controller Error Flag
**EEPROM Error Flag
19
35
51
20
36
52
21
37
53
22
38
54
23
39
55
24
40
56
25
41
57
26
42
58
27
43
59
28
44
60
29
45
61
30
46
62
31
47
*
32
48
**
33
AR Area Section 3-5
3-5-7 SYSMAC LINK/SYSMAC NET Link System Service Time (CPU31-E
Only)
AR 16 provides the time allocated to servicing operating level 0 of the SYSMAC
LINK System and/or SYSMAC NET Link System during each cycle when a SYS-
MAC LINK Unit and/or SYSMAC NET Link Unit is mounted to a Rack.
AR 17 provides the time allocated to servicing operating level 1 of the SYSMAC
LINK System and/or SYSMAC NET Link System during each cycle when a SYS-
MAC LINK Unit and/or SYSMAC NET Link Unit is mounted to a Rack.
These times are recorded in 4-digit BCD to tenths of a millisecond (000.0 ms to
999.9 ms) and are refreshed every cycle.
Bits
15 to 12 11 to 08 07 to 04 03 to 00
10 2 10 1 10 0 10 –1
3-5-8 Calendar/Clock Area and Bits
Calendar/Clock Area If AR 2114 (Stop Bit) is OFF, then the date, day, and time will be available in BCD in AR 18 to AR 20 and AR 2100 to AR 2108 as shown below. This area can also be controlled with AR 2113 (Seconds Round-off Bit) and AR 2115 (Set Bit).
Bits Contents
AR 1800 to AR 1807 Seconds
AR 1808 to AR 1815 Minutes
AR 1900 to AR 1907 Hours
AR 1908 to AR 1915 Day of month
AR 2000 to AR 2007 Month
AR 2008 to AR 2015 Year
AR 2100 to AR 2107 Day of week
Possible values
00 to 99
00 to 59
00 to 23 (24-hour system)
01 to 31 (adjusted by month and for leap year)
1 to 12
00 to 99 (Rightmost two digits of year)
00 to 06 (00: Sunday; 01: Monday; 02: Tuesday; 03: Wednesday; 04:
Thursday; 05: Friday; 06: Saturday)
Seconds Round-off Bit
Stop Bit
Set 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 greater, the minutes is incremented by 1 and the seconds is set to 00.
AR 2114 is turned OFF to enable the operation of the Calendar/clock Area and
ON to stop the operation.
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 Operations are the easiest ways to set this data.)
Note A more convenient way is if steps 1 and 2 are executed simultaneously as follows.
Set 4000 to 4006 with present value change.
Stop bit ON data
3. Turn ON AR 2114 (Reset Bit). The Calendar/clock will automatically start operating with the designated settings and AR 2114 and AR 2115 will both be turned OFF.
The Calendar/clock Area and Bits are refreshed each cycle while operational.
34
AR Area Section 3-5
Clock Accuracy Clock accuracy is affected by the ambient temperature as shown in the following table.
Ambient temperature
55
°
C
25
°
C
0
°
C
Accuracy (loss or gain per month)
–3 to 0 minutes
±
1 minute
–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.
3-5-9 TERMINAL Mode Key Bits
If the Programming Console is mounted to the PC and is in TERMINAL mode, any inputs on keys 0 through 9 (including characters A through F, i.e, keys 0 through 5 with SHIFT) will turn on a corresponding bit in AR 22. TERMINAL mode is entered either through Programming Console operations or by executing KEY(62).
The bits in AR 22 correspond to Programming Console inputs as follows:
Bit
AR 2200
AR 2201
AR 2202
AR 2203
AR 2204
AR 2205
AR 2206
AR 2207
AR 2208
AR 2209
AR 2210
AR 2211
AR 2212
AR 2213
AR 2214
AR 2215
7
8
5
6
9
A
2
3
0
1
4
B
C
D
E
F
Programming Console input
Refer to Section 5 Instruction Set for details on KEY(62) and to Section 7 Pro-
gram Monitoring and Execution for details on the TERMINAL mode.
3-5-10 Power-OFF Counter
AR 23 provides in 4-digit BCD the number of times that the PC power has been turned off. This counter can be reset as necessary using the PV Change 1 operation from the Programming Console. (Refer to 7-1-4 Hexadecimal/BCD Data
Modification for details.) The Power-OFF Counter is refreshed every time power is turned on.
3-5-11 CPU Low Battery Flag
AR 2404 is the Battery Alarm Flag for the CPU31-E backup battery.
AR 2404 is refreshed every cycle while the PC is in RUN or MONITOR mode.
3-5-12 SCAN(18) Cycle Time Flag
AR 2405 turns ON when the cycle time set with SCAN(18) is shorter than the actual cycle time.
35
DM Area Section 3-6
AR 2405 is refreshed every cycle while the PC is in RUN or MONITOR mode.
3-5-13 Network Parameter Flags
AR 2406 is ON when the actual setting of the network parameter for operating level 1 of the SYSMAC LINK System differs from the setting at the FIT.
AR 2407 is ON when the actual setting of the network parameter for operating level 0 of the SYSMAC LINK System differs from the setting at the FIT.
3-5-14 Link Unit Mounted Flags
The following flags indicate when the specified Link Units are mounted to the
Racks. (Refer to 3-5-15 CPU-mounting Device Flag for CPU-mounting Host
Link Units.) These flags are refreshed every cycle.
Name
SYSMAC LINK/SYSMAC NET Link Unit
Level 1 Mounted Flag
SYSMAC LINK/SYSMAC NET Link Unit
Level 0 Mounted Flag
PC Link Unit Level 1
PC Link Unit Level 0
Rack-mounting Host Link Unit Level 1
Rack-mounting Host Link Unit Level 0
Bit
AR 2408
AR 2409
AR 2411
AR 2412
AR 2413
AR 2414
Link Unit
SYSMAC LINK/SYSMAC NET Link Unit in operating level 1
SYSMAC LINK/SYSMAC NET Link Unit in operating level 0
PC Link Unit in operating level 1
PC Link Unit in operating level 0
Rack-mounting Host Link Unit in operating level 1
Rack-mounting Host Link Unit in operating level 0
3-5-15 CPU-mounting Device Flag
AR 2415 turns ON when any device is mounted directly to the CPU. This includes CPU-mounting Host Link Units, Programming Consoles, and Interface
Units. This flag is refreshed every cycle.
3-5-16 FALS-generating Address
AR 25 contains the address generating a user-programmed FALS code or a system FALS code 9F (cycle time error). The address is in 4-digit BCD. FALS codes are described in 5-23-1 FAILURE ALARM – FAL(06) and SEVERE FAILURE
ALARM – FALS(07). The address is refreshed every cycle when an FALS code has been generated.
3-5-17 Cycle Time Indicators
AR 26 contains the maximum cycle time that has occurred since program execution was begun. AR 27 contains the present cycle time.
Both times are to tenths of a millisecond in 4-digit BCD (000.0 ms to 999.9 ms), and are refreshed every cycle.
3-6 DM (Data Memory) Area
The DM area is divided into various parts as described in the following table.
Addresses
DM 0000 to DM 0968
DM 0969 to DM 0999
DM 1000 to DM 1999
User read/write
Read/write
Read/write
Read only
Usage
General User Area
Error History Area (CPU31-E only)
Special I/O Unit Data Area
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 Programming Console, GPC, FIT, or SYSMATE software.
36
DM Area
Indirect Addressing
Error History Area
Area Structure
Section 3-6
The DM area retains status during power interruptions.
Normally, when the content of a data area word is specified for an instruction, the instruction is performed directly on the content of that word. For example, suppose MOV(21) is performed with DM 0100 as the first operand and LR 20 as the second operand. When this instruction is executed, the content of DM 0100 is moved to LR 20.
It is possible, however, to use indirect DM addresses as the operands for many instructions. To indicate an indirect DM address, * DM is input with the address of the operand. With an indirect address, with content of this operand does not contain the actual data to be used. Instead, it’s contents is assumed to hold the address of another DM word, the content of which will actually be used in the instruction. If
*
DM 0100 was used in our example above and the content of DM
0100 is 0324, then * DM 0100 actually means that the content of DM 0324 is to be used as the operand in the instruction, and the content of DM 0324 will be moved to LR 20.
MOV(21)
* DM 0100
LR 00
Indirect address
Word
DM 0099
DM 0100
DM 0101
Content
4C59
0324
F35A
Indicates
DM 0324
DM 0324
DM 0325
DM 0326
5555
2506
D541
5555 moved to LR 00.
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)-generated error codes whenever AR 0715 (Error History Enable Bit) is ON. Refer to
Section 8 Troubleshooting for details on error codes.
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 (Error Record Pointer). The record number, DM words, and pointer value for each of the ten records are as follows:
3
4
1
2
5
6
Record
None
7
8
9
10
Addresses
N.A.
DM 0970 to DM 0972
DM 0973 to DM 0975
DM 0976 to DM 0978
DM 0979 to DM 0981
DM 0982 to DM 0984
DM 0985 to DM 0987
DM 0988 to DM 0990
DM 0991 to DM 0993
DM 0994 to DM 0996
DM 0997 to DM 0999
0000
0001
0002
0003
0004
0005
0006
0007
0008
0009
000A
Pointer value
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.
Word Bit
First
Second
Third
00 to 07
08 to 15
00 to 07
08 to 15
00 to 07
08 to 15
Content
Error code
00 (non-fatal) or 80 (fatal)
Seconds
Minutes
Hours
Day of month
Operation
Special I/O Unit Data
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.
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 indicated 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 History 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.
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.
5
6
3
4
7
8
1
2
0
Unit
9
Addresses
DM 1000 to DM 1099
DM 1100 to DM 1199
DM 1200 to DM 1299
DM 1300 to DM 1399
DM 1400 to DM 1499
DM 1500 to DM 1599
DM 1600 to DM 1699
DM 1700 to DM 1799
DM 1800 to DM 1899
DM 1900 to DM 1999
38
TC Area Section 3-8
3-7 HR (Holding Relay) Area
The HR area is used to store/manipulate various kinds of data and can be accessed either by word or by bit. Word addresses range from HR 00 through HR
99; bit addresses, from HR 0000 through HR 9915. HR bits can be used in any order required and can be programmed as often as required.
The HR area retains status when the system operating mode is changed, when power is interrupted, or when PC operation is stopped.
HR area bits and words can be used to to preserve data whenever PC operation is stopped. HR bits also have various special applications, such as creating latching relays with the Keep instruction and forming self-holding outputs. These are discussed in Section 4 Writing and Inputting the Program and Section 5 In-
struction Set.
When a SYSMAC LINK System is used, a certain number of HR bits is required for a routing table and monitor timer. These bits are taken from between HR 00 to
HR 42. Refer to the SYSMAC LINK System Manual for details.
3-8 TC (Timer/Counter) Area
The TC area is used to create and program timers and counters and holds the
Completion flags, set values (SV), and present values (PV) for all timers and counters. All of these are accessed through TC numbers ranging from TC 000 through TC 511. Each TC number is defined as either a timer or counter using one of the following instructions: TIM, TIMH, CNT, CNTR(12), TIMW<13>,
TMHW<15>, or CNTW<14>. No prefix is required when using a TC number in a timer or counter instruction.
Once a TC number has been defined using one of these instructions, it cannot be redefined elsewhere in the program either using the same or a different instruction. If the same TC number is defined in more than one of these instructions or in the same instruction twice, an error will be generated during the program check. There are no restrictions on the order in which TC numbers can be used.
Once defined, a TC number can be designated as an operand in one or more of certain set of instructions other than those listed above. When defined as a timer, a TC number designated as an operand takes a TIM prefix. The TIM prefix is used regardless of the timer instruction that was used to define the timer. Once defined as a counter, the TC number designated as an operand takes a CNT prefix. The CNT is also used regardless of the counter instruction that was used to define the counter.
TC numbers can be designated for operands that require bit data or for operands that require word data. When designated as an operand that requires bit data, the TC number accesses the completion flag of the timer or counter. When designated as an operand that requires word data, the TC number accesses a memory location that holds the PV of the timer or counter.
TC numbers are also used to access the SV of timers and counters from a Programming Device. The procedures for doing so using the Programming Console are provided in 7-1 Monitoring Operation and Modifying Data.
The TC area retains the SVs of both timers and counters during power interruptions. The PVs of timers are reset when PC operation is begun and when reset in interlocked program sections. Refer to 5-9 INTERLOCK and INTERLOCK
CLEAR – IL(02) and ILC(03) for details on timer and counter operation in interlocked program sections. The PVs of counters are not reset at these times.
Note that in programming “TIM 000” is used to designate three things: the Timer instruction defined with TC number 000, the completion flag for this timer, and the PV of this timer. The meaning in context should be clear, i.e., the first is al-
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.
3-9 LR (Link Relay) Area
The LR area is used as a common data area to transfer information between
PCs. This data transfer is achieved through a PC Link System, a SYSMAC LINK
System, or a SYSMAC NET Link System. The SYSMAC LINK or SYSMAC NET
Link Systems can use the LR area only when it is not being used by the PC Link
System.
Certain words will be allocated as the write words of each PC. These words are written by the PC and automatically transferred to the same LR words in the other PCs in the System. The write words of the other PCs are transferred in as read words so that each PC can access the data written by the other PCs in the
PC Link System. Only the write words allocated to the particular PC will be available for writing; all other words may be read only. Refer to the PC Link System
Manual, SYSMAC LINK System Manual, or SYSMAC NET Link System Manual for details.
The LR area is accessible either by bit or by word. LR area word addresses range from LR 00 to LR 63; LR area bit addresses, from LR 0000 to LR 6315. Any part of the LR area that is not used by the PC Link System can be used as work words or work bits.
LR area data is not retained when the power is interrupted, when the PC is changed to PROGRAM mode, or when it is reset in an interlocked program section. Refer to 5-9 INTERLOCK and INTERLOCK CLEAR – IL(02) and ILC(03) for details on interlocks.
3-10 Program Memory
Program Memory is where the user program is stored. The amount of Program
Memory available is either 4K or 8K words, depending on the type of Memory
Unit mounted to the CPU.
Memory Units come in different types, such as RAM and ROM Units, and for each type there are different sizes. (Refer to the Installation Guide for details.)
To store instructions in Program Memory, input the instructions through the Programming Console, or download programming data from a FIT, floppy disk, cassette tape, or host computer, or from a File Memory Unit if one is mounted to the
CPU Rack. Refer to the end of Appendix A Standard Products for information on
FIT and other special products. Programming Console operations, including those for program input, are described in Sections 4 and 7.
3-11 TR (Temporary Relay) Area
The TR area provides eight bits that are used only with the LD and OUT instructions to enable certain types of branching ladder diagram programming. The use of TR bits is described in Section 4 Writing and Inputting the Program.
TR addresses range from TR 0 though TR 7. Each of these bits can be used as many times as required and in any order required as long as the same LR bit is not used twice in the same instruction block.
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.
4-1 Basic Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-2 Instruction Terminology
4-3 Program Capacity
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-4 Basic Ladder Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-4-1 Basic Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-4-2 Mnemonic Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-4-3 Ladder Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-4-4 OUTPUT and OUTPUT NOT
4-4-5 The END Instruction
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-4-6 Logic Block Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-4-7 Coding Multiple Right-hand Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-5 The Programming Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-5-1 The Keyboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-5-2 PC Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-5-3 The Display Message Switch
4-6 Preparation for Operation
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-6-1 Entering the Password . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-6-2 Buzzer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-6-3 Clearing Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-6-4 Registering the I/O Table
4-6-5 Clearing Error Messages
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-6-6 Verifying the I/O Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-6-7 Reading the I/O Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-6-8 Clearing the I/O Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-6-9 SYSMAC NET Link Table Transfer (CPU31-E Only) . . . . . . . . . . . . . . . . . . . .
4-7 Inputting, Modifying, and Checking the Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-7-1 Setting and Reading from Program Memory Address . . . . . . . . . . . . . . . . . . . . .
4-7-2 Entering and Editing Programs
4-7-3 Checking the Program
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-7-4 Displaying the Cycle Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-7-5 Program Searches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-7-6 Inserting and Deleting Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-7-7 Branching Instruction Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-7-8 Jumps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-8 Controlling Bit Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-8-1 DIFFERENTIATE UP and DIFFERENTIATE DOWN . . . . . . . . . . . . . . . . . . . .
4-8-2 KEEP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-8-3 Self-maintaining Bits (Seal) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-9 Work Bits (Internal Relays) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-10 Programming Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-11 Program Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
72
75
77
68
69
71
71
63
64
64
66
60
61
61
57
58
60
60
47
48
49
56
56
43
44
44
45
42
42
43
87
87
88
88
78
79
82
86
88
91
92
41
Instruction Terminology Section 4-2
4-1 Basic Procedure
There are several basic steps involved in writing a program. Sheets that can be copied to aid in programming are provided in Appendix F Word Assignment Re-
cording Sheets and Appendix G Program Coding Sheet.
1, 2, 3...
1. Obtain a list of all I/O devices and the I/O points that have been assigned to them and prepare a table that shows the I/O bit allocated to each I/O device.
2. If the PC has any Units that are allocated words in data areas other than the
IR area or are allocated IR words in which the function of each bit is specified by the Unit, prepare similar tables to show what words are used for which
Units and what function is served by each bit within the words. These Units include Special I/O Units and Link Units.
3. Determine what words are available for work bits and prepare a table in which you can allocate these as you use them.
4. Also prepare tables of TC numbers and jump numbers so that you can allocate these as you use them. Remember, the function of a TC number can be defined only once within the program; jump numbers 01 through 99 can be used only once each. (TC number are described in 5-13 Timer and Counter
Instructions; jump numbers are described later in this section.)
5. Draw the ladder diagram.
6. Input the program into the CPU. When using the Programming Console, this will involve converting the program to mnemonic form.
7. Check the program for syntax errors and correct these.
8. Execute the program to check for execution errors and correct these.
9. After the entire Control System has been installed and is ready for use, execute the program and fine tune it if required.
10. Make a backup copy of the program.
The basics of ladder-diagram programming and conversion to mnemonic code are described in 4-4 Basic Ladder Diagrams. Preparing for and inputting the program via the Programming Console are described in 4-5 The Programming
Console through 4-7 Inputting, Modifying, and Checking the Program. The rest of Section 4 covers more advanced programming, programming precautions, and program execution. All special application instructions are covered in Sec-
tion 5 Instruction Set. Debugging is described in Section 7 Program Monitoring
and Execution. Section 8 Troubleshooting also provides information required for debugging.
4-2 Instruction Terminology
There are basically two types of instructions used in ladder-diagram programming: instructions that correspond to the conditions on the ladder diagram and are used in instruction form only when converting a program to mnemonic code and instructions that are used on the right side of the ladder diagram and are executed according to the conditions on the instruction lines leading to them.
Most instructions have at least one or more operands associated with them. Operands indicate or provide the data on which an instruction is to be performed.
These are sometimes input as the actual numeric values, but are usually the addresses of data area words or bits that contain the data to be used. For instance, a MOVE instruction that has IR 000 designated as the source operand will move the contents of IR 000 to some other location. The other location is also designated as an operand. A bit whose address is designated as an operand is called an operand bit; a word whose address is designated as an operand is called an operand word. If the actual value is entered as a constant, it is preceded by # to indicate that it is not an address.
42
Basic Ladder Diagrams Section 4-4
Other terms used in describing instructions are introduced in Section 5 Instruc-
tion Set.
4-3 Program Capacity
The memory capacity and maximum user program size vary with the Memory
Unit that is mounted as shown below. Refer to the Installation Guide for further information on Memory Units.
RAM
Memory
EPROM
EEPROM
Model
C200H-MP831
C200H-ME431
C200H-ME831
C200H-ME432
C200H-ME832
C200H-MR431
C200H-MR831
C200H-MR432
C200H-MR832
C200H-MR433
C200H-MR833
Capacity
8K words
4K words
8K words
4K words
8K words
4K words
8K words
4K words
8K words
4K words
8K words
Maximum program size
6,974 words
2,878 words
6,974 words
2,878 words
6,974 words
2,878 words
6,974 words
2,878 words
6,974 words
2,878 words
6,974 words
4-4 Basic Ladder Diagrams
A ladder diagram consists of one line running down the left side with lines branching off to the right. The line on the left is called the bus bar; the branching lines, instruction lines or rungs. Along the instruction lines are placed conditions that lead to other instructions on the right side. The logical combinations of these conditions determine when and how the instructions at the right are executed. A ladder diagram is shown below.
00000 06315 25208 24401 HR 0109 LR 2503 24400
Instruction
00001 00501 00502 00503 00504
00100 00002 00003 HR 0050 00007 TIM 001 LR 0515
00010
00011
21001
21005
21002
21007
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 condition indicates the operand bit for the instruction. It is the status of the bit associated 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.
4-4-1 Basic Terms
Normally Open and
Normally Closed
Conditions
Each condition in a ladder diagram is either ON or OFF depending on the status of the operand bit that has been assigned to it. A normally open condition is ON if the operand bit is ON; OFF if the operand bit is OFF. A normally closed condition is ON if the operand bit is OFF; OFF if the operand bit is ON. Generally speaking, you use a normally open condition when you want something to happen when a bit is ON, and a normally closed condition when you want something to happen when a bit is OFF.
00000
Instruction
Instruction is executed when IR bit 00000 is ON.
Normally open condition
00000
Instruction
Instruction is executed when IR bit 00000 is OFF.
Normally closed condition
Execution Conditions
Operand Bits
Logic Blocks
In ladder diagram programming, the logical combination of ON and OFF conditions 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 instructions have execution conditions.
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 diagram 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 special applications. Refer to 4-7-7 Branching Instruction Lines for details.
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 programming and is essential when programs are to be input in mnemonic code.
4-4-2 Mnemonic Code
The ladder diagram cannot be directly input into the PC via a Programming Console; a GPC, a FIT, or LSS is required. To input from a Programming Console, it is necessary to convert the ladder diagram to mnemonic code. The mnemonic code provides exactly the same information as the ladder diagram, but in a form that can be typed directly into the PC. Actually you can program directly in mnemonic code, although it in not recommended for beginners or for complex programs. Also, regardless of the Programming Device used, the program is stored in memory in mnemonic form, making it important to understand mnemonic code.
Because of the importance of the Programming Console as a peripheral device and because of the importance of mnemonic code in complete understanding of a program, we will introduce and describe the mnemonic code along with the ladder diagram. Remember, you will not need to use the mnemonic code if you are inputting via a GPC, a FIT, or LSS (although you can use it with these devices too, if you prefer).
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 address 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 addresses 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 instruction. 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 instructions 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.
Address Instruction
00000
00001
00002
00003
00004
00005
00006
LD
AND
OR
LD NOT
AND
AND LD
MOV(21)
00007
00008
00009
00010
00011
00012
00013
CMP(20)
LD
OUT
MOV(21)
DIFU(13)
AND
OUT
Operands
HR 0001
00001
00002
00100
00101
00102
DM
DM
HR
DM
DM
000
0000
0000
00
25505
00501
0000
0500
00502
00005
00503
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 address 00000 unless there is a specific reason for starting elsewhere.
4-4-3 Ladder Instructions
The ladder instructions are those instructions that correspond to the conditions on the ladder diagram. Ladder instructions, either independently or in combination with the logic block instructions described next, form the execution conditions upon which the execution of all other instructions are based.
45
Basic Ladder Diagrams
LOAD and LOAD NOT
Section 4-4
The first condition that starts any logic block within a ladder diagram corresponds 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 later in this manual.
00000
A LOAD instruction.
00000
A LOAD NOT instruction.
Address Instruction
00000
00001
00002
00003
LD
Instruction
LD NOT
Instruction
Operands
00000
00000
AND and AND NOT
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 instruction (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.
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 conditions 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.
00000 00100 LR 0000
Instruction
OR and OR NOT
Address Instruction
00000
00001
00002
00003
LD
AND NOT
AND
Instruction
LR
Operands
00000
00100
0000
The instruction will have an ON execution condition only when all three conditions 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 instruction in a series is the first condition on the instruction line.
Each AND NOT instruction in series takes the logical AND of its execution condition and the inverse of its operand bit.
When two or more conditions lie on separate instruction lines which run in parallel 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 the top) to a LOAD NOT, an OR NOT, and an OR instruction. Again, each of these instructions requires one line of mnemonic code.
00000
Instruction
00100
LR 0000
Combining AND and OR
Instructions
Address Instruction
00000
00001
00002
00003
LD
OR NOT
OR
Instruction
LR
Operands
00000
00100
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.
When AND and OR instructions are combined in more complicated diagrams, 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
Address Instruction
00000
00001
00002
00003
00004
00005
LD
AND
OR
AND
AND NOT
Instruction
Operands
00000
00001
00200
00002
00003
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 consider more complicated diagrams, however, we’ll look at the instructions required to complete a simple “input-output” program.
4-4-4 OUTPUT and OUTPUT NOT
The simplest way to output the results of combining execution conditions is to output it directly with the OUTPUT and OUTPUT NOT. These instructions are
47
Basic Ladder Diagrams
00000
00001
Section 4-4 used to control the status of the designated operand bit according to the execution 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 mnemonic code, each of these instructions requires one line.
00200
00201
Address Instruction
00000
00001
LD
OUT
Address Instruction
00000
00001
LD
OUT NOT
Operands
00000
00200
Operands
00001
00201
In the above examples, IR 00200 will be ON as long as IR 00000 is ON and IR
00201 will be OFF as long as IR 00001 is ON. Here, IR 00000 and IR 00001 will be input bits and IR 00200 and IR 00201 output bits assigned to the Units controlled by the PC, i.e., the signals coming in through the input points assigned IR
00000 and IR 00001 are controlling the output points assigned IR 00200 and IR
00201, respectively.
The length of time that a bit is ON or OFF can be controlled by combining the
OUTPUT or OUTPUT NOT instruction with TIMER instructions. Refer to Examples under 5-13-1 TIMER – TIM for details.
4-4-5 The END Instruction
The last instruction required to complete a simple program is the END instruction. When the CPU cycles the program, it executes all instruction up to the first
END instruction before returning to the beginning of the program and beginning execution again. Although an END instruction can be placed at any point in a program, which is sometimes done when debugging, no instructions past the first END instruction will be executed until it is removed. The number following the END instruction in the mnemonic code is its function code, which is used when inputted most instruction into the PC. These are described later. The END instruction requires no operands and no conditions can be placed on the same instruction line with it.
00000 00001
Instruction
END(01)
Program execution ends here.
Address Instruction
00000
00001
00002
00003
LD
AND NOT
Instruction
END(01)
Operands
00000
00001
---
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 programs. Before we finish with ladder diagram basic and go onto inputting the program 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
4-4-6 Logic Block Instructions
Logic block instructions do not correspond to specific conditions on the ladder diagram; rather, they describe relationships between logic blocks. The AND
LOAD instruction logically ANDs the execution conditions produced by two logic blocks. The OR LOAD instruction logically ORs the execution conditions produced by two logic blocks.
AND LOAD Although simple in appearance, the diagram below requires an AND LOAD instruction.
00000 00002
Instruction
00001 00003
OR LOAD
Address Instruction
00000
00001
00002
00003
00004
LD
OR
LD
OR NOT
AND LD
Operands
00000
00001
00002
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 results of an OR between IR 00000 and IR 00001 is attempted, the OR NOT between 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 combine 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 restarted. To combine the results of the current execution condition with that of a previous “unused” execution condition, an AND LOAD or an OR LOAD instruction 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 condition for IR 00000 is a LOAD instruction and the condition below it is an OR instruction 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.
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 instruction 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 unused execution condition.
00000
00002
00001
00003
Instruction
Address Instruction
00000
00001
00002
00003
00004
LD
AND NOT
LD
AND
OR LD
Operands
00000
00001
00002
00003
---
Logic Block Instructions in
Series
Naturally, some diagrams will require both AND LOAD and OR LOAD instructions.
To code diagrams with logic block instructions in series, the diagram must be 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 combined, 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.
00000 00002 00004
00500
00001 00003 00005
Address Instruction
00000
00001
00002
00003
00004
00005
00006
00007
00008
LD
OR NOT
LD NOT
OR
AND LD
LD
OR
AND LD
OUT
Operands
00000
00001
00002
00003
—
00004
00005
—
00500
Address Instruction
00000
00001
00002
00003
00004
00005
00006
00007
00008
LD
OR NOT
LD NOT
OR
LD
OR
AND LD
AND LD
OUT
Operands
00000
00001
00002
00003
00004
00005
—
—
00500
50
Basic Ladder Diagrams Section 4-4
Again, with the method on the right, a maximum of eight blocks can be combined. 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 mnemonic 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.
Combining AND LOAD and
OR LOAD
Address Instruction
00000
00001
00002
00003
00004
00005
00006
00007
00008
LD
AND NOT
LD NOT
AND NOT
OR LD
LD
AND
OR LD
OUT
Operands
00000
00001
00002
00003
—
00004
00005
—
00501
Address Instruction
00000
00001
00002
00003
00004
00005
00006
00007
00008
LD
AND NOT
LD NOT
AND NOT
LD
AND
OR LD
OR LD
OUT
Operands
00000
00001
00002
00003
00004
00005
—
—
00501
Again, with the method on the right, a maximum of eight blocks can be combined. There is no limit to the number of blocks that can be combined with the first method.
Both of the coding methods described above can also be used when using AND
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 necessary to further separate block b components, because it can be coded directly using only AND and OR.
00000 00001 00002 00003
00501
00201
Block a
00004
Block b
Address Instruction
00000
00001
00002
00003
00004
00005
00006
00007
LD
AND NOT
LD
AND
OR
OR
AND LD
OUT
Operands
00000
00001
00002
00003
00201
00004
—
00501
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 instruction and the execution condition of the logic block third from the end, and on back to the first logic block that is being combined.
00000 00001
Block a
Block b1
00002 00003
00004 00202
Block b2
Block b
Complicated Diagrams
00502
Address Instruction
00000
00001
00002
00003
00004
00005
00006
00007
00008
LD NOT
AND
LD
AND NOT
LD NOT
AND
OR LD
AND LD
OUT
Operands
00000
00001
00002
00003
00004
00202
—
—
00502
When determining what logic block instructions will be required to code a diagram, 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, regardless of whether the execution conditions resulted from a single condition, from logic blocks, or from previous logic block instructions.
52
Basic Ladder Diagrams
Block a1
00000 00001
00002 00003
Block a2
Block a
Block b1
00004 00005
00006 00007
Block b2
Block b
Section 4-4
When working with complicated diagrams, blocks will ultimately be coded starting 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.
00503
Blocks a1 and a2
Blocks b1 and b2
Blocks a and b
Address Instruction
00000
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
LD
AND NOT
LD NOT
AND
OR LD
LD
AND
LD
AND
OR LD
AND LD
OUT
Operands
00000
00001
00002
00003
—
00004
00005
00006
00007
—
—
00503
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 execution 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
Block a
Block b
Block c
Block n
53
Basic Ladder Diagrams
00000
00004
00006
00001
00002 00003
00005
00007
Section 4-4
The following diagram requires an OR LOAD followed by an AND LOAD to code the top of the three blocks, and then two more OR LOADs to complete the mnemonic code.
LR 0000
Address Instruction
00000
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
LD
LD
LD
AND NOT
OR LD
AND LD
LD NOT
AND
OR LD
LD NOT
AND
OR LD
OUT LR
Operands
00000
00001
00002
00003
--
--
00004
00005
--
00006
00007
--
0000
00002 00003
00001
00004
00006
00000
00005
00007
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.
LR 0000
Address Instruction
00000
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
LD
AND NOT
OR
AND
LD NOT
AND
OR LD
LD NOT
AND
OR LD
OUT LR
Operands
00002
00003
00001
00000
00004
00005
--
00006
00007
--
0000
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
00000
Block a
00001 00002
Block b
00003
Block c
00004
Section 4-4 bines blocks blocks d and e, the following AND LOAD combines the resulting execution condition with that of block c, etc.
Block d
00005
00006 00007
Block e
LR 0000
Blocks d and e
Block c with result of above
Block b with result of above
Block a with result of above
Address Instruction
00000
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
LD
LD
AND
LD
AND
LD
LD
AND
OR LD
AND LD
OR LD
AND LD
OUT LR
Operands
00000
00001
00002
00003
00004
00005
00006
00007
--
--
--
--
0000
00006 00007
00005
00001
00003 00004
00002
Again, this diagram can be redrawn as follows to simplify program structure and coding and to save memory space.
00000
LR 0000
Address Instruction
00000
00001
00002
00003
00004
00005
00006
00007
00008
00009
LD
AND
OR
AND
AND
LD
AND
OR LD
AND
OUT LR
Operands
00006
00007
00005
00003
00004
00001
00002
--
00000
0000
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:
00000 00001
Block a
00002 00003
01000 01001
00500
Block b
00004 00005
00006
Block c
00500
The first logic block instruction is used to combine the execution conditions resulting from blocks a and b, and the second one is to combine the execution condition 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
Block a
00000 00001
Section 4-5
AND, and AND NOT instructions. The logical flow for this and the resulting code are shown below.
Block b
01000 01001
LD
AND
00000
00001
LD
AND
01000
01001
OR LD
00500
OR 00500
00002 00003
AND 00002
AND NOT 00003
AND LD
Block c
00004 00005
LD
AND
00006
00004
00005
LD 00006
Address Instruction
00000
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
LD
AND
LD
AND
OR LD
OR
AND
AND NOT
LD
AND
OR
AND LD
OUT
Operands
00000
00001
01000
01001
--
00500
00002
00003
00004
00005
00006
--
00500
00500
4-4-7 Coding Multiple Right-hand Instructions
If there is more than one right-hand instruction executed with the same execution condition, they are coded consecutively following the last condition on the instruction line. In the following example, the last instruction line contains one more condition that corresponds to an AND with IR 00004.
00000 00003
00001
00002
HR 0000
00004
HR
0001
00500
00506
Address Instruction
00000
00001
00002
00003
00004
00005
00006
00007
00008
LD
OR
OR
OR
AND
OUT
OUT
AND
OUT
Operands
HR
HR
00000
00001
00002
0000
00003
0001
00500
00004
00506
4-5 The Programming Console
Once a program has been written, it must be input into the PC. This can be done in graphic (ladder diagram) form using a GPC,a FIT, or LSS. The most common way of inputting a program, however, is through a Programming Console using mnemonic code. This and the next section describe the Programming Console and the operation necessary to prepare for program input. 4-7 Inputting, Modify-
ing, and Checking the Program describes actual procedures for inputting the program into memory.
Depending on the model of Programming Console used, it is either connected to the CPU via a Programming Console Adapter and Connecting Cable or it is mounted directly to the CPU.
56
The Programming Console Section 4-5
4-5-1 The Keyboard
White: Numeric Keys
Red: CLR Key
Yellow: Operation Keys
Gray: Instruction and Data
Area Keys
The keyboard of the Programming Console is functionally divided by key color into the following four areas:
The ten white keys are used to input numeric program data such as program addresses, data area addresses, and operand values. The numeric keys are also used in combination with the function key (FUN) to enter instructions with function codes.
The CLR key clears the display and cancels current Programming Console operations. It is also used when you key in the password at the beginning of programming operations. Any Programming Console operation can be cancelled by pressing the CLR key, although the CLR key may have to be pressed two or three times to cancel the operation and clear the display.
The yellow keys are used for writing and correcting programs. Detailed explanations of their functions are given later in this section.
Except for the SHIFT key on the upper right, the gray keys are used to input instructions and designate data area prefixes when inputting or changing a program. The SHIFT key is similar to the shift key of a typewriter, and is used to alter the function of the next key pressed. (It is not necessary to hold the SHIFT key down; just press it once and then press the key to be used with it.)
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.
Pressed before the function code when inputting an instruction via its function code.
Pressed to enter SFT (the Shift Register instruction).
Input either after a function code to designate the differentiated form of an instruction or after a ladder instruction to designate an inverse condition.
Pressed to enter AND (the AND instruction) or used with NOT to enter AND NOT.
Pressed to enter OR (the OR instruction) or used with NOT to enter OR NOT.
Pressed to enter CNT (the Counter instruction) or to designate a TC number that has already been defined as a counter.
Pressed to enter LD (the Load instruction) or used with NOT to enter LD NOT. Also pressed to indicate an input bit.
Pressed to enter OUT (the Output instruction) or used with
NOT to enter OUT NOT. Also pressed to indicate an output bit.
Pressed to enter TIM (the Timer instruction) or to designate a
TC number that has already been defined as a timer.
Pressed before designating an address in the TR area.
Pressed before designating an address in the LR area.
Pressed before designating an address in the HR area.
Pressed before designating an address in the AR area.
Pressed before designating an address in the DM area.
Pressed before designating an indirect DM address.
Pressed before designating a word address.
Pressed before designating an operand as a constant.
Pressed before designating a bit address.
Pressed before function codes for block programming instructions, i.e., those placed between pointed parentheses <>.
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
Mode Changes
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 program 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 operation of the keyboard mapping function. To enter TERMINAL mode, press the
CHG key or execute the TERMINAL Mode Change instruction (TERM(48)).
!
WARNING Do not leave the Programming Console connected to the PC by an extension cable when in RUN mode. Noise picked up by the extension cable can enter the
PC, affecting the program and thus the controlled system.
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 applied, 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 peripheral 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 device was attached. The mode can be changed with the mode switch on the Programming 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.
4-5-3 The Display Message Switch
Next to the external connector for peripheral devices on the PC there is a small switch for selecting either Japanese or English language messages for display on the Programming Console. It is factory set to OFF, which causes English language messages to be displayed.
4-6 Preparation for Operation
This section describes the procedures required to begin Programming Console operation. These include password entry, clearing memory, error message clearing, and I/O table operations. I/O table operations are also necessary at other times, e.g., when changes are to be made in Units used in the PC configuration.
The following sequence of operations must be performed before beginning initial program input.
1, 2, 3...
1. Confirm that all wiring for the PC has been installed and checked properly.
2. Confirm that a RAM Unit is mounted as the Memory Unit and that the write-protect switch is OFF.
3. Connect the Programming Console to the PC. Make sure that the Programming Console is securely connected or mounted to the CPU; improper connection may inhibit operation.
4. Set the mode switch to PROGRAM mode.
5. Turn on PC power.
6. Enter the password.*
7. Clear memory.
8. Register the I/O table.
9. Check the I/O table until the I/O table and system configuration are correct and in agreement.
*Unlike the C500 and C1000H PCs, it is not necessary to register the I/O table.
Register the I/O table if you want an error alarm to be given when I/O Units are added, removed, or interchanged with a different type.
Each of these operations from entering the password on is described in detail in the following subsections. All operations should be done in PROGRAM mode unless otherwise noted.
4-6-1 Entering the Password
To gain access to the PC’s programming functions, you must first enter the password. The password prevents unauthorized access to the program.
The PC prompts you for a password when PC power is turned on or, if PC power is already on, after the Programming Console has been connected to the PC. To gain access to the system when the “Password!” message appears, press CLR and then MONTR. Then press CLR to clear the display.
If the Programming Console is connected to the PC when PC power is already on, the first display below will indicate the mode the PC was in before the Pro-
60
Preparation for Operation Section 4-6 gramming Console was connected. Ensure that the PC is in PROGRAM mode
before you enter the password. When the password is entered, the PC will shift to the mode set on the mode switch, causing PC operation to begin if the mode is set to RUN or MONITOR. The mode can be changed to RUN or MONI-
TOR with the mode switch after entering the password.
<PROGRAM>
PASSWORD
<PROGRAM> BZ
Indicates the mode set by the mode selector switch.
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.
4-6-3 Clearing Memory
Using the Memory Clear operation it is possible to clear all or part of the Program
Memory, and the IR, HR, AR, DM and TC areas. Unless otherwise specified, the clear operation will clear all of the above memory areas, provided that the Memory Unit attached to the PC is a RAM Unit or an EEPROM Unit and the write-enable switch is ON. If the write-enable switch is OFF or the Memory Unit is an
EPROM Unit, Program Memory cannot be cleared.
Before beginning to programming for the first time or when installing a new program, 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 sequence is provided later in this section. Further debugging methods are provided 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 sequence are used only when performing a partial memory clear, which is described below.
Memory can be cleared in PROGRAM mode only.
61
Preparation for Operation
Key Sequence
All Clear
Partial Clear
Section 4-6
Both AR and HR areas
TC area
DM area
Program Memory cleared from designated address.
Retained if pressed
The following procedure is used to clear memory completely.
MEMORY ERR
I/O VER ERR
Continue pressing the CLR key once for each error message until “00000” appears on the display
00000
00000
00000 MEM CLR ?
HR CNT DM
00000MEM CLR
END HR CNT DM
All 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 addresses 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
To leave the TC area uncleared and retaining Program Memory addresses
00000 through 00122, input as follows:
00000
00000
00000
00000MEM CLR ?
HR CNT DM
00000MEM CLR ?
HR DM
00123MEM CLR ?
HR DM
00000MEM CLR
END HR DM
4-6-4 Registering the I/O Table
The I/O Table Registration operation writes the types of I/O Units controlled by the PC and the Rack locations of the I/O Units into the I/O table memory area of the CPU (see 3-3 I/R Area). It also clears all I/O bits. The I/O table must be registered before programming operations are begun. As the I/O table remains in memory, a new I/O table must also be registered whenever I/O Units are changed.
Unlike the C500H and C1000H PCs, C200H memory is allocated to slots in the
CPU and Extension I/O Racks, so it is not necessary to register the I/O table.
Register the I/O table if you want an error to occur when I/O Units have been added, removed, or replaced with another type.
I/O Table Registration can be performed only in PROGRAM mode. The write-enable switch on the Memory Unit must be ON (ON=“WRITE”).
The I/O verification error message, “I/O VER ERR” or “I/O SET ERROR”, will appear when starting programming operations or after I/O Units have been changed. This error is cleared by registering a new I/O table.
When the I/O table has not been registered, the PC will operate according to the
I/O Units mounted when power is applied. The I/O verification/setting error will not occur.
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 host computer. Four asterisks (
****
), indicating no Unit, will be displayed instead.
Key Sequence
63
Preparation for Operation
Initial I/O Table Registration
Section 4-6
Memory cleared completely
00000
00000
FUN (??)
00000I/OTBL?
?Ć?U=
00000I/OTBL WRIT
????
00000I/OTBL WRIT
9713
00000I/OTBL WRIT
OK
Register I/O table
4-6-5 Clearing Error Messages
After the I/O table has been registered, any error messages recorded in memory should be cleared. It is assumed here that the causes of any of the errors for which error messages appear have already been taken care of. If the beeper sounds when an attempt is made to clear an error message, eliminate the cause of the error, and then clear the error message (refer to Section 8 Troubleshoot-
ing).
To display any recorded error messages, press CLR, FUN, and then MONTR.
The first message will appear. Pressing MONTR again will clear the present message and display the next error message. Continue pressing MONTR until all messages have been cleared.
Although error messages can be accessed in any mode, they can be cleared only in PROGRAM mode.
Key Sequence
4-6-6 Verifying the I/O Table
The I/O Table Verification operation is used to check the I/O table registered in memory to see if it matches the actual sequence of I/O Units mounted. The first inconsistency discovered will be displayed as shown below. Every subsequent pressing of VER displays the next inconsistency.
Key Sequence
64
Preparation for Operation
Example
Meaning of Displays
Section 4-6
00000
00000
FUN (??)
00000I/OTBL?
?Ć?U=
00000I/OTBL VER
OK
00000I/OTBL VER
0Ć1U=O*** I***
(No errors)
(An error occurred)
Actual I/O words
Registered I/O table words
I/O slot number
Rack number
00000I/OTBL VER
**=R*ĆI R*ĆW
00000I/OTBL VER
*Ć*U=**** RMT*
Duplication
Indicates a Remote I/O Unit that has not been registered
65
Preparation for Operation Section 4-6
4-6-7 Reading the I/O Table
The I/O Table Read operation is used to access the I/O table that is currently registered in the CPU memory.
Key Sequence
[0 to 2]
Rack number
[0 to 9]
Unit number
Press the EXT key to select Remote
I/O Slave Racks or Optical I/O Units.
Example 00000
00000
FUN (??)
00000I/OTBL ?
?Ć?U=
(Slave Rack Units)
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
(PC Unit)
Meaning of Displays
I/O Unit Designations for Displays (see I/O Units Mounted in Remote Slave Racks, next page)
66
Preparation for Operation
I/O Units
Special I/O Units
Remote I/O Master Units
Remote I/O Slave Racks
Section 4-6
C500, 1000H/C2000H I/O Units
No. of points
16
32
64
Input Unit
I * * *
I I * *
I I I I
Output Unit
0 * * *
0 0 * *
0 0 0 0
C200H I/O Units
No. of points
8
16
Input Unit Output Unit i(*)* * o * * * i i * * o o * *
Note: (
*
) is i for non-fatal errors or F_
00000I/OTBL READ
*Ć*U=**** ***
I/O word number
I/O type: i: (input), o: (output)
Unit number (0 to 9)
Rack number (0 to 2)
00000I/OTBL READ
*Ć*U=$***
Blank: Unit 1 exclusively
W: Unit 2 exclusively
Special I/O
Unit type:
C: High-speed Counter
N: Host Link Unit
A: Other
Unit number (0 to 9)
Indicates Special I/O Unit
00000I/OTBL READ
*Ć*U=RMT*
Remote I/O
Master no. (0 to 1)
00000I/OTBL READ
R**Ć*U=**** ***
I/O word number
I/O type: I, O i, o (see tables on previous page)
Unit number (0 to 9)
Remote I/O Slave Unit number (0 to 4)
Remote I/O Master Unit number (0 to 1)
Indicates a Remote I/O Rack
67
Preparation for Operation
Group-2 High-density I/O
Units
00000I/OTBL READ
*Ć*U=#***
Section 4-6
2:
4:
2 words (32 pts)
4 words (64 pts)
Optical I/O Units and
Remote Terminals
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 ( **** ), indicating no Unit, will be displayed instead.
00000I/OTBL READ
2**HU=R*Ć*
I/O type: I (input), O (output), or
W (input/output)
Remote I/O Master Unit number (0 to 1)
Word (H: leftmost 8 bits; L: rightmost 8 bits)
I/O word number (200 to 231)
4-6-8 Clearing the I/O Table
The I/O Table Clear operation is used to delete the contents of the I/O table that is currently registered in the CPU memory. The PC will be set for operation based on the I/O Units mounted when the I/O Table Clear operation is performed.
The I/O Table Clear operation will reset all Special I/O Units and Link Units mounted at the time. Do not perform the I/O Table Clear operation when a Host or PC Link Unit, Remote I/O Master Unit, High-speed Counter Unit, Position
Control Unit, or other Special I/O Unit is in operation.
68
Preparation for Operation
Key Sequence
Section 4-6
Example 00000
00000
FUN (??)
00000I/OTBL
?Ć?U=
00000I/OTBL WRIT
????
00000I/OTBL CLR
????
00000I/OTBL CLR
9713
00000I/OTBL CLR
OK
4-6-9 SYSMAC NET Link Table Transfer (CPU31-E Only)
The SYSMAC NET Link Table Transfer operation transfers a copy of the SYS-
MAC NET Link Data Link table to RAM or EEPROM program memory.This allows the user program and SYSMAC NET Link table to be written into EPROM together. This operation is applicable to the CPU31-E only.
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
Key Sequence
Example
Section 4-6
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
4-7 Inputting, Modifying, and Checking the Program
Once a program is written in mnemonic code, it can be input directly into the PC from a Programming Console. Mnemonic code is keyed into Program Memory addresses from the Programming Console. Checking the program involves a syntax check to see that the program has been written according to syntax rules.
Once syntax errors are corrected, a trial execution can begin and, finally, correction under actual operating conditions can be made.
The operations required to input a program are explained below. Operations to modify programs that already exist in memory are also provided in this section, as well as the procedure to obtain the current cycle time.
Before starting to input a program, check to see whether there is a program already loaded. If there is a program loaded that you do not need, clear it first using the program memory clear key sequence, then input the new program. If you need the previous program, be sure to check it with the program check key sequence and correct it as required. Further debugging methods are provided in
Section 7 Monitoring and Execution.
4-7-1 Setting and Reading from Program Memory Address
When inputting a program for the first time, it is generally written to Program
Memory starting from address 00000. Because this address appears when the display is cleared, it is not necessary to specify it.
When inputting a program starting from other than 00000 or to read or modify a program that already exists in memory, the desired address must be designated.
To designate an address, press CLR and then input the desired address. Leading zeros of the address need not be input, i.e., when specifying an address such as 00053 you need to enter only 53. The contents of the designated address will not be displayed until the down key is pressed.
Once the down key has been pressed to display the contents of the designated address, the up and down keys can be used to scroll through Program Memory.
Each time one of these keys is pressed, the next or previous word in Program
Memory will be displayed.
If Program Memory is read in RUN or MONITOR mode, the ON/OFF status of any displayed bit will also be shown.
Key Sequence
71
Inputting, Modifying, and Checking the Program
Example
Section 4-7
If the following mnemonic code has already been input into Program Memory, the key inputs below would produce the displays shown.
00000
00200
Address Instruction
00200
00201
00202
LD
AND
TIM
00203 LD
#
Operands
00000
00001
000
0123
00100
00200READ OFF
LD 00000
00201READ ON
AND 00001
00202READ OFF
TIM 000
00202
TIM #0123
00203READ ON
LD 00100
4-7-2 Entering and Editing Programs
Programs can be entered and edited only in PROGRAM mode.
The same procedure is used to either input a program for the first time or to edit a program that already exists. In either case, the current contents of Program
Memory is overwritten, i.e., if there is no previous program, the NOP(00) instruction, which will be written at every address, will be overwritten.
To enter a program, input the mnemonic code that was produced from the ladder diagram step-by-step, ensuring that the correct address is set before starting.
Once the correct address is displayed, enter the first instruction word and press
WRITE. Next, enter the required operands, pressing WRITE after each, i.e.,
WRITE is pressed at the end of each line of the mnemonic code. When WRITE is pressed at the end of each line, the designated instruction or operand is entered and the next display will appear. If the instruction requires two or more words, the next display will indicate the next operand required and provide a default value for it. If the instruction requires only one word, the next address will be displayed.
Continue inputting each line of the mnemonic code until the entire program has been entered.
When inputting numeric values for operands, it is not necessary to input leading zeros. Leading zeros are required only when inputting function codes (see below). When designating operands, be sure to designate the data area for all but
IR and SR addresses by pressing the corresponding data area key, and to designate each constant by pressing CONT/#. CONT/# is not required for counter or timer SVs (see below). The AR area is designated by pressing SHIFT and then
HR. TC numbers as bit operands (i.e., completion flags) are designated by pressing either TIM or CNT before the address, depending on whether the TC number has been used to define a timer or a counter. To designate an indirect
DM address, press CH/
*
before the address (pressing DM is not necessary for an indirect DM address).
Inputting SV for Counters and Timers
The SV (set value) for a timer or counter is generally entered as a constant, although inputting the address of a word that holds the SV is also possible. When inputting an SV as a constant, CONT/# is not required; just input the numeric
72
Inputting, Modifying, and Checking the Program Section 4-7
Designating Instructions value and press WRITE. To designate a word, press CLR and then input the word address as described above.
The most basic instructions are input using the Programming Console keys provided 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 function 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 desired, 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
[Address displayed] [Instruction word] [Operand]
73
Inputting, Modifying, and Checking the Program
Example
Section 4-7
The following program can be entered using the key inputs shown below. Displays will appear as indicated.
00000
Address Instruction
00200
00201
LD
TIM
00200
00202 TIMH(15)
#
#
Operands
00002
000
0123
001
0500
00200
LD 00002
00201READ
NOP (00)
00201
TIM 000
00201 TIM DATA
#0000
00201 TIM
#0123
00202READ
NOP (00)
00202
FUN (??)
00202
TIMH (15) 001
00202 TIMH DATA
#0000
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.
Message
****REPL ROM
Cause and correction
An attempt was made to write to ROM, or to write-protected RAM or EEPROM. Ensure that a RAM or EEPROM Unit is mounted and that its write-protect switch is set to OFF.
****PROG OVER The instruction at the last address in memory is not NOP(00). Erase all unnecessary instructions at the end of the program or use a larger Memory Unit.
****ADDR OVER An address was set that is larger than the highest memory in Program Memory. Input a smaller address
****SETDATA ERR Data has been input in the wrong format or beyond defined limits, e.g., a hexadecimal value has been input for BCD. Re-enter the data. This error will generate a FALS 00 error.
****I/O NO. ERR A data area address has been designated that exceeds the limit of the data area, e.g., an address is too large. Confirm the requirements for the instruction and re-enter the address.
4-7-3 Checking the Program
Once a program has been entered, the syntax should be checked to verify that no programming rules have been violated. This check should also be performed if the program has been changed in any way that might create a syntax error.
To check the program, input the key sequence shown below. The numbers indicate the desired check level (see below). When the check level is entered, the program check will start. If an error is discovered, the check will stop and a display indicating the error will appear. Press SRCH to continue the check. If an error is not found, the program will be checked through to the first END(01), with a display indicating when each 64 instructions have been checked (e.g., display
#1 of the example after the following table).
CLR can be pressed to cancel the check after it has been started, and a display like display #2, in the example, will appear. When the check has reached the first
END, a display like display #3 will appear.
A syntax check can be performed on a program only in PROGRAM mode.
Key Sequence
To check up to END(01)
To abort
(0, 1, 2, Check levels)
Check Levels and Error
Messages
Three levels of program checking are available. The desired level must be designated 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
Type Message
Type A ?????
NO END INSTR
CIRCUIT ERR
LOCN ERR
DUPL
SBN UNDEFD
JME UNDEFD
OPERAND ERR
STEP ERR
Type B ILĆILC ERR
JMPĆJME ERR
SBNĆRET ERR
Type C JMP UNDEFD
SBS UNDEFD
COIL DUPL
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.
Meaning and appropriate response
The program has been lost. Re-enter the program.
There is no END(01) in the program. Write END(01) at the final address in the program.
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.
An instruction is in the wrong place in the program. Check instruction requirements and correct the program.
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.)
SBS(91) has been programmed for a subroutine number that does not exist.
Correct the subroutine number or program the required subroutine.
A JME(04) is missing for a JMP(05). Correct the jump number or insert the proper
JME(04).
A constant entered for the instruction is not within defined values. Change the constant so that it lies within the proper range.
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.
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(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.
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.
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.
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.
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
Example
Section 4-7
The following example shows some of the displays that can appear as a result of a program check.
00000
00000PROG CHK
CHKLEVEL (0Ć2)?
00064PROG CHK
Display #1
Halts program check
00128PROG CHKEND
Display #2
Check continues until END(01)
03000PROG CHK
END (01)(03.6KW) Display #3
When errors are found
00178CIRCUIT ERR
OUT 00200
00196COIL DUPL
OUT 00200
00200ILĆILC ERR
ILC (03)
32000NO ENDINSTR
END
4-7-4 Displaying the Cycle Time
Once the program has been cleared of syntax errors, the cycle time should be checked. This is possible only in RUN or MONITOR mode while the program is being executed. See Section 6 Program Execution Timing for details on the cycle time.
To display the current average cycle time, press CLR then MONTR. The time displayed by this operation is a typical cycle time. The differences in displayed values depend on the execution conditions that exist when MONTR is pressed.
Example
00000
00000CYCLE TIME
054.1MS
00000CYCLE TIME
053.9MS
77
Inputting, Modifying, and Checking the Program Section 4-7
4-7-5 Program Searches
The program can be searched for occurrences of any designated instruction or data area address used in an instruction. Searches can be performed from any currently displayed address or from a cleared display.
To designate a bit address, press SHIFT, press CONT/#, then input the address, including any data area designation required, and press SRCH. To designate an instruction, input the instruction just as when inputting the program and press
SRCH. Once an occurrence of an instruction or bit address has been found, any additional occurrences of the same instruction or bit can be found by pressing
SRCH again. SRCH’G will be displayed while a search is in progress.
When the first word of a multiword instruction is displayed for a search operation, the other words of the instruction can be displayed by pressing the down key before continuing the search.
If Program Memory is read in RUN or MONITOR mode, the ON/OFF status of any bit displayed will also be shown.
Key Sequence
78
Inputting, Modifying, and Checking the Program
Example:
Instruction Search
Section 4-7
00000
00000
LD 00000
00200SRCH
LD 00000
00202
LD 00000
06000SRCH
END (01)(06.4KW)
00000
00100
00100
TIM 001
00203SRCH
TIM 001
00203 TIM DATA
#0123
Example:
Bit Search
00000
00000CONT SRCH
CONT 00005
00200CONT SRCH
LD 00005
00203CONT SRCH
AND 00005
06000
END (01)(06.4K)
4-7-6 Inserting and Deleting Instructions
In PROGRAM mode, any instruction that is currently displayed can be deleted or another instruction can be inserted before it. These are not possible in RUN or
MONITOR modes.
To insert an instruction, display the instruction before which you want the new instruction to be placed, input the instruction word in the same way as when inputting a program initially, and then press INS and the down key. If other words are required for the instruction, input these in the same way as when inputting the program initially.
79
Inputting, Modifying, and Checking the Program Section 4-7
To delete an instruction, display the instruction word of the instruction to be deleted and then press DEL and the up key. All the words for the designated instruction will be deleted.
!
Caution Be careful not to inadvertently delete instructions; there is no way to recover them without reinputting them completely.
Key Sequences
Example
When an instruction is inserted or deleted, all addresses in Program Memory following the operation are adjusted automatically so that there are no blank addresses or no unaddressed instructions.
The following mnemonic code shows the changes that are achieved in a program through the key sequences and displays shown below.
Original Program
Address Instruction
00000
00001
00002
00003
00004
00005
00006
00007
00008
LD
AND
LD
AND NOT
OR LD
AND
AND NOT
OUT
END(01)
Operands
00100
00101
00201
00102
-
00103
00104
00201
-
80
Before Insertion:
00100 00101
00201 00102
00103 00104
00105
00201
Before Deletion:
00100 00101
00201 00102
00103 00105 00104
Delete
00201
END(01)
END(01)
The following key inputs and displays show the procedure for achieving the program changes shown above.
Inputting, Modifying, and Checking the Program
Inserting an Instruction
00000
00000
OUT 00000
00000
OUT 00201
00207SRCH
OUT 00201
00206READ
AND NOT 00104
00206
AND 00000
00206
AND 00105
00206INSERT?
AND 00105
00207INSERT END
AND NOT 00104
00206READ
AND 00105
Deleting an Instruction
00000
00000
OUT 00000
00000
OUT 00201
00208SRCH
OUT 00201
00207READ
AND NOT 00104
00207 DELETE?
AND NOT 00104
00207DELETE END
OUT 00201
00206READ
AND 00105
Section 4-7
Find the address prior to the insertion point
Program After Insertion
Address Instruction
00000
00001
00002
00003
00004
00005
00006
00007
00008
00009
LD
AND
LD
AND NOT
OR LD
AND
AND
AND NOT
OUT
END(01)
Operands
00100
00101
00201
00102
-
00103
00105
00104
00201
-
Insert the instruction
Find the instruction that requires deletion.
Program After Deletion
Address Instruction
00000
00001
00002
00003
00004
00005
00006
00007
00008
LD
AND NOT
LD
AND NOT
OR LD
AND
AND
AND NOT
OUT
Operands
00100
00101
00201
00102
-
00103
00105
00104
00201
Confirm that this is the instruction to be deleted.
81
Inputting, Modifying, and Checking the Program Section 4-7
4-7-7 Branching Instruction Lines
When an instruction line branches into two or more lines, it is sometimes necessary to use either interlocks or TR bits to maintain the execution condition that existed at a branching point. This is because instruction lines are executed across to a right-hand instruction before returning to the branching point to execute instructions on a branch line. If a condition exists on any of the instruction lines after the branching point, the execution condition could change during this time making proper execution impossible. The following diagrams illustrate this.
In both diagrams, instruction 1 is executed before returning to the branching point and moving on to the branch line leading to instruction 2.
00000
Branching point
00002
Instruction 1
Instruction 2
Diagram A: Correct Operation
00000
Branching point
00001
00002
Diagram B: Incorrect Operation
Instruction 1
Instruction 2
Address Instruction
00000
00001
00002
00003
LD
Instruction 1
AND
Instruction 2
Operands
00000
00002
Address Instruction
00000
00001
00002
00003
00004
LD
AND
Instruction 1
AND
Instruction 2
Operands
00000
00001
00002
TR Bits
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 executed 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 branching 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 execution condition. One is to use TR bits; the other, to use interlocks
(IL(02)/IL(03)).
The TR area provides eight bits, TR 0 through TR 7, that can be used to temporarily 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 returning 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 execution. 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
00000
00000
TR 0
00001
00002
Diagram B: Corrected Using a TR bit
Instruction 1
Instruction 2
Address Instruction
00000
00001
00002
00003
00004
00005
00006
LD
OUT
AND
Instruction 1
LD
AND
Instruction 2
Operands
TR
00000
0
00001
TR 0
00002
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 condition. This execution condition is then output using an OUTPUT instruction to
TR 0 to store the execution condition at the branching point. The execution condition 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.
TR 0
00001
00004
00005
TR 1
00002
00003
Instruction 1
Instruction 2
Instruction 3
Instruction 4
Address Instruction
00000
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
LD
OUT
AND
OUT
AND
OUT
LD
AND
OUT
LD
AND
OUT
LD
AND NOT
OUT
Operands
TR
TR
TR
TR
TR
00000
0
00001
1
00002
00500
1
00003
00501
0
00004
00502
0
00005
00503
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 example, this is achieved by reorganizing the parts of the instruction block: the bottom one, by separating the second OUTPUT instruction and using another LOAD instruction 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 instructions is sometimes important. For example, a MOVE instruction may be required 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.
00000
TR 0
00001
Instruction 1
Instruction 2
00000
00000
00001
TR 0
00002
00004
00001
Instruction 2
Instruction 1
00003
Instruction 1
Instruction 2
Interlocks
00001
00000
00002 00003
Instruction 1
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.
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 program, the execution condition for the INTERLOCK instruction will control the execution of all instruction up to the next INTERLOCK CLEAR instruction. If the execution condition for the INTERLOCK instruction is OFF, all right-hand instructions 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 requires an operand.
00000
IL(02)
00001
00002
Instruction 1
Instruction 2
ILC(03)
Address Instruction
00000
00001
00002
00003
00004
00005
00006
LD
IL(02)
LD
Instruction 1
LD
Instruction 2
ILC(03)
Operands
00000
---
00001
00002
---
If IR 00000 is ON in the revised version of diagram B, above, the status of IR
00001 and that of IR 00002 would determine the execution conditions for instructions 1 and 2, respectively. Because IR 00000 is ON, this would produce the same results as ANDing the status of each of these bits. If IR 00000 is OFF, the
INTERLOCK instruction would produce an OFF execution condition for instructions 1 and 2 and then execution would continue with the instruction line following the INTERLOCK CLEAR instruction.
As shown in the following diagram, more than one INTERLOCK instruction can be used within one instruction block; each is effective through the next INTER-
LOCK CLEAR instruction.
00000
00001
00002
00003
00005
00006
00004
IL(02)
Instruction 1
IL(02)
Instruction 2
Instruction 3
Instruction 4
ILC(03)
Address Instruction
00000
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
LD
IL(02)
LD
Instruction 1
LD
IL(02)
LD
AND NOT
Instruction 2
LD
Instruction 3
LD
Instruction 4
ILC(03)
Operands
00000
---
00001
00002
---
00003
00004
00005
00006
---
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 executed with OFF execution conditions and execution would move to the instruction 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 instruction 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 execution condition. Although this is similar to what happens when the execution condition for an INTERLOCK instruction is OFF, with jumps, the operands for all instructions 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., electronic instruments.
Jumps are created using the JUMP (JMP(04)) and JUMP END (JME(05)) instructions. 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 between 00 and 99. There are two types of jumps. The jump number used determines 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
00001
00002
JMP(04) 01
Instruction 1
Instruction 2
JME(05) 01
Address Instruction
00000
00001
00002
00003
00004
00005
00006
LD
JMP(04)
LD
Instruction 1
LD
Instruction 2
JME(05)
Operands
00000
01
00001
00002
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 diagram 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
00000
00001
00002
00003
00005
00006
00004
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).
JMP(04) 00
Instruction 1
JMP(04) 00
Instruction 2
Instruction 3
Instruction 4
JME(05) 00
Address Instruction
00000
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
LD
JMP(04)
LD
Instruction 1
LD
JMP(04)
LD
AND NOT
Instruction 2
LD
Instruction 3
LD
Instruction 4
JME(05)
Operands
00000
00
00001
00002
00
00003
00004
00005
00006
00
4-8 Controlling Bit Status
There are five instructions that can be used generally to control individual bit status. These are the OUTPUT, OUTPUT NOT, DIFFERENTIATE UP,
DIFFERENTIATE DOWN, and KEEP instructions. All of these instructions appear as the last instruction in an instruction line and take a bit address for an operand. Although details are provided in 5-8 Bit Control Instructions, these instructions (except for OUTPUT and OUTPUT NOT, which have already been introduced) are described here because of their importance in most programs. Although these instructions are used to turn ON and OFF output bits in the IR area
(i.e., to send or stop output signals to external devices), they are also used to control the status of other bits in the IR area or in other data areas.
4-8-1 DIFFERENTIATE UP and DIFFERENTIATE DOWN
DIFFERENTIATE UP and DIFFERENTIATE DOWN instructions are used to turn the operand bit ON for one cycle at a time. The DIFFERENTIATE UP instruction turns ON the operand bit for one cycle after the execution condition for it goes from OFF to ON; the DIFFERENTIATE DOWN instruction turns ON the operand bit for one cycle after the execution condition for it goes from ON to OFF.
Both of these instructions require only one line of mnemonic code.
00000
00001
DIFU(13) 00200
DIFD(14) 00201
Address Instruction
00000
00001
LD
DIFU(13)
Address Instruction
00000
00001
LD
DIFD(14)
Operands
00000
00200
Operands
00001
00201
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
4-8-2 KEEP
Section 4-9
00003
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 execution 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.
S: set input
R: reset input
KEEP(11)
HR 0000
Address Instruction
00000
00001
00002
00003
00004
LD
AND NOT
LD
OR
KEEP(11)
Operands
HR
00002
00003
00004
00005
0000
00002
00004
00005
4-8-3 Self-maintaining Bits (Seal)
Although the KEEP instruction can be used to create self-maintaining bits, it is sometimes necessary to create self-maintaining bits in another way so that they can be turned OFF when in an interlocked section of a program.
To create a self-maintaining bit, the operand bit of an OUTPUT instruction is used as a condition for the same OUTPUT instruction in an OR setup so that the operand bit of the OUTPUT instruction will remain ON or OFF until changes occur in other bits. At least one other condition is used just before the OUTPUT instruction to function as a reset. Without this reset, there would be no way to control the operand bit of the OUTPUT instruction.
The above diagram for the KEEP instruction can be rewritten as shown below.
The only difference in these diagrams would be their operation in an interlocked program section when the execution condition for the INTERLOCK instruction was ON. Here, just as in the same diagram using the KEEP instruction, two reset bits are used, i.e., HR 0000 can be turned OFF by turning ON either IR 00004 or
IR 00005.
00002 00003
HR 0000
00004
00005
HR 0000
Address Instruction
00000
00001
00002
00003
00004
00005
LD
AND NOT
OR
AND NOT
OR NOT
OUT
Operands
HR
HR
00002
00003
0000
00004
00005
0000
4-9 Work Bits (Internal Relays)
In programming, combining conditions to directly produce execution conditions is often extremely difficult. These difficulties are easily overcome, however, by using certain bits to trigger other instructions indirectly. Such programming is
88
Work Bits
Work Bit Applications
Reducing Complex
Conditions
Section 4-9 achieved by using work bits. Sometimes entire words are required for these purposes. 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.
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 programming 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 condition 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. Understanding the use of these bits is essential to effective programming.
Work bits can be used to simplify programming when a certain combination of conditions is repeatedly used in combination with other conditions. In the following 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
00000
00002
00003
24600
00004
24600
00001
24600 00004
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.
00005
00005
24600
00100
00101
Address Instruction
00000
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
LD
AND NOT
OR
OR NOT
OUT
LD
AND
AND NOT
OUT
LD
OR NOT
AND
OUT
LD NOT
OR
OR
OUT
Operands
00000
00001
00002
00003
24600
24600
00004
00005
00100
24600
00004
00005
00101
24600
00006
00007
00102
00102
00006
00007
Differentiated Conditions
00000
22500
00001 00002 00003
00004 00005
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.
DIFU(13) 22500
00100
Address Instruction
00000
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
LD
DIFU(13)
LD
LD
AND NOT
AND NOT
OR LD
LD
AND NOT
OR LD
OUT
Operands
00000
22500
22500
00001
00002
00003
---
00004
00005
---
00100
90
Programming Precautions Section 4-10
4-10 Programming Precautions
The number of conditions that can be used in series or parallel is unlimited as long as the memory capacity of the PC is not exceeded. Therefore, use as many conditions as required to draw a clear diagram. Although very complicated diagrams can be drawn with instruction lines, there must not be any conditions on lines running vertically between two other instruction lines. Diagram A shown below, for example, is not possible, and should be drawn as diagram B. Mnemonic code is provided for diagram B only; coding diagram A would be impossible.
00000 00002
Instruction 1
00004
00001 00003
Instruction 2
Diagram A
00001
00000
00000
00001
00004
00004
Diagram B
00002
00003
Instruction 1
Instruction 2
Address Instruction
00000
00001
00002
00003
00004
00005
00006
00007
00008
00009
LD
AND
OR
AND
Instruction 1
LD
AND
OR
AND NOT
Instruction 2
Operands
00001
00004
00000
00002
00000
00004
00001
00003
The number of times any particular bit can be assigned to conditions is not limited, 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 instruction 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
00000
00001
LD
Instruction
Operands
25313
Diagram B
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 second of a pair of instructions and is controlled by the execution condition of the
91
Program Execution
00000
00001 00207
00001 00207
00000
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 examples.
00207
Address Instruction
00000
00001
00002
00003
00004
LD
LD
AND
OR LD
OUT
Operands
00000
00001
00207
---
00207
Diagram A
00207
Address Instruction
00000
00001
00002
00003
LD
AND
OR
OUT
Operands
00001
00207
00000
002
Diagram B
4-11 Program Execution
When program execution is started, the CPU cycles the program from top to bottom, checking all conditions and executing all instructions accordingly as it moves down the bus bar. It is important that instructions be placed in the proper order so that, for example, the desired data is moved to a word before that word is used as the operand for an instruction. Remember that an instruction line is completed to the terminal instruction at the right before executing an instruction lines branching from the first instruction line to other terminal instructions at the right.
Program execution is only one of the tasks carried out by the CPU as part of the cycle time. Refer to Section 6 Program Execution Timing for details.
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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-2 Instruction Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-3 Data Areas, Definer Values, and Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-4 Differentiated Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-5 Coding Right-hand Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-6 Instruction Set Lists
5-6-1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Function Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-6-2 Alphabetic List by Mnemonic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-7 Ladder Diagram Instructions
5-7-1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LOAD, LOAD NOT, AND, AND NOT, OR, and OR NOT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-7-2 AND LOAD and OR LOAD
5-8 Bit Control Instructions
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-8-1
5-8-2
5-8-3
OUTPUT and OUTPUT NOT – OUT and OUT NOT
KEEP – KEEP(11)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
DIFFERENTIATE UP and DOWN – DIFU(13) and DIFD(14) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-9 INTERLOCK and INTERLOCK CLEAR – IL(02) and ILC(03)
5-10 JUMP and JUMP END – JMP(04) and JME(05)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-11 END – END(01) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-12 NO OPERATION – NOP(00) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-13 Timer and Counter Instructions
5-13-1 TIMER – TIM
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-13-2 HIGH-SPEED TIMER – TIMH(15)
5-13-3 COUNTER – CNT
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-13-4 REVERSIBLE COUNTER – CNTR(12) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-14 Data Shifting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-14-1 SHIFT REGISTER – SFT(10) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-14-2 REVERSIBLE SHIFT REGISTER – SFTR(84)
5-14-3 ARITHMETIC SHIFT LEFT – ASL(25)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-14-4 ARITHMETIC SHIFT RIGHT – ASR(26)
5-14-5 ROTATE LEFT – ROL(27)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-14-6 ROTATE RIGHT – ROR(28) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-14-7 ONE DIGIT SHIFT LEFT – SLD(74) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-14-8 ONE DIGIT SHIFT RIGHT – SRD(75) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-14-9 WORD SHIFT – WSFT(16) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-14-10 REVERSIBLE WORD SHIFT – RWS(17) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-15 Data Movement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-15-1 MOVE – MOV(21) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-15-2 MOVE NOT – MVN(22) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-15-3 COLUMN-TO-WORD – CTW(63) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-15-4 WORD-TO-COLUMN – WTC(64) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-15-5 BLOCK SET – BSET(71) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-15-6 BLOCK TRANSFER – XFER(70) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-15-7 DATA EXCHANGE – XCHG(73) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-15-8 SINGLE WORD DISTRIBUTE – DIST(80) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-15-9 DATA COLLECT – COLL(81)
5-15-10 MOVE BIT – MOVB(82)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-15-11 MOVE DIGIT – MOVD(83) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
121
121
123
125
125
125
126
126
127
108
110
111
111
111
112
116
116
119
101
102
102
103
103
104
104
106
97
100
100
95
95
95
96
133
134
135
135
136
136
137
128
128
129
130
130
131
132
93
94
5-16 Data Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-16-1 MULTI-WORD COMPARE – MCMP(19) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-16-2 COMPARE – CMP(20) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-16-3 DOUBLE COMPARE – CMPL(60)
5-16-4 BLOCK COMPARE – BCMP(68)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-16-5 TABLE COMPARE – TCMP(85)
5-17 Data Conversion
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-17-1 BCD-TO-BINARY – BIN(23) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-17-2 DOUBLE BCD-TO-DOUBLE BINARY – BINL(58)
5-17-3 BINARY-TO-BCD – BCD(24)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-17-4 DOUBLE BINARY-TO-DOUBLE BCD – BCDL(59)
5-17-5 HOURS-TO-SECONDS – HTS(65)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-17-6 SECONDS-TO-HOURS – STH(66) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-17-7 4-TO-16 DECODER – MLPX(76) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-17-8 16-TO-4 ENCODER – DMPX(77) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-17-9 7-SEGMENT DECODER – SDEC(78)
5-17-10 ASCII CONVERT – ASC(86)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-18 BCD Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-18-1 INCREMENT – INC(38)
5-18-2 DECREMENT – DEC(39)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-18-3 SET CARRY – STC(40) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-18-4 CLEAR CARRY – CLC(41) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-18-5 BCD ADD – ADD(30) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-18-6 DOUBLE BCD ADD – ADDL(54)
5-18-7 BCD SUBTRACT – SUB(31)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-18-8 DOUBLE BCD SUBTRACT – SUBL(55)
5-18-9 BCD MULTIPLY – MUL(32)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-18-10 DOUBLE BCD MULTIPLY – MULL(56) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-18-11 BCD DIVIDE – DIV(33) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-18-12 DOUBLE BCD DIVIDE – DIVL(57) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-18-13 FLOATING POINT DIVIDE – FDIV(79)
5-18-14 SQUARE ROOT – ROOT(72)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-19 Binary Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-19-1 BINARY ADD – ADB(50) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-19-2 BINARY SUBTRACT – SBB(51) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-19-3 BINARY MULTIPLY – MLB(52)
5-19-4 BINARY DIVIDE – DVB(53)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-20 Logic Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-20-1 COMPLEMENT – COM(29) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-20-2 LOGICAL AND – ANDW(34) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-20-3 LOGICAL OR – ORW(35) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-20-4 EXCLUSIVE OR – XORW(36) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-20-5 EXCLUSIVE NOR – XNRW(37) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-21 Subroutines and Interrupt Control
5-21-1 Overview
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-21-2 SUBROUTINE DEFINE and RETURN – SBN(92)/RET(93) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-21-3 SUBROUTINE ENTER – SBS(91) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-21-4 INTERRUPT CONTROL – INT(89) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-22 Step Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-22-1 STEP DEFINE and STEP START–STEP(08)/SNXT(09) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-23 Special Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-23-1 FAILURE ALARM – FAL(06) and SEVERE FAILURE ALARM – FALS(07) . . . . . . . . . . . . . . . .
5-23-2 CYCLE TIME – SCAN(18) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-23-3 MESSAGE DISPLAY – MSG(46) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-23-4 LONG MESSAGE – LMSG(47) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-23-5 TERMINAL MODE – TERM(48) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-23-6 SET SYSTEM – SYS(49) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-23-7 BIT COUNTER – BCNT(67) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-23-8 VALUE CALCULATE – VCAL(69) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-23-9 WATCHDOG TIMER REFRESH – WDT(94) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-23-10 I/O REFRESH – IORF(97) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-23-11 GROUP-2 HIGH-DENSITY I/O REFRESH – MPRF(61) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-24 Network Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-24-1 NETWORK SEND – SEND(90) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-24-2 NETWORK RECEIVE – RECV(98) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-24-3 About Network Communications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
198
200
200
201
202
188
188
197
197
198
182
182
183
183
185
179
180
180
181
182
202
205
205
206
207
207
208
210
174
176
178
179
179
167
168
169
172
174
161
162
164
165
166
159
159
159
159
160
150
152
154
157
158
146
147
148
148
149
138
138
139
141
143
144
146
146
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 mnemonics. 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.
5-2 Instruction Format
Most instructions have at least one or more operands associated with them. Operands indicate or provide the data on which an instruction is to be performed.
These are sometimes input as the actual numeric values (i.e., as constants), but are usually the addresses of data area words or bits that contain the data to be used. A bit whose address is designated as an operand is called an operand bit; a word whose address is designated as an operand is called an operand word. In some instructions, the word address designated in an instruction indicates the first of multiple words containing the desired data.
Each instruction requires one or more words in Program Memory. The first word is the instruction word, which specifies the instruction and contains any definers
(described below) or operand bits required by the instruction. Other operands required by the instruction are contained in following words, one operand per word. Some instructions require up to four words.
A definer is an operand associated with an instruction and contained in the same word as the instruction itself. These operands define the instruction rather than telling what data it is to use. Examples of definers are TC numbers, which are used in timer and counter instructions to create timers and counters, as well as jump numbers (which define which Jump instruction is paired with which Jump
End instruction). Bit operands are also contained in the same word as the instruction itself, although these are not considered definers.
5-3 Data Areas, Definer Values, and Flags
In this section, each instruction description includes its ladder diagram symbol, the data areas that can be used by its operands, and the values that can be used as definers. Details for the data areas are also specified by the operand names and the type of data required for each operand (i.e., word or bit and, for words, hexadecimal or BCD).
Not all addresses in the specified data areas are necessarily allowed for an operand, e.g., if an operand requires two words, the last word in a data area cannot be designated as the first word of the operand because all words for a single operand must be within the same data area. Other specific limitations are given in a
Limitations subsection. Refer to Section 3 Memory Areas for addressing conventions and the addresses of flags and control bits.
!
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, however, be crossed for a single operand, i.e., the last bit in the IR area may be specified for an operand that requires more than one word as long as the SR area is also allowed for that operand.
95
Differentiated Instructions
Indirect Addressing
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
ER
CY
GR
EQ
LE
Name
Instruction Execution Error Flag
Carry Flag
Greater Than Flag
Equals Flag
Less Than Flag
25503
25504
25505
25506
25507
Bit
ER is the flag most commonly used for monitoring an instruction’s execution.
When ER goes ON, it indicates that an error has occurred in attempting to execute the current instruction. The Flags subsection of each instruction lists possible reasons for ER being ON. ER will turn ON if operands are not entered correctly. Instructions are not executed when ER is ON. A table of instructions and the flags they affect is provided in Appendix D Error and Arithmetic Flag Opera-
tion.
When the DM area is specified for an operand, an indirect address can be used.
Indirect DM addressing is specified by placing an asterisk before the DM:
*
DM.
When an indirect DM address is specified, the designated DM word will contain the address of the DM word that contains the data that will be used as the operand of the instruction. If, for example, * DM 0001 was designated as the first operand and LR 00 as the second operand of MOV(21), the contents of DM 0001 was 1111, and DM 1111 contained 5555, the value 5555 would be moved to LR
00.
MOV(21)
* DM 0001
LR 00
Indirect address
Word
DM 0000
DM 0001
DM 0002
Content
4C59
1111
F35A
Indicates
DM 1111.
DM 1111
DM 1113
DM 1114
5555
2506
D541
5555 moved to LR 00.
Designating Constants
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.
Although data area addresses are most often given as operands, many operands 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. Constants must also be entered in the form required by the instruction, i.e., in BCD or in hexadecimal.
5-4 Differentiated Instructions
Most instructions are provided in both differentiated and non-differentiated forms. Differentiated instructions are distinguished by an @ in front of the instruction mnemonic.
A non-differentiated instruction is executed each time it is cycled as long as its execution condition is ON. A differentiated instruction is executed only once after its execution condition goes from OFF to ON. If the execution condition has not changed or has changed from ON to OFF since the last time the instruction was cycled, the instruction will not be executed. The following two examples
96
Coding Right-hand Instructions
00000
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.
Address Instruction
00000 LD
00001 MOV(21)
Diagram A
MOV(21)
HR 10
DM 0000
HR
DM
Operands
00000
10
0000
00000
@MOV(21)
HR 10
DM 0000
Address Instruction
00000 LD
00001 @MOV(21)
Operands
00000
Diagram B
HR
DM
10
0000
In diagram A, the non-differentiated MOV(21) will move the content of HR 10 to
DM 0000 whenever it is cycled with 00000. If the cycle time is 80 ms and 00000 remains ON for 2.0 seconds, this move operation will be performed 25 times and only the last value moved to DM 0000 will be preserved there.
In diagram B, the differentiated @MOV(21) will move the content of HR 10 to DM
0000 only once after 00000 goes ON. Even if 00000 remains ON for 2.0 seconds with the same 80 ms cycle time, the move operation will be executed only once during the first cycle in which 00000 has changed from OFF to ON. Because the content of HR 10 could very well change during the 2 seconds while 00000 is
ON, the final content of DM 0000 after the 2 seconds could be different depending on whether MOV(21) or @MOV(21) was used.
All operands, ladder diagram symbols, and other specifications for instructions are the same regardless of whether the differentiated or non-differentiated form of an instruction is used. When inputting, the same function codes are also used, but NOT is input after the function code to designate the differentiated form of an instruction. Most, but not all, instructions have differentiated forms.
Refer to 5-9 INTERLOCK and INTERLOCK CLEAR – IL(02) and IL(03) for the effects of interlocks on differentiated instructions.
The C200H also provides differentiation instructions: DIFU(13) and DIFD(14).
DIFU(13) operates the same as a differentiated instruction, but is used to turn
ON a bit for one cycle. DIFD(14) also turns ON a bit for one cycle, but does it when the execution condition has changed from ON to OFF. Refer to 5-8-2 DIF-
FERENTIATE UP and DOWN - DIFU(13) and DIFD(14) for details.
Note If SR 25313 (Always ON Flag) or SR 25315 (First Cycle Bit) are used as input bits for differentiated instructions, because there is no rising edge, the differentiated instruction will not be executed. Do not use SR 25313 or SR 25315 as input bits for differentiated instructions.
5-5 Coding Right-hand Instructions
Writing mnemonic code for ladder instructions is described in Section 4 Writing
and Inputting the Program. Converting the information in the ladder diagram symbol for all other instructions follows the same pattern, as described below, and is not specified for each instruction individually.
The first word of any instruction defines the instruction and provides any definers. If the instruction requires only a signal bit operand with no definer, the bit operand is also placed on the same line as the mnemonic. All other operands are placed on lines after the instruction line, one operand per line and in the same order as they appear in the ladder symbol for the instruction.
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 instruction 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 function code, which will be necessary when inputting the instruction via the Programming 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
00002
00001
00100 00200
01001 01002 LR 6300
00005
TIM 000
HR 0015
22500
DIFU(13) 22500
BCNT(67)
#0001
004
HR 00
TIM 000
#0150
MOV(21)
HR 00
LR 00
00500
Address Instruction Data
00000 LD 00000
00001 AND 00001
00002 OR
00003 DIFU(13)
00004 LD
00005 AND NOT
00002
22500
00100
00200
00006 LD
00007 AND NOT
00008 AND NOT LR
00009 OR LD
00010 AND
00011 BCNT(67)
#
01001
01002
6300
--
22500
--
0001
00012
00013
00014
00015
00016
00017
LD
TIM
LD
MOV(21)
LD
OUT NOT
HR
#
TIM
HR
LR
HR
004
00
00005
000
0150
000
--
00
00
0015
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
00000 00001
00002
00100 00200
01001 01002 LR 6300
HR 0015
Section 5-5
22500
‘logic blocks’ that are combined by the right-hand instruction. An example of this for SFT(10) is shown below.
I
P
R
SFT(10)
HR 00
HR 00
00500
Address Instruction Data
00000 LD 00000
00001 AND
00002 LD
00003 LD
00001
00002
00100
00004
00005
00006
00007
AND NOT
LD
AND NOT
AND NOT
00008 OR LD
00009 AND
00010 SFT(10)
00011 LD
00012 OUT NOT
LR
HR
HR
HR
00200
01001
01002
6300
--
22500
--
00
00
0015
00500
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
5-6 Instruction Set Lists
This section provides tables of the instructions available in the C200H. The first table can be used to find instructions by function code. The second table can be used to find instruction by mnemonic. In both tables, the @ symbol indicates instructions with differentiated variations.
5-6-1 Function Codes
The following table lists the instructions that have function codes. Each instruction is listed by mnemonic and by instruction name. Use the numbers in the leftmost column as the leftmost digit and the number in the column heading as the rightmost digit of the function code.
Code
0
1
2
3
4
5
6
7
8
9
0
NOP
NO
OPERATION
SFT
SHIFT
REGISTER
CMP
COMPARE
(@) ADD
BCD ADD
(@) STC
SET CARRY
(@) ADB
BINARY ADD
CMPL
DOUBLE
COMPARE
(@) XFER
BLOCK
TRANSFER
(@) DIST
SINGLE
WORD
DISTRIBUTE
(@) SEND
NETWORK
SEND
END
END
KEEP
KEEP
1
(@) MOV
MOVE
(@) SUB
BCD
SUBTRACT
(@) CLC
CLEAR
CARRY
(@) SBB
BINARY
SUBTRACT
(@) MPRF
GROUP-2
HIGH-DEN-
SITY I/O RE-
FRESH
(@) BSET
BLOCK SET
(@) COLL
DATA
COLLECT
(@) SBS
SUBROU-
TINE
ENTRY
2
IL
INTERLOCK
CNTR
REVERS-
IBLE
COUNTER
(@) MVN
MOVE NOT
(@) MUL
BCD
MULTIPLY
(@) MLB
BINARY
MULTIPLY
(@) ROOT
SQUARE
ROOT
(@) MOVB
MOVE BIT
SBN
SUBROU-
TINE
DEFINE
3
ILC
INTERLOCK
CLEAR
DIFU
DIFFEREN-
TIATE UP
(@) BIN
BCD TO
BINARY
(@) DIV
BCD
DIVIDE
(@) DVB
BINARY
DIVIDE
(@) CTW
COLUMN-
TO-WORD
(@) XCHG
DATA
EXCHANGE
(@) MOVD
MOVE DIGIT
RET
SUBROU-
TINE
RETURN
JUMP
JUMP
Rightmost digit
4 5
JME
JUMP END
DIFD
DIFFEREN-
TIATE DOWN
TIMH
HIGH-
SPEED
TIMER
(@) ASL
SHIFT LEFT
(@) BCD
BINARY TO
BCD
(@) ANDW
LOGICAL
AND
(@) ORW
LOGICAL OR
(@) ADDL
DOUBLE
BCD ADD
(@) WTC
WORD-TO-
COLUMN
(@) SLD
ONE DIGIT
SHIFT LEFT
(@) SFTR
REVERS-
IBLE SHIFT
REGISTER
(@) WDT
WATCHDOG
TIMER
REFRESH
(@) SUBL
DOUBLE
BCD
SUBTRACT
(@) HTS
HOURS-TO-
SECONDS
(@) SRD
ONE DIGIT
SHIFT
RIGHT
(@) TCMP
TABLE
COMPARE
6
(@) FAL
FAILURE
ALARM AND
RESET
(@) WSFT
WORD
SHIFT
(@) ASR
SHIFT
RIGHT
(@) XORW
EXCLUSIVE
OR
(@) MSG
MESSAGE
DISPLAY
(@) MULL
DOUBLE
BCD
MULTIPLY
(@) STH
SECONDS-
TO-HOURS
(@) MLPX
4-TO-16
DECODER
(@) ASC
ASCII
CONVERT
7
FALS
SEVERE
FAILURE
ALARM
(@) RWS
REVERS-
IBLE WORD
SHIFT
(@) ROL
ROTATE
LEFT
(@) XNRW
EXCLUSIVE
NOR
(@) LMSG
LONG
MESSAGE
(@) DIVL
DOUBLE
BCD
DIVIDE
(@) BCNT
BIT
COUNTER
(@) DMPX
16-TO-4
ENCODER
(@) IORF
I/O
REFRESH
8
STEP
STEP
DEFINE
(@) SCAN
CYCLE TIME
(@) ROR
ROTATE
RIGHT
(@) INC
INCREMENT
(@) TERM
TERMINAL
MODE
(@) BINL
DOUBLE
BCD-TO-
DOUBLE
BINARY
(@) BCMP
BLOCK
COMPARE
(@) SDEC
7-SEGMENT
DECODER
(@) RECV
NETWORK
RECEIVE
9
SNXT
STEP START
(@) MCMP
MULTI-
WORD
COMPARE
(@) COM
COMPLE-
MENT
(@) DEC
DECRE-
MENT
SYS
SET
SYSTEM
(@) BCDL
DOUBLE
BINARY-TO-
DOUBLE
BCD
(@) VCAL
VALUE
CALCULATE
(@) FDIV
FLOATING
POINT
DIVIDE
(@) INT
INTERRUPT
CONTROL
100
Instruction Set Lists
5-6-2 Alphabetic List by Mnemonic
Mnemonic Code
ADB (@)
AND
AND LD
50
ADD (@) 30
ADDL (@) 54
None
None
BINARY ADD
BCD ADD
Name
DOUBLE BCD ADD
AND
AND LOAD
AND NOT None AND NOT
ANDW (@) 34 LOGICAL AND
ASC (@)
ASL (@)
ASR (@)
BCD (@)
86
25
26
24
BCDL (@) 59
ASCII CONVERT
ARITHMETIC SHIFT LEFT
ARITHMETIC SHIFT RIGHT
BINARY TO BCD
BCMP (@) 68
BCNT (@) 67
BIN (@)
BINL (@)
23
58
BSET (@) 71
CLC (@) 41
CMP
CMPL
20
60
CNT
CNTR
DOUBLE BINARY-TO-DOUBLE
BCD
BLOCK COMPARE
BIT COUNTER
BCD-TO-BINARY
DOUBLE BCD-TO-DOUBLE
BINARY
BLOCK SET
CLEAR CARRY
COMPARE
DOUBLE COMPARE
None COUNTER
12 REVERSIBLE COUNTER
COLL (@) 81
COM (@) 29
CTW (@)
DEC (@)
63
39
DIFD
DIFU
14
13
DIST (@)
DIV (@)
80
33
DIVL (@) 57
DMPX (@) 77
DVB (@)
END
53
01
FAL (@)
FALS
FDIV (@)
HTS (@)
IL
ILC
06
07
79
65
02
03
DATA COLLECT
COMPLEMENT
COLUMN-TO-WORD
DECREMENT BCD
DIFFERENTIATE DOWN
DIFFERENTIATE UP
SINGLE WORD DISTRIBUTE
BCD DIVIDE
DOUBLE BCD DIVIDE
16-TO-4 ENCODER
BINARY DIVIDE
END
FAILURE ALARM
SEVERE FAILURE ALARM
FLOATING POINT DIVIDE
HOURS-TO-SECONDS
INTERLOCK
INTERLOCK CLEAR
Section 5-6
Mnemonic Code
INC (@)
INT (@)
38
89
IORF (@) 97
JME 05
JMP
KEEP
04
11
Name
INCREMENT
INTERRUPT CONTROL
I/O REFRESH
JUMP END
JUMP
KEEP
LD
LD NOT
None LOAD
None LOAD NOT
LMSG (@) 47
MCMP (@) 19
LONG MESSAGE
MULTI-WORD COMPARE
MLB (@) 52
MLPX (@) 76
MOV (@) 21
MOVB (@) 82
MOVD (@) 83
MPRF (@) 61
BINARY MULTIPLY
4-TO-16 DECODER
MOVE
MOVE BIT
MSG (@)
MUL (@)
46
32
MULL (@) 56
MOVE DIGIT
GROUP-2 HIGH-DENSITY I/O
REFRESH
MESSAGE
BCD MULTIPLY
DOUBLE BCD MULTIPLY
MVN (@)
NOP
OR
22
00
MOVE NOT
NO OPERATION
None OR
OR LOAD None OR LOAD
OR NOT None OR NOT
ORW (@) 35
OUT None
LOGICAL OR
OUTPUT
OUT NOT None OUTPUT NOT
RECV (@) 98 NETWORK RECEIVE
RET
ROL (@)
93
27
SUBROUTINE RETURN
ROTATE LEFT
ROOT (@) 72
ROR (@) 28
RWS (@)
SBB (@)
17
51
SQUARE ROOT
ROTATE RIGHT
REVERSIBLE WORD SHIFT
BINARY SUBTRACT
SBN
SBS (@)
92
91
SCAN (@) 18
SDEC (@) 78
SEND (@) 90
SFT 10
SFTR (@) 84
SUBROUTINE DEFINE
SUBROUTINE ENTRY
CYCLE TIME
7-SEGMENT DECODER
NETWORK SEND
SHIFT REGISTER
REVERSIBLE SHIFT REGISTER
101
Ladder Diagram Instructions
Mnemonic Code
SLD (@)
SNXT
74
09
SRD (@)
STC (@)
STEP
STH (@)
75
40
08
66
SUB (@) 31
SUBL (@) 55
SYS 49
TCMP (@) 85
TERM (@) 48
Name
ONE DIGIT SHIFT LEFT
STEP START
ONE DIGIT SHIFT RIGHT
SET CARRY
STEP DEFINE
SECONDS-TO-HOURS
BCD SUBTRACT
DOUBLE BCD SUBTRACT
SET SYSTEM
TABLE COMPARE
TERMINAL MODE
Mnemonic Code
TIM
TIMH
None
15
TIMER
Name
HIGH-SPEED TIMER
VCAL (@) 69
WDT (@) 94
WSFT (@) 16
WTC (@) 64
VALUE CALCULATE
WATCHDOG TIMER REFRESH
WORD SHIFT
WORD-TO-COLUMN
XCHG (@) 73
XFER (@) 70
XNRW (@) 37
XORW (@) 36
DATA EXCHANGE
BLOCK TRANSFER
EXCLUSIVE NOR
EXCLUSIVE OR
5-7 Ladder Diagram Instructions
Ladder Diagram instructions include Ladder instructions and Logic Block instructions and correspond to the conditions on the ladder diagram. Logic block instructions are used to relate more complex parts.
5-7-1 LOAD, LOAD NOT, AND, AND NOT, OR, and OR NOT
Ladder Symbols Operand Data Areas
LOAD – LD
B B: Bit
IR, SR, AR, HR, TC, LR, TR
LOAD NOT – LD NOT
AND – AND
AND NOT – AND NOT
OR – OR B
B
B
B
B: Bit
IR, SR, AR, HR, TC, LR
B: Bit
IR, SR, AR, HR, TC, LR
B: Bit
IR, SR, AR, HR, TC, LR
B: Bit
IR, SR, AR, HR, TC, LR
OR NOT – OR NOT B
B: Bit
IR, SR, AR, HR, TC, LR
Limitations
Description
Section 5-7
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.
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.
Flags There are no flags affected by these instructions.
5-7-2 AND LOAD and OR LOAD
AND LOAD – AND LD
Ladder Symbol
00000
00001
00002
00003
OR LOAD – OR LD
Ladder Symbol
00000
00002
00001
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 condition, 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 understanding of logic block instructions is required. For an introduction to logic blocks, refer to 4-4-6 Logic Block Instructions.
There are no flags affected by these instructions.
Flags
5-8 Bit Control Instructions
There are five instructions that can be used generally to control individual bit status. These are OUT, OUT NOT, DIFU(13), DIFD(14), and KEEP(11). These instructions are used to turn bits ON and OFF in different ways.
103
Bit Control Instructions Section 5-8
5-8-1 OUTPUT and OUTPUT NOT – OUT and OUT NOT
OUTPUT – OUT
Ladder Symbol Operand Data Areas
B
B: Bit
IR, SR, AR, HR, TC, LR, TR
OUTPUT NOT – OUT NOT
Ladder Symbol
B
Operand Data Areas
B: Bit
IR, SR, AR, HR, TC, LR
Limitations
Description
Any output bit can generally be used in only one instruction that controls its status. Refer to 3-3 IR Area for details.
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 execution 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.
Flags There are no flags affected by these instructions.
5-8-2 DIFFERENTIATE UP and DOWN – DIFU(13) and DIFD(14)
Ladder Symbols Operand Data Areas
DIFU(13) B
B: Bit
IR, AR, HR, LR
Limitations
Description
DIFD(14) B
B: Bit
IR, AR, HR, LR
Any output bit can generally be used in only one instruction that controls its status. Refer to 3-3 IR Area for details.
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 current 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 designated 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. Examples of these are shown below.
Flags
Precautions
Example 1:
When There is No
Differentiated Instruction
There are no flags affected by these instructions.
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. Refer 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.
In diagram A, below, whenever CMP(20) is executed with an ON execution condition it will compare the contents of the two operand words (HR 10 and DM
0000) and set the arithmetic flags (GR, EQ, and LE) accordingly. If the execution condition remains ON, flag status may be changed each cycle if the content of one or both operands change. Diagram B, however, is an example of how
DIFU(13) can be used to ensure that CMP(20) is executed only once each time the desired execution condition goes ON.
00000
00000
22500
Diagram A
Diagram B
CMP(20)
HR 10
DM 0000
DIFU(13) 22500
CMP(20)
HR 10
DM 0000
Address Instruction
00000 LD
00001 CMP(20)
HR
DM
Operands
00000
10
0000
Address Instruction
00000 LD
00001 DIFU(13)
00002 LD
00003 CMP(20)
HR
DM
Operands
00000
22500
22500
10
0000
Example 2:
Simplifying Programming
Although a differentiated form of MOV(21) is available, the following diagram would be very complicated to draw using it because only one of the conditions
105
Bit Control Instructions Section 5-8 determining the execution condition for MOV(21) requires differentiated treatment.
00000
22500
00001 00002 00003
00004 00005
DIFU(13) 22500
MOV(21)
HR 10
DM 0000
Address Instruction Operands
00000 LD
00001 DIFU(13)
00002 LD
00003 LD
00000
22500
22500
00001
00004 AND NOT
00005 AND NOT
00006 OR LD
00002
00003
---
00007 LD 00004
00008 AND NOT 00005
00009 OR LD
00010 MOV(21)
---
HR
DM
10
0000
5-8-3 KEEP – KEEP(11)
Ladder Symbol
S
R
KEEP(11)
B
Operand Data Areas
B: Bit
IR, AR, HR, LR
Limitations
Description
Any output bit can generally be used in only one instruction that controls its status. Refer to 3-3 IR Area for details.
KEEP(11) is used to maintain the status of the designated bit based on two execution 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, regardless 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
KEEP(11) operates like the self-maintaining bit described in 4-8-3 Self-maintain-
ing Bits. The following two diagrams would function identically, though the one
106
Bit Control Instructions
00002 00003
00500
Section 5-8 using KEEP(11) requires one less instruction to program and would maintain status even in an interlocked program section.
00500
Address Instruction
00000 LD
00001 OR
00002 AND NOT
00003 OUT
Operands
00002
00500
00003
00500
00002
00003
S
R
KEEP(11)
B
Address Instruction
00000 LD
00001 LD
00002 KEEP(11)
Operands
00002
00003
00500
Flags
Precautions
Example
There are no flags affected by this instruction.
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 reset (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 situation is shown below.
A
Input Unit
NEVER
A
S
R
KEEP(11)
B
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.
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 emergency 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)
00002
00003
00004
Reset input
00005
Indicates emergency situation
Section 5-9 indicates an emergency situation, is used to turn ON the warning indicator through 00500.
S
KEEP(11)
B
R
Address Instruction
00000 LD
00001 OR
00002 OR
00003 LD
00004 KEEP(11)
00005 LD
00006 OUT
HR
HR
Operands
00002
00003
00004
00005
0000
0000
00500
HR 0000
00500
Activates 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.
5-9 INTERLOCK and INTERLOCK CLEAR – IL(02) and ILC(03)
Ladder Symbol
IL(02)
Description
DIFU(13) and DIFD(14) in
Interlocks
Ladder Symbol
ILC(03)
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
OUT and OUT NOT
TIM and TIMH(15)
CNT, CNTR(12)
KEEP(11)
DIFU(13) and DIFD(14)
All others
Treatment
Designated bit turned OFF.
Reset.
PV maintained.
Bit status maintained.
Not executed (see below).
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).
Changes in the execution condition for a DIFU(13) or DIFD(14) are not recorded if the DIFU(13) or DIFD(14) is in an interlocked section and the execution condition for the IL(02) is OFF. When DIFU(13) or DIFD(14) is execution in an interlocked 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
00001
A
IL(02)
DIFU(13) 01000
ILC(03)
Address Instruction
00000 LD
00001 IL(02)
00002 LD
00003 DIFU(13)
00004 ILC(03)
Operands
00000
00001
01000
00000
00001
01000
ON
OFF
ON
OFF
ON
OFF
Precautions
Flags
Example
00000
00001
00002
00003
00100
00005
00004
There must be an ILC(03) following any one or more IL(02).
Although as many IL(02) instructions as are necessary can be used with one
ILC(03), ILC(03) instructions cannot be used consecutively without at least one
IL(02) in between, i.e., nesting is not possible. Whenever a ILC(03) is executed, all interlocks between the active ILC(03) and the preceding ILC(03) are cleared.
When more than one IL(02) is used with a single ILC(03), an error message will appear when the program check is performed, but execution will proceed normally.
There are no flags affected by these instructions.
The following diagram shows IL(02) being used twice with one ILC(03).
IL(02)
#0015 001.5 s
IL(02)
CP
R
CNT
001
IR 010
00502
ILC(03)
Address Instruction
00000 LD
00001 IL(02)
00002 LD
00003 TIM
00004 LD
00005 IL(02)
00006 LD
00007 AND NOT
00008 CNT
00009 LD
00010 OUT
00011 ILC(03)
#
Operands
00000
00001
511
0015
00002
00003
00004
001
010
00005
00502
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
5-10 JUMP and JUMP END – JMP(04) and JME(05)
Ladder Symbols Definer Values
JMP(04) N
N: Jump number
# (00 to 99)
Limitations
Description
DIFU(13) and DIFD(14) in
Jumps
Precautions
JME(05) N
N: Jump number
# (00 to 99)
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.
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 program 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 instructions 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, because all jumps made to them will end at the first JME(05) 00.
Although DIFU(13) and DIFD(14) are designed to turn ON the designated bit for 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 programming, 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.
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 properly as written.
There are no flags affected by these instructions.
Flags
110
Timer and Counter Instructions
Examples Examples of jump programs are provided in 4-7-8 Jumps.
5-11 END – END(01)
Ladder Symbol
END(01)
Section 5-13
Description
Flags
END(01) is required as the last instruction in any program. If there are subroutines, 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 program, 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.
END(01) turns OFF the ER, CY, GR, EQ, and LE flags.
5-12 NO OPERATION – NOP(00)
Description NOP(00) is not generally required in programming and there is no ladder symbol for it. When NOP(00) is found in a program, nothing is executed and the program execution moves to the next instruction. When memory is cleared prior to programming, NOP(00) is written at all addresses. NOP(00) can be input through the 00 function code.
Flags There are no flags affected by NOP(00).
5-13 Timer and Counter Instructions
TIM and TIMH are decrementing ON-delay timer instructions which require a TC number and a set value (SV).
CNT is a decrementing counter instruction and CNTR is a reversible counter instruction. Both require a TC number and a SV. Both are also connected to multiple instruction lines which serve as an input signal(s) and a reset.
Any one TC number cannot be defined twice, i.e., once it has been used as the definer in any of the timer or counter instructions, it cannot be used again. Once defined, TC numbers can be used as many times as required as operands in instructions other than timer and counter instructions.
TC numbers run from 000 through 511. No prefix is required when using a TC number as a definer in a timer or counter instruction. Once defined as a timer, a
TC number can be prefixed with TIM for use as an operand in certain instructions. The TIM prefix is used regardless of the timer instruction that was used to define the timer. Once defined as a counter, a TC number can be prefixed with
CNT for use as an operand in certain instructions. The CNT is also used regardless of the counter instruction that was used to define the counter.
TC numbers can be designated as operands that require either bit or word data.
When designated as an operand that requires bit data, the TC number accesses a bit that functions as a ‘Completion Flag’ that indicates when the time/count has expired, i.e., the bit, which is normally OFF, will turn ON when the designated SV has expired. When designated as an operand that requires word data, the TC number accesses a memory location that holds the present value (PV) of the timer or counter. The PV of a timer or counter can thus be used as an operand in
CMP(20), or any other instruction for which the TC area is allowed. This is done by designating the TC number used to define that timer or counter to access the memory location that holds the PV.
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 externally, must be in BCD.
5-13-1 TIMER – TIM
Limitations
Description
Ladder Symbol
Definer Values
N: TC number
# (000 through 511)
TIM N
SV Operand Data Areas
SV: Set value (word, BCD)
IR, AR, DM, HR, LR, #
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.
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.
Execution condition
ON
OFF
Completion Flag
ON
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
Flags
Examples
Example 1:
Basic Application
00000
TIM 000
00001
TIM 001
Example 2:
Extended Timers
00000
TIM 001
TIM 002
Example 3:
ON/OFF Delays
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.
ER: SV is not in BCD.
Indirectly addressed DM word is non-existent. (Content of * DM word is not BCD, or the DM area boundary has been exceeded.)
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 diagrams cannot be modified to control execution of other instructions.
The following example shows two timers, one set with a constant and one set via 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.
TIM 000
#0150 015.0 s
00200
TIM 001
IR 005
IR 005
00201
Address Instruction
00000 LD
00001 TIM
00002 LD
00003 OUT
00004 LD
00005 TIM
00006 AND NOT
00007 OUT
#
Operands
TIM
TIM
00000
000
0150
000
00200
00001
001
005
001
00200
There are two ways to achieve timers that operate for longer than 999.9 seconds. 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-second (15-minute) timers combined to functionally form a 30-minute timer.
TIM 001
#9000
900.0 s
TIM 002
#9000 900.0 s
00200
Address Instruction
00000 LD
00001 TIM
00002 LD
00003 TIM
00004 LD
00005 OUT
#
TIM
#
Operands
TIM
00000
001
9000
001
002
9000
002
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.
TIM can be combined with KEEP(11) to delay turning a bit ON and OFF in reference 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 bit whose manipulation is to be delayed is used in KEEP(11). Turning ON and
OFF the bit designated for KEEP(11) is thus delayed by the SV for the two TIM.
The two SV could naturally be the same if desired.
In the following example, 00500 would be turned ON 5.0 seconds after 00000 goes ON and then turned OFF 3.0 seconds after 00000 goes OFF. It is necessary to use both 00500 and 00000 to determine the execution condition for TIM
002; 00000 in an inverse condition is necessary to reset TIM 002 when 00000 goes ON and 00500 is necessary to activate TIM 002 (when 00000 is OFF).
00000
00500 00000
TIM 001
TIM 002
TIM 001
#0050 005.0 s
TIM 002
#0030
003.0 s
S
R
KEEP(11)
00500
Address Instruction
00000 LD
00001 TIM
00002 LD
00003 AND NOT
00004 TIM
00005 LD
00006 LD
00007 KEEP(11)
#
#
TIM
TIM
Operands
00000
001
0050
00500
00000
002
0030
001
002
00500
00000
00500
Example 4:
One-Shot Bits
01000 TIM 001
00000
01000
01000 TIM 001
5.0 s 3.0 s
The length of time that a bit is kept ON or OFF can be controlled by combining
TIM with OUT or OUT NO. The following diagram demonstrates how this is possible. 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 condition, creates an OFF execution condition for OUT 00204).
01000
TIM 001
#0015 001.5 s
00204
Address Instruction
00000 LD
00001 AND NOT
00002 OR
00003 OUT
00004 LD
00005 TIM
00006 LD
00007 AND NOT
00008 OUT
TIM
#
Operands
TIM
01000
001
00000
01000
01000
001
0015
01000
001
00204
00000
00204
1.5 s 1.5 s
114
Timer and Counter Instructions
The following one-shot timer may be used to save memory.
Section 5-13
00000
00100 TIM 001
TIM 001
#0015 001.5 s
00100
Address Instruction
00000 LD
00001 OR
00002 TIM
00003 AND NOT
00004 OUT
#
Operands
TIM
00000
00100
001
0015
001
00100
Example 5:
Flicker Bits
Bits can be programmed to turn ON and OFF at regular intervals while a designated 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 specified 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 TIM 002
TIM 001
TIM 001
TIM 001
#0010
1.0 s
Address Instruction
00000 LD
00001 AND NOT
00002 TIM
TIM 002
#0015 1.5 s
00205
00003 LD
00004 TIM
00005 LD
00006 OUT
Operands
TIM
#
TIM
#
TIM
00000
002
001
0010
001
002
0015
001
00205
00000
00205
00000 25502
1.0 s 1.5 s 1.0 s 1.5 s
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.
00206
Address Instruction
00000 LD
00001 LD
00002 OUT
Operands
00000
25502
00206
115
Timer and Counter Instructions
5-13-2 HIGH-SPEED TIMER – TIMH(15)
Section 5-13
Ladder Symbol
Definer Values
N: TC number
# (000 through 015 preferred)
TIMH(15) N
SV Operand Data Areas
SV: Set value (word, BCD)
IR, AR, DM, HR, LR, #
Limitations
Description
Precautions
Flags
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.
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.
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.
ER: SV is not in BCD.
Indirectly addressed DM word is non-existent. (Content of
*
DM word is not BCD, or the DM area boundary has been exceeded.)
5-13-3 COUNTER – CNT
Limitations
Ladder Symbol
Definer Values
N: TC number
# (000 through 511)
CP
R
CNT N
SV Operand Data Areas
SV: Set value (word, BCD)
IR, AR, DM, HR, LR, #
Each TC number can be used as the definer in only one TIMER or COUNTER instruction.
116
Timer and Counter Instructions
Description
Section 5-13
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 decremented 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 illustrated below. PV line height is meant only to indicate changes in the PV.
Execution condition on count pulse (CP)
Execution condition on reset (R)
Completion Flag
ON
OFF
ON
OFF
ON
OFF
PV
SV
SV – 1
SV – 2
0002
0001
0000
SV
Precautions
Flags
Example 1:
Basic Application
Program execution will continue even if a non-BCD SV is used, but the SV will not be correct.
ER: SV is not in BCD.
Indirectly addressed DM word is non-existent. (Content of
*
DM word is not BCD, or the DM area boundary has been exceeded.)
In the following example, the PV will be decremented whenever both 00000 and
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
00002
CNT 004
00001
CP
R
CNT 004
#0150
00205
Address Instruction
00000 LD
00001 AND
00002 LD
00003 CNT
00004 LD
00005 OUT
#
Operands
CNT
00000
00001
00002
0004
0150
004
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
00000
00002
00001
25315
Example 2:
Extended Counter
00000 00001
00002
CNT 001
CNT 002
CNT 001
00002
CNT 002
CNT 004
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.
CP
R
CNT 004
#0150
00205
Address Instruction
00000 LD
00001 AND
00002 LD
00003 OR
00004 CNT
00005 LD
00006 OUT
#
Operands
CNT
00000
00001
00002
25315
004
0150
004
00205
Counters that can count past 9,999 can be programmed by using one CNT to 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 Completion Flag for CNT 001 goes ON. Bit 00002 serves as a reset for the entire extended counter, resetting both CNT 001 and CNT 002 when it is OFF. The Completion Flag for CNT 002 is also used to reset CNT 001 to inhibit CNT 001 operation, 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.
CP
R
CP
R
CNT 001
#0100
CNT 002
#0200
Address Instruction
00000 LD
00001 AND
00002 LD NOT
00003 OR
00004 OR
00005 CNT
00006 LD
00007 LD NOT
00008 CNT
00009 LD
00010 OUT
CNT
CNT
#
CNT
#
Operands
CNT
00000
00001
00002
001
002
001
0100
001
00002
002
0200
002
00203
00203
Example 3:
Extended Timers
CNT can be used in sequence as many times as required to produce counters capable of counting any desired values.
CNT can be used to create extended timers in two ways: by combining TIM with
CNT and by counting SR area clock pulse bits.
In the following example, CNT 002 counts the number of times TIM 001 reaches zero from its SV. The Completion Flag for TIM 001 is used to reset TIM 001 so that it runs continuously and CNT 002 counts the number of times the Completion Flag for TIM 001 goes ON (CNT 002 would be executed once each time be-
118
Timer and Counter Instructions
00000 TIM 001 CNT 002
TIM 001
00001
CNT 002
00000 25502
00001
CNT 001
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.
CP
R
TIM 001
#0050 005.0 s
CNT
002
#0100
00201
Address Instruction
00000 LD
00001 AND NOT
00002 AND NOT
00003 TIM
00004 LD
00005 LD
00006 CNT
00007 LD
00008 OUT
TIM
CNT
#
TIM
#
Operands
CNT
00000
001
002
001
0050
001
00001
002
0100
002
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 control 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.
CP
R
CNT
001
#0700
0202
Address Instruction
00000 LD
00001 AND
00002 LD NOT
00003 CNT
00004 LD
00005 OUT
#
Operands
CNT
00000
25502
00001
001
0700
001
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 particular, the 0.02-second and 0.1-second clock pulses should not be used to create timers with CNT instructions.
5-13-4 REVERSIBLE COUNTER – CNTR(12)
Ladder Symbol
Definer Values
N: TC number
# (000 through 511)
II
DI
R
CNTR(12)
N
SV
Operand Data Areas
SV: Set value (word, BCD)
IR, AR, DM, HR, LR, #
119
Timer and Counter Instructions
Limitations
Description
Section 5-13
Each TC number can be used as the definer in only one TIMER or COUNTER instruction.
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 executed 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 execution 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 Completion 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 increment (II)
Execution condition on decrement (DI)
Completion Flag
ON
OFF
ON
OFF
ON
OFF
PV
SV – 2
SV – 1
SV
0000
0001
0000
SV
SV – 1
SV – 2
Precautions
Flags
Program execution will continue even if a non-BCD SV is used, but the SV will not be correct.
ER: SV is not in BCD.
Indirectly addressed DM word is non-existent. (Content of
*
DM word is not BCD, or the DM area boundary has been exceeded.)
120
Data Shifting Section 5-14
5-14 Data Shifting
All of the instructions described in this section are used to shift data, but in differing amounts and directions. The first shift instruction, SFT(10), shifts an execution condition into a shift register; the rest of the instructions shift data that is already in memory.
5-14-1 SHIFT REGISTER – SFT(10)
Ladder Symbol
I
P
R
SFT(10)
St
E
Operand Data Areas
St: Starting word
IR, AR, HR, LR
E: End word
IR, AR, HR, LR
Limitations
Description
E
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 instruction that controls individual bit status (e.g., OUT, KEEP(11)), an error
(“COIL DUPL”) will be generated when program syntax is checked on the Programming 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.
SFT(10) is controlled by three execution conditions, I, P, and R. If SFT(10) is executed and 1) execution condition P is ON and was OFF the last execution, and 2) R is OFF, then execution condition I is shifted into the rightmost bit of a shift register defined between St and E, i.e., if I is ON, a 1 is shifted into the register; if I is OFF, a 0 is shifted in. When I is shifted into the register, all bits previously in the register are shifted to the left and the leftmost bit of the register is lost.
St+1, St+2, ...
St
Lost data
Flags
Execution condition I
The execution condition on P functions like a differentiated instruction, i.e., I will be shifted into the register only when P is ON and was OFF the last time SFT(10) was executed. If execution condition P has not changed or has gone from ON to
OFF, the shift register will remain unaffected.
St designates the rightmost word of the shift register; E designates the leftmost.
The shift register includes both of these words and all words between them. The same word may be designated for St and E to create a 16-bit (i.e., 1-word) shift register.
When execution condition R goes ON, all bits in the shift register will be turned
OFF (i.e., set to 0) and the shift register will not operate until R goes OFF again.
There are no flags affected by SFT(10).
121
Data Shifting
Example 1:
Basic Application
00005
25502
00006
Section 5-14
The following example uses the 1-second clock pulse bit (25502) so that the execution condition produced by 00005 is shifted into a 3-word register between
IR 010 and IR 012 every second.
I
P
R
SFT(10)
010
012
Address Instruction
00000 LD
00001 LD
00002 LD
00003 SFT(10)
Operands
00005
25502
00006
010
012
Example 2:
Controlling Bits in Shift
Registers
The following program is used to control the status of the 17th bit of a shift register running from AR 00 through AR 01. When the 17th bit is to be set, 00004 is 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.
00004
12800
12800
00200 00201
00202
00203
I
P
SFT(10)
AR 00
AR 01
R
DIFU(13) 12800
JMP(04) 00
AR 0100
Address Instruction
00000 LD
00001 AND
00002 LD
00003 LD
00004 SFT(10)
00005 LD
00006 DIFU(13)
00007 LD
00008 JMP(04)
00009 LD
00010 OUT
00011 JME(05)
AR
AR
Operands
00200
00201
00202
00203
AR
00
01
00004
12800
12800
00
12800
0100
00
JME(05) 00
Example 3:
Control Action
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).
The following program controls the conveyor line shown below so that faulty products detected at the sensor are pushed down a shoot. To do this, the execution 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)
00001
00000
00003
HR 0003
00002
Rotary Encoder
(00000)
Sensor
(00002)
Chute
I
P
R
SFT(10)
HR 00
HR 01
00500
00500
Address Instruction
00000 LD
00001 LD
00002 LD
00003 SFT(10)
00004 LD
00005 OUT
00006 LD
00007 OUT NOT
00008 OUT NOT
HR
HR
HR
Operands
00001
00000
00003
HR
00
01
0003
00500
00002
00500
0003
HR 0003
5-14-2 REVERSIBLE SHIFT REGISTER – SFTR(84)
Limitations
Description
Ladder Symbols
SFTR(84)
C
St
E
@SFTR(84)
C
St
E
Operand Data Areas
C: Control word
IR, AR, DM, HR, LR
St: Starting word
IR, AR, DM, HR, LR
E: End word
IR, AR, DM, HR LR
St and E must be in the same data area and St must be less than or equal to E.
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
Flags
Example
00005
00006
00007
00008
00009
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)
Status to input into register
Shift pulse bit
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 reset bit (bit 15) is OFF, the entire shift register and CY will be set to zero.
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.)
CY: Receives the status of bit 00 of St or bit 15 of E, depending on the shift direction.
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.
05012
05013
05014
05015
Direction
Status to input
Shift pulse
Address Instruction
00000
00001
00002
00003
00004
00005
00006
00007
00008
00009
LD
OUT
LD
OUT
LD
OUT
LD
OUT
LD
@SFT(10)
Reset
LR
LR
Operands
00005
05012
00006
05013
00007
00514
00008
05015
00009
050
20
21
@SFTR(84)
050
LR 20
LR 21
124
Data Shifting
5-14-3 ARITHMETIC SHIFT LEFT – ASL(25)
ASL(25)
Wd
Ladder Symbols
@ASL(25)
Wd
Section 5-14
Operand Data Areas
Wd: Shift word
IR, AR, DM, HR, LR
Description When the execution condition is OFF, ASL(25) is not executed. When the execution 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.
CY
Bit
15
Bit
00
1 0 0 1 1 1 0 0 0 1 0 1 0 0 1 1
0
Flags ER: Indirectly addressed DM word is non-existent. (Content of * DM word is not BCD, or the DM area boundary has been exceeded.)
CY: Receives the status of bit 15.
EQ: ON when the content of Wd is zero; otherwise OFF.
5-14-4 ARITHMETIC SHIFT RIGHT – ASR(26)
ASR(26)
Wd
Ladder Symbols
@ASR(26)
Wd
Operand Data Areas
Wd: Shift word
IR, AR, DM, HR, LR
Description When the execution condition is OFF, ASR(25) is not executed. When the execution 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
15
1
Bit
00
1 0 0 1 0 1 1 0 0 1 1 0 0 1 0
CY
0
Flags ER: Indirectly addressed DM word is non-existent. (Content of
*
DM word is not BCD, or the DM area boundary has been exceeded.)
CY: Receives the data of bit 00.
EQ: ON when the content of Wd is zero; otherwise OFF.
5-14-5 ROTATE LEFT – ROL(27)
ROL(27)
Wd
Ladder Symbols
@ROL(27)
Wd
Operand Data Areas
Wd: Rotate word
IR, AR, DM, HR, LR
125
Data Shifting
Description
Section 5-14
When the execution condition is OFF, ROL(27) is not executed. When the execution 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.
CY
0
Bit
15
Bit
00
1 0 1 1 0 0 1 1 1 0 0 0 1 1 0 1
Precautions
Flags
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 execution ROL(27).
ER: Indirectly addressed DM word is non-existent. (Content of * DM word is not BCD, or the DM area boundary has been exceeded.)
CY: Receives the data of bit 15.
EQ: ON when the content of Wd is zero; otherwise OFF.
5-14-6 ROTATE RIGHT – ROR(28)
Ladder Symbols
ROR(28)
Wd
@ROR(28)
Wd
Operand Data Areas
Wd: Rotate word
IR, AR, DM, HR, LR
Description When the execution condition is OFF, ROR(28) is not executed. When the execution 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.
CY
0
Bit
15
Bit
00
0 1 0 1 0 1 0 0 0 1 1 1 0 0 0 1
Precautions
Flags
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 execution ROR(28).
ER: Indirectly addressed DM word is non-existent. (Content of
*
DM word is not BCD, or the DM area boundary has been exceeded.)
CY: Receives the data of bit 15.
EQ: ON when the content of Wd is zero; otherwise OFF.
5-14-7 ONE DIGIT SHIFT LEFT – SLD(74)
SLD(74)
St
E
Ladder Symbols
@SLD(74)
St
E
Operand Data Areas
St: Starting word
IR, AR, DM, HR, LR
E: End word
IR, AR, DM, HR, LR
126
Data Shifting
Limitations
Description
Precautions
Flags
Section 5-14
St and E must be in the same data area, and E must be greater than or equal to
St.
When the execution condition is OFF, SLD(74) is not executed. When the execution 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
8 F C 5
...
St
D 7 9 1
Lost data 0
If a power failure occurs during a shift operation across more than 50 words, the shift operation might not be completed.
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.)
5-14-8 ONE DIGIT SHIFT RIGHT – SRD(75)
Ladder Symbols
SRD(75)
E
St
@SRD(75)
E
St
Operand Data Areas
E: End word
IR, AR, DM, HR, LR
St: Starting word
IR, AR, DM, HR, LR
Limitations
Description
Precautions
Flags
St and E must be in the same data area, and E must be less than or equal to St.
When the execution condition is OFF, SRD(75) is not executed. When the execution 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 rightmost digit of E is lost.
St
3 4 5 2
...
E
F 8 C 1
0 Lost data
If a power failure occurs during a shift operation across more than 50 words, the shift operation might not be completed.
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
5-14-9 WORD SHIFT – WSFT(16)
Ladder Symbols
WSFT(16)
St
E
@WSFT(16)
St
E
Section 5-14
Operand Data Areas
St: Starting word
IR, AR, DM, HR, LR
E: End word
IR, AR, DM, HR, LR
Limitations
Description
St and E must be in the same data area, and E must be greater than or equal to
St.
When the execution condition is OFF, WSFT(16) is not executed. When the execution 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.)
5-14-10 REVERSIBLE WORD SHIFT – RWS(17)
Ladder Symbols
Operand Data Areas
C: Control word
IR, SR, AR, DM, HR, TC, LR, #
RWS(17)
C
St
E
RWS(17)
C
St
E
St: Starting word
IR, AR, DM, HR, LR
E: End word
IR, AR, DM, HR, LR
Limitations
Description
St and E must be in the same data area, and E must be less than or equal to St.
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 between 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
Control Word
Flags
Example
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 register 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 lower 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.
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.
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.)
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.
HR 1213: OFF (Shift upward)
HR 1214: ON (Shift enabled)
HR 1215: OFF (Reset OFF)
DM 0100
DM 0101
DM 0102
DM 0103
DM 0104
DM 0105
DM 0106
DM 0107
DM 0108
DM 0109
DM 0110
Before execution
After execution
1234
0000
0000
2345
3456
0000
4567
5678
6789
0000
789A
0000
1234
0000
2345
0000
3456
4567
5678
0000
6789
789A
5-15 Data Movement
This section describes the instructions used for moving data between different addresses in data areas. These movements can be programmed to be within the same data area or between different data areas. Data movement is essential for utilizing all of the data areas of the PC. Effective communications in Link Systems also requires data movement. All of these instructions change only the content of the words to which data is being moved, i.e., the content of source words is the same before and after execution of any of the data movement instructions.
129
Data Movement
5-15-1 MOVE – MOV(21)
Ladder Symbols
MOV(21)
S
D
@MOV(21)
S
D
Section 5-15
Operand Data Areas
S: Source word
IR, SR, AR, DM, HR, TC, LR, #
D: Destination word
IR, AR, DM, HR, LR
Description When the execution condition is OFF, MOV(21) is not executed. When the execution condition is ON, MOV(21) copies the content of S to D.
Source word Destination word
Bit status not changed.
Precautions
Flags
TC numbers cannot be designated as D to change the PV of the timer or counter.
You can, however, easily change the PV of a timer or a counter by using
BSET(71).
ER: 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 all zeros are transferred to D.
5-15-2 MOVE NOT – MVN(22)
Ladder Symbols
MVN(22)
S
D
@MVN(22)
S
D
Operand Data Areas
S: Source word
IR, SR, AR, DM, HR, TC, LR, #
D: Destination word
IR, AR, DM, HR, LR
Description When the execution condition is OFF, MVN(22) is not executed. When the execution 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 corresponding bit in D is turned OFF, and for each OFF bit in S, the corresponding bit in D is turned ON.
Source word Destination word
Bit status inverted.
Precautions
Flags
TC numbers cannot be designated as D to change the PV of the timer or counter.
However, these can be easily changed using BSET(71).
ER: 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 all zeros are transferred to D.
130
Data Movement
5-15-3 COLUMN-TO-WORD – CTW(63)
Section 5-15
Ladder Symbols
CTW(63)
S
C
D
@CTW(63)
S
C
D
Operand Data Areas
S: First word of 16 word source set
IR, SR, AR, DM, HR, LR
C: Column bit designator (BCD)
IR, AR, DM, HR, TC, LR, #
D: Destination word
IR, AR, DM, HR, LR
Limitations
Description
C must be between #0000 and #0015.
When the execution condition is OFF, CTW(63) is not executed. When the execution 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).
S
S+1
S+2
S+3
.
.
.
C
Bit
15
Bit
00
0 0 0 0 1 1 1 0 0 0 1 0 0 0 0 1
1 1 0 1 0 0 1 0 0 1 1 1 0 0 0 1
0 0 0 1 1 0 1 1 0 0 1 0 0 1 1 1
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
D
Bit
15
0
. . .
0 1 1 1
Bit
00
Flags
Example
00000
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.)
EQ: ON when the content of D is zero; otherwise OFF.
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.
CTW(63)
100
#0007
DM 0100
Address Instruction
00000 LD
00001 CTW(63)
#
DM
Operands
00000
100
0007
0100
131
Data Movement
5-15-4 WORD-TO-COLUMN – WTC(64)
Limitations
Description
Section 5-15
Ladder Symbols
WTC(64)
S
D
C
@WTC(64)
S
D
C
Operand Data Areas
S: Source word
IR, SR, AR, DM, HR, LR
D: First word of the destination set
IR, AR, DM, HR, LR
C: Column bit designator (BCD)
IR, AR, DM, HR, TC, LR, #
C must be between #0000 and #0015.
When the execution condition is OFF, WTC(64) is not executed. When the execution 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).
S
Bit
15
0
.
.
.
.
.
.
.
Bit
00
0 1 1 1
D
D+1
D+2
D+3
.
.
.
Bit
15
C
Bit
00
0 0 0 0 1 1 1 0 0 0 1 0 0 0 0 1
1 1 0 1 0 0 1 0 0 1 1 1 0 0 0 1
0 0 0 1 1 0 1 1 0 0 1 0 0 1 1 1
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
Example
00000
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.)
EQ: ON when the content of S is zero; otherwise OFF.
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).
WTC(64)
DM 0100
DM 0200
#0015
Address Instruction
00000 LD
00001 WTC(64)
DM
DM
#
Operands
00000
0100
0200
0015
132
Data Movement
5-15-5 BLOCK SET – BSET(71)
Limitations
Description
Section 5-15
Ladder Symbols
BSET(71)
S
St
E
@BSET(71)
S
St
E
Operand Data Areas
S: Source data
IR, SR, AR, DM, HR, TC, LR, #
St: Starting word
IR, AR, DM, HR, TC, LR
E: End Word
IR, AR, DM, HR, TC, LR
St must be less than or equal to E, and St and E must be in the same data area.
When the execution condition is OFF, BSET(71) is not executed. When the execution condition is ON, BSET(71) copies the content of S to all words from St through E.
S
3 4 5 2
St
3 4 5 2
St+1
3 4 5 2
St+2
3 4 5 2
Flags
Example
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.
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.)
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 operate as a 30-second timer.
00003 00004
00004 00003
00003
00004
@BSET(71)
#0500
TIM 010
TIM 010
@BSET(71)
#0300
TIM 010
TIM 010
TIM 010
#9999
Address Instruction
00000 LD
00001 AND NOT
00002 @BSET(71)
00003 LD
00004 AND NOT
00005 @BSET(71)
00006 LD
00007 OR
00008 TIM
#
TIM
TIM
Operands
00003
00004
#
TIM
TIM
#
0500
010
010
00004
00003
0300
010
010
00003
00004
010
9999
5-15-6 BLOCK TRANSFER – XFER(70)
Limitations
Description
Ladder Symbols
XFER(70)
N
S
D
@XFER(70)
N
S
D
Operand Data Areas
N: Number of words (BCD)
IR, SR, AR, DM, HR, TC, LR, #
S: Starting source word
IR, SR, AR, DM, HR, TC, LR
D: Starting destination word
IR, AR, DM, HR, TC, LR
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,
When the execution condition is OFF, XFER(70) is not executed. When the execution condition is ON, XFER(70) copies the contents of S, S+1, ..., S+N to D,
D+1, ..., D+N.
S
3 4 5 2
S+1
3 4 5 1
S+2
3 4 2 2
D
3 4 5 2
D+1
3 4 5 1
D+2
3 4 2 2
ER: N is not BCD
S+N
6 4 5 2
D+N
6 4 5 2
Flags
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.)
5-15-7 DATA EXCHANGE – XCHG(73)
Ladder Symbols
XCHG(73)
E1
E2
@XCHG(73)
E1
E2
Operand Data Areas
E1: Exchange word 1
IR, AR, DM, HR, TC, LR
E2: Exchange word 2
IR, AR, DM, HR, TC, LR
Description When the execution condition is OFF, XCHG(73) is not executed. When the execution condition is ON, XCHG(73) exchanges the content of E1 and E2.
E1 E2
Flags
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.
ER: Indirectly addressed DM word is non-existent. (Content of * DM word is not BCD, or the DM area boundary has been exceeded.)
5-15-8 SINGLE WORD DISTRIBUTE – DIST(80)
Ladder Symbols
DIST(80)
S
DBs
Of
@DIST(80)
S
DBs
Of
Operand Data Areas
S: Source data
IR, SR, AR, DM, HR, TC, LR, #
DBs: Destination base word
IR, AR, DM, HR, TC, LR
Of: Offset data (BCD)
IR, AR, DM, HR, TC, LR, #
Limitations
Description
Of must be a BCD. DBs must be in the same data area as DBs+Of.
When the execution condition is OFF, DIST(80) is not executed. When the execution 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
3 4 5 2
DBs + Of
3 4 5 2
Flags ER: The specified offset data is not BCD, or when added to the DBs, the resulting address lies outside the data area of the DBs.
Indirectly * DM word is not BCD, or the DM area boundary has been exceeded.)
135
Data Movement
EQ: ON when the content of S is zero; otherwise OFF.
5-15-9 DATA COLLECT – COLL(81)
Section 5-15
Ladder Symbols
COLL(81)
SBs
Of
D
@COLL(81)
SBs
Of
D
Operand Data Areas
SBs: Source base word
IR, SR, AR, DM, HR, TC, LR
Of: Offset data (BCD)
IR, AR, DM, HR, TC, LR, #
D: Destination word
IR, AR, DM, HR, TC, LR
Limitations
Description
Of must be a BCD. SBs must be in the same data area as SBs+Of.
When the execution condition is OFF, COLL(81) is not executed. When the execution 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
3 4 5 2
D
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.)
EQ: ON when the content of S is zero; otherwise OFF.
5-15-10 MOVE BIT – MOVB(82)
Ladder Symbols
MOVB(82)
S
Bi
D
@MOVB(82)
S
Bi
D
Operand Data Areas
S: Source word
IR, SR, AR, DM, HR, LR, #
Bi: Bit designator (BCD)
IR, AR, DM, HR, TC, LR, #
D: Destination word
IR, AR, DM, HR, LR
Limitations
Description
The rightmost two digits and the leftmost two digits of Bi must each be between
00 and 15.
When the execution condition is OFF, MOVB(82) is not executed. When the execution 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 designate the source bit; the leftmost two bits designate the destination bit.
Bi
Bit
15
Bit
00
0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 1
Bi
MSB
1 2 0 1
LSB
S
Bit
15
1 2 0 1 Bit
00
0 1 0 1 0 1 0 0 0 1 1 1 0 0 0 1
Source bit (00 to 15)
Destination bit (00 to 15)
D
Bit
15
Bit
00
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.)
5-15-11 MOVE DIGIT – MOVD(83)
Ladder Symbols
MOVD(83)
S
Di
D
@MOVD(83)
S
Di
D
Operand Data Areas
S: Source word
IR, SR, AR, DM, HR, TC, LR, #
Di: Digit designator (BCD)
IR, AR, DM, HR, TC, LR, #
D: Destination word
IR, AR, DM, HR, TC, LR
Limitations
Description
The rightmost three digits of Di must each be between 0 and 3.
When the execution condition is OFF, MOVD(83) is not executed. When the execution condition is ON, MOVD(83) copies the content of the specified digit(s) in S to the specified digit(s) in D. Up to four digits can be transferred at one time. The first digit to be copied, the number of digits to be copied, and the first digit to receive the copy are designated in Di as shown below. Digits from S will be copied to consecutive digits in D starting from the designated first digit and continued for the designated number of digits. If the last digit is reached in either S or D, further digits are used starting back at digit 0.
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
Digit Designator
Section 5-16
The following show examples of the data movements for various values of Di.
2
3
0
1
S
Di: 0010
D
2
3
0
1
2
3
0
1
S
Di: 0030
D
2
3
0
1
S
Di: 0031
0
1
2
3
D
0
1
2
3
0
1
2
3
S
Di: 0023
D
2
3
0
1
Flags ER: At least one of the rightmost three digits of Di is not between 0 and 3.
Indirectly
*
DM word is not BCD, or the DM area boundary has been exceeded.)
5-16 Data Comparison
This section describes the instructions used for comparing data. CMP(20) is used to compare the contents of two words; BCMP(68) is used to determine within which of several preset ranges the content of one word lies; and
TCMP(85) is used to determine which of several preset values the content of one word equals.
5-16-1 MULTI-WORD COMPARE – MCMP(19)
Ladder Symbols
MCMP(19)
TB1
TB2
R
@MCMP(19)
TB1
TB2
R
Operand Data Areas
TB1: First word of table 1
IR, SR, AR, DM, HR, TC, LR
TB2: First word of table 2
IR, SR, AR, DM, HR, TC, LR
R: Result word
IR, AR, DM, HR, TC, LR
Limitations
Description
Flags
TB1 and TB1+15 must be in the same data area.
TB2 and TB2+15 must be in the same data area.
When the execution condition is OFF, MCMP(19) is not executed. When the execution condition is ON, MCMP(19) compares the content of TB1 to TB2,
TB1+1 to TB2+1, TB1+2 to TB2+2, ..., and TB1+15 to TB2+15. If the first pair is equal, the first bit in R is turned OFF, etc., i.e., if the content of TB1 equals the content of TB2, bit 00 is turned OFF, if the content of TB1+1 equals the content of
TB2+1, bit 01 is turned OFF, etc. The rest of the bits in R will be turned ON.
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
Example
00000
TB1: IR 100
IR 100
IR 101
IR 102
IR 103
IR 104
IR 105
IR 106
IR 107
IR 108
IR 109
IR 110
IR 111
IR 112
IR 113
IR 114
IR 115
0100
0200
0210
ABCD
ABCD
ABCD
ABCD
0800
0900
1000
ABCD
ABCD
ABCD
1400
0210
1212
Section 5-16
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.
MCMP(19)
100
DM 0200
DM 0300
TB2: DM 0200
DM 0200
DM 0201
DM 0202
DM 0203
DM 0204
DM 0205
DM 0206
DM 0207
DM 0208
DM 0209
DM 0210
DM 0211
DM 0212
DM 0213
DM 0214
DM 0215
0100
0200
0210
0400
0500
0600
0210
0800
0900
1000
0210
1200
1300
1400
0210
1600
Address Instruction
00000 LD
00001 MCMP(19)
R: DM 0300
DM 030000
DM 030001
DM 030002
DM 030003
DM 030004
DM 030005
DM 030006
DM 030007
DM 030008
DM 030009
DM 030010
DM 030011
DM 030012
DM 030013
DM 030014
DM 030015
0
0
1
1
0
1
1
0
1
1
0
0
1
1
0
0
DM
DM
Operands
00000
100
0200
0300
5-16-2 COMPARE – CMP(20)
Limitations
Description
Precautions
Ladder Symbols
CMP(20)
Cp1
Cp2
Operand Data Areas
Cp1: First compare word
IR, SR, AR, DM, HR, TC, TR, #
Cp2: Second compare word
IR, SR, AR, DM, HR, TC, LR, #
When comparing a value to the PV of a timer or counter, the value must be in
BCD.
When the execution condition is OFF, CMP(20) is not executed. When the execution condition is ON, CMP(20) compares Cp1 and Cp2 and outputs the result to the GR, EQ, and LE flags in the SR area.
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 access them before the desired status is changed.
139
Data Comparison
Flags
Example 1:
Saving CMP(20) Results
Section 5-16
ER: Indirectly addressed DM word is non-existent. (Content of
*
DM word is not BCD, or the DM area boundary has been exceeded.)
EQ: ON if Cp1 equals Cp2.
LE: ON if Cp1 is less than Cp2.
GR: ON if Cp1 is greater than Cp2.
GR
EQ
LE
Flag Address
25505
25506
25507
C1 < C2
OFF
OFF
ON
C1 = C2
OFF
ON
OFF
ON
C1 > C2
OFF
OFF
The following example shows how to save the comparison result immediately. If 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 programming, 00200, 00201, and 00202 are changed only when CMP(20) is executed.
00000
TR
0
CMP(20)
HR 09
010
25505
25506
00200 Greater Than
25507
Address Instruction
00000
00001
00002
LD
OUT
CMP(20)
00003
00004
LD
AND
Operands
TR
00000
0
HR
TR
010
09
0
25505
00201 Equal
00202
Less Than
Address Instruction
00005
00006
00007
00008
00009
00010
00011
OUT
LD
AND
OUT
LD
AND
OUT
Operands
TR
TR
00200
0
25506
00201
0
25507
00202
Example 2:
Obtaining Indications during Timer Operation
The following example uses TIM, CMP(20), and the LE flag (25507) to produce outputs at particular times in the timer’s countdown. The timer is started by turning 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). Output 00200 is produced after 100 seconds; output 00201, after 200 seconds; output 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
00000
00200
00201
TIM 010
25507
25507
25507
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.
TIM 010
#5000 500.0 s
CMP(20)
TIM 010
#4000
00200
Output at
100 s.
CMP(20)
TIM 010
#3000
00201
Output at
200 s.
CMP(20)
TIM 010
#2000
00202
Output at
300 s.
00204
Output at
500 s.
Address Instruction
00000
00001
LD
TIM
00002 CMP(20)
00003
00004
00005
00006
AND
OUT
LD
CMP(20)
#
Operands
00000
010
5000
TIM
#
010
4000
25507
00200
00200
TIM
#
010
3000
Address Instruction
00007
00008
00009
00010
AND
OUT
LD
CMP(20)
00011
00012
00013
00014
AND
OUT
LD
OUT
Operands
25507
00201
00201
TIM
#
TIM
010
2000
25507
00202
010
00204
5-16-3 DOUBLE COMPARE – CMPL(60)
Ladder Symbols
Limitations
CMPL(60)
Cp1
Cp2
___
Operand Data Areas
Cp1: First word of first compare word pair
IR, SR, AR, DM, HR, TC, TR
Cp2: First word of second compare word pair
IR, SR, AR, DM, HR, TC, LR
Cp1 and Cp1+1 must be in the same data area.
141
Data Comparison
Description
Precautions
Flags
Example:
Saving CMPL(60) Results
Section 5-16
Cp2 and Cp2+1 must be in the same data area.
When the execution condition is OFF, CMPL(60) is not executed. When the execution 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.
Placing other instructions between CMPL(60) and the operation which accesses the EQ, LE, and GR flags may change the status of these flags. Be sure to access them before the desired status is changed.
ER: Indirectly addressed DM word is non-existent. (Content of
*
DM word is not BCD, or the DM area boundary has been exceeded.)
GR: ON if Cp1+1,Cp1 is greater than Cp2+1,Cp2.
EQ: ON if Cp1+1,Cp1 equals Cp2+1,Cp2.
LE: ON if Cp1+1,Cp1 is less than Cp2+1,Cp2.
The following example shows how to save the comparison result immediately. If 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.
00000
TR
0
25505
CMPL(60)
HR 09
010
---
00200 Greater Than
25506
00201
Equal
25507
00202
Less Than
Address Instruction
00000
00001
00002
LD
OUT
CMPL(60)
00003 AND
Operands
TR
00000
0
HR 09
010
25505
Address Instruction
00004
00005
00006
00007
00008
00009
00010
OUT
LD
AND
OUT
LD
AND
OUT
Operands
TR
TR
00200
0
25506
00201
0
25507
00202
142
Data Comparison
5-16-4 BLOCK COMPARE – BCMP(68)
Section 5-16
Ladder Symbols
BCMP(68)
CD
CB
R
@BCMP(68)
CD
CB
R
Operand Data Areas
CD: Compare data
IR, SR, DM, HR, TC, LR, #
CB: First comparison block word
IR, SR, DM, HR, TC, LR
R: Result word
IR, AR, DM, HR, TC, LR
Limitations
Description
Flags
Each lower limit word in the comparison block must be less than or equal to the upper limit.
When the execution condition is OFF, BCMP(68) is not executed. When the execution 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
CB+2
≤
CD
≤
CB+3
CB+4
≤
CD
≤
CB+5
CB+6
≤
CD
≤
CB+7
CB+8
≤
CD
≤
CB+9
CB+10
≤
CD
≤
CB+11
CB+12
≤
CD
≤
CB+13
CB+14
≤
CD
≤
CB+15
CB+16
≤
CD
≤
CB+17
CB+18
≤
CD
≤
CB+19
CB+20
≤
CD
≤
CB+21
CB+22
≤
CD
≤
CB+23
CB+24
≤
CD
≤
CB+25
CB+26
≤
CD
≤
CB+27
CB+28
≤
CD
≤
CB+29
CB+30
≤
CD
≤
CB+31
Bit 00
Bit 01
Bit 02
Bit 03
Bit 04
Bit 05
Bit 06
Bit 07
Bit 08
Bit 09
Bit 10
Bit 12
Bit 13
Bit 14
Bit 15
Bit 16
ER: The comparison block (i.e., CB through CB+31) 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.)
143
Data Comparison
Example
00000
CD 001
001 0210
Compare data in IR 001
(which contains 0210) with the given ranges.
Section 5-16
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.
BCMP(68)
001
HR 10
HR 05
Address Instruction
00000 LD
00001 BCMP(88)
HR
HR
Operands
00000
001
10
05
Lower limits
HR 10
HR 12
HR 14
HR 16
HR 18
HR 20
HR 22
HR 24
HR 26
HR 28
HR 30
HR 32
HR 34
HR 36
HR 38
HR 40
0000
0101
0201
0301
0401
0501
0601
0701
0801
0901
1001
1101
1201
1301
1401
1501
Upper limits
HR 11
HR 13
HR 15
HR 17
HR 19
HR 21
HR 23
HR 25
HR 27
HR 29
HR 31
HR 33
HR 35
HR 37
HR 39
HR 41
0100
0200
0300
0400
0500
0600
0700
0800
0900
1000
1100
1200
1300
1400
1500
1600
R: HR 05
HR 0500
HR 0501
HR 0502
HR 0503
HR 0504
HR 0505
HR 0506
HR 0507
HR 0508
HR 0509
HR 0510
HR 0511
HR 0512
HR 0513
HR 0514
HR 0515
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
5-16-5 TABLE COMPARE – TCMP(85)
Description
Flags
Ladder Symbols
TCMP(85)
CD
TB
R
@TCMP(85)
CD
TB
R
Operand Data Areas
CD: Compare data
IR, SR, AR, DM, HR, TC, LR, #
TB: First comparison table word
IR, SR, DM, HR, TC, LR
R: Result word
IR, AR, DM, HR, TC, LR
When the execution condition is OFF, TCMP(85) is not executed. When the execution 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.
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
Example
00000
CD: 001
001 0210
Compare the data in IR 001 with the given ranges.
Section 5-16
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.
TCMP(85)
001
HR 10
HR 05
Address Instruction
00000 LD
00001 TCMP(85)
HR
HR
Operands
00000
001
10
05
Upper limits
HR 10
HR 11
HR 12
HR 13
HR 14
HR 15
HR 16
HR 17
HR 18
HR 19
HR 20
HR 21
HR 22
HR 23
HR 24
HR 25
0100
0200
0210
0400
0500
0600
0210
0800
0900
1000
0210
1200
1300
1400
0210
1600
R: HR 05
HR 0500
HR 0501
HR 0502
HR 0503
HR 0504
HR 0505
HR 0506
HR 0507
HR 0508
HR 0509
HR 0510
HR 0511
HR 0512
HR 0513
HR 0514
HR 0515
1
0
0
0
0
0
1
0
0
1
0
0
0
1
0
0
145
Data Conversion Section 5-17
5-17 Data Conversion
The conversion instructions convert word data that is in one format into another format and output the converted data to specified result word(s). Conversions are available to convert between binary (hexadecimal) and BCD, to 7-segment display data, to ASCII, and between multiplexed and non-multiplexed data. All of these instructions change only the content of the words to which converted data is being moved, i.e., the content of source words is the same before and after execution of any of the conversion instructions.
5-17-1 BCD-TO-BINARY – BIN(23)
BIN(23)
S
R
Ladder Symbols
@BIN(23)
S
R
Operand Data Areas
S: Source word (BCD)
IR, SR, AR, DM, HR, TC, LR
R: Result word
IR, AR, DM, HR, LR
Description When the execution condition is OFF, BIN(23) is not executed. When the execution 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 Programming 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.
Flags ER: The content of S is 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.
5-17-2 DOUBLE BCD-TO-DOUBLE BINARY – BINL(58)
Ladder Symbols
BINL(58)
S
R
@BINL(58)
S
R
Operand Data Areas
S: First source word (BCD)
IR, SR, AR, DM, HR, TC, LR
R: First result word
IR, AR, DM, HR, LR
146
Data Conversion
Description
Section 5-17
When the execution condition is OFF, BINL(58) is not executed. When the execution 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.
5-17-3 BINARY-TO-BCD – BCD(24)
Ladder Symbols
BCD(24)
S
R
@BCD(24)
S
R
Operand Data Areas
S: Source word (binary)
IR, SR, AR, DM, HR, LR
R: Result word
IR, AR, DM, HR, LR
Limitations
Description
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.
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
Flags
BCD
R
BCD(24) can be used to convert binary to BCD so that displays on the Programming 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 arithmetic operations rather than binary arithmetic operations, e.g., when BCD and binary values must be added.
ER: S is greater than 270F.
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.
147
Data Conversion
5-17-4 DOUBLE BINARY-TO-DOUBLE BCD – BCDL(59)
Ladder Symbols
BCDL(59)
S
R
@BCDL(59)
S
R
Section 5-17
Operand Data Areas
S: First source word (binary)
IR, SR, AR, DM, HR, LR
R: First result word
IR, AR, DM, HR, LR
Limitations
Description
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 executed, the content of R and R+1 remain unchanged.
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
Flags ER: Content of R and R+1 exceeds 99999999.
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.
5-17-5 HOURS-TO-SECONDS – HTS(65)
HTS(65)
S
R
---
Ladder Symbols
@HTS(65)
S
R
---
Operand Data Areas
S: Beginning source word (BCD)
IR, SR, AR, DM, HR, TC, LR
R: Beginning result word (BCD)
IR, SR, AR, DM, HR, TC, LR
---: Not used.
Limitations
Description
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/minutes/seconds format.
HTS(65) is used to convert time notation in hours/minutes/seconds to an equivalent in just seconds.
For the source data, the seconds is designated in bits 00 through 07 and the minutes 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
Flags
Example
00000
HR 12
HR 13
Section 5-17
3
2
2
8
0
1
7
5
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.
When 00000 is OFF (i.e., when the execution condition is ON), the following instruction 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.
HTS(65)
HR 12
DM 0100
000
Address Instruction
00000 LD NOT
00001 HTS(65)
HR
DM
Operands
00000
12
0100
000
2,815 hrs, 32 min, 07 s
DM 0100
DM 0101
5
1
9
0
2
1
7
3
10,135,927 s
5-17-6 SECONDS-TO-HOURS – STH(66)
STH(66)
S
R
---
Ladder Symbols
@STH(66)
S
R
---
Operand Data Areas
S: Beginning source word (BCD)
IR, SR, AR, DM, HR, TC, LR
R: Beginning result word (BCD)
IR, SR, AR, DM, HR, TC, LR
---: Not used.
Limitations
Description
Flags
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.
STH(66) is used to convert time notation in seconds to an equivalent in hours/minutes/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.
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
Example
00000
HR 12
HR 13
Section 5-17
5
1
9
0
2
1
7
3
When 00000 is OFF (i.e., when the execution condition is ON), the following instruction would convert the seconds given in HR 12 and HR 13 to hours, minutes, and seconds and store the results in DM 0100 and DM 0101 as shown.
STH(66)
HR 12
DM 0100
000
Address Instruction
00000 LD NOT
00001 STH(66)
HR
DM
Operands
00000
12
0100
000
10,135,927 s
DM 0100
DM 0101
3
2
2
8
0
1
7
5
2,815 hrs, 32 min, 07 s
5-17-7 4-TO-16 DECODER – MLPX(76)
Limitations
Description
Ladder Symbols
MLPX(76)
S
Di
R
@MLPX(76)
S
Di
R
Operand Data Areas
S: Source word
IR, SR, AR, DM, HR, TC, LR
Di: Digit designator
IR, AR, DM, HR, TC, LR, #
R: First result word
IR, AR, DM, HR, LR
The rightmost two digits of Di must each be between 0 and 3.
All result words must be in the same data area.
When the execution condition is OFF, MLPX(76) is not executed. When the execution condition is ON, MLPX(76) converts up to four, four-bit hexadecimal digits from S into decimal values from 0 to 15, each of which is used to indicate a bit position. The bit whose number corresponds to each converted value is then turned ON in a result word. If more than one digit is specified, then one bit will be turned ON in each of consecutive words beginning with R. (See examples, below.)
The following is an example of a one-digit decode operation from digit number 1 of S, i.e., here Di would be 0001.
Source word
C
Bit C (i.e., bit number 12) turned ON.
First result word
0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
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
Digit Designator
Flags
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 converted, the last two words in a data area cannot be designated.
The digits of Di are set as shown below.
Digit number: 3 2 1 0
Specifies the first digit to be converted (0 to 3)
Number of digits to be converted (0 to 3)
0: 1 digit
1: 2 digits
2: 3 digits
3: 4 digits
Not used
Some example Di values and the digit-to-word conversions that they produce are shown below.
2
3
0
1
S
Di: 0010
R
R + 1
2
3
0
1
S
Di: 0030
R
R + 1
R + 2
R + 3
S
Di: 0031
0
1
2
3
R
R + 1
R + 2
R + 3
0
1
2
3
S
Di: 0023
R
R + 1
R + 2
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
Example
00000
Section 5-17
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.
MLPX(76)
DM 0020
#0021
HR 10
Address Instruction
00000 LD
00001 MLPX(76)
DM
#
HR
Operands
00000
00200
0021
10
S: DM 0020
DM 00
DM 01
DM 02
DM 03
DM 04
DM 05
DM 06
DM 07
DM 08
DM 09
DM 10
DM 11
DM 12
DM 13
DM 14
DM 15
0
0
1
1
0
0
0
1
1
0
1
1
R: HR 10
2 0
2
1
2 2
2 3
2 0
2
1
2 2
2 1
2
2
2 3
2 3
2 0
2 1
2 2
2 3
2 0
1
2
3
Not
Converted
15
6
0
HR 1000
HR 1001
HR 1002
HR 1003
HR 1004
HR 1005
HR 1006
HR 1007
HR 1008
HR 1009
HR 1010
HR 1011
HR 1012
HR 1013
HR 1014
HR 1015
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
R+1: HR 11
HR 1100
HR 1101
HR 1102
HR 1103
HR 1104
HR 1105
HR 1106
HR 1107
HR 1108
HR 1109
HR 1110
HR 1111
HR 1112
HR 1113
HR 1114
HR 1115
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
R+2: HR 12
HR 1200
HR 1201
HR 1202
HR 1203
HR 1204
HR 1205
HR 1206
HR 1207
HR 1208
HR 1209
HR 1210
HR 1211
HR 1212
HR 1213
HR 1214
HR 1215
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
5-17-8 16-TO-4 ENCODER – DMPX(77)
Limitations
Description
Ladder Symbols
DMPX(77)
SB
R
Di
@DMPX(77)
SB
R
Di
Operand Data Areas
SB: First source word
IR, SR, AR, DM, HR, TC, LR
R: Result word
IR, AR, DM, HR, LR
Di: Digit designator
IR, AR, DM, HR, TC, LR, #
The rightmost two digits of Di must each be between 0 and 3.
All source words must be in the same data area.
When the execution condition is OFF, DMPX(77) is not executed. When the execution condition is ON, DMPX(77) determines the position of the highest ON bit in S, encodes it into single-digit hexadecimal value corresponding to the bit number of the highest ON bit number, then transfers the hexadecimal value to the specified digit in R. The digits to receive the results are specified in Di, which also specifies the number of digits to be encoded.
152
Data Conversion
Digit Designator
Flags
Example
Section 5-17
The following is an example of a one-digit encode operation to digit number 1 of
R, i.e., here Di would be 0001.
First source word
0 0 0 1 0 0 0 1 0 0 0 1 0 1 1 0
C transferred to indicate bit number 12 as the highest ON bit.
Result word
C
Up to four digits from four consecutive source words starting with S may be encoded 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.
The digits of Di are set as shown below.
Digit numbers: 3 2 1 0
Specifies the first digit to receive converted data (0 to 3).
Number of words to be converted (0 to 3)
0: 1 word
1: 2 words
2: 3 words
3: 4 words
Not used.
Some example Di values and the word-to-digit conversions that they produce are shown below.
Di: 0011 Di: 0030
S
S + 1
R
0
1
2
3
S
S + 1
S + 2
S + 3
R
0
1
2
3
S
S + 1
Di: 0013
R
0
1
2
3
S
S + 1
S + 2
S + 3
Di: 0032
2
3
0
1
R
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.)
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
00000
Section 5-17
IR 010
01000
:
01011 1
01012 0
: : :
01015 0
LR 10
LR 1000
LR 1001 1
LR 1002 0
: : :
: : :
LR 1015 0
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.
DMPX(77)
010
HR 20
#0010
DMPX(77)
LR 10
HR 20
#0012
Address Instruction
00000 LD
00001 DMPX(77)
00002 DMPX(77)
HR
#
LR
HR
#
Operands
00000
010
20
0010
10
20
0012
IR 011
01100
:
01109 1
01110 0
: : :
01115 0
HR 20
Digit 0
Digit 1
Digit 2
Digit 3
B
9
1
8
LR 11
LR 1100
:
LR 1108 1
LR 1109 0
: : :
LR 1115 0
5-17-9 7-SEGMENT DECODER – SDEC(78)
Limitations
Description
Ladder Symbols
SDEC(78)
S
Di
D
@SDEC(78)
S
Di
D
Operand Data Areas
S: Source word (binary)
IR, SR, AR, DM, HR, TC, LR
Di: Digit designator
IR, AR, DM, HR, TC, LR, #
D: First destination word
IR, AR, DM, HR, LR
Di must be within the values given below
All destination words must be in the same data area.
When the execution condition is OFF, SDEC(78) is not executed. When the execution condition is ON, SDEC(78) converts the designated digit(s) of S into the equivalent 8-bit, 7-segment display code and places it into the destination word(s) beginning with D.
Any or all of the digits in S may be converted in sequence from the designated first digit. The first digit, the number of digits to be converted, and the half of D to receive the first 7-segment display code (rightmost or leftmost 8 bits) are designated in Di. If multiple digits are designated, they will be placed in order starting
154
Data Conversion
Digit Designator
Example
Section 5-17 from the designated half of D, each requiring two digits. If more digits are designated than remain in S (counting from the designated first digit), further digits will be used starting back at the beginning of S.
The digits of Di are set as shown below.
Digit number: 3 2 1 0
Specifies the first digit to receive converted data (0 to 3).
Number of digits to be converted (0 to 3)
0: 1 digit
1: 2 digits
2: 3 digits
3: 4 digits
First half of D to be used.
0: Rightmost 8 bits (1st half)
1: Leftmost 8 bits (2nd half)
Not used; set to 0.
Some example Di values and the 4-bit binary to 7-segment display conversions that they produce are shown below.
S digits
Di: 0011
2
3
0
1
D
1st half
2nd half
Di: 0030
S digits
2
3
0
1
D
1st half
2nd half
D+1
1st half
2nd half
S digits
Di: 0112
2
3
0
1
D
1st half
2nd half
D+1
1st half
2nd half
S digits
0
Di: 0130
1
2
3
D
1st half
2nd half
D+1
1st half
2nd half
D+2
1st half
2nd half
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
Di
1
0
1 x10 2
1
1
1
0 x10 3
1
1
0
1
0 x10 0
0
0
0 x10 1
0
1: Second digit
0: One digit
0 or 1: bits 00 through 07 or
08 through 15.
Not used.
Section 5-17 table underneath shows the original data and converted code for all hexadecimal digits.
S
0
1
2
3
1
1
1
0
1
1
0
1
0
1
0
0
0
0
0
1
2 1
2 2
2 3
2 0
2 1
2 2
2
2
2
3
2
0
2
1
2
0
2 1
2 2
2 3
2 0
2 3
8
D
Bit 00 or bit 08
1
1
1
1
1
Bit 07 or bit 15
0
1
1 f e g c d a b f e a g b c d
Flags
7
8
5
6
9
A
B
E
F
C
D
1
2
3
4
0
Digit
0
1
0
0
1
1
1
1
1
1
1
0
0
0
0
0
Original data
Bits
0
0
0
0
0
0
1
1
1
0
1
1
1
0
0
0
0
1
1
1
1
1
1
0
0
1
0
0
1
0
1
1
1
0
1
0
1
0
1
0
1
0
1
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
–
0
1
1
1
1
1
1
1
1
0
1
1
1
1
0
0 g
Converted code (segments) f e d c b
1
0
1
0
1
0
1
1
1
1
0
0
1
1
0
0
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
0
1
0
1
0
1
1
1
1
1
1
1
1
0
1
1
0
1
1
1
1
0
1
1
1
1
1
1
1
0
1
0
0
0
0
0
1
1
1
0
0
1
1
0
1
1
1
1
1
1
0
1
1
1
0
0
1
1
0
1 a
Display
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
5-17-10 ASCII CONVERT – ASC(86)
Limitations
Description
Digit Designator
Section 5-17
ASC(86)
S
Di
D
Ladder Symbols
@ASC(86)
S
Di
D
Operand Data Areas
S: Source word
IR, SR, AR, DM, HR, TC, LR
Di: Digit designator
IR, AR, DM, HR, TC, LR, #
D: First destination word
IR, AR, DM, HR, LR
Di must be within the values given below
All destination words must be in the same data area.
When the execution condition is OFF, ASC(86) is not executed. When the execution condition is ON, ASC(86) converts the designated digit(s) of S into the equivalent 8-bit ASCII code and places it into the destination word(s) beginning with D.
Any or all of the digits in S may be converted in order from the designated first digit. The first digit, the number of digits to be converted, and the half of D to receive the first ASCII code (rightmost or leftmost 8 bits) are designated in Di. If multiple digits are designated, they will be placed in order starting from the designated half of D, each requiring two digits. If more digits are designated than remain in S (counting from the designated first digit), further digits will be used starting back at the beginning of S.
Refer to Appendix I for a table of extended ASCII characters.
The digits of Di are set as shown below.
Digit number: 3 2 1 0
Specifies the first digit to be converted (0 to 3).
Number of digits to be converted (0 to 3)
0: 1 digit
1: 2 digits
2: 3 digits
3: 4 digits
First half of D to be used.
0: Rightmost 8 bits (1st half)
1: Leftmost 8 bits (2nd half)
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
2
3
0
1
D
1st half
2nd half
S
2
3
0
1
D
1st half
2nd half
D+1
1st half
2nd half
S
2
3
0
1
Di: 0112
D
1st half
2nd half
D+1
1st half
2nd half
1
2
S
0
3
Di: 0130
D
1st half
2nd half
D+1
1st half
2nd half
D+2
1st half
2nd half
Parity
Flags
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 number 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.
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.)
5-18 BCD Calculations
The BCD calculation instructions – INC(38), DEC(39), ADD(30), ADDL(54),
SUB(31), SUBL(55), MUL(32), MULL(56), DIV(33), DIVL(57), FDIV(79), and
ROOT(72) – all perform arithmetic operations on BCD data.
For INC(38) and DEC(39) the source and result words are the same. That is, the content of the source word is overwritten with the instruction result. All other instructions change only the content of the words in which results are placed, i.e., the contents of source words are the same before and after execution of any of the other BCD calculation instructions.
STC(40) and CLC(41), which set and clear the carry flag, are included in this group because most of the BCD operations make use of the Carry Flag (CY) in their results. Binary calculations and shift operations also use CY.
The addition and subtraction instructions include CY in the calculation as well as in the result. Be sure to clear CY if its previous status is not required in the calcu-
158
BCD Calculations Section 5-18 lation, and to use the result placed in CY, if required, before it is changed by execution of any other instruction.
5-18-1 INCREMENT – INC(38)
Ladder Symbols Operand Data Areas
INC(38)
Wd
@INC(38)
Wd
Wd: Increment word (BCD)
IR, AR, DM, HR, LR
Description When the execution condition is OFF, INC(38) is not executed. When the execution condition is ON, INC(38) increments Wd, without affecting Carry (CY).
Flags ER: Wd is 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 incremented result is 0.
5-18-2 DECREMENT – DEC(39)
Ladder Symbols Operand Data Areas
DEC(39)
Wd
@DEC(39)
Wd
Wd: Decrement word (BCD)
IR, AR, DM, HR, LR
Description When the execution condition is OFF, DEC(39) is not executed. When the execution 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.
Flags ER: Wd is 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 decremented result is 0.
5-18-3 SET CARRY – STC(40)
Ladder Symbols
STC(40) @STC(40)
When the execution condition is OFF, STC(40) is not executed.When the execution condition is ON, STC(40) turns ON CY (SR 25504).
5-18-4 CLEAR CARRY – CLC(41)
Ladder Symbols
CLC(41) @CLC(41)
159
BCD Calculations Section 5-18
When the execution condition is OFF, CLC(41) is not executed.When the execution condition is ON, CLC(41) turns OFF CY (SR 25504).
CLEAR CARRY is used to reset (turn OFF) CY (SR 25504) to “0.”
5-18-5 BCD ADD – ADD(30)
ADD(30)
Au
Ad
R
Ladder Symbols
@ADD(30)
Au
Ad
R
Operand Data Areas
Au: Augend word (BCD)
IR, SR, AR, DM, HR, TC, LR, #
Ad: Addend word (BCD)
IR, SR, AR, DM, HR, TC, LR, #
R: Result word
IR, AR, DM, HR, LR
Description When the execution condition is OFF, ADD(30) is not executed. When the execution 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
Flags
Example
00002
TR 0
25504
25504
ER: Au and/or Ad is not BCD.
Indirectly addressed DM word is non-existent. (Content of
*
DM word is not BCD, or the DM area boundary has been exceeded.)
CY: ON when there is a carry in the result.
EQ: ON when the result is 0.
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.
CLC(41)
Address Instruction
00000 LR
00001 OUT
00002 CLC(41)
00003 AND(30)
Operands
TR
00002
0
ADD(30)
LR 25
#6103
DM 0100
LR
#
DM
25
6103
0100
25504 00004 AND
00005 MOV(21)
MOV(21)
#0001
DM 0101
MOV(21)
#0000
DM 0101
00006 LD
00007 AND NOT
00008 MOV(21)
#
DM
TR
#
DM
0001
0101
0
25504
0000
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
5-18-6 DOUBLE BCD ADD – ADDL(54)
Description
Flags
Example
00000
Section 5-18
Ladder Symbols
ADDL(54)
Au
Ad
R
@ADDL(54)
Au
Ad
R
Operand Data Areas
Au: First augend word (BCD)
IR, SR, AR, DM, HR, TC, LR
Ad: First addend word (BCD)
IR, SR, AR, DM, HR, TC, LR
R: First result word
IR, AR, DM, HR, LR
When the execution condition is OFF, ADDL(54) is not executed. When the execution 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
+
R + 1
CY
R
ER: Au and/or Ad is not BCD.
Indirectly addressed DM word is non-existent. (Content of * DM word is not BCD, or the DM area boundary has been exceeded.)
CY: ON when there is a carry in the result.
EQ: ON when the result is 0.
When 00000 is ON, the following program adds two 12-digit numbers, the first contained in LR 20 through LR 22 and the second in DM 0012. The result is placed in LR 10 through HR 13. In the second addition (using ADD(30)), any carry from the first addition is included. The carry from the second addition is placed in HR 13 by using @ADB(50) (see 5-19-1 BINARY ADD – ADB(50)) with two all-zero constants to indirectly place the content of CY into HR 13.
Address Instruction
00000 LD
00001 CLC(41)
00002 @ADDL(54)
Operands
00000
CLC(41)
@ADDL(54)
LR 20
DM 0010
HR 10
@ADD(30)
LR 22
DM 0012
HR 12
@ADB(50)
#0000
#0000
HR 13
00003 @ADD(30)
00004 @ADB(50)
LR
DM
HR
LR
DM
HR
#
#
HR
20
0010
10
22
0012
12
0000
0000
13
161
BCD Calculations
5-18-7 BCD SUBTRACT – SUB(31)
Description
Section 5-18
SUB(31)
Mi
Su
R
Ladder Symbols
@SUB(31)
Mi
Su
R
Operand Data Areas
Mi: Minuend word (BCD)
IR, SR, AR, DM, HR, TC, LR, #
Su: Subtrahend word (BCD)
IR, SR, AR, DM, HR, TC, LR, #
R: Result word
IR, AR, DM, HR, LR
When the execution condition is OFF, SUB(31) is not executed. When the execution 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 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 (see example below).
Mi – Su – CY CY R
Flags
Example
ER: Mi and/or Su is not BCD.
Indirectly addressed DM word is non-existent. (Content of * DM word is not BCD, or the DM area boundary has been exceeded.)
CY: ON when the result is negative, i.e., when Mi is less than Su plus CY.
EQ: ON when the result is 0.
!
Caution Be sure to clear the carry flag with CLC(41) before executing SUB(31) if its previous 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 convert the output result to the true value, subtract the value in R from 0.
When 00002 is ON, the following ladder program clears CY, subtracts the contents 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 subtraction 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 subtraction operation is to be performed, 00002 will need to be turned OFF for at least one cycle (resetting HR 2100) and then turned back ON.
00002
TR 0
25504
25504
HR 2100
CLC(41)
@SUB(31)
010
DM 0100
HR 20
CLC(41)
First subtraction
@SUB(31)
#0000
HR 20
HR 21
HR 2100
Turned ON to indicate negative result.
Second subtraction
Address Instruction
00000 LD
00001 OUT
00002 CLC(41)
00003 @SUB(31)
Operands
TR
00002
0
DM
HR
010
0100
20
25504 00004 AND
00005 CLC(41)
00006 @SUB(31)
00007 LD
00008 AND
00009 OR
00010 OUT
#
HR
HR
TR
HR
HR
The first and second subtractions for this diagram are shown below using example 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
CY – 0
– 3452
HR 20 7577 (1029 + (10000 – 3452))
CY
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.
0000
20
20
0
25504
2100
2100
163
BCD Calculations
5-18-8 DOUBLE BCD SUBTRACT – SUBL(55)
Description
Section 5-18
Ladder Symbols
SUBL(55)
Mi
Su
R
@SUBL(55)
Mi
Su
R
Operand Data Areas
Mi: First minuend word (BCD)
IR, SR, AR, DM, HR, TC, LR, #
Su: First subtrahend word (BCD)
IR, SR, AR, DM, HR, TC, LR, #
R: First result word
IR, AR, DM, HR, LR
When the execution condition is OFF, SUBL(55) is not executed. When the execution 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
–
R + 1
CY
R
Flags ER: Mi, M+1,Su, or Su+1 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.)
CY: ON when the result is negative, i.e., when Mi is less than Su.
EQ: ON when the result is 0.
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
Example
Section 5-18
DM 0001 so that a negative result can be subtracted from 0 (inputting an 8-digit constant is not possible).
00003
TR 0
25504
25504
HR 2100
CLC(41)
@SUBL(55)
HR 20
120
DM 0100
@BSET(71)
#0000
DM 0000
DM 0001
CLC(41)
First subtraction
@SUBL(55)
DM 0000
DM 0100
DM 0100
HR 2100
Turned ON to indicate negative result.
Second subtraction
Address Instruction
00000
00001
00002
00003
LD
OUT
CLC(41)
@SUBL(55)
TR
Operands
00003
0
00004
00005
AND
@BSET(71)
HR
DM
20
120
0100
25504
#
DM
DM
0000
0000
0001
Address Instruction
00006
00007
CLC(41)
@SUBL(55)
00008
00009
00010
00011
LD
AND
OR
OUT
Operands
DM
DM
DM
TR
HR
HR
0000
0100
0100
0
25504
2100
2100
5-18-9 BCD MULTIPLY – MUL(32)
MUL(32)
Md
Mr
R
Ladder Symbols
@MUL(32)
Md
Mr
R
Operand Data Areas
Md: Multiplicand (BCD)
IR, SR, AR, DM, HR, TC, LR, #
Mr: Multiplier (BCD)
IR, SR, AR, DM, HR, TC, LR, #
R: First result word
IR, AR, DM, HR LR
165
BCD Calculations
Description
Example
00000
Section 5-18
When the execution condition is OFF, MUL(32) is not executed. When the execution condition is ON, MUL(32) multiplies Md by the content of Mr, and places the result In R and R+1.
X
Md
Mr
R +1 R
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.
MUL(32)
013
DM 0005
HR 07
Address Instruction
00000 LD
00001 MUL(32)
Operands
00000
DM
HR
013
00005
07
Md: IR 013
3 3 5 6
X
Mr: DM 0005
0 0 2 5
R+1: HR 08 R: HR 07
0 0 0 8 3 9 0 0
Flags ER: Md and/or Mr is not BCD.
Indirectly addressed DM word is non-existent. (Content of * DM word is not BCD, or the DM area boundary has been exceeded.)
CY: ON when there is a carry in the result.
EQ: ON when the result is 0.
5-18-10 DOUBLE BCD MULTIPLY – MULL(56)
Ladder Symbols
MULL(56)
Md
Mr
R
@MULL(56)
Md
Mr
R
Operand Data Areas
Md: First multiplicand word (BCD)
IR, SR, AR, DM, HR, TC, LR, #
Mr: First multiplier word (BCD)
IR, SR, AR, DM, HR, TC, LR, #
R: First result word
IR, AR, DM, HR LR
166
BCD Calculations
Description
Section 5-18
When the execution condition is OFF, MULL(56) is not executed. When the execution 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
Mr + 1
Md
Mr x
R + 1 R + 2 R + 1 R
Flags ER: Md, Md+1,Mr, or Mr+1 is not BCD.
Indirectly addressed DM word is non-existent. (Content of
*
DM word is not BCD, or the DM area boundary has been exceeded.)
CY: ON when there is a carry in the result.
EQ: ON when the result is 0.
5-18-11 BCD DIVIDE – DIV(33)
Ladder Symbol
DIV(33)
Dd
Dr
R
Operand Data Areas
Dd: Dividend word (BCD)
IR, SR, AR, DM, HR, TC, LR, #
Dr: Divisor word (BCD)
IR, SR, AR, DM, HR, TC, LR, #
R: First result word (BCD)
IR, AR, DM, HR, LR
Limitations
Description
R and R+1 must be in the same data area.
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
R+1
Quotient
R
Dr Dd
Flags ER: Dd or Dr is not in 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 0.
167
BCD Calculations
Example
00000
Dd: HR 09
0 0 0 3
Section 5-18
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. Example data and calculations are shown below the program.
DIV(33)
020
HR 09
DM 0017
Remainder Quotient
R: DM 0017 R + 1: DM 0018
1 1 5 0 0 0 0 2
Dd: IR 020
3 4 5 2
Address Instruction
00000 LD
00001 DIV(33)
Operands
00000
HR
DM
020
09
0017
5-18-12 DOUBLE BCD DIVIDE – DIVL(57)
Description
Ladder Symbols
DIVL(57)
Dd
Dr
R
@DIVL(57)
Dd
Dr
R
Operand Data Areas
Dd: First dividend word (BCD)
IR, SR, AR, DM, HR, TC, LR
Dr: First divisor word (BCD)
IR, SR, AR, DM, HR, TC, LR
R: First result word
IR, AR, DM, HR LR
When the execution condition is OFF, DIVL(57) is not executed. When the execution 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.
R+3
Remainder
R+2 R+1
Quotient
R
Dr+1 Dr Dd+1 Dd
Flags ER: Dr and Dr+1 contain 0.
Dd, Dd+1, Dr, or Dr+1 is 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 0.
168
BCD Calculations
5-18-13 FLOATING POINT DIVIDE – FDIV(79)
Limitations
Description
Section 5-18
Ladder Symbols
FDIV(79)
Dd
Dr
R
@FDIV(79)
Dd
Dr
R
Operand Data Areas
Dd: First dividend word (BCD)
IR, SR, AR, DM, HR, TC, LR
Dr: First divisor word (BCD)
IR, SR, AR, DM, HR, TC, LR
R: First result word
IR, AR, DM, HR LR
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.
When the execution condition is OFF, FDIV(79) is not executed. When the execution 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
Flags
Example
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 exponent (0 to 7) sign of exponent 0: +
1: – mantissa (leftmost 3 digits)
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 mantissa (leftmost 4 digits)
= 0.1111111 x 10 –2
ER: Dr and Dr+1 contain 0.
Dd, Dd+1, Dr, or Dr+1 is not BCD.
The result is not between 0.0000001 x 10 –7 and 0.999999 x 10 +7 .
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.
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 10
4
). All of the moves are to place the proper data into consecutive 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
00000
Address Instruction
00000 LD
00001 @MOV(21)
00002 @MOV(21)
00003 @MOV(21)
00004 @MOV(21)
#
HR
#
HR
00005 @MOVD(83)
DM
#
HR
#
HR
#
HR
Operands
00000
0000
00
0000
02
4000
01
4000
03
0000
0021
01
@MOVD(83)
DM 0001
#0021
HR 03
@MOVD(83)
DM 0001
#0300
HR 02
@FDIV(79)
HR 00
HR 02
DM 0002
@MOV(21)
#0000
HR 00
@MOV(21)
#0000
HR 02
@MOV(21)
#4000
HR 01
@MOV(21)
#4000
HR 03
@MOVD(83)
DM 0000
#0021
HR 01
@MOVD(83)
DM 0000
#0300
HR 00
HR 01 HR 00
0 0 0 0
0000
HR 01 HR 00
4 0 0 0 0 0 0 0
4000
DM 0000
3 4 5 2
HR 01 HR 00
4 3 4 5 0 0 0 0
DM 0000
3 4 5 2
HR 01 HR 00
4 3 4 5 2 0 0 0
÷
HR 01 HR 00
4 3 4 5 2 0 0 0
HR 03 HR 02
4 0 0 7 9 0 0 0
DM 0003 DM 0002
2 4 3 6 9 6 2 0
0.4369620 x 10
2
Address Instruction
00006 @MOVD(83)
Operands
DM
#
HR
0000
0300
00
00007 @MOVD(83)
DM
#
HR
0001
0021
03
00008 @MOVD(83)
DM
#
HR
0001
0300
02
00009 @FDIV(79)
HR
HR
DM
00
02
0002
Section 5-18
171
BCD Calculations
5-18-14 SQUARE ROOT – ROOT(72)
Ladder Symbols
Description
Section 5-18
ROOT(72)
Sq
R
@ROOT(72)
Sq
R
Operand Data Areas
Sq: First source word (BCD)
IR, SR, AR, DM, HR, TC, LR
R: Result word
IR, AR, DM, HR, LR,
When the execution condition is OFF, ROOT(72) is not executed. When the execution 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 truncated.
R
Sq+1 Sq
Flags
Example
ER: Sq is 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 0.
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 number 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 different 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
00000
25505
Address Instruction
00000 LD
00001 @BSET(71)
#
DM
DM
@CMP(20)
DM 0103
#4900
@INC(38)
011
Operands
00000
0000
0100
0101
00002 @MOV(21)
DM
010
0101
00003 @ROOT(72)
DM
DM
0100
0102
00004 @MOV(21)
# 0000
011
00005 @MOV(21)
#
DM
0000
0103
@BSET(71)
#0000
DM 0100
DM 0101
@MOV(21)
010
DM 0101
@ROOT(72)
DM 0100
DM 0102
@MOV(21)
#0000
011
@MOV(21)
#0000
DM 0103
@MOVD(83)
DM 0102
#0012
011
@MOVD(83)
DM 0102
#0210
DM 0103
DM 0101 DM 0100
0 0 0 0 0 0 0 0
0000 0000
010
6 0 1 7
DM 0101 DM 0100
6 0 1 7 0 0 0 0
60170000= 7756.932
DM 0103 IR 011
0 0 0 0 0 0 0 0
0000 0000
DM 0102
7 7 5 6
IR 011 DM 0103
0 0 7 7 5 6 0 0
5600 > 4900
Address
IR 011
0 0 7 8
Instruction
00006 @MOVD(83)
Operands
00007
00008
00009
@MOVD(83)
@CMP(20)
LD
00010 @INC(38)
DM
#
DM
#
DM
DM
#
25505
0102
0012
011
0102
0210
0103
0103
4900
011
Section 5-18
173
Binary Calculations Section 5-19
5-19 Binary Calculations
The binary calculation instructions – ADB(50), SBB(51), MLB(52) and DVB(53)
– all perform arithmetic operations on hexadecimal data.
The addition and subtraction instructions include CY in the calculation as well as in the result. Be sure to clear CY if its previous status is not required in the calculation, and to use the result placed in CY, if required, before it is changed by the execution of any other instruction. STC(40) and CLC(41) can be used to control
CY. Refer to 5-18 BCD Calculations.
5-19-1 BINARY ADD – ADB(50)
ADB(50)
Au
Ad
R
Ladder Symbols
@ADB(50)
Au
Ad
R
Operand Data Areas
Au: Augend word (binary)
IR, SR, AR, DM, HR, TC, LR, #
Ad: Addend word (binary)
IR, SR, AR, DM, HR, TC, LR, #
R: Result word
IR, AR, DM, HR, LR
Description When the execution condition is OFF, ADB(50) is not executed. When the execution 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
Flags
Examples
00000
TR 0
25504
25504
ER: Indirectly addressed DM word is non-existent. (Content of
*
DM word is not BCD, or the DM area boundary has been exceeded.)
CY: ON when the result is greater than FFFF.
EQ: ON when the result is 0.
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.
CLC(41)
ADB(50)
010
DM 0100
HR 10
MOV(21)
#0000
HR 11
MOV(21)
#0001
HR 11
= R
= R+1
= R+1
Address Instruction
00000 LD
00001 OUT
00002 CLC(41)
00003 ADB(50)
Operands
TR
00000
0
00004
00005
AND NOT
MOV(21)
00006 LD
00007 AND
00008 MOV(21)
DM
HR
#
HR
TR
#
HR
010
0100
10
25504
0000
11
0
25504
00001
11
174
Binary Calculations
00000
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
The following example performs eight-digit addition by using ADB(50) twice.
ADB(50) is also used to place the carry into DM 0302 (one word greater than the rest of the answer). The complete answer thus ends up in DM 0300 through DM
0302.
CLC(41)
@ADB(50)
LR 20
DM 0200
DM 0300
@ADB(50)
LR 21
DM 0201
DM 0301
@ADB(50)
#0000
#0000
DM 0302
Address Instruction
00000 LD
00001 CLC(41)
00002 @ADB(50)
00003 @ADB(50)
00004 @ADB(50)
LR
DM
DM
LR
DM
DM
#
#
DM
Operands
00000
20
0200
0300
21
0201
0301
0000
0000
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.
Lower 4 digits.
Au: LR 20
A 6 E 2
Higher 4 digits.
Au: LR 21
4 F 5 2
+
Ad: DM 0200
8 0 C 5
R: DM 0300
2 7 A 7
CY = 1
+
Ad: DM 0201
E C 3 B
R: DM 0301
3 B 8 E
CY = 1
R+2: DM 0302 R+1: DM 0301 R: DM 0300
0 0 0 1 3 B 8 E 2 7 A 7
175
Binary Calculations
5-19-2 BINARY SUBTRACT – SBB(51)
Description
Section 5-19
SBB(51)
Mi
Su
R
Ladder Symbols
@SBB(51)
Mi
Su
R
Operand Data Areas
Mi: Minuend word (binary)
IR, SR, AR, DM, HR, TC, LR, #
Su: Subtrahend word (binary)
IR, SR, AR, DM, HR, TC, LR, #
R: Result word
IR, AR, DM, HR, LR
When the execution condition is OFF, SBB(51) is not executed. When the execution 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 complement of the actual result is placed in R.
Mi – Su – CY CY R
Flags
Example
ER: Indirectly addressed DM word is non-existent. (Content of
*
DM word is not BCD, or the DM area boundary has been exceeded.)
CY: ON when the result is negative, i.e., when Mi is less than Su plus CY.
EQ: ON when the result is 0.
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 subtracted from zero to obtain the true result, which is placed in HR 10 and HR 11,
176
Binary Calculations
00000
TR 0
25504
25504
25504
Section 5-19 and either #0000 or #0001 is placed in HR 12 (0001 indicates a negative answer).
CLC(41)
Address Instruction
00000 LD
00001 OUT
00002 CLC(41)
00003 SBB(51)
Operands
TR
00000
0
SBB(51)
010
DM 0100
HR 10
SBB(51)
011
DM 0101
HR 11
CLC(41)
00004 SBB(51)
DM
HR
DM
HR
010
0100
10
011
0101
11
25505 00005 AND
00006 CLC(41)
00007 SBB(51)
SBB(51)
#0000
HR 10
HR 10
SBB(51)
#0000
HR 11
HR 11
MOV(21)
#0000
HR 12
MOV(21)
#0001
HR 12
00008 SBB(51)
00009 LD
00010 AND NOT
00011 MOV(21)
00012 LD
00013 AND
00014 MOV(21)
#
HR
HR
#
HR
HR
TR
#
HR
TR
0000
10
10
0000
11
11
0
25504
0000
12
0
25504
#
HR
0000
12
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
Flags
Section 5-19
#0000 – 6851 –1 (from CY = 1) = 0000 + (10000 – 6851 – 1) = 97AE.
The content of HR 12, #0001, indicates a negative result.
–
–
Lower 4 digits.
Mi: IR 010
5 A 1 0
Su: DM 0100
6 0 E 3
0 0 0 0
CY = 0
(from CLC(41))
Higher 4 digits.
Mi: IR 011
2 0 F 5
–
Su: DM 0101
B 8 A 3
–
0 0 0 1
20F5 + (10000 – B8A3) – 1 5A10 + (10000 – 60E3)
R: HR 10
F 9 2 D
CY = 1
R: HR 11
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
5-19-3 BINARY MULTIPLY – MLB(52)
Description
MLB(52)
Md
Mr
R
Ladder Symbols
@MLB(52)
Md
Mr
R
Operand Data Areas
Md: Multiplicand word (binary)
IR, SR, AR, DM, HR, TC, LR, #
Mr: Multiplier word (binary)
IR, SR, AR, DM, HR, TC, LR, #
R: First result word
IR, AR, DM, HR LR
When the execution condition is OFF, MLB(52) is not executed. When the execution 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.
X
R +1
Md
Mr
R
ER: 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.
178
Logic Instructions Section 5-20
5-19-4 BINARY DIVIDE – DVB(53)
Description
DVB(53)
Dd
Dr
R
Ladder Symbols
@DVB(53)
Dd
Dr
R
Operand Data Areas
Dd: Dividend word (binary)
IR, SR, AR, DM, HR, TC, LR, #
Dr: Divisor word (binary)
IR, SR, AR, DM, HR, TC, LR, #
R: First result word
IR, AR, DM, HR LR
When the execution condition is OFF, DVB(53) is not executed. When the execution 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
Flags ER: Dr contains 0.
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.
5-20 Logic Instructions
The logic instructions – COM(29), ANDW(34), ORW(35), XORW(36), and
XNRW(37) – perform logic operations on word data.
5-20-1 COMPLEMENT – COM(29)
Ladder Symbols Operand Data Areas
COM(29)
Wd
@COM(29)
Wd
Wd: Complement word
IR, AR, DM, HR, LR
Description
Example
When the execution condition is OFF, COM(29) is not executed. When the execution condition is ON, COM(29) clears all ON bits and sets all OFF bits in Wd.
15 00
Original 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1
Flags
Complement
15 00
0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0
ER: 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.
179
Logic Instructions
5-20-2 LOGICAL AND – ANDW(34)
Description
Example
Section 5-20
Ladder Symbols
ANDW(34)
I1
I2
R
@ANDW(34)
I1
I2
R
Operand Data Areas
I1: Input 1
IR, SR, AR, DM, HR, TC, LR, #
I2: Input 2
IR, SR, AR, DM, HR, TC, LR, #
R: Result word
IR, AR, DM, HR, LR
When the execution condition is OFF, ANDW(34) is not executed. When the execution condition is ON, ANDW(34) logically AND’s the contents of I1 and I2 bit-by-bit and places the result in R.
I1
I2
15 00
1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1
15 00
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
R
15 00
0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1
Flags ER: 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.
5-20-3 LOGICAL OR – ORW(35)
Ladder Symbols
ORW(35)
I1
I2
R
@ORW(35)
I1
I2
R
Operand Data Areas
I1: Input 1
IR, SR, AR, DM, HR, TC, LR, #
I2: Input 2
IR, SR, AR, DM, HR, TC, LR, #
R: Result word
IR, AR, DM, HR, LR
180
Logic Instructions
Description
Example
Section 5-20
When the execution condition is OFF, ORW(35) is not executed. When the execution condition is ON, ORW(35) logically OR’s the contents of I1 and I2 bit-by-bit and places the result in R.
I1
15 00
1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1
I2
15 00
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
R
15 00
1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1
Flags ER: 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.
5-20-4 EXCLUSIVE OR – XORW(36)
Ladder Symbols
XORW(36)
I1
I2
R
@XORW(36)
I1
I2
R
Operand Data Areas
I1: Input 1
IR, SR, AR, DM, HR, TC, LR, #
I2: Input 2
IR, SR, AR, DM, HR, TC, LR, #
R: Result word
IR, AR, DM, HR, LR
Description
Example
When the execution condition is OFF, XORW(36) is not executed. When the execution condition is ON, XORW(36) exclusively OR’s the contents of I1 and I2 bit-by-bit and places the result in R.
I1
15 00
1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1
I2
15 00
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Flags
R
15 00
1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0
ER: 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.
181
Subroutines and Interrupt Control
5-20-5 EXCLUSIVE NOR – XNRW(37)
Description
Section 5-21
Ladder Symbols
XNRW(37)
I1
I2
R
@XNRW(37)
I1
I2
R
Operand Data Areas
I1: Input 1
IR, SR, AR, DM, HR, TC, LR, #
I2: Input 2
IR, SR, AR, DM, HR, TC, LR, #
R: Result word
IR, AR, DM, HR, LR
When the execution condition is OFF, XNRW(37) is not executed. When the execution condition is ON, XNRW(37) exclusively NOR’s the contents of I1 and I2 bit-by-bit and places the result in R.
I1
15 00
1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1
I2
15 00
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
15 00
0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 R
Flags ER: 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.
5-21 Subroutines and Interrupt Control
5-21-1 Overview
Subroutines break large control tasks into smaller ones and enable you to reuse a given set of instructions. When the main program calls a subroutine, control is transferred to the subroutine and the subroutine instructions are executed. The instructions within a subroutine are written in the same way as main program code. When all the subroutine instructions have been executed, control returns to the main program to the point just after the point from which the subroutine was entered (unless otherwise specified in the subroutine).
Subroutines may also be activated by interrupts. Like subroutine calls, interrupts cause a break in the flow of the main program execution such that the flow can be resumed from that point after completion of the subroutine. An interrupt is caused either by an external source, such as an input signal from an Interrupt
Input Unit, or a scheduled interrupt. In the case of the scheduled interrupt, the interrupt signal is repeated at regular intervals.
Whereas subroutine calls are controlled from within the main program, subroutines activated by interrupts are triggered when the interrupt signal is received.
Also, multiple interrupts from different Interrupt Input Units can occur at the same time. To effectively deal with this, the PC employs a priority scheme for handling interrupts.
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) provides such functions as masking of interrupts (so that they are recorded but ignored) and clearing of interrupts.
5-21-2 SUBROUTINE DEFINE and RETURN – SBN(92)/RET(93)
Ladder Symbols Definer Data Areas
SBN(92) N
N: Subroutine number
# (00 to 99)
RET(93)
Limitations
Description
Precautions
Each subroutine number can be used in SBN(92) once only, i.e., up to 100 subroutines may be programmed. Subroutine numbers 00 through 31 are used by
Interrupt Input Units and subroutine number 99 is used for the scheduled interrupt. Refer to 5-21-4 INTERRUPT CONTROL – INT(89) for details.
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 subroutine 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 executed 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.)
If SBN(92) is mistakenly placed in the main program, it will inhibit program execution 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 operand bit may stay ON longer than one cycle.
Flags There are no flags directly affected by these instructions.
5-21-3 SUBROUTINE ENTER – SBS(91)
Ladder Symbol
SBS(91) N
Definer Data Areas
N: Subroutine number
# (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 execution 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 execution returns to the original subroutine which is then completed before returning 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.
SBN(92) 10 SBN(92) 11 SBN(92) 12
SBS(91) 10 SBS(91) 11 SBS(91) 12
RET(93) RET(93) RET(93)
Although subroutines 00 through 31 can be called by using SBS(91), they are also activated by interrupt signals from Interrupt Input Units. Subroutine 99, which can also be called using SBS(91), is used for the scheduled interrupt. (Refer to the next subsection for details.)
184
Subroutines and Interrupt Control Section 5-21
The following diagram illustrates program execution flow for various execution conditions for two SBS(91).
Main program
A
SBS(91)
B
SBS(91)
00
01
OFF execution conditions for subroutines 00 and 01
A B C
ON execution condition for subroutine 00 only
A D B C
C
ON execution condition for subroutine 01 only
A B E C
Subroutines
SBN(92)
D
RET(93)
SBN(92)
00
01
E
RET(93)
END(01)
ON execution conditions for subroutines 00 and 01
A D B E C
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.
5-21-4 INTERRUPT CONTROL – INT(89)
Limitations
INT(89)
CC
N
D
Ladder Symbols
@INT(89)
CC
N
D
Operand Data Areas
CC: Control code
# (000 to 002)
N: Interrupt designator
# (004)
D: Control data
IR, AR, DM, HR, TC, LR, TR, #
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 scheduled 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
Description
Scheduling the Interrupt
CC = 000
(Interval)
Section 5-21
INT(89) is used to control the scheduled interrupt. Subroutine 99 can be established 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
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 interrupt and the time to the first scheduled interrupt (CC = 001. Unstable operation may result is the time to the first interrupt is not set.
To set the time interval for the scheduled interrupt, set CC to 000 and set D to any 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
(Time to First Interrupt)
To set the time to the first interrupt, set CC to 001 and set D to any value between
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
(Read Interval)
Flags
To access the current time interval for the scheduled interrupt, set CC 002. The current time interval will be places in D
ER: CC, D, or N is not within specified values.
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 program shows the overall structure and operation of the scheduled 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 scheduled 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
Main program
Subroutine
Interrupts every 20 ms
INT(89)
000
004
#0002 Set at 20 ms.
Main program execution
SBN(92) 99
RET(93)
Returned from scheduled interrupt routine
Address Instruction
00000 LD
00001 INT(89)
00002 INT(89)
#
#
Operands
25315
001
004
0002
000
004
0002
Address Instruction
Main program.
00500 SBN(92)
Subroutine.
00600 RET(93)
Operands
99
187
Step Instructions Section 5-22
5-22 Step Instructions
The step instructions STEP(08) and SNXT(09) are used in conjunction to set up breakpoints between sections in a large program so that the sections can be executed as units and reset upon completion. A section of program will usually be defined to correspond to an actual process in the application. (Refer to the application examples later in this section.) A step is like a normal programming code, except that certain instructions (e.g., IL(02)/ILC(03), JMP(04)/JME(05)) may not be included.
5-22-1 STEP DEFINE and STEP START–STEP(08)/SNXT(09)
Ladder Symbols
STEP(08) B STEP(08)
Definer Data Areas
B: Control bit
IR, AR, HR, LR
Limitations
Description
SNXT(09) B B: Control bit
IR, AR, HR, LR
All control bits must be in the same word and must be consecutive.
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 execution 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 different locations before the step to control the step according to two different execution 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
Step controlled by LR 2000
SNXT(09) LR 2000
Starts step execution
STEP(08) LR 2000
1st step
00001
SNXT(09) LR 2001
STEP(08) LR 2001
Step controlled by LR 2001
2nd step
00002
SNXT(09) 2002
STEP(08) Ends step execution
Address Instruction
00000 LD
00001 SNXT(09)
00002 STEP(08)
LR
LR
Operands
00000
2000
2000
Step controlled by 20200.
00100 LD
00101 SNXT(09) LR
00001
2001
Address Instruction
00102 STEP(08)
Operands
LR
Step controlled by 20201.
2001
00200 LD
00201 SNXT(09)
00202 STEP(08)
LR
---
00002
2002
Precautions
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 positioning of, SNXT(09) determine how the steps are executed. The three examples given below demonstrate these three types of step execution.
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
Flags
Section 5-22
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
00100
25407
SNXT(09) 01000
STEP(08) 01000
01000
Start
CP
R
CNT 01
#0003
25407
1 cycle
Address Instruction
00000 LD
00001 SNXT(09)
00002 STEP(08)
00003 LD
Operands
00000
01000
01000
00100
Address Instruction
00004 LD
00005 CNT
#
Operands
25407
01
0003
Examples
Example 1:
Sequential Execution
The following three examples demonstrate the three types of execution control possible with step programming. Example 1 demonstrates sequential execution; example 2, branching execution; and example 3, parallel execution.
The following process requires that three processes, loading, part installation, and inspection/discharge, be executed in sequence with each process being reset 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 3
SW 4
190
Loading Part installation Inspection/discharge
Step Instructions Section 5-22
The following diagram demonstrates the flow of processing and the switches that are used for execution control.
Process A
SW1
Process B
SW2
SW3
Process C
SW4
Loading
Part Installation
Inspection/discharge
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)
00002 (SW2)
Process A
00003 (SW3)
Process B
00004 (SW4)
Process C
SNXT(09) 12800
Process A started.
STEP(08) 12800
SNXT(09) 12801
Process A reset.
Process B started.
STEP(08) 12801
SNXT(09) 12802
Process B reset.
Process C started.
STEP(08) 12802
SNXT(09) 12803
Process C reset.
STEP(08)
Address Instruction
00000 LD
00001 SNXT(09)
00002 STEP(08)
Process A
00100 LD
00101 SNXT(09)
00102 STEP(08)
Operands
00001
12800
12800
00002
12801
12801
Address Instruction
Process B
00100 LD
00101 SNXT(09)
00102 STEP(08)
Process C
00200 LD
00201 SNXT(09)
00202 STEP(08)
Operands
00003
12802
12802
00004
12803
---
Example 2:
Branching Execution
192
The following process requires that a product is processed in one of two ways, depending on its weight, before it is printed. The printing process is the same
Step Instructions
Weight scale
Section 5-22 regardless of which of the first processes is used. Various sensors are positioned to signal when processes are to start and end.
SW A1
SW A2
Printer
SW D
Process A
Process B
SW B1
SW B2
Process C
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.
Process A
SW A1
Process C
SW A2
SW D
End
Process B
SW B1
SW B2
The program for this process, shown below, starts with two SNXT(09) instructions 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.
00001 (SW A1) 00002 (SW B2)
00001 (SW A1) 00002 (SW B2)
00003 (SW A2)
Process A
00004 (SW B2)
Process B
00005 (SW D)
Process C
SNXT(09) HR 0000
SNXT(09) HR 0001
STEP(08) HR 0000
Process A started.
SNXT(09) HR 0002
Process A reset.
Process C started.
STEP(08) HR 0001
SNXT(09) HR 0002
Process B reset.
Process C started.
STEP(08) HR 0002
SNXT(09) HR 0003
Process C reset.
STEP(08)
Address Instruction
00000 LD
00001 AND NOT
00002 SNXT(09)
00003 LD NOT
00004 AND
00005 SNXT(09)
00006 STEP(08)
Process A
00100 LD
00101 SNXT(09)
00102 STEP(08)
Operands
HR
HR
HR
00001
00002
0000
00001
00002
0001
0000
HR
HR
00003
0002
0001
Address Instruction
Process B
00100 LD
00101 SNXT(09)
00102 STEP(08)
Process C
00200 LD
00201 SNXT(09)
00202 STEP(08)
Operands
HR
HR
HR
---
00004
0002
0002
00005
0003
194
Step Instructions
Example 3:
Parallel Execution
SW1
Section 5-22
The following process requires that two parts of a product pass simultaneously 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 A
SW3 SW5 SW7
Process B
Process D
Process E
SW2
Process C
SW4
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 B
SW3
SW 1 and SW2 both ON
SW5 and SW6 both ON
Process E
SW7
End
Process C
Process D
SW4
The program for this operation, shown below, starts with two SNXT(09) instructions that start processes A and C. These instructions branch from the same instruction 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
00001 (SW1 and SW2))
SNXT(09) LR 0000
Process A started.
Process C started.
SNXT(09) LR 0002
STEP(08) LR 0000
Section 5-22
Process A
00002 (SW3)
SNXT(09) LR 0001
Process A reset.
Process B started.
STEP(08) LR 0001
Process B
01101
00003 (SW4)
00004 (SW5 and SW6)
LR 0003
Used to turn off process D.
SNXT(09) LR 0004
Process E started.
STEP(08) LR 0002
Process C
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
Address Instruction
00000 LD
00001 SNXT(09)
00002 SNXT(09)
00003 STEP(08)
Process A
00100 LD
00101 SNXT(09)
00102 STEP(08)
Process B
00100 LD
00101 OUT
0003
00101 AND
00101 SNXT(09)
LR
LR
LR
Operands
00001
0000
0002
0000
LR
LR
LR
00002
0001
0001
01101
LR
00004
0004
Address Instruction
00102 STEP(08)
Process C
00200 LD
00201 SNXT(09)
00202 STEP(08)
Process D
00300 STEP(08)
Process E
00400 LD
00401 SNXT(09)
00402 STEP(08)
Operands
LR 0002
LR
LR
LR
LR
00003
0003
0003
0004
00005
0005
---
5-23 Special Instructions
The instructions in this section are used for various operations, including programming user error codes and messages, counting ON bits, setting the watchdog timer, and refreshing I/O during program execution.
5-23-1 FAILURE ALARM – FAL(06) and
SEVERE FAILURE ALARM – FALS(07)
Ladder Symbols Definer Data Areas
FAL(06) N @FAL(06) N
N: FAL number
# (00 to 99)
Description
FALS(07) N
N: FAL number
# (01 to 99)
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 between 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
X10 1 X10 0
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 indicator 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 indicator will light and PC operation will stop.
197
Special Instructions Section 5-23
Resetting Errors
The system also generates error codes to the FAL area.
A maximum of three FAL error codes will be retained in memory, although only one of these is available in the FAL area. To access the other FAL codes, reset the FAL area by executing FAL(06) 00. Each time FAL(06) 00 is executed, another FAL error will be moved to the FAL area, clearing the one that is already there.
FAL(06) 00 is also used to clear message programmed with the instruction,
MSG(46).
If the FAL area cannot be cleared, as is generally the case when FALS(07) is executed, first remove the cause of the error and then clear the FAL area through the Programming Console (see 4-6-5 Clearing Error Messages).
5-23-2 CYCLE TIME – SCAN(18)
Ladder Symbols
Operand Data Areas
Mi: Multiplier (BCD)
IR, SR, AR, DM, HR, TC, LR, #
---: Not used.
SCAN(18)
Mi
---
---
@SCAN(18)
Mi
---
---
---: Not used.
Limitations
Description
Flags
Mi must be BCD. Only the rightmost three digits of Mi are used.
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.
ER: Indirectly addressed DM word is non-existent. (Content of * DM word is not BCD, or the DM area boundary has been exceeded.)
Mi is not BCD.
5-23-3 MESSAGE DISPLAY – MSG(46)
Ladder Symbols
MSG(46)
FM
@MSG(46)
FM
Operand Data Areas
FM: First message word
IR, AR, DM, HR, LR
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 Programming Console, GPC, or FIT. The displayed message can be up to 16 characters 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
Message Buffering and
Priority
Clearing Messages
Flags
Example
00000
00001
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.
Up to three messages can be buffered in memory. Once stored in the buffer, they 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 address values have higher priority.
In handling indirectly addressed messages (i.e.
*
DM), those with the lowest DM address values have higher priority.
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.
ER: Indirectly addressed DM word is non-existent. (Content of
*
DM word is not BCD, or the DM area boundary has been exceeded.)
The following example shows the display that would be produced for the instruction and data given when 00000 was ON. If 00001 goes ON, a message will be cleared.
MSG(46)
DM 0010
FAL(06) 00
Address Instruction
00000 LD
00001 MSG(46)
00002 LD
00003 FAL(06)
Operands
00000
DM 0010
00001
00
DM 0010 4
DM 0011 4
DM 0012 4
DM 0013 4
DM 0014 4
DM 0015 4
DM 0016 4
DM 0017 4
DM contents
7
9
B
D
F
1
3
5
4
4
4
4
5
4
4
4
8
A
C
E
0
2
4
6
K
M
O
C
E
I
G
A
ASCII equivalent
B
D
F
H
J
L
N
P
MSG
ABCDEFGHIJKLMNOP
199
Special Instructions
5-23-4 LONG MESSAGE – LMSG(47)
Ladder Symbols
LMSG(47)
S
D
---
@LMSG(47)
S
D
---
Section 5-23
Operand Data Areas
S: First source word (ASCII)
IR, AR, DM, HR, TC, LR
D: Destination
# (000)
---: Not used.
Limitations
Description
S through S+15 must be in the same data area and must be in ASCII. The message will be truncated if a null character (00) is contained between S and S+15.
LMSG(47) is used to output a 32-character message to a Programming Console. The message to be output must be in ASCII beginning in word S and ending in S+15, unless a shorter message is desired. A shorter message can be produced 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. Although LMSG(47) will be executed as normal, the message will not appear correctly on the Programming Console unless TERMINAL mode is set.
Flags
Example
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.)
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 previous section for an example using MSG(46).
5-23-5 TERMINAL MODE – TERM(48)
Ladder Symbols
TERM(48)
---
---
---
@TERM(48)
---
---
---
Description When the execution condition is OFF, TERM(48) is not executed. When the execution condition is ON, the Programming Console can be switched to TERMI-
NAL mode by pressing the CHG key on the Programming Console. The Programming 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
5-23-6 SET SYSTEM – SYS(49)
Ladder Symbols
SYS(49)
P
---
---
@SYS(49)
P
---
---
Section 5-23
Operand Data Areas
P: Parameters
#
---: Not used.
---: Not used.
IR, SR, AR, DM, HR, TC, LR, TR, #
Limitations
Description
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.
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 power 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
1 0 1 0 0 0 1 1
7 6 5 4 3 2 1 0
1 1 0 0 0 0 1 1
A 3
Turns ON the Forced Status
Hold Bit (SR 25211).
Turns ON the I/O Status
Hold Bit (SR 25212).
Excludes battery check from system error checks.
Sets the initial operating mode to MONITOR mode.
Initial Operating Mode The factors that determine the PC’s initial operating mode are listed below in order 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 regardless 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, Printer Interface Unit, or Floppy Disk Interface Unit) is connected.
If none of the above conditions is met, the PC will start in RUN mode.
Flags No flags are affected by this instruction.
5-23-7 BIT COUNTER – BCNT(67)
BCNT(67)
N
SB
R
Ladder Symbols
@BCNT(67)
N
SB
R
Operand Data Areas
N: Number of words (BCD)
IR, AR, DM, HR, TC, LR, #
SB: Source beginning word
IR, SR, AR, DM, HR, TC, LR
R: Destination word
IR, AR, DM, HR, TC, LR
Limitations
Description
N cannot be 0.
When the execution condition is OFF, BCNT(67) is not executed. When the execution 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.
5-23-8 VALUE CALCULATE – VCAL(69)
Ladder Symbols
Operand Data Areas
C: Control word
VCAL(69) @VCAL(69)
C C
IR, AR, DM, HR, TC, LR, #
S: Input data source word
S S
D D
IR, SR, AR, DM, HR, TC, LR
D: Result destination word
IR, AR, DM, HR, TC, LR
Limitations
Description
For trigonometric functions, x, the content of S, must be in BCD form and satisfy the condition 0000
≤ x
≤
0900 (0
°≤Θ≤
90
°
).
When the execution condition is OFF, VCAL(69) is not executed. When the execution 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
Flags
Sine Function
00000
Section 5-23 dress, VCAL(69) computes f(x) of the function entered in advance at word C.
The function is a series of line segments (which can approximate a curve) determined by the operator.
* x is the content of S.
ER: Indirectly addressed DM word is non-existent. (Content of * DM word is not BCD, or the DM area boundary has been exceeded.)
For trigonometric functions, x > 0900. (x is the content of S.)
The linear approximation data is not readable.
EQ: The result is 0.
The following example demonstrates the use of the VCAL(69) sine function to calculate the sine of 30
°
. The sine function is specified when C is #0000.
VCAL(69)
#0000
DM 0000
DM 0100
Address Instruction
00000 LD
00001 VCAL(69)
#
DM
DM
Operands
00000
0000
0000
0100
0
0
Input data, x
S: DM 0000
10 1 10 0
3 0
Enter input data not exceeding #0900 in BCD.
10 –1
0
Cosine Function
00000
10 –1
5
Result data
D: DM 0100
10 –2 10 –3
0 0
10 –4
0
Result data has four significant digits, fifth and higher digits are ignored. The result for sin(90) will be 0.9999, not 1.
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.
VCAL(69)
#0001
DM 0010
DM 0110
Address Instruction
00000 LD
00001 VCAL(69)
#
DM
DM
Operands
00000
0001
0010
0110
0
0
Input data, x
S: DM 0010
10 1 10 0
3 0
Enter input data not exceeding #0900 in BCD.
10 –1
0
Linear Approximation
10 –1
8
Result data
D: DM 0110
10 –2 10 –3
6 6
10
0
–4
Result data has four significant digits, fifth and higher digits are ignored. The result for cos(0) will be 0.9999, not 1.
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 approximation data.
The content of word C specifies the number of line segments in the approximation, and whether the input and output are in BCD or BIN form. Bits 00 to 07 contain the number of line segments less 1, m–1, as binary data. Bits 14 and 15 determine, respectively, the output and input forms: 0 specifies BCD and 1 specifies BIN.
203
Special Instructions Section 5-23
Y
4
Y
3
Y
1
Y
Y m
Y
2
Y
0
X
0
Enter the coordinates of the m+1 end-points, which define the m line segments, 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
EEPROM section begins at DM1000.
X
1
X
2
X
3
X
4
X m
X
Word Coordinate
C+1
C+2
C+3
C+4
C+5
C+6
↓
Y
2
↓
C+(2m+1) X m
C+(2m+2) Y m
X m
(max. X value)
Y
0
X
1
Y
1
X
2
00000
Content Coordinate
DM 0000 $C00B
DM 0001 $05F0
DM 0002 $0000
DM 0003 $0005
DM 0004 $0F00
DM 0005 $001A
DM 0006 $0402
↓ ↓
DM 0025 $05F0
DM 0026 $1F20
X
12
Y
0
X
1
Y
1
X
2
Y
2
↓
X
12
Y
12
The following example demonstrates the construction of a linear approximation with 12 line segments. The block of data is continuous, as it must be, from DM
0000 to DM 0026 (C to C + (2
×
12 + 2)). The input data is taken from IR 010, and the result is output to IR 011.
VCAL(69)
DM 0000
010
011
Address Instruction
00000 LD
00001 VCAL(69)
Operands
00000
DM 0000
010
011
Bit
15
Bit
00
1 1 0 0 0 0 0 0 0 0 0 0 1 0 1 1
(Output and
input both BIN)
(m–1 = 11: 12 line segments)
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)
$0005 $0014
5-23-9 WATCHDOG TIMER REFRESH – WDT(94)
Ladder Symbols
$001A
WDT(94) T @WDT(94) T
$05F0
X
Definer Data Areas
T: Watchdog timer value
# (00 to 63)
Description
Precautions
When the execution condition is OFF, WDT(94) is not executed. When the execution condition is ON, WDT(94) extends the setting of the watchdog timer (normally set by the system to 130 ms) by 100 ms times T.
Timer extension = 100 ms x T.
If the cycle time is longer than the time set for the watchdog timer, 9F will be output 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.
Flags There are no flags affected by this instruction.
5-23-10 I/O REFRESH – IORF(97)
Ladder Symbol
IORF(97)
St
E
Operand Data Areas
St: Starting word
IR 000 to IR 049
E: End word
IR 000 to IR 049
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 Expansion 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
Description
Execution Time
St must be less than or equal to E.
To refresh I/O words allocated to CPU or Expansion I/O Racks (IR 000 to
IR 030), simply indicate the first (St) and last (E) I/O words to be refreshed.
When the execution condition for IORF(97) is ON, all words between St and E will be refreshed. This will be in addition to the normal I/O refresh performed during the CPU’s cycle.
To refresh I/O words allocated to Special I/O Units (IR 100 to IR 199), indicate the unit numbers of the Units. IR 040 to IR 049 correspond to Special I/O Units 0 to 9.
For example, set St=IR 043 and E=IR 045 to refresh the I/O words allocated to
Special I/O Units 3, 4, and 5. The I/O words allocated to those Units (IR 130 to
IR 159) will be refreshed when IORF(97) is executed.This will be in addition to the normal I/O refresh performed during the CPU’s cycle.
Note In this instruction, IR 040 to IR 049 are allocated to Group-2 High-density I/O
Units 0 to 9 only. Execution of IORF(97) will have no effect on the content of IR
040 to IR 049.
Refer to 5-23-11 GROUP-2 HIGH-DENSITY I/O REFRESH – MPRF(61) for details on refreshing words allocated to Group-2 High-density I/O Units.
When Standard I/O Units are specified, the execution time for IORF(97) is computed as follows:
T
IORF
=
= instruction execution time + Input Unit I/O refresh time
+ Output Unit I/O refresh time
0.4 ms + 0.07 ms
×
(no. of 8-pt Units + no. of 16-pt Units
×
2)
+ 0.04 ms
×
(no. of 5- and 8-pt Units + no. of 12-pt Units
×
2)
When Special I/O Units are specified, the execution time for IORF(97) is computed as follows:
T
IORF
= instruction execution time +
∑
(Special I/O Unit I/O refresh times)
The instruction execution time is 0.4 ms. Refer to 6-1 Cycle Time for I/O refresh times for Special I/O Units.
Flags There are no flags affected by this instruction.
5-23-11 GROUP-2 HIGH-DENSITY I/O REFRESH – MPRF(61)
Ladder Symbol
MPRF(61)
St
E
Operand Data Areas
St: Starting Unit
#0000 to #0009
E: End Unit
#0000 to #0009
Limitations
Description
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.
When the execution condition is OFF, MPRF(61) is not executed. When the execution 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
Execution Time
Flags
The execution time for MPRF(61) is computed as follows:
T
MPRF
= instruction execution time + initial processing time
+
∑
(Group-2 High-density I/O Unit I/O refresh times)
The instruction execution time is 0.4 ms and the initial processing time is
0.36 ms. Refer to 6-1 Cycle Time for a table showing I/O refresh times for
Group-2 High-density I/O Units.
ER: St or E is not BCD between #0000 and #0009.
St is greater than E.
5-24 Network Instructions
The SYSMAC NET Link/SYSMAC LINK instructions are used for communicating with other PCs linked through the SYSMAC NET Link System or SYSMAC
LINK System. These instructions are applicable to the C200H-CPU31-E only.
5-24-1 NETWORK SEND – SEND(90)
Ladder Symbols
Operand Data Areas
S: Source beginning word
SEND(90) @SEND(90)
IR, SR, AR, DM, HR, TC, LR
S S
D: Destination beginning word
D D
IR, AR, DM, HR, TC, LR
C C
C: First control data word
IR, AR, DM, HR, TC, LR
Limitations
Description
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.
When the execution condition is OFF, SEND(90) is not executed. When the execution condition is ON, SEND(90) transfers data beginning at word S, to addresses 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
C+1
Number of words (0 to 1000 in 4-digit hexadecimal, i.e., 0000 hex
to 03E8 hex
)
Network number (0 to 127 in 2-digit hexadecimal, i.e., 00 hex
to 7F hex
)
Bit 14 ON: Operating level 0
OFF: Operating level 1
Bits 08 to 13 and 15: Set to 0.
C+2 Destination node (0 to 126 in 2-digit hexadecimal, i.e., 00 hex
to 7E hex
)*
Destination port
NSB: 00
NSU: 01/02
*The node number of the PC executing the send may be set.
207
Network Instructions
SYSMAC LINK Systems
Examples
00000
DM 0010
DM 0011
DM 0012
15
0
0
0
0
0
0
0
0
0
5
0
A
0
Section 5-24
Set the destination node number to 0 to send the data to all nodes. Refer to the
SYSMAC LINK System Manual for details.
Word
C
C+1
Bits 00 to 07 Bits 08 to 15
Number of words (0 to 256 in 4-digit hexadecimal, i.e., 0000 hex
to 0100 hex
)
Response time limit (0.1 and 25.4
seconds in 2-digit hexadecimal without decimal point, i.e., 00 hex
FF hex
)
to
Note: The response time will be
2 seconds if the limit is set to 0 hex
There will be no time limit if the time limit is set to FF hex
.
.
Bits 08 to 11:
No. of retries (0 to 15 in hexadecimal, i.e., 0 hex
to F
Bit 12: Set to 0.
hex
)
Bit 13 ON: Response not returned.
OFF: Response returned.
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 hexadecimal, i.e., 00 hex
to 3E hex
)*
Set to 0.
*The node number of the PC executing the send cannot be set.
This example is for a SYSMAC NET Link System. When 00000 is ON, the following program transfers the content of IR 001 through IR 005 to LR 20 through LR
24 on node 10.
SEND(90)
001
LR 20
DM 0010
Address Instruction
00000 LD
00001 SEND(90)
Operands
00000
LR
DM
001
20
0010
IR 001
IR 002
IR 003
IR 004
IR 005
Node 10
LR 20
LR 21
LR 22
LR 23
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.
5-24-2 NETWORK RECEIVE – RECV(98)
RECV(98)
S
D
C
Ladder Symbols
@RECV(98)
S
D
C
Operand Data Areas
S: Source beginning word
IR, SR, AR, DM, HR, TC, LR
D: Destination beginning word
IR, AR, DM, HR, TC, LR
C: First control data word
IR, AR, DM, HR, TC, LR
208
Network Instructions Section 5-24
Limitations
Description
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.
When the execution condition is OFF, RECV(98) is not executed. When the execution 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 receive data to a node on the same Subsystem (i.e., network). Refer to the SYS-
MAC NET Link System Manual for details.
Word
C
C+1
C+2
Bits 00 to 07 Bits 08 to 15
Number of words (0 to 1000 in 4-digit hexadecimal, i.e., 0000 hex
to 03E8 hex
)
Network number (0 to 127 in 2-digit hexadecimal, i.e., 00 hex
to 7F hex
)
Bit 14 ON: Operating level 0
OFF: Operating level 1
Bits 08 to 13 and 15:
Set to 0.
Source node (1 to 126 in 2-digit hexadecimal, i.e., 01 hex
to 7E hex
)
Source port
NSB: 00
NSU: 01/02
SYSMAC LINK Systems Refer to the SYSMAC LINK System Manual for details.
Word
C
C+1
C+2
Bits 00 to 07 Bits 08 to 15
Number of words (0 to 256 in 4-digit hexadecimal, i.e., 0000 hex
to 0100 hex
)
Response time limit (0.1 and 25.4
seconds in 2-digit hexadecimal without decimal point, i.e., 00 hex
FF hex
)
to
Note: The response time will be
2 seconds if the limit is set to 0 hex
There will be no time limit if the time limit is set to FF hex
.
.
Bits 08 to 11:
No. of retries (0 to 15 in hexadecimal, i.e., 0
F hex
) hex
to
Bit 12: Set to 0.
Bit 13: Set to 0.
Bit 14 ON: Operating level 0
OFF: Operating level 1
Bit 15: Set to 1.
Source node (0 to 62 in 2-digit hexadecimal, i.e., 00 hex
to 3E hex
)
Set to 0.
209
Network Instructions
Examples
00000
DM 0010
DM 0011
DM 0012
15
0
0
0
0
0
0
0
0
0
5
0
A
0
Section 5-24
This example is for a SYSMAC NET Link System. When 00000 is ON, the following program transfers the content of IR 001 through IR 005 to LR 20 through LR
24 on node 10.
Node 10
IR 001
IR 002
IR 003
IR 004
IR 005
RECV(98)
001
LR 20
DM 0010
LR 20
LR 21
LR 22
LR 23
LR 24
Address Instruction
00000 LD
00001 RECV(98)
LR
DM
Operands
00000
001
20
0010
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.
5-24-3 About Network Communications
SEND(90) and RECV(98) are based on command/response processing. That is, the transmission is not complete until the sending node receives and acknowledges a response from the destination node. Note that the
SEND(90)/RECV(98) Enable Flag is not turned ON until the first END(01) after the transmission is completed. Refer to the SYSMAC NET Link System Manual or SYSMAC LINK System Manual for details about command/response operations.
If multiple SEND(90)/RECV(98) operations are used, the following flags must be used to ensure that any previous operation has completed before attempting further send/receive SEND(90)/RECV(98) operations
SR Flag
SEND(90)/RECV(98)
Enable Flags
(SR 25201, SR 25204)
SEND(90)/RECV(98)
Error Flags
(SR 25200, SR 25203)
Functions
OFF during SEND(90)/RECV(98) execution (including command response processing). Do not start a
SEND(90)/RECV(98) operation unless this flag is ON.
OFF following normal completion of SEND/RECV (i.e., after reception of response signal)
ON after an unsuccessful SEND(90)/RECV(98) attempt.
Error status is maintained until the next
SEND(90)/RECV(98) operation.
Error types:
Time-out error (command/response time greater than 1 second)
Transmission data errors
210
Network Instructions
Timing
Successful send/receive execution
Send/receive error
Section 5-24
Data Processing for
SEND(90)/RECV(98)
Programming Example:
Multiple
SEND(90)/RECV(98)
Instruction received
Transmission completes normally
Instruction received
Transmission error
Instruction received
Data is transmitted for SEND(90) and RECV(98) for all PCs when
SEND(90)/RECV(98) is executed. Final processing for transmissions/receptions is performed during servicing of peripheral devices and Link Units.
To ensure successful SEND(90)/RECV(98) operations, your program must use the SEND(90)/RECV(98) Enable Flags and SEND(90)/RECV(98) Error Flags to 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
00000
SEND(90)/RECV(98) Enable Flag
25204 12802
12801
12800
212
12800
SEND(90)/RECV(98) Error Flag
25203
12800 25204
00001 25204 12800
12803
12802 25204 25203
12802
12802
SEND(90)/RECV(98) Error Flag
25203
12802 25204
Section 5-24
S
R
KEEP(11)
12800
@MOV(21)
#000A
DM 0000
@MOV(21)
#0000
DM 0001
@MOV(21)
#0003
DM 0002
XFER(70)
#0010
000
DM 0010
@SEND(90)
DM 0010
DM 0020
DM 0000
12800 prevents execution of SEND(90) until
RECV(98) (below) has completed. IR 00000 is turned ON to start transmission.
Data is placed into control data words to specify the 10 words to be transmitted to node 3 in operating level 1 of network 00
(NSB).
Turns ON to indicate transmission error.
00200
DIFU(13) 12801
S
R
KEEP(11)
12802
XFER(70)
#0016
000
DM 0030
@MOV(21)
#0010
DM 0003
@MOV(21)
#0000
DM 0004
@MOV(21)
#007E
DM 0005
@RECV(98)
HR 10
LR 10
DM 0003
00201
Resets 12800, above.
12802 prevents execution of RECV(98) when SEND(90) above has not completed.
IR 00001 is turned ON to start transmission.
Transmitted data moved into words beginning at DM 0030 for storage.
Data moved into control data words to specify the 16 words to be transmitted from node 126 in operating level 1 of network 00
(NSB).
Turns ON to indicate reception error.
DIFU(13) 12803 Resets 12802, above.
Network Instructions
Address Instruction
00000 LD
00001 AND
00002 AND NOT
00003 LD
00004 KEEP(11)
00005 LD
00006 @MOV(21)
00007 @MOV(21)
00008
00009
@MOV(21)
@XFER(70)
00010 @SEND(90)
DM
DM
DM
DM
#
DM
#
DM
#
00011 LD
00012 AND
00013 OUT
00014 LD
00015 AND
00016 DIFU(13)
00017 LD
00018 AND
#
DM
Operands
00000
25204
12802
12801
12800
12800
000A
0000
0000
0001
0003
00002
0010
000
0002
0010
0020
0000
12800
25203
00200
12800
25204
12801
00001
25204
Address Instruction
00019 AND NOT
00020 LD
00021 KEEP(11)
00022 LD
00023 AND
00024 AND NOT
00025 XFER(70)
00026
00027
00028
00029
00030 @RECV(98)
00031
00032
00033
00034
00035
00036
LD
@MOV(21)
@MOV(21)
@MOV(21)
LD
AND
OUT
LD
AND
DIFU(13)
#
DM
HR
LR
DM
#
DM
#
DM
#
DM
Operands
12800
12803
12802
12802
25204
25203
0016
000
0030
12802
0010
0003
0000
0004
007E
0005
10
10
0003
12802
25203
00201
12802
25204
12803
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 execute 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.
6-1 Cycle Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6-2 Calculating Cycle Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6-2-1 PC with I/O Units Only . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6-2-2 PC with Link Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6-3 Instruction Execution Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6-4 I/O Response Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
216
220
220
221
222
227
215
Cycle Time
6-1 Cycle Time
Section 6-1
To aid in PC operation, the average, maximum, and minimum cycle times can be displayed on the Programming Console or any other Programming Device and the maximum cycle time and current cycle time values are held in AR 26 and AR
27. Understanding the operations that occur during the cycle and the elements that affect cycle time is, however, essential to effective programming and PC operations.
The major factors in determining program timing are the cycle time and the I/O response time. One scan of CPU operation is called a cycle; the time required for one cycle is called the cycle time. The time required to produce a control output signal following reception of an input signal is called the I/O response time.
The overall flow of the CPU operation is as shown in the following flowchart.
216
Cycle Time
Flowchart of CPU Operation
Power application
Clears IR area and resets all timers
Checks I/O Unit connections
Resets watchdog timer
Checks hardware and
Program Memory
NO
Check OK?
YES
Resets watchdog timer and program address counter
Sets error flags and turns
ON or flashes indicator
ALARM/ERROR
ERROR
(Solid ON)
Executes program
ALARM
(Flashing)
End of program?
NO
YES
SCAN(18) executed?
NO
YES
Resets watchdog timer and waits until the set cycle time has elapsed
Calculates cycle time
Resets watchdog timer
Refreshes input bits and output signals
Services Host Link Units
Services Peripheral devices
Services SYSMAC LINK and
SYSMAC NET Link Units
(C200H-CPU31-E only)
I/O refreshing
Host Link Unit servicing
Peripheral device servicing
SYSMAC LINK and SYSMAC
NET Link Unit servicing
Section 6-1
Initialization on power-up
Overseeing processes
Program execution
PC cycle time
Cycle time calculation
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 performed 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 includes basically seven types of operation.
1, 2, 3...
1. Overseeing
2. Program execution
3. Cycle time calculation
4. I/O refreshing
5. Host Link Unit servicing
6. Peripheral device servicing
7. SYSMAC LINK and SYSMAC NET Link Unit servicing
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.
Operation
1. Overseeing
2. Program execution
3. Cycle time calculation
4. I/O refreshing
5. Host Link Unit servicing
6. Peripheral device servicing
7. SYSMAC LINK and
SYSMAC NET Link Unit servicing
Time required
CPU31-E: 3.5 ms
CPU21-E/23E:
2.8 ms (without Memory Unit clock function)
3.1 ms (with Memory Unit clock function)
Total execution time for all instructions varies with program size, the instructions used, and execution conditions. Refer to 6-3 Instruction
Execution Times for details.
Negligible
70
µ s per input byte. 40
µ s per output byte.
1.3 ms per Remote I/O Master Unit + 0.2 ms per I/O word used in Remote I/O Slave
Units.
The total Group-2 High-density I/O Unit refresh time is 0.36 ms (for initial processing) +
Group-2 High-density I/O Unit refresh times.
Refer to the tables below for details on PC
Link, Special I/O Unit, and Group-2 Highdensity I/O Unit refresh times.
8 ms max. per Unit
Function
Watchdog timer set. I/O Bus, Program
Memory checked. Clock refreshed.
Program executed.
Cycle time calculated. When the Cycle
Time instruction (SCAN(18)) is executed, waits until the set time has elapsed and then resets the watchdog timer.
Input bits set according to status of input signals. Output signals sent according to status of output bits in memory.
Inputs and Outputs in Remote I/O Systems refreshed.
Special I/O Units serviced.
Group-2 High-density I/O Units serviced.
Commands from computers connected through Rack-mounting Host Link Units processed.
Commands from Programming Devices and Interface Units processed.
0 ms when no devices are mounted.
0.8 ms when T < 13 ms.
T x 0.06 ms when T > 13 ms.
(T is the total cycle time calculated in operation 3.)
1.5 ms per Unit + 10 ms max.
Commands from PCs or computers connected through SYSMAC LINK/NET Link
Units processed.
SYSMAC LINK and SYSMAC NET Link
Unit servicing is performed in the CPU31-E only.
218
Cycle Time
PC Link Unit I/O Refresh
Section 6-1
0
0
1
1
Switch 7 setting
Pin 1 Pin 2
0
1
0
1
512
256
128
64
I/O pts to refresh
8.9
Time required
(ms)
5.7
3.6
2.8
Special I/O Unit Refresh
Unit
C200H-ID501/215
C200H-OD501/215
C200H-MD501/215
C200H-CT001-V1/CT002
C200H-NC111/NC112
C200H-NC211
C200H-AD001
C200H-AD002
C200H-DA001
C200H-TS001/TS101
C200H-TC jjj
(see note 1)
C200H-ASC02
C200H-IDS01-V1/IDS21
C200H-OV001
C200H-TV jjj
(see note 1)
C200H-PID0 j
(see note 2)
C200H-FZ001
C200H-CP114
Time required
0.8 ms each
0.8 ms each when set for 32 I/O pts.
1.8 ms each when set for I/O timing
2.2 ms
3.0 ms
6 ms
2.3 ms
2.0 ms
2.0 ms
1.8 ms each
4.0 ms each
2.0 ms each normally, 6.0 ms for @ format
2.5 ms each normally, 6.5 ms for command transfer
4.5 ms
4.0 ms
4.0 ms
2.3 ms
3.2 ms
Note 1.
jjj
= 001/002/003/101/102/103
2.
j
=1/2/3
Group-2 High-density I/O Unit Refresh
Unit
C200H-ID216
C200H-OD218
C200H-ID217
C200H-OD219
0.32 ms
0.30 ms
0.50 ms
0.44 ms
Time required
Special I/O Units in Remote
I/O Slave Racks
Watchdog Timer and Long
Cycle Times
Remote I/O Master Units are serviced only once each cycle. When Special I/O
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, especially when differential instructions are turned ON and OFF.
Within the PC, the watchdog timer measures the cycle time and compares it to a 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)
10 or greater
Possible adverse affects
TIMH(15) inaccurate when TC 016 through TC 511 are used.
20 or greater
100 or greater
0.02-second clock pulse not accurately readable.
0.1-second clock pulse not accurately readable and Cycle
Timer Error Flag (25309) turns ON.
0.2-second clock pulse not accurately readable.
200 or greater
6,500 or greater FALS code 9F generated regardless of watchdog timer setting and the system stops.
6-2 Calculating Cycle Time
The PC configuration, the program, and program execution conditions must be taken into consideration when calculating the cycle time. This means taking into account such things as the number of I/O points, the programming instructions used, and whether or not peripheral devices are employed. This section shows some basic cycle time calculation examples. To simplify the examples, the instructions used in the programs have been assumed to be all either LD or OUT.
The average execution time for the instructions is thus
0.6
µ s. (Operating times are given in the table in 6-3 Instruction Execution
Times.)
6-2-1 PC with I/O Units Only
Here, we’ll compute the cycle time for a PC with a CPU21-E, or CPU23-E CPU that has a Memory Unit with a clock function installed. The CPU controls only I/O
Units, eight on the CPU Rack and five on a 5-slot Expansion I/O Rack. In this PC configuration, there is also a Programming Console mounted to the CPU that needs to be taken into consideration. The PC configuration for this would be as shown below. It is assumed that the program contains 5,000 instructions requiring an average of 0.94
µ s each to execute.
8-point Input Units 8-point Output Units
CPU Rack
Calculations
220
Expansion I/O Rack
16-point Input Units 12-point Output Units
8-point Output Unit
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.
Calculating Cycle Time Section 6-2
(16 points x 2) + (8 points x 4)
8 points
The program execution time is 4.7 ms (0.94
µ s/instruction
×
5,000 instructions).
The I/O refresh time would be as follows for two16-point Input Units, four 8-point
Input Units, two 12-point Output Units (12-point Units are treated as 16-point
Units), and five 8-point Output Units controlled by the PC: x 70
µ s +
(16 points x 2) + (8 points x 5)
8 points x 40
µ s = 0.92 ms
The Programming Console is mounted to the PC and the total cycle time of operations 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
6-2-2 PC with Link Units
Here, the cycle time is computed for a PC with a CPU21-E, or CPU23-E CPU that has a Memory Unit with a clock function installed. The CPU controls three
8-point Input Units, three 8-point Output Units, a Host Link Unit, and a Remote
I/O Master Unit connected to a Remote I/O Slave Rack containing four 16-point
Input Units and four 12-point Output Units. The PC configuration for this could be as shown below. It is assumed that the program contains 5,000 instructions requiring an average of 0.94
µ s each to execute.
Host Link Unit
Remote I/O
Master Unit
8-point
Input Units
8-point
Output Units
CPU Rack
Computer
Slave Rack
16-point
Input Units
12-point
Output Units
Calculations The equation for the cycle time is as follows:
Cycle time = overseeing time + program execution time
+ I/O refreshing time + Host Link Unit servicing time
+ peripheral device servicing time
The overseeing time is fixed at 3.1 ms.
The program execution time is 4.7 ms (0.94
µ s/instruction
×
5,000 instructions).
The I/O refreshing time would be as follows for three 8-point Input Units and three 8-point Output Units mounted in the CPU Rack, and eight Units mounted in a Slave Rack.
(8 points x 3) x 70
µ s + (8 points x 3) x 40
µ s
8 points
+ 1.3 ms + 8 Units x 0.2 ms = 3.23 ms
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.
6-3 Instruction Execution Times
Instruction
LD
LD NOT
AND
AND NOT
OR
OR NOT
AND LD
OR LD
OUT
OUT NOT
TIM
---
---
---
---
---
---
---
---
---
---
Constant for SV
The following table lists the execution times for all instructions that are available for the C200H. The maximum and minimum execution times and the conditions which cause them are given where relevant. When “word” is referred to in the
Conditions column, it implies the content of any word except for indirectly addressed DM words. Indirectly addressed DM words, which create longer execution times when used, are indicated by “
*
DM.”
Execution times for most instructions depend on whether they are executed with an ON or an OFF execution condition. 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 circumstances, 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.
All execution times are given in microseconds unless otherwise noted.
Conditions ON execution time (
µ s) OFF execution time (
µ s)
0.75
---
0.75
0.75
1.13
1.13
2.25
0.75
0.75
0.75
0.75
0.75
---
---
---
---
---
---
---
---
---
R: 2.25
IL: 2.25
CNT
NOP(00)
END(01)
IL(02)
ILC(03)
JMP(04)
* DM for SV
Constant for SV
* DM for SV
---
---
---
---
---
2.25
0.75
80
59
44
69
JMP: 2.25
R: 160
IL: 2.25
JMP: 2.25
R: 2.25
IL: 2.25
JMP: 2.25
R: 160
IL: 2.25
35
35
35
JMP: 2.25
---
---
222
WSFT(16)
RWS(17)
SCAN(18)
MCMP(19)
CMP(20)
MOV(21)
MVN(22)
BIN (23)
BCD(24)
ASL(25)
Instruction Execution Times
Instruction Conditions
JME(05) ---
FAL(06) 01 to 99 ---
FAL(06) 00
FALS(07)
---
---
STEP(08)
SNXT(09)
SFT(10)
---
---
With 1-word shift register
KEEP(11)
CNTR(12)
DIFU(13)
DIFD(14)
TIMH(15)
With 250-word shift register
---
Constant for SV
* DM for SV
---
---
Interrupt Constant for SV
Normal cycle
Interrupt * DM for SV
Normal cycle
When shifting 1 word
When shifting 1,000 words using
*
DM
When resetting 1 word
When shifting 999 words using * DM
Constant for SV
*
DM for SV
Comparing 2 words, result word
Comparing 2 * DM, result * DM
When comparing a constant to a word
When comparing two * DM
When transferring a constant to a word
When transferring * DM to * DM
When transferring a constant to a word
When transferring * DM to * DM
When converting a word to a word
When converting * DM to * DM
When converting a word to a word
When converting * DM to * DM
When shifting a word
When shifting * DM
890
124
296
88
259
91
261
174
338
179
170
8.6 ms
388
30.3 ms
311
412
636
337
72
158
ON execution time (
µ s)
47
236
182
4.28 ms
95
34
181
Section 6-3
OFF execution time (
µ s)
35
2.25
2.25
2.25
2.25
2.25
R: 191
IL: 30
JMP: 30
1.44 ms
1.13
111
205
93
92
120
135
120
135
IL: 30
JMP: 30
---
R: 85
IL: 49
JMP: 49
Normal: 93
IL: 93
JMP: 84
Normal: 92
IL: 92
JMP: 84
R: 199
IL: 199
JMP: 73
R: 291
IL: 291
JMP: 73
3
3.75
3.75
3.75
3
3
3
3
3
2.25
223
Instruction Execution Times
Instruction
ASR(26)
ROL(27)
ROR(28)
COM(29)
ADD(30)
SUB(31)
MUL(32)
DIV(33)
ANDW(34)
ORW(35)
XORW(36)
XNRW(37)
INC(38)
DEC(39)
STC(40)
CLC(41)
MSG(46)
LMSG(47)
TERM(48)
SYS(49)
ADB(50)
SBB(51)
MLB(52)
DVB(53)
ADDL(54)
SUBL(55)
Conditions
When shifting a word
When shifting * DM
When rotating a word
When rotating
*
DM
When rotating a word
When rotating * DM
When inverting a word
When inverting * DM
Constant + word b word
* DM + * DM b
* DM
Constant + word b word
* DM – * DM b * DM
Constant x word b word
* DM x * DM b word
Word
÷
constant b word
* DM
÷ * DM b
* DM
Constant AND word b word
* DM AND * DM b
* DM
Constant OR word b word
* DM OR * DM b * DM
Constant XOR word b word
* DM XOR * DM b
* DM
Constant XNOR word b word
* DM XNOR * DM b * DM
When incrementing a word
When incrementing * DM
When decrementing a word
When decrementing * DM
---
---
---
Constant for SV
* DM for SV
---
---
Constant + word b word
* DM + * DM b
* DM
Constant – word b word
* DM – * DM b * DM
Constant x word b word
* DM x * DM b
* DM
Word
÷
constant b word
* DM
÷ * DM b
* DM
Word + word b word
* DM + * DM b
* DM
Word – word b word
* DM – * DM b * DM
224
984
290
367
161
2
144
393
147
396
205
452
476
373
82
167
82
167
27
27
98
122
371
122
371
122
371
124
704
243
491
255
504
77
162
67
152
153
415
161
422
480
742
724
ON execution time (
µ s)
72
158
77
162
2.25
2.25
2.25
3.75
3.75
3.75
3.75
3.75
3.75
3.75
3.75
2.25
2.25
1.5
1.5
2.25
3.75
3.75
3.75
3.75
3.75
3.75
3.75
3.75
3.75
Section 6-3
OFF execution time (
µ s)
2.25
Instruction Execution Times
Instruction
MULL(56)
DIVL(57)
BINL(58)
BCDL(59)
CMPL(60)
MPRF(61)
CTW(63)
WTC(64)
HTS(65)
STH(66)
BCNT(67)
BCMP(68)
VCAL69)
XFER(70)
BSET(71)
ROOT(72)
XCHG(73)
SLD(74)
SRD(75)
MLPX(76)
DMPX(77)
SDEC(78)
Conditions
Word x word b word
*
DM x
*
DM b
*
DM
Word
÷
word b word
* DM
÷ * DM b
* DM
When converting words to words
When converting * DM to * DM
When converting words to words
When converting
*
DM to
*
DM
When comparing words to words
When comparing * DM to * DM
When refreshing one 32-pt Output Unit
When refreshing ten 32-pt Input Units
ON execution time (
µ s)
1.14 ms
1.39 ms
3.25 ms
3.39 ms
350
511
588
750
380
543
700
3.60 ms
When transferring from words to a word
When transferring * DM to * DM
When transferring from a word to words
When transferring * DM to * DM
Word to word
*
DM to
*
DM
Word to word
* DM to * DM
670
923
807
1.07 ms
859
1.00 ms
744
889
When counting 1 word
When counting 1,000 words using * DM
502
100 ms
Comparing constant to word-designated table
674
Comparing * DM b
* DM-designated table 926
Trigonometric functions.
488
Linear approximation with a 256 word table
When transferring 1 word
2.71 ms
305
When transferring 1,000 words using
*
DM
When setting a constant to 1 word
When setting * DM ms to 1,000 words using * DM
When taking root of word and placing in a word
When taking root of 99,999,999 in * DM and placing in
*
DM
16 ms
209
4.28 ms
631
1.16 ms
Between words 156
Between * DM
When shifting 1 word
316
193
When shifting 1,000 DM words using * DM 33 ms
When shifting 1 word 193
When shifting 1,000 DM words using
*
DM 33 ms
When decoding word to word 203
When decoding * DM to * DM
When encoding a word to a word
When encoding * DM to * DM
When decoding a word to a word
When decoding * DM to * DM
568
225
551
235
571
Section 6-3
OFF execution time (
µ s)
3.75
3.75
3
3
3.75
3.75
3.75
3.75
3.75
3.75
3.75
3.75
3.75
3.75
3.75
3
3
3
3
3.75
3.75
3.75
225
Instruction Execution Times
Instruction
FDIV(79)
DIST(80)
COLL(81)
MOVB (82)
MOVD(83)
SFTR(84)
TCMP(85)
ASC(86)
INT(89)
SEND(90)
SBS(91)
SBN(92)
RET(93)
WDT(94)
IORF(97)
RECV(98)
Conditions
Word
÷
word b word (equals 0)
Word
÷
word b word (doesn’t equal 0)
* DM
÷ * DM b * DM
ON execution time (
632
1.77 ms
2.1 ms
Constant b word + (word)
* DM b ( * DM + ( * DM))
(Word + (word)) b word
( * DM + ( * DM)) b
* DM
When transferring word to a word
When transferring * DM to * DM
When transferring word to a word
When transferring * DM to * DM
246
481
262
497
158
357
195
399
When shifting 1 word 284
When shifting 1,000 DM words using * DM 13.8 ms
Comparing constant to words in a designated table
542
Comparing * DM b * DM-designated table 830
Word b word 270
* DM b * DM
When reading interrupt mask
454
265
µ s)
When masking and clearing interrupt
1-word transmit
1000-word transmit
---
---
---
---
1-word refresh
30-word refresh
1-word refresh
1000-word refresh
265
563
752
158
---
198
35
450
4 ms
559
764
Section 6-3
OFF execution time (
µ s)
3.75
3.75
3.75
3.75
3.75
3.75
3.75
3.75
3.75
3.75
2.25
---
1.5
2.25
3
3.75
226
I/O Response Time Section 6-4
6-4 I/O Response Time
The I/O response time is the time it takes for the PC to output a control signal after it has received an input signal. The time it takes to respond depends on the cycle time and when the CPU receives the input signal relative to the input refresh period. The I/O response times for a PC not in a Link System are discussed below. For response times for PCs with Link Systems, refer to the relevant Sys- tem Manual.
The minimum and maximum I/O response time calculations described below are for where 00000 is the input bit that receives the signal and 00200 is the output bit corresponding to the desired output point.
00000
00200
Minimum I/O Response
Time
The PC responds most quickly when it receives an input signal just prior to the
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 output 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.
Cycle
Input signal
Input
ON delay
Output signal
Cycle time
Instruction execution
I/O refresh
CPU reads input signal
Cycle time
Instruction execution
Output ON delay
Instruction execution
I/O response time
Maximum I/O Response
Time
Minimum I/O response time = input ON delay + cycle time + I/O refresh time + output ON delay
The PC takes longest to respond when it receives the input signal just after the
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
Cycle
Input signal
Input
ON delay
Output signal
Calculation Example
Section 6-4 time would not need to be added in because the input comes just after it rather than before it.
Cycle time
Instruction execution
I/O refresh
Cycle time
Instruction execution
Cycle time
Instruction execution
CPU reads input signal
Output
ON delay
I/O response time
Maximum I/O response time = input ON delay + (cycle time x 2) + output ON delay
The data in the following table would produce the minimum and maximum cycle times shown calculated below.
Input ON-delay
Output ON-delay
Cycle time
1.5 ms
15 ms
20 ms
Minimum I/O response time = 1.5 + 20 + 15 = 36.5 ms
Maximum I/O response time = 1.5 + (20 x 2) +15 = 56.5 ms
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.
7-1 Monitoring Operation and Modifying Data
7-1-1 Bit/Word Monitor
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7-1-2 Forced Set/Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7-1-3 Forced Set/Reset Cancel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7-1-4 Hexadecimal/BCD Data Modification
7-1-5 Hex/ASCII Display Change
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7-1-6 3-word Monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7-1-7 3-word Data Modification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7-1-8 Binary Monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7-1-9 Binary Data Modification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7-1-10 Changing Timer/Counter SV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7-2 Program Backup and Restore Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7-2-1 Saving Program Memory Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7-2-2 Restoring or Comparing Program Memory Data
7-2-3 Saving, Restoring, and Comparing DM Data
. . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
240
241
243
246
246
249
250
230
230
233
235
236
237
238
239
229
Monitoring Operation and Modifying Data Section 7-1
7-1 Monitoring Operation and Modifying Data
The simplest form of operation monitoring is to display the address whose operand bit status is to be monitored using the Program Read or one of the search operations. As long as the operation is performed in RUN or MONITOR mode, the status of any bit displayed will be indicated.
This section provides other procedures for monitoring data as well as procedures for modifying data that already exists in a data area. Data that can be modified includes the PV (present value) and SV (set value) for any timer or counter.
All monitor operations in this section can be performed in RUN, MONITOR, or
PROGRAM mode and can be cancelled by pressing CLR.
All data modification operations except for timer/counter SV changes are performed after first performing one of the monitor operations. Data modification is possible in either MONITOR or PROGRAM mode, but cannot be performed in
RUN mode.
7-1-1 Bit/Word Monitor
The status of any bit or word in any data area can be monitored using the following operation. Although the operation is possible in any mode, ON/OFF status displays will be provided for bits in MONITOR or RUN mode only.
The Bit/Digit Monitor operation can be entered either from a cleared display by designating the first bit or word to be monitored or it can be entered from any address in the program by displaying the bit or word address whose status is to be monitored and pressing MONTR.
When a bit is monitored, it’s ON/OFF status will be displayed (in MONITOR or
RUN mode); when a word address is designated other than a timer or counter, the digit contents of the word will be displayed; and when a timer or counter number is designated, the PV of the timer will be displayed and a small box will appear if the completion flag of a timer or counter is ON. When multiple words are monitored, a caret will appear under the leftmost digit of the address designation to help distinguish between different addresses. The status of TR bits and SR flags (e.g., the arithmetic flags), cleared when END(01) is executed, cannot be monitored.
Up to six memory addresses, either bits, words, or a combination of both, can be monitored at once, although only three of these are displayed at any one time. To monitor more than one address, return to the start of the procedure and continue designating addresses. Monitoring of all designated addresses will be maintained unless more than six addresses are designated. If more than six addresses are designated, the leftmost address of those being monitored will be cancelled.
To display addresses that are being monitored but are not presently on the Programming Console display, press MONTR without designating another address. The addresses being monitored will be shifted to the right. As MONTR is pressed, the addresses being monitored will continue shifting to the right until the rightmost address is shifted back onto the display from the left.
During a monitor operation the up and down keys can be pressed to increment and decrement the leftmost address on the display and CLR can be pressed to cancel monitoring the leftmost address on the display. If the last address is cancelled, the monitor operation will be cancelled. The monitor operation can also be cancelled regardless of the number of addresses being monitored by pressing SHIFT and then CLR.
LD and OUT can be used only to designate the first address to be displayed; they cannot be used when an address is already being monitored.
230
Monitoring Operation and Modifying Data
Key Sequence
Section 7-1
Clears leftmost address
Cancels monitor operation
Examples
Program Read then Monitor
The following examples show various applications of this monitor operation.
00100
00100READ
TIM 000
T000
1234
T0001
â0000
Indicates Completion flag is ON
00100
TIM 001
Monitor operation is cancelled
231
Monitoring Operation and Modifying Data
Bit Monitor
Word Monitor
00000
00000
LD 00001
00001
^ ON
00000
CONT 00001
Section 7-1
00000
00000
CHANNEL 000
00000
CHANNEL LR 01
cL01
FFFF
cL00
0000
232
Monitoring Operation and Modifying Data
Multiple Address Monitoring
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
D000000001
10FF^ OFF
0001
OFF
00000
CONT 00001
00000
CHANNEL DM 0000
Cancels monitoring of leftmost address
Monitor operation canceled
0000000001
S ONR OFF
Indicates Force Reset in operation.
Indicates Force Set in operation.
7-1-2 Forced Set/Reset
When the Bit/Digit Monitor operation is being performed and a bit, timer, or counter address is leftmost on the display, PLAY/SET can be pressed to turn ON the bit, start the timer, or increment the counter and REC/RESET can be pressed to turn OFF the bit or reset the timer or counter. Timers will not operate in PRO-
GRAM mode. SR bits cannot be turned ON and OFF with this operation.
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 completion 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 program section.
00002
TIM 000
#0123
012.3 s
TIM 000
00500
Address Instruction
00200 LD
00201 TIM
00202
00205
LD
OUT
#
TIM
Data
00002
000
0123
000
00500
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).
(This example is performed in MONITOR mode.)
0010000500
^ OFF^ OFF
Monitoring
00100 and
00500.
0010000500
á ON^ OFF
Indicates that force set/reset is in progress.
0010000500
á OFF^ OFF
T0000010000500
^ OFF^ OFF
T0000010000500
0123^ OFF^ OFF
T0000010000500
á0000^ OFF^ ON
T0000010000500
0123^ OFF^ OFF
T0000010000500
â0000^ ON^ ON
T0000010000500
á0123^ ON^ OFF
T0000010000500
0122^ ON^ OFF
T0000010000500
â0000^ ON^ ON
Monitoring
TIM 000.
Setting TIM 000 turns ON 00500.
Returns to the beginning when the key is released.
Display with 0010 originally
ON.
Timer starts timing, turning
00500 OFF.*
When the time is up, 00500 goes ON again.
Indicates that the time is up.
*Timing not done in PROGRAM mode.
7-1-3 Forced Set/Reset Cancel
This operation restores the status of all bits in the I/O, IR, TIM, CNT, HR, AR, or
LR areas which have been force set or reset. It can be performed in PROGRAM or MONITOR mode.
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
Example
Section 7-1
The following example shows the displays that appear when Restore Status is carried out normally.
00000
00000
00000FORCE RELE?
00000FORCE RELE
END
7-1-4 Hexadecimal/BCD Data Modification
When the Bit/Digit Monitor operation is being performed and a BCD or hexadecimal value is leftmost on the display, CHG can be input to change the value. SR words cannot be changed.
If a timer or counter is leftmost on the display, the PV will be displayed and will be the value changed. See 7-1-10 Changing Timer/Counter SV for the procedure to change SV. PV can be changed in MONITOR mode only when the timer or counter is operating.
To change contents of the leftmost word address, press CHG, input the desired value, and press WRITE
Key Sequence
Word currently monitored on left of display.
[ Data ]
236
Monitoring Operation and Modifying Data
Example
Section 7-1
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?
T000 0119 ????
PV changed
Timing
00000PRES VAL?
T000 0100 0200
Timing
T000
0199
Timing
7-1-5 Hex/ASCII Display Change
This operation converts DM data displays from 4-digit hexadecimal data to AS-
CII and vice versa.
237
Monitoring Operation and Modifying Data
Key Sequence
Section 7-1
Example
Word currently displayed.
00000
00000
CH DM 0000
D0000
4412
D0000
AB
D0000
4142
7-1-6 3-word Monitor
To monitor three consecutive words together, specify the lowest numbered word, press MONTR, and then press EXT to display the data contents of the specified word and the two words that follow it.
A CLR entry changes the Three-word Monitor operation to a single-word display.
238
Monitoring Operation and Modifying Data
Key Sequence
Single-word monitor in progress
Section 7-1
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
7-1-7 3-word Data Modification
This operation changes the contents of a word during the 3-Word Monitor operation. The blinking square indicates where the data can be changed. After the new data value is keyed in, pressing WRITE causes the original data to be overwritten with the new data. If CLR is pressed before WRITE, the change operation will be cancelled and the previous 3-word Monitor operation will resume.
Key Sequence
3 words currently displayed
[ Data ]
239
Monitoring Operation and Modifying Data
Example
D0002D0001D0000
0123 4567 89AB
D0002 3CHCHANG?
á0123 4567 89AB
D0002 3CHCHANG?
á0001 4567 89AB
D0002 3CHCHANG?
0001á4567 89AB
D0002 3CHCHANG?
0001á2345 89AB
D0002D0001D0000
0001 2345 89AB
D0002D0001D0000
0001 4567 89AB
3-word Monitor in progress.
Stops in the middle of monitoring.
Resumes previous monitoring.
Section 7-1
7-1-8 Binary Monitor
You can specify that the contents of a monitored word be displayed in binary by pressing SHIFT and MONTR after the word address has been input. Words can be successively monitored by using the up and down keys to increment and decrement the displayed word address. To clear the binary display, press CLR.
Key Sequence
[Word]
Binary monitor clear
All monitor clear
240
Monitoring Operation and Modifying Data
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
Section 7-1
0000S0100R0110SR
Indicates Force Reset in effect
Indicates Force Set in effect
7-1-9 Binary Data Modification
This operation assigns a new 16-digit binary value to an IR, HR, AR, LR, or DM word.
The cursor, which can be shifted to the left with the up key and to the right with the down key, indicates the position of the bit that can be changed. After positioning to the desired bit, a 0 or a 1 can then be entered as the new bit value. The bit can also be Force Set or Force Reset by pressing SHIFT and either PLAY/SET or
REC/RESET. An S or R will then appear at that bit position. Pressing the NOT key will clear the force status, S will change to 1, and R to o. After a bit value has been changed, the blinking square will appear at the next position to the right of the changed bit.
241
Monitoring Operation and Modifying Data
Key Sequence
Word currently displayed in binary.
Section 7-1
(Force Status Clear)
242
Monitoring Operation and Modifying Data
Example
Section 7-1
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
7-1-10 Changing Timer/Counter SV
There are two ways to change the SV of a timer or counter. It can be done either by inputting a new value; or by incrementing or decrementing the current SV.
Either method can be used only in MONITOR or PROGRAM mode. In MONI-
TOR mode, the SV can be changed while the program is being executed. Incrementing and decrementing the SV is possible only when the SV has been entered as a constant.
To use either method, first display the address of the timer or counter whose SV is to be changed, presses the down key, and then press CHG. The new value can then be input numerically and WRITE pressed to change the SV or EXT can be pressed followed by the up and down keys to increment and decrement the current SV. When the SV is incremented and/or decremented, CLR can be pressed once to change the SV to the incremented or decremented value but remaining in the display that appeared when EXT was pressed or CLR can be pressed twice to return to the original display with the new SV.
This operation can be used to change a SV from designation as a constant to a word address designation and vice versa.
243
Monitoring Operation and Modifying Data
Key Sequence
Section 7-1
Example
Inputting New SV and
Changing to Word
Designation
The following examples show inputting a new constant, changing from a constant to an address, and incrementing to a new constant.
00000
00000
TIM 000
00201SRCH
TIM 000
00201 TIM DATA
#0123
00201 TIM DATA
T000 #0123 #????
00201 TIM DATA
T000 #0123 #0124
00201 TIM DATA
#0124
00201 DATA?
T000 #0123 c???
00201 DATA?
T000 #0123 c010
00201 TIM DATA
010
244
Monitoring Operation and Modifying Data
Incrementing and
Decrementing
00000
Section 7-1
00000
TIM 000
00201SRCH
TIM 000
00201 TIM DATA
#0123
00201 TIM DATA
T000 #0123 #????
00201DATA ? U/D
T000 #0123 #0123
Current SV (during change operation)
SV before the change
00201DATA ?
T000 #0123 #0122
00201DATA ?
T000 #0123 #0123
00201DATA ?
T000 #0123 #0124
00201DATA ?
T000 #0124 #????
00201 TIM DATA
#0124
Returns to original display with new SV
245
Program Backup and Restore Operations Section 7-2
7-2 Program Backup and Restore Operations
Both Program Memory (UM) and DM area data can be backed-up on a standard, commercially available cassette tape recorder. Any dependable magnetic cassette tape of adequate length will suffice. To save a 8K-word program, the tape must be about 15 minutes long (about 2 min. per K word of data). Always allow for about 5 seconds of blank leader tape before the taped data begins. Store only one program or section of DM area on a single side of a tape; there is no way to identify separate programs or DM areas stored on the same side of the tape.
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 cassette permits.
Be sure to clearly label all cassette tapes.
Use patch cords to connect the cassette recorder earphone (or LINE-OUT) jack to the Programming Console EAR jack and the cassette recorder microphone
(or LINE-IN) jack to the Programming Console MIC jack. Set the cassette recorder volume and frequency equalizer controls to maximum levels.
The PC must be in PROGRAM mode for all cassette tape operations.
While the operation is in progress, the cursor will blink and the block count will be incremented on the display.
Cassette tape operations may be halted at any time by pressing CLR.
Error Messages
Message
0000 ERR *******
FILE NO.********
**** MT VER ERR
**** MT ERR
The following error messages may appear during cassette tape operations.
Meaning and appropriate response
File number on cassette and designated file number are not the same. Repeat the operation using the correct file number.
Cassette tape contents differs from that in the PC. Check content of tape and/or the PC.
Cassette tape is faulty. Replace it with another.
7-2-1 Saving Program Memory Data
This operation is used to copy the content of Program Memory to a cassette tape. The procedure is as follows:
1, 2, 3...
1. Press EXT and the 0 key to specify Program Memory.
2. Input a file number for the data that is to be saved.
3. Specify the start and stop addresses of the section of Program Memory that is to be recorded. When the start address is designated, the default stop address will indicate the last address of the Program Memory. Determine the address of END (01) and designate this address as the stop address. Do not designate a stop address greater than this one.
4. Start cassette tape recording. Use only reliable, high quality data use tapes.
5. Within 5 seconds, press SHIFT and REC/RESET.
Program saving continues until END(01) or the stop address is reached. At that time the program size in Kwords is displayed. If the END(01) is reached before the stop address, the recording operation will continue, however, through the designated stop address unless CLR is pressed to cancel.
246
Program Backup and Restore Operations
Key Sequence
CLR EXT
A
0
Section 7-2
[File no.]
WRITE
[Start address]
WRITE
[Stop address]
Start recording with the tape recorder.
SHIFT
REC
RESET
After about 5 seconds**
(Cancel with the CLR key).
**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
00000MT
FILE NO.00000000
00000MT
FILE NO.86031400
00000MT
START ADDR 00000
00000MT
START ADDR 00345
00345MT
STOP ADDR 03890
00345MT
STOP ADDR 05789
Selecting
Program Memory
Starting address of data to be recorded
Last address
Stop address specified
Start recording
Continue within 5 seconds
00345MT RECORD á
FILE NO.86031400
Blinking
Recording in progress
02420MT RECORD á
FILE NO.86031400
When it comes to END
04801MT RECORD á
END (01)(05.6KW)
Stop recording with CLR
04801MT DISCONTD
END (01)(05.6KW)
Saved up to stop address
05789RECORD END
END (01)(06.8KW)
248
Program Backup and Restore Operations Section 7-2
7-2-2 Restoring or Comparing Program Memory Data
This operation is used to restore Program Memory data from a cassette tape or to compare Program Memory data with the contents on a cassette tape. The procedure is as follows:
1, 2, 3...
1. Press EXT and the 0 key to specify Program Memory.
2. Specify the number of the file to be restored or compared.
3. Specify the start address for the data that is to be restored or compared.
4. Start playing the cassette tape.
5. Within 5 seconds, press SHIFT and PLAY/SET to restore data or VER to compare data.
Program restoration or comparison continues until END(01) is reached or until the tape is finished, at which time the program size in Kwords is displayed. At that time the program size in Kwords is displayed. Even if END(01) is reached before the end of the tape, the restoring or comparison operation will continue through the end of the tape unless CLR is pressed to cancel.
Key Sequence
CLR EXT
A
0 [File no.]
WRITE
[Start address]
Start tape recorder playback.
SHIFT
PLAY
SET
Within about 5 seconds**
**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
Example
00000
00000MT
UM:0 DM:1
00000MT
FILE NO.00000000
00000MT
FILE NO.86031400
00000MT
START ADDR 00000
00000MT
START ADDR 00345
00345MT PLAY á
FILE NOâ86031400
Restoring in progress
00420MT PLAY á
FILE NOâ86031400
END reached
04801MT PLAY á
END (01)(05.6KW)
Restored up to END
04801MT DISCONTD
END (01)(05.6KW)
Stop restoring using CLR
05789PLAY END
END (01)(05.6KW)
Section 7-2
00345MT VER á
FILE NOâ86031400
Comparison in progress
01420MT VER á
FILE NOâ86031400
END reached
04801MT VER á
END (01)(05.6KW)
Stop comparison using CLR
04801MT DISCONTD
(05.6KW)
Compared up to end of tape
05789VER OK
END (01)(05.6KW)
7-2-3 Saving, Restoring, and Comparing DM Data
The procedures for saving, restoring and comparing DM area data are identical to those for Program Memory except that the DM area is specified and start and stop addresses are not required. Cassette tape operations for DM area data will be continued to the end of the DM area or the end of the cassette tape unless
250
Program Backup and Restore Operations Section 7-2
CLR is pressed to cancel. Refer to the relevant operation in the preceding sections for details. An example for each operation is given below.
Key Sequence
CLR EXT
B
1 [File no.]
Start tape recorder recording.
Start tape recorder playback.
5 second leader tape**
SHIFT
REC
RESET
Saving
SHIFT
PLAY
SET
Restoring
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.
Example: Saving DM Data 00000
00000MT
UM:0 DM:1
D0000MT
FILE NO.00000000
D0000MT
FILE NO.00000012
Start recording
Wait about 5 seconds
D0000MT RECORDá
FILE NO.00000012
Recording in progress
D0127MT RECORDá
FILE NO.00000012
Recording stopped using CLR key.
D0127MT DISCONTD
FILE NO.00000012
Recording stops at the end.
D1999 OK
FILE NO.00000012
Selecting the
DM area
251
Program Backup and Restore Operations
Example: Restoring DM
Data
Section 7-2
00000
00000MT
UM:0 DM:1
D0000MT
FILE NO.00000000
D0000MT
FILE NO.00000012
Start tape playback
Selecting the
DM area
Within 5 seconds
D0000MT PLAY á
FILE NO.00000012
Restoring in progress
D0127MT PLAY á
FILE NO.00000012
Restoring stopped using CLR key.
D0127MT DISCONTD
FILE NO.00000012
Restoring stopped at the end.
D1999MT END
FILE NO.00000012
Blinking
252
Program Backup and Restore Operations
Example: Comparing DM
Data
Section 7-2
00000
00000MT
UM:0 DM:1
D0000MT
FILE NO.00000000
D0000MT
FILE NO.00000012
Start tape playback
Selecting the
DM area
Within 5 seconds
D0000MT VER á
FILE NO.00000012
Comparison in progress
D0127MT VER á
FILE NO.00000012
Stopped verification using CLR Key
D0127MT DISCONTD
FILE NO.00000012
Verification stopped at the end.
D1999VER OK
FILE NO.00000012
Blinking
253
SECTION 8
Troubleshooting
The C200H provides self-diagnostic functions to identify many types of abnormal system conditions. These functions minimize 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.
8-1 Alarm Indicators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8-2 Programmed Alarms and Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8-3 Reading and Clearing Errors and Messages
8-4 Error Messages
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8-5 Error Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
256
256
256
256
260
255
Error Messages Section 8-4
8-1 Alarm Indicators
The ALARM/ERROR indicator on the front of the CPU provides visual indication of an abnormality in the PC. When the indicator is ON (ERROR), a fatal error
(i.e., ones that will stop PC operation) has occurred; when the indicator is flashing (ALARM), a nonfatal error has occurred. This indicator is shown in 2-1 Indi-
cators.
!
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 software errors, or when FALS(07) is executed in the program (see tables on following pages). PC operation will continue for all other errors. It is the user’s responsibility 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.
8-2 Programmed Alarms and Error Messages
FAL(06), FALS(07), and MSG(46) can be used in the program to provide user-programmed information on error conditions. With these three instructions, the user can tailor error diagnosis to aid in troubleshooting.
FAL(06) is used with a FAL number other than 00, which is output to the SR area when FAL(06) is executed. Executing FAL(06) will not stop PC operation or directly affect any outputs from the PC.
FALS(07) is also used with a FAL number, which is output to the same location in the SR area when FALS(07) is executed. Executing FALS(07) will stop PC operation and will cause all outputs from the PC to be turned OFF.
When FAL(06) is executed with a function number of 00, the current FAL number contained in the SR area is cleared and replaced by another, if more have been stored in memory by the system.
When MSG(46) is used a message containing specified data area words is displayed onto the Programming Console or another Programming Device.
The use of these instructions is described in detail in Section 5 Instruction Set.
8-3 Reading and Clearing Errors and Messages
System error messages can be displayed onto a Data Access Console, as well as the Programming Console or other Programming Device.
On the Programming Console, press the CLR, FUN, and MONTR keys. If there are multiple error messages stored by the system, the MONTR key can be pressed again to access the next message. If the system is in PROGRAM mode, pressing the MONTR key will clear the error message, so be sure to write down all message errors as you read them. (It is not possible to clear an error or a message while in RUN or MONITOR mode; the PC must be in PROGRAM mode.)
When all messages have been cleared, “ERR CHK OK” will be displayed.
Details on accessing error messages from the Programming Console are provided in 7-1 Monitoring Operation and Modifying Data. Procedures for the GPC,
LSS, and FIT are provided in the relevant Operation Manuals.
8-4 Error Messages
There are basically three types of errors for which messages are displayed: initialization errors, non-fatal operating errors, and fatal operating errors. Most of
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
Error and message
Waiting for start input
CPU WAITãG
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.
FAL no.
None
Probable cause
Start input on CPU Power
Unit is OFF.
Possible correction
Short start input terminals on CPU Power Unit.
Waiting for Special I/O,
High-density I/O Units
CPU WAITãG
None
Waiting for Remote I/O
CPU WAITãG
None
A Special I/O Unit has not initialized.
Power to Remote I/O Unit is off or terminator cannot be found.
Perform the I/O Table Read operation to check unit numbers. Replace Unit if it 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.)
Check power supply to
Remote I/O Units, connections between
Remote I/O Units, and terminator setting.
257
Error Messages Section 8-4
Non-fatal Operating Errors
Error and message
FAL error
The following error messages appear for errors that occur after program execution 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.
SYS FAIL FAL**
FAL no.
01 to 99
Probable cause
FAL(06) has been executed in program. Check the FAL number to determine conditions that would cause execution (set by user).
Possible correction
Correct according to cause indicated by FAL number
(set by user).
Cycle time overrun
CYCLE TIME OVER
I/O table verification error
I/O VER ERR
Remote I/O error
RMTE I/O ERR
Remote I/O
Master Unit number
Special I/O error
*
SPECIAL UNIT ERR
Group-2 High-density I/O error
SYS FAIL FAL 9A
Battery error
BATT LOW
F8
E7
B0 or B1
D0
9A
F7
Watchdog timer has exceeded 100 ms.
Unit has been removed or replaced by a different kind of Unit, making I/O table incorrect.
Error occurred in transmissions between
Remote I/O Units.
Error has occurred in PC
Link Unit, Remote I/O
Master Unit, between a
Host, SYSMAC LINK, or
SYSMAC NET Link Unit and the CPU, or in refresh between Special I/O Unit and the CPU.
An error has occurred during data transmission between the CPU and a
Group-2 High-density I/O
Unit.
Program cycle time is longer than recommended.
Reduce cycle time if possible.
Use I/O Table Verify
Operation to check I/O table and either connect dummy
Units or register the I/O table again.
Check transmission line between PC and Master and between Remote I/O
Units.
Determine the unit number of the Unit which caused the error (AR 00), correct the error, and toggle the appropriate Restart Bit in
AR 01 or SR 252. If the Unit does not restart, replace it.
Determine the unit number of the Unit which caused the error (AR 02), replace the
Unit, and try to power-up again.
Backup battery in the CPU or RAM/EEPROM Memory
Unit is missing or its voltage has dropped.
Determine which battery caused the error (AR 2404), check battery, and replace if necessary.
Fatal Operating Errors The following error messages appear for errors that occur after program execution has been started. PC operation and program execution will stop and all outputs 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 operating errors, the POWER and ALARM/ERROR indicators will be lit. The RUN output will be OFF.
258
Error Messages
Error and message
Power interruption
No message.
CPU error
No message, or the message displayed before the error.
Memory error
MEMORY ERR
No END(01) instruction
NO END INST
Section 8-4
FAL no.
None
Probable cause
Power has been interrupted for at least
10 ms.
Possible correction
Check power supply voltage and power lines. Try to power-up again.
None
F1
F0
Watchdog timer has exceeded maximum setting (default setting:
130 ms).
Memory Unit is incorrectly mounted or missing, a Checksum error has occurred, or there is an incorrect instruction.
END(01) is not written anywhere in program.
Restart system in PROGRAM mode and check program.
Reduce cycle time or reset watchdog timer if longer time required. (Consider effects of longer cycle time before resetting.)
Check Memory Unit to make sure it is mounted and backed up properly. Perform a Program
Check Operation to locate cause of error. If error not correctable, try inputting program again.
Write END(01) at the final address of the program.
I/O bus error
I/O BUS ERR
*
Rack no.
Too many Units
I/O UNIT OVER
Input-output I/O table error
I/O SET ERROR
FALS error
SYS FAIL FAL**
C0 to C2 Error has occurred in the bus line between the
CPU and I/O Units.
The rightmost digit of the FAL number will indicate the number of the Rack where the error was detected. Check cable connections between the I/O
Units and Racks.
E1
E0
Two or more Special I/O
Units are set to the same unit number or two or more Group-2
High-density I/O Units are set to the same I/O number or I/O word.
The I/O number of a
64-pt Group-2
High-density I/O Unit is set to 9.
Two SYSMAC NET Link or SYSMAC LINK Units share the same operating level.
Perform the I/O Table Read operation to check unit numbers, and eliminate duplications. (High-density I/O
Units other than Group-2 are
Special I/O Units, too.)
Set unit numbers of 64-pt
Group-2 High-density I/O Units to numbers other than 9.
Check the SYSMAC NET Link and SYSMAC LINK Unit operating levels and eliminate duplications.
Input and output word designations registered in I/O table do no agree with input/output words required by Units actually mounted.
Check the I/O table with I/O
Table Verification operation and check all Units to see that they are in correct configuration.
When the system has been confirmed, register the I/O table again.
01 to 99 or 9F
FALS has been executed by the program. Check the FAL number to determine conditions that would cause execution (Set by user or by system).
Correct according to cause indicated by FAL number. If FAL number is 9F, check watchdog timer and cycle time, which may be to long. 9F will be output when FALS(07) is executed and the cycle time is between 120 and 130 ms.
259
Error Flags
Other Error Messages
Section 8-5
A number of other error messages are detailed within this manual. Errors in program 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.
8-5 Error Flags
SR Area
The following table lists the flags and other information provided in the SR and
AR areas that can be used in troubleshooting. Details are provided in 3-4 SR
Area and 3-5 AR Area.
25309
25310
25311
25312
25414
25415
25503
Address(es) Function
23600 to 23615 Node loop status for SYSMAC NET Link system
23700 to 23715 Completion/error code output area for SEND(90)/RECV(98) in
SYSMAC LINK/SYSMAC NET Link System
24700 to 25015 PC Link Unit Run and Error Flags
25100 to 25115 Remote I/O Error Flags
25200
25203
SYSMAC LINK/SYSMAC NET Link Level 0 SEND(90)/RECV(98)
Error Flag
SYSMAC LINK/SYSMAC NET Link Level 1 SEND(90)/RECV(98)
Error Flag
25206
25208
Rack-mounting Host Link Unit Level 1 Error Flag
CPU-mounting Host Link Unit Error Flag
25300 to 25307 FAL number output area.
25308 Low Battery Flag (ON for low battery in CPU or Memory Unit)
Cycle Time Error Flag
I/O Verification Error Flag
Rack-mounting Host Link Unit Level 0 Error Flag
Remote I/O Error Flag
Group-2 High-density I/O Unit Error Flag
Special I/O, Master, or Link Unit Error Flag
Instruction Execution Error (ER) Flag
260
Error Flags
AR Area
Address(es)
0000 to 0009
0010
0011
0012
0013
0014
0015
0200 to 0204
0205 to 0214
0300 to 0315
0400 to 0415
0500 to 0515
0600 to 0615
0713 to 0715
1114
1115
1514
1515
2404
2500 to 2515
Section 8-5
Function
Special I/O or PC Link Unit Error Flags
SYSMAC LINK/SYSMAC NET Link Level 1 System
Error Flags
SYSMAC LINK/SYSMAC NET Link Level 0 System
Error Flags
Rack-mounting Host Link Unit Level 1 Error Flag
Rack-mounting Host Link Unit Level 0 Error Flag
Remote I/O Master Unit 1 Error Flag
Remote I/O Master Unit 0 Error Flag
Error Flags for Slave Racks 0 to 4
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.)
Optical I/O Units (0 to 7) Error Flags
Optical I/O Units (8 to 15) Error Flags
Optical I/O Units (16 to 23) Error Flags
Optical I/O Units (24 to 31) Error Flags
Error History Bits
Communications Controller Error Flag Level 0
EEPROM Error Flag for operating level 0
Communications Controller Error Flag Level 1
EEPROM Error Flag for operating level 1
CPU Low Battery Flag
(If SR 25308 is ON and this flag is OFF, the Memory
Unit battery is low.)
FALS-generating address or cycle time error (BCD)
261
Appendix A
Standard Models
C200H Racks
Name
Backplane (same for all Racks)
CPU Rack CPUs
Memory Units
EPROM
Expansion I/O Power Supply
I/O Racks Units
I/O Connecting
Cables (max. total length: 12 m)
Specifications
10 slots
8 slots
5 slots
3 slots w/built-in power supply (100 to 120/200 to 240 VAC);
Output current: 4.6 A (3.2 A to I/O Units) w/built-in power supply (24 VDC);
Output current: 3 A (1.6 A to I/O Units) w/built-in power supply (100 to 120/200 to 240 VAC);
Output current: 4.6 A (3.0 A to I/O Units);
Can support SYSMAC NET Link/SYSMAC LINK Units.
CMOS-RAM Units; battery back-up UM: 3K words;
DM: 1K words
UM: 7K words;
DM: 1K words
CMOS-RAM Units; battery back-up; with clock
UM: 3K words;
DM: 1K words
UM: 7K words;
DM: 1K words
CMOS-RAM Units; capacitor back-up UM: 3K words;
DM: 1K words
EPROM Unit
(EPROM ordered separately)
EEPROM Units
UM: 7K words;
DM: 1K words
UM: 7K words;
DM: 1K words
UM: 3K words;
DM: 1K words
UM: 7K words;
DM: 1K words
EEPROM Units with clock
27128; 150 ns; write voltage: 12.5 V
100 to 120/200 to 240 VAC (selectable)
24 VDC
UM: 3K words;
DM: 1K words
UM: 7K words;
DM: 1K words
30 cm
70 cm
2 m
5 m
10 m
Model number
C200H-BC101-V2
C200H-BC081-V2
C200H-BC051-V2
C200H-BC031-V2
C200H-CPU21-E
C200H-CPU23-E
C200H-CPU31-E
C200H-MR431
C200H-MR831
C200H-MR433
C200H-MR833
C200H-MR432
C200H-MR832
C200H-MP831
C200H-ME431
C200H-ME831
C200H-ME432
C200H-ME832
ROM-ID-B
C200H-PS221
C200H-PS211
C200H-CN311
C200H-CN711
C200H-CN221
C200H-CN521
C200H-CN131
263
Standard Models Appendix A
C200H Standard I/O Units
Input Units
Name
AC Input Units
DC Input Units
8 pts
Specifications
100 to 120 VAC
16 pts 100 to 120 VAC
8 pts 200 to 240 VAC
16 pts 200 to 240 VAC
8 pts No-voltage contact; NPN
8 pts
8 pts
No-voltage contact; PNP
12 to 24 VDC
AC/DC Input Units
16 pts 24 VDC
8 pts 12 to 24 VAC/DC
16 pts 24 VAC/DC
8 pts 2 A, 250 VAC/24 VDC (For resistive loads) Output
Units
Relay Output Units
Triac Output Units
12 pts 2 A, 250 VAC/24 VDC (For resistive loads)
16 pts 2 A, 250 VAC/24 VAC (For resistive loads)
5 pts
8 pts
8 pts
2 A, 250 VAC/24 VDC (For resistive loads)
Independent commons
2 A, 250 VAC/24 VDC (For resistive loads)
Independent commons
1 A, 120 VAC
8 pts 1 A, 250 VAC
12 pts 0.3 A, 250 VAC
Transistor Output
Units
Analog Timer Unit
Variable Resistor
Connector
(Related Product)
8 pts 1 A, 12 to 48 VDC
12 pts 0.3 A, 24 VDC
16 pts 0.3 A, 24 VDC
8 pts 2.1 A, 24 VDC
8 pts 0.8 A, 24 VDC; source type (PNP); with load short protection
8 pts 0.3 A, 5 to 24 VDC; source type (PNP)
12 pts 0.3 A, 5 to 24 VDC; source type (PNP)
4 timer pts
0.1 to 1 s, 1 to 10 s, 10 to 60 s, or 1 min to 10 min (switchable)
Connector with lead wire (2 m) for 1 external resistor
B7A Interface Units Connects to B7A Link Terminals.
15 or
16 input pts
16 output pts
Model number
C200H-IA121
C200H-IA122
C200H-IA221
C200H-IA222
C200H-ID001
C200H-ID002
C200H-ID211
C200H-ID212
C200H-IM211
C200H-IM212
C200H-OC221
C200H-OC222
C200H-OC225
1, 2
C200H-OC223
C200H-OC224
C200H-OA121-E
C200H-OA221
C200H-OA222
C200H-OD411
C200H-OD211
C200H-OD212 1
C200H-OD213
C200H-OD214
C200H-OD216
C200H-OD217
C200H-TM001
C4K-CN223
C200H-B7AI1
C200H-B7AO1
Note 1. C200H-OD212 Transistor Output Unit and C200H-OC225 Contact Output Unit must be mounted to either 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
C200H Group-2 High-density I/O Units
Name
DC Input Units
Transistor Output
Units
32 pts.
64 pts.
32 pts.
64 pts.
Specifications
24 VDC
24 VDC
16 mA 4.5 VDC to 100 mA 26.4 VDC
16 mA 4.5 VDC to 100 mA 26.4 VDC
Model number
C200H-ID216
C200H-ID217
C200H-OD218
C200H-OD219
C200H Special I/O Units
All of the following are classified as Special I/O Units except for the ASCII Unit, which is an Intelligent I/O Unit.
Highdensity I/O
Units
Name
DC Input
Units
32 pts
32 pts
Specifications
5 VDC (TTL inputs); with high-speed input function
24 VDC; with high-speed inputs
Model number
C200H-ID501
C200H-ID215
Transistor
Output Units
DC Input/
Transistor
Output Units
32 pts
32 pts
16 input/
16 output pts
16 input/
16 output pts
0.1 A, 24 VDC (usable as 128-point dynamic output unit)
35 mA, 5 VDC (TTL outputs) (usable as 128-point dynamic output unit)
12-VDC inputs; with high-speed input function
0.1 A , 12-VDC outputs (usable as 128-point dynamic input unit)
24-VDC inputs; with high-speed input function
0.1 A , 24-VDC outputs (usable as 128-point dynamic input unit)
16 input/
16 output pts
5 VDC (TTL inputs); with high speed input function 35 mA, 5 VDC Output (TTL outputs) (usable as 128-point dynamic input unit)
Analog I/O Analog Input 4 to 20 mA, 1 to 5/0 to 10 V (switchable); 4 inputs
Units Units
4 to 20 mA, 1 to 5/0 to 10/–10 to 10 V; 8 inputs
C200H-OD215
C200H-OD501
C200H-MD115
C200H-MD215
C200H-MD501
C200H-AD001
C200H-AD002
Analog
Output Unit
4 to 20 mA, 1 to 5/0 to 10 V (switchable); 2 outputs
Temperature Sensor Units Thermocouple (K(CA) or J(IC)) (switchable); 4 inputs
Thermocouple (K(CA) or L(Fe-CuNi)) (switchable); 4 inputs
Platinum resistance thermometer (JPt) (switchable), DIN standards;
4 inputs
Platinum resistance thermometer (Pt) (switchable); 4 inputs
Temperature Control Units ThermocouTransistor output ple
Voltage output
C200H-DA001
C200H-TS001
C200H-TS002
C200H-TS101
C200H-TS102
C200H-TC001
C200H-TC002
Heat/Cool Temperature
Control Units
PID Control Units
Current output
Platinum re- Transistor output sistance
Voltage output thermometer Current output
ThermocouTransistor output ple
Voltage output
Current output
Platinum re- Transistor output sistance
Voltage output thermometer Current output
Transistor output;
4 to 20 mA/1 to 5 V/0 to 5V/0 to 10 V inputs (selectable)
Voltage output;
4 to 20 mA/1 to 5 V/0 to 5V/0 to 10 V inputs (selectable)
Current output;
4 to 20 mA/1 to 5 V/0 to 5V/0 to 10 V inputs (selectable)
C200H-TC003
C200H-TC101
C200H-TC102
C200H-TC103
C200H-TV001
C200H-TV002
C200H-TV003
C200H-TV101
C200H-TV102
C200H-TV103
C200H-PID01
C200H-PID02
C200H-PID03
265
Standard Models Appendix A
Name
Position Control Units 1 axis
1 axis
Specifications
Pulse output; speeds: 1 to 100,000 pps
Pulse output; directly connectable to servomotor driver; compatible with line driver; speeds: 1 to 250,000 pps
Pulse output; 1 to 250,000 pps, 53 pts per axis
Cam Positioner Unit
2 axis
Detects angles of rotation by means of a resolver and provides ON and
OFF outputs at specified angles. A maximum of 48 cam outputs (16 external outputs and 32 internal outputs) maximum are available.
High-speed Counter Units 1 axis Pulse input; counting speed: 50 kcps;
5 VDC/12 VDC/24 VDC
ASCII Unit
ID Sensor Units
1 axis Pulse input; counting speed: 75 kcps;
RS-422 line driver
24K-byte RAM and 24K-byte EEPROM are built-in.
Local application, electromagnetic coupling
Model number
C200H-NC111
C200H-NC112
C200H-NC211
C200H-CP114
C200H-CT001-V1
C200H-CT002
C200H-ASC02
C200H-IDS01-V1
Read/Write
Head
Remote application, microwave transmissions
Electromagnetic type
Microwave type
Data Carrier SRAM type for V600-H series.
(see note)
EEPROM type for V600-H series.
60 messages max.; message length: 32, 48, or 64 s (switchable) Voice Unit
Connecting
Cable
Fuzzy Logic Unit
RS-232C
C200H-IDS21
V600-H series
V620-H series
V600-D jj R jj
V600-D jj P jj
C200H-OV001
C200H-CN224
Up to 8 inputs and 4 outputs. (I/O to and from specified data area words) C200H-FZ001
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.
C200H Link Units
Name
Host Link Units Rack-mounting
Specifications
C200H only
PC Link Unit
Remote I/O
Master Units
Remote I/O Slave Units
CPU-mounting C1000H/C2000H
C500
C200H
C120
Single level: 32 Units
Multilevel: 16 Units
Up to two per PC; connectable to up to 5
Slaves per PC total
100 to 120/200 to 240 VAC (switchable)
24 VDC
100 to 120/200 to 240 VAC (switchable)
24 VDC
APF/PCF
RS-422
RS-232C
PCF
APF/PCF
RS-232C
RS-422
RS-485
APF/PCF
Wired
APF/PCF
Wired
Model number
C200H-LK101-PV1
C200H-LK202-V1
C200H-LK201-V1
3G2A6-LK101-EV1
3G2A6-LK101-PEV1
3G2A6-LK201-EV1
3G2A6-LK202-EV1
C200H-LK401
C200H-RM001-PV1
C200H-RM201
C200H-RT001-P
C200H-RT002-P
C200H-RT201
C200H-RT202
Optional Products
Name
I/O Unit Cover
Terminal Block Covers
Specifications
Cover for 10-pin terminal block
Short protection for 10-pin terminal block (package of 10 covers); 8 pts
Model number
C200H-COV11
C200H-COV02
266
Standard Models Appendix A
Connector Cover
Space Unit
Battery Set
Name Specifications
Short protection for 19-pin terminal block (package of 10 covers); 12 pts
Model number
C200H-COV03
Protective cover for unused I/O Connecting Cable connectors C500-COV02
Used for vacant slots
For: C200H-MR_31/MR_33 RAM Memory Units
C200H-ME_32 EEPROM Memory Unit
C200H-CPU31-E CPU
C200H-SP001
C200H-BAT09
Relay 24 VDC
Backplane Insulation Plates For 10-slot Backplane
For 8-slot Backplane
I/O Brackets
Memory Unit Lock Fitting
External Connectors
For 5-slot Backplane
For 3-slot Backplane
For 5-slot Backplane
For 8-slot Backplane
G6B-1174P-FD-US DC24
C200H-ATTA1
C200H-ATT81
C200H-ATT51
C200H-ATT31
C200H-ATT53
C200H-ATT83
For 3-slot Backplane
To secure Memory Unit to CPU
C200H-ATT33
C200H-ATT03
Solder terminal; 40 pin with connector cover Straight type C500-CE401
Right-angle type C500-CE404
Solderless terminal (crimp-type); 40 pin with Straight type connector cover
C500-CE402
Right-angle type C500-CE405
Pressure welded terminal; 40 pin C500-CE403
Solder terminal; 24 pin with connector cover C500-CE241
Solderless terminal; 24 pin with connector cover (crimp-type) C500-CE242
Pressure welded terminal; 24 pin C500-CE243
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
Optical I/O
Units
Repeater Units
Name
No-voltage Input Units 8 pts.
AC/DC Input Units
AC Input Units
Relay Output Units
Triac Output Units
Specifications
12 to 24 VAC/DC 8 pts.
100 to 120 VAC power supply
Model no.
APF/PCF 3G5A2-ID001-PE
PCF 3G5A2-ID001-E
APF/PCF 3G5A2-IM211-PE
PCF 3G5A2-IM211-E
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
2A, 250 VAC/24 VDC APF/PCF 3G5A2-OC221-PE
(w/relay socket) 8 pts.
PCF 3G5A2-OC221-E
1A, 100 to 120/200 to
240 VAC (w/built-in surge killer) 8 pts.
APF/PCF
PCF
3G5A2-OA222-PE
3G5A2-OA222-E
Transistor Output Unit 0.3 A, 12 to 48 VDC
8 pts.
Connected between 32nd and 33rd Units
APF/PCF 3G5A2-OD411-PE
APF/PCF 3G5A2-RPT01-PE
Remote Subsystem; power supply: 85 to
250 VAC.
PCF 3G5A2-RPT01-E
267
Standard Models
Link Adapters
Name
Link Adapters
Specifications
3 RS-422 connectors
3 optical connectors (APF/PCF)
3 optical connectors (PCF)
1 connector for RS-232C; 2 for RS-422
1 connector each for APF/PCF, RS-422, and RS-232C
1 connector each for PCF, RS-422, and RS-232C
1 connector each for APF/PCF and APF
1 connector each for PCF and AGF
1 connector for APF/PCF; 2 for AGF
1 connector for PCF; 2 for AGF
O/E converter; 1 connector for RS-485, 1 connector each for APF/PCF
Used for on-line removal of FIT or SYSMAC NET Link Units from the
SYSMAC NET Link System, SYSMAC NET Optical Link Adapter 3 connectors for APF/PCF.
Appendix A
Model no.
3G2A9-AL001
3G2A9-AL002-PE
3G2A9-AL002-E
3G2A9-AL003
3G2A9-AL004-PE
3G2A9-AL004-E
3G2A9-AL005-PE
3G2A9-AL005-E
3G2A9-AL006-PE
3G2A9-AL006-E
B500-AL007-PE
B700-AL001
DIN Products
Name
DIN Track Mounting Bracket 1 set (2 included)
DIN Track
Specifications
Length: 50 cm; height: 7.3 cm
Length: 1 m; height: 7.3 cm
End Plate
Spacer
Length: 1 m; height: 16 mm
---
---
Model number
C200H-DIN01
PFP-50N
PFP-100N
PFP-100N2
PFP-M
PFP-S
Optical Fiber Cable
Plastic Optical Fiber Cable (APF) APF stands for “All-Plastic Fiber.” This cable can be used to connect only Units having the suffix “-P” in their model number.
The maximum length is 20 m. The 3G5A2-PF002 cable comes without connectors and must be assembled by the user.
Product
Plastic Optical Fiber Cable
Optical Connector A
Optical Connector B
Plastic Optical Fiber Cable
Optical Fiber Processing Kit
Description
Cable only (optical connectors not provided)
Order in units of 5 m for cable less than 100 m, or in units of
200 m or 500 m.
2 pcs (brown),for plastic Optical fiber 10 m long max.
2 pcs (black) for plastic Optical fiber 8 to 20 m long
1 m, w/optical connector A provided at both ends
Accessory: 125-mm nipper (Muromoto Tekko’s 550M) for APF
Model no.
3G5A2-PF002
3G5A2-CO001
3G5A2-CO002
3G5A2-PF101
3G2A9-TL101
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 having 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
Optical Fiber Cables 0.1 m, w/connector
(for indoors)
1 m, w/connector
2 m, w/connector
3 m, w/connector
5 m, w/connector
10 m, w/connector
Description
Ambient temperature: –10
°
to 70
°
C
20 m, w/connector
30 m, w/connector
40 m, w/connector
50 m, w/connector
Optical Fiber Cable 1 to 500 m (Order in Units of 10 m)
(for outdoors)
501 to 800 m (Order in Units of 10 m)
Ambient temperature: –10
Ambient temperature: 0
°
°
to 70
to 55
°
(Must not be subjected to direct
C
°
C sunlight)
Model no.
3G5A2-OF011
3G5A2-OF101
3G5A2-OF201
3G5A2-OF301
3G5A2-OF501
3G5A2-OF111
3G5A2-OF211
3G5A2-OF311
3G5A2-OF411
3G5A2-OF511
3G5A2-OF002
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.
Fiber length (m)
Peripheral Devices
Name
Hand-held Programming
Console
Data Access Console
Specifications
Vertical, w/backlight
Connecting cable required; sold separately
Vertical, w/backlight
Connecting cable required; sold separately
For handheld console, 2 m Programming and Data
Access Console Connecting
Cables
Panel Mounting Bracket
For handheld console, 4 m
Programming Console
Bases
Mounts Hand-held Programming Console or Data Access Console to a panel.
Used to mount 16- or 32-point I/O Units to 29-mm height rightmost two slots when mounting peripherals directly to CPU.
49-mm height
Data Setting Console Used for data input and process value display for the
C200H-TC jjj
/C200H-TV jjj
/C200H-PID jj
.
Data Setting Console Con- For C200H-DSC01 necting Cables
2 m
4 m
PROM Writer Applicable to all C-series PCs.
Write voltages: 12.5 or 21 V
Model number
C200H-PRO27-E
C200H-DAC01-E
C200H-CN222
C200H-CN422
C200H-ATT01
C200H-BP001
C200H-BP002
C200H-DSC01
C200H-CN225
C200H-CN425
C500-PRW06
269
Standard Models Appendix A
Name
Floppy Disk Interface Unit
Printer Interface Unit
Memory Pack
Peripheral Interface Unit
Graphic Programming
Consoles
Memory Pack
CRT Interface Unit
Specifications
Applicable to all C-series PCs.
Applicable to all C-series PCs.
Applicable to C200H, C1000H, or C2000H.
Connects the C200H CPU to a GPC or FIT.
Connecting Cable sold separately.
100- to 120-VAC power supply (Comments supported.)
200- to 240-VAC power supply (Comments supported.)
Applicable to C200H, C1000H, or C2000H.
For connection between GPC and CRT
Ladder Support Software (LSS)
Product
Ladder Support Software
Description
5.25”, 2D for IBM PC/AT compatible
3.5”, 2DD for IBM PC/AT compatible
Model number
3G2C5-FDI03-E
3G2A5-PRT01-E
C2000-MP103-EV3
C200H-IP006
3G2C5-GPC03-E
3G2C5-GPC04-E
3G2C5-MP304-EV3
C500-GDI01
Model no.
C500-SF711-EV3
C500-SF312-EV3
SYSMAC LINK Unit/SYSMAC NET Link Unit
Name
SYSMAC LINK Unit
Terminator
Attachment Stirrup
F Adapter
F Adapter Cover
Communications
Cable
Auxiliary Power Supply Unit
SYSMAC NET Link Unit
Power Supply
Adapter
Power Cable
Bus Connection Unit
Specifications
Wired via coaxial cable.
Must be mounted to rightmost 2 slots on Rack with
C200H-CPU31-E
Wired via optical fiber cable.
Bus Connection Unit required separately. May be used with
APS Power Supply Unit.
Model number
C200H-SLK23
C200H-SLK13
One required for each node at ends of System
Provided with SYSMAC LINK Unit
---
C1000H-TER01
C200H-TL001
C1000H-CE001
---
Coaxial cables Manufactured by Hitachi
Manufactured by Fujigura
C1000H-COV01
ECXF5C-2V
5C-2V
Supplies backup power to either one or two SYSMAC LINK
Units. One C200H-CN111 Power Connecting Cable included.
Must be mounted to rightmost 2 slots on Rack with C200H-
CPU31-E
Required when supplying power from
Central Power Supply
For 1 Unit
Connects Power Supply Adapter and SYS-
MAC NET Link Unit
C200H-APS03
C200H-SNT32
C200H-APS01
For 2 Units C200H-APS02
For 1 Unit C200H-CN111
Connects SYSMAC LINK Unit or SYSMAC
NET Link Unit to CPU
For 2 Units C200H-CN211
For 1 Unit C200H-CE001
For 2 Units C200H-CE002
270
Appendix B
Programming Instructions
This appendix provides tables listing the programming instructions used with C200H PCs. The first table summarizes 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 conditions. 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.
15
16
17
18
19
11
12
13
14
20
21
22
07
08
09
10
03
04
05
06
––
00
01
02
––
––
––
––
––
––
––
––
––
––
––
Function Code Name
AND
AND LOAD
AND NOT
COUNTER
LOAD
LOAD NOT
OR
OR LOAD
OR NOT
OUTPUT
OUTPUT NOT
TIMER
NO OPERATION
END
INTERLOCK
INTERLOCK CLEAR
JUMP
JUMP END
FAILURE ALARM
SEVERE FAILURE ALARM
STEP DEFINE
STEP START
SHIFT REGISTER
KEEP
REVERSIBLE COUNTER
DIFFERENTIATE UP
DIFFERENTIATE DOWN
HIGH-SPEED TIMER
WORD SHIFT
REVERSIBLE WORD SHIFT
CYCLE TIME
MULTI-WORD COMPARE
COMPARE
MOVE
MOVE NOT
KEEP
CNTR
DIFU
DIFD
TIMH
WSFT
RWS
SCAN
MCMP
ILC
JMP
JME
FAL
FALS
STEP
SNXT
SFT
CMP
MOV
MVN
Mnemonic
AND
AND LD
AND NOT
CNT
LD
LD NOT
OR
OR LD
OR NOT
OUT
OUT NOT
TIM
NOP
END
IL
Page
106
119
104
104
116
128
128
198
138
108
110
110
197
197
188
188
121
139
130
130
103
102
104
104
112
111
111
108
102
103
102
116
102
102
102
271
Programming Instructions
53
54
55
56
49
50
51
52
41
46
47
48
37
38
39
40
34
35
36
30
31
32
33
26
27
28
29
23
Function Code
24
25
71
72
73
74
67
68
69
70
75
76
61
63
64
65
66
57
58
59
60
Name
BCD-TO-BINARY
BINARY-TO-BCD
ARITHMETIC SHIFT LEFT
ARITHMETIC SHIFT RIGHT
ROTATE LEFT
ROTATE RIGHT
COMPLEMENT
BCD ADD
BCD SUBTRACT
BCD MULTIPLY
BCD DIVIDE
AND WORD
OR WORD
EXCLUSIVE OR
EXCLUSIVE NOR
INCREMENT
DECREMENT
SET CARRY
CLEAR CARRY
DISPLAY MESSAGE
LONG MESSAGE
TERMINAL MODE
SET SYSTEM
BINARY ADD
BINARY SUBTRACT
BINARY MULTIPLY
BINARY DIVIDE
DOUBLE BCD ADD
DOUBLE BCD SUBTRACT
DOUBLE BCD MULTIPLY
DOUBLE BCD DIVIDE
DOUBLE BCD-TO-DOUBLE BINARY
DOUBLE BINARY-TO-DOUBLE BCD
DOUBLE COMPARE
GROUP-2 HIGH-DENSITY I/O REFRESH
COLUMN-TO-WORD
WORD-TO-COLUMN
HOURS-TO-SECONDS
SECONDS-TO-HOURS
BIT COUNTER
BLOCK COMPARE
VALUE CALCULATE
BLOCK TRANSFER
BLOCK SET
SQUARE ROOT
DATA EXCHANGE
ONE DIGIT SHIFT LEFT
ONE DIGIT SHIFT RIGHT
4-TO-16 DECODER
272
Appendix B
201
174
176
178
179
161
164
166
182
159
159
159
159
198
200
200
160
162
165
167
180
180
181
146
147
125
125
125
126
179
202
143
202
134
133
172
135
126
127
150
168
146
148
141
206
131
132
148
149
Page
MPRF
CTW
WTC
HTS
STH
BCNT
BCMP
VCAL
XFER
DVB
ADDL
SUBL
MULL
DIVL
BINL
BCDL
CMPL
BSET
ROOT
XCHG
SLD
SRD
MLPX
CLC
MSG
LMSG
TERM
SYS
ADB
SBB
MLB
ANDW
ORW
XORW
XNRW
INC
DEC
STC
BIN
BCD
ASL
Mnemonic
ASR
ROL
ROR
COM
ADD
SUB
MUL
DIV
Programming Instructions
90
91
92
84
85
86
89
93
94
97
98
80
81
82
83
77
Function Code
78
79
Name
16-TO-4 ENCODER
7-SEGMENT DECODER
FLOATING POINT DIVIDE
SINGLE WORD DISTRIBUTE
DATA COLLECT
MOVE BIT
MOVE DIGIT
REVERSIBLE SHIFT REGISTER
TABLE COMPARE
ASCII CONVERT
INTERRUPT CONTROL
NETWORK SEND
SUBROUTINE ENTER
SUBROUTINE DEFINE
RETURN
WATCHDOG TIMER REFRESH
I/O REFRESH
NETWORK RECEIVE
SFTR
TCMP
ASC
INT
SEND
SBS
SBN
Mnemonic
DMPX
SDEC
FDIV
DIST
COLL
MOVB
MOVD
RET
WDT
IORF
RECV
Appendix B
123
144
157
185
207
183
183
152
154
169
135
136
136
137
183
205
205
208
Page
273
Programming Instructions Appendix B
Instruction Execution Times
The following table lists the execution times for all instructions that are available for the C200H. The maximum and minimum execution times and the conditions which cause them are given where relevant. When “word” is referred to in the Conditions column, it implies the content of any word except for indirectly addressed DM words. Indirectly addressed DM words, which create longer execution times when used, are indicated by “ * DM.”
Execution times for most instructions depend on whether they are executed with an ON or an OFF execution condition. 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 circumstances, 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.
All execution times are given in microseconds unless otherwise noted.
Instruction
LD
LD NOT
AND
AND NOT
OR
OR NOT
AND LD
OR LD
OUT
OUT NOT
TIM
CNT
Conditions
–––
–––
–––
–––
–––
–––
–––
–––
–––
–––
Constant for SV
* DM for SV
Constant for SV
* DM for SV
NOP(00)
END(01)
IL(02)
–––
–––
–––
ILC(03)
JMP(04)
–––
–––
JME(05) –––
FAL(06) 01 to 99 –––
FAL(06) 00
FALS(07)
STEP(08)
SNXT(09)
–––
–––
–––
–––
0.75
80
59
44
69
47
236
182
4.28 ms
95
34
0.75
0.75
0.75
0.75
1.13
1.13
2.25
ON execution time (
µ s) OFF execution time (
µ s)
0.75
–––
0.75
0.75
0.75
–––
–––
–––
2.25
JMP: 2.25
R: 160
IL: 2.25
JMP: 2.25
–––
–––
35
35
35
35
2.25
2.25
2.25
2.25
2.25
–––
–––
–––
–––
–––
–––
R: 2.25
IL: 2.25
JMP: 2.25
R: 160
IL: 2.25
JMP: 2.25
R: 2.25
IL: 2.25
274
WSFT(16)
RWS(17)
SCAN(18)
MCMP(19)
CMP(20)
MOV(21)
MVN(22)
BIN (23)
BCD(24)
ASL(25)
ASR(26)
ROL(27)
ROR(28)
Programming Instructions
Instruction
SFT(10)
Conditions
With 1-word shift register
KEEP(11)
CNTR(12)
DIFU(13)
DIFD(14)
TIMH(15)
With 250-word shift register
–––
Constant for SV
* DM for SV
–––
–––
Interrupt Constant for SV
Normal cycle
Interrupt * DM for SV
Normal cycle
When shifting 1 word
When shifting 1,000 words using * DM
When resetting 1 word
When shifting 999 words using
*
DM
Constant for SV
* DM for SV
Comparing 2 words, result word
Comparing 2
*
DM, result
*
DM
When comparing a constant to a word
When comparing two * DM
When transferring a constant to a word
When transferring
*
DM to
*
DM
When transferring a constant to a word
When transferring * DM to * DM
When converting a word to a word
When converting * DM to * DM
When converting a word to a word
When converting * DM to * DM
When shifting a word
When shifting * DM
When shifting a word
When shifting * DM
When rotating a word
When rotating * DM
When rotating a word
When rotating * DM
Appendix B
261
174
338
179
337
72
158
72
158
77
162
77
162
124
296
88
259
91
170
8.6 ms
388
30.3 ms
311
412
636
890
ON execution time (
µ s)
181
OFF execution time (
µ s)
R: 191
IL: 30
JMP: 30
1.44 ms
1.13
111
205
93
92
120
135
120
135
IL: 30
JMP: 30
–––
R: 85
IL: 49
JMP: 49
Normal: 93
IL: 93
JMP: 84
Normal: 92
IL: 92
JMP: 84
R: 199
IL: 199
JMP: 73
R: 291
IL: 291
JMP: 73
3
3.75
3.75
3.75
3
3
3
3
3
2.25
2.25
2.25
2.25
275
Programming Instructions
Instruction
COM(29)
ADD(30)
SUB(31)
MUL(32)
DIV(33)
ANDW(34)
ORW(35)
XORW(36)
XNRW(37)
INC(38)
DEC(39)
STC(40)
CLC(41)
MSG(46)
LMSG(47)
TERM(48)
SYS(49)
ADB(50)
SBB(51)
MLB(52)
DVB(53)
ADDL(54)
SUBL(55)
MULL(56)
DIVL(57)
BINL(58)
Conditions
When inverting a word
When inverting * DM
Constant + word b word
* DM + * DM b
* DM
Constant + word b word
* DM – * DM b * DM
Constant x word b word
* DM x * DM b word
Word
÷
constant b word
* DM
÷ * DM b * DM
Constant AND word b word
* DM AND * DM b * DM
Constant OR word b word
* DM OR * DM b
* DM
Constant XOR word b word
* DM XOR * DM b * DM
Constant XNOR word b word
* DM XNOR * DM b
* DM
When incrementing a word
When incrementing
*
DM
When decrementing a word
When decrementing * DM
–––
–––
–––
Constant for SV
* DM for SV
–––
–––
Constant + word b word
* DM + * DM b * DM
Constant – word b word
* DM – * DM b
* DM
Constant x word b word
*
DM x
*
DM b
*
DM
Word
÷
constant b word
* DM
÷ * DM b
* DM
Word + word b word
* DM + * DM b
* DM
Word – word b word
*
DM –
*
DM b
*
DM
Word x word b word
* DM x * DM b
* DM
Word
÷
word b word
* DM
÷ * DM b * DM
When converting words to words
When converting * DM to * DM
276
Appendix B
984
290
367
161
2
144
393
82
167
27
27
98
147
396
205
452
371
124
373
82
167
122
371
122
371
122
476
704
243
491
255
504
1.14 ms
1.39 ms
3.25 ms
3.39 ms
350
511
ON execution time (
µ s)
67
152
153
415
161
422
480
742
724
OFF execution time (
µ s)
2.25
3.75
3.75
3.75
3.75
3.75
3.75
3.75
3.75
2.25
2.25
1.5
1.5
2.25
3.75
3.75
3.75
3.75
3.75
3.75
3.75
3.75
3.75
3.75
3.75
3
Programming Instructions Appendix B
Instruction
BCDL(59)
CMPL(60)
MPRF(61)
CTW(63)
WTC(64)
HTS(65)
STH(66)
BCNT(67)
BCMP(68)
VCAL69)
XFER(70)
BSET(71)
ROOT(72)
XCHG(73)
SLD(74)
SRD(75)
MLPX(76)
DMPX(77)
SDEC(78)
FDIV(79)
DIST(80)
Conditions
When converting words to words
When converting * DM to * DM
When comparing words to words
When comparing * DM to * DM
When refreshing one 32-pt Output Unit
ON execution time (
µ s)
588
750
380
543
700
When refreshing ten 32-pt Input Units 3.60 ms
When transferring from words to a word
When transferring * DM to * DM
When transferring from a word to words
When transferring * DM to * DM
Word to word
*
DM to
*
DM
670
923
807
1.07 ms
859
1.00 ms
Word to word
* DM to * DM
When counting 1 word
When counting 1,000 words using * DM
Comparing constant to word-designated table
744
889
502
100 ms
674
Comparing * DM b
* DM-designated table 926
Trigonometric functions.
488
2.71 ms Linear approximation with a 256 word table
When transferring 1 word 305
When transferring 1,000 words using
* DM
When setting a constant to 1 word
When setting * DM ms to 1,000 words using * DM
16 ms
209
4.28 ms
When taking root of word and placing in a word
When taking root of 99,999,999 in * DM and placing in * DM
631
1.16 ms
Between words
Between * DM
156
316
When shifting 1 word 193
When shifting 1,000 DM words using * DM 33 ms
When shifting 1 word 193
When shifting 1,000 DM words using * DM 33 ms
When decoding word to word 203
When decoding * DM to * DM
When encoding a word to a word
568
225
When encoding * DM to * DM
When decoding a word to a word
551
235
When decoding
*
DM to
*
DM
Word
÷
word b word (equals 0)
Word
÷
word b word (doesn’t equal 0)
* DM
÷ * DM b * DM
Constant b word + (word)
* DM b ( * DM + ( * DM))
571
632
1.77 ms
2.1 ms
246
481
OFF execution time (
µ s)
3
3.75
3.75
3.75
3.75
3.75
3.75
3.75
3.75
3.75
3.75
3.75
3
3
3
3
3.75
3.75
3.75
3.75
3.75
277
Programming Instructions Appendix B
Instruction
COLL(81)
MOVB (82)
MOVD(83)
SFTR(84)
TCMP(85)
ASC(86)
INT(89)
SEND(90)
SBS(91)
SBN(92)
RET(93)
WDT(94)
IORF(97)
RECV(98)
Conditions ON execution time (
µ s)
(Word + (word)) b word
( * DM + ( * DM)) b
* DM
When transferring word to a word
When transferring * DM to * DM
262
497
158
357
When transferring word to a word
When transferring * DM to * DM
195
399
When shifting 1 word 284
When shifting 1,000 DM words using * DM 13.8 ms
Comparing constant to words in a designated table
542
Comparing * DM b * DM-designated table 830
Word b word 270
* DM b * DM
When reading interrupt mask
454
265
When masking and clearing interrupt
1-word transmit
1000-word transmit
–––
–––
–––
–––
1-word refresh
30-word refresh
1-word refresh
1000-word refresh
265
563
752
158
–––
198
35
450
4 ms
559
764
OFF execution time (
µ s)
3.75
3.75
3.75
3.75
3.75
3.75
3.75
3.75
2.25
–––
1.5
2.25
3
3.75
278
Programming Instructions
Basic Instructions
Name
Mnemonic
AND
AND
AND LOAD
AND LD
AND NOT
AND NOT
COUNTER
CNT
LOAD
LD
LOAD NOT
LD NOT
OR
OR
Symbol
B
Appendix B
Function Operand Data Areas
Logically ANDs the status of the designated bit with the current execution condition.
B:
IR
SR
HR
AR
LR
TC
Logically ANDs the resultant execution conditions of the preceding logic blocks.
None
B
CP
R
CNT N
SV
Logically ANDs the inverse of the designated bit with the current execution condition.
B:
IR
SR
HR
AR
LR
TC
A decrementing counter. SV: 0 to 9999;
CP: count pulse; R: reset input. The TC bit is entered as a constant.
N:
TC
SV:
IR
HR
AR
LR
DM
#
B
B
B
Defines the status of bit B as the execution condition for subsequent operations in the instruction line.
Defines the status of the inverse of bit B as the execution condition for subsequent operations in the instruction line.
B:
IR
SR
HR
AR
LR
TC
B:
IR
SR
HR
AR
LR
TC
TR
Logically ORs the status of the designated bit with the current execution condition.
B:
IR
SR
HR
AR
LR
TC
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
Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
279
Programming Instructions
Name
Mnemonic
OR LOAD
OR LD
Symbol
Appendix B
Function Operand Data Areas
Logically ORs the resultant execution conditions of the preceding logic blocks.
None
OR NOT
OR NOT
OUTPUT
OUT
OUTPUT NOT
OUT NOT
TIMER
TIM
B
B
B
TIM N
SV
Logically ORs the inverse of the designated bit with the execution condition.
B:
IR
SR
HR
AR
LR
TC
Turns ON B for an ON execution condition; turns OFF B for an OFF execution condition.
B:
IR
SR
HR
AR
LR
TR
Turns OFF B for an ON execution condition; turns ON B for an OFF execution condition.
B:
IR
SR
HR
AR
LR
ON-delay (decrementing) timer operation.
Set value: 000.0 to 999.9 s. The same TC bit cannot be assigned to more than one timer/counter. The TC bit is entered as a constant.
N:
TC
SV:
IR
HR
AR
LR
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
Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
280
Programming Instructions
Special Instructions
Symbol Name
Mnemonic
NO OPERATION
NOP(00)
None
Appendix B
Function Operand Data Areas
Nothing is executed and program operation moves to the next instruction.
None
END
END(01)
END(01)
Required at the end of each program. Instructions located after END(01) will not be executed.
None
INTERLOCK
IL(02)
INTERLOCK CLEAR
ILC(03)
JUMP
JMP(04)
JUMP END
JME(05)
FAILURE ALARM
(@)FAL(06)
SEVERE FAILURE
ALARM
FALS(07)
IL(02)
ILC(03)
JMP(04) N
JME(05) N
FAL(06) N
FALS(07) N
If an interlock condition is OFF, all outputs and all timer PVs between the current
IL(02) and the next ILC(03) are turned OFF or reset, respectively. Other instructions are treated as NOP. Counter PVs are maintained. If the execution condition is ON, execution continues normally.
When the execution condition for the
JMP(04) instruction is ON, all instructions between JMP(04) and the corresponding
JME(05) are to be ignored or treated as
NOP(00). For direct jumps, the corresponding JMP(04) and JME(05) instructions have the same N value in the range
01 through 99. Direct jumps are usable only once each per program (i.e., N is 01 through 99 can be used only once each) and the instructions between the JUMP and JUMP END instructions are ignored;
00 may be used as many times as necessary, instructions between JMP 00 and the next JME 00 are treated as NOP, thus increasing cycle time, as compared with direct jumps.
Assigns a failure alarm code to the given execution condition.When N can be given a value between 01 and 99 to indicate that a non-fatal error (i.e., one that will not stop the CPU) has occurred. This is indicated by the PC outputting N (the FAL number) to the FAL output area. To reset the FAL area, N can be defined as 00. This will cause all previously recorded FAL numbers in the FAL area to be deleted. FAL data sent after a 00 will be recorded in the normal way. The same code numbers can be used for both FAL(06) and FALS(07).
A fatal error is indicated by outputting N to the FAL output area and the CPU is stopped. The same FAL numbers are used for both FAL(06) and FALS(07).
None
N:
00 to 99
(not applicable for
C jj P, C jj K, or
C120 PCs)
N:
00 to 99
N:
01 to 99
STEP DEFINE
STEP(08)
STEP(08) B
When used with a control bit (B), defines the start of a new step and resets the previous step. When used without B, it defines the end of step execution.
B:
IR
HR
AR
LR
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
Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
281
Programming Instructions
Name
Mnemonic
STEP START
SNXT(09)
SHIFT REGISTER
SFT(10)
KEEP
KEEP(11)
Appendix B
I
P
R
Symbol Function Operand Data Areas
SNXT(09) B
SFT(10)
ST
E
Used with a control bit (B) to indicate the end of the step, reset the step, and start the next step which has been defined with the same control bit.
B:
IR
HR
AR
LR
Creates a bit shift register for data from the starting word (St) through to the ending word (E). I: input bit; P: shift pulse; R: reset input. St must be less than or equal to E. St and E must be in the same data area.
St/E:
IR
HR
AR
LR
15
E
00 15
ST
00
IN
S
R
KEEP(11)
B
Defines a bit (B) as a latch, controlled by the set (S) and reset (R) inputs.
B:
IR
HR
AR
LR
REVERSIBLE
COUNTER
CNTR (12)
DIFFERENTIATE UP
DIFU(13)
DIFFERENTIATE
DOWN
DIFD(14)
HIGH-SPEED TIMER
TIMH(15)
WORD SHIFT
(@)WSFT(16)
II
DI
R
CNTR(12)
N
SV
Increases or decreases the PV by one whenever the increment input (II) or decrement input (DI) signals, respectively, go from OFF to ON. SV: 0 to 9999; R: reset input. Each TC bit can be used for one timer/ counter only. The TC bit is entered as a constant.
N:
TC
DIFU(13) B
DIFU(13) turns ON the designated bit (B) for one cycle on reception of the leading
(rising) edge of the input signal; DIFD(14) turns ON the bit for one cycle on reception of the trailing (falling) edge.
B:
IR
HR
AR
LR
DIFD(14) B
TIMH(15) N
SV
WSFT(16)
St
E
A high-speed, ON-delay (decrementing) timer. SV: 00.02 to 99.99 s. Each TC bit can be assigned to only one timer or counter.
The TC bit is entered as a constant.
N:
TC
The data in the words from the starting word (St) through to the ending word (E), is shifted left in word units, writing all zeros into the starting word. St must be less than or equal to E, and St and E must be in the same data area.
St/E:
IR
HR
AR
LR
DM
SV:
IR
SR
HR
AR
LR
DM
#
SV:
IR
SR
HR
AR
LR
HR
#
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
Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
282
Programming Instructions
Name
Mnemonic
REVERSIBLE WORD
SHIFT
(@)RWS(17)
CYCLE TIME
(@)SCAN(18)
MULTI-WORD
COMPARE
(@)MCMP(19)
COMPARE
(@)CMP(20)
MOVE
(@)MOV(21)
Symbol
RWS(17)
C
St
E
SCAN(18)
Mi
---
---
MCMP(19)
S
1
S
2
D
CMP(20)
Cp1
Cp2
MOV(21)
S
D
Appendix B
Function Operand Data Areas
Creates and controls a reversible non-synchronous word shift register between St and E. Exchanges the content of a word containing zero with the content of either the preceding or following word, depending on the shift direction. Bits 13, 14, and 15 of control word C determine the mode of operation of the register according to the following: The shift direction is determined by bit 13 (OFF shifts the non-zero data to higher addressed words;
ON to lower addressed words). Bit 14 is the register enable bit (ON for shift enabled). Bit 15 is the reset bit (if bit 15 is ON, the register will be set to zero between St and E when the instruction is executed with bit 14 also ON). St and E must be in the same data area.
Sets the minimum cycle time, Mi, in tenths of milliseconds. The possible setting range is from 0 to 999.0 ms. If the actual cycle time is less than the time set using
SCAN(18), the CPU will wait until the designated time has elapsed before starting the next cycle.
Compares the data within a block of 16 words of 4-digit hexadecimal data (S
1
to
S
1
+15) with that in another block of 16 words (S
2
to S
2
+15) on a word-by-word basis. If the words are not in agreement, the bit corresponding to unmatched words turns ON in the result word, D. Bits corresponding to words that are equal are turned OFF.
Compares the data in two 4-digit hexadecimal words (Cp1 and Cp2) and outputs result to the GR, EQ, or LE Flags.
C:
IR
SR
HR
AR
LR
TC
DM
#
Mi:
IR
SR
HR
AR
LR
TC
DM
#
S
1
IR
/S
2
:
SR
HR
AR
LR
TC
DM
Transfers data from source word, (S) to destination word (D).
St/E:
IR
SR
HR
AR
LR
TC
DM
---:
Not used.
D:
IR
SR
HR
AR
LR
TC
DM
S:
IR
SR
HR
AR
LR
TC
DM
#
Cp1/Cp2:
IR
SR
HR
AR
LR
TC
DM
#
D:
IR
HR
AR
LR
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
Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
283
Programming Instructions
Name
Mnemonic
MOVE NOT
(@)MVN(22)
Symbol
MVN(22)
S
D
BCD-TO-BINARY
(@)BIN(23)
BINARY-TO-BCD
(@)BCD(24)
BIN(23)
S
R
BCD(24)
S
R
Appendix B
Function
Transfers the inverse of the data in the source word (S) to destination word (D).
S:
IR
SR
HR
AR
LR
TC
DM
#
Converts 4-digit, BCD data in source word
(S) into 16-bit binary data, and outputs converted data to result word (R).
S
(BCD )
R
( BIN )
S:
IR
SR
HR
AR
LR
TC
DM x10
0 x10 1 x10 2 x10 3 x16 0 x16 1 x16 2 x16 3
Operand Data Areas
D:
IR
HR
AR
LR
DM
R:
IR
HR
AR
LR
DM
Converts binary data in source word (S) into BCD, and outputs converted data to result word (R).
S R
( BIN) (BCD ) x16 0 x16 1 x16 2 x16 3 x10 0 x10 1 x10 2 x10 3
S:
IR
SR
HR
AR
LR
DM
R:
IR
HR
AR
LR
DM
ARITHMETIC SHIFT
LEFT
(@)ASL(25)
ARITHMETIC SHIFT
RIGHT
(@)ASR(26)
ASL(25)
Wd
ASR(26)
Wd
Each bit within a single word of data (Wd) is shifted one bit to the left, with zero written to bit 00 and bit 15 moving to CY.
CY
15 00
Wd 0
Wd:
IR
HR
AR
LR
DM
Each bit within a single word of data (Wd) is shifted one bit to the right, with zero written to bit 15 and bit 00 moving to CY.
0
15
Wd
00
CY
Wd:
IR
HR
AR
LR
DM
ROTATE LEFT
(@)ROL(27)
ROL(27)
Wd
Each bit within a single word of data (Wd) is moved one bit to the left, with bit 15 moving to carry (CY), and CY moving to bit 00.
15 00
Wd CY
Wd:
IR
HR
AR
LR
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
Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
284
Programming Instructions Appendix B
Name
Mnemonic
ROTATE RIGHT
(@)ROR(28)
COMPLEMENT
(@)COM(29)
Symbol
ROR(28)
Wd
COM(29)
Wd
Function Operand Data Areas
Each bit within a single word of data (Wd) is moved one bit to the right, with bit 00 moving to carry (CY), and CY moving to bit
15.
15 00
CY Wd
Wd:
IR
HR
AR
LR
DM
Inverts bit status of one word (Wd) of data, changing 0s to 1s, and vice versa.
Wd Wd
Wd:
IR
HR
AR
LR
DM
BCD ADD
(@)ADD(30)
ADD(30)
Au
Ad
R
Adds two 4-digit BCD values (Au and Ad) and content of CY, and outputs the result to the specified result word (R).
Au + Ad +
Au/Ad:
IR
SR
HR
AR
LR
TC
DM
#
R:
IR
HR
AR
LR
DM
BCD SUBTRACT
(@)SUB(31)
BCD MULTIPLY
(@)MUL(32)
BCD DIVIDE
(@)DIV(33)
SUB(31)
Mi
Su
R
MUL(32)
Md
Mr
R
DIV(33)
Dd
Dr
R
Subtracts both the 4-digit BCD subtrahend
(Su) and content of CY, from the 4-digit
BCD minuend (Mi) and outputs the result to the specified result word (R).
Mi – Su – CY R CY
Multiplies the 4-digit BCD multiplicand
(Md) and 4-digit BCD multiplier (Mr), and outputs the result to the specified result words (R and R + 1). R and R + 1 must be in the same data area.
Md x Mr R + 1 R
Divides the 4-digit BCD dividend (Dd) by the 4-digit BCD divisor (Dr), and outputs the result to the specified result words. R receives the quotient; R + 1 receives the remainder. R and R + 1 must be in the same data area.
Dd
÷
Dr R + 1 R
Mi/Su:
IR
SR
HR
AR
LR
TC
DM
#
Md/Mr:
IR
SR
HR
AR
LR
TC
DM
#
Dd/Dr:
IR
SR
HR
AR
LR
TC
DM
#
R:
IR
HR
AR
LR
DM
R:
IR
HR
AR
LR
DM
R:
IR
HR
AR
LR
DM
LOGICAL AND
(@)ANDW(34)
ANDW(34)
I1
I2
R
Logically ANDs two 16-bit input words (I1 and I2) and sets the bits in the result word
(R) if the corresponding bits in the input words are both ON.
I1/I2:
IR
SR
HR
AR
LR
TC
DM
#
R:
IR
HR
AR
LR
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
Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
285
Programming Instructions
Name
Mnemonic
LOGICAL OR
(@)ORW(35)
EXCLUSIVE OR
(@)XORW(36)
EXCLUSIVE NOR
(@)XNRW(37)
INCREMENT
(@)INC(38)
DECREMENT
(@)DEC(39)
SET CARRY
(@)STC(40)
Symbol
ORW(35)
I1
I2
R
XORW(36)
I1
I2
R
XNRW(37)
I1
I2
R
INC(38)
Wd
DEC(39)
Wd
Appendix B
Function
Logically ORs two 16-bit input words (I1 and I2) and sets the bits in the result word
(R) when one or both of the corresponding bits in the input words is/are ON.
Exclusively ORs two 16-bit input words (I1 and I2) and sets the bits in the result word
(R) when the corresponding bits in input words differ in status.
Exclusively NORs two 16-bit input words
(I1 and I2) and sets the bits in the result word (R) when the corresponding bits in both input words have the same status.
Increments the value of a 4-digit BCD word
(Wd) by one, without affecting carry (CY).
Wd:
IR
HR
AR
LR
DM
I1/I2:
IR
SR
HR
AR
LR
TC
DM
#
I1/I2:
IR
SR
HR
AR
LR
TC
DM
#
I1/I2:
IR
SR
HR
AR
LR
TC
DM
#
Operand Data Areas
R:
IR
HR
AR
LR
DM
R:
IR
HR
AR
LR
DM
R:
IR
HR
AR
LR
DM
Decrements the value of a 4-digit BCD word by 1, without affecting carry (CY).
Wd:
IR
HR
AR
LR
DM
Sets the Carry Flag (i.e., turns CY ON).
None
STC(40)
CLEAR CARRY
(@)CLC(41)
Clears the Carry Flag (i.e, turns CY OFF). None
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
Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
286
Programming Instructions
Name
Mnemonic
DISPLAY MESSAGE
(@)MSG(46)
LONG MESSAGE
(@)LMSG(47)
TERMINAL MODE
(@)TERM(48)
SET SYSTEM
(@)SYS(49)
Symbol
MSG(46)
FM
LMSG(47)
S
D
---
TERM(48)
---
---
---
SYS(49)
---
P
---
Appendix B
Function Operand Data Areas
Displays eight words of ASCII code, starting from FM, on the Programming Console or GPC. All eight words must be in the same data area.
FM A B
C D
FM:
IR
HR
AR
LR
TC
DM
#
FM+ 7
D P
ABCD........DP
Outputs a 32-character message to either a Programming Console, or a device connected via the RS-232C interface. The output message must be in ASCII beginning at address S. The destination of the message is designated in D: 000 specifies that the message is to be output to the
GPC; 001 specifies the RS-232C interface, starting with the leftmost byte; and
002 specifies the RS-232C interface, starting from the rightmost byte.
When the execution condition is ON, the
Programming Console operation mode is changed to TERMINAL mode. There is no program command available to change the mode back to CONSOLE mode. Pressing the CHNG Key on the Programming Console manually toggles between the two modes.
SYS(49) must be programmed at program address 00001 with LD AR 1001 at program address 00000.
The leftmost 8 bits of P must contain A3.
The status of bits 00, 01, 06, and 07 are used to control the 4 operating parameters described below.
If bit 00 of P is ON, the battery check will be excluded from system error checks.
If bit 01 of P is ON, the PC will enter MONI-
TOR mode at startup, unless a Programming Console connected to the CPU is not set to MONITOR.
If bit 06 of P is ON, the Force Status Hold
Bit (SR 25211) will be effective at startup.
If bit 07 of P is ON, the I/O Status Hold Bit
(SR 25212) will be effective at startup.
S:
IR
HR
AR
LR
TC
DM
None
P:
#
D:
#000
#001
#002
---:
Not used.
---:
Not used.
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
Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
287
Programming Instructions
Name
Mnemonic
BINARY ADD
(@)ADB(50)
Symbol
ADB(50)
Au
Ad
R
BINARY SUBTRACT
(@)SBB(51)
SBB(51)
Mi
Su
R
Appendix B
Function Operand Data Areas
Adds the 4-digit augend (Au), 4-digit addend (Ad), and content of CY and outputs the result to the specified result word (R).
+
Au
A d
+ CY
Au/Ad:
IR
SR
HR
AR
LR
TC
DM
#
R:
IR
HR
AR
LR
DM
R
CY
Subtracts the 4-digit hexadecimal subtrahend (Su) and content of carry, from the
4-digit hexadecimal minuend (Mi), and outputs the result to the specified result word
(R).
–
Mi
Su
Mi/Su:
IR
SR
HR
AR
LR
TC
DM
#
– CY
R:
IR
HR
AR
LR
DM
R
CY
BINARY MULTIPLY
(@)MLB(52)
MLB(52)
Md
Mr
R
Multiplies the 4-digit hexadecimal multiplicand (Md) and 4-digit multiplier (Mr), and outputs the 8-digit hexadecimal result to the specified result words (R and R+1). R and R+1 must be in the same data area.
X
Md
Mr
Md/Mr:
IR
SR
HR
AR
LR
TC
DM
#
R:
IR
HR
AR
LR
DM
Quotient R
Remainder
R+1
BINARY DIVIDE
(@)DVB(53)
DVB(53)
Dd
Dr
R
Divides the 4-digit hexadecimal dividend
(Dd) by the 4-digit divisor (Dr), and outputs result to the designated result words ( R and R + 1). R and R + 1 must be in the same data area.
÷
D d
Dr
Dd/Dr:
IR
SR
HR
AR
LR
TC
DM
#
R:
IR
HR
AR
LR
Quotient R
Remainde r 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
Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
288
Programming Instructions
Name
Mnemonic
DOUBLE BCD ADD
(@)ADDL(54)
Symbol
ADDL(54)
Au
Ad
R
DOUBLE BCD
SUBTRACT
(@)SUBL(55)
DOUBLE BCD
MULTIPLY
(@)MULL(56)
SUBL(55)
Mi
Su
R
MULL(56)
Md
Mr
R
Appendix B
Function Operand Data Areas
Adds two 8-digit values (2 words each) and the content of CY, and outputs the result to the specified result words. All words for any one operand must be in the same data area.
Au+ 1 Au
Au/Ad:
IR
SR
HR
AR
LR
TC
DM
R:
IR
HR
AR
LR
DM
+ Ad+ 1 Ad
+ CY
CY R+ 1 R
Subtracts both the 8-digit BCD subtrahend and the content of CY from an 8-digit BCD minuend, and outputs the result to the specified result words. All words for any one operand must be in the same data area.
Mi + 1 Mi
Mi/Su:
IR
SR
HR
AR
LR
TC
DM
R:
IR
HR
AR
LR
DM
– Su + 1 Su
– CY
CY R + 1 R
Multiplies the 8-digit BCD multiplicand and
8-digit BCD multiplier, and outputs the result to the specified result words. All words for any one operand must be in the same data area.
Md/Mr:
IR
SR
HR
AR
LR
TC
DM
Md+ 1 Md
R:
IR
HR
AR
LR
DM
X Mr+ 1 Md
R + 3 R + 2 R + 1 R
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
Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
289
Programming Instructions
Name
Mnemonic
DOUBLE BCD DIVIDE
(@)DIVL(57)
DOUBLE
BCD-TO-DOUBLE
BINARY (@)BINL(58)
DOUBLE
BINARY-TO-DOUBLE
BCD
(@)BCDL(59)
Symbol
DIVL(57)
Dd
Dr
R
BINL(58)
S
R
BCDL(59)
S
R
Appendix B
Function Operand Data Areas
Divides the 8-digit BCD dividend by an
8-digit BCD divisor, and outputs the result to the specified result words. All words for any one operand must be in the same data area.
Dd/Dr:
IR
SR
HR
AR
LR
TC
DM
Dd + 1 Dd
÷
Dr + 1 Dr
R:
IR
HR
AR
LR
DM
Quotient
Remainder
R + 1 R
R + 3 R + 2
Converts the BCD value of the two source words (S: starting word) into binary and outputs the converted data to the two result words (R: starting word). All words for any one operand must be in the same data area.
S:
IR
SR
HR
AR
LR
TC
DM
S R
R:
IR
HR
AR
LR
DM
S + 1 R + 1
Converts the binary value of the two source words (S: starting word) into eight digits of BCD data, and outputs the converted data to the two result words (R: starting result word). Both words for any one operand must be in the same data area.
S:
IR
SR
HR
AR
LR
DM
R:
IR
HR
AR
LR
DM
DOUBLE COMPARE
CMPL(60)
CMPL(60)
S
1
S
2
S
S + 1
R
R + 1
Compares the 8-digit hexadecimal values in words S
S
2
1
+1 and S
+1 and S
2
1
with the values in
, and indicates the result using the Greater Than, Less Than, and
Equal Flags in the AR area. S
1
+1 are regarded as the most
+1 and
S
2 significant data in each pair of words.
S
1
IR
,S
2
:
SR
HR
AR
LR
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
Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
290
Programming Instructions
Name
Mnemonic
GROUP-2 HIGH-DENSI-
TY I/O REFRESH
MPRF(61)
Symbol
MPRF(61)
St
E
COLUMN-TO-WORD
(@)CTW(63)
CTW(63)
S
C
D
Appendix B
Function Operand Data Areas
Refreshes I/O words allocated to Group-2
High-density I/O Units with I/O numbers St through E.This will be in addition to the normal I/O refresh performed during the
CPU’s cycle.
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. Normally these words are refreshed only once per cycle, but refreshing words before use in an instruction can increase execution speed.
St must be less than or equal to E.
Fetches data from the same numbered bit
(C) in 16 consecutive words (where S is the address of the first source word), and creates a 4-digit word by consecutively placing the data in the bits of the destination word, D.
The bit from word S is placed into bit 00 of
D, the bit from word S+1 is placed into bit
01, etc.
St/E:
# (0000 to 0009)
S:
IR
SR
HR
AR
LR
TC
DM
C:
IR
SR
HR
AR
LR
TC
DM
#
D:
IR
SR
HR
AR
LR
TC
DM
S
S+1
Bit C
0
1
D
0
1
00
01
WORD-TO-COLUMN
(@)WTC(64)
WTC(64)
S
D
C
S+15 0 0 15
Places bit data from the source word (S), consecutively into the same numbered bits of the 16 consecutive destination words (where D is the address of the first destination word).
Bit 00 from word S is placed into bit C of word D, bit 01 from word S is placed into bit C of word D+1, etc.
S:
IR
SR
HR
AR
LR
TC
DM
S
00
01
1
1
Bit C
1
1
D
D+1
D:
IR
SR
HR
AR
LR
TC
DM
C:
IR
SR
HR
AR
LR
TC
DM
#
15
0 0
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
Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
291
Programming Instructions
Name
Mnemonic
HOURS-TO-SECONDS
(@)HTS(65)
Symbol
HTS(65)
S
R
---
SECONDS-TO-HOURS
(@)STH(66)
STH(66)
S
R
---
BIT COUNTER
(@)BCNT(67)
BCNT(67)
N
SB
R
BLOCK COMPARE
(@)BCMP(68)
BCMP(68)
S
CB
R
Appendix B
Function Operand Data Areas
Converts a time given in hours/minutes/ seconds (S and S+1) to an equivalent time in seconds only (R and R+1). S and S+1 must be BCD and within one data area. R and R+1 must also be within one data area.
Converts a time given in seconds (S and
S+1) to an equivalent time in hours/minutes/seconds (R and R+1). S and S+1 must be BCD between 0 and 35,999,999, and within the same data area. R and R+1 must also be within one data area.
Counts the number of ON bits in one or more words (SB is the beginning source word) and outputs the result to the specified result word (R). N gives the number of words to be counted. All words in which bit are to be counted must be in the same data area.
Compares a 1-word binary value (S) with the 16 ranges given in the comparison table (CB is the starting word of the comparison block). If the value falls within any of the ranges, the corresponding bits in the result word (R) will be set. The comparison block must be within one data area.
S:
IR
SR
HR
AR
LR
TC
DM
#
N:
IR
SR
HR
AR
LR
TC
DM
S:
IR
SR
HR
AR
LR
TC
DM
S:
IR
SR
HR
AR
LR
TC
DM
S
Lower limit Upper limit
CB CB+1 1
CB+2 CB+3
CB+4 CB+5
0
1
Result
---:
Not used.
---:
Not used.
CB:
IR
SR
HR
LR
TC
DM
SB:
IR
SR
HR
AR
LR
TC
DM
R:
IR
HR
AR
LR
TC
DM
R:
IR
SR
HR
AR
LR
TC
DM
R:
IR
SR
HR
AR
LR
TC
DM
R:
IR
HR
AR
LR
TC
DM
CB+30 CB+31
Lower limit
≤
S
≤
Upper limit
0
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
Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
292
Programming Instructions
Name
Mnemonic
VALUE CALCULATE
(@)VCAL(69)
Symbol
VCAL(69)
C
S
D
Appendix B
Function Operand Data Areas
Calculates the cosine, or sine of the given degree value, or determines the y-coordinate of the given x value in a previously established line graph. For the sine and cosine conversions, S is entered in BCD as an angle (in the range 0.0 to 90.0 degrees).
When calculating the y-coordinate in a graph, S gives the address of the value of the x-coordinate. The calculated data is transferred to the destination word (D).
Sine and cosine results are given in BCD.
Line graph coordinate calculations (interpolation) can be in BCD or BIN.
The data in the control word (C) determines which operation is performed. If C is entered as a constant with a value of 0000 or 0001, the sine or cosine, respectively, of the source data value is calculated. If C is entered as a word designation, it gives the address of the first word of the data table for the line graph. The value of the first two digits gives m–1, where m is the number of data points for which coordinates are given on the line graph. Bits 14 and 15, respectively, specify the output and input data formats (0 indicates BCD, 1 indicates binary).
C:
IR
SR
HR
AR
LR
TC
DM
#
Y
Y m
Y
4
Y
3
Y
1
Y
2
Y
0
X
1
X
2
Input data format
Output data format
X
3
X
4
X m m–1, where m is the number of data points whose coordinates are specified in the table
X
S:
IR
SR
HR
AR
LR
TC
DM
D:
IR
SR
HR
AR
LR
TC
DM
14 08 07
C
15
C+1
000000
X m
(max. x-coordinate for this table)
C+2
Y
0
C+3
X
1
C+4
Y
1
C+5
X
2
C+6
Y
2
00
C+(2m+1)
X m
C+(2m+2)
Y m
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
Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
293
Programming Instructions
Name
Mnemonic
BLOCK TRANSFER
(@)XFER(70)
BLOCK SET
(@)BSET(71)
SQUARE ROOT
(@)ROOT(72)
DATA EXCHANGE
(@)XCHG(73)
Symbol
XFER(70)
N
S
D
BSET(71)
S
St
E
ROOT(72)
Sq
R
XCHG(73)
E1
E2
Appendix B
Function Operand Data Areas
Moves the content of several consecutive source words (S gives the address of the starting source word) to consecutive destination words (D is the starting destination word). All source words must be in the same data area, as must all destination words. Transfers can be within one data area or between two data areas, but the source and destination words must not overlap.
N:
IR
SR
HR
AR
LR
TC
DM
#
S :
IR
HR
AR
LR
TC
DM
D:
IR
SR
HR
AR
LR
TC
DM
#
S
S + 1
D
D + 1
No. of
Words
S+N–1 D+N–1
Copies the content of one word or constant
(S) to several consecutive words (from the starting word, St, through to the ending word, E). St and E must be in the same data area.
S
St
St/E:
IR
HR
AR
LR
TC
DM
S:
IR
SR
HR
AR
LR
TC
DM
#
E
Computes the square root of an 8-digit
BCD value (Sq and Sq + 1) and outputs the truncated 4-digit, integer result to the specified result word (R). Sq and Sq + 1 must be in the same data area.
Sq+1 Sq
Sq:
IR
SR
HR
AR
LR
TC
DM
R:
IR
HR
AR
LR
DM
R
Exchanges the contents of two words (E1 and E2).
E1 E2
E1/E2:
IR
HR
AR
LR
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
Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
294
Programming Instructions
Name
Mnemonic
ONE DIGIT SHIFT LEFT
(@)SLD(74)
Symbol
SLD(74)
St
E
Appendix B
Function Operand Data Areas
Shifts all data, between the starting word
(St) and ending word (E), one digit (four bits) to the left, writing zero into the rightmost digit of the starting word. St and E must be in the same data area.
St/E:
IR
HR
AR
LR
DM
St 0
St + 1
ONE DIGIT SHIFT
RIGHT
(@)SRD(75)
4-TO-16 DECODER
(@)MLPX(76)
16-TO-4 ENCODER
(@)DMPX(77)
SRD(75)
E
St
MLPX(76)
S
Di
R
DMPX(77)
S
R
Di
E
Shifts all data, between starting word (St) and ending word (E), one digit (four bits) to the right, writing zero into the leftmost digit of the ending word. St and E must be in the same data area.
St/E:
IR
HR
AR
LR
DM
E
E – 1
0 St
Converts up to four hexadecimal digits in the source word (S), into decimal values from 0 to 15, and turns ON the corresponding bit(s) in the result word(s) (R). There is one result word for each converted digit.
Digits to be converted are designated by
Di. (The rightmost digit specifies the first digit. The next digit to the left gives the number of digits to be converted minus 1.
The two leftmost digits are not used.)
S:
IR
SR
HR
AR
LR
TC
DM
S 0 to F
Di:
IR
HR
AR
LR
TC
DM
#
R:
IR
HR
AR
LR
DM
R
Determines the position of the leftmost ON bit in the source word(s) (starting word: S) and turns ON the corresponding bit(s) in the specified digit of the result word (R).
One digit is used for each source word.
Digits to receive the converted values are designated by Di. (The rightmost digit specifies the first digit. The next digit to left gives the number of words to be converted minus 1. The two leftmost digits are not used.)
15 00
S
S:
IR
SR
HR
AR
LR
TC
DM
R:
IR
HR
AR
LR
DM
Di:
IR
HR
AR
LR
TC
DM
#
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
Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
295
Programming Instructions
Name
Mnemonic
7-SEGMENT DECODER
(@)SDEC(78)
FLOATING POINT
DIVIDE
(@)FDIV(79)
SINGLE WORD
DISTRIBUTE
(@)DIST(80)
Symbol
SDEC(78)
S
Di
D
FDIV(79)
Dd
Dr
R
DIST(80)
S
DBs
Of
Appendix B
Function
Converts hexadecimal values from the source word (S) into 7-segment display data. Results are placed in consecutive half-words, starting at the first destination word (D). Di gives digit and destination details. (The rightmost digit gives the first digit to be converted. The next digit to the left gives the number of digits to be converted minus 1. If the next digit is 1, the first converted data is transferred to left half of the first destination word. If it is 0, the transfer is to the right half).
S:
IR
SR
HR
AR
LR
TC
DM
S
Operand Data Areas
Di:
IR
HR
AR
LR
TC
DM
#
D:
IR
HR
AR
LR
DM
D
0 to F
Divides one floating point value by another and outputs a floating point result. The rightmost seven digits of each set of two words (eight digits) are used for mantissa, and the leftmost digit is used for the exponent and its sign (Bits 12 to 14 give the exponent value, 0 to 7. If bit 15 is 0, the exponent is positive; if it’s 1, the exponent is negative).
Dd/Dr:
IR
SR
HR
AR
LR
TC
DM
R:
IR
HR
AR
LR
DM
Dd + 1 Dd
÷
Dr + 1 Dr
R + 1 R
Moves one word of source data (S) to the destination word whose address is given by the destination base word (DBs) plus offset (Of).
S
Base (DBs)
+
Offset (OF)
S:
IR
SR
HR
AR
LR
TC
DM
#
(S) (DBs + Of)
DBs:
IR
HR
AR
LR
TC
DM
Of:
IR
HR
AR
LR
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
Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
296
Programming Instructions
Name
Mnemonic
DATA COLLECT
(@)COLL(81)
MOVE BIT
(@)MOVB(82)
MOVE DIGIT
(@)MOVD(83)
Symbol
COLL(81)
SBs
Of
D
MOVB(82)
S
Bi
D
MOVD(83)
S
Di
D
Appendix B
Function
Extracts data from the source word and writes it to the destination word (D). The source word is determined by adding the offset (Of) to the address of the source base word (SBs).
SBs:
IR
SR
HR
AR
LR
TC
DM
Base (DBs)
+
Offset (OF)
(SBs+Of) (D)
Transfers the designated bit of the source word or constant (S) to the designated bit of the destination word (D). The rightmost two digits of the bit designator (Bi) specify the source bit. The two leftmost digits specify the destination bit.
S:
IR
SR
HR
AR
LR
DM
#
S
Operand Data Areas
Of:
IR
HR
AR
LR
TC
DM
#
D:
IR
HR
AR
LR
TC
DM
Bi:
IR
HR
AR
LR
TC
DM
#
D:
IR
HR
AR
LR
DM
D
Moves hexadecimal content of up to four specified 4-bit source digit(s) from the source word to the specified destination digit(s) (S gives the source word address.
D specifies the destination word). Specific digits within the source and destination words are defined by the Digit Designator
(Di) digits. (The rightmost digit gives the first source digit. The next digit to the left gives the number of digits to be moved.
The next digit specifies the first digit in the destination word.)
S:
IR
SR
HR
AR
LR
TC
DM
#
S
15 00
Di:
IR
HR
AR
LR
TC
DM
#
D:
IR
SR
HR
AR
LR
TC
DM
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
Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
297
Programming Instructions
Name
Mnemonic
REVERSIBLE SHIFT
REGISTER
(@)SFTR(84)
Symbol
SFTR(84)
C
St
E
TABLE COMPARE
(@)TCMP(85)
TCMP(85)
CD
TB
R
Appendix B
Function Operand Data Areas
Shifts bits in the specified word or series of words either left or right. Starting (St) and ending words (E) must be specified. Control word (C) contains shift direction, reset input, and data input. (Bit 12: 0 = shift right,
1 = shift left. Bit 13 is the value shifted into the source data, with the bit at the opposite end being moved to CY. Bit 14: 1 = shift enabled, 0 = shift disabled. If bit 15 is ON when SFTR(89) is executed with an ON condition, the entire shift register and CY will be set to zero.) St and E must be in the same data area and St must be less than or equal to E.
15 14 13 12 11 00
C
Not used
St/E/C:
IR
HR
AR
TC
LR
DM
1
5
0
0
1
5
0
0
E St
IN
CY
1
5
E
0
0
1
5
St
0
0
IN
CY
Compares a 4-digit hexadecimal value
(CD) with values in table consisting of 16 words (TB: is the first word of the comparison table). If the value of CD falls within any of the comparison ranges, corresponding bits in result word (R) are set (1 for agreement, and 0 for disagreement).
The table must be entirely within the one data area.
R
CD Tb 0
Tb+1 1
0
CD:
IR
SR
HR
AR
LR
TC
DM
#
TB/R:
IR
HR
AR
LR
TC
DM
Tb+13
Tb+14
Tb+15
1
0
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
Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
298
Programming Instructions
Name
Mnemonic
ASCII CONVERT
(@)ASC(86)
Symbol
ASC(86)
S
Di
D
Appendix B
Function Operand Data Areas
Converts hexadecimal digits from the source word (S) into 8-bit ASCII values, starting at leftmost or rightmost half of the starting destination word (D). The rightmost digit of Di designates the first source digit. The next digit to the left gives the number of digits to be converted. The next digit specifies the whether the data is to be transferred to the rightmost (0) or leftmost
(1) half of the first destination word. The leftmost digit specifies parity:
0: none,
1: even, or
2: odd.
S:
IR
SR
HR
AR
LR
TC
DM
Di:
IR
HR
LR
TC
DM
#
D:
IR
HR
LR
DM
S 0 to F
D
15 08 07 00
8-bit data
INTERRUPT CONTROL
(@)INT(89)
INT(89)
CC
N
D
Controls programmed (scheduled) interrupts and interrupts from Interrupt Input
Units. Each PC can have up to 4 IIUs. N defines the source of the interrupt: 000 to 003 designate the no. of the IIU; 004 designates a scheduled interrupt. In IIUs, bits 00 to 07 identify the interrupting subroutine, higher bits are not used. Bit 00 of Unit 0 corresponds to interrupt subroutine 00, through to bit 07 of Unit 3 which corresponds to subroutine 31. CC is the control code, the meaning of which depends on the value of N, as follows:
CC:
000 to
002
N:
000 to
004
D:
IR
HR
AR
LR
TC
DM
#
CC
000
N = 000 to 003 N = 004
Masks and unmasks interrupt bits for the designated Unit
(N) according to the data in D.
Bits corresponding to ON bits in D are masked, those corresponding to OFF bits are unmasked. Masked bits are recorded and will be executed when they are unmasked (unless previously cleared).
The interrupt time interval is set according to the data in D
(00.01 to 99.99 s)
The decimal point is not entered. The interrupt is cancelled if
D is 00.00.
001 Clears the masked interrupt bits of the designated Unit (N) according to the corresponding ON bits in D. The subroutines corresponding to bits cleared in this manner will not be executed when the bit is unmasked.
The time to the first interrupt is set according to the data in
D (00.01 to 99.99 s)
The decimal point is not entered. The interrupt is cancelled if
D is 00.00.
002 Copies the mask status of the designated IIU to D.
Copies the time interval 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
Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
299
Programming Instructions
Name
Mnemonic
NETWORK SEND
(@)SEND(90)
(CPU31-E)
Symbol
SEND(90)
S
D
C
Appendix B
Function
Transfers data from n source words (S is the starting word) to the destination words
(D is the first address) in node N of the specified network (in a SYSMAC LINK or NET
Link System). The format of the control words varies depending on the type of system. In both types of systems, the first control word (C) gives the number of words to be transferred.
For NET Link Systems, in word C+1, bit 14 specifies the system (0 for system 1, and
1 for system 0), and the rightmost 7 bits define the network number. The left half of word C+2 specifies the destination port
(00: NSB, 01/02: NSU), and the right half specifies the destination node number. If the destination node number is set to 0, data is transmitted to all nodes.
For SYSMAC LINK Systems, the right half of C+1 specifies the response monitoring time (default 00: 2 s, FF: monitoring disabled), the next digit to the left gives the maximum number of re-transmissions (0 to 15) that the PC will attempt if no response signal is received. Bit 13 specifies whether a response is needed (0) or not
(1), and bit 14 specifies the system number
(0 for system 1, and 1 for system 0). The right half of C+2 gives the destination node number. If this is set to 0, the data will be sent to all nodes.
S:
IR
SR
HR
AR
LR
TC
DM
C
SYSMAC NET n: no. of words to be transmitted (0 to 1000)
C+1
C+2
0X00 0000
Destination port no.
Network no. (0 to 127)
Destination node no.
(0 to 126)
Operand Data Areas
D/C:
IR
HR
AR
LR
TC
DM
SYSMAC LINK
C
C+1 n: no. of words to be transmitted, 0 to 1000
0XX0 Re-transmissions
Response monitor time
(0.1 to 25.4 s)
C+2 0000
0000
Destination node no.
(0 to 62)
Source N
S
S+1
Destination node N
D
D+1
S+n–1 D+n–1
SUBROUTINE ENTRY
(@)SBS(91)
SBS(91) N
Calls subroutine N. Moves program operation to the specified subroutine.
N:
00 to 99
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
Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
300
Programming Instructions
Name
Mnemonic
SUBROUTINE DEFINE
SBN(92)
SUBROUTINE RETURN
RET(93)
Appendix B
Symbol
SBN(92) N
Function
Marks the start of subroutine N.
RET(93)
Operand Data Areas
N:
00 to 99
Marks the end of a subroutine and returns control to the main program.
None
WATCHDOG TIMER
REFRESH
(@)WDT(94)
I/O REFRESH
(@)IORF(97)
WDT(94) T
IORF(97)
St
E
Sets the maximum and minimum limits for the watchdog timer (normally 0 to 130 ms).
New limits:
Maximum time = 130 + (100 x T)
Minimum time = 130 + (100 x (T–1))
T:
0 to 63
Can refresh I/O words allocated to CPU or
Expansion I/O Racks and Special I/O
Units. Normally these words are refreshed only once per cycle, but refreshing words before use in an instruction can increase execution speed.
To refresh I/O words allocated to CPU or
Expansion I/O Racks (IR 000 to IR 030), indicate the first (St) and last (E) I/O words to be refreshed. All words between St and
E will be refreshed when IORF(97) is executed.
To refresh I/O words allocated to Special
I/O Units (IR 100 to IR 199), indicate the first (St) and last (E) unit numbers of the units. IR 040 to IR 049 correspond to Special I/O Units 0 to 9.
St must be less than or equal to E.
St/E:
IR
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
Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
301
Programming Instructions
Name
Mnemonic
NETWORK RECEIVE
(@)RECV(98)
(CPU31-E)
Symbol
RECV(98)
S
D
C
Appendix B
Function
Transfers data from the source words (S is the first word) from node N of the specified network (in a SYSMAC LINK or NET Link
System) to the destination words starting at D. The format of the control words varies depending on the type of system. In both types of systems, the first control word (C) gives the number of words to be transferred.
For NET Link Systems, in the second word
(C+1), bit 14 specifies the system (0 for system 1, and 1 for system 0), and the rightmost 7 bits define the network number. The left half of word C+2 specifies the source port (00: NSB, 01/02: NSU), and the right half specifies the source node number.
For SYSMAC LINK Systems, the right half of C+1 specifies the response monitoring time (default 00: 2 s, FF: monitoring disabled), the next digit to the left gives the maximum number of re-transmissions (0 to 15) that the PC will attempt if no response signal is received. Bit 13 specifies whether a response is needed (0) or not
(1), and bit 14 specifies the system number (0 for system 1, and 1 for system 0).
The right half of C+2 gives the source node number.
S:
IR
SR
HR
AR
LR
TC
DM
C
SYSMAC NET n: no. of words to be transmitted (0 to 1000)
C+1
C+2
0X00 0000
Source port no.
(NSB: 00, NSU: 01/02)
Network no. (0 to 127)
Source node no.
(0 to 126)
SYSMAC LINK
C
C+1
C+2 n: no. of words to be transmitted, 0 to 1000
0XX0
0000
Re-transmissions
Response monitor time
(0.1 to 25.4 s)
0000
Source node no.
(0 to 62)
Operand Data Areas
C/D:
IR
HR
AR
LR
TC
DM
Source node N
S
S+1
Destination node
D
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
Rd only: DM 1000 to DM 1999
0000 to 9999 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.
Name
Password Input
Buzzer ON/OFF
Data Clear
I/O Table Register
I/O Table Verify
I/O Table Read
NET Link Link Table
Transfer
I/O Table Delete
Address Designation
Program Input
Program Read
Function
Prompts the user for the access password.
Controls whether the buzzer will sound for keystroke inputs.
Used to erase data, either selectively or totally, from the Program Memory and the IR, AR, HR, DM, and TC areas.
Registers the I/O table after initial entry or subsequent amendments.
Checks the I/O Table against the actual arrangement of I/O Units.
Displays the Unit type, location, allocated I/O word, and word multiplier
(where applicable).
Transfers a copy of the NET Link System’s Link Table to the user memory
(UM) area.
Deletes the entire I/O Table.
Displays the specified address.
Used to edit or input program instructions.
Allows the user to scroll through the program address-by-address. In
RUN and MONITOR modes, status of bits is also given.
Searches a program for the specified data address or instruction.
60
61
61
61
64
66
69
68
71
72
71
Program Search
Instruction Insert
Instruction Delete
Program Check
Error Message Read
Bit/Word Monitor
Allows a new instruction to be inserted before the displayed instruction, or deletes the displayed instruction (respectively).
Checks the completed program for syntax errors (up to three levels in
H-type PCs).
Displays error messages in sequence, starting with the most severe messages.
Displays the specified address whose operand is to be monitored. In RUN or MONTR mode it will show the status of the operand for any bit or word in any data area.
78
79
75
64
230
3-word Monitor
Forced Set/Reset
Clear Forced Set/Reset
Hex/BCD Data Change
Binary Data Change
SV Change/SV Reset
3-word Change
Cycle Time Display
Hex-ASCII Display
Change
Binary Monitor
Program Memory Save
Simultaneously monitors three consecutive words.
238
Set: Used to turn ON bits or timers, or to increment counters currently displayed on the left of the screen.
Reset: Used to turn OFF bits, or to reset timers or counters.
233
Simultaneously clears all forced bits within the currently displayed word.
235
236 Used to change the value of the leftmost BCD or hexadecimal word displayed during a Bit/Word Monitor operation.
Changes the value of 16-bit words bit-by-bit. Bits can be changed temporarily or permanently to the desired status.
Alters the SV of a timer or counter either by incrementing or decrementing the value, or by overwriting the original value with a new one.
Used to change the value of a word displayed during a 3-word Monitor operation.
Measures the duration of the current cycle. Cycle times will vary according to the execution conditions which exist in each cycle.
Converts 4-digit hexadecimal data in the DM area to ASCII and vice-versa.
Displays the monitored area in binary format.
Saves Program Memory to tape.
Program Memory Restore Reads Program Memory from tape.
241
243
239
77
237
240
246
249
Reference
303
Programming Console Operations
Name
Program Memory Compare
DM Data Save, Restore,
Compare
Function
Compares Program Memory data on tape with that in the Program
Memory area.
The save, restore, and compare tape operations for DM area data.
Appendix C
249
Reference
250
System Operations
Operation/Description
Password Input
Controls access to the PC’s programming functions. To gain access to the system once “PASS-
WORD” has been displayed, press CLR, MONTR, and then
CLR.
Buzzer ON/OFF
The buzzer can be switched to operate whenever Programming
Console keys are pressed (as well as for the normal error indication). BZ is displayed in the upper 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
Unless otherwise specified, this operation will clear all erasable memory in Program Memory and
IR, HR, AR, DM, and TC areas.
To clear EPROM memory the write enable switch must be ON
(i.e., enabled). The branch lines shown are used only when performing a partial memory clear, with each of the memory areas entered being retained. Specifying an address will result in the
Program Memory after and including that address being deleted. All memory up to that address will be retained.
I/O Table Register
Whenever I/O Unit changes are 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
Used to check that the registered
I/O Table matches the actual arrangement of I/O Units. Pressing
VER displays the next inconsistency.
Modes*
R M P
R M P
P
P
R P M
CLR
SHIFT
CLR
CLR
CLR
MONTR
B
1
PLAY
SET
FUN
FUN
CLR
NOT
SHIFT
SHIFT
CH
*
CH
*
Key sequence
REC
RESET
CHG
VER
*Modes in which the given instruction is applicable: R = RUN, M = MONITOR, P = PROGRAM
All Clear
[Address]
9
HR
CNT
DM
7
VER
B
1
MONTR
Partial
Clear
Retained if pressed
D
3
WRITE
304
Programming Console Operations
Operation/Description
I/O Table Read
Used to read the I/O Table. The display gives the Unit type, location, I/O word allocation, and word multiplier (where applicable). Rack and unit numbers will vary according to the system in use. The EXT key can be pressed to allow Remote I/O
Slave Racks and Optical I/O
Units to be selected. If shift is pressed before the arrow key, the
Rack and unit numbers need not be specified.
(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 host computer.)
NET Link Table Transfer
Copies the Data Link Table to program memory, either RAM or
EPROM. This allows the user program and the Data Link Table to be written to EPROM together
(for the CPU31-E only). When power is applied to a PC with
Data Link Tables stored in program memory, the table will automatically overwrite the CPU Data
Link Table. Changes made to the table do not affect the copy in program memory. To update the copy in program memory, the transfer operation must be repeated. Transfer will not work if: a) the memory is not RAM or
EPROM, or if the memory is write-protected. b) there is no
END(01) instruction. c) the contents of the program memory exceeds 2.3K for a 4K word memory, or 6.4K for an 8K word memory.
I/O Table Delete
Clears the entire I/O table. The cursor should be at the program address of the table.
Modes*
R P M
P
P
CLR
CLR
CLR
All PCs
FUN SHIFT
CH
*
Key sequence
To select Remote I/O Slave
Racks or Optical I/O Units
C200H
C1000H/C2000H
C200H
MONTR
FUN
FUN
SHIFT
SHIFT
[Rack no.]
CH
*
SHIFT
SHIFT
EXT
CHG
[Unit no.] MONTR
NOT
Appendix C
WRITE
WRITE
*Modes in which the given instruction is applicable: R = RUN, M = MONITOR, P = PROGRAM
305
Programming Console Operations Appendix C
Programming Operations
Operation/Description
Address Designation
Displays the specified address.
Can be used to start programming from a non-zero address or to access an address for editing.
Leading zeros need not be entered. The contents of the address 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
Used to enter or edit program instructions. This operation overwrites the contents of the memory at the displayed address. Once at the desired address, enter the new instruction word and then press WRITE
(preceded by NOT for differentiated instructions). Input the required operands, and press
WRITE after each.
Program Read
Allows the user to scroll through the program address-by-address. If the Program Memory is read in RUN or MONITOR mode, the ON/OFF status of each displayed bit is also shown.
Program Search
Allows the program to be searched for occurrences of any designated instruction or data area address. To designate a bit address, press SHIFT, CONT/#, and then input the address. Then press SRCH. Pressing SRCH again will find the next occurrence. For multi-word instructions, the up and down keys can be used to scroll through the words before continuing the search. In RUN or MONITOR mode, the ON/OFF status of each monitored bit will also be displayed. Applicable data areas vary according to the PC being used.
Modes*
R P M
P
R P M
R P M
CLR
Address displayed
Address currently displayed
CLR
CLR
[Address]
[Instruction word]
[Instruction]
SHIFT
CONT
#
Key sequence
SRCH
LR
HR
SHIFT HR
TIM
CNT
*Modes in which the given instruction is applicable: R = RUN, M = MONITOR, P = PROGRAM
SRCH
(AR)
[Operand]
Scroll through multi-word instructions
[Address]
SRCH SRCH
306
Programming Console Operations Appendix C
Operation/Description
Instruction Insert and
Instruction Delete
The displayed instruction can be deleted, or another instruction can be inserted before it. Care should be taken to avoid inadvertent deletions as there is no way of recovering the instructions other than to re-enter them. When an instruction is deleted all subsequent instruction addresses are automatically adjusted so that there are no empty addresses, or instructions without addresses.
Program Check
Once a program has been entered, it should be checked for errors. This program check can be used to search for three levels of syntax errors. Details of the errors covered by each level are given in the relevant manuals.
The address where the error was generated will also be displayed.
Modes*
P
At the desired position in program:
P
CLR SRCH
Insert
Delete
A
B
C
0
1
2
Key sequence
[Enter new instruction]
Instruction currently displayed
SRCH
Error Message Read
Displays error messages in sequence with most severe messages displayed first. Press monitor to access remaining messages. In PROGRAM mode, pressing MONTR clears the displayed message from memory and the next message is displayed.
R P M
CLR FUN MONTR MONTR
*Modes in which the given instruction is applicable: R = RUN, M = MONITOR, P = PROGRAM
CLR
(0, 1, 2: check levels)
INS
DEL
SRCH Press SRCH to find next error.
Cancel
307
Programming Console Operations
Monitoring and Data Changing Operations
Appendix C
Operation/Description
Bit/Word Monitor
Up to six memory addresses, containing either words or bits, or a combination of the two, can be monitored at once. Only three can be displayed at any one time.
If operated in RUN or MONITOR mode, the status of monitored bits will also be displayed.
The operation can be started from a cleared display by entering the address of the first word or bit to be monitored and pressing
MONTR, or from any address in the program by displaying the address of the bit or word to be monitored and pressing MONTR.
When a timer or counter is monitored, its PV will be displayed and a box is displayed in the bottom left hand corner if the Completion
Flag is ON.
Modes*
R P M
CLR SHIFT
CONT
#
LD
OUT
TIM
CNT
DM
3-word Monitor
Monitors three consecutive words simultaneously. Specify the lowest valued address of the three words, press MONTR, and then press EXT to display the data contents of the specified word and the two words that follow. Pressing CLR will change the three-word monitor operation into a single-word display.
Forced Set/Reset
If a bit, timer, or counter address is leftmost on the screen during a
Bit/Word Monitor operation, pressing PLAY/SET will turn ON the bit, start the timer, or increment the counter. Pressing REC/
RESET will turn OFF the bit, or reset the timer or counter. These force-sets and force-resets are effective while the key is held down.
Permanent sets and resets can be implemented by pressing
SHIFT first, the force operations will be effective until NOT is pressed, or until a Clear Forced
Set/Reset operation is performed. Timers will not operate in
PROGRAM mode. SR bits are not affected by this operation.
Clear Forced Set/Reset
Simultaneously clears all forced set and forced reset bits within the word currently displayed.
R P M
P M
P M
Bit/Word monitor in progress.
Currently monitored words appear on the left of the screen.
Bit/Word monitor in progress. Bit or Timer/Counter currently monitored appears on left of the screen.
CLR
PLAY
SET
REC
RESET
Key sequence
EXT
SHIFT
NOT
LR
HR
PLAY
SET
REC
RESET
SHIFT
SHIFT
HR
NOT
PLAY
SET
REC
RESET
[Address]
MONTR
Clears the leftmost address from the screen.
*Modes in which the given instruction is applicable: R = RUN, M = MONITOR, P = PROGRAM
CLR
Cancel
308
Programming Console Operations Appendix C
Operation/Description
Hex/BCD Data Change
Used to edit the leftmost BCD or hexadecimal value displayed during a Bit/Word Monitor operation. If a timer or counter is leftmost on the display, the PV will be the value displayed and affected by this operation. It can only be changed in MONITOR mode and only while the timer or counter is operating. SR words cannot be changed using this operation.
Modes*
P M
Bit/Word monitor in progress.
Currently monitored word appears on the left of the screen.
Key sequence
CHG
Binary Data Change
This operation is used to change the value of IR, HR, AR, LR, or
DM words bit-by-bit. The cursor can be moved left by using the up key, and right by using the down key. The position of the cursor is the bit that will be overwritten.
There are two types of changes on the C200H, temporary and permanent. Temporary changes result if 1 or 0 is entered. Permanent changes are made by pressing SHIFT and SET, or SHIFT and RESET. The former will result in an S being displayed in that bit position. Similarly, SHIFT and RESET will produce an R in the display.
During operation of the PC, the bits having 1 or 0 values will change according to the program conditions. Bits with S or R, however, will always be treated as a
1 or 0, respectively. NOT cancels
S and R settings and the bits will become 1 or 0, respectively.
P M
Binary monitor in progress. Word currently displayed.
CHG
SV Change,
SV Reset
There are two ways of modifying the SVs for timers and counters.
One method is to enter a new value.
The second is to increment or decrement the existing SV. In
MONITOR mode the SV can be changed while the program is being executed. Incrementing and decrementing can only be carried out if the SV has been entered as a constant.
P M
M
Timer/Counter currently displayed
CHG
*Modes in which the given instruction is applicable: R = RUN, M = MONITOR, P = PROGRAM
[New data]
EXT
SHIFT
SHIFT
B
A
1
0
NOT
WRITE
PLAY
SET
REC
RESET
[New SV]
WRITE
WRITE
WRITE
309
Programming Console Operations Appendix C
Operation/Description
3-word Change
This operation changes the value of a word displayed during a
3-word Monitor operation. The blinking cursor indicates the word that will be affected by the operation. The cursor can be moved by using the up and down keys.
When the cursor is at the desired location, press CHG. After entering the new data, pressing
WRITE causes the original data to be overwritten.
Cycle Time Display
This operation should be performed after all syntax errors have been corrected. The cycle time can only be checked in RUN or MONITOR mode and while the program is being executed. The cycle time displayed after pressing CLR and MONTR is that for the current cycle. Pressing
MONTR again will display a new cycle time. Any difference between successive cycle times is due to the different execution conditions that exist during each cycle.
Hex/ASCII Display Change
Converts 4-digit hexadecimal
DM data to ASCII and vice-versa.
Binary Monitor
The contents of a monitored word can be specified to be displayed in binary by pressing SHIFT and
MONTR after entering the word address. Words can be scrolled by pressing the up and down keys to increment and decrement the displayed address. To terminate the binary display, press
CLR.
Modes*
P M
R M
R P M
R P M
3-word Monitor in progress
CLR MONTR
Word currently displayed
TR
MONTR
Key sequence
CHG
[Data] WRITE
[Word address]
Binary monitor cancel
*Modes in which the given instruction is applicable: R = RUN, M = MONITOR, P = PROGRAM
All monitor cancel
310
Programming Console Operations Appendix C
Cassette Tape Operations
Operation/Description
Program Memory Save
Copies data from the Program
Memory to tape. The file no. specified in the instructions provides an identifying address for the information within the tape. Each file number should be used only once per tape. If only a part of the
Program Memory is to be stored, the appropriate start and stop addresses must be entered. Each
C60 tape can store approximately 16K words on each side of the tape. When the start address is entered, the maximum stop address is set as the default. Do not set a stop address greater than this one. If you wish to record past this address the additional information will need to be recorded either on the flip side of the tape or on a separate tape.
After starting the tape recorder, wait about 5 seconds before pressing SHIFT REC/RESET.
This is to allow the leader tape to pass before the data transmission starts.
Program Memory Restore
To read Program Memory data which has been recorded on a cassette tape, the keystrokes are as given here. The file number must be the same as the one entered when the data was recorded. The read operation will proceed from the specified start address up to the end of the tape, unless halted by a CLR command. The instruction must be completed before the required data is reached on the tape, i.e., usually before the leader tape finishes.
Modes*
P
P
CLR
CLR
WRITE
EXT
EXT
A
[Stop address]
A
0
0
Key sequence
[File no.]
Start recording with the tape recorder.
[File no.]
After about 5 seconds**
(Cancel with the CLR key).
Start tape recorder playback.
*Modes in which the given instruction is applicable: R = RUN, M = MONITOR, P = PROGRAM
WRITE
WRITE
[Start address]
SHIFT
[Start address]
SHIFT
Within about 5 seconds**
REC
RESET
PLAY
SET
**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.
311
Programming Console Operations Appendix C
Operation/Description
Program Memory Compare
The procedure to compare Program Memory data stored on a tape with that in the PC’s Program Memory area is the same as that for reading it (see above), except that after starting the tape playback, VER should be pressed instead of SHIFT and
PLAY/SET.
DM Data Save, Restore, Compare
The procedures for transferring
DM area data to and from tape, and for comparing it, are basically the same as for the Program
Memory, given above. The exceptions are that start and stop addresses are not required, and the DM area is specified instead of the Program Memory. Each operation will continue through to the end of the tape unless cancelled by pressing CLR.
Modes*
P
P
CLR EXT
A
0
Key sequence
[File no.]
WRITE
Start tape recorder playback.
[Start address]
VER
Within about 5 seconds**
CLR
B
1
EXT
[File no.]
5 second leader tape**
Start tape recorder recording.
Start tape recorder playback.
Saving
SHIFT
REC
RESET
Restoring
SHIFT
PLAY
SET
Comparing
VER
*Modes in which the given instruction is applicable: R = RUN, M = MONITOR, P = PROGRAM
**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.
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 compared 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.
25503 (ER) 25504 (CY)
Unaffected
25505 (GR)
Unaffected
25506 (EQ)
Unaffected
25507 (LE)
Unaffected
CMP(20)
MOV(21)
MVN(22)
BIN(23)
BCD(24)
ASL(25)
ASR(26)
ROL(27)
ROR(28)
COM(29)
ADD(30)
SUB(31)
MUL(32)
DIV(33)
ANDW(34)
ORW(35)
XORW(36)
XNRW(37)
INC(38)
DEC(39)
Instructions
TIM
CNT
END(01)
STEP(08)
SNXT(09)
CNTR(12)
TIMH(15)
WSFT(16)
RWS(17)
SCAN(18)
MCMP(19)
OFF
Unaffected
OFF
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
OFF
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
OFF
Unaffected
Unaffected
OFF
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
313
Error and Arithmetic Flag Operation Appendix D
SRD(75)
MLPX(76)
DMPX(77)
SDEC(78)
FDIV(79)
DIST(80)
COLL(81)
MOVB(82)
MOVD(83)
SFTR(84)
TCMP(85)
ASC(86)
INT(89)
SEND(90)
SBS(91)
BINL(58)
BCDL(59)
CMPL(60)
MPRF(61)
CTW(63)
WTC(64)
HTS(65)
STH(66)
BCNT(67)
BCMP(68)
VCAL(69)
XFER(70)
BSET(71)
ROOT(72)
XCHG(73)
SLD(74)
Instructions
STC(40)
CLC(41)
MSG(46)
LMSG(47)
TERM(48)
SYS(49)
ADB(50)
SBB(51)
MLB(52)
DVB(53)
ADDL(54)
SUBL(55)
MULL(56)
DIVL(57)
25503 (ER)
Unaffected
Unaffected
Unaffected
Unaffected
ON
25504 (CY)
OFF
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
25505 (GR)
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
25506 (EQ)
Unaffected
Unaffected
Unaffected
Unaffected
25507 (LE)
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
314
Error and Arithmetic Flag Operation Appendix D
Instructions
SBN(92)
RET(93)
WDT(94)
BPRG(96)
IORF(97)
RECV(98)
25503 (ER)
Unaffected
25504 (CY)
Unaffected
Unaffected
25505 (GR)
Unaffected
25506 (EQ)
Unaffected
Unaffected Unaffected
25507 (LE)
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
IR
Bits
00000 to 23515
SR
HR
AR
LR
23600 to 25507
HR 0000 to
HR 9915
AR 0000 to
AR 2715
LR 0000 to LR 6315 LR 00 to LR 63
DM Not accessible as bits.
TC
TR
Read/write:
DM 0000 to DM 0999
Read only:
DM 1000 to DM 1999
(TC 000 to TC 511) (TC 000 to TC 511)
(TR 0 to TR 7)
000 to 235
Words
236 to 255
HR 00 to HR 99
AR 00 to AR 27
Not accessible as words.
Notes
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.
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 bits are available for general data storage and manipulation. The HR area maintains bit status when PC power is turned off.
AR bits are mostly dedicated for specific purposes.
Unused AR bits may be used as works bits. See tables of dedicated bits following this table.
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 0000 through DM 0999 are generally used for data storage. DM 1000 through DM 1999 are read-only and used for Special I/O Units.
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.
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 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)
236
237
Bit(s) Function
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
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
252
00 to 15
00
Remote I/O Error Flags
SEND(90)/RECV(98) Error Flag for operating level 0 of SYSMAC LINK/SYSMAC NET Link
System
01
02
03
04
SEND(90)/RECV(98) Enable Flag for operating level 0 of SYSMAC LINK/SYSMAC NET Link
System
Operating Level 0 Data Link Operating Flag
SEND(90)/RECV(98) Error Flag for operating level 1 of SYSMAC LINK/SYSMAC NET Link
System
SEND(90)/RECV(98) Enable Flag for operating level 1 of SYSMAC LINK/SYSMAC NET Link
System
09
10
11
05
06
07
08
Operating Level 1 Data Link Operating Flag
Host Computer to Rack-mounting Host Link Unit Level 1 Error Flag
Rack-mounting Host Link Unit Level 1 Restart Bit
CPU-mounting Host Link Unit Error Flag
CPU-mounting Host Link Unit Restart Bit
Not used.
Forced Status Hold Bit
253
09
10
11
12
13
14
12
13
14
15
Data Retention Control Bit
Rack-mounting Host Link Unit Level 0 Restart Bit
Not used.
Output OFF Bit
00 to 07 FAL number output area.
08 Low Battery Flag (for batteries in RAM or EEPROM Memory Units, or the CPU31-E CPU)
15
Cycle Time Error Flag
I/O Verification Error Flag
Host Computer to rack-mounting Host Link Unit Level 0 Error Flag
Remote I/O Error Flag
Normally ON Flag
Normally OFF Flag
First cycle
318
Data Areas Appendix E
Word(s)
254
255
01
02
03
04
05
06
07
Bit(s)
00
01
1-minute clock pulse bit
0.02-second clock pulse bit
Function
02 to 06 Reserved for function expansion. Do not use.
07 Step Flag
08 to 13 Reserved for function expansion. Do not use.
14 Group-2 High-density I/O Unit Error Flag
15
00
Special Unit Error Flag (Special I/O, PC Link, Host Link, Remote I/O Master, SYSMAC NET
Link, and SYSMAC LINK)
0.1-second clock pulse bit
0.2-second clock pulse bit
1.0-second clock pulse bit
Instruction Execution Error (ER) Flag
Carry (CY) Flag
Greater Than (GR) Flag
Equals (EQ) Flag
Less Than (LE) Flag
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
AR 07
AR 07 to 15
AR 16, AR 17
AR 18 to AR 21
AR 07, AR 22
Use
Error History Area
SYSMAC LINK Units
SYSMAC LINK and SYSMAC NET Link Units
Calendar/Clock Area
TERMINAL Mode Key Bits
00
Word(s)
03
04
05
06
AR Bit Allocations
01
02
Bit(s) Function
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
12
13
14/15
Error Flag for operating level 0 of SYSMAC LINK or SYSMAC NET Link System
Host Computer to Rack-mounting Host Link Unit Level 1 Error Flag
Host Computer to Rack-mounting Host Link Unit Level 0 Error Flag
Remote I/O Master Unit 1/Unit 0 Error Flags
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
12, 13
Restart Bit for operating level 0 of SYSMAC LINK or SYSMAC NET Link System
Not used.
14/15 Remote I/O Master Unit 1/Unit 0 Restart Bits
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
00 to 15 Error Flags for Optical I/O Units 0 to 7
00 to 15 Error Flags for Optical I/O Units 8 to 15
00 to 15 Error Flags for Optical I/O Units 16 to 23
00 to 15 Error Flags for Optical I/O Units 24 to 31
319
Data Areas Appendix E
22
23
24
25
26
27
07
Word(s)
08 to 11
12 to 15
16
17
18 to 21
Bit(s) Function
00 to 03 Data Link setting for operating level 0 of SYSMAC LINK System
04 to 07 Data Link setting for operating level 1 of SYSMAC LINK System
08 TERMINAL Mode Input Cancel Bit
09 to 12 Not used.
13 to 15 Error History Area (13: Overwrite Bit, 14: Reset Bit, 15: Enable Bit)
00 to 15 Active Node Flags for SYSMAC LINK System nodes of operating level 0
00 to 15 Active Node Flags for SYSMAC LINK System nodes of operating level 1
00 to 15 SYSMAC LINK/SYSMAC NET Link System operating level 0 service time per cycle
00 to 15 SYSMAC LINK/SYSMAC NET Link System operating level 1 service time per cycle
00 to 15 Calendar/Clock Area
In the CPU31-E, the calendar/clock function is contained in the CPU. In the CPU21-E and
CPU23-E, the calendar/clock function is contained in the Memory Unit, and only the
C200H-MR433/MR833/ME432/ME832 Memory Units have the calendar/clock function.
00 to 15 TERMINAL Mode Key Bits
06
07
08
09
00 to 15 Power-OFF Counter
00 to 03 Not used.
04
05
CPU Unit Low Battery Flag (CPU31-E only)
Cycle Time Flag
SYSMAC LINK System Network Parameter Flag for operating level 1
SYSMAC LINK System Network Parameter Flag for operating level 0
SYSMAC LINK/SYSMAC NET Link Unit Level 1 Mounted Flag
SYSMAC LINK/SYSMAC NET Link Unit Level 0 Mounted Flag
10
11
12
Not used.
PC Link Multilevel System: Level 1 Mounted Flag
PC Link Single-level System or Multilevel System Level 0 Mounted Flag
13
14
Rack-mounting Host Link Unit Level 1 Mounted Flag
Rack-mounting Host Link Unit Level 0 Mounted Flag
15 CPU-mounting Device Mounted Flag
00 to 15 FALS-generating Address
00 to 15 Maximum Cycle Time
00 to 15 Present Cycle Time
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
07
08
09
10
04
05
06
11
12
13
14
15
Word:
Bit
00
01
02
03
Programmer:
10
11
12
13
14
15
06
07
08
09
Word:
Bit
00
01
02
03
04
05
Field device
Unit:
Program:
Notes
Field device
Unit:
Notes
I/O Bits
07
08
09
10
04
05
06
11
12
13
14
15
Word:
Bit
00
01
02
03
10
11
12
13
14
15
06
07
08
09
Word:
Bit
00
01
02
03
04
05
Date:
Field device
Unit:
Field device
Unit:
Notes
Page:
Notes
322
07
08
09
10
04
05
06
11
12
13
14
15
Area:
Bit
00
01
02
03
Programmer:
10
11
12
13
14
15
06
07
08
09
Area:
Bit
00
01
02
03
04
05
Usage
Usage
Word:
Program:
Notes
Word:
Notes
Work Bits
10
11
12
13
14
15
06
07
08
09
Area:
Bit
00
01
02
03
04
05
07
08
09
10
04
05
06
11
12
13
14
15
Area:
Bit
00
01
02
03
Date:
Usage
Usage
Word:
Word:
Notes
Page:
Notes
323
Programmer:
Word Contents
Program:
Notes
Data Storage
Word
Date:
Contents
Page:
Notes
324
Programmer:
TC address T or C Set value
Timers and Counters
Program:
Notes
Date:
TC address T or C Set value
Page:
Notes
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
Programmer:
Address Instruction Operand(s)
Program:
Address Instruction
Date:
Operand(s) Address Instruction
Page:
Operand(s)
328
Appendix H
Data Conversion Table
26
27
28
29
22
23
24
25
30
31
32
19
20
21
15
16
17
18
11
12
13
14
07
08
09
10
03
04
05
06
00
01
02
Decimal
1A
1B
1C
1D
16
17
18
19
13
14
15
0F
10
11
12
1E
1F
20
0B
0C
0D
0E
07
08
09
0A
03
04
05
06
00
01
02
Hex
00010101
00010110
00010111
00011000
00011001
00100000
00100001
00100010
00100011
00100100
00100101
00100110
00100111
00101000
00101001
00110000
00110001
00110010
BCD
00000000
00000001
00000010
00000011
00000100
00000101
00000110
00000111
00001000
00001001
00010000
00010001
00010010
00010011
00010100
00001111
00010000
00010001
00010010
00010011
00010100
00010101
00010110
00010111
00011000
00011001
00011010
00011011
00011100
00011101
00011110
00011111
00100000
Binary
00000000
00000001
00000010
00000011
00000100
00000101
00000110
00000111
00001000
00001001
00001010
00001011
00001100
00001101
00001110
329
Appendix I
Extended ASCII
Programming Console and Data Access Console Displays
Bits 0 to 3
BIN
0000 0
HEX
0001 1
0010 2
0011 3
0100 4
0101 5
0110 6
0111 7
1000 8
1001 9
1010 A
1011 B
1100 C
1101 D
1110 E
1111 F
Bits 4 to 7
0000 0001 0010 0011 0100 0101 0110 0111 1010 1011 1100 1101 1110 1111
0 1 2
NUL DLE Space
0
SOH
STX
DC
DC
1
2
!
"
1
2
ETX DC
3
EOT DC
4
#
$
ENQ NAK %
ACK SYN &
3
4
5
6
BEL ETB '
BS CAN (
HT
LF
VT
EM )
SUB *
ESC +
FF
CR
S0
S1
FS ,
GS Ć
RS
US
.
/
<
=
>
?
7
8
9
:
;
3
L
M
N
O
G
H
I
J
K
C
D
E
F
@
A
B
4
\
]
^
_
W
X
Y
Z
[
S
T
U
V
P
Q
R
5 l m n o g h i j k c d e f
` a b
6
|
}
«
~ w x y z
{ s t u v p q r
7
!
"
#
$
%
&
'
(
)
*
+
,
Ć
.
/
A
<
=
>
?
7
8
9
:
;
3
4
5
6
0
1
2
B
L
M
N
O
G
H
I
J
K
C
D
E
F
@
A
B
C
\
]
^
_
W
X
Y
Z
[
S
T
U
V
P
Q
R
D w x y z
{
|
} s t u v p q r
F l m n o g h i j k c d e f
` a b
E
~
331
address allocation
AND
APF
AR area arithmetic shift
ASCII
ASCII Unit
Backplane
BCD
BCD calculation binary binary calculation binary-coded decimal bit bit address
Glossary
The location in memory where data is stored. For data areas, an address consists 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.
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.
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.
Acronym for all plastic fiber-optic cable.
A PC data area allocated to flags, control bits, and work bits.
A shift operation wherein the carry flag is included in the shift.
Short for American Standard Code for Information Interchange. ASCII is used to code characters for output to printers and other external devices.
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.
A base onto which Units are mounted to form a Rack. Backplanes provide a series 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.
Short for binary-coded decimal.
An arithmetic calculation that uses numbers expressed in binary-coded decimal.
A number system where all numbers are expressed to the base 2, i.e., any number can be written using only 1’s or 2’s. Each group of four binary bits is equivalent to one hexadecimal digit.
An arithmetic calculation that uses numbers expressed in binary.
A system used to represent numbers so that each group of four binary bits is numerically equivalent to one decimal digit.
A binary digit; hence a unit of data in binary notation. The smallest unit of information 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 available for general use in programming.
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
bit designator bit number buffer building-block PC bus bar call carry flag clock pulse clock pulse bit common data condition constant control bit
Control System controlled system control signal counter
334
Glossary
An operand that is used to designate the bit or bits of a word to be used by an instruction.
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.
A temporary storage space for data in a computerized device.
A PC that is constructed from individual components, or “building blocks.” With building-block PCs, there is no one Unit that is independently identifiable as a
PC. The PC is rather a functional assembly of components.
The line leading down the left and sometimes right side of a ladder diagram. Instruction execution proceeds down the bus bar, which is the starting point for all instruction lines.
A process by which instruction execution shifts from the main program to a subroutine. The subroutine may be called by an instruction or by an interrupt.
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.
A pulse available at a certain bit in memory for use in timing operations. Various clock pulses are available with different pulse widths.
A bit in memory that supplies a pulse that can be used to time operations. Various clock pulse bits are available with different pulse widths, and therefore different frequencies.
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 allocated to it. This allocation is the same in each LR Area of each PC.
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.
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.
A bit in a memory area that is set either through the program or via a Programming Device to achieve a specific purpose, e.g., a Restart bit is turned ON and
OFF to restart a Unit.
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.
The devices that are being controlled by a PC System.
A signal sent from the PC to effect the operation of the controlled system.
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
CPU
CPU Backplane
CPU Rack
CTS cycle cycle time data area data area boundary data sharing debug decimal decrement default definer delay destination
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.
An acronym for central processing unit. In a PC System, the CPU executes the program, processes I/O signals, communicates with external devices, etc.
A Backplane which is used to create a 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.
An acronym for clear-to-send, a signal used in communications between electronic devices to indicate that the receiver is ready to accept incoming data.
The process used to execute a ladder-diagram program. The program is examined sequentially from start to finish and each instruction is executed in turn based on execution conditions.
The time required for a single cycle of the ladder-diagram program.
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.
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.
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.
A process by which a draft program is corrected until it operates as intended.
Debugging includes both the removal of syntax errors, as well as the fine-tuning of timing and coordination of control operations.
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 represent one decimal digit, via a system called binary-coded decimal.
Decreasing a numeric value.
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.
A number used as an operand for an instruction but that serves to define the instruction itself, rather that the data on which the instruction is to operate. Definers include jump numbers, subroutine numbers, etc.
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.
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
differentiated instruction differentiation instruction digit digit designator distributed control
DM area download electrical noise error code exclusive OR exclusive NOR exection condition execution time
Expansion I/O Backplane
Expansion I/O Rack extended counter
Glossary
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.
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 instruction.
A unit of storage in memory that consists of four bits.
An operand that is used to designate the digit or digits of a word to be used by an instruction.
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.
A data area used to hold only word data. Words in the DM area cannot be accessed bit by bit.
The process of transferring a program or data from a higher-level computer to a lower-level computer or PC.
Random variations of one or more electrical characteristics such as voltage, current, and data, which might interfere with the normal operation of a device.
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.
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 conditions.
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 usually the ON/OFF states of bits, or the logical combination of such states, called execution conditions.
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 instruction line and up to the instruction currently being executed.
The time required for the CPU to execute either an individual instruction or an entire program.
A Backplane which is used to create an 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.
A counter created in a program by using two or more count instructions in succession. 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 provides 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.
Abbreviation for Factory Intelligent Terminal.
FIT flag A dedicated bit in memory that is set by the system to indicate some type of operating status. Some flags, such as the carry flag, can also be set by the operator or via the program.
flicker bit floating point decimal
Floppy Disk Interface Unit force reset
A bit that is programmed to turn ON and OFF at a specific frequency.
A decimal number expressed as a number between 0 and 1 (the mantissa) multiplied by a power of 10, e.g., 0.538 x 10
-5
.
A Unit used to interface a floppy disk drive to a PC so that programs and/or data can be stored on floppy disks.
The process of forcibly turning OFF a bit via a programming device. Bits are usually turned OFF as a result of program execution.
force set function code
GPC
Graphic Programming
Console
The process of forcibly turning ON a bit via a programming device. Bits are usually turned ON as a result of program execution.
A two-digit number used to input an instruction into the PC.
Acronym for Graphic Programming Console.
hardware error hexadecimal
Host Link System
Host Link Unit host computer
A programming device with advanced programming and debugging capabilities to facilitate PC operation. A Graphic Programming Console is provided with a large display onto which ladder-diagram programs can be written directly in ladder-diagram symbols for input into the PC without conversion to mnemonic form.
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).
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 Programming Devices are often expressed in hexadecimal to simplify operation.
Each group of four binary bits is numerically equivalent to one hexadecimal digit.
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.
An interface used to connect a PC to a host computer in a Host Link System.
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
HR area increment indirect address initialization error initialize input input bit input device input point input signal instruction instruction block instruction execution time instruction line interface interlock
Glossary
A data area used to store and manipulate data, and to preserve data when power to the PC is turned OFF.
Increasing a numeric value.
An address whose contents indicates another address. The contents of the second address will be used as the operand. Indirect addressing is possible in the
DM area only.
An error that occurs either in hardware or software during the PC System startup, i.e., during initialization.
Part of the startup process whereby some memory areas are cleared, system setup is checked, and default values are set.
The signal coming from an external device into the PC. The term input is often used abstractly or collectively to refer to incoming signals.
A bit in the IR area that is allocated to hold the status of an input.
An external device that sends signals into the PC System.
The point at which an input enters the PC System. Input points correspond physically to terminals or connector pins.
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 voltage or from a nonconductive to a conductive state.
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.
A group of instructions that is logically related in a ladder-diagram program. Although 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.
The time required to execute an instruction. The execution time for any one instruction can vary with the execution conditions for the instruction and the operands used within it.
A group of conditions that lie together on the same horizontal line of a ladder diagram. Instruction lines can branch apart or join together to form instruction blocks.
An interface is the conceptual boundary between systems or devices and usually 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.
A programming method used to treat a number of instructions as a group so that the entire group can be reset together when individual execution is not required.
An interlocked program section is executed normally for an ON execution condition and partially reset for an OFF execution condition.
338
interrupt (signal)
Interrupt Input Unit inverse condition
I/O capacity
I/O Control Unit
I/O devices
I/O Interface Unit
I/O Link
I/O Link Unit
I/O point
I/O response time
I/O table
I/O Unit
I/O word
IR area
JIS jump
Glossary
A signal that stops normal program execution and causes a subroutine to be run.
A Rack-mounting Unit used to input external interrupts into a PC System.
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.
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.
A Unit mounted to the CPU Rack in certain PCs to monitor and control I/O points on Expansion I/O Units.
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 system.
A Unit mounted to an Expansion I/O Rack in certain PCs to interface the Expansion I/O Rack to the CPU Rack.
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 controlling the Master and a PC connected to the Remote I/O System through an I/O
Link Unit or an I/O Link Rack.
A Unit used with certain PCs to create an I/O Link in an Optical Remote I/O System.
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 terminals or connector pins on a Unit; in terms of programming, an I/O points correspond to I/O bits in the IR area.
The time required for an output signal to be sent from the PC in response to an input signal received from an external device.
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.
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.
A word in the IR area that is allocated to a Unit in the PC System.
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.
Acronym for Japanese Industrial Standards.
A type of programming where execution moves directly from one point in a program to another, without sequentially executing any instructions inbetween.
Jumps are usually conditional on an execution condition.
339
jump number ladder diagram (program) ladder diagram symbol ladder instruction
Ladder Support Software
LAN leftmost (bit/word)
Link Adapter link linkable slot
Link System
Link Unit load local area network logic block logic block instruction logic instruction
Glossary
A definer used with a jump that defines the points from and to which a jump is to be made.
A form of program arising out of relay-based control systems that uses circuit-type diagrams to represent the logic flow of programming instructions. The appearance of the program is similar to a ladder, and thus the name.
A symbol used in a ladder-diagram program.
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.
A software package that provides most of the functions of the Factory Intelligent
Terminal on an IBM AT, IBM XT, or compatible computer.
An acronym for local area network.
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.
A Unit used to connect communications lines, either to branch the lines or to convert between different types of cable. There are two types of Link Adapter:
Branching Link Adapters and Converting Link Adapters.
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).
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.
A system that includes one or more of the following systems: Remote I/O System, PC Link System, Host Link System, or Net Link System.
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.
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.
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.
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.
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.
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 loop
LR area
LSS main program masking
Master memory area mnemonic code
MONITOR mode same-numbered bits in the two words and output the result to the bit of the same number in the specified result word.
A group of instructions that can be executed more than once in succession (i.e., repeated) depending on an execution condition or bit status.
A data area that is used in a PC Link System so that data can be transferred between two or more PCs. If a PC Link System is not used, the LR area is available for use as work bits.
Abbreviation for Ladder Support Software.
All of a program except for the subroutines.
‘Covering’ an interrupt signal so that the interrupt is not effective until the mask is removed.
Short for Remote I/O Master Unit.
Any of the areas in the PC used to hold data or programs.
A form of a ladder-diagram program that consists of a sequential list of the instructions without using a ladder diagram. Mnemonic code is required to input a program into a PC when using a Programming Console.
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 debugging the PC.
most-significant (bit/word) See leftmost (bit/word).
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
Net Link System
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.
An optical LAN formed from PCs connected through Net Link Units. A Net Link
System also normally contains nodes interfacing computers and other peripheral 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
Network Service Board
Network Service Unit node
The Unit used to connect PCs to a Net Link System. The full name is “SYSMAC
Net Link Unit.”
A device with an interface to connect devices other than PCs to a Net Link System.
A Unit that provides two interfaces to connect peripheral devices to a Net Link
System.
One of the positions in a LAN. Each node incorporates a device that can communicate 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
NO input noise interference nonfatal error normal condition
NOT
NSB
NSU
OFF
OFF delay
ON
ON delay one-shot bit on-line removal operand operand bit operand word operating error
Optical I/O Unit
Optical Slave Rack
OR
342
Glossary
An input that is normally open, i.e., the input signal is considered to be present when the circuit connected to the input closes.
Disturbances in signals caused by electrical noise.
A hardware or software error that produces a warning but does not stop the PC from operating.
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.
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 operand bit.
An acronym for Network Service Board.
An acronym for Network Service Unit.
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.
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).
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.
The delay between the time when an ON signal is initiated (e.g., by an input device or PC) and the time when the signal reaches a state readable as an ON signal by a receiving party (e.g., output device or PC).
A bit that is turned ON or OFF for a specified interval of time which is longer than one cycle.
Removing a Rack-mounted Unit for replacement or maintenance during PC operation.
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.
A bit designated as an operand for an instruction.
A word designated as an operand for an instruction.
An error that occurs during actual PC operation as opposed to an initialization error, which occurs before actual operations can begin.
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.
A Slave Rack connected through an Optical Remote I/O Slave Unit.
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
output output bit output device output point output signal overseeing overwrite parity
PC
PCB
PC configuration
PCF
PC Link System
PC Link Unit
PC System peripheral device port present value
Glossary states of bits or the logical combination of such states called execution conditions.
The signal sent from the PC to an external device. The term output is often used abstractly or collectively to refer to outgoing signals.
A bit in the IR area that is allocated to hold the status to be sent to an output device.
An external device that receives signals from the PC System.
The point at which an output leaves the PC System. Output points correspond physically to terminals or connector pins.
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.
Part of the processing performed by the CPU that includes general tasks required to operate the PC.
Changing the content of a memory location so that the previous content is lost.
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.
An acronym for Programmable Controller.
An acronym for printed circuit board.
The arrangement and interconnections of the Units that are put together to form a functional PC.
Acronym for plastic-clad optical fiber cable.
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 connected in series with it.
The Unit used to connect PCs in a PC Link System.
With building-block PCs, all of the Racks and independent Units connected directly 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.
Devices connected to a PC System to aid in system operation. Peripheral devices include printers, programming devices, external storage media, etc.
A connector on a PC or computer that serves as a connection to an external device.
The current value registered in a device at any instant during its operation. Present value is abbreviated as PV.
343
printed circuit board
Printer Interface Unit program
Programmable Controller programmed alarm programmed error programmed message
Programming Console
Programming Device
PROGRAM mode
PROM Writer prompt
PV
Rack refresh relay-based control
Glossary
A board onto which electrical circuits are printed for mounting into a computer or electrical device.
A Unit used to interface a printer so that ladder diagrams and other data can be printed out.
The list of instructions that tells the PC the sequence of control actions to be carried out.
A computerized device that can accept inputs from external devices and generate outputs to external devices according to a program held in memory. Programmable Controllers are used to automate control of external devices. Although single-component Programmable Controllers are available, building-block Programmable Controllers are constructed from separate components. Such building-block Programmable Controllers are formed only when enough of these separate components are assembled to form a functional assembly, i.e., no one individual Unit is called a PC.
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.
An error arising as a result of the execution of an instruction designed to generate the error in the program, as opposed to one generated by the system.
A message generated as a result of execution of an instruction designed to generate the message in the program, as opposed to one generated by the system.
The simplest form or programming device available for a PC. Programming
Consoles are available both as hand-held models and as CPU-mounting models.
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.
A mode of operation that allows inputting and debugging of programs to be carried out, but that does not permit normal execution of the program.
A peripheral device used to write programs and other data into a ROM for permanent storage and application.
A message or symbol that appears on a display to request input from the operator.
Acronym for present value.
An assembly of various Units on a Backplane that forms a functional unit in a building-block PC System. Racks include CPU Racks, Expansion I/O Racks, I/O
Racks, and Slave Racks.
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.
The forerunner of PCs. In relay-based control, groups of relays are interconnected to form control circuits. In a PC, these are replaced by programmable circuits.
344
Remote I/O Master Unit
Remote I/O Slave Unit
Remote I/O System
Remote I/O Unit remote I/O word reset return reversible counter reversible shift register right-hand instruction rightmost (bit/word) rotate register
RUN mode scheduled interrupt self diagnosis self-maintaining bit servicing set set value
Glossary
The Unit in a Remote I/O System through which signals are sent to all other Remote 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.
A Unit mounted to a Backplane to form a Slave Rack. Remote I/O Slave Unit is generally abbreviated to Slave.
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.
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.
An I/O word allocated to a Unit in a Remote I/O System.
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.
The process by which instruction execution shifts from a subroutine back to the main program (usually the point from which the subroutine was called).
A counter that can be both incremented and decremented depending on the specified conditions.
A shift register that can shift data in either direction depending on the specified conditions.
Another term for terminal instruction.
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.
A shift register in which the data moved out from one end is placed back into the shift register at the other end.
The operating mode used by the PC for normal control operations.
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 execution of specific subroutines that can be used for instructions that must be executed repeatedly for a specified period of time.
A process whereby the system checks its own operation and generates a warning or error if an abnormality is discovered.
A bit that is programmed to maintain either an OFF or ON status until set or reset by specified conditions.
The process whereby the PC provides data to or receives data from external devices or remote I/O Units, or otherwise handles data transactions for Link Systems.
The process of turning a bit or signal ON.
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
Slave
Slave Rack slot software error software protect source
Special I/O Unit
SR area subroutine subroutine number
SV switching capacity syntax error shift register system configuration system error system error message
TC area
TC number
346
Glossary
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 other end is lost.
Short for Remote I/O Slave Unit.
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.
A position on a Rack (Backplane) to which a Unit can be mounted.
An error that originates in a software program.
A means of protecting data from being changed that uses software as opposed to a physical switch or other hardware setting.
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.
A dedicated Unit that is designed for a specific purpose. Special I/O Units include Position Control Units, High-Speed Counter Units, Analog I/O Units, etc.
A data area in a PC used mainly for flags, control bits, and other information provided 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.
A group of instructions placed after the main program and executed only if called from the main program or activated by an interrupt.
A definer used to identify the subroutine that a subroutine call or interrupt activates.
Abbreviation for set value.
The maximum voltage/current that a relay can safely switch on and off.
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 specifying 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).
The arrangement in which Units in a system are connected.
An error generated by the system, as opposed to one resulting from execution of an instruction designed to generate an error.
An error message generated by the system, as opposed to one resulting from execution of an instruction designed to generate a message.
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.
A definer that corresponds to a bit in the TC area and used to define the bit as either a timer or a counter.
terminal instruction terminator timer
TM area transmission distance
TR area trace transfer trigger address
UM area
Unit unit number watchdog timer
Wired Slave Rack word word address word multiplier
Glossary
An instruction placed on the right side of a ladder diagram that uses the final execution conditions of an instruction line.
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.
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.
A memory area used to store the results of a trace.
The distance that a signal can be transmitted.
A data area used to store execution conditions so that they can be reloaded later for use with other instructions.
An operation whereby the program is executed and the resulting data is stored in
TM memory to enable step-by-step analysis and debugging.
The process of moving data from one location to another within the PC, or between 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.
An address in the program that defines the beginning point for tracing. The actual beginning point can be altered from the trigger by defining either a positive or negative delay.
The memory area used to hold the active program, i.e., the program that is being currently executed.
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.
A number assigned to some Link Units and Special I/O Units to facilitate identification when assigning words or other operating parameters to it.
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.
A Slave Rack connected through a Wired Remote I/O Slave Unit.
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.
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.
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
work bit work word
Glossary word setting made on the Unit is added to 32 times the word multiplier to arrive at the actual word to be allocated.
A bit in a work word.
A word that can be used for data calculation or other manipulation in programming, i.e., a ‘work space’ in memory. A large portion of the IR area is always reserved 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
A addresses, in data area, 17 applications, precautions, xiii
AR area, 30–36 arithmetic flags, 96 arithmetic operations, flags, 30
ASCII, converting data, 157
B backup
DM area data, 250 program, 246–248 battery
CPU31 Low Battery Flag, 35
Low Battery Flag, 28
BCD calculations, 158–173 converting, 17 definition, 17 binary calculations, 174 definition, 17 bits controlling, 103 forced set/reset, 233 monitoring, 230–233 buzzer, 61
C calendar/clock, dedicated bits, 34 canceling, forced set/reset, 235 cassette tape operation, 246–253 comparing Program Memory data, 249–250 error messages, 246 restoring Program Memory data, 249–250 saving Program Memory data, 246 channel. See word clock pulse bits, 29 comparing Program Memory data, 249–250 constants, operands, 96 control bit definition, 16
Output OFF, 28
Control System, definition, 3 controlled system, definition, 3
Index
counters bits in TC area, 39 changing SV, 243 conditions when reset, 117, 120 creating extended timers, 118 extended, 118 inputting SV, 72
Power-OFF, 35 reversible counters, 119
CPU
Device Mounted Flag, 36 operational flow, 216–217
CPU indicators, 12
CPU Rack, definition, 12 cycle, First Cycle Flag, 29 cycle time, 216–220 calculating, 220–222 controlling, 198
Cycle Time Indicators, 36 displaying on Programming Console, 77 error flag, 28 flag for SCAN(18), 35
D data comparison instructions, 138–145 converting, 18, 146–158 decrementing, 159 incrementing, 159 modifying, 239 modifying binary data, 241 modifying hex/BCD, 236 moving, 129–138 data area, definition, 15 data areas, structure, 16
Data Link table, transferring, 69 data retention in AR area, 30 in HR area, 39 in IR area, 18 in LR area, 40 in SR area, 21 in TC area, 39 in TR area, 40 decrementing, 159 definers, definition, 95 differentiated instructions, 96 function codes, 95 digit, monitoring, 230 digit numbers, 17 displays converting between hex and ASCII, 237
I/O Unit designations, 66
Programming Console, English/Japanese switch, 60
DM area, saving, restoring, and comparing, 250–253
349
E
ER. See flag, Instruction Execution Error error codes, programming, 197 error history, dedicated bits, 33 error messages, programming, 198, 200 errors cassette tape operations, 246 clearing messages, 64 fatal, 258 history area, 37 initialization, 257
Instruction Execution Error Flag, 30 message tables, 256–260 messages when inputting programs, 74 non-fatal, 258 programming indications, 256 programming messages, 198, 200 reading and clearing messages, 256 resetting, 198
SR and AR area flags, 260 execution condition, definition, 44 execution time, instructions, 222–226
Expansion I/O Rack, definition, 12
F
Factory Intelligent Terminal. See peripheral devices
FAL area, 28, 197
FAL code, FALS-generating Address, 36 fatal operating errors, 258
FIT. See peripheral devices flag
AR and SR area error flags, 260 arithmetic, 30 programming example, 140, 142
CPU-mounting Device, 36
CY clearing, 159 setting, 159
Cycle Time Error, 28 definition, 16
First Cycle, 29
I/O Verification Error, 28
Instruction Execution Error, 30
Link Units, 36
Low Battery, 28
Low Battery (CPU31), 35
Network Parameter, 36
Optical I/O Error, 32
Step, 29 floating-point decimal, division, 169
Floppy Disk Interface Unit. See peripheral devices forced set/reset, 233 canceling, 235–236
Forced Status Hold Bit, 27
350
Index function codes, 95
G-H
GPC. See peripheral devices
Graphic Programming Console. See peripheral devices
Group-2 High-density I/O Units, 4 word allocation, 20 hexadecimal, definition, 17
High-density I/O Units. See Group-2 High-density I/O Units;
Units
Host Link Systems, error bits and flags, 23
HR area, 39
I
I/O bit definition, 18 limits, 18
I/O numbers, 20
I/O points, refreshing, 205, 206
I/O response times, 227
I/O status, maintaining, 27
I/O table clearing, 68 reading, 66 registration, 63 verification, 64
Verification Error flag, 28
I/O Units. See Units
I/O word allocation, 19 definition, 18 limits, 18 incrementing, 159 indirect addressing, 96 input bit application, 18 definition, 3 input device, definition, 3 input point, definition, 3 input signal, definition, 3 installation, precautions, xiii instruction set
ADB(50), 174
ADD(30), 160
ADDL(54), 161
AND, 46, 102 combining with OR, 47
AND LD, 49, 103 combining with OR LD, 51 use in logic blocks, 50
AND NOT, 46, 102
ANDW(34), 180
ASC(86), 157
ASL(25), 125
ASR(26), 125
BCD(24), 147
BCDL(59), 148
BCMP(68), 143
BCNT(67), 202
BIN(23), 146
BINL(58), 146
BSET(71), 133
CLC(41), 159
CMP(20), 139
CMPL(60), 141
CNT, 116
CNTR(12), 119
COLL(81), 136
COM(29), 179
CTW(63), 131
DEC(39), 159
DIFD(14), 87, 104–106 using in interlocks, 108 using in jumps, 110
DIFU(13), 87, 104–106 using in interlocks, 108 using in jumps, 110
DIST(80), 135
DIV(33), 167
DIVL(57), 168
DMPX(77), 152
DVB(53), 179
END(01), 48, 99, 111 execution times, 222–226
FAL(06), 197
FALS(07), 197
FDIV(79), 169
HTS(65), 148
IL(02), 84, 108–109
ILC(03), 84, 108–109
INC(38), 159
INT(89), 185
IORF(97), 205
JME(05), 110
JMP(04), 110
JMP(04) and JME(05), 86
KEEP(11), 106 in controlling bit status, 88 ladder instructions, 45
LD, 46, 102
LD NOT, 46, 102
LMSG(47), 200
MCMP(19), 138
MLB(52), 178
MLPX(76), 150
MOV(21), 130
MOVB(82), 136
MOVD(83), 137
MPRF(61), 206
MSG(46), 198
MUL(32), 165
MULL(56), 166
MVN(22), 130
NOP(00), 111
NOT, 44 operands, 42
Index
OR, 46, 102 combining with AND, 47
OR LD, 49, 103 combining with AND LD, 51 use in logic blocks, 51
OR NOT, 46, 102
ORW(35), 180
OUT, 47, 104
OUT NOT, 47, 104
RECV(98), 208
RET(93), 183
ROL(27), 125
ROOT(72), 172
ROR(28), 126
RWS(17), 128
SBB(51), 176
SBN(92), 183
SBS(91), 183
SCAN(18), 198
SDEC(78), 154
SEND(90), 207
SFT(10), 121
SFTR(84), 123
SLD(74), 126
SNXT(09), 188
SRD(75), 127
STC(40), 159
STEP(08), 188
STH(66), 149
SUB(31), 162
SUBL(55), 164
SYS(49), 201 maintaining forced status, 27 maintaining I/O status, 27
TCMP(85), 144
TERM(48), 59, 200 terminology, 42
TIM, 112
TIMH(15), 116
VCAL(69), 202
WDT(94), 205
WSFT(16), 128
WTC(64), 132
XCHG(73), 135
XFER(70), 134
XNRW(37), 182
XORW(36), 181 instructions designations when inputting, 73 instruction set lists, 100 mnemonics list, ladder, 101 interlocks, 108–109 using self-maintaining bits, 88 interrupts, 182 control, 185 scheduled interrupt, 186–187 example, 186
IR area, 18–20
J-L jump numbers, 110 jumps, 110–111
351
ladder diagram branching, 82
IL(02) and ILC(03), 84 using TR bits, 82 controlling bit status using DIFU(13) and DIFD(14), 87, 104–106 using KEEP(11), 106–112 using OUT and OUT NOT, 47 converting to mnemonic code, 44–56 display via GPC, FIT, or LSS, 43 instructions combining, AND LD and OR LD, 51 controlling bit status using KEEP(11), 88 using OUT and OUT NOT, 104 format, 95 notation, 95 structure, 43 using logic blocks, 49 ladder diagram instructions, 102–103
Ladder Support Software
See also peripheral devices capabilities. See peripheral devices
LEDs. See CPU indicators leftmost, definition, 17
Link System, flags and control bits, 23–27
Link Units
See also Units flags, 36
PC cycle time, 221 logic block instructions, converting to mnemonic code, 49–56 logic blocks. See ladder diagram logic instructions, 179–182
LR area, 40
LSS
See also peripheral devices capabilities. See peripheral devices
M memory all clear, 62 memory areas clearing, 61 definition, 15 memory partial clear, 62 messages, programming, 198, 200 mnemonic code, converting, 44–56 modifying data, hex/binary, 236 monitoring binary, 240 monitoring 3 words, 238 mounting Units, location, 13
Index
N nesting, subroutines, 184
NET Link System, LR area application. See SYSMAC NET
Link System non-fatal operating errors, 258 normally closed condition, definition, 44
NOT, definition, 44
O operand bit, 44 operands, 95 allowable designations, 95 requirements, 95 operating environment, precautions, xii operating modes, 58 operating parameters, setting, 201 operation, preparations, 60–70
Optical I/O Unit, Error flag, 32 output bit application, 18 controlling, via Output OFF bit, 28 controlling ON/OFF time, 104 controlling status, 87, 88 definition, 3 output device, definition, 3 output point, definition, 3 output signal, definition, 3
P password, entering on Programming Console, 60
PC configuration, 12 definition, 3
PC Link Systems error bits and flags, 25–27
LR area application, 40 peripheral devices, 5
Factory Intelligent Terminal (FIT), 6
Floppy Disk Interface Unit, 6
Graphic Programming Console (GPC), 5
Ladder Support Software (LSS), 5 capabilities, 8
Printer Interface Unit, 6
Programming Console, 5, 56–60
PROM Writer, 6 power supply, Power-OFF Counter, 35 precautions, xi applications, xiii general, xii operating environment, xii safety, xii
352
present value. See PV
Printer Interface Unit. See peripheral devices program execution, 92
Program Memory, 40 backup and restore, 249–250 setting address and reading content, 71–72 structure, 45 programming backup onto cassette tape, 246–253 checks for syntax, 75–77 entering and editing, 72 example, using shift register, 122 inputting, modifying and checking, 71–87 inserting and deleting instructions, 79–81 jumps, 86 precautions, 91 preparing data in data areas, 133 searching, 78–79 setting and reading from memory address, 71 simplification with differentiated instructions, 106 writing, 42
Programming Console, 56–60
See also peripheral devices
PROM Writer. See peripheral devices
PV accessing via PC area, 39
CNTR(12), 120 timers and counters, 112
R
Racks, types, 12
Remote I/O Systems, error bits and flags, 22 response times, I/O, 227–228 rightmost, definition, 17
S safety precautions. See precautions self-maintaining bits, using KEEP(11), 106 set value. See SV seven-segment displays, converting data, 154 shift registers, 121–129 controlling individual bits, 122
Special I/O Units. See Units
SR area, 21–30 status indicators. See CPU indicators step execution, Step flag, 29 step instructions, 188–197 subroutine number, 183 subroutines, 182–187
Index
SV accessing via TC area, 39 changing, 243
CNTR(12), 120 timers and counters, 112
SYSMAC LINK System
Active Node Flags, 33 communications completion code, 24 data link settings, 32 data link status, 24 flags, 23 instructions, 207
LR area application, 40
Network Parameter Flag, 36 routing table and monitor timer, 39 service time, 34
SYSMAC NET Link System data link status, 24
Data Link Table transferring, 69 instructions, 207 service time, 34
T
TC area, 39–40
TC numbers, 39, 111
TERMINAL mode, 59
Key Bits, 35 timers bits in TC area, 39 changing SV, 243 conditions when reset, 112, 116 example using CMP(20), 140 extended timers, 113 flicker bits, 115 inputting SV, 72
ON/OFF delays, 113 one-shot bits, 114
TR area, 40
TR bits, use in branching, 82
U
Units definition, 3
High-density I/O Units, definition, 4
I/O Units, definition, 3
Link Units, definition, 4
Special I/O Units, definition, 4
W watchdog timer, 219 extending, 205 word bit, definition, 16 work word, definition, 16
353
Revision History
A manual revision code appears as a suffix to the catalog number on the front cover of the manual.
Cat. No. W217-E1-2
Revision code
The following table outlines the changes made to the manual during each revision. Page numbers refer to the previous version.
Revision code
1
1A
1B
1C
1D
2
Date
July 1992
November 1992
January 1994
June 1994
January 1995
March 2000
Revised content
Original production.
Page 129: Layout of diagram corrected.
Pages 266 and 268: Products added to standard-models tables.
Multipoint I/O changed to High-density I/O throughout the manual. Scan time changed to cycle time throughout the manual.
Page 7: Available manuals list updated.
Page 8-10: LSS operation capabilities added.
Page 24: “node numbers in table body” corrected to “Registration number in the data link table” in the SYSMAC NET Link Systems table.
Page 33: Note added to Set Bit procedure.
Page 201 and 202: The description for SET SYSTEM – SYS(49) has been rewritten.
Page 218: Time required for Host Link Unit servicing has been clarified to 8 ms per Unit max.
Page 219: Units added to the Special I/O Unit Refresh table.
Page 248: Note added.
Pages 263 to 268: Standard Models lists has been updated.
Address change.
Page 117: AND instruction for TIM 002 in Example 5 corrected to AND NOT.
Precautions section added. In addition, the following changes were made.
Page 7: Minor changes made to table.
Page 31: Corrections made to first table.
Page 99: Note added.
Page 114: Information added to “Limitations.”
Page 263: Change made to “CPU error” item.
Page 275: Model numbers changed in last table.
Page 323: Information added to introduction.
355
Télécharger
Publicité