Programming Installationmediasrv.co.za/uploads/media/5836.pdfThis manual describes the...
-
Upload
nguyencong -
Category
Documents
-
view
221 -
download
2
Transcript of Programming Installationmediasrv.co.za/uploads/media/5836.pdfThis manual describes the...
1 2 3
Visual KV Series 3 P
rogra
mm
ing
User's ManualVisual KV Series
3Programming
© KEYENCE CORPORATION, 1999 NKVP-UM-4-1000 Printed in Japan
96M0366
How this manual is organized:
The Visual KV Series User’s Manual is composed of 3 separatemanuals; 1-Installation, 2-Support Software, 3-Programming.Please read each manual relevant to your purpose.
Installation
1. Configuration andSpecifications
2. System Installation
3. Access Window
4. KV-D20 OperatorInterface Panel
5. KV-10/80 Hardware
6. Handheld Program-mer
7. KV-L2 Serial InterfaceModule
8. KV-AN6 Analog I/OModule
9. KV-AD4/DA4 AnalogI/O Unit
10. Troubleshooting
11. Appendices
SupportSoftware
1. Introduction
2. Editor
3. Simulator
4. Monitor
5. Appendices
Programming
1. Programming
2. Instructions
3. Interrupts
4. High-speed Counters
5. Positioning Control
6. Interrupts, High-speedCounters, PositioningControl
7. Serial Communication
8. ProgrammingExamples
INDEX
Specifications are subject to change without notice.
KEYENCE CORPORATION1-3-14, Higashi-Nakajima,Higashi-Yodogawa-ku,Osaka, 533-8555, JapanPHONE: 81-6-6379-2211FAX: 81-6-6379-2131
AFFILIATED COMPANIES
KEYENCE CORPORATION OF AMERICAPHONE: 201-930-0100 FAX: 201-930-0099
KEYENCE (UK) LIMITEDPHONE: 01908-696900 FAX: 01908-696777
KEYENCE DEUTSCHLAND GmbHPHONE: 0711-79 73 71-0 FAX: 0711-797 77 99
KEYENCE FRANCE S.A.PHONE: 01 47 92 76 76 FAX: 01 47 92 76 77
KEYENCE SINGAPORE PTE LTD.PHONE: 392-1011 FAX: 392-5055
KEYENCE (MALAYSIA) SDN BHDPHONE: 03-252-2211 FAX: 03-252-2131
KEYENCE (THAILAND) CO., LTD.PHONE: 02-369-2777 FAX: 02-369-2775
KEYENCE THAIWAN CO., LTD.PHONE: 02-2627-3100 FAX: 02-2798-8925
KEYENCE KOREA CORPORATIONPHONE: 02-563-1270 FAX: 02-563-1271
Safety PrecautionsThis instruction manual describes the operation and function of the KV Series PLC.Read this manual carefully to ensure safe use and maximum performance from yourKV Series PLC.
SymbolsThe following symbols alert you to important messages. Be sure to read thesemessages carefully.
Failure to follow instructions may lead to injury. (electricshock, burn, etc.)
Failure to follow instructions may lead to product damage.
Provides additional information on proper operation.
ConventionsThis manual describes the operation/function of all Keyence KV Series PLC.Note following conventions when you use.
General Precautions• At startup and during operation, be sure to monitor the functions and perfor-
mance of the KV Sereis PLC.
• We recommend that you take substantial safety measures to avoid any damagein the event a problem occurs.
• Do not open or modify the KV Series PLC or use it in any way other than de-scribed in the specifications.
• When the KV Series PLC is used in combination with other instruments, func-tions and performance may be degraded, depending on operating conditions andthe surrounding environment.
• Do not use the KV Series PLC for the purpose of protecting the human body.
Note: The built-in display may show the error message "Error 40" blinking the veryfirst time you turn on the power supply to the Visual KV Series. Press any keyaround the display to cancel this message.The Visual KV Series shows this message when no program is loaded.
WARNING
CAUTION
Note:
(1)
Visual KV (Series) KV-10AR/AT/DR/DT KV-16AR/AT/DR/DTKV-10xx, 16xx, 24xx, 40xx KV-24AR/AT/DR/DT KV-40AR/AT/DR/DT
Conventional KV (Series) KV-10R(W)/T(W) KV-16R(W)/T(W)KV-300 (Series) KV-24R(W)/T(W) KV-40R(W)/T(W)KV-10/80 (Series) KV-80R(W)/T(W)
KV-300
Note to UserWhen using the Visual KV Series in the following conditions or environments, besure to use the Visual KV Series with sufficient margin regarding the rating andfunctions, take appropriate safety precautions such as fail-safe, and contact oursales personnel if any questions arise.
• Use in conditions or environments not described in this manual
• Use for nuclear power control, railway facilities, air service facilities, vehicles,combustion devices, medical equipment, amusement machines, safety equip-ment, etc.
• Use for applications where large effects are predicted to be given on human livesand properties and safety is especially requested.
Restriction on Acquiring the CE Marking Restriction to be compatible with EMC directives
• When using a relay output type unit (whose model name ends with "R"), connectspark killers having the appropriate withstand voltage against the load to theoutput terminals in parallel to contacts (because the unit discharges when a relaycontact becomes open and noise is generated). In our experiments, we use thefollowing models of spark killers.
XEB0101 0.1 µF-10 Ω manufactured by OKAYA DENKI SANGYO
The following 1-turn ferrite core is added to the AC power input circuit of the KV-40AR/T, the KV-24AR/T and to the DC power input circuit of the KV-40DR/T.
ZCAT3035-1330 manufactured by TDK
Note: The contents above do not by themselves ensure that the entire machinemanufactured in accordance with the above contents is compatible with EMCdirectives.
You must judge by yourself whether or not the entire machine is compatible withEMC directives because compatibility may change depending on the componentconfiguration, wiring and location inside of the machine.
Restriction on compatibility with low-voltage directives (IEC-1010-1)
• Use insulated type crimp-style terminals.
• For wiring materials, use lead wires whose sheath is 0.4 mm or more.
• The Visual KV Series is allowed to be installed in a vertical position only.(Spacers for expansion units are not available.)
• Be sure to use the Visual KV Series inside the control panel.
(2)
Features of the Visual KV Series Extremely small
The Visual KV Series is the smallest in the world among AC type PLCs equippedwith screw terminal blocks, and saves installation space.
Extremely fast
The minimum scan time is 140 µs and minimum instruction execution time is 0.7µs, which is the fastest control in its class.
AC power built-in type newly addedAC power built-in type units are newly added. This type can be used in smallspaces where a switching power supply unit cannot be installed.
Excellent Access Window
An Access Window with two-color backlight is adopted in all models to facilitatechanging and monitoring of device data. Changing between RUN mode andPROGRAM mode, checking the error code when an error has occurred, etc. canbe performed in a Visual KV Series unit without the need for any handheldprogrammer.The analog trimmer, which has been popular in the conventional KV Series, isdigitized to enable more detail settings. [Digital trimmers]
User message setting function
In the Access Window, 256 different user messages can be displayed. Thisfunction can be used to give instructions on works on the production line, indicateabnormalities in the units, etc.
Program write in RUN mode
Ladder programs can be changed even while the system is running.
Equipped with two serial portsVisual KV Series basic units are equipped with two serial ports to connect periph-eral units, improving the debug environment.(The KV-10xx is equipped with only one serial port.)
Easy Ramp-up/down control function
The one-axis motor control function is offered separately from high-speedcounters so that feedback control is enabled.
Equipped with two 24-bit high-speed 30 kHz, two-phase counters
The Visual KV Series is equipped with two high-speed counters each with a two-point comparator output function that enables high-speed encoder input.
Specified frequency pulse output function
High-speed counters can function as pulse oscillators of 50 kHz maximum witheasy setting, without creating a complicated ladder program.
Frequency counter functionHigh-speed counters can function as frequency counters with easy setting,without creating complicated ladder programs.
Cam switch function
High-speed counters can function as cam switches with easy setting, withoutcreating complicated ladder programs.
(3)
Interrupt function
The Visual KV Series is equipped with four high-speed interrupt inputs of10 µs maximum.
Input time constant change function
The time constant can be set in 7 steps from 10 µs to 10 ms.
Double memory backup functionsIn addition to a conventional SRAM battery backup function, the Visual KV Seriesis also equipped with an EEPROM backup function.
Compatibility with Conventional KV Series Peripheral UnitsThe Visual KV Series functions as a high-end compatible model of the conventionalKV Series. Peripheral units of the conventional KV Series such as the ladder supportsoftware "KV IncrediWare (DOS)" and "LADDER BUILDER for KV" and thehandheld programmer KV-P3E(01) can be used since they are part of the Visual KVSeries.However, it should be noted that the contents have changed as follows.
• The internal clock cycle of high-speed counters consists of three types: 1 µs, 10µs, and 100 µs.
• The time constant for an input relay specified by the HSP instruction is 10 µs.
• The analog trimmer function is set with the Access Window built into the basicunit.
• The available device setting range of the TMIN instruction is from 0 to 65535.[Handheld programmer KV-P3E(01) can display 0 to 9999 .]
• The RUN/PROGRAM LED is displayed in the Access Window provided on thefront face of the basic unit.
• Transistor output is not independent, but is common.
• With the transistor type, the output terminal layout is different.
• The specifications for output current of transistor outputs Nos. 500 to 502 is 100mA.
• Conventional KV Series expansion units are not available as expansion units forthe Visual KV Series.
• The channel setting switch is not provided for expansion units. Channels aredetermined in connection order.
• Scans in expansion I/O units are not synchronous with the scan time in Visual KVSeries basic units.
• Assignment of special utility relays has partially changed.
• Data memory device Nos. DM1000 to DM1999 are assigned as special datamemories.
(4)
Cautions when using the previous version of ladder support softwarePay strict attention to the following items when using the ladder support software.
• When using the ladder support software "KV IncrediWare (DOS)" or "LADDERBUILDER for KV Ver. 1.0x", set the model to "KV-300".
• DM0 to DM1999 are only available.
When the ladder support software "LADDER BUILDER for KV Ver. 1.0x" isused, do not use the monitor’s Change All function. If the Change All functionis used, the basic unit may be damaged. Never use the Change All function.
Peripheral units and other units incompatible with the Visual KV SeriesPeripheral units in the conventional KV Series and other units shown below are notcompatible with the Visual KV Series.
• Expansion I/O units for the conventional KV Series: KV-8ER/8ET/8EX/16EX/8EYR/8EYT/16EYR/16EYT
• Analog I/O units for the conventional KV Series: KV-AD4/DA4
Cautions when Using the Serial PortThe KV-16xx/24xx/40xx units are equipped with two RJ-11 modular connectors forserial communication.When using them, pay strict attention to the following contents:
• Programs can be transferred and monitored using either communication port A orB. However, never connect the ladder software and a handheld programmer tothe two ports at the same time.
• The KV-D20 operator interface panel can be connected to either communicationport A or B. However, only one KV-D20 unit can be connected to a single basicunit.
• Never leave both the KV-D20 operator interface panel and KV-P3E(01) handheldprogrammer on simultaneously for a long period of time.
CAUTION
(5)
(6)
(7)
How this manual is organizedThe Visual KV Series User’s Manual is composed of 3 separate manuals;1-Installation, 2-Support Software, 3-Programming. Please read each manualrelevant to your purpose.
1 InstallationChapter 1 Configuration and Specifications [Visual KV Series Only]
Describes the system configuration of the Visual KV Series, the names and functions ofeach part, and the specifications.
Chapter 2 System Installation [Visual KV Series Only]Describes the installation and connection of each Visual KV Series unit as well assystem maintenance.
Chapter 3 Access Window [Visual KV Series Only]Describes the Access Window used for changing and monitoring data.
Chapter 4 KV-D20 Operator Interface Panel [Visual KV Series Only]Describes the KV-D20 Operator Interface Panel used for changing, monitoring, anddisplaying the status of inside relays, timers, counters and data memories.
Chapter 5 KV-300, KV-10/80 Hardware [KV-300, KV-10/80 Series Only]Describes the hardware specifications and wirings for KV-300 and KV-10/80 Series.
Chapter 6 Handheld ProgrammerDescribes how to use the handheld programmer and memory card.
Chapter 7 KV-L2 Serial Interface Module [KV-300 Series Only]Describes the serial interface modules for KV-300 Series.
Chapter 8 KV-AN6 Analog I/O Module [KV-300 Series Only]Describes the optional Analog I/O module for KV-300 Series
Chapter 9 KV-AD4/DA4 Analog I/O Unit [KV-10/80 Series Only]Describes the optional Analog I/O unit for KV-10/80 Series.
Chapter 10 TroubleshootingThis chapter describes the error code list, countermeasures against problems, and errorindications for each unit.
AppendicesThe appendix includes a list of ladder program applications and the index.
2 Support SoftwareChapter 1 Introduction
Describes the items included in the package, the product outline, the method to connecta personal computer, the installation method, etc.
(8)
Chapter 2 EditorDescribes the operating procedures in Editor mode.
Chapter 3 SimulatorDescribes the operating procedures in Simulator mode.
Chapter 4 MonitorDescribes the operating procedures in Monitor mode.
AppendicesIncludes instructions list, devices list, sample program list and quick reference for keyoperation and shortcuts.
3 ProgrammingChapter 1 Programming
Describes basic knowledge including program creation procedures, device configuration,relay assignments, special functions to set and confirm Visual KV Series operations, aswell as the extended ladder diagrams. Understand the contents described here com-pletely at first before creating programs.
Chapter 2 InstructionsDescribes the concrete usage of instructions in the KV Series.Refer to "Chapter 3 Interrupts" on page 3-183 for details of interrupt instructions.Refer to "Chapter 4 High-speed counters" on page 3-195 for details of the high-speedcounters used in the application instruction.
Chapter 3 Interrupts [Visual KV Series Only]The interrupt processing function executes an interrupt program when an external inputor request from the high-speed counter comparator (interrupt factor) is encounteredduring KV operation.This chapter describes the types of interrupt factors as well as inputs and outputsencountered during interrupt processing.
Chapter 4 High-speed Counters [Visual KV Series Only]Describes high-speed counters and high-speed counter comparators, which allow high-speed pulse measurement and pulse output, independent of the scan time.
Chapter 5 Positioning Control [Visual KV Series Only]Describes ramp-up/down control of stepping motors and servo motors.
Chapter 6 Interrupts, High-speed Counters, Positioning Control [KV-300, KV-10/80 Series Only]Describes ramp-up/down control of stepping motors and servo motors.
Chapter 7 Serial CommunicationThe KV Series can be connected to an external device with an RS-232C interface toestablish communication.This chapter describes communications specifications, how to connect the KV Series toexternal devices, and how to perform communication.
Chapter 8 Programming ExamplesDescribes the typical programming examples for KV-10/80 Series. These programs canbe used for Visual KV Series. However, pay attention to the I/O addressing compatibilitybefore use.
(9)
Contents 3 Programming
Chapter 1 Programming
1.1 Before Creating Programs ..............................................................................3-21.1.1 Flow from Introduction to Operation ...................................................................3-21.1.2 Scan Time ...........................................................................................................3-3
Scan time .....................................................................................................3-3Input response time delay ............................................................................3-3
1.2 User Memory ....................................................................................................3-41.2.1 Program Capacity ...............................................................................................3-4
Maximum number of lines in a program.......................................................3-4Calculating the byte count used ...................................................................3-4
1.3 Device Configuration .......................................................................................3-51.3.1 Device List ..........................................................................................................3-5
Relay list ......................................................................................................3-5List of I/O relays in basic units .....................................................................3-5List of relays in expansion units ...................................................................3-6
1.3.2 Relay No. ............................................................................................................3-7Address No. .................................................................................................3-7Contact No. ..................................................................................................3-8Channel No. .................................................................................................3-8
1.3.3 Assigning Relay Nos. ..........................................................................................3-81.3.4 Input Relays ........................................................................................................3-9
Basic unit .....................................................................................................3-9Expansion unit ...........................................................................................3-10
1.3.5 Output Relays ...................................................................................................3-10Output operation time ................................................................................3-10
1.3.6 Internal Utility Relays ........................................................................................3-11Retentive function of internal utility relays ..................................................3-11
1.3.7 Special Utility Relays ........................................................................................3-12Description .................................................................................................3-12
1.3.8 Special Utility Relay List ...................................................................................3-14Special relays and arithmetic operation flags ............................................3-14Special utility relays for high-speed counter(0) ..........................................3-14Special utility relays for high-speed counter(1) ..........................................3-15Other special utility relays ..........................................................................3-15
1.3.9 Timers and Counters ........................................................................................3-18Timer/Counter list .......................................................................................3-18Description .................................................................................................3-18
1.3.10 Data Memories .................................................................................................3-191.3.11 Temporary Data Memory ..................................................................................3-211.3.12 Relay Nos. and Functions .................................................................................3-22
1.4 Special Functions ..........................................................................................3-231.4.1 Input Time Constant Change Function .............................................................3-23
Setting the input time constant for basic units using special utility relays ..3-231.4.2 Modifying the Input Relay Time Constant .........................................................3-24
Modification within the CPU .......................................................................3-241.4.3 Constant Scan Time Mode ...............................................................................3-251.4.4 Output Disabled Function .................................................................................3-261.4.5 Input Refresh Disabled Function ......................................................................3-261.4.6 Contact Comment Save Function .....................................................................3-271.4.7 Special Functions .............................................................................................3-28
Constant Scan Time Mode ........................................................................3-28Output Disabled Function ..........................................................................3-28Input Refresh Disabled Function ................................................................3-28
1.5 Extended Ladder Diagrams ..........................................................................3-291.5.1 Features of Extended Ladder Diagrams ...........................................................3-291.5.2 Advantages of Extended Ladder Diagrams ......................................................3-301.5.3 Example of an Extended Ladder Diagram ........................................................3-31
(10)
Chapter 2 Instructions
2.1 Instruction List [Visual KV Series] ..............................................................3-342.1.1 Basic Instructions ..............................................................................................3-342.1.2 Application Instructions .....................................................................................3-362.1.3 Arithmetic Instructions ......................................................................................3-382.1.4 Interrupt Instructions .........................................................................................3-412.1.5 Function No. List (Alphabetical order) ..............................................................3-41
2.2 Instruction List [KV-300 Series, KV-10/80] .................................................3-422.2.1 Basic Instructions ..............................................................................................3-422.2.2 Application Instructions .....................................................................................3-452.2.3 Arithmetic Instructions ......................................................................................3-482.2.4 Interrupt Instructions .........................................................................................3-54
2.3 Convention Details ........................................................................................3-55
2.4 Instruction Details ..........................................................................................3-562.4.1 Basic Instructions ..............................................................................................3-562.4.2 Application Instructions .....................................................................................3-952.4.3 Arithmetic Instructions ....................................................................................3-134
2.5 Programming Notes .....................................................................................3-189
Chapter 3 Interrupts Visual KV
3.1 Interrupt Instructions ...................................................................................3-192
3.2 Interrupt Processing ....................................................................................3-1943.2.1 Interrupt Processing ........................................................................................3-1943.2.2 Types of Interrupts ..........................................................................................3-1953.2.3 Interrupt Priority ..............................................................................................3-1963.2.4 Interrupt Program............................................................................................3-196
3.3 Direct Input/Output ......................................................................................3-1973.3.1 Direct Input .....................................................................................................3-1973.3.2 Direct Output ...................................................................................................3-197
3.4 Applications of Interrupt Programs ...........................................................3-1983.4.1 Interrupt with a Signal Converter ....................................................................3-1983.4.2 Interrupt with a High-speed Counter ...............................................................3-1993.4.3 Measuring the ON Time of High-speed Pulses ..............................................3-2003.4.4 Measuring the Period in which a Target Passes between Two Points ........... 3-201
Chapter 4 High-speed Counters Visual KV
4.1 High-speed Counter Instructions ...............................................................3-204
4.2 Outline of High-speed Counters .................................................................3-2064.2.1 High-speed Counters and High-speed Counter Comparators ........................ 3-206
Structure of high-speed counters and high-speed counter comparators .3-206Specifications of high-speed counters .....................................................3-208High-speed counter comparators .............................................................3-209
4.2.2 Internal Clock for High-speed Counters ..........................................................3-210
4.3 Setting and Operation of High-speed Counters ........................................3-2114.3.1 Reading the Current Value of the High-speed Counter ..................................3-2114.3.2 Preset Value of the High-speed Counter Comparator .................................... 3-2114.3.3 Comparator Output .........................................................................................3-2114.3.4 Count Input Method ........................................................................................3-2124.3.5 Resetting the High-speed Counter .................................................................3-2144.3.6 Differences with the CTH Instruction between the
Conventional and Visual KV Series ................................................................3-2164.3.7 Applications of High-speed Counters .............................................................3-217
4.4 Extended Functions of High-speed Counters ........................................... 3-2214.4.1 24-bit High-speed Counter ..............................................................................3-2214.4.2 Changing the Current Value of a 24-bit High-speed Counter ......................... 3-2234.4.3 Application Example of 24-bit High-speed Counter (single-phase input) .......3-2244.4.4 Ring Counter Function ....................................................................................3-2254.4.5 Applications of Ring Counters ........................................................................3-226
4.5 Special Functions Using High-speed Counters ........................................3-228
(11)
4.5.1 Specified Frequency Pulse Output Function ..................................................3-2284.5.2 Applications of the Specified Frequency Pulse Output ...................................3-2294.5.3 Frequency Counter Function ..........................................................................3-2314.5.4 Applications of Frequency Counters ...............................................................3-2324.5.5 Cam Switch Function ......................................................................................3-233
Cam switch mode ....................................................................................3-233Multi-step comparator mode ....................................................................3-234Setting method .........................................................................................3-234
4.5.6 Application of the Cam Switch (Cam Switch Mode) .......................................3-236
4.6 Direct Clock Pulse Output ...........................................................................3-2374.6.1 Outline of Direct Clock Pulse Output ..............................................................3-2374.6.2 Pulse Output Setting with the High-speed Counter Comparator ....................3-238
Changing the pulse period and width .......................................................3-238Calculating the pulse period and comparator preset value ......................3-239Operation with special utility relays ..........................................................3-239
4.7 Examples of Direct Clock Pulse Output ....................................................3-2424.7.1 Example of Outputting a Pulse with 1:1 ON/OFF Ratio ..................................3-2424.7.2 Example of Outputting a Pulse with Variable ON/OFF Ratio ..........................3-2454.7.3 Example of Stopping the Pulse Output at a Specified Pulse Count ...............3-2494.7.4 Application of Direct Clock Pulse Output (Ramp-up/down control) ................3-251
Chapter 5 Positioning Control Visual KV
5.1 Outline of Positioning Control ....................................................................3-2545.1.1 Ramp-up/down Control ...................................................................................3-254
5.2 Parameter Setting and Operating Procedures ..........................................3-2555.2.1 Parameter Setting Procedure .........................................................................3-2555.2.2 Operating Procedure ......................................................................................3-257
5.3 Examples of Using the Positioning Control Function ..............................3-2585.3.1 Connection Example .......................................................................................3-2585.3.2 Tips .................................................................................................................3-2585.3.3 Application Examples of the Positioning Control Function .............................3-259
Chapter 6 Interrupts, High-speed Counters,Positioning Control KV-300, KV-10/80
6.1 Interrupt Instructions ...................................................................................3-2686.1.1 Description of Interrupts ..................................................................................3-268
Input processing for routine program and interrupt routine ......................3-268Types of interrupt .....................................................................................3-268Interrupt priority ........................................................................................3-269Interrupt routine ........................................................................................3-269Direct output .............................................................................................3-270Direct input ...............................................................................................3-270
6.1.2 Interrupt Instructions .......................................................................................3-271
6.2 Direct Clock Pulse ........................................................................................3-2766.2.1 Output of Direct Clock Pulse ...........................................................................3-276
Outline of High-Speed Counters ..............................................................3-276Outline of Pulse Output ............................................................................3-279Examples of Pulse Output .......................................................................3-284
6.3 Positioning Control ......................................................................................3-2966.3.1 Positioning Control (Ramp-up/down Control) .................................................3-296
Outline of positioning control ....................................................................3-296Setting and application of parameters .....................................................3-297Examples of stepping motor control .........................................................3-300
Chapter 7 Serial Communication
7.1 Communications Specifications ................................................................3-3067.1.1 Communications Specification ........................................................................3-3067.1.2 Connection with the KV Unit ...........................................................................3-3067.1.3 Connecting the KV-300 CPU to a Personal Computer ...................................3-307
7.2 Serial Communication .................................................................................3-3087.2.1 Command Transmission Procedure ...............................................................3-308
(12)
7.2.2 Format of Commands/Responses ..................................................................3-3097.2.3 Communication Command/Response List .....................................................3-3107.2.4 Setting Communication Commands and Responses to Commands ..............3-3117.2.5 Other Response Codes ..................................................................................3-3157.2.6 Error Code List ................................................................................................3-3167.2.7 Example Program ...........................................................................................3-317
7.3 Loading Text Data ........................................................................................3-3187.3.1 Receiving Text Data .......................................................................................3-3187.3.2 Transmitting Text Data ...................................................................................3-3197.3.3 Sample Program .............................................................................................3-320
7.4 ASCII Code List ............................................................................................3-321
Chapter 8 Programming Examples
8.1 List .........................................................................................................3-324
8.2 Details .........................................................................................................3-3268.2.1 Reference Program Examples ........................................................................3-326
Basic Instructions .....................................................................................3-326Application Instructions ............................................................................3-334Arithmetic Instructions ..............................................................................3-343
WARRANTIES AND DISCLAIMERS 3-367
1 Installation
Chapter 1 Configuration and Specifications Visual KV
1.1 System Configuration ......................................................................................1-21.1.1 System Configuration .........................................................................................1-2
1.2 Specifications ...................................................................................................1-41.2.1 General Specifications ........................................................................................1-41.2.2 AC Power Specifications ....................................................................................1-5
Visual KV Series operation at power interruption ........................................1-51.2.3 Performance Specifications ................................................................................1-6
Data backup function against instantaneous power interruption .................1-7
1.3 Common I/O Specifications of Basic Units ...................................................1-81.3.1 Model of a Basic Unit ..........................................................................................1-81.3.2 Common I/O Specifications ................................................................................1-8
1.4 KV-10AR/AT(P)/DR/DT(P) (10-I/O Basic Unit) .............................................1-101.4.1 Part Names and Functions ...............................................................................1-101.4.2 Terminal Layout Drawings and I/O Circuit Diagrams ........................................1-11
KV-10AR/DR (Relay output type) ..............................................................1-11KV-10AT(P)/DT(P) (Transistor output type) ...............................................1-13
1.4.3 AC Power Input (KV-10AR/AT(P)) ....................................................................1-141.4.4 Relationship between Continuous Simultaneous ON Ratio and Ambient Temperature 1-151.4.5 Dimensions .......................................................................................................1-16
1.5 KV-16AR/AT(P)/DR/DT(P) (16-I/O Basic Unit) .............................................1-171.5.1 Part Names and Functions ...............................................................................1-171.5.2 Terminal Layout Drawings and I/O Circuit Diagrams ........................................1-18
KV-16AR/DR (Relay output type) ..............................................................1-18KV-16AT(P)/DT(P) (Transistor output type) ...............................................1-20
1.5.3 AC Power Input (KV-16AR/AT(P)) ....................................................................1-211.5.4 Relationship between Continuous Simultaneous ON Ratio and Ambient Temperature 1-221.5.5 Dimensions .......................................................................................................1-23
1.6 KV-24AR/AT(P)/DR/DT(P) (24-I/O Basic Unit) .............................................1-241.6.1 Part Names and Functions ...............................................................................1-241.6.2 Terminal Layout Drawings and I/O Circuit Diagrams ........................................1-25
KV-24AR/DR (Relay output type) ..............................................................1-25KV-24AT(P)/DT(P) (Transistor output type) ...............................................1-27
1.6.3 AC Power Input (KV-24AR/AT(P)) ....................................................................1-281.6.4 Relationship between Continuous Simultaneous ON Ratio and Ambient Temperature 1-291.6.5 Dimensions .......................................................................................................1-30
1.7 KV-40AR/AT(P)/DR/DT(P) (40-I/O Basic Unit) ..............................................1-31
(13)
1.7.1 Part Names and Functions ...............................................................................1-311.7.2 Terminal Layout Drawings and I/O Circuit Diagrams ........................................1-32
KV-40AR/DR (Relay output type) ..............................................................1-32KV-40AT(P)/DT(P) (Transistor output type) ...............................................1-34
1.7.3 AC Power Input (KV-40AR/AT(P)) ....................................................................1-351.7.4 Relationship between Continuous Simultaneous ON Ratio and Ambient Temperature 1-361.7.5 Dimensions .......................................................................................................1-37
1.8 KV-E4X/E8X/E16X (Expansion Input Unit) ..................................................1-381.8.1 Part Names and Functions ...............................................................................1-381.8.2 Input Specifications ...........................................................................................1-381.8.3 Terminal Layout Drawings and Input Circuit Diagrams .................................... 1-39
KV-E4X (4-I/O expansion input unit) ..........................................................1-39KV-E8X (8-I/O expansion input unit) ..........................................................1-40KV-E16X (16-I/O expansion input unit) ......................................................1-41
1.8.4 Dimensions .......................................................................................................1-42
1.9 KV-E4R/E4T/E8R/E8T(P)/E16R/E16T(P) (Expansion Output Unit) .............1-431.9.1 Part Names and Functions ...............................................................................1-431.9.2 Output Specifications ........................................................................................1-43
KV-E4R/E8R/E16R (Relay output type) .....................................................1-44KV-E4T/E8T(P)/E16T(P) [Transistor output type (NPN/PNP)] ..................1-44
1.9.3 Terminal Layout Drawings and Input Circuit Diagrams .................................... 1-45KV-E4R [4-I/O expansion output unit (relay output type)] ..........................1-45KV-E4T [4-I/O expansion output unit transistor output type)] ....................1-46KV-E8R [8-I/O expansion output unit (relay output type)] ..........................1-47KV-E8T(P) [8-I/O expansion output unit (transistor output type)] ..............1-48KV-E16R [16-I/O expansion output unit (relay output type)] ......................1-49KV-E16T(P) [16-I/O expansion input unit (transistor output)] ....................1-50
1.9.4 Dimensions .......................................................................................................1-51
1.10 KV-E4XR/E4XT(P) (Expansion I/O Unit) .......................................................1-521.10.1 Part Names and Functions ...............................................................................1-521.10.2 Input Specifications ...........................................................................................1-531.10.3 Output Specifications ........................................................................................1-53
KV-E4XR (Relay output type) ....................................................................1-53KV-E4XT(P) (Transistor output type) .........................................................1-53
1.10.4 Terminal Layout Drawings and Input Circuit Diagrams .................................... 1-54KV-E4XR (Relay output type) ....................................................................1-54KV-E4XT(P) (Transistor output type) .........................................................1-56
1.10.5 Dimensions .......................................................................................................1-58
1.11 KV-D20 (Operator Interface Panel) ...............................................................1-591.11.1 Part Names and Functions ...............................................................................1-591.11.2 General Specifications ......................................................................................1-601.11.3 Functional Specifications ..................................................................................1-601.11.4 Dimensions .......................................................................................................1-61
Chapter 2 System Installation Visual KV
2.1 Installation Environment ...............................................................................1-642.1.1 Installation Environment ...................................................................................1-642.1.2 Installation Position ...........................................................................................1-652.1.3 Installation Procedure .......................................................................................1-66
Expansion unit spacer ................................................................................1-662.1.4 Cautions on Wiring for Each Unit ......................................................................1-67
Wiring procedures for basic units ...............................................................1-67Cautions on wiring for I/O units ..................................................................1-68Terminal .....................................................................................................1-68Cautions on grounding ...............................................................................1-69
2.1.5 Contact Protection ............................................................................................1-69
2.2 Connecting Visual KV Series Expansion Units ..........................................1-702.2.1 Visual KV Series Expansion Units ....................................................................1-702.2.2 Connecting Visual KV Series Expansion Units .................................................1-71
Connection methods ..................................................................................1-72Number of connectable units .....................................................................1-73
2.2.3 Confirming the Connection Settings of Expansion Units ..................................1-74Expansion unit relay list .............................................................................1-74Connection information for expansion units ...............................................1-75Input time constant for expansion units .....................................................1-76
(14)
Clearing the input value when disconnecting .............................................1-762.2.4 Transferring I/O Information between Expansion Units and the Basic Unit ......1-77
When inputting ...........................................................................................1-77In the case of output ..................................................................................1-77
2.3 Inspection and Maintenance .........................................................................1-782.3.1 Inspection .........................................................................................................1-782.3.2 Maintenance .....................................................................................................1-78
Chapter 3 Access Window Visual KV
3.1 Overview of the Access Window ..................................................................1-803.1.1 What is the Access Window .............................................................................1-803.1.2 Access Window Use Examples ........................................................................1-80
3.2 Basic Operating Procedures .........................................................................1-813.2.1 Operation Mode ................................................................................................1-813.2.2 Access Window Modes .....................................................................................1-813.2.3 Part Names and Functions of the Access Window ...........................................1-823.2.4 Selecting Modes and Setting/Resetting Key Lock ............................................1-823.2.5 Turbo Function ..................................................................................................1-83
3.3 Digital Trimmer Mode ....................................................................................1-843.3.1 Function and Operating Procedure ...................................................................1-84
Key operation and screen display ..............................................................1-84Function and operating procedure .............................................................1-84
3.4 Device Mode ...................................................................................................1-873.4.1 Function and Operating Procedure ...................................................................1-87
Devices that can be displayed and changed .............................................1-87Key operation and screen display ..............................................................1-87Selecting the device and displaying the current value/set value ................1-88Changing a numeric value .........................................................................1-89Holding the setting .....................................................................................1-91
3.4.2 Screen Display for Each Device Type ..............................................................1-91Data memory (DM) ....................................................................................1-91Temporary data memory (TM) ...................................................................1-91Timer/counter (T/C) ....................................................................................1-92High-speed counter comparator (CTC) ......................................................1-92Trimmer (TRM) ..........................................................................................1-93Relay (RLY) ...............................................................................................1-93
3.5 System Mode ..................................................................................................1-943.5.1 Function and Operating Procedure ...................................................................1-94
Key operation and screen display ..............................................................1-94LOAD mode and SAVE mode ....................................................................1-96Display in LOAD/SAVE mode ....................................................................1-96
3.6 Message Display ............................................................................................1-973.6.1 Error Messages and Error Status .....................................................................1-973.6.2 User Messages .................................................................................................1-97
How to use the user messages ..................................................................1-98
Chapter 4 KV-D20 Operator Interface Panel Visual KV
4.1 Before Operation ..........................................................................................1-1004.1.1 Checking Package Contents ..........................................................................1-1004.1.2 Part Names and Functions .............................................................................1-1014.1.3 Details about the KV-D20 ...............................................................................1-102
General specifications ..............................................................................1-102Functional specifications ..........................................................................1-102Dimensions ..............................................................................................1-103
4.1.4 Installation and Environment ..........................................................................1-104Use environment ......................................................................................1-104Panel mounting ........................................................................................1-105
4.1.5 Inspection and Maintenance ...........................................................................1-106Inspection .................................................................................................1-106Maintenance ............................................................................................1-106
4.2 Overview and Operation ..............................................................................1-1074.2.1 Use Examples for the KV-D20 ........................................................................1-107
(15)
4.2.2 Connection with the KV Series .......................................................................1-108Connection ...............................................................................................1-108Precautions ..............................................................................................1-108
4.2.3 Overview of the KV-D20 .................................................................................1-109Switching the display mode .....................................................................1-109Overview of each display mode ...............................................................1-110Assignment of relays/DM .........................................................................1-111Other functions .........................................................................................1-112Precautions about screen change function ..............................................1-115
4.2.4 Operator Mode ................................................................................................1-117Screen selection in operator mode ..........................................................1-117Operator screen .......................................................................................1-118Direct access screen ................................................................................1-126KV-I/O monitor screen .............................................................................1-127Switch comment screen ...........................................................................1-128Lamp comment screen ............................................................................1-128Screen change permission in operator mode ..........................................1-129
4.2.5 Device Mode ...................................................................................................1-130Device mode ............................................................................................1-130Operation example for device mode ........................................................1-132
4.2.6 System Mode ..................................................................................................1-134System mode ...........................................................................................1-134
4.3 Examples of Ladder Programs ...................................................................1-1354.3.1 Basic Ladder Programs ..................................................................................1-135
Before creating ladder programs .............................................................1-135Basic ladder programs .............................................................................1-136
4.3.2 Examples of Ladder Programs .......................................................................1-143Example of displaying user messages .....................................................1-143Example of displaying messages with titles .............................................1-145Example of position control ......................................................................1-146Example of frequency counter .................................................................1-149Example of 24-bit high-speed counter .....................................................1-152Example of cam switch function ...............................................................1-154
4.4 Appendix .......................................................................................................1-1584.4.1 Troubleshooting ..............................................................................................1-1584.4.2 Available Character List ..................................................................................1-1624.4.3 Comment Draft Sheet .....................................................................................1-163
Chapter 5 KV-300, KV-10/80 Hardware KV-300, KV-10/80
5.1 System Configuration ..................................................................................1-1665.1.1 KV-300 ............................................................................................................1-1665.1.2 KV-10/80 .........................................................................................................1-167
5.2 Module/Unit Specifications .........................................................................1-1685.2.1 Wiring: KV-U4 Power Supply Module .............................................................1-168
Parts and functions ..................................................................................1-1685.2.2 Wiring: KV-U5 DC Power Distribution Module ................................................1-169
Parts and functions ..................................................................................1-1695.2.3 Wiring: KV-300 CPU .......................................................................................1-170
Parts and functions ..................................................................................1-1705.2.4 Wiring: KV-C16X/C32X Connector Input Module ...........................................1-171
Parts and functions ..................................................................................1-1715.2.5 Wiring: KV-C32T/B16R/B16S Connector Output Module ...............................1-172
Parts and functions ..................................................................................1-1725.2.6 Wiring: KV-R1A I/O Distribution Module .........................................................1-173
Parts and functions ..................................................................................1-1735.2.7 Wiring: KV-R8X/R16X/R8R/R16R/R8T/R16T I/O Terminal Modules .............1-174
Parts and functions ..................................................................................1-1745.2.8 Module Names and Functions ........................................................................1-1755.2.9 Peripheral Equipment Names and Functions .................................................1-176
5.3 Module/Unit Connections ............................................................................1-1785.3.1 Environmental Requirements .........................................................................1-1785.3.2 Installation Guidelines .....................................................................................1-1785.3.3 Assembling the System ..................................................................................1-179
Connecting modules ................................................................................1-1795.3.4 Mounting to the DIN Rail .................................................................................1-1805.3.5 Removing the Terminal Block .........................................................................1-181
(16)
5.3.6 Connecting the AC Power Supply Module and DC Power Distribution Module .... 1-182KV-U4 AC Power Supply Module ............................................................1-182KV-U5 DC Power Distribution Module .....................................................1-182
5.3.7 I/O Connectors ................................................................................................1-183KV-300 CPU ............................................................................................1-183KV-C16X/C32X ........................................................................................1-184KV-C32T/B16R/B16S ..............................................................................1-185KV-R8X/R16X/R8R/R16R/R8T/R16T ......................................................1-186
5.3.8 I/O Terminal Modules: Communication Cables and Power Distribution .........1-187Transmission distance by cable type .......................................................1-187Connection patterns .................................................................................1-187Incorrect wiring patterns ...........................................................................1-188Power distribution ....................................................................................1-188
5.3.9 Connector Assembly Instructions ...................................................................1-1895.3.10 KV-300 CPU I/O Indicators .............................................................................1-1915.3.11 KV-10/80 Expansion Units ..............................................................................1-1925.3.12 Mounting Environment ....................................................................................1-194
Chapter 6 Handheld Programmer
6.1 Using the Handheld Programmer ...............................................................1-1966.1.1 Outline of the Handheld Programmer .............................................................1-1966.1.2 Precautions .....................................................................................................1-198
6.2 Basic Operations .........................................................................................1-2006.2.1 Basic Programming Operation ........................................................................1-200
6.3 Functions ......................................................................................................1-216Function Nos. list .....................................................................................1-216ALL CLEAR ..............................................................................................1-217HANDHELD PROGRAMMER CLEAR .....................................................1-217COUNTER CLEAR ..................................................................................1-218HIGH-SPEED COUNTER CLEAR ...........................................................1-218ALL DATA MEMORY CLEAR ..................................................................1-219ALL LATCHING RELAYS RESET ...........................................................1-219PROGRAM SENT OR RECEIVED ..........................................................1-220OFFLINE EDITOR START ......................................................................1-221OFFLINE EDITOR STOP ........................................................................1-221TIMER/COUNTER CURRENT VALUE CHANGE ...................................1-222TIMER/COUNTER SETTING CHANGE .................................................. 1-224RELAY ON/OFF .......................................................................................1-226WRITE INTO DATA MEMORY ................................................................1-227READ TRIMMER SETTING .....................................................................1-228SYNTAX CHECK .....................................................................................1-228PROGRAM CAPACITY CHECK ..............................................................1-229
6.4 Memory Card ................................................................................................1-2306.4.1 Functions [used with KV-P3E(01)] ..................................................................1-2306.4.2 Storage Capacity ............................................................................................1-230
CLEAR .....................................................................................................1-232NEW .........................................................................................................1-233ACCS .......................................................................................................1-234ACCS: SAVE ...........................................................................................1-235ACCS: LOAD ...........................................................................................1-236ACCS: VERIFY ........................................................................................1-236ACCS: DELETE .......................................................................................1-237
Chapter 7 KV-L2 Serial Interface Module KV-300
7.1 Outline .........................................................................................................1-2407.1.1 Features ..........................................................................................................1-240
7.2 Configuration ...............................................................................................1-2417.2.1 Parts and Functions ........................................................................................1-2417.2.2 System Configuration .....................................................................................1-2427.2.3 Outline of Operation Modes ............................................................................1-244
7.3 Installation ....................................................................................................1-2457.3.1 Setting the Operation Mode ............................................................................1-2457.3.2 Communications Protocols .............................................................................1-2477.3.3 Connector Wiring ............................................................................................1-248
(17)
7.3.4 Connecting to External Units ..........................................................................1-249Connecting to An External Display ..........................................................1-249Connecting to an IBM PC-AT Computer ..................................................1-249Connecting to the KV-10/16/24/40/80 ......................................................1-250Connecting KV-L2s ..................................................................................1-250
7.4 Software Setup .............................................................................................1-2527.4.1 Using KV Software [KV IncrediWare (DOS)] ..................................................1-252Starting KV IncrediWare (DOS) from the KV-L2 ........................................................1-252
7.5 KV Mode Programming ...............................................................................1-2537.5.1 Operating in KV Mode ....................................................................................1-253
Communications protocol ........................................................................1-2537.5.2 Serial Communications Procedure .................................................................1-255
Command transmission procedure ..........................................................1-255Command/response format .....................................................................1-256Communications commands and responses ...........................................1-256Communications commands ....................................................................1-257
7.5.3 Transmission and Reception of Text Data ......................................................1-262Assigning relay nos. and data memory address nos. ..............................1-262Transmitting Text Data .............................................................................1-264Receiving text data ..................................................................................1-265ASCII code/binary conversion function ....................................................1-266Example program .....................................................................................1-269
7.6 Display Interface Mode Programming .......................................................1-2707.6.1 Operating in Display Interface Mode ..............................................................1-270
Communications protocols .......................................................................1-270Communications control procedure .........................................................1-271
7.6.2 Command and Response Format ...................................................................1-2737.6.3 Commands and Responses ...........................................................................1-275
List of commands and responses ............................................................1-275Description of commands and responses ................................................1-277End codes ................................................................................................1-291
7.7 Non-procedure Mode Programming ..........................................................1-2927.7.1 Operating in Non-procedure Mode .................................................................1-292
Communications protocol ........................................................................1-292Connecting to the KV-L2 ..........................................................................1-293
7.7.2 Assignment of Relay Nos. and Data Memory Address Nos. ..........................1-294Assigning relay nos. and data memory address nos. ..............................1-294
7.7.3 Transmitting Text Data ...................................................................................1-297Data transmission and internal data memory addresses .........................1-297
7.7.4 Receiving Text Data .......................................................................................1-298Format of received data and data memory addresses ............................1-298
7.7.5 ASCII code/Binary Conversion Function ........................................................1-300
7.8 Troubleshooting Guide ...............................................................................1-3047.8.1 Troubleshooting ..............................................................................................1-3047.8.2 Precautions .....................................................................................................1-305
7.9 Specifications ...............................................................................................1-3067.9.1 Specifications ..................................................................................................1-306
General specifications ..............................................................................1-306Communications protocol ........................................................................1-306RS-232C connector specifications ...........................................................1-306RS-422A terminal block specifications .....................................................1-306
7.9.2 Dimensions .....................................................................................................1-307
7.10 Command List ..............................................................................................1-3087.10.1 List of Commands and Responses .................................................................1-3087.10.2 List of Commands and Responses in Display Interface mode .......................1-309
Chapter 8 KV-AN6 Analog I/O Module KV-300
8.1 Outline .........................................................................................................1-312Features ...................................................................................................1-312
8.2 Configuration ...............................................................................................1-3138.2.1 Parts and Functions ........................................................................................1-3138.2.2 System Configuration .....................................................................................1-314
8.3 Installation ....................................................................................................1-3158.3.1 Terminal Nos. .................................................................................................1-315
(18)
8.3.2 Removing the Terminal Block .........................................................................1-3168.3.3 Example of Voltage I/O Wiring ........................................................................1-3178.3.4 Example of Current I/O Wiring ........................................................................1-3188.3.5 Setting I/O Ranges .........................................................................................1-319
8.4 Programming ................................................................................................1-3208.4.1 Input Characteristics (A/D) ..............................................................................1-3208.4.2 Calculating Input Data (A/D) ...........................................................................1-3218.4.3 Output Characteristics (D/A) ...........................................................................1-3228.4.4 Calculating Output Data (D/A) ........................................................................1-3238.4.5 Assigning Data Memory (DM) Addresses .......................................................1-3248.4.6 Reading Analog Input .....................................................................................1-3258.4.7 Measuring Analog Input Average ...................................................................1-3268.4.8 Writing Analog Output .....................................................................................1-3278.4.9 Converting Analog Input to Analog Output .....................................................1-328
8.5 KV-AN6 Appendices ....................................................................................1-3298.5.1 Troubleshooting ..............................................................................................1-3298.5.2 Precautions .....................................................................................................1-3308.5.3 Specifications ..................................................................................................1-331
Environmental specifications ...................................................................1-331System specifications ..............................................................................1-331
8.5.4 Dimensions .....................................................................................................1-332
Chapter 9 KV-AD4/DA4 Analog I/O Unit KV-10/80
9.1 Outline .........................................................................................................1-334Features ...................................................................................................1-334
9.2 Configuration ...............................................................................................1-3359.2.1 Part Names and Functions .............................................................................1-335
KV-AD4 ....................................................................................................1-335KV-DA4 ....................................................................................................1-336
9.2.2 Specifications ..................................................................................................1-337KV-AD4 ....................................................................................................1-337KV-DA4 ....................................................................................................1-339
9.2.3 System Configuration .....................................................................................1-341
9.3 Installation ....................................................................................................1-3429.3.1 Installation Procedure .....................................................................................1-3429.3.2 Checking the Installation Environment ...........................................................1-3439.3.3 Setting the KV-AD4 Input Mode ......................................................................1-344
Setting the input mode .............................................................................1-3449.3.4 Connecting External Instruments ....................................................................1-345
Wiring .......................................................................................................1-345Wiring diagrams .......................................................................................1-346
9.3.5 Connecting to the KV-10 to 80 ........................................................................1-3489.3.6 Maintenance ...................................................................................................1-349
Inspection and Cleaning ..........................................................................1-349
9.4 Programming ................................................................................................1-3509.4.1 Programming the KV-AD4 ..............................................................................1-350
A/D Conversion Mechanism ....................................................................1-350About Digital Data after A/D Conversion .................................................. 1-351Calculating Voltage and Current Values from Digital Data ......................1-352
9.4.2 Programming the KV-DA4 ..............................................................................1-353D/A Conversion Mechanism ....................................................................1-353Converting Digital Data to Voltage or Current Values to be Output .........1-354Writing Digital Data to Data Memory for D/A Conversion ........................ 1-356
9.4.3 A/D and D/A Conversion Tables .....................................................................1-357Voltage Conversion Table ........................................................................1-357Current Conversion Table ........................................................................1-358
9.5 Programming Examples ..............................................................................1-359Calculating Analog Data Values from Digital Data ...................................1-359Writing Data to be Analog-output .............................................................1-361Outputting Analog Trimmer Values ..........................................................1-364Outputting Analog Input Data ...................................................................1-365Outputting Analog Input from a Pressure Sensor to an Air Valve ............ 1-366Setting the Minimum and Maximum Voltage Limits and Measuring theAverage Voltage ......................................................................................1-367
9.6 Troubleshooting ...........................................................................................1-370
(19)
Chapter 10 Troubleshooting
10.1 Error List .......................................................................................................1-37210.1.1 List of Error Codes in Basic Units ...................................................................1-37210.1.2 Error indication in Expansion Units .................................................................1-37410.1.3 Program Errors ...............................................................................................1-37510.1.4 Memory Card Errors and Other Errors ...........................................................1-376
10.2 Replacing Relays .........................................................................................1-377Replacement procedure ...........................................................................1-377
10.3 Troubleshooting ...........................................................................................1-37810.3.1 Troubleshooting List .......................................................................................1-378
10.4 Error Messages ............................................................................................1-380
Appendices
Appendix A. Specifications and Dimensions [Visual KV Series] ....................1-382A.1 System Specifications [Visual KV Series] .......................................................1-382
Hardware .................................................................................................1-382Software and Programming .....................................................................1-383AC power supply unit ...............................................................................1-384
A.2 Common I/O Specifications of Basic Units .....................................................1-384Input specifications ..................................................................................1-384Output specifications (relay output): KV-10AR/DR, KV-16AR/DR,KV-24AR/DR, and KV-40AR/DR ..............................................................1-385Output specifications (transistor output): KV-10AT(P)/DT(P),KV-16AT(P)/DT(P), KV-24AT(P)/DT(P), and KV-40AT(P)/DT(P) ............1-385
A.3 Expansion Unit Specifications ........................................................................1-385A.4 Dimensions .....................................................................................................1-389
Appendix B. Specifications and Dimensions [KV-300 Series] .........................1-392B.1 System Specifications [KV-300 Series] ..........................................................1-392
Hardware .................................................................................................1-392Software and Programming .....................................................................1-393AC Power supply module/DC power distribution module ........................1-394
B.2 Module Specifications .....................................................................................1-398KV-300 CPU ............................................................................................1-398KV-C16X/C32X Input Modules ................................................................1-399KV-C32T/B16R/B16S Output Modules ...................................................1-400KV-R8X/R16X I/O Terminal Modules .......................................................1-401KV-R8T/R16T/R8R/R16R I/O Terminal Modules .....................................1-402KV-R8T/R16T/R8R/R16R I/O Terminal Modules (RUN Output) ..............1-403KV-R1A I/O Distribution Module ..............................................................1-403
B.3 Dimensions .....................................................................................................1-404
Appendix C. Ladder Program List ......................................................................1-406
Appendix D. A/D and D/A Conversion Tables [KV-AN6] .....................................1-408Voltage conversion table ..........................................................................1-408Current conversion table ..........................................................................1-409
WARRANTIES AND DISCLAIMERS 1-419
2 Support software
Chapter 1 Introduction
1.1 Items Included in the Package ........................................................................2-2
1.2 Outline of the Ladder Builder for KV ..............................................................2-31.2.1 Operating environment and system configuration ..............................................2-31.2.2 Features and functions of the Ladder Builder for KV ..........................................2-4
Features of the Ladder Builder for KV .........................................................2-4Functions of the Ladder Builder for KV ........................................................ 2-6
1.3 Before Programming .......................................................................................2-7Machines to be prepared .............................................................................2-7
1.3.1 Differences from the KV IncrediWare (DOS) ......................................................2-81.3.2 Differences from the Ladder Builder for KV Ver 1.0 ........................................... 2-8
1.4 Installing the Software .....................................................................................2-9
(20)
1.4.1 Preparation for installation ..................................................................................2-91.4.2 Installation Procedure .......................................................................................2-10
Installation in Windows 95 .........................................................................2-10Installation in Windows 3.1 ........................................................................2-12
1.5 Cautions for Use ............................................................................................2-13
1.6 Basic Operations ...........................................................................................2-141.6.1 Program creation flow and available modes .....................................................2-141.6.2 Starting up and exiting from the software .........................................................2-161.6.3 Screen ..............................................................................................................2-181.6.4 Mouse operation and keyboard operation ........................................................2-211.6.5 Online Help .......................................................................................................2-23
Chapter 2 Editor KV-300
2.1 Outline of the Editor Functions ....................................................................2-262.1.1 Cautions for editing ladder programs ................................................................2-26
2.2 Edit Screen .....................................................................................................2-272.2.1 Name and function of each part of the screen ..................................................2-272.2.2 Ladder program window screen .......................................................................2-28
2.3 File Management ............................................................................................2-292.3.1 Creating a new file ............................................................................................2-292.3.2 Setting the automatic file read function .............................................................2-302.3.3 Setting automatic file save for the file ...............................................................2-312.3.4 Saving and reading files ...................................................................................2-322.3.5 Reading and saving a file in another format .....................................................2-332.3.6 Saving a ladder diagram in text format .............................................................2-362.3.7 Verifying files ....................................................................................................2-36
2.4 Entering/Deleting Symbols and Connection Lines ....................................2-372.4.1 Entering symbols ..............................................................................................2-372.4.2 Deleting symbols ..............................................................................................2-422.4.3 Entering contacts/coils directly .........................................................................2-422.4.4 Changing the device at the current cursor position ..........................................2-432.4.5 Entering/Deleting connection lines ...................................................................2-442.4.6 Canceling edit operations .................................................................................2-45
2.5 Entering Comments/Labels .........................................................................2-462.5.1 Editing comments/labels ...................................................................................2-462.5.2 Editing line comments .......................................................................................2-502.5.3 Changing ladder lines into comments ...............................................................2-51
2.6 Edit and Arrangement ..................................................................................2-522.6.1 Copy, move, and delete ....................................................................................2-522.6.2 Inserting and deleting lines ...............................................................................2-57
2.7 Jump, Search, and Replace .........................................................................2-582.7.1 Jump .................................................................................................................2-582.7.2 Searching for instruction words/operands ........................................................2-622.7.3 Searching for the device at the cursor position .................................................2-632.7.4 Replacing operands ..........................................................................................2-642.7.5 Converting a/b contacts ....................................................................................2-65
2.8 Editing the Mnemonic List ...........................................................................2-672.8.1 Displaying and terminating a mnemonic list .....................................................2-672.8.2 Copy, move, and delete ....................................................................................2-69
2.9 Displaying the Use Status .............................................................................2-702.9.1 Displaying a use status list ...............................................................................2-70
2.10 Setting the System .........................................................................................2-712.10.1 Setting the system ............................................................................................2-71
2.11 Entering and Developing Macros ................................................................2-722.11.1 Creating a macro file .........................................................................................2-722.11.2 Entering and developing macros ......................................................................2-74
2.12 Compilation ....................................................................................................2-752.12.1 Executing compilation .......................................................................................2-752.12.2 Error display ......................................................................................................2-762.12.3 Double coil check ..............................................................................................2-76
2.13 Printing Functions .........................................................................................2-77
2.13.1 Printing ..............................................................................................................2-772.13.2 Preview display .................................................................................................2-81
2.14 Changing the Display Color on the Screen .................................................2-822.14.1 Changing display colors on the screen .............................................................2-82
Chapter 3 Simulator
3.1 Outline of the Simulator Functions ..............................................................2-843.1.1 Outline of the functions .....................................................................................2-843.1.2 Restrictions in the simulator ..............................................................................2-84
3.2 Starting up and Exiting from the Simulator .................................................2-863.2.1 Operating procedure for startup and exit ..........................................................2-863.2.2 Name and function of each part of the screen ..................................................2-88
3.3 Ladder Monitor ...............................................................................................2-893.3.1 Outline of the ladder monitor ............................................................................2-893.3.2 Executing scans ................................................................................................2-893.3.3 Executing steps ..............................................................................................2-1013.3.4 Jump and search ............................................................................................2-1053.3.5 Stop/reset and device all clear ........................................................................2-108
3.4 Monitor All ....................................................................................................2-1093.4.1 Outline of monitor all .......................................................................................2-1093.4.2 Displaying, saving, and reading the monitor all window .................................2-1093.4.3 Monitor all window ..........................................................................................2-1133.4.4 Registering devices ........................................................................................2-1133.4.5 Selecting and changing devices .....................................................................2-116
3.5 Registration Monitor ....................................................................................2-1193.5.1 Outline of the registration monitor ...................................................................2-1193.5.2 Displaying, saving, and reading the registration monitor ................................2-1193.5.3 Registration monitor window...........................................................................2-1223.5.4 Registering devices ........................................................................................2-1223.5.5 Selecting and changing devices .....................................................................2-1233.5.6 Manipulating timing charts ..............................................................................2-1283.5.7 Printing out the registration monitor ................................................................2-131
Chapter 4 Monitor
4.1 Outline of the Monitor Functions ...............................................................2-1344.1.1 Outline of the functions ...................................................................................2-1344.1.2 Restrictions in the monitor ..............................................................................2-1344.1.3 Precautions for communication ......................................................................2-135
4.2 Communicating with the PLC .....................................................................2-1364.2.1 Setting the PLC communication parameters ..................................................2-1364.2.2 Setting the comment transfer ..........................................................................2-138
4.3 Starting up and Exiting from the Monitor ..................................................2-1394.3.1 Operating procedures for startup and exit ......................................................2-1394.3.2 Name and function of each part of the screen ................................................2-143
4.4 Ladder Monitor .............................................................................................2-1444.4.1 Outline of the ladder monitor ..........................................................................2-1444.4.2 Displaying the ladder monitor window ............................................................2-1444.4.3 PLC error check ..............................................................................................2-1444.4.4 Starting the monitor ........................................................................................2-1454.4.5 Stopping the monitor .......................................................................................2-1454.4.6 Screen displayed while the monitor is running ...............................................2-1464.4.7 Setting the PLC operation mode .....................................................................2-147
4.5 Monitor All and Registration Monitor .........................................................2-1484.5.1 Functions of the monitor all window................................................................2-1484.5.2 Functions of the registration monitor ..............................................................2-148
4.6 Monitor Function ..........................................................................................2-1494.6.1 Disabling the input refresh/Disabling the output .............................................2-1494.6.2 Changing the current values all at once .........................................................2-1504.6.3 Device all clear ...............................................................................................2-154
(21)
Appendices
Appendix A Error Message List .........................................................................2-156A-1 System errors .................................................................................................2-156A-2 Memory errors ................................................................................................2-156A-3 File errors ........................................................................................................2-157A-4 Installation errors ............................................................................................2-157A-5 Errors that occur in the editor .........................................................................2-158A-6 Errors that occur in the monitor/simulator .......................................................2-159A-7 Communication errors (displayed in the monitor) ........................................... 2-159A-8 PLC errors ......................................................................................................2-160A-9 Errors that occur during compilation ...............................................................2-161
Appendix B Instruction List ...............................................................................2-163B-1 Basic instructions ............................................................................................2-163B-2 Application instructions ...................................................................................2-164B-3 Arithmetic instructions .....................................................................................2-165B-4 Interrupt instructions .......................................................................................2-166
Appendix C Relay No. List ..................................................................................2-167C-1 Relays, timers, counters, and memory numbers for each model ...................2-167
Appendix D Special Utility Relay List ................................................................2-168D-1 Special relays and arithmetic operation flags ................................................. 2-168D-2 Special utility relays for high-speed counter (0) ..............................................2-168D-3 Special utility relays for high-speed counter (1) ..............................................2-169D-4 Other special utility relays ...............................................................................2-169D-5 Memory switches ............................................................................................2-172D-6 Special memory list .........................................................................................2-172
Appendix E Devices for KV-10R(W)/T(W) to 80R(W)/T(W), KV-300 ................ 2-174E-1 Special utility relays ........................................................................................2-174E-2 Memory switches ............................................................................................2-176E-3 Special memory list .........................................................................................2-176
Appendix F Sample Program List .....................................................................2-178F-1 Description of sample ladder programs ..........................................................2-178
Appendix G Quick Reference .............................................................................2-180G-1 Editor ..............................................................................................................2-180G-2 Simulator .........................................................................................................2-188G-3 Monitor ............................................................................................................2-195
Appendix H Notes for Programming .................................................................2-201H-1 Circuits that must be modified ........................................................................2-201H-2 Precautions for programming .........................................................................2-202H-3 Programs which cannot be decompiled ..........................................................2-203
Appendix I List of Files Used ............................................................................2-204
Appendix J Countermeasures for Frequent Communication Errors ............ 2-205
WARRANTIES AND DISCLAIMERS 2-215
(22)
WARRANTIES AND DISCLAIMERSSee 3-367.
Caution• No part of this manual may be reprinted or reproduced in any form or by any
means without the prior written permission of KEYENCE CORPORATION.
• The content of this manual is subject to change without notice.
• KEYENCE has thoroughly checked and reviewed this manual. Please contactthe sales office listed at the end of this manual if you have any questions orcomments regarding this manual or if you find an error.
• KEYENCE assumes no liability for damages resulting from the use of the infor-mation in this manual, item 3 above notwithstanding.
• KEYENCE will replace any incomplete or incorrectly collated manual.
All company names and product names in this manual are registered trademarks ortrademarks of their respective owners.
(23)
Chapter 1Programming
This chapter describes basic knowledge including program creation procedures,device configuration, relay assignments, special functions to set and confirm VisualKV Series operations, as well as the extended ladder diagrams. Understand thecontents described here completely at first before creating programs. For a detailed description of instructions, refer to "2.4. Instruction Details" (p.3-56).
1.1 Before Creating Programs .......................................................... 3-21.1.1 Flow from Introduction to Operation ........................................................... 3-21.1.2 Scan Time .................................................................................................. 3-3
1.2 User Memory ................................................................................ 3-41.2.1 Program Capacity ...................................................................................... 3-4
1.3 Device Configuration ................................................................... 3-51.3.1 Device List .................................................................................................. 3-51.3.2 Relay No. ................................................................................................... 3-71.3.3 Assigning Relay Nos. ................................................................................. 3-81.3.4 Input Relays ............................................................................................... 3-91.3.5 Output Relays .......................................................................................... 3-101.3.6 Internal Utility Relays ............................................................................... 3-111.3.7 Special Utility Relays ................................................................................ 3-121.3.8 Special Utility Relay List ........................................................................... 3-141.3.9 Timers and Counters ................................................................................ 3-181.3.10 Data Memories ......................................................................................... 3-191.3.11 Temporary Data Memory ......................................................................... 3-211.3.12 Relay Nos. and Functions ........................................................................ 3-22
1.4 Special Functions ...................................................................... 3-231.4.1 Input Time Constant Change Function .................................................... 3-231.4.2 Modifying the Input Relay Time Constant ................................................ 3-241.4.3 Constant Scan Time Mode....................................................................... 3-251.4.4 Output Disabled Function ......................................................................... 3-261.4.5 Input Refresh Disabled Function .............................................................. 3-261.4.6 Contact Comment Save Function ............................................................ 3-271.4.7 Special Functions ..................................................................................... 3-28
1.5 Extended Ladder Diagrams ...................................................... 3-291.5.1 Features of Extended Ladder Diagrams .................................................. 3-291.5.2 Advantages of Extended Ladder Diagrams ............................................. 3-301.5.3 Example of an Extended Ladder Diagram ............................................... 3-31
1.1 Before Creating Programs
3-2
1
Chapter 1 Programming
1.1 Before Creating ProgramsThis section describes what you should know before creating programs and opera-tions for the Visual KV Series.
1.1.1 Flow from Introduction to OperationThis section describes an overview of program creation procedures, functions used,and setting items.In the example described below, a latch circuit is created as a program for the VisualKV Series.
Introduction
Examining contents of operationsFigure 1 shows a latch circuit which operates as follows.
Pushbutton switch PB1: ONPushbutton switch PB2: OFF
Pilot lamp (PL) turns on.
Pushbutton switch PB1: OFFPushbutton switch PB2: OFF
Pilot lamp (PL) remainslit even if PB1 turnsOFF.
Pushbutton switch PB1: OFFPushbutton switch PB2: ON
Pilot lamp (PL) goes outwhen PB2 is set to ON.
Time chartON
OFF
ON
OFF
PLON
OFF
PB1 contact
PB2 contact
Fig. 1PB1 = N.O. contact switchPB2 = N.C. contact switch
PB1 PB2
RL(Relay)
PL
Next, a program is created that will use the same operation as this circuit to control a PLC.
Program examinationCircuit 1 shows relay symbols for the latch circuit.Examine which contact in the Visual KV Series is used for each pushbutton switch and pilot lamp(Table 1). When many I/O devices are required for control, expansion units should also be considered.
Circuit 1
PL
RL
RL
RL
PB1 PB2Relay (coil)
Relay (contact)
Relay (contact)Pilot lamp
Table 1
I/O device Contact No.Pushbutton switch PB1 (N.O. contact) Input relay (0000)
Pushbutton switch PB2 (N.C. contact) Input relay (0001)
Relay RL Internal relay (1000)
Pilot lamp PL Output coil (0500)
Program creationEdit a program using the "LADDER BUILDER for KV" programming support software creation tool.
Ladder diagram
0500
1000
1000
1000
0000 0001*
Coding listLD 0000OR 1000AND 0001OUT 1000LD 1000OUT 0500END
* Enter "N.O. (AND X001)" to 0001 touse N.C. contact.
Transferring and confirming the programTransfer the created program to the Visual KV Series, perform a test run, and then confirm operationswith the actual devices.
Operation
1.1 Before Creating Programs
3-3
11
Chapter 1 Programming
1.1.2 Scan TimeScan time
The Visual KV Series repeatedly executes a ladder based on the sequence circuitas follows.
The duration of time required to perform one cycle is called the scan time (or cycletime). The scan time varies based on program size and the instructions used in theprogram.
Input response time delayIn addition to the I/O processing time, there is also an input time delay in the VisualKV Series caused by the scan time. The input time delay is generated because theinput status can only be read during the input processing time. If the input status ischanged after input processing, the changed contents can only be read during thenext scan time.
In the figure below, 1 and 2 can be read but 3 cannot be read.
Reference: The maximum and minimum values of the input response time are asfollows.
Maximum value: Input time constant + Scan time x 2 + Output response delay time
Minimum value: Input time constant + Scan time + Output response delay time
Note 1: When the input time constant is made small by setting the HSP instruction,special utility relay 2813, and data memory DM1940, a signal may not be received ifits ON time is shorter than the scan time.
Note 2: The INT instruction is independent of the scan time.
Note 3: The minimum scan time is 140 µs (with the basic unit).
Input processing Writes the ON/OFF status of all input terminals to the inputmemory before executing the program.
Program execution
Reads the ON/OFF status of each device (internal utility relay,timer, counter, etc.) based on the instructions, and performsarithmetic operations.Writes the arithmetic operation result to the output memory.
Output processing Outputs the contents of the output memory to output terminals.
ON
OFF
1 2 3Input signal
Read Read
Out
put p
roce
ssin
g
Inpu
t pro
cess
ing
Programexecution
Scan time
Out
put p
roce
ssin
g
Inpu
t pro
cess
ing
Programexecution
Scan time
Out
put p
roce
ssin
g
Inpu
t pro
cess
ing
Programexecution
Out
put p
roce
ssin
g
Inpu
t pro
cess
ing
Programexecution
Out
put p
roce
ssin
g
Inpu
t pro
cess
ing
1.2 User Memory
3-4
1
Chapter 1 Programming
1.2 User MemoryThis section describes the allowable size (capacity) of a program which can becreated in the Visual KV Series.
1.2.1 Program CapacityWhen a user program is created for the Visual KV Series, the maximum number ofsteps a program can contain using the mnemonic diagram varies based on the bytecount of the instructions used. The instruction byte count is determined individuallyfor each instruction. For more about byte counts for each instruction, refer to "2.1 Instruction List" (p.3-34).
Maximum number of lines in a programIn the KV-10xx/16xx, a program with approximately 2,000 steps can be written. Inthe KV-24xx/40xx, a program with approximately 4,000 steps can be written.
• Total byte count of the memory used by instructions ≤ 6,000 bytes / 12,000bytes
• Total byte count of the memory used by objects of instructions ≤ 12,000bytes / 24,000 bytes
* In the description above, a value on the left side indicates the byte count forthe KV-10xx/16xx, while a value on the right side indicates the byte count forthe KV-24xx/40xx.
* The memory occupied by objects indicates the memory required to execute aprogram when operation is started.
For example, the allowable number of steps to be written can be calculated from thememory occupied by the instructions as follows.
12,000 bytes / 3 bytes (average byte count of an instruction) = 4,000 steps
Note: If either the memory occupied by the instructions or the memory occupied byobjects of a program exceeds the specified memory capacity, the program cannotbe written or executed.
Calculating the byte count usedThe byte count used in this program can be calculated as shown in the table below.
T0000500
0000
0500
#00020T000
Line No. Instruction Operand Byte count Number of objects
00000 LD 0000 3 5
00001 OR 0500 3 4
00002 TMR 000#00020 2 7
00003 ANB T000 3 8
00004 OUT 0500 3 8
Total 14 bytes 32 bytes
1.3 Device Configuration
3-5
11
Chapter 1 Programming
1.3 Device Configuration"Device" is a general name for relays, registers, etc. processed by instructions.This section describes the available devices in the Visual KV Series and theirgeneral use.
1.3.1 Device ListRelay list
Note 1: The ON/OFF status of the set functions is always cleared when the opera-tion mode is changed from PROGRAM to RUN. However, special utility relays 2700to 2715 are held even when the operation mode is changed from PROGRAM toRUN or when the power is turned off.
Note 2: Internal utility relays can be held by setting the MEMSW instruction
List of I/O relays in basic units
.oNyaleR esulamroNdeeps-hgiH
)1(esu)2(esudeeps-hgiH skrameR
0000syalertupnItupnitceriD(
)aeradewolla
stupnitpurretnI3TNIot0TNI
noisrevniytiraloP()dewolla
serutpactupnI
deeps-hgihfoesahpBsanoitcnufyehTnisyalerytilitufonoitacificepshguorhtsretnuoc
.01-VK1000
2000 –
3000 –
4000
syalertupnI
deeps-hgiHtupni0retnuoc
deeps-hgiH0retnuoc esahpA
tupni
–
5000deeps-hgiH
tupni1retnuocdeeps-hgiH
1retnuoc–
6000
–
deeps-hgiH0retnuoc esahpB
tupni
–
7000deeps-hgiH
1retnuoc–
8000deeps-hgiH
0retnuoc teserPtupni
–
9000deeps-hgiH
1retnuoc–
5140ot0100 syalertupnI –
0050
syalertuptuOtuptuotceriD()aeradewolla
tuptuo0retnuocdeeps-hgiH stniop07
1050deeps-hgiH
1retnuoctuptuo
ycneuqerfdeificepStuptuoeslup
–
2050 tuptuolortnocnwod/pu-pmaR –
3050 – –
5190ot4050 syalertuptuO stniop67
5191ot0001 syalerytilitulanretnI stniop061
5182ot0002 syalerytilitulaicepS stniop441
5192ot0092 syalerytilitulaicepS aeraegarotsnoitamrofniYEKH
51971ot0003 syalerytilitulanretnI stniop441,2
Model KV-10xx KV-16xx KV-24xx KV-40xx
Basic input relays 0000 to 0005 0000 to 0009 0000 to 0015 0000 to 0107
Basic output relays 0500 to 0503 0500 to 0505 0500 to 0507 0500 to 0515
1.3 Device Configuration
3-6
1
Chapter 1 Programming
List of relays in expansion units Input units
Output units
I/O units
* Relay Nos. of expansion units are automatically assigned in the order of connection.* The connection order is counted only for input and output units. When I/O units are
connected, they are counted as input units and output units separately.
noitcennoCredro
X4E-VK X8E-VK X61E-VK
42/61/01-VK 04-VK 42/61/01-VK 04-VK 42/61/01-VK 04-VKtupnits1
eludom301ot001 302ot002 701ot001 702ot002 511ot001 512ot002
tupnidn2eludom
302ot002 303ot003 702ot002 703ot003 512ot002 513ot003
tupnidr3eludom
303ot003 304ot004 703ot003 704ot004 513ot003 514ot004
tupniht4eludom
304ot004 704ot004 514ot004
noitcennoCredro
R/)P(T4E-VK R/)P(T8E-VK R/)P(T61E-VK
tuptuots1eludom
306ot006 706ot006 516ot006
tuptuodn2eludom
307ot007 707ot007 517ot007
tuptuodr3eludom
308ot008 708ot008 518ot008
tuptuoht4eludom
309ot009 709ot009 519ot009
noitcennoCredro
)P(T/RX4E-VK
syalertupnI syalertuptuO
42/61/01-VK 04-VK 42/61/01-VK 04-VKtupnits1
eludom301ot001 302ot002
tupnidn2eludom
302ot002 303ot003
tupnidr3eludom
303ot003 304ot004
tupniht4eludom
304ot004
tuptuots1eludom
606ot306 606ot306
tuptuodn2eludom
307ot307 307ot307
tuptuodr3eludom
308ot308 308ot308
tuptuoht4eludom
309ot309 309ot309
1.3 Device Configuration
3-7
11
Chapter 1 Programming
1.3.2 Relay No.The relay No. configuration is shown below.
Address No.Address Nos. are assigned to basic units, input expansion units, output expansionunits, and I/O expansion units. Zero to 4 are assigned to input units, while 5 to 9 areassigned to output units. Address Nos. assigned in a unit vary based on the numberof I/O terminals and the connection position of the unit.
* 2 to 4 in KV-40xx
Address No. assignment procedure• The address No. is represented as a number 0 to 9.• Address Nos. 0 to 4 are provided for inputs, while address Nos. 5 to 9 are pro-
vided for outputs.
1 2 5 1 5Channel No.
Contact No.(00 to 15)
Address No.(Input: 0 to 4, output: 5 to 9)
Model Address Nos.
KV-10xx 0, 5
Basic unitsKV-16xx 0, 5
KV-24xx 0, 5
KV-40xx 0, 1, 5
kV-E4X 1 to 4*
Input expansion units KV-E8X 1 to 4*
KV-E16X 1 to 4*
KV-E4R/E4T(P) 6 to 9
Output expansion units KV-E8R/E8T(P) 6 to 9
KV-E16R/E16T(P) 6 to 9
I/O expansion units KV-E4XR/E4XT(P) 1 to 4*, 6 to 9
1.3 Device Configuration
3-8
1
Chapter 1 Programming
Contact No.• Contact Nos. are input/output terminal Nos. of basic units, input expansion units,
output expansion units, and I/O expansion units.
• The contact No. is represented as a number 0 to 15.
ExampleIn the KV-E4X, with 4 input terminals, the contact Nos. are 0 to 3. In the KV-E16T(P), with 16 input terminals, the contact Nos. are 0 to 15.
• In a unit with 16 or more terminals, the contact No. of the 17th terminal returns to0 and its address No. is increased by 1.
Example
In the KV-40AR, with 40 terminals (24 input and 16 output terminals), addressNo. 0 is assigned to input terminal Nos. 1 to 16 and address No. 1 is assigned toinput terminal Nos. 17 to 24
Channel No.The channel No. is the higher order digit in the contact No.
1.3.3 Assigning Relay Nos.When assigning relay Nos., the unit No. is based on the connection position of theunit, and the address No. is determined based on the unit type and I/O contacts.
With the connections above, the relay Nos. for each unit are assigned as shown inthe table below.
a) KV-16ARBasic unitInput: 10 pointsOutput: 6 points
b) KV-E4X InputexpansionunitInput: 4 points
c) KV-E8R Outputexpansion unitOutput: 8 points
Unit Assigned relay Nos.
a) KV-16AR 0000 to 0009 (input) and 0500 to 0505 (output)
b) KV-E4X 0100 to 0103 (input)
c) KV-E8R 01600 to 0607 (output)
1.3 Device Configuration
3-9
11
Chapter 1 Programming
1.3.4 Input RelaysInput relays receive ON/OFF signals sent from external input equipment.
Note 1: Input relays function as contacts in programs. They cannot be used as relaycoils (outputs).
Note 2: There is no restriction of the contact type (N.O. or N.C.) used, the order therelay Nos. are used, or the number of relays used.
Basic unit Input relay time constant
Though the time constant is usually 10 ms ±20%, it can be changed using thefollowing settings.
• When the HSP instruction is used: 10 µs ±20%
• While special utility relay 2813 remains ON, the time constant can be changed in7 steps by setting data memory DM1940 as follows.
When DM1940 is set to 0: 10µs ±20%1: 20 µs ±20%2: 500 µs ±20%3: 1 ms ±20%4: 2.5 ms ±20%5: 5 ms ±20%6: 10 ms ±20%Never set a numeric value of 7 or larger.
For more about changing the input time constant, refer to "1.4.1 Input Time Constant ChangeFunction" (p.3-23).
Hardware input (independent of scan time)
• High-speed counterWhen the time constant is set to 10 µs using the HSP instruction or data memoryDM1940 (only while special utility relay 2813 remains ON), the maximum inputresponse of input relays 0004 and 0005 of CTH0 and CTH1 becomes 30 kHz.
• INT instruction: 0000 to 0003This instruction can receive any signal without regard to the scan time as far asthe signal ON time is longer than the input time constant.
"HSP instruction" (p.3-86), "INT instruction" (p.3-192), "4.1 High-speed Counter Instructions" (p.3-204)
Note 1: While special utility relay 2813 remains ON, the input time constant can bespecified for all input relays in a basic unit.
Note 2: Never enter a number of 7 or larger to data memory DM1940.
Note 3: The input time constant specified by data memory DM1940 becomeseffective at the rising edge of special utility relay 2813. To change the input timeconstant, first change data memory DM1940, then set special utility relay 2813 toOFF and ON again. Or change the operation mode of a KV basic unit from PRO-GRAM to RUN.
Note 4: If the HSP instruction and special utility relay 2813 are used at the sametime, priority is given to the HSP instruction.
Note 5: Only when a high-speed counter input or INT instruction is given, availableinput signals do not depend on the scan time.
1.3 Device Configuration
3-10
1
Chapter 1 Programming
Expansion unit Input relay time constant
By setting special utility relays 2609 to 2612 to ON, the time constant in input expan-sion units can be set to 10 µs.
* Not available with the KV-40xx
1.3.5 Output RelaysOutput relays output the program execution results to the outside. There are twotypes of outputs, relay and transistor.
Note 1: Output relays function as contacts and relay coils in programs.
Note 2: There is no restriction of the contact type (N.O. or N.C.) used, the order therelay Nos. are used, or the number of relays used.
Output operation time• Transistor output
OFF ON: 50 µs or less (10 µs or less in 500 to 502)ON OFF: 250 µs or less (10 µs or less in 500 to 502, 100 µs or less for other
outputs in the basic unit)
• Relay outputOFF ON: 10 ms or lessON OFF: 10 ms or less
Note 1: When programming direct clock pulses, output relays 0500 and 0501 areused to output pulses in a transistor-type output unit.
Note 2: When the ramp-up/down control function is used, output relay 0502 outputspositioning pulses in a transistor-type output unit. "Chapter 5. Positioning Control" (p.3-253)
Note 3: When the specified frequency pulse output function is used, output relay0501 outputs pulses in a transistor-type output unit. "4.5.1 Specified Frequency Pulse Output Function" (p.3-228)
ytilitulaicepS.oNyaler
noitcnuF
*9062tinunoisnapxetupnifotnatsnocemittupnI
5110ot0010.soNyalerhtiw01:NO,sm01:FFO µs
0162tinunoisnapxetupnifotnatsnocemittupnI
5120ot0020.soNyalerhtiw01:NO,sm01:FFO µs
1162tinunoisnapxetupnifotnatsnocemittupnI
5130ot0030.soNyalerhtiw01:NO,sm01:FFO µs
2162tinunoisnapxetupnifotnatsnocemittupnI
5140ot0040.soNyalerhtiw01:NO,sm01:FFO µs
epyttuptuorotsisnarT epyttuptuoyaleR
)P(TD/)P(TA01-VK )P(TD/)P(TA61-VK RD/RA01-VK RD/RA61-VK
)P(TD/)P(TA42-VK )P(TD/)P(TA04-VK RD/RA42-VK RD/RA04-VK
T4E-VK )P(T8E-VK R4E-VK R8E-VK
)P(T61E-VK )P(TX4E-VK R61E-VK RX4E-VK
1.3 Device Configuration
3-11
11
Chapter 1 Programming
1.3.6 Internal Utility RelaysIn a relay circuit, when one relay contact is used twice or more inside the circuit, amulti-pole relay with the same number of poles as the number used may be needed.Internal utility relays function only in programs, and eliminate the complexity of relaycircuits to facilitate circuit design.
Note 1: Internal utility relays function as contacts and relay coils in programs.
Note 2: There is no restriction of the contact type (N.O. or N.C.) used, the order therelay Nos. are used, or the number of relays used.
Retentive function of internal utility relaysExcept for internal utility relays, all relays turn OFF when the operation mode ischanged or when operation is stopped via a power shutdown. When operation isrestarted, all relays remain OFF except relays whose input condition is ON. How-ever, internal utility relays can be set using the MEMSW (memory switch) whether ornot they are to be retained. (Internal utility relays 2700 to 2715, however, are alwaysretained.)
When an internal utility relay is set to be retained, its ON/OFF status is stored even ifthe power is turned off. By using the retained relay all clear function (FUN65), allrelays which are set to be retained can be set to OFF. For more about setting the memory switch, refer to "MEMSW instruction" (p.3-92).
Application example of a retentive function: Lift vertical movement control
Internal utility relays 1000 and 1001 are set to be retained.When the upper/lower limit switch turns ON, the direction of lift movement isinverted. Even if the power is turned off while the lift is moving up (or down), the liftcontinues to move up (or down) when the power is turned on again.
Note: The retentive function is effective only when internal utility relays retained bythe self-retentive circuit or the SET/SFT/KEEP instruction are also retained by thememory switch.
Internal utility relays are not retained in the program shown below.
(0000)
(0500)
(0501)
(0001)
0000 10000001
T000 05000501
T001 05010500
1000 #00010T000
0001 10010000
1001 #00010T001
END
ENDH
MEMSW$0004
Move-up
Upper limitswitch
Lower limitswitch
Move-down
0000 1001
1.3 Device Configuration
3-12
1
Chapter 1 Programming
1.3.7 Special Utility RelaysEach special utility relay has a unique function. By using special utility relays effec-tively, programs can be simplified and program control improved.
Note 1: A special utility relay can be used as many times as desired in one program.
Note 2: Special utility relays dedicated for reading can be used as contacts, butcannot be used as outputs.
For more about relays dedicated for reading, refer to "1.3.8 Special Utility Relay List" (p.3-14).
DescriptionRelay 2002: Always ONBy setting an output relay to ON using relay 2002, the output relay can be used as a"running indicator output".
Relay 2003: Always OFF.
Opposite that of relay 2002, use relay 2003 where it is not required to be turned on.For example, when using only the up function of an up/down counter, use relay 2003in the DW (down) input.
Relays 2004, 2005 and 2006: Clock pulse
For each relay, the time ratio is "ON:OFF = 1:1". (Accordingly, the ON time of relay2005 is 0.05 sec/pulse.)However, because these relays depend on the scan time, error as much as the scantime is generated.
• By combining an output relay, an "intermittent output" can be made.• By using relay 2006 as input for a counter, the counter can be used as a long-
term timer.
Relay 2007: Remains OFF during only one scan when operation is started.This relay can be used when a signal needs to be sent after a specific period(equivalent to one scan) after operation is started. This relay can also be used foran initial reset at the start of operation.After one scan, this relay remains ON.
2002
00000LDA
DM0000STA
2002
HSP0100
Set the input time constant of relay 0100 to 10 µs.Transfer the ON/OFF status data of channel 0000 to DM0000.
C000
1000 #03600
2006C000
1000
1000 turns ON at every hour.
1000 #00100
0000C005
2007
When operation is started, this relay returnsthe current value of C005 to 0.
1.3 Device Configuration
3-13
11
Chapter 1 Programming
Relay 2008: Remains ON during only one scan when operation is started.
This relay can be used for an initial reset at the start of operation.After one scan, this relay remains OFF.
Relay 2813: Sets the input time constant of the CPU.While relay 2813 remains ON, the input time constant of a basic unit can be setusing the value of DM1940.
When operation is started, this relay sets all internalutility relays used by the SFT instruction to OFF.
0000
1000
SFTD
CLK
RES2008
1100
1100
#00000LDA
DM0000STA
2008
When operation is started, this relay returns the currentvalue of DM0000 to 0.
1.3 Device Configuration
3-14
1
Chapter 1 Programming
1.3.8 Special Utility Relay ListSpecial relays and arithmetic operation flags
"1.3.7 Special Utility Relays" (p.3-12)
* Read-only relay.
Special utility relays for high-speed counter(0)
"Chapter 4. High-Speed Counters" (p.3-203)
* Read-only relay.
Note: Never use special utility relays that are not shown above.
.oNyaleR noitcnuF
*0012 1(0HTCrofylnodesukcolclanretnI µ )s*1012 01(0HTCrofylnodesukcolclanretnI µ )s*2012 001(0HTCrofylnodesukcolclanretnI µ )s
3012 0CTCrotarapmocnehw0HTCforaelccitamotuA.NOsnrut
deraelC:NOderaelctoN:FFO
4012 nehw0050ottuptuotceridstimrep/stibihorP.NOsnrut0CTCrotarapmoc
detibihorP:NOdettimreP:FFO
5012 rotarapmocnehwFFOottessi0050ottuptuotceriD.NOsnrut0CTC
FFOotteS:NOFFOottestoN:FFO
6012 rotarapmocnehwNOottessi0050ottuptuotceriD.NOsnrut0CTC
NOotteS:NONOottestoN:FFO
7012 hcaedesreversi0050ottuptuofosutatsFFO/NO.NOsnrut0CTCrotarapmocemit
desreveR:NOdesrevertoN:FFO
8012 nehw0050ottuptuotceridstimrep/stibihorP.NOsnrut1CTCrotarapmoc
detibihorP:NOdettimreP:FFO
9012 rotarapmocnehwFFOottessi0050ottuptuotceriD.NOsnrut1CTC
FFOotteS:NOFFOottestoN:FFO
0112 rotarapmocnehwNOottessi0050ottuptuotceriD.NOsnrut1CTC
NOotteS:NONOottestoN:FF
1112 hcaedesreversi0050ottuptuofosutatsFFO/NO.NOsnrut1CTCrotarapmocemit
desreveR:NOdesrevertoN:FFO
2112 1CTCrotarapmocnehw0HTCforaelccitamotuA.NOsnrut
deraelC:NOderaelctoN:FFO
3112 .0HTCrotarapmocrofedomnoitacilpitlumstceleSNOFFONOFFO
seslup2:NO4x:NO2x:FFOeslup1:FFO4112
noitacilpitluMedom
eslup1 2x 4x seslup2
3112 FFO NO FFO NO
4112 FFO FFO NO NO
.oNyaleR noitcnuF
*2002 .NOsyawlA
*3002 .FFOsyawlA
*4002 )%05:elcycytud(eslupkcolcs-10.0
*5002 )%05:elcycytud(eslupkcolcs-1.0
*6002 )%05:elcycytud(eslupkcolcs-0.1
*7002 .putratsretfanacstsrifgnirudFFOsniameR
*8002 .putratsretfanacstsrifgnirudNOsniameR
*9002nanehwroevitagensinoitarepocitemhtirafotlusernehwNOsnruT
.detarenegsiwolfrevo
*0102 .0sinoitarepocitemhtirafotlusernehwNOsnruT
*1102 .evitisopsinoitarepocitemhtirafotlusernehwNOsnruT
*2102 .rorrenasetarenegnoitarepocitemhtirananehwNOsnruT
1.3 Device Configuration
3-15
11
Chapter 1 Programming
Special utility relays for high-speed counter(1)
"Chapter 4. High-Speed Counters" (p.3-203)
* Read-only relay.
Note: Never use special utility relays that are not shown above.
Other special utility relays
.oNyaleR noitcnuF
*0022 1(1HTCrofylnodesukcolclanretnI µ )s*1022 01(1HTCrofylnodesukcolclanretnI µ )s*2022 001(1HTCrofylnodesukcolclanretnI µ )s
3022 2CTCrotarapmocnehw1HTCforaelccitamotuA.NOsnrut
deraelC:NOderaelctoN:FFO
4022 nehw1050ottuptuotceridstimrep/stibihorP.NOsnrut2CTCrotarapmoc
detibihorP:NOdettimreP:FFO
5022 rotarapmocnehwFFOottessi1050ottuptuotceriD.NOsnrut2CTC
FFOotteS:NOFFOottestoN:FFO
6022 rotarapmocnehwNOottessi1050ottuptuotceriD.NOsnrut2CTC
NOotteS:NONOottestoN:FFO
7022 hcaedesreversi1050ottuptuofosutatsFFO/NO.NOsnrut2CTCrotarapmocemit
desreveR:NOdesrevertoN:FFO
8022 nehw1050ottuptuotceridstimrep/stibihorP.NOsnrut3CTCrotarapmoc
detibihorP:NOdettimreP:FFO
9022 rotarapmocnehwFFOottessi1050ottuptuotceriD.NOsnrut3CTC
FFOotteS:NOFFOottestoN:FFO
0122 rotarapmocnehwNOottessi1050ottuptuotceriD.NOsnrut3CTC
NOotteS:NONOottestoN:FFO
1122 hcaedesreversi1050ottuptuofosutatsFFO/NO.NOsnrut3CTCrotarapmocemit
desreveR:NOdesrevertoN:FFO
2122 3CTCrotarapmocnehw1HTCforaelccitamotuA.NOsnrut
deraelC:NOderaelctoN:FFO
3122 .1HTCrotarapmocrofedomnoitacilpitlumstceleSNOFFONOFFO
seslup2:NO4x:NO2x:FFOeslup1:FFO4122
noitacilpitluMedom
eslup1 2x 4x seslup2
3122 FFO NO FFO NO
4122 FFO FFO NO NO
.oNyaleR noitcnuF
0032 delbasidstuptuolanretxE)5190ot0050stuptuo(
delbasiD:NOdelbasidtoN:FFO
1032 delbasidstupnihserferlanretxE)5140ot0000stupni(
delbasiD:NOdelbasidtoN:FFO
3032 edomemitnacstnatsnoC)92MTnieulavteserpetirw(
delbanE:NOdelbasiD:FFO
4032 sdeecxeemitnacsnehwnacsenorofNOsniameR.emitnacstnatsnocteserp
5032 .noitareporetnuocycneuqerfrofgalftratS
6032 tuptuoeslupycneuqerfdeificepSdelbanE:NO
delbasiD:FFO7032 tuptuoeslupycneuqerfdeificepsrofgalfrorrE8032 .NOdenrutnehwrevirdrotomspotS
9032 nirevirdrotomspotS.noitareponisirevirdrotomnehwNOsnruT.noitcurtsnitpurretniybFFOdenrutnehwseicnegreme
0132 .)egdegnisirtanoitceted(NOdenrutnehwrevirdrotomstratS4132 .noitarepohctiwsmacrofgalftratS5132 .noitarepohctiwsmacnisruccororrenanehwNOsnruT
* Read-only relay.
1.3 Device Configuration
3-16
1
Chapter 1 Programming
.oNyaleR noitcnuF
0042 langislanretxe0HTCfognimiTFFO teserplanretxE FFO
egdegnillaftANO
egdegnisirtANO
leveL1042 FFO desuton NO FFO NO
2042 TNIfoytiraloptpurretnIFFO
egdegnisirtAFFO
egdegnillaftANO
egdegnisirtANO
segdehtobtA3042 FFO NO FFO NO
4042 1TNIfoytiraloptpurretnIFFO
egdegnisirtAFFO
egdegnillaftANO
egdegnisirtANO
segdehtobtA5042 FFO NO FFO NO
6042 retnuocgnirsates0HTC teS:NO testoN:FFO
7042.edomnoitacilpitlumonottessi0HTCnehwtupniBesahperongI
.putnuocsyawladnatupniBesahperongI:NO.laususatupniBesahpesU:FFO
8042 teserplanretxe1HTCfognimiTFFO teserplanretxE FFO
egdegnillaftANO
egdegnisirtANO
leveL9042 FFO desuton NO FFO NO
0142 2TNIfoytiraloptpurretnIFFO
egdegnisirtAFFO
egdegnillaftANO
egdegnisirtANO
segdehtobtA1142 FFO NO FFO NO
2142 3TNIfoytiraloptpurretnIFFO
egdegnisirtAFFO
egdegnillaftANO
egdegnisirtANO
segdehtobtA3142 FFO NO FFO NO
4142 retnuocgnirsates1HTC teS:NO testoN:FFO
5142.edomnoitacilpitlumonottessi1HTCnehwtupniBesahperongI
.putnuocsyawladnatupniBesahperongI:NO.laususaBesahpesU:FFO
0052 .dengissasilenapecafretnirotarepo02D-VKno]1F[hctiwsdezimotsuC1052 .dengissasilenapecafretnirotarepo02D-VKno]2F[hctiwsdezimotsuC2052 .dengissasilenapecafretnirotarepo02D-VKno]3F[hctiwsdezimotsuC3052 .dengissasilenapecafretnirotarepo02D-VKno]4F[hctiwsdezimotsuC
4052silenapecafretnirotarepo02D-VKno1pmalrotacidnidezimotsuC
.dengissa
5052silenapecafretnirotarepo02D-VKno2pmalrotacidnidezimotsuC
.dengissa
6052silenapecafretnirotarepo02D-VKno3pmalrotacidnidezimotsuC
.dengissa
7052silenapecafretnirotarepo02D-VKno4pmalrotacidnidezimotsuC
.dengissa
8052rotareponeewtebegnahcstimreP02D-VKfoedomeciveddnaedom
.lenapecafretnirotarepodettimreP:NO
toN:FFOdettimrep
9052ecafretnirotarepo02D-VKehtstimreP
rotareponeewtebdetfihsebotlenap.edommetsysdnaedom
dettimreP:NOO toN:FF
dettimrep
0152ehtrofegaugnalyalpsidehtseificepS
lenapecafretnirotarepo02D-VKesenapaJ:NO hsilgnE:FFO
1152rotarepo02D-VKehtrofpeebehtsteS
lenapecafretnipeebesU:NO peeboN:FFO
2152 metsysrofdevreseR3152 metsysrofdevreseR
5152fostnetnoc(egassemresuasyalpsiD
wodniWsseccAehtni)0591MDyalpsiD:NO
egassemtonoD:FFO
egassemyalpsid
1.3 Device Configuration
3-17
11
Chapter 1 Programming
Note: Never use special utility relays that are not shown above.
.oNyaleR noitcnuF
9062yalerhtiwtinunoisnapxetupnifotnatsnocemittupnI
5110ot0010.soNsm01:FFO
01:NO µs
0162yalerhtiwtinunoisnapxetupnifotnatsnocemittupnI
5120ot0020.soNsm01:FFO
01:NO µs
1162yalerhtiwtinunoisnapxetupnifotnatsnocemittupnI
5130ot0030.soNsm01:FFO
01:NO µs
2162yalerhtiwtinunoisnapxetupnifotnatsnocemittupnI
5140ot0040.soNsm01:FFO
01:NO µs
3162 tcennocsidnoisnapxetatupnifogniraelCderaelC:FFO
deraelctoN:NO
2172lamroN:FFOrorretcennocsiD
tinudetcennocninoitcennocsiD:NO
derotssiaerasihTehtnehwneve
siedomnoitarepomorfdegnahc
,NURotMARGORPsirewopehtnehwro
tuohtiw(ffodenrutehtybdetceffagnieb.)noitcurtsniWSMEM
tonsiaerasihTehtfinevederaelc
raelCllAyalerytilitu.detavitcasinoitcnufsiaerasiht,revewoH
llAnanehwderaelcdetucexesiraelC
agniretsigertuohtiw.margorp
4172tiucricnoitcerroctupnideeps-hgihfoesU
desutoN:FFOdesU:NO
5172 .noitareponisihctiwsmacelihwNO
0082 .)gnidneselihwNOsniamer(AtropnoitacinummocotdneslangiskaerB
1082ylnognirudNOsniamerdna,AtropnoitacinummocmorfatadtxetsevieceR
.atadtxetgniviecerelihwnacs1
2082ylnognirudNOsniameR.rorreecnatpeccaatadtxetAtropnoitacinummoC3082yalerro1082yalerrehtieelihwdeviecersiatadtxetnehwNOnacs1
.NOsi
3082rorreevieceratadtxetAtropnoitacinummoC
.sruccororreevieceratadtxetanehwnacs1ylnognirudNOsniameR4082 ).gnidnesgnirudNOsniamer(tratsdnesatadtxetAtropnoitacinummoC5082 .)gnidneselihwNOsniamer(BtropnoitacinummocotdneslangiskaerB
60821ylnognirudNOsniamerdna,atadtxetBtropnoitacinummocsevieceR
.atadtxetgniviecerelihwnacs
7082.rorreecnatpeccaatadtxetBtropnoitacinummoC
elihwdeviecergniebsiatadtxetnehwNOnacs1ylnognirudNOsniameR.NOsi8082yalerro6082yaler
8082rorreevieceratadtxetBtropnoitacinummoC
.sruccororreevieceratadtxetanehwnacs1ylnognirudNOsniameR9082 ).gnidnesgnirudNOsniamer(tratsdnesatadtxetBtropnoitacinummoC2182 .yrettabpukcabhtiwsruccoytilamronbananehwNOsnruT
3182
ybdesustupnitpecxe(eludomcisabnistupnillaottnatsnocemittupnisteS.)noitcurtsniPSH
.sm01ottnatsnocemittupnisteS:FFO.tnatsnocemittupnisenimretedneht,0491MDniderotseulavotsrefeR:NO
4182 .detibihorperasyekelpitluM:noitcurtsniYEKH5182 .dehsinifsinacS:noitcurtsniYEKH
5192ot0092 .aeraegarotsnoitamrofniYEKH
1.3 Device Configuration
3-18
1
Chapter 1 Programming
1.3.9 Timers and CountersTimers and counters can be set in a program, and their outputs can be used ascontacts elsewhere in the program. [There is no restriction on the contact type (N.O.or N.C.) and the order of use.]A same number can be assigned to only one timer or counter. For example, T005and C005 cannot be used in the same program.
Timer/Counter list
Description Timers• When 0.1-s timers (TMR) and high-speed 0.001-s timers (TMS) are used as
contacts, the "Tnnn" No. is used for both types. However, the form for setting isdifferent. "TMRnnn#ddddd" is used for 0.1-s timers, "TMHnnn#ddddd" is used forhigh-speed 0.01-s timers, and "TMSnnn#ddddd" is used for high-speed 1-mstimers (nnn = timer No, ddddd = timer set value).
• In a single program, different timer Nos. must be assigned to each of TMRnnn,TMHnnn, and TMSnnn.
• When the PLC is stopped, all timers are reset and their current values becomeequivalent to set values.
Counters• When counters (C) and up/down counters (UDC) are used as contacts, the
"Cnnn" No. is used for both types. However, the form for setting is different."Cnnn#ddddd" is used for counters, while "UDCnnn#ddddd" is used for up/downcounters.
• In one program, different numbers must be assigned to each of the counters andup/down counters.
• Even when operation is stopped, each counter stores whatever value it has atthat time.
"TMR instruction" (p.3-67), "TMH instruction" (p.3-68), "TMS instruction" (p.3-69), "C instruction" (p.3-72), "UDC instruction" (p.3-76).
High-speed counters and high-speed counter comparators
The Visual KV Se ries is equipped with two high-speed counters (CTH0 and CTH1)and four high-speed counter comparators (CTC0, CTC1, CTC2, and CTC3) with a30-kHz input response speed (frequency), two phases, and size of 16 or 24 bits.
Note: When a high-speed counter or high-speed counter comparator will be used asa 24-bit device, a set value is required to be stored in a data memory using theMEMSW instruction.
For details about high-speed counters and high-speed counter comparators, refer to "Chapter 4 High-speed Counters" (p.3-203).
emaN tcatnoClioC
)noitcurtsni(rebmuN
remiT
)remits-1.0(remiT
942Tot000T
942ot000RMT
latotni052
remitdeeps-hgiH)remits-10.0(
942ot000HMT
remitsm-1deeps-hgiH)remits-100.0(
942ot000SMT
retnuoCretnuoC
942Cot000C942ot000C
retnuocnwod/pU 942ot000CDU
1.3 Device Configuration
3-19
11
Chapter 1 Programming
1.3.10 Data MemoriesData memories store various types of data.Data memories are not usually used in a program that consists of contacts, coils,timers, and counters. When arithmetic instructions are used, however, data memo-ries can be used to store data for arithmetic operations as well as the results ofarithmetic operations.
.oNMD noitpircseD
999MDot0MD )resuybdesuebnac(deificepstoN
9901MDot0001MD AtropeviecertxeT
9911MDot0011MD AtropdnestxeT
9921MDot0021MD BtropeviecertxeT
9931MDot0031MD BtropdnestxeT
0041MD .oNyalertuptuotsrifehT:noitcnufhctiwsmaC
1041MD rotarapmocpets-itlumnieulavnosirapmoC:noitcnufhctiwsmaCedom
2041MD tupnitnempiuqefoelcycenofotnuocesluP:noitcnufhctiwsmaC0HTCot
3041MD )resuybdesuebnac(deificepstoN
4041MD )sm(elcyctnemerusaeM
5041MD )zH(tnuocycneuqerffotluseR
7041MD/6041MD yalertuptuohcihwtaelgnafoeulavteS:noitcnufhctiwsmaCFFO/NOsnrut
9041MD/8041MD:
9641MD/8641MD
1+yalertuptuohcihwtaelgnafoeulavteS:noitcnufhctiwsmaCFFO/NOsnrut
:13+yalertuptuohcihwtaelgnafoeulavteS:noitcnufhctiwsmaC
FFO/NOsnrut
0741MD )resuybdesuebtonnac(metsysybdevreseR
9741MDot1741MD )resuybdesuebnac(deificepstoN
0841MD ot002()zH(ycneuqerfputratS:noitcnuflortnocnwod/pu-pmaR)000,05
1841MD ot002()zH(ycneuqerfgnitarepO:noitcnuflortnocnwod/pu-pmaR)000,05
2841MD )sm(emitnoitareleccA:noitcnuflortnocnwod/pu-pmaR)000,4ot0(
3841MD )resuybdesuebnac(deificepstoN
4841MD )tigidrewol(tnuocesluptuptuO:noitcnuflortnocnwod/pu-pmaR)535,56ot0(
5841MD )tigidreppu(tnuocesluptuptuO:noitcnuflortnocnwod/pu-pmaR)535,56ot0(
6841MD )71ot11(edocrorrE:noitcnuflortnocnwod/pu-pmaR
9941MDot7841MD )resuybdesuebnac(deificepstoN
9651MDot5651MD )resuybdesuebnac(deificepstoN
9751MDdna8751MD )resuybdesuebnac(deificepstoN
9951MDot0851MD .oNecivedyalpsiD:lenapecafretnirotarepO02D-VK
9961MDot4661MD )resuybdesuebnac(deificepstoN
5761MDot0761MD )resuybdesuebtonnac(metsysybdevreseR
6761MD gnittesnoissimreptfihsneercS:lenapecafretnirotarepO02D-VKedomrotareponi
1.3 Device Configuration
3-20
1
Chapter 1 Programming
* Read-only relay.
Note 1: 16-bit binary data is stored in each of the data memories as for internalregisters.
Note 2: The data stored in data memories is held even when the power is turned offor when the All Clear function is executed. The backup time is 20 days or more inthe KV-10xx, and 2 months or more in other models.
Note 3: DM1000 to DM1999 are assigned as special data memories.
.oNMD noitpircseD
9761MDot7761MDecafretnirotarepo02D-VKehtrofedomsseccatceridrofaerA
lenap
9961MDot0861MD setubirttaecivedyalpsiD:lenapecafretnirotarepO02D-VK
9971MDot4671MD )resuybdesuebnac(deificepstoN
9081MDot6081MD )resuybdesuebnac(deificepstoN
9981MDot6281MD )resuybdesuebnac(deificepstoN
*1091MD/0091MD )tigidreppu/tigidrewol(0HTCmorfdaereulavtib-42
*3091MD/2091MD )tigidreppu/tigidrewol(1HTCmorfdaereulavtib-42
*5091MD/4091MD )tigidreppu/tigidrewol(0CTCmorfdaereulavtib-42
*7091MD/6091MD )tigidreppu/tigidrewol(1CTCmorfdaereulavtib-42
*9091MD/8091MD )tigidreppu/tigidrewol(2CTCmorfdaereulavtib-42
*1191MD/0191MD )tigidreppu/tigidrewol(3CTCmorfdaereulavtib-42
3191MD/2191MD )tigidreppu/tigidrewol(0HTCotnettirweulavtnerructib-42
5191MD/4191MD )tigidreppu/tigidrewol(1HTCotnettirweulavtnerructib-42
7191MD/6191MD )tigidreppu/tigidrewol(0CTCotnettirweulavtnerructib-42
9191MD/8191MD )tigidreppu/tigidrewol(1CTCotnettirweulavtnerructib-42
1291MD/0291MD )tigidreppu/tigidrewol(2CTCotnettirweulavtnerructib-42
3291MD/2291MD )tigidreppu/tigidrewol(3CTCotnettirweulavtnerructib-42
5291MD/4291MD )tigidreppu/tigidrewol(tupniteserp0HTC
7291MD/6291MD )tigidreppu/tigidrewol(tupniteserp1HTC
*9291MD/8291MD )tigidreppu/tigidrewol(detarenegsi0TNInehwerutpactupnI
*1391MD/0391MD )tigidreppu/tigidrewol(detarenegsi1TNInehwerutpactupnI
*3391MD/2391MD )tigidreppu/tigidrewol(detarenegsi2TNInehwerutpactupnI
*5391MD/4391MD )tigidreppu/tigidrewol(detarenegsi3TNInehwerutpactupnI
6391MD )zH(ycneuqerfteS:noitcnuftuptuoeslupycneuqerfdeificepS
7391MD noitamrofninoitcennoctinunoisnapxeO/I
8391MD eulavtimilreppU:0.oNremmirtlatigiD
9391MD eulavtimilreppU:1.oNremmirtlatigiD
0491MD
gnittestnatsnocemittupnI01:0 µ 02:1s µ 005:2s µs
sm01:6sm5:5sm5.2:4sm1:3.tesebtonnaceulavrehtoynA
3491MDot1491MD )resuybdesuebtonnac(metsysybdevreseR
4491MDnoisividnehwnacs1otnidetrevnocsnoitcurtsniforebmuN
demrofrepsinoisrevnoc
9491MDot5491MD )resuybdesuebnac(deificepstoN
0591MD )552ot0(yalpsidrorrewodniwsseccA
9991MDot1591MD )resuybdesuebnac(deificepstoN
1.3 Device Configuration
3-21
11
Chapter 1 Programming
1.3.11 Temporary Data MemoryThese data memories are used for temporary storage. When arithmetic instructionsare used, temporary data memories can be used to temporarily store the data forarithmetic operations as well as the results of arithmetic operations.
Attribute R: Read W: Write
* Both R and W are enabled when special functions are not used.
Note 1: Temporary data memories are initialized when the power is turned on.
Note 2: TM20, TM30, and TM31 are read-only, so cannot be used for writing.However, TM28 can be used for both reading and writing if special functions are notused.
Note 3: TM00 and TM01 are used by the MUL and DIV instructions. Never use themfor any other purpose.
.oNMT egasU etubirttA
00MT )LUM/VID(snoitarepocitemhtirarofdesU W/R
10MT )VID(snoitarepocitemhtirarofdesU W/R
72MTot20MT )resuybdesuebnac(deificepstoN W/R
82MTelihweulavtesdnoyeb)sm1:eludom(emitnacsserotS
.demrofrepsinoitarepoemitnacstnatsnoc*R
92MTemitnacstnatsnocfo)sm1:eludom(eulavtesserotS
noitarepoW/R
03MT .nevigsinoitpurretni3TNInehweulav0CTCserotS *R
13MT01yrevefoeulavnaem(emitnacsderusaemserotS
.)sm1.0:eludom()snacsR
1.3 Device Configuration
3-22
1
Chapter 1 Programming
1.3.12 Relay Nos. and FunctionsAssignment of Relay Nos.The components of a relay no. are shown below.
Unit Nos.
Unit nos. are assigned to units within the KV-300 system, with the unit connected tothe right of the KV-300 CPU (see the figure below) assigned as no. 7. The CPU isassigned as unit no. 0.
Address Nos.
Address nos. are assigned to the input units, output units, and I/O terminal units.The following table shows the assignment of address nos. to units.
* The KV-R1A I/O Distribution Unit accommodates 5 input units and 5 output units.Addresses are set with address switches.
0 7 5 1 5
Address No.
Channel No. Relay No. (00 to 15)
Module No. (07 to 17)Input (0 to 4) Output (5 to 9)
Power supply unit CPU
0 7 8 9 16 17
Unit Address No.
KV-300 CPU CPU 0, 5
KV-C16X 16-input unit 0
KV-C32X 32-input unit 0. 1
KV-B16R 16-output unit 5
KV-B16S 16-output unit 5
KV-C32T 32-output unit 5, 6
KV-R8X 8-input terminal unit 0 to 4 *
KV-R16X 16-input terminal unit
KV-R8R 8-output terminal unit 5 to 9 *
KV-R16R 16-output terminal unit
KV-R8T 8-output terminal unit
KV-R16T 16-output terminal unit
1.4 Special Functions
3-23
11
Chapter 1 Programming
1.4 Special FunctionsThis section describes special functions to set and confirm operations on the VisualKV Series, and useful functions for program debugging and adjustment of externalequipment.
1.4.1 Input Time Constant Change FunctionThe input time constant can be changed when a signal is read from an input contact.When connecting external equipment which has no contact in which chattering suchas transistor outputs does not occur, and inputting pulses of short width, the inputtime constant change function can be used to decrease the input time constant.
Setting the input time constant for basic units using special utility relaysThe input time constant for a basic unit can be changed using data memory DM1940and special utility relay 2813.Though the input time constant is usually 10 ms, it can be changed to a value thatcorresponds to the number stored in DM1940 by setting special utility relay 2813 toON.If the HSP instruction and special utility relay 2813 are used at the same time,priority is given to the HSP instruction and the number stored in DM1940 is ignored.
Special utility relay 2813OFF: Sets the input time constant to 10 ms.ON: Refers to the number stored in DM1940, then determines the input time
constant.
Note 1: Be sure to set the input time constant to 10 µs when using the 30-kHz high-speedcounter input.
Note 2: Never enter a number that is 7 or larger to data memory DM1940.
Note 3: The input time constant specified by data memory DM1940 becomes effective at therising edge of special utility relay 2813.
To change the input time constant, first change data memory DM1940, then set special utilityrelay to OFF and ON again. Or change the operation mode of the KV basic unit fromPROGRAM to RUN.
Note 4: The input time constant for input relays set by the HSP instruction is 10 µs.
For more about the HSP instruction, refer to "HSP instruction" (p.3-86).
For more about setting the input time constant for expansion units, refer to "Input timeconstant for expansion units" (p.1-76).
Note 5: Set the special utility relay using the SET/RES instructions.
Note 6: When the input time constant is set to 1 ms or less, connect the output equipmentwithout contacts. If connecting output equipment with contacts, contact bounds may enter.
Note 7: Except for interrupts and high-speed counters, signals whose ON time is shorter thanthe scan time may not be received even if the input time constant is set to a small value.
0491MDniderotsrebmuN tnatsnocemittupnI0 01 µs1 02 µs2 005 µs3 sm14 sm5.25 sm56 sm01
eromro7 dewollatoN
1.4 Special Functions
3-24
1
Chapter 1 Programming
1.4.2 Modifying the Input Relay Time Constant Modifying with External Switches
KV-C32X/C16X KV-R16X/R8X
As shown in above figures, an external switch can be used to select the input timeconstant only on the KV-C32X/C16X Connector Input Units and KV-R16X/R8X I/OTerminal Units.
In the following table, white represents the switch position.
Note: Connect a solid-state contact output device when the input time constant isset to 1 ms for 25 µs. Connection of a contact output device may result in contactbounce.
Modification within the CPUThe input time constant for KV-300 CPU input relay nos. 0000 to 0009 can bemodified in the program.
Note 1: When using the 30 kHz high-speed counter input, turn ON special utilityrelay 2813.
Note 2: When special utility relay 2813 is ON, the input time constant of input relays0000 to 0009 is set to 10 µs ±20%.
Note 3: The input time constant remains 10 ms ±20% if the HSP instruction is usedwhen special utility relay 2813 is ON.
Note 4: When the input time constant is set to 10 µs or 25 µs, a solid-state outputdevice must be connected. Connection of a contact output device may result incontact bounce.
5V24V 10 ms0 ms1 ms
43
2
10
1 ms0 ms 10 ms
Input time constant selection switch
Input time constant KV-C32X/C16X KV-R16X/R8X
25 µs ±20%
1 ms ±20%
10 ms ±20%
0ms 1ms 10ms
0ms 1ms 10ms
0ms 1ms 10ms
0ms 1ms 10ms
0ms 1ms 10ms
0ms 1ms 10ms
Input time constant Setting
10 µs ±20% Turn ON special utility relay 2813 (0000 to 0009).
25 µs ±20% Use the HSP instruction.
10 ms ±20% Default
KV-300 PLC Only
1.4 Special Functions
3-25
11
Chapter 1 Programming
1.4.3 Constant Scan Time ModeThis function executes a program while keeping the scan time at a constant valuewhich usually changes based on the processing contents. This section describeshow to set this function.
Though the scan time changes usually depending on the processing contents, it canbe kept at a constant value by using this function. This function can be used toacquire data from external equipment at a constant time interval.The set value should be longer than the maximum scan time because the scan timeis kept at a constant value until the end of processing.
Setting procedureSet the desired scan time to temporary data memory TM29.Set special utility relay 2303 to ON.The scan time is written to TM31.The scan time can be set in 1-ms increments.Enter the desired scan time (ms) to the temporary data memory.
Setting example
In this example, the scan time is kept at 20 ms.
Note 1: Be sure to set the constant scan time value so it is larger than the actualscan time.
Note 2: If the actual scan time exceeds the set scan time, special utility relay 2304turns ON (during the next 1 scan) while the actual scan time is written to TM28 (unit:1 ms).
Note 3: The scan time can be set up to 200 ms in temporary data memory TM29. Ifa value larger than 200 ms is input, it will be treated as 200 ms.
2008 2303SET
TM29STA
#00020LDA
1.4 Special Functions
3-26
1
Chapter 1 Programming
1.4.4 Output Disabled FunctionThis function disables outputs from each unit in RUN mode without regard to theprogram used. By disabling external outputs, the program can be debugged whileexternal equipment is connected, even when output of signals to the externalequipment is not desired.
Setting procedureWhen special utility relay 2300 turns ON, all outputs from all output relays (0500 to0915) to the outside are cleared after 1 scan is finished.However, the display in the Access Window and the output indicator lamps are notcleared.
Setting example
By setting/resetting special utility relay 2300 using the Access Window, the "KVIncrediWare (DOS)" or "LADDER BUILDER for KV" programming support software,or the KV-P3E(01) handheld programmer, the external output prohibition functioncan be used.External outputs are prohibited while input 0000 is ON. External outputs are permit-ted, though, while input 0000 is OFF.
For more about operating procedures, refer to the "Chapter 6. Handheld Programmer" (p.1-195).
1.4.5 Input Refresh Disabled FunctionThis function disables the update of inputs from each unit triggered by input signalsfrom external equipment.By disabling external input refresh, inputs from each unit can be set to ON/OFF inmonitor status without mechanical operations to enable a program check.
Setting procedure
When special utility relay 2301 turns ON, input refresh (read of input relays) for allinput relays (0000 to 0415 used by the QL Series) is skipped.In this status, inputs can be set to ON/OFF from the Access Window, the "KVIncrediWare (DOS)" or "LADDER BUILDER for KV" programming support software,or the KV-P3E(01) handheld programmer.
Setting exampleBy setting/resetting special utility relay 2301 using the Access Window, the "KVIncrediWare (DOS)" or "LADDER BUILDER for KV" programming support software,or the KV-P3E(01) handheld programmer, the external input refresh prohibitionfunction can be used.External input refresh is prohibited while input 0000 is ON. External input refresh ispermitted, though, while input 0000 is OFF.
For more about operating procedures, refer to the "Chapter 6. Handheld Programmer" (p.1-195).
Note: Once external input refresh is prohibited, it can be permitted only by settingspecial utility relay 2301 to OFF from the Access Window, the "KV IncrediWare(DOS)" or "LADDER BUILDER for KV" programming support software, or the KV-P3E(01) handheld programmer.
0000 2300
0000 2301
1.5 Extended Ladder Diagrams
3-27
11
Chapter 1 Programming
1.4.6 Contact Comment Save Function• This function transfers contact comments to the Visual KV Series using the "KV
IncrediWare (DOS)" or "LADDER BUILDER for KV" programming supportsoftware.
• The Visual KV Series can store not only programs but also comments registeredto each contact using the "KV IncrediWare (DOS)" or "LADDER BUILDER forKV" programming support software.A program may not be easy to understand if only device Nos. are used. Byregistering comments to the contacts, the program can be easily debugged andmore efficiently maintained.
• The number of contact comments that can be transferred is up to 1,000 for bothnormal transfer and compression transfer.
• The KV-D20 operator interface panel includes the contact comment displayfunction.
For more about operating procedures, refer to "2.5 Entering Comments/Labels" (p.1-46) and "4.2.2Setting the comment transfer" (p.2-138).
Note 1: Line comments cannot be stored.
Note 2: The KV-P3E(01) handheld programmer cannot read or write contact com-ments.
Note 3: The KV-D20 operator interface panel cannot display contact commentswhich have been compressed and transferred.
1.4 Special Functions
3-28
1
Chapter 1 Programming
1.4.7 Special FunctionsConstant Scan Time Mode
In this mode, operation can take place according to a preset scan time (in ms).
Setting
Write the desired scan time into TM29 (temporary data memory), then turn onspecial utility relay No. 2303. The scan time can also be written into TM31. Specify ascan time in increments of 10 ms (a value of less than 10 ms is invalid).Here, write a value into TM equivalent to 10 times the scan time.
ExampleSet the constant scan time to 20 ms.
Note 1: The set value for the constant scan time must be greater than the actualscan time. Otherwise, special utility relay 2304 turns on during every scan to disableconstant scan time mode.
Note 2: If the scan time exceeds the set value, special utility relay no. 2304 turns onduring the next scan.
Output Disabled FunctionDuring checking of a program, this function clears output from output relays regard-less of the program currently running.
SettingTurn on special utility relay No. 2300. After one scan is completed, all output relays(00500 to 00503, 07500 to 17915) are cleared.
Example
Use the output disabled function by executing FORCED RESET/RESET to specialutility relay No. 2300 from the monitor display. To execute FORCED RESET or RESET, refer to "Chapter 6 Handheld Programmer" (p.1-195).
Input Refresh Disabled FunctionSet this function if it is desired to turn ON/OFF input relays from the monitor displaywithout activating the machine when checking a program.
Setting
Turn ON special utility relay No. 2301 to skip input refresh (reading from inputrelays). Input relays can then be turned ON/OFF with the KV-P3E(01) or with KVIncrediWare (DOS) on the monitor display.
Example
Set input relay No. 0000 to ON to disable input refresh; set to OFF to enable inputrefresh.
Note: If input refresh is disabled, it is not enabled until input relay No. 0000 is turnedon from the handheld programmer.
LDA STA SET
02008 #00200 TM29 2303
0000 2301
KV-300 PLC only
1.5 Extended Ladder Diagrams
3-29
11
Chapter 1 Programming
1.5 Extended Ladder DiagramsThis section describes KEYENCE’s unique extended ladder diagram.
1.5.1 Features of Extended Ladder DiagramsThe extended ladder diagram is a programming method developed to reduceproblems related to design, testing, operation, and maintenance of programs.In a conventional ladder diagram, output instructions can be written only on the rightside of a ladder diagram. On the other hand, in an extended ladder diagram, outputinstructions can be written anywhere except on the left. As the result, the programsshown below can be written.
Mixture of input and output circuits
Conventional ladder diagram Extended ladder diagram
Connection of two or more instructions on one line
Conventional ladder diagram Extended ladder diagram
Branch from output coil
Conventional ladder diagram Extended ladder diagram
Only input circuitscan be written.
Only outputcircuits canbe written.
Only inputcircuits canbeassembled.
Both inputcircuits andoutput circuitscan beassembled.
Only outputcircuits canbeassembled.
Instructions can be written only from theleft end to the right end on one line.
Many instructions can be connected.
There is only a single line, so the ladderdiagram is easier to understand.
Branches can be made only from inputcontacts.
Three lines are required.
Branches can also be made from outputcoils.
1.5 Extended Ladder Diagrams
3-30
1
Chapter 1 Programming
2010
20102002
2010 0502
0501
0500#01000CMP
DM0000LDA
#02000CMP
#03000CMP
2002 DM0000LDA
#01000CMP
2002
2010
#02000CMP
0500
0501
2002
2010
#03000CMP
2010 0502
In a conventional ladder diagram, operationsperformed by the program cannot be easilyunderstood. In an extended ladder diagram,operations performed by the program can beunderstood at a glance.
When the start switch (0000) is set to ON, a lamp (0500) is lit andtimer 0 is activated.
0000 1100
T000
T001
0500
0501
0502 0000
1000STG
1001STG
#00030T000
#00020T001
1002STG
1001JMP
1002JMP
ENDS
1100DIFU
1000SET
When timer 0 turns ON three seconds later, the lamp goes out, abuzzer (0501) is sounded, and timer 1 is activated.
When timer 1 turns ON two seconds later, the buzzer is stoppedand the motor (0502) starts to rotate.
When the start switch (0000) is set to OFF, the motor is stoppedand all operations are reset.
0000
T002
T001
T000
1000
0500 0501
0501
0500
0500
0000
1000
T002
1001
T000
T001
T002
1001
0501
1002
T000
1002
T001
1003
1001
1003
1002
1003
#00010T000
1000DIFU
1001STG
1001JMP
1003JMP
1002JMP
#00030T002
#00020T001
#00010T000
1000DIFU
1002STG
1003STG
#00020T001
1003
#00030T002
1001SET
By using an extended ladder diagram as shownabove, the program can be executed in thesequence of the processing to be performed. Soeven a person who uses a relay sequence for thefirst time can understand the processing contents.By combining the STG instruction, double coilscan also be used.
1.5.2 Advantages of Extended Ladder DiagramsThe number of lines in a ladder diagram can be reduced.Because both output instructions and input instructions can be written side by side,the number of program lines can be reduced.As the result, the contents of the program can be seen at a glance.
ExampleWhen DM0000 stores 1000, 0500 turns ON.
2000, 0501 turns ON.3000, 0502 turns ON.
Conventional ladder diagram Extended ladder diagram
Processing sequence is clear.Ladder symbols can be laid out in processing sequence, so the program flow iseasier to understand. In addition, maintainability is considerably improved.
ExampleWhen the start switch is set to ON, a lamp is lit for three seconds, a buzzer issounded for two seconds, and then the motor starts to rotate.
Conventional ladder diagram Extended ladder diagram
1.5 Extended Ladder Diagrams
3-31
11
Chapter 1 Programming
0501
05000000
LD 0000OUT 0500OUT 0501
LD 0000OUT 0500CONOUT 0501
050105000000
The CON instruction for connection is added.(The scan time is not affected.)
At the rising edge of input0001, 1002 turns ON.
0001
1000
1002 0000
0002
1000
1001
1003 1000 1001
1001 0500
1003DIFU
1002DIFU
05000000 10000001
1000
10010002
1001
At the rising edge of input1003, 1002 turns ON.If input 0000 is ON, 1000turns ON.
If 1000 is ON, 1001 turns ON.
When 1001 turns ON, output 0500turns ON.
Input 0000turns ON.
Input 0001turns ON.
Input 0002turns ON.
Output 0500turns ON.
Note: When an extended ladder diagram is used, the number of lines in ladderdiagram may be reduced. However, this may not necessarily reduce the number ofmnemonics in the program.
Conventional ladder diagram Extended ladder diagram
1.5.3 Example of an Extended Ladder Diagram Using W-UE
Only when inputs are given in the order "0000 0001 0002", output 0500 turnsON.
Conventional ladder diagram Extended ladder diagram
Because the program can be written in only one line when an extended adderdiagram is used, it is easier to look at and understand compared with a programwritten using a conventional ladder diagram.
1.5 Extended Ladder Diagrams
3-32
1
Chapter 1 Programming
Chapter 2Instructions
Describes the concrete usage of instructions in the KV Series.Refer to "Chapter 3 Interrupts" on page 3-191 for details of interrupt instructions.Refer to "Chapter 4 High-speed counters" on page 3-203 for details of the high-speed counters used in the application instruction.
2.1 Instruction List [Visual KV Series] .......................................3-342.1.1 Basic Instructions ................................................................................. 3-342.1.2 Application Instructions ........................................................................ 3-362.1.3 Arithmetic Instructions .......................................................................... 3-382.1.4 Interrupt Instructions ............................................................................ 3-412.1.5 Function No. List (Alphabetical order) .................................................. 3-41
2.2 Instruction List [KV-300 Series, KV-10/80] ..........................3-422.2.1 Basic Instructions ................................................................................. 3-422.2.2 Application Instructions ........................................................................ 3-452.2.3 Arithmetic Instructions .......................................................................... 3-482.2.4 Interrupt Instructions ............................................................................ 3-54
2.3 Convention Details .................................................................3-55
2.4 Instruction Details ..................................................................3-562.4.1 Basic Instructions ................................................................................. 3-562.4.2 Application Instructions ........................................................................ 3-952.4.3 Arithmetic Instructions .......................................................................... 3-134
2.5 Programming Notes ...............................................................3-189
2.1 Instruction List Visual KV Series
3-34
2
Chapter 2 Instructions
2.1 Instruction ListThe KV Series uses 80 instructions.The instructions are divided into four categories according to their functions: basicinstructions, application instructions, arithmetic instructions, and interrupt instruc-tions.The following is an overview of applications and functions. For details, refer to therespective description pages for each instruction.
2.1.1 Basic Instructions
Visual KV Series
LOAD LD
R No.T/C No.
LOAD BAR LDB
AND AND
AND BAR ANB
OR OR
OR BAR ORB
AND LOAD ANL
OR LOAD ORL
OUT OUT
R No.
OUT BAR OUB
SET SET
RESET RES
0.1-sTIMER TMR T No.,
# presetvalue0.01-s
TIMERTMH
(FUN49)
0000 to 17915T000 to T249C000 to C249CTC0 to CTC3
0500 to 19152009
2300 to 17915
0500 to 19152009
2300 to 17915T000 to T249C000 to C249
0500 to 19152009
2100 to 17915T000 to T249C000 to C249CTH0 to CTH1CTC0 to CTC3
000 to 249#00000 to#65535
0.7 to 1.6
0.7 to 1.6
0.7 to 0.9
0.7 to 0.9
0.7 to 0.9
0.7 to 0.9
0.8
0.8
1.5
1.5
1.9 to 12.8
1.9 to 20.5
12.0 to 17.8
12.0 to 17.8
3 (12)
3 (12)
3 (8)
3 (8)
3 (8)
3 (8)
1 (4)
1 (4)
3 (12)
3 (12)
3 (14)
3 (14)
2 (6)
2 (6)
Connects N.O. contact to bus.
Connects N.C. contact to bus.
Connects N.O. contact inseries with previous contact.
Connects N.C. contact inseries with previous contact.
Connects N.O. contact inparallel with previous contact.
Connects N.C. contact inparallel with previous contact.
Connects in series blocksmade of one or morecontacts.Connects in parallel blocksmade of one or morecontacts.
Outputs input ON/OFF statusto R coil.
Outputs inverted input ON/OFF status to R coil.
Forces relay ON and holdsthis status when input is ON.
Forces R/T/C OFF when inputis ON.
16-bit on-delay T that countsdown in 0.1-s decrements.
16-bit on-delay T that countsdown in 0.01-s decrements.
3-57
3-57
3-58
3-58
3-60
3-60
3-61
3-63
3-65
3-65
3-66
3-66
3-67
Instruction Symbol Mnemonic Operand Operand value Function Exec.time(µs) Bytes Page
R No.T/C No.
nnnn
nnnn
nnnn
nnnn
nnnn
nnnn
nnnn
nnnn
nnnnSET
nnnnRES
#ddddd
Txxx
#ddddd
TxxxTH
3-68
Visual KV Series
3-35
12
Chapter 2 Instructions
2.1 Instruction List
• Number of bytes represents the memory capacity required for each instruction.• Number in ( ) represents the memory capacity required for object code of each
instruction.• *1 34 + 0.25 + n x 0.25 (n: No. of shift steps)• All operand values are shown in normal notation. The corresponding relay num-
bers in X-Y-M notation are shown below:
Normal notation X-Y-M notation0000 to 0415 X000 to X04F0500 to 0915 Y050 to Y09F1000 to 6915 M1000 to M69157000 to 17915 X700 to X174F or Y750 to Y179F
Instruction Symbol Mnemonic Operand Operand value Function Exec.time(µs) Bytes Page
1-msTIMER
TMS(FUN51)
COUNTER C# preset value,C No., counter
input R
UP-DOWNCOUNTER
UDC(FUN52)
C No.,# preset value
#00000 to#65535
000 to 2490000 to 17915
000 to 249#00000 to
#65535
12.0 to 17.8
12.0 to 17.8
13.0 to 24.0
2 (7)
4 (7)
2 (10)
16-bit on-delay T thatcounts down in 1-msdecrements.
Sets 16-bit up-counter.
Sets a 16-bit up-downcounter.
000 to 249#0000 to #65535
3-72
3-76
3-69
DIFFEREN-TIATE UP
DIFU(FUN10)
R No.DIFFEREN-
TIATEDOWN
DIFD(FUN09)
KEEP KEEP(FUN22)
R No.
SHIFT SFT(FUN39)
nnnn: 1st RNo. mmmm:Last R No.
HIGHSPEED
HSP(FUN18) R No.
MASTERCONTROL
MC(FUN24)
MASTERCONTROL
RESET
MCR(FUN25)
MEMORYSWITCH
MEMSW(FUN26) $ constant
NOPNOP
(FUN30)
END END
END HI ENDH
1000 to 19153000 to 9915
0500 to 19152009
2100 to 17915
1000 to 19153000 to 9915
(KV-10)0000 to 0005
(KV-16)0000 to 0009
(KV-24)0000 to 0015
(KV-40)0000 to 0107
$ 0000 to$ FFFF
11.2 to 13.2
10.0 to 12.8
8.2 to 19.8
(*)
3.8 to 9.4
0.2
0.2
––
––
––
––
3 (10)
3 (10)
3 (11)
5 (15)
3 (8)
1 (4)
1 (0)
3 (0)
1 (0)
1 (1)
1 (0)
Turns ON R for 1 scantime at rising edge ofinput.Turns ON R for 1 scantime at falling edge ofinput.Turns ON R and holds thisstatus when SET input is ON.Turns OFF R when RESETinput is ON.
Sets shift register.
Reduces input relay timeconstant to 10 µs forhigher input response.
Selects ON/OFF status ofR coils, Ts, or Cs.
Represents end of MC.
Sets memory switches.
Performs no operation.
Indicates end of eachroutine of program.
Indicates end of entireprogram.
3-78
3-78
3-80
3-82
3-86
3-89
3-89
T No.,# preset value
3-94
3-94
3-94
#dddddTxxxT
S
#ddddd
nnnnCxxx
UDC xxx#ddddd
UPDWRES
nnnnDIFU
nnnn
DIFD
KEEP
SETRES
nnnn
SFTnnnn
mmmm
DCLKRES
HSPnnnn
MC
MCR
MEMSW$xxxx
END
ENDH
3-92
2.1 Instruction List Visual KV Series
3-36
2
Chapter 2 Instructions
• Number of bytes represents the memory capacity required for each instruction.• Number in ( ) represents the memory capacity required for object code of each
instruction.• All operand values are shown in normal notation. The corresponding relay
numbers in X-Y-M notation are shown below:
Normal notation X-Y-M notation0000 to 0415 X000 to X04F0500 to 0915 Y050 to Y09F1000 to 6915 M1000 to M69157000 to 17915 X700 to X174F or Y750 to Y179F
2.1.2 Application Instructions
Instruction Symbol Mnemonic Operand Operand value FunctionExec.time
(µs) Bytes Page
WAIT ON
WAIT OFF
WAIT UPEDGE
WAITDOWNEDGE
CONNECT
PUSH
READ
POP
W-ON
W-OFF
W-UE
W-DE
CON(FUN 06)
MPS
MRD
MPP
nnnn:R, T, CNos.
mmmm:R No.R No.
17915T000 to T249C000 to C249CTC0 to CTC3
mmmm:1000 to 19153000 to 99151000 to 1915
10.4 to 12.6
13.6 to 18.5
13.6 to 18.5
6.8 to 5.3
3.2
6.8
10.5 to 13.0
5 (12)
5 (12)
5 (12)
1 (0)
1 (4)
1 (4)
1 (4)
R (output operand [mmmm])when R, T, or C (input operand[nnnn]) is ON.
Turns ON R (output operand[mmmm]) at falling edge of R, T,or C (input operand [nnnn]).Represents series connectionof output instruction togetherwith another instruction.
Stores input status andarithmetic flag.
Reads input status andarithmetic flag stored withPUSH.
3-96
3-96
3-98
3-98
3-102
STEP
STEP END
STP(FUN 45)
STE(FUN 43)
R No.nnnn:
0000 to
0500 to 9915T000 to T249C000 to C249CTC0 to CTC3
11.2 to 13.4
2.5
5 (12)
3 (10)
1 (0)
Reads & clears input statusand arithmetic flag storedwith PUSH.
Is used with STEP to makeprogram step.
STAGE
JUMP
ENDSTAGE
STG(FUN 44)
JMP(FUN 21)
ENDS(FUN 14)
R, T, CNos.
3000 to 99150000 to 0009
4.5 to 12.5
4.3 to 7.5
3 (10)
3 (8)
1 (4)
Turns ON
Turns ON R (output operand[mmmm]) when R, T, or C (inputoperand [nnnn]) is OFF.Turns ON R (output operand[mmmm]) at rising edge of R, T,or C (input operand [nnnn]).
Executes instructions in STGblock when R (operand) is ON.
When input is ON, turns R ofcurrent stage OFF and movesto stage specified by operand.
Turns current stage OFF andnext stage ON when input isON.
Executes program betweenSTP & STE when R (oper-and) is ON.
3-103
3-103
3-106
3-106
3-106
3-114
3-114
nnnnON
mmmm
nnnnOFF
mmmm
nnnn
mmmm
nnnn
mmmm
nnnn
STG
nnnn
JMP
ENDS
STPnnnn
STE
3-103
Visual KV Series
3-37
12
Chapter 2 Instructions
2.1 Instruction List
• Number of bytes represents the memory capacity required for each instruction.• Number in ( ) represents the memory capacity required for object code of each
instruction.• All operand values are shown in normal notation. The corresponding relay
numbers in X-Y-M notation are shown below:
Normal notation X-Y-M notation0000 to 0415 X000 to X04F0500 to 0915 Y050 to Y09F1000 to 6915 M1000 to M69157000 to 17915 X700 to X174F or Y750 to Y179F
Instruction Symbol Mnemonic Operand Operand value Function Exec.time(µs) Bytes Page
INTERVALTIMER
16-BITCOUNTER
16-BITCOUNTERCOMPARA-
TOR
16-BITCOUNTER
16-BITCOUNTERCOMPARA-
TOR
SUBROUTINECALL
ITVL
CTH
CTC
CALL(FUN 03)
SBN(FUN 38)
RET(FUN 33)
DMnnnn:DM No.mmmm: RNo.
Count inputR
n:Comparator
No.ddddd:# preset
value
n:Comparator
No.ddddd:
# presetvalue
SubroutineNo.
DMnnnn:DM0000 toDM1985mmmm:
1000 to 19123000 to 9912
0004210021012102
n: 0,1ddddd: #00001
to #65535
00050500220022012202
20.0 to 80.0
14.4
2.3 to 3.5
5.4 to 6.5
4.3
5 (10)
4 (6)
2 (6)
4 (6)
2 (6)
2 (8)
Measures pulse-to-pulseinterval & pulse width inspecified mode.
16-bit (0 to 65535) up-down counter for clockpulses with input responsefrequency of 30 kHz.
Hardware-based comparatorbetween preset & currentvalues of high-speed counter(CTH0). This comparator isturned ON when thesevalues are equal.
Executes subroutinespecified by operand.
Represents beginning ofsubroutine specified byoperand.
Represents end ofsubroutine.
3-117
3-204
3-204
3-204
REPEATSTART
REPEAT END
16-KEY INPUT
FOR(FUN 16)
NEXT(FUN 29)
HKEY(FUN 17)
# constant,DM No.TMxx
nnnn:Input Rmmmm:Output R
#00000 to#65535
DM0000 toDM1999
TM00 to TM29
nnnn:0000 to 415
mmmm:0500 to 915
12.0 to18.0
0.5
22.1 to180.0
3 (20)
1 (4)
5 (10)
Executes programbetween FOR & NEXTfor number of timesspecified by operand.
Represents end ofrepetition.
Reads 16-key data bytime-sharing and outputsthese data into specialutility Rs 2900 to 2915.
3-125
3-125
SUBROUTINEENTRY
SUBROUTINERETURN
CTH
CTC
Count inputR
SubroutineNo.
n: 2,3ddddd: #00001
to #65535
00 to 99
00 to 99
14.4
2.3 to 3.5
2 (4)
1 (4)
16-bit (0 to 65535) up-down counter for clockpulses with inputresponse frequency of 30kHz.
Hardware-based comparatorbetween preset & currentvalues of high-speed counter(CTH1). This comparator isturned ON when thesevalues are equal.
3-204
3-122
3-122
3-131
ITVLPLSDMnnnnPAUSEmmmmRES
CTH0nnnn
CTCn#ddddd
CTH1nnnn
CTCn#ddddd
CALLnn
SBNnn
RET
FORnnnn
HKEYnnnn
mmmm
NEXT
3-122
2.1 Instruction List Visual KV Series
3-38
2
Chapter 2 Instructions
• Number of bytes represents the memory capacity required for each instruction.• Number in ( ) represents the memory capacity required for object code of each
instruction.
2.1.3 Arithmetic Instructions
Instruction Symbol Mnemonic Operand Operand value Function Exec.time(µs) Bytes Page
DATAMEMORY
WRITE
TRIMMERSETTING
LOAD A
STORE A
COMPARE
ADD
SUBTRACT
MULTIPLY
DW
TMIN(FUN 50)
@TMIN@(FUN 50)
LDA(FUN 23)
@LDA@(FUN 23)
STA(FUN 42)
@STA@(FUN 42)
CMP(FUN 04)
@CMP@(FUN 04)
ADD(FUN00)
@ADD@(FUN 00)
SUB(FUN 46)
@SUB@(FUN 46)
MUL(FUN 28)
@MUL@(FUN28)
nnnn:#/$ constantDMmmmm:
DM No.
Trimmer No.
R No.,C/T No.,DM No,TM xx,
#/$ constant,#TMxx
R No.,C/T No.,DM No.,TM xx,#TMxx
DM/TM No.TMxx,
#/$ constant,#TMxx
nnnn:#0000 to#65535
$0000 to$FFFF
DMmmmm:DM0000 toDM1999
0 to 1
0000 to 17915T000 to T249C000 to C249CTH0 to CTH1
DM0000 toDM1999
TM00 to TM31#00000 to
#65535$0000 to $FFFF
#TM00 to#TM29
0500 to 19152100 to 17915T000 to T249C000 to C249
CTH0 toCTC3
DM0000 toDM1999
TM00 to TM29#TM00 to#TM29
DM0000 toDM1999
TM00 to TM31#00000 to
#65535$0000 to$FFFF
#TM00 to#TM29
8.0
8.9
20.9
6.4 to 14.0
18.4 to 26.0
6.6 to 28.5
18.0 to 40.5
10.8 to 35.6
22.8 to 47.6
9.4 to 34.2
21.4 to 46.2
10.8 to 35.6
22.8 to 47.6
14.4 to 38.1
26.4 to 50.1
5 (8)
1 (6)
1 (16)
3 (8)
3 (18)
3 (8)
3 (18)
3 (6)
3 (16)
3 (6)
3 (16)
3 (6)
3 (16)
3 (6)
3 (16)
Writes constant into datamemory.
Inputs value set byaccess window’s digitaltrimmer (0 to 65535) tointernal register.
Inputs value specified byoperand into internalregister or inputs currentvalue when T/C isspecified as operand.
Transfers content ofinternal register tolocation specified byoperand, or changespreset value when T/C isspecified as operand.
Compares content ofinternal register andvalue specified byoperand.
Adds content of internalregister and valuespecified by operand andinputs result back tosame register.
Subtracts value specifiedby operand from contentof register and inputsresult back to sameregister.
Multiplies content ofinternal register by valuespecified by operand andinputs result back tosame register.
3-136
3-138
3-140
3-140
3-150
3-150
nnnn
DMmmmmDW
n TMIN
n TMIN
nnnnLDA
nnnnLDA
nnnnSTA
nnnnSTA
nnnnCMP
nnnnCMP
nnnnADD
nnnnADD
nnnnSUB
nnnnSUB
nnnnMUL
nnnnMUL
3-150
3-146
Visual KV Series
3-39
12
Chapter 2 Instructions
2.1 Instruction List
• Number of bytes represents the memory capacity required for each instruction.• Number in ( ) represents the memory capacity required for object code of each
instruction.• All operand values are shown in normal notation. The corresponding relay num-
bers in X-Y-M notation are shown below:
Normal notation X-Y-M notation0000 to 0415 X000 to X04F0500 to 0915 Y050 to Y09F1000 to 6915 M1000 to M69157000 to 17915 X700 to X174F or Y750 to Y179F
@DIV@(FUN 11)
Instruction Symbol Mnemonic Operand Operand value Function Exec.time(µs) Bytes Page
DIVIDE
DIV(FUN 11)
17.4 to 43.3
29.4 to 55.3
3 (6)
3 (16)
Divides content of internalregister by value specifiedby operand and inputsresult back to sameregister.
R No.,DM No.,TM xx,
#/$ constant,#TMxx
DM0000 toDM1999
TM00 to TM31#00000 to
#65535$0000 to$FFFF
#TM00 to#TM29
AND A
OR A
EXCLUSIVEOR A
SHIFTRIGHT A
SHIFT LEFTA
ROTATERIGHT A
ROTATELEFT A
ANDA(FUN 01)
@ANDA@(FUN 01)
ORA(FNC 31)
@ORA@(FUN 31)
EORA(FUN 15)
@EORA@(FUN 15)
SRA(FNC 41)
@SRA@(FUN 41)
SLA(FNC 40)
@SLA@(FUN 40)
RRA(FUN 37)
@RRA@(FUN 37)
RLA(FUN 35)
@RLA@(FUN 35)
R No.,DM No.,TM xx,
#/$ constant,#TMxx
R No.,DM No.,TM xx,
#/$ constant,#TMxx
# constant
0000 to 17915DM0000 to
DM1999TM00 to TM31
#00000 to#65535
$0000 to$FFFF
#TM00 to#TM29
0000 to 17915DM0000 toDM1999
TM00 to TM31#00000 to#65535
$0000 to$FFFF
#TM00 to#TM29
8.2 to 33.1
20.2 to 45.1
8.2 to 33.1
20.2 to 45.1
8.2 to 33.1
20.2 to 45.1
9.3 to 27.6
21.3 to 39.6
9.2 to 27.6
21.2 to 39.6
10.3 to 28.6
22.3 to 40.6
10.3 to 28.6
22.3 to 40.6
3 (8)
3 (18)
3 (8)
3 (18)
3 (8)
3 (18)
2 (6)
2 (16)
2 (6)
2 (16)
2 (6)
2 (16)
2 (6)
2 (16)
ANDs each of 16 bits ofinternal register and thatof value specified byoperand, and inputs resultback to same register.
ORs each of 16 bits ofinternal register and thatof value specified byoperand, and inputs resultback to same register.
EXCLUSIVE-ORs each of16 bits of internal registerand that of value specifiedby operand, and inputsresult back to sameregister.
Moves content of internalregister serially left byvalue specified byoperand.
Rotates contents ofinternal register and carrybit (2009) clockwise byoperand value.
Rotates contents ofinternal register and carrybit (2009) counterclock-wise by operand value.
Moves content of internalregister serially right byvalue specified byoperand.
3-159
3-161
3-164
3-166
#01 to #16
3-166
3-169
nnnnDIV
nnnnDIV
nnnnANDA
nnnnANDA
nnnnORA
nnnnORA
nnnnEORA
nnnnEORA
#ddSRA
#ddSRA
#ddSLA
#ddSLA
#ddRRA
#ddRRA
#ddRLA
#ddRLA
3-169
3-150
2.1 Instruction List Visual KV Series
3-40
2
Chapter 2 Instructions
• Number of bytes represents the memory capacity required for each instruction.• Number in ( ) represents the memory capacity required for object code of each
instruction.• All operand values are shown in normal notation. The corresponding relay
numbers in X-Y-M notation are shown below:
Normal notation X-Y-M notation0000 to 0415 X000 to X04F0500 to 0915 Y050 to Y09F1000 to 6915 M1000 to M69157000 to 17915 X700 to X174F or Y750 to Y179F (OUTPUT)
Converts content ofinternal register (4-digitBCD) into 16-bit binarydata.
Converts content ofinternal register (16-bitbinary) into 4-digit BCDdata.
DEMULTI-PLEXER
TRANSFERBCD
TRANSFERBIN
ASCIICONVERT
REVERSEASCII
CONVERT
SQUAREROOT
DMX(FUN 12)
@DMX@(FUN 12)
TBCD(FUN 47)
@TBCD@(FUN 47)
TBIN(FUN 48)
@TBIN@(FUN 48)
ASC(FUN 02)
@ASC@(FUN 02)
RASC(FUN 32)
@RASC@(FUN 32)
ROOT(FUN 36)
@ROOT@(FUN 36)
22.6
34.6
5.6
17.6
9.6
21.6
9.7
21.7
9.3
21.3
95.7 1 (4)
1 (4)
1 (14)
1 (4)
1 (14)
1 (14)
1 (4)
1 (14)
1 (4)
1 (14)
1 (4)
1 (14)
Converts position ofhighest order bit with 1 ininternal register into 4-bitdata.
Converts content of lowerorder 8 bytes of internalregister into 2-digit ASCIIcode.
Converts 2-digit ASCIIcode of internal registerinto 2-digit numericalvalue.
Takes square root of 32-bit data (TM00: higherorder byte, internalregister: lower order byte)and inputs result back tosame register.
3-176
3-180
3-180
3-183
3-183
Instruction Symbol Mnemonic Operand Operandvalue
Function Exec.time(µs) Bytes Page
COMPLE-MENT
INCREMENTMEMORY
DECRE-MENT
MEMORY
MULTI-PLEXER
COM(FUN 05)
@COM@(FUN 05)
INC(FNC 19)
@INC@(FUN 19)
DEC(FNC 07)
@DEC@(FUN 07)
MPX(FUN 27)
@MPX@(FUN 27)
DM/TM No.
DM/TM No.
DM0000 toDM1999TM00 to
TM29
5.6
17.6
9.8
21.8
10.4
22.4
10.1
22.1
1 (4)
1 (14)
3 (6)
3 (16)
3 (6)
3 (16)
1 (6)
1 (16)
Inverts content of each bitin internal register.
Adds 1 to content of datamemory specified byoperand.
Subtracts 1 from contentof data memory specifiedby operand.
Converts 4-bit data(specified by operand) ofinternal register into 16-bitdata.
3-171
3-172
3-172
# constant
DM0000 toDM1999TM00 toTM29
#0 to #3
COM
COM
nnnnINC
nnnnINC
nnnnDEC
nnnnDEC
#nMPX
#nMPX
DMX
DMX
TBCD
TBCD
TBIN
TBIN
ASC
ASC
RASC
RASC
ROOT
ROOT
3-185
3-176
107.7
Visual KV Series
3-41
12
Chapter 2 Instructions
2.1 Instruction List
• Number of bytes represents the memory capacity required for each instruction.• Number in ( ) represents the memory capacity required for object code of each
instruction.• All operand values are shown in normal notation. The corresponding relay
numbers in X-Y-M notation are shown below:
Normal notation X-Y-M notation0000 to 0415 X000 to X04F0500 to 0915 Y050 to Y09F1000 to 6915 M1000 to M69157000 to 17915 X700 to X174F or Y750 to Y179F
2.1.5 Function No. List (Alphabetical order)The following list shows the function Nos. used to enter instructions with the KV-P3E(01) handheld programmer. Refer to "Chapter 6 Handheld Programmer" on page 1-195 for details.
Reference: To find function No. assigned to desired function:1. Press the [FUN] key.2. When the cursor appears at the position where the function No. is to be entered,
press the ON or OFF key and scroll the functions and assigned Nos. to find thedesired function.
2.1.4 Interrupt Instructions
Instruction Symbol Mnemonic Operand Operand value Function Exec.time(µs) Bytes Page
INTERRUPTDISABLED
INTERRUPTENABLED
INTERRUPT
RETURNINTERRUPT
DI(FUN 08)
EI(FUN 13)
INT(FUN 20)
RETI(FUN 34)
R No.
ComparatorNo.
000 to 003
CTC0 toCTC3
2.2
4.0
60.0 to90.0
60.0 to90.0
18.0 to22.0
1 (12)
1 (10)
1 (8)
1 (4)
Disables execution ofinterrupt.
Enables execution ofinterrupt.
Executes interruptinstructions between INTand RETI at rising/fallingedge of input relays 0000through 0003.
Used with comparatorsCTC0 to CTC3 andexecutes instructionsbetween INT and RETI.
Represents end ofinterrupt.
3-193
3-193
3-192
3-1921 (8)
3-192
DI
EI
INTnnnn
INTCTCn
RETI
.oNnoitcnuF noitcurtsnI
00 DDA
10 ADNA
20 CSA
30 LLAC
40 PMC
50 MOC
60 NOC
70 CED
80 ID
90 DFID
01 UFID
11 VID
21 XMD
.oNnoitcnuF noitcurtsnI
62 WSMEM
72 XPM
82 LUM
92 TXEN
03 PON
13 ARO
23 CSAR
33 TER
43 1TER
53 ALR
63 TOOR
73 ARR
83 NBS
.oNnoitcnuF noitcurtsnI
31 IE
41 SDNE
51 AROE
61 ROF
71 YEKH
81 PSH
91 CNI
02 TNI
12 PMJ
22 PEEK
32 ADL
42 CM
52 RCM
.oNnoitcnuF noitcurtsnI
93 TFS
04 ALS
14 ARS
24 ATS
34 ETS
44 GTS
54 PTS
64 BUS
74 DCBT
84 NIBT
94 HMT
05 NIMT
15 SMT
25 CDU
KV-300 Series, KV-10/802.2 Instruction List KV-300 Series,
3-42
2
Chapter 2 Instructions
2.2 Instruction List• Number of bytes represents the memory capacity required for each instruction.• Number in ( ) represents the memory capacity required for object code of each
instruction.• Abbreviations: R: Relay, T: Timer, C: Counter, #: Decimal, $: Hex.
2.2.1 Basic InstructionsKV-10/16/24/40/80
KV-300 Series, KV-10/80
nnnnLOAD
nnnn
nnnn
nnnn
nnnn
nnnn
nnnn
nnnn
(SET)nnnn
LD
R No.T/C No.
LOAD BAR LDB
AND AND
AND BAR ANB
OR OR
OR BAR ORB
AND LOAD ANL
OR LOAD ORL
OUT OUT
R No.
OUT BAR OUB
SET SET
RESET RES
0.1-s TIMER TMR
T No.,# preset
value
0.01-sTIMER
TMH(FNC49)
1-ms TIMERTMS
(FNC51)
COUNTER C
# presetvalue, C
No., clocksource R
UP-DOWNCOUNTER
UDC(FNC52)
C No.,# preset
value
0000 to 2915T000 to T063C000 to C063CTC0 to CTC3
0500 to 19152009
2300 to 2915
0500 to 19152009
2100 to 2915T000 to T063C000 to C063
0500 to 19152009
2100 to 2915T000 to T063C000 to C063CTH0 to CTH1CTC0 to CTC3
(RES)nnnn
#ddddd
T xxx
#dddddxxxH
#dddddxxxS
nnnn
#dddddC xxx
UDCxxx#dddddUP
DWRES
000 to 063#00000 to#65535
#00000 to65535
000 to 0630000 to 6915
000 to 063#00000 to#65535
0000 to 6915T000 to T119C000 to C119CTC0 to CTC3
0500 to 19152009
2300 to 6915
0500 to 19152009
2100 to 6915T000 to T119C000 to C119
0500 to 19152009
2100 to 6915T000 to T119C000 to C119CTH0 to CTH1CTC0 to CTC3
000 to 119#00000 to#65535
#00000 to#65535
000 to 1190000 to 6915
000 to 119#00000 to#65535
1.5 to 2.5
2.1 to 3.5
1.5 to 2.5
2.7 to 4.5
1.5 to 2.5
2.7 to 4.5
1.0 to 1.4
1.0 to 1.4
5.2 to 8.4
6.4 to 10.4
3.1 to 23.0
3.1 to 24.0
17.0 to 22.0
17.0 to 22.0
17.0 to 22.0
19.0 to 21.0
21.0 to 26.0
3 (4)
3 (6)
3 (4)
3 (8)
3 (4)
3 (8)
1 (2)
1 (2)
3 (13)
3 (17)
3 (8)
3 (8)
2 (5)
2 (5)
2 (5)
4 (7)
2 (5)
Connects N.O. contactto bus.
Connects N.C. contactto bus.
Connects N.O. contactin series with previouscontact.Connects N.C. contactin series with previouscontact.Connects N.O. contactin parallel with previouscontact.Connects N.C. contactin parallel with previouscontact.Connects in seriesblocks made of one ormore contacts.Connects in parallelblocks made of one ormore contacts.Outputs input ON/OFFstatus to R coil.Outputs inverted input
ON/OFF status to Rcoil.
Forces R ON and holdsthis status when input isON.
Forces R/T/C OFFwhen input is ON.
16-bit on-delay T thatcounts down in 0.1-sdecrements.16-bit on-delay T thatcounts down in 0.01-sdecrements.16-bit on-delay T thatcounts down in 1-msdecrements.
Sets 16-bit up-counter.
Sets a 16-bit up-downcounter.
Page
3-57
3-57
3-58
3-58
3-60
3-60
3-61
3-63
3-65
3-65
3-66
3-66
3-67
3-68
3-69
3-72
KV-10/16/24/40/80
Instruction Symbol Mnemonic Operand Operand valueKV-10/16
Operand valueKV-24/40/80
Exec.time(µs)
BytesFunction
3-76
KV-300 Series, KV-10/80
3-43
12
Chapter 2 Instructions
2.2 Instruction List
KV-300
Instruction Symbol Mnemonic Operand Operand value Exec.time(µs)
BytesFunction Page
LOADnnnn
nnnn
nnnn
nnnn
nnnn
nnnn
LOAD BAR
AND
AND BAR
OR
OR BAR
AND LOAD
OR LOAD
LD
LDB
AND
ANB
OR
ORB
ANL
ORL
R No.T/C No.
0000 to 00090500 to 17915T000 to T249C000 to C249CTC0 to CTC3
0.15 to 0.70
0.15 to 0.90
0.15 to 0.50
0.15 to 0.80
0.15 to 0.50
0.15 to 0.80
0.55
0.55
3 (5)
3 (7)
3 (4)
3 (8)
3 (4)
3 (8)
1 (3)
1 (3)
Connects N.O. contactto bus.
Connects N.C. contactto bus.
Connects N.O. contactin series with previouscontact.Connects N.C. contactin series with previouscontact.Connects N.O. contactin parallel withprevious contact.Connects N.C. contactin parallel withprevious contact.Connects in seriesblocks made of one ormore contacts.Connects in parallelblocks made of one ormore contacts.
3-57
3-57
3-58
3-58
3-60
3-60
3-61
3-63
KV-300
nnnnDIFU
nnnnDIFD
KEEPSETRES
nnnn
SFTDCLKRES
nnnn
mmmm
MC
HSPnnnn
MCR
$xxxxMEMSW
$xxxx
END
ENDH
DIFFEREN-TIATE UP
DIFU(FNC10)
R No.DIFFEREN-
TIATEDOWN
DIFD(FNC09)
KEEPKEEP
(FNC22)R No.
SHIFT SFT(FNC39)
R No.1st& last R
Nos.
HIGHSPEED
HSP(FNC18) R No.
MASTERCONTROL
MC(FNC24)
MASTERCONTROL
RESET
MCR(FNC25)
MEMORYSWITCH
MEMSW(FNC26)
$ constant
NOP NOP(FNC30)
END END
END HI ENDH
1000 to 1915
0500 to 19152009
2100 to 2915
1000 to 1915
(KV-10)0000 to 0005
(KV-16)0000 to 0009
$ 0000 to $ FFFF
1000 to 19153000 to 6915
0500 to 19152009
2100 to 69151000 to
19153000 to6915
(KV-24)0000 to 0015
(KV-40)0000 to 0107
11.0 to 13.0
11.0 to 13.0
9.0 to 26.0
(*)
8.0 to 9.0
1.8 to 3.2
0.6 to 1.0
––
––
––
––
3 (5)
3 (5)
3 (5)
5 (7)
3 (4)
1 (7)
1 (2)
3 (0)
1 (0)
1 (3)
1 (0)
Turns ON R for 1scan time at risingedge of input.
Turns ON R for 1scan time at fallingedge of input.Turns ON R andholds this status whenSET input is ON.
Turns OFF R whenRESET input is ON.
Sets shift register.
Reduces input relay timeconstant to 25 ms forhigher input response.Selects ON/OFFstatus of R coils, Ts,or Cs.
Represents end of MC.Sets memory switches.
Performs no opera-tion.
Indicates end of eachroutine of program.
Indicates end of entireprogram.
3-78
3-78
3-80
3-82
3-86
3-89
3-89
3-92
3-94
3-94
KV-10/16/24/40/80
Instruction Symbol Mnemonic Operand Operand valueKV-10/16
Operand valueKV-24/40/80
Exec.time(µs)
BytesFunction Page
3-94
KV-300 Series, KV-10/802.2 Instruction List KV-300 Series,
3-44
2
Chapter 2 Instructions
KV-300
Instruction Symbol Mnemonic Operand Operand value Exec.time(µs) Bytes
Function Page
OUT
OUT BAR
nnnn
nnnn
(SET)nnnn
(RES)nnnn
#ddddd
T xxx
#dddddxxxH
#dddddxxxS
nnnn
#dddddC xxx
UDCxxx#dddddUP
DWRES
nnnnDIFU
nnnnDIFD
KEEPSETRES
nnnn
SFTDCLKRES
nnnn
mmmm
HSPnnnn
MC
MCR
$xxxxMEMSW
$xxxx
END
ENDH
SET
RESET
0.1-s TIMER
0.01-s TIMER
1-ms TIMER
COUNTER
UP-DOWNCOUNTER
DIFFEREN-TIATE UP
DIFFEREN-TIATE DOWN
KEEP
SHIFT
HIGHSPEED
MASTERCONTROL
MASTERCONTROLRESET
MEMORYSWITCH
NOP
END
OUT
OUB
SET
RES
TMR
TMH(FNC49)
TMS(FNC51)
C
UDC(FNC52)
DIFUFNC10)
DIFD(FNC09)
KEEP(FNC22)
SFT(FNC39)
HSP(FNC18)
MC(FNC24)
MCR(FNC25)
MEMSW(FNC26)
NOP(FNC30)
END HI
END
ENDH
R No.
T No.,# presetvalue
# presetvalue, CNo., clocksource R
C No.,# presetvalue
R No.
R No.
1st &last RNos.
R No.
$ constant
0500 to 19152009
2300 to 17915
0500 to 19152009
2100 to 17915T000 to T249C000 to C249
0500 to 19152009
2100 to 17915T000 to T249C000 to C249CTH0 to CTH1CTC0 to CTC3
000 to 249#00000 to 65535
#00000 to #65535000 to 249
0000 to 00090500 to 17915
000 to 249#00000 to #65535
1000 to 19153000 to 6915
(*) 7000 to 9915
0500 to 19152009
2100 to 179151000 to 19153000 to 6915
(*) 7000 to 9915
0000 to 0009
$0000 to $FFFF
0.20 to 0.56
0.50 to 1.20
0.20 to 5.70
0.50 to 4.40
5.60 to 10.40
5.60 to 10.40
5.60 to 10.40
7.60 to 9.45
8.00 to 11.60
6.70
6.70
6.10 to 7.90
6.40 to 8.20
4.66 to 4.92
0.20
—
—
—
0.95
—
3 (8)
3 (11)
3 (12)
3 (12)
2 (7)
2 (7)
2 (7)
4 (7)
2 (10)
3 (10)
3 (10)
3 (11)
5 (15)
3 (8)
1 (4)
1 (0)
3 (0)
1 (0)
1 (1)
1 (0)
Outputs input ON/OFFstatus to R coil.
Outputs inverted inputON/OFF status to Rcoil.
Forces R ON and holdsthis status when inputis ON.
Forces R/T/C OFFwhen input is ON.
16-bit on-delay T thatcounts down in 0.1-sdecrements.16-bit on-delay T thatcounts down in 0.01-sdecrements.16-bit on-delay T thatcounts down in 1-msdecrements.
Sets 16-bit up-counter.
Sets a 16-bit up-downcounter.
Turns ON R for 1 scantime at rising edge ofinput.Turns ON R for 1 scantime at falling edge ofinput.Turns ON R and holdsthis status when SETinput is ON.
Turns OFF R whenRESET input is ON.
Sets shift register.
Reduces input relay timeconstant to 25 ms forhigher input response.
Selects ON/OFF statusof R coils, Ts, or Cs.
Represents end of MC.Sets memory switches.
Performs no operation.
Indicates end of eachroutine of program.
Indicates end of entireprogram.
3-65
3-65
3-66
3-66
3-67
3-68
3-69
3-72
3-76
3-78
3-78
3-80
3-82
3-86
3-89
3-89
3-92
3-94
3-94
Note: 14.0 + 3.0 x (n) to 17.0 + 3.0 x (n) (n represents number of times the originaldata is generated.)
3-94
KV-300 Series, KV-10/80
3-45
12
Chapter 2 Instructions
2.2 Instruction List
2.2.2 Application InstructionsKV-10/16/24/40/80
KV-10/16/24/40/80
Instruction Symbol Mnemonic Operand Operand valueKV-10/16
Operand valueKV-24/40/80
Exec.time(µs) Bytes
Function Page
WAIT ON
WAIT OFF
WAIT UPEDGE
WAIT DOWNEDGE
CONNECT
PUSH
READ
POP
STAGE
JUMP
ENDSTAGE
STEP
STEP END
INTERVALTIMER
8-BITCOUNTER
8-BITCOUNTERCOMPARA-
TOR
16-BITCOUNTER
16-BITCOUNTERCOMPARA-
TOR
SUBROU-TINE CALL
SUBROU-TINE ENTRY
SUBROU-TINE
RETURN
W-ONnnnnON
mmmm
W-OFFnnnnOFF
mmmm
W-UE
W-D
CON[FNC 06]
MPS
MRD
MPP
STG[FNC 44]
JMP[FNC 21]
ENDS[FNC 14]
STP[FNC 45]
STE[FNC 43]
ITVL
CTH
CTC
CTH
CTC
CALL[FNC 03]
SBN[FNC 38]
RET[FNC 33]
nnnn:R,T, or C
No.
R No.
R, T, CNos.
DM & RNo.
Clocksource Rs
n:Comparator
No.ddddd: #
preset value
Clocksource Rs
n: Compara-tor No.
ddddd: #preset value
Subrou-tine No.
Subrou-tine No.
nnnn↑
mmmm
nnnn↓
mmmm
nnnnSTG
nnnnJMP
ENDS
STPnnnn
STE
ITVLPLS
PAUSERES
nnnnmmmm
DM
nnnnCTH0
#ddddd
CTCn
nnnnCTH1
#ddddd
CTCn
nn
CALL
nnSBN
RET
nnnn:0000 to 2915T000 to T063C000 to C063CTC0 to CTC3
mmmm:1000 to 1915
1000 to 1915
0000 to 2915T000 to T063C000 to C063CTC0 to CTC3
DM0000 toDM0985
1000 to 1912
00042100 to 2102
n: 0,1ddddd: #00000 to #00255
00052200 to 2202
n: 2,3ddddd: #00000 to #65535
00 to 99
00 to 99
nnnn:0000 to 6915T000 to T119C000 to C119CTC0 to CTC3
mmmm:1000 to 19153000 to 6915
1000 to 19153000 to 6915
0000 to 6915T000 to T119C000 to C119CTC0 to CTC3
DM0000 toDM1985
1000 to 19123000 to 6912
11.0 to13.0
11.0 to13.0
14.0 to18.0
14.0 to18.0
0.4 to0.6
11.0 to14.0
8.0 to10.0
10.0 to12.0
11.0 to14.0
10.0 to13.0
7.0 to9.0
3.7 to5.3
0.00
29.0 to79.0
9.0 to39.0
3.0 to 4.0
8.0 to48.0
3.0 to 4.0
8.0 to10.0
0.00
4.6 to 6.2
5 (7)
5 (7)
5 (7)
5 (7)
301
1 (3)
1 (3)
1 (3)
3 (7)
3 (5)
1 (3)
3 (7)
1 (0)
5 (7)
4 (4)
2 (5)
4 (4)
2 (5)
2 (6)
2 (0)
1 (5)
Turns ON R (2nd operand[mmmm]) when R, T, or C (1stoperand [nnnn]) turns ON.
When R, T, or C (1st operand[nnnn]) turns OFF, R (2ndoperand [mmmm]) turns ON.R (2nd operand [mmmm])turns ON at rising edge of R, T,or C (1st operand [nnnn]).
R (2nd operand [mmmm])turns ON at falling edge of R,T, or C (1st operand [nnnn]).
Represents series connectionof output instruction togetherwith another instruction.
Stores input status andarithmetic flag.
Reads input status andarithmetic flag stored withPUSH.Reads & clears input statusand arithmetic flag stored withPUSH.Executes instructions betweenSTG & JMP when R(operand) is ON.
Turns current stage OFF andnext stage ON when input isON.
Turns current stage OFF wheninput is ON.
Executes program betweenSTP & STE when R (operand)is ON.
Is used with STEP to makeprogram step.
Measures pulse-to-pulseinterval & pulse width inspecified mode.
8-bit (0 to255) up-counter forclock pulses with inputresponse frequency of 10 kHz.Hardware-based comparatorbetween preset & currentvalues of high speed counter.This comparator is turned ONwhen these values are equal.16-bit (0 to 65535) up-counterfor clock pulses with inputresponse frequency of 10 kHz.Hardware-based comparatorbetween preset & currentvalues of high speed counter.This comparator is turned ONwhen these values are equal.
Executes subroutine specifiedby operand.
Represents beginning ofsubroutine specified byoperand.
Represents end of subroutine.
3-96
3-96
3-98
3-98
3-102
3-103
3-103
3-103
3-106
3-106
3-106
3-114
3-114
3-117
3-277
3-277
3-204
3-204
3-122
3-122
3-122
KV-300 Series, KV-10/802.2 Instruction List KV-300 Series,
3-46
2
Chapter 2 Instructions
KV-300KV-300
Instruction Symbol Mnemonic Operand Operand value Exec.time(µs) Bytes
Function Page
WAIT ONnnnnON
mmmm
nnnnOFF
mmmm
nnnn↑
mmmm
nnnn↓
mmmm
nnnnSTG
nnnnJMP
ENDS
STPnnnn
STE
ITVLPLS
PAUSERES
nnnnmmmm
DM
nnnnCTH0
WAIT OFF
WAIT UPEDGE
WAIT DOWNEDGE
CONNECT
PUSH
READ
POP
STAGE
JUMP
ENDSTAGE
STEP
STEP END
INTERVALTIMER
16-BITCOUNTER
W-ON
W-OFF
W-UE
W-DE
CON[FNC 06]
MPS
MRD
MPP
STG[FNC 44]
JMP[FNC 21]
ENDS[FNC 14]
STP[FNC 45]
STE[FNC 43]
ITVL
CTH
nnnn:R,T, orC No.
R No.
R, T,C Nos.
DM & R No.
Clocksource Rs
nnnn:0000 to 0009
0500 to 17915T000 to T249C000 to C249CTC0 to CTC3
mmmm:1000 to 19153000 to 6915
(*)7000 to 9915
1000 to 19153000 to 6915
(*)7000 to 9915
0000 to 00090500 to 6915
(*)7000 to 9915T000 to T249C000 to C249CTC0 to CTC3
DMnnnn:DM0000 to DM9985
mmmm:1000 to 19123000 to 6912
(*)7000 to 9912
0004210021012102
5.00 to 6.10
5.00 to 6.10
6.10 to 7.50
6.10 to 7.50
—
1.30
2.70
1.40
5.60 to 6.50
3.80 to 6.00
—
1.30
—
13.80 to17.30
3.85
5 (9)
5 (9)
5 (10)
5 (10)
1 (0)
1 (9)
1 (18)
1 (9)
3 (10)
3 (7)
1 (0)
3 (9)
1 (0)
5 (11)
4 (7)
Turns ON R (2nd operand[mmmm]) when R, T, or C (1stoperand [nnnn]) turns ON.
When R, T, or C (1st operand[nnnn]) turns OFF, R (2ndoperand [mmmm]) turns ON.R (2nd operand [mmmm])turns ON at rising edge of R,T, or C (1st operand [nnnn]).R (2nd operand [mmmm])turns ON at falling edge of R,T, or C (1st operand [nnnn]).
Represents series connectionof output instruction togetherwith another instruction.
Stores input status andarithmetic flag.
Reads input status andarithmetic flag stored withPUSH.
Reads & clears input statusand arithmetic flag storedwith PUSH.Executes instructionsbetween STG & JMP when R(operand) is ON.
Turns current stage OFF andnext stage ON when input isON.
Turns current stage OFFwhen input is ON.
Executes program betweenSTP & STE when R(operand) is ON.
Is used with STEP to makeprogram step.
Measures pulse-to-pulseinterval & pulse width inspecified mode.
16-bit (0 to 65535) up-counterfor clock pulses with inputresponse frequency of 30kHz.
3-96
3-96
3-98
3-98
3-102
3-103
3-103
3-103
3-106
3-106
3-106
3-114
3-114
3-117
3-204
KV-10/16/24/40/80
Instruction Symbol Mnemonic Operand Operand valueKV-10/16
Operand valueKV-24/40/80
Exec.time(µs)
BytesFunction Page
REPEATSTART
REPEATEND
16-KEYINPUT
FOR[FNC 16]
NEXT[FNC 29]
HKEY[FNC 17]
# constant,DM No.
I/O R
nnnnFOR
NEXT
nnnnmmmm
HKEY
#00000 to#65535
DM0000 toDM0999
TM00 to TM29
nnnn:0000 to 000910000 to 10415
:17000 to 17415
mmmm:10500 to 10915:
17500 to 17915
#00000 to#65535
DM0000 toDM1999
TM00 to TM29
5.0 to 20.0
1.7 to 2.3
71 to 370
3 (15)
1 (3)
5 (7)
Executes programbetween FOR & NEXTfor number of timesspecified by operand.
Represents end ofrepetition.
Reads 16-key data bytime-sharing andoutputs these data intospecial utility Rs 2900to 2915.
3-125
3-125
3-131
KV-300 Series, KV-10/80
3-47
12
Chapter 2 Instructions
2.2 Instruction List
KV-300
Instruction Symbol Mnemonic Operand Operand value Exec.time(µs) Bytes
Function Page
16-BITCOUNTERCOMPARA-
TOR
16-BITCOUNTER
16-BITCOUNTERCOMPARA-
TOR
SUBROU-TINE CALL
SUBROU-TINE ENTRY
SUBROU-TINE
RETURN
REPEATSTART
REPEATEND
16-KEYINPUT
CTC
CTH
CTC
SBN[FNC 38]
RET[FNC 33]
FOR[FNC 16]
NEXT [FNC 29]
HKEY[FNC 17]
CALL [FNC 03]
#ddddd
CTCn
nnnnCTH1
#ddddd
CTCn
nn
CALL
nnSBN
RET
nnnnFOR
NEXT
nnnnmmmm
HKEY
n:Comparator
No.ddddd: #
preset value
Clocksource Rs
n:Comparator
No.ddddd: #
preset value
SubroutineNo.
SubroutineNo.
# constant,DM No.
I/O R
n: 0, 1ddddd:
#00000 to #65535
0005220022012202
n: 2, 3ddddd:
#00000 to #65535
00 to 99
00 to 99
#00000 to #65535DM0000 to DM9999
TM00 to TM29
nnnn:0000 to 000910000 to 10415
:17000 to 17415
mmmm:0500 to 050310500 to 10915
:17500 to 17915
—
3.85
—
3.16
—
1.15 to 1.45
1.55
—
16.50
2 (0)
4 (7)
2 (0)
2 (17)
2 (0)
1 (6)
3 (19)
1 (0)
5 (9)
Hardware-based comparatorbetween preset & currentvalues of high speed counter.This comparator is turned ONwhen these values are equal.
16-bit (0 to 65535) up-counter for clock pulses withinput response frequency of30 kHz.
Hardware-based comparatorbetween preset & currentvalues of high speed counter.This comparator is turned ONwhen these values are equal.
Executes subroutinespecified by operand.
Represents beginning ofsubroutine specified byoperand.
Represents end ofsubroutine.
Executes program betweenFOR & NEXT for number oftimes specified by operand.
Represents end of repetition.
Reads 16-key data by time-sharing and outputs thesedata into special utility Rs2900 to 2915.
3-204
3-204
3-204
3-122
3-122
3-122
3-125
3-125
3-131
KV-300 Series, KV-10/802.2 Instruction List KV-300 Series,
3-48
2
Chapter 2 Instructions
2.2.3 Arithmetic InstructionsKV-10/16/24/40/80
KV-10/16/24/40/80 Instruction Symbol Mnemonic Operand Operand value
KV-10/16Operand valueKV-24/40/80
Exec.time(µs)
BytesFunction Page
DATAMEMORY
WRITE
TRIMMERSETTING
LOAD A
STORE A
COMPARE
ADD
SUBTRACT
MULTIPLY
DIVIDE
DW
TMIN[FNC 50]
@TMIN@[FNC 50]
LDA[FNC 23]
@LDA@[FNC 23]
STA[FNC 42]
@STA@[FNC 42]
CMP[FNC 04]
@CMP@[FNC 04]
ADD[FNC 00]
@ADD@[FNC 00]
SUB[FNC 46]
@SUB@[FNC 46]
MUL[FNC 28]
@MUL@[FNC 28]
DIV[FNC 11]
@DIV@[FNC 11]
#/$constant,DM No.
TrimmerNo.
R No.,C/T No.,DM/TM
No.,#/$
constant,#TMxx
R No.,C/T No.,DM/TM
No.,#/$
constant,#TMxx
DM/TMNo.,#/$
constant,#TMxx
DM/TMNo.,
#/$ No.,#TMxx
#00000 to#65535$0000 to$FFFF
DM0000 toDM0999
0
0000 to 2915T000 to T063C000 to C063CTH0 to CTH1
DM0000 toDM0999
TM00 to TM31#00000 to
#65535$0000 to$FFFF
#TM00 to#TM29
0500 to 19152100 to 2915T000 to T063C000 to C063
DM0000 toDM0999
TM00 to TM29#TM00 to#TM29
DM0000 toDM0999
TM00 to TM31#00000 to#65535
$0000 to$FFFF
#TM00 to#TM29
DM0000 toDM0999
TM00 to TM31#00000 to#65535$0000 to$FFFF
#TM00 to#TM29
#0000 to#65535
$0000 to$FFFF
DM0000 toDM1999
0 to 1
0000 to 6915T000 to T119C000 to C119CTH0 to CTH1
DM0000 toDM1999
TM00 to TM31#00000 to
#65535$0000 to$FFFF
#TM00 to#TM29
0500 to 19152100 to 6915T000 to T119C000 to C119
DM0000 toDM1999
TM00 to TM29#TM00 to#TM29
DM0000 toDM1999
TM00 to TM31#00000 to
#65535$0000 to$FFFF
#TM00 to#TM29
DM0000 toDM1999
TM00 to TM31#00000 to
#65535$0000 to$FFFF
#TM00 to#TM29
3.6 to 6.0
13.0 to 15.0
25.0 to 29.0
10.0 to 46.0
22.0 to 60.0
9.0 to 99.0
21.0 to 113.0
14.0 to 68.0
26.0 to 82.0
13.0 to 65.0
25.0 to 79.0
15.0 to 68.0
27.0 to 82.0
17.0 to 71.0
29.0 to 85.0
22.0 to 79.0
34.0 to 93.0
5 (6)
1 (4)
1 (11)
3 (5)
3 (12)
3 (5)
3 (12)
3 (5)
3 (12)
3 (5)
3 (12)
3 (5)
3 (12)
3 (5)
3 (12)
3 (5)
3 (12)
Writes constant intodata memory.
Converts trimmerrotation angle into 0to 249 and inputs itinto internal register.
Inputs value specifiedby operand intointernal register orinputs current valuewhen T/C is specifiedas operand.
Transfers content ofinternal register tolocation specified byoperand, or changespreset value when T/C is specified asoperand.
Compares content ofinternal register andvalue specified byoperand.
Adds content ofinternal register andvalue specified byoperand and inputsresult back to sameregister.Subtracts valuespecified by operandfrom content ofregister and inputsresult back to sameregister.
Multiplies content ofinternal register byvalue specified byoperand and inputsresult back to sameregister.
Divides content ofinternal register byvalue specified byoperand and inputsresult back to sameregister.
3-136
3-138
3-140
3-140
3-146
3-150
3-150
3-150
3-150
< DW >DMmmmm
nnnn
< TMIN >n
↑ TMIN >n
< LDA >nnnn
↑ LDA >nnnn
< STA >nnnn
↑ STA >nnnn
< CMP >nnnn
↑ CMP >nnnn
< ADD >nnnn
↑ ADD >nnnn
< SUB >nnnn
↑ SUB >nnnn
< MUL >nnnn
↑ MUL >nnnn
< DIV >nnnn
↑ DIV >nnnn
KV-300 Series, KV-10/80
3-49
12
Chapter 2 Instructions
2.2 Instruction List
KV-10/16/24/40/80
Instruction Symbol Mnemonic Operand Operand valueKV-10/16
Operand valueKV-24/40/80
Exec.time(µs)
BytesFunction Page
AND A
OR A
EXCLU-SIVEOR A
SHIFTRIGHT A
SHIFTLEFT A
ROTATERIGHT A
ROTATELEFT A
COMPLE-MENT
INCRE-MENT
MEMORY
DECRE-MENT
MEMORY
MULTI-PLEXER
ANDA[FNC 01]
@ANDA@[FNC 01]
ORA[FNC 31]
@ORA@[FNC 31]
EORA[FNC 15]
@EORA@[FNC 15]
SRA[FNC 41]
@SRA@[FNC 41]
SLA[FNC 40]
@SLA@[FNC 40]
RRA[FNC 37]
@RRA@[FNC 37]
RLA[FNC 35]
@RLA@[FNC 35]
COM[FNC 05]
@COM@[FNC 05]
INC[FNC 19]
@INC@[FNC 19]
DEC[FNC 07]
@DEC@[FNC 07]
MPX[FNC 27]
@MPX@[FNC 27]
R No.,DM/TM No.,
#/$ No.,#TMxx
R No.,DM/TM No.,
#/$ No.,#TMxx
# constant
DM/TM No.
# constant
0000 to 2915DM0000 toDM0999
TM00 to TM31#00000 to#65535
$0000 to$FFFF
#TM00 to#TM29
0000 to 2915DM0000 toDM0999
TM00 to TM31#00000 to#65535
$0000 to$FFFF
#TM00 to#TM29
#01 to #16
DM0000 toDM0999
TM00 to TM29
#0 to #3
0000 to 6915DM0000 to
DM1999TM00 to TM31
#00000 to#65535
$0000 to$FFFF
#TM00 to#TM29
0000 to 6915DM0000 to
DM1999TM00 to TM31
#00000 to#65535
$0000 to$FFFF
#TM00 to#TM29
DM0000 toDM1999TM00
to TM29
11.0 to 64.0
23.0 to 78.0
11.0 to 63.0
23.0 to 77.0
10.0 to 63.0
22.0 to 77.0
11.0 to 28.0
23.0 to 42.0
10.0 to 28.0
22.0 to 42.0
12.0 to 30.0
24.0 to 44.0
12.0 to 29.0
24.0 to 43.0
5.0 to 6.0
17.0 to 20.0
12.0 to 15.0
24.0 to 29.0
14.0 to 17.0
26.0 to 31.0
24.0 to 25.0
36.0 to 39.0
3 (5)
3 (12)
3 (5)
3 (12)
3 (5)
3 (12)
2 (4)
2 (11)
2 (4)
2 (11)
2 (4)
2 (11)
2 (4)
2 (11)
1 (3)
1 (10)
3 (5)
3 (12)
3 (5)
3 (12)
1 (4)
1 (11)
ANDs each of 16 bitsof internal register andthat of value specifiedby operand, and inputsresult back to sameregister.
ORs each of 16 bits ofinternal register andthat of value specifiedby operand, andinputs result back tosame register.
EXCLUSIVE-ORseach of 16 bits ofinternal register andthat of valuespecified by operand,and inputs resultback to sameregister.
Moves content ofinternal registerserially left by valuespecified by operand.
Moves content ofinternal register seriallyright, allowing each bitthat leaves right end toenter carry bit and thenleftmost bit.
Moves content ofinternal register seriallyleft, allowing each bitthat leaves left end toenter carry bit and thenrightmost bit.
Inverts content ofeach bit in internalregister.
Adds 1 to content ofdata memoryspecified by operand.
Subtracts 1 fromcontent of datamemory specified byoperand.
Converts 4-bit data(specified byoperand) of internalregister into 16bitdata.
Moves content ofinternal registerserially right byvalue specified byoperand.
3-159
3-161
3-164
3-166
3-166
3-169
3-169
3-171
3-172
3-172
<ANDA>nnnn
↑ANDA>nnnn
< ORA >nnnn
↑ ORA >nnnn
<EORA>nnnn
↑EORA>nnnn
< SRA >#dd
↑ SRA >#dd
< SLA >#dd
↑ SLA >#dd
< RRA >#dd
↑ RRA >#dd
< RLA >#dd
↑ RLA >#dd
< COM >
↑ COM >
< INC >nnnn
↑ INC >nnnn
< DEC >nnnn
↑ DEC >nnnn
< MPX >#n
↑ MPX >#n
3-176
KV-300 Series, KV-10/802.2 Instruction List KV-300 Series,
3-50
2
Chapter 2 Instructions
KV-300
Instruction Symbol Mnemonic Operand Operand value Exec.time(µs)
BytesFunction Page
KV-300
DATAMEMORY
WRITE
TRIMMERSETTING
LOAD A
STORE A
DW
TMIN [FNC 50]
@TMIN@[FNC 50]
LDA[FNC 23]
@LDA@[FNC 23]
STA[FNC 42]
@STA@[FNC 42]
#/$constant,DM No.
TrimmerNo.
R No.,C/T No.,DM/TM
No.,#/$
constant,#TMxx
R No.,C/T No.,DM/TM
No.,#/$
constant,#TMxx
nnnn:#0000 to #65535$0000 to $FFFF
DMmmmm:DM0000 to DM9999
0, 1
0000 to 00090500 to 17915T000 to T249C000 to C249CTH0 to CTH1
DM0000 to DM9999TM00 to TM31
#00000 to #65535$0000 to $FFFF#TM00 to #TM29
0500 to 19152100 to 17915T000 to T249C000 to C249CTC0 to CTC3
DM0000 to DM9999TM00 to TM29
#TM00 to #TM29
0.60 to1.40
5.10 to5.60
2.00 to5.70
0.30 to28.00
2.30 to30.00
0.20 to30.00
2.20 to32.00
5 (11)
1 (11)
1 (25)
3 (12)
3 (26)
3 (12)
3 (26)
Writes constant intodata memory.
Converts trimmerrotation angle into 0 to249 and inputs it intointernal register.
Inputs value specifiedby operand into internalregister or inputscurrent value when T/Cis specified as operand.
Transfers content ofinternal register tolocation specified byoperand, or changespreset value when T/Cis specified as operand.
3-136
3-138
3-140
3-140
< DW >DMmmmm
nnnn
< TMIN >n
↑ TMIN >n
< LDA >nnnn
↑ LDA >nnnn
< STA >nnnn
↑ STA >nnnn
KV-10/16/24/40/80
Instruction Symbol Mnemonic Operand Operand valueKV-10/16
Operand valueKV-24/40/80
Exec.time(µs)
BytesFunction Page
DEMULTI-PLEXER
TRANSFERBCD
TRANSFERBIN
ASCIICONVERT
REVERSEASCII
CONVERT
SQUAREROOT
DMX[FNC 12]
@DMX@[FNC 12]
TBCD[FNC 47]
@TBCD@[FNC 47]
TBIN[FNC 48]
@TBIN@[FNC 48]
ASC[FNC 02]
@ASC@[FNC 02]
RASC[FNC 32]
@RASC@[FNC 32]
ROOT[FNC 36]
@ROOT@[FNC 36]
28.0 to 30.0
40.0 to 44.0
19.0 to 21.0
31.0 to 35.0
18.0 to 20.0
30.0 to 34.0
8.0
20.0 to 22.0
12.0 to 14.0
24.0 to 28.0
102.0 to103.0
114.0 to117.0
1 (3)
1 (10)
1 (3)
1 (10)
1 (3)
1 (10)
1 (3)
1 (10)
1 (3)
1 (10)
1 (3)
1 (10)
Converts position ofhighest order bit with1 in internal registerinto 4-bit data.
Converts content ofinternal register (16-bit binary) into 4-digitBCD data.
Converts content ofinternal register (4-digit BCD) into 16-bitbinary data.
Converts content oflower order byte ofinternal register into2-digit ASCII code.
Converts 2-digit ASCIIcode into one bytedata.
Takes square root of 32-bit data (TM00: higherorder byte, internalregister: lower orderbyte) and inputs resultback to same register.
3-176
3-180
3-180
3-183
3-183
3-185
< DMX >
↑ DMX >
<TBCD>
↑ TBCD>
< TBIN >
↑ TBIN>
< ASC >
↑ ASC >
<RASC>
↑ RASC>
<ROOT>
↑ ROOT>
KV-300 Series, KV-10/80
3-51
12
Chapter 2 Instructions
2.2 Instruction List
KV-300
Instruction Symbol Mnemonic Operand Operand value Exec.time(µs) Bytes
Function Page
COMPARE
ADD
SUBTRACT
MULTIPLY
DIVIDE
AND A
OR A
EXCLUSIVEOR A
CMP[FNC 04]
@CMP@[FNC 04]
ADD[FNC 00]
@ADD@[FNC 00]
SUB[FNC 46]
@SUB@[FNC 46]
MUL [FNC 28]
@MUL@[FNC 28]
DIV[FNC 11]
@DIV@[FNC 11]
ANDA[FNC 01]
@ANDA@[FNC 01]
ORA [FNC 31]
@ORA@[FNC 31]
EORA[FNC 15]
@EORA@[FNC 15]
DM/TMNo.,#/$
constant,#TMxx
DM/TMNo.,
#/$ No.,#TMxx
R No.,DM/TM
No.,#/$ No.,#TMxx
R No.,DM/TM
No.,#/$ No.,#TMxx
DM0000 to DM9999TM00 to TM31
#00000 to #65535$0000 to $FFFF#TM00 to #TM29
DM0000 to DM9999TM00 to TM31
#00000 to #65535$0000 to $FFFF#TM00 to #TM29
0000 to 00090500 to 17915
DM0000 to DM9999TM00 to TM31
#00000 to #65535$0000 to $FFFF#TM00 to #TM29
0000 to 00090500 to 17915
DM0000 to DM9999TM00 toTM31
#00000 to #65535$0000 to $FFFF#TM00 to #TM29
9.20 to36.00
11.20 to38.00
7.70 to35.00
9.70 to37.00
8.40 to35.00
10.40 to37.00
9.80 to37.00
11.80 to39.00
13.70 to41.00
15.70 to42.00
6.90 to33.00
8.90 to35.00
6.90 to33.00
8.90 to35.00
6.90 to33.00
8.9 to35.00
3 (12)
3 (26)
3 (12)
3 (26)
3 (12)
3 (26)
3 (12)
3 (26)
3 (12)
3 (26)
3 (12)
3 (26)
3 (12)
3 (26)
3 (12)
3 (26)
Compares content ofinternal register andvalue specified byoperand.
Adds content of internalregister and valuespecified by operandand inputs result backto same register.
Subtracts valuespecified by operandfrom content of registerand inputs result backto same register.
Multiplies content ofinternal register byvalue specified byoperand and inputsresult back to sameregister.
Divides content ofinternal register byvalue specified byoperand and inputsresult back to sameregister.ANDs each of 16 bits ofinternal register and thatof value specified byoperand, and inputsresult back to sameregister.ORs each of 16 bits ofinternal register andthat of value specifiedby operand, and inputsresult back to sameregister.
EXCLUSIVE-ORs eachof 16 bits of internalregister and that of valuespecified by operand,and inputs result back tosame register.
3-146
3-150
3-150
3-150
3-150
3-159
3-161
< CMP >nnnn
↑ CMP >nnnn
< ADD >nnnn
↑ ADD >nnnn
< SUB >nnnn
↑ SUB >nnnn
< MUL >nnnn
↑ MUL >nnnn
< DIV >nnnn
↑ DIV >nnnn
<ANDA>nnnn
↑ANDA>nnnn
< ORA >nnnn
↑ ORA >nnnn
<EORA>nnnn
↑EORA>nnnn
3-164
KV-300 Series, KV-10/802.2 Instruction List KV-300 Series,
3-52
2
Chapter 2 Instructions
KV-300
Instruction Symbol Mnemonic Operand Operand value Exec.time(µs) Bytes
Function Page
SHIFTRIGHT A
SHIFTLEFT A
ROTATERIGHT A
ROTATELEFT A
COMPLE-MENT
INCREMENTMEMORY
DECREMENTMEMORY
MULTI-PLEXER
DEMULTI-PLEXER
SRA [FNC 41]
@SRA@[FNC 41]
SLA[FNC 40]
@SLA@[FNC 40]
RRA [FNC 37]
@RRA@[FNC 37]
RLA [FNC 35]
@RLA@[FNC 35]
COM [FNC 05]
@COM@[FNC 05]
INC[FNC 19]
@INC@[FNC 19]
DEC[FNC 07]
@DEC@[FNC 07]
MPX [FNC 27]
@MPX@[FNC 27]
DMX [FNC 12]
@DMX@[FNC 12]
# constant
DM/TMNo.
# constant
#01 to #16
DM0000 to DM9999TM00 to TM29
#0 to #3
10.80
12.80
10.80
12.80
12.00
14.00
12.00
14.00
6.10
8.10
7.70
9.70
7.70
9.70
7.30
9.30
6.70
8.70
2 (22)
2 (25)
2 (11)
2 (25)
2 (11)
2 (25)
2 (11)
2 (25)
1 (9)
1 (23)
3 (12)
3 (26)
3 (12)
3 (26)
1 (11)
1 (25)
1 (9)
1 (23)
Moves content ofinternal register seriallyright by value specifiedby operand.
Moves content ofinternal register seriallyleft by value specified byoperand.
Moves content ofinternal register seriallyright, allowing each bitthat leaves right end toenter carry bit and thenleftmost bit.
Moves content ofinternal register seriallyleft, allowing each bitthat leaves left end toenter carry bit and thenrightmost bit.
Inverts content of eachbit in internal register.
Adds 1 to content ofdata memory specifiedby operand.
Subtracts 1 from contentof data memoryspecified by operand.
Converts 4-bit data(specified by operand)of internal register into16- bit data.
Converts position ofhighest order bit with 1in internal register into4-bit data.
3-166
3-166
3-169
3-169
3-171
3-172
3-172
3-176
3-176
< SRA >#dd
↑ SRA >#dd
< SLA >#dd
↑ SLA >#dd
< RRA >#dd
↑ RRA >#dd
< RLA >#dd
↑ RLA >#dd
< COM >
↑ COM >
< INC >nnnn
↑ INC >nnnn
< DEC >nnnn
↑ DEC >nnnn
< MPX >#n
↑ MPX >#n
< DMX >
↑ DMX >
KV-300 Series, KV-10/80
3-53
12
Chapter 2 Instructions
2.2 Instruction List
KV-300
Instruction Symbol Mnemonic Operand Operand value Exec.time(µs) Bytes
Function Page
TRANSFERBCD
TRANSFERBIN
ASCIICONVERT
REVERSEASCII
CONVERT
SQUAREROOT
TBCD[FNC 47]
@TBCD@[FNC 47]
TBIN[FNC 48]
@TBIN@[FNC 48]
ASC [FNC 02]
@ASC@[FNC 02]
RASC[FNC 32]
@RASC@[FNC 32]
ROOT[FNC 36]
@ROOT@[FNC 36]
13.20
15.20
14.00
16.00
8.50
10.50
6.80
8.80
77.70
79.70
1 (9)
1 (23)
1 (9)
1 (23)
1 (9)
1 (23)
1 (9)
1 (23)
1 (9)
1 (23)
Converts content ofinternal register (16-bitbinary) into 4-digit BCDdata.
Converts content ofinternal register (4-digitBCD) into 16-bit binarydata.
Converts content oflower order byte ofinternal register into 2-digit ASCII code.
Converts 2-digit ASCIIcode into one byte data.
Takes square root of 32-bit data (TM00: higherorder byte, internalregister: lower orderbyte) and inputs resultback to same register.
3-180
3-180
3-183
3-183
<TBCD>
↑ TBCD>
< TBIN >
↑ TBIN>
< ASC >
↑ ASC >
<RASC>
↑ RASC>
<ROOT>
↑ ROOT>
3-185
KV-300 Series, KV-10/802.2 Instruction List KV-300 Series,
3-54
2
Chapter 2 Instructions
2.2.4 Interrupt InstructionsKV-10/16/24/40/80
KV-300
Instruction Symbol Mnemonic Operand Operand value Exec.time(µs) Bytes Function Page
INTERRUPTDISABLED
INTERRUPTENABLED
INTERRUPT
RETURNINTERRUPT
DI[FNC 08]
EI[FNC 13]
INT[FNC 20]
RETI[FNC 34]
R No.
ComparatorNo.
000 to 003
CTC0 to CTC3
3.20
5.80
40.00 to80.00
40.00 to80.00
60 to 100
1 (9)
1 (0)
1 (0)
1 (0)
1 (0)
Disables executionof interrupt.
Enables executionof interrupt.
Executes instructionsbetween INT andRETI at rising edgeof any of input 000 to003 or at falling edgeof 003.
Used with compara-tors CTC0 to CTC3and executesinstructions betweenINT and RETI.
Represents end ofinterrupt.
3-193
3-193
3-192
3-192
3-192
< DI >
< EI >
INTnnn
INTCTCn
RETI
KV-300
KV-10/16/24/40/80
Instruction Symbol Mnemonic Operand Operand valueKV-10/16
Operand valueKV-24/40/80
Exec.time(µs) Bytes
Function Page
INTERRUPTDISABLED
INTERRUPTENABLED
INTERRUPT
RETURNINTERRUPT
DI[FNC 08]
EI[FNC 13]
INT[FNC 20]
RETI[FNC 34]
R No.
ComparatorNo.
000 to 003
CTC0 to CTC3
3.0 to 4.6
3.0 to 4.6
35.0 to 48.0
35.0 to48.8
20.0 to23.0
1 (4)
1 (4)
1 (8)
1 (3)
Disables executionof interrupt.
Enables executionof interrupt.
Executes instruc-tions between INTand RETI at risingedge of any of input000 to 003 or atfalling edge of 003.
Used with compara-tors CTC0 to CTC3and executesinstructions betweenINT and RETI.
Represents end ofinterrupt.
3-193
3-193
3-192
3-192
3-192
< DI >
< EI >
INTnnn
INTCTCn
RETI
2.3 Convention Details
3-55
12
Chapter 2 Instructions
2.3 Convention DetailsIn this chapter, each instruction is described as follows:
2.4 Instruction Details
3-66
2
Chapter 2 Instructions
Example
Coding
Description
• Output relay 0500 remains ON after input relay 0000 turns OFF. Output relay0500 turns OFF when input relay 0001 turns ON.
• SET instruction sets a latch whereas RES instruction resets it.• RES instruction not only turns OFF relay coils but serves as a reset signal when
a timer or counter is used as an operand.
Note: The SET and RES instructions can be entered in any order. Note, however,that priority is given to the instruction that is entered last.In the above example, when both 0000 and 0001 are ON, RES has priority overSET, causing 0500 to remain OFF.
Tips
Differences between SET/RES and KEEP
Basically , SET/RES and KEEP ( p. 3-57 and p. 3-71) serve the same purpose.• SET and RES can be used separately. Therefore, RES can be placed before
SET.Another instruction may be placed between SET and RES.
• KEEP needs only three lines of program, therefore saving memory space whenused a number of times.
Operands
Key operation
SET: Set
RES: Reset
Turns ON specified relay when input is ONand enables this relay to remain ON.
Turns OFF specified relay, timer, or counterwhen input is ON.
SET1
RES0
nnnnRES
nnnnSET
0000
0001
0500SET
0500RES
Line No. Instruction Operand
0000 LD 0000
0001 SET 0500
0002 LD 0001
0003 OUB 0500
0001 00020001
0002 C000RES
#00100
00000C000
#00100
0000C000
0000
0001 0500SET
0500RES
0000
0001RES
KEEP
0500SETLD 0000
RES 0500
LD 0001SET 0500
LD 0000LD 0001KEEP 0500
SET1
RES0Operand ENT
R-SRCH Operand ENTR-SRCH
:
:
SET / RES
NEW KV KV-300 KV-10/16 KV-24/40/80
0500 to 1915 0500 to 1915 0500 to 1915 0500 to 19152009 2009 2009 2009
2100 to 17915 2100 to 17915 2100 to 2915 2100 to 6915T000 to T249 T000 to T249 T000 to T063 T000 to T119C000 to C249 C000 to C249 C000 to C063 C000 to C119
CTH0 to CTH1 (RES only)CTC0 to CTC3 (RES only)
InstructionDescribes the nameand brief function ofthe instruction.
Instruction keyRepresents the key orfunction No. for entry.
Ladder symbolRepresents the formof the instruction on aladder diagram.
MnemonicRepresents the instruc-tion in ladder language.
• Example• Timing diagram• DescriptionPerform programmingusing the given exampleto gain experience.
NoteDescribes the notesfor the instruction.
TipsDescribes hands-ontechniques for efficientprogramming.
OperandShows operands (elementNos.) that can be used forthe instruction.
Key operationDescribes the basic keyoperations on the handheldprogrammer. Set the modeswitch to PROGRAM.
CodingShows thecoding forthe givenexample.
* The above page is created for explanation purposes only.This page may be different from the actual page.