The text of a manual ยท part 2 of 9
User's Manual Visual KV Series 3 Programming, pages 11 to 15
Pages 11 to 15 of 79
The original document is the PDF (355 KB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
Filed in the catalog under the Keyence KV-16R
Page 11
Chapter 2
Chapter 3
Instructions 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5
Instruction List [Visual KV Series] .............................................................. 3-34 Basic Instructions .............................................................................................. 3-34 Application Instructions ..................................................................................... 3-36 Arithmetic Instructions ...................................................................................... 3-38 Interrupt Instructions .........................................................................................3-41 Function No. List (Alphabetical order) .............................................................. 3-41
2.2 2.2.1 2.2.2 2.2.3 2.2.4
Instruction List [KV-300 Series, KV-10/80] ................................................. 3-42 Basic Instructions .............................................................................................. 3-42 Application Instructions ..................................................................................... 3-45 Arithmetic Instructions ...................................................................................... 3-48 Interrupt Instructions .........................................................................................3-54
2.3
Convention Details ........................................................................................ 3-55
2.4 2.4.1 2.4.2 2.4.3
Instruction Details .......................................................................................... 3-56 Basic Instructions .............................................................................................. 3-56 Application Instructions ..................................................................................... 3-95 Arithmetic Instructions .................................................................................... 3-134
2.5
Programming Notes ..................................................................................... 3-189
Interrupts
Visual KV
3.1
Interrupt Instructions ................................................................................... 3-192
3.2 3.2.1 3.2.2 3.2.3 3.2.4
Interrupt Processing .................................................................................... 3-194 Interrupt Processing ........................................................................................ 3-194 Types of Interrupts .......................................................................................... 3-195 Interrupt Priority .............................................................................................. 3-196 Interrupt Program ............................................................................................ 3-196
3.3 Direct Input/Output ...................................................................................... 3-197 3.3.1 Direct Input ..................................................................................................... 3-197 3.3.2 Direct Output ................................................................................................... 3-197 3.4 3.4.1 3.4.2 3.4.3 3.4.4
Chapter 4
Applications of Interrupt Programs ........................................................... 3-198 Interrupt with a Signal Converter .................................................................... 3-198 Interrupt with a High-speed Counter ............................................................... 3-199 Measuring the ON Time of High-speed Pulses .............................................. 3-200 Measuring the Period in which a Target Passes between Two Points ........... 3-201
High-speed Counters 4.1
Visual KV
High-speed Counter Instructions ............................................................... 3-204
4.2 Outline of High-speed Counters ................................................................. 3-206 4.2.1 High-speed Counters and High-speed Counter Comparators ........................ 3-206 Structure of high-speed counters and high-speed counter comparators . 3-206 Specifications of high-speed counters ..................................................... 3-208 High-speed counter comparators ............................................................. 3-209 4.2.2 Internal Clock for High-speed Counters .......................................................... 3-210 4.3 4.3.1 4.3.2 4.3.3 4.3.4 4.3.5 4.3.6
Setting and Operation of High-speed Counters ........................................ 3-211 Reading the Current Value of the High-speed Counter .................................. 3-211 Preset Value of the High-speed Counter Comparator .................................... 3-211 Comparator Output ......................................................................................... 3-211 Count Input Method ........................................................................................ 3-212 Resetting the High-speed Counter ................................................................. 3-214 Differences with the CTH Instruction between the Conventional and Visual KV Series ................................................................ 3-216 4.3.7 Applications of High-speed Counters ............................................................. 3-217 4.4 4.4.1 4.4.2 4.4.3 4.4.4 4.4.5
Extended Functions of High-speed Counters ........................................... 3-221 24-bit High-speed Counter .............................................................................. 3-221 Changing the Current Value of a 24-bit High-speed Counter ......................... 3-223 Application Example of 24-bit High-speed Counter (single-phase input) ....... 3-224 Ring Counter Function .................................................................................... 3-225 Applications of Ring Counters ........................................................................ 3-226
4.5
Special Functions Using High-speed Counters ........................................ 3-228
(10)
Page 12
4.5.1 4.5.2 4.5.3 4.5.4 4.5.5
Specified Frequency Pulse Output Function .................................................. 3-228 Applications of the Specified Frequency Pulse Output ................................... 3-229 Frequency Counter Function .......................................................................... 3-231 Applications of Frequency Counters ............................................................... 3-232 Cam Switch Function ...................................................................................... 3-233 Cam switch mode .................................................................................... 3-233 Multi-step comparator mode .................................................................... 3-234 Setting method .........................................................................................3-234 4.5.6 Application of the Cam Switch (Cam Switch Mode) ....................................... 3-236 4.6 Direct Clock Pulse Output ........................................................................... 3-237 4.6.1 Outline of Direct Clock Pulse Output .............................................................. 3-237 4.6.2 Pulse Output Setting with the High-speed Counter Comparator .................... 3-238 Changing the pulse period and width ....................................................... 3-238 Calculating the pulse period and comparator preset value ...................... 3-239 Operation with special utility relays .......................................................... 3-239 4.7 4.7.1 4.7.2 4.7.3 4.7.4
Chapter 5
Examples of Direct Clock Pulse Output .................................................... 3-242 Example of Outputting a Pulse with 1:1 ON/OFF Ratio .................................. 3-242 Example of Outputting a Pulse with Variable ON/OFF Ratio .......................... 3-245 Example of Stopping the Pulse Output at a Specified Pulse Count ............... 3-249 Application of Direct Clock Pulse Output (Ramp-up/down control) ................ 3-251
Positioning Control
Visual KV
5.1 Outline of Positioning Control .................................................................... 3-254 5.1.1 Ramp-up/down Control ................................................................................... 3-254 5.2 Parameter Setting and Operating Procedures .......................................... 3-255 5.2.1 Parameter Setting Procedure ......................................................................... 3-255 5.2.2 Operating Procedure ...................................................................................... 3-257 5.3 5.3.1 5.3.2 5.3.3
Chapter 6
Examples of Using the Positioning Control Function .............................. 3-258 Connection Example ....................................................................................... 3-258 Tips .................................................................................................................3-258 Application Examples of the Positioning Control Function ............................. 3-259
Interrupts, High-speed Counters, Positioning Control
KV-300, KV-10/80
6.1 Interrupt Instructions ................................................................................... 3-268 6.1.1 Description of Interrupts .................................................................................. 3-268 Input processing for routine program and interrupt routine ...................... 3-268 Types of interrupt ..................................................................................... 3-268 Interrupt priority ........................................................................................ 3-269 Interrupt routine ........................................................................................ 3-269 Direct output ............................................................................................. 3-270 Direct input ...............................................................................................3-270 6.1.2 Interrupt Instructions ....................................................................................... 3-271 6.2 Direct Clock Pulse ........................................................................................ 3-276 6.2.1 Output of Direct Clock Pulse ........................................................................... 3-276 Outline of High-Speed Counters .............................................................. 3-276 Outline of Pulse Output ............................................................................ 3-279 Examples of Pulse Output ....................................................................... 3-284 6.3 Positioning Control ...................................................................................... 3-296 6.3.1 Positioning Control (Ramp-up/down Control) ................................................. 3-296 Outline of positioning control .................................................................... 3-296 Setting and application of parameters ..................................................... 3-297 Examples of stepping motor control ......................................................... 3-300
Chapter 7
Serial Communication 7.1 7.1.1 7.1.2 7.1.3
Communications Specifications ................................................................ 3-306 Communications Specification ........................................................................ 3-306 Connection with the KV Unit ........................................................................... 3-306 Connecting the KV-300 CPU to a Personal Computer ................................... 3-307
7.2 Serial Communication ................................................................................. 3-308 7.2.1 Command Transmission Procedure ............................................................... 3-308
(11)
Page 13
Chapter 8
7.2.2 7.2.3 7.2.4 7.2.5 7.2.6 7.2.7
Format of Commands/Responses .................................................................. 3-309 Communication Command/Response List ..................................................... 3-310 Setting Communication Commands and Responses to Commands .............. 3-311 Other Response Codes .................................................................................. 3-315 Error Code List ................................................................................................ 3-316 Example Program ........................................................................................... 3-317
7.3 7.3.1 7.3.2 7.3.3
Loading Text Data ........................................................................................ 3-318 Receiving Text Data ....................................................................................... 3-318 Transmitting Text Data ................................................................................... 3-319 Sample Program ............................................................................................. 3-320
7.4
ASCII Code List ............................................................................................ 3-321
Programming Examples 8.1
List
......................................................................................................... 3-324
8.2 Details ......................................................................................................... 3-326 8.2.1 Reference Program Examples ........................................................................ 3-326 Basic Instructions ..................................................................................... 3-326 Application Instructions ............................................................................ 3-334 Arithmetic Instructions .............................................................................. 3-343
WARRANTIES AND DISCLAIMERS
1
3-367
Installation
Chapter 1
Configuration and Specifications
Visual KV
1.1 System Configuration ...................................................................................... 1-2 1.1.1 System Configuration ......................................................................................... 1-2 1.2 Specifications ................................................................................................... 1-4 1.2.1 General Specifications ........................................................................................ 1-4 1.2.2 AC Power Specifications .................................................................................... 1-5 Visual KV Series operation at power interruption ........................................ 1-5 1.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-8 1.3.1 Model of a Basic Unit .......................................................................................... 1-8 1.3.2 Common I/O Specifications ................................................................................ 1-8 1.4 KV-10AR/AT(P)/DR/DT(P) (10-I/O Basic Unit) ............................................. 1-10 1.4.1 Part Names and Functions ............................................................................... 1-10 1.4.2 Terminal Layout Drawings and I/O Circuit Diagrams ........................................ 1-11 KV-10AR/DR (Relay output type) .............................................................. 1-11 KV-10AT(P)/DT(P) (Transistor output type) ............................................... 1-13 1.4.3 AC Power Input (KV-10AR/AT(P)) .................................................................... 1-14 1.4.4 Relationship between Continuous Simultaneous ON Ratio and Ambient Temperature 1-15 1.4.5 Dimensions ....................................................................................................... 1-16 1.5 KV-16AR/AT(P)/DR/DT(P) (16-I/O Basic Unit) ............................................. 1-17 1.5.1 Part Names and Functions ............................................................................... 1-17 1.5.2 Terminal Layout Drawings and I/O Circuit Diagrams ........................................ 1-18 KV-16AR/DR (Relay output type) .............................................................. 1-18 KV-16AT(P)/DT(P) (Transistor output type) ............................................... 1-20 1.5.3 AC Power Input (KV-16AR/AT(P)) .................................................................... 1-21 1.5.4 Relationship between Continuous Simultaneous ON Ratio and Ambient Temperature 1-22 1.5.5 Dimensions ....................................................................................................... 1-23 1.6 KV-24AR/AT(P)/DR/DT(P) (24-I/O Basic Unit) ............................................. 1-24 1.6.1 Part Names and Functions ............................................................................... 1-24 1.6.2 Terminal Layout Drawings and I/O Circuit Diagrams ........................................ 1-25 KV-24AR/DR (Relay output type) .............................................................. 1-25 KV-24AT(P)/DT(P) (Transistor output type) ............................................... 1-27 1.6.3 AC Power Input (KV-24AR/AT(P)) .................................................................... 1-28 1.6.4 Relationship between Continuous Simultaneous ON Ratio and Ambient Temperature 1-29 1.6.5 Dimensions ....................................................................................................... 1-30 1.7
KV-40AR/AT(P)/DR/DT(P) (40-I/O Basic Unit) .............................................. 1-31
(12)
Page 14
1.7.1 Part Names and Functions ............................................................................... 1-31 1.7.2 Terminal Layout Drawings and I/O Circuit Diagrams ........................................ 1-32 KV-40AR/DR (Relay output type) .............................................................. 1-32 KV-40AT(P)/DT(P) (Transistor output type) ............................................... 1-34 1.7.3 AC Power Input (KV-40AR/AT(P)) .................................................................... 1-35 1.7.4 Relationship between Continuous Simultaneous ON Ratio and Ambient Temperature 1-36 1.7.5 Dimensions ....................................................................................................... 1-37 1.8 1.8.1 1.8.2 1.8.3
KV-E4X/E8X/E16X (Expansion Input Unit) .................................................. 1-38 Part Names and Functions ............................................................................... 1-38 Input Specifications ........................................................................................... 1-38 Terminal Layout Drawings and Input Circuit Diagrams .................................... 1-39 KV-E4X (4-I/O expansion input unit) .......................................................... 1-39 KV-E8X (8-I/O expansion input unit) .......................................................... 1-40 KV-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-43 1.9.1 Part Names and Functions ............................................................................... 1-43 1.9.2 Output Specifications ........................................................................................ 1-43 KV-E4R/E8R/E16R (Relay output type) ..................................................... 1-44 KV-E4T/E8T(P)/E16T(P) [Transistor output type (NPN/PNP)] .................. 1-44 1.9.3 Terminal Layout Drawings and Input Circuit Diagrams .................................... 1-45 KV-E4R [4-I/O expansion output unit (relay output type)] .......................... 1-45 KV-E4T [4-I/O expansion output unit transistor output type)] .................... 1-46 KV-E8R [8-I/O expansion output unit (relay output type)] .......................... 1-47 KV-E8T(P) [8-I/O expansion output unit (transistor output type)] .............. 1-48 KV-E16R [16-I/O expansion output unit (relay output type)] ...................... 1-49 KV-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-52 1.10.1 Part Names and Functions ............................................................................... 1-52 1.10.2 Input Specifications ........................................................................................... 1-53 1.10.3 Output Specifications ........................................................................................ 1-53 KV-E4XR (Relay output type) .................................................................... 1-53 KV-E4XT(P) (Transistor output type) ......................................................... 1-53 1.10.4 Terminal Layout Drawings and Input Circuit Diagrams .................................... 1-54 KV-E4XR (Relay output type) .................................................................... 1-54 KV-E4XT(P) (Transistor output type) ......................................................... 1-56 1.10.5 Dimensions ....................................................................................................... 1-58 1.11 KV-D20 (Operator Interface Panel) ............................................................... 1-59 1.11.1 Part Names and Functions ............................................................................... 1-59 1.11.2 General Specifications ...................................................................................... 1-60 1.11.3 Functional Specifications .................................................................................. 1-60 1.11.4 Dimensions ....................................................................................................... 1-61
Chapter 2
System Installation
Visual KV
2.1 2.1.1 2.1.2 2.1.3
Installation Environment ............................................................................... 1-64 Installation Environment ................................................................................... 1-64 Installation Position ........................................................................................... 1-65 Installation Procedure ....................................................................................... 1-66 Expansion unit spacer ................................................................................ 1-66 2.1.4 Cautions on Wiring for Each Unit ...................................................................... 1-67 Wiring procedures for basic units ............................................................... 1-67 Cautions on wiring for I/O units .................................................................. 1-68 Terminal ..................................................................................................... 1-68 Cautions on grounding ............................................................................... 1-69 2.1.5 Contact Protection ............................................................................................ 1-69 2.2 Connecting Visual KV Series Expansion Units .......................................... 1-70 2.2.1 Visual KV Series Expansion Units .................................................................... 1-70 2.2.2 Connecting Visual KV Series Expansion Units ................................................. 1-71 Connection methods .................................................................................. 1-72 Number of connectable units ..................................................................... 1-73 2.2.3 Confirming the Connection Settings of Expansion Units .................................. 1-74 Expansion unit relay list ............................................................................. 1-74 Connection information for expansion units ............................................... 1-75 Input time constant for expansion units ..................................................... 1-76
(13)
Page 15
Clearing the input value when disconnecting ............................................. 1-76 2.2.4 Transferring I/O Information between Expansion Units and the Basic Unit ...... 1-77 When inputting ........................................................................................... 1-77 In the case of output .................................................................................. 1-77 2.3 Inspection and Maintenance ......................................................................... 1-78 2.3.1 Inspection ......................................................................................................... 1-78 2.3.2 Maintenance .....................................................................................................1-78
Chapter 3
Access Window
Visual KV
3.1 Overview of the Access Window .................................................................. 1-80 3.1.1 What is the Access Window ............................................................................. 1-80 3.1.2 Access Window Use Examples ........................................................................ 1-80 3.2 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5
Basic Operating Procedures ......................................................................... 1-81 Operation Mode ................................................................................................1-81 Access Window Modes ..................................................................................... 1-81 Part Names and Functions of the Access Window ........................................... 1-82 Selecting Modes and Setting/Resetting Key Lock ............................................ 1-82 Turbo Function .................................................................................................. 1-83
3.3 Digital Trimmer Mode .................................................................................... 1-84 3.3.1 Function and Operating Procedure ................................................................... 1-84 Key operation and screen display .............................................................. 1-84 Function and operating procedure ............................................................. 1-84 3.4 Device Mode ................................................................................................... 1-87 3.4.1 Function and Operating Procedure ................................................................... 1-87 Devices that can be displayed and changed ............................................. 1-87 Key operation and screen display .............................................................. 1-87 Selecting the device and displaying the current value/set value ................ 1-88 Changing a numeric value ......................................................................... 1-89 Holding the setting ..................................................................................... 1-91 3.4.2 Screen Display for Each Device Type .............................................................. 1-91 Data memory (DM) .................................................................................... 1-91 Temporary data memory (TM) ................................................................... 1-91 Timer/counter (T/C) .................................................................................... 1-92 High-speed counter comparator (CTC) ...................................................... 1-92 Trimmer (TRM) .......................................................................................... 1-93 Relay (RLY) ...............................................................................................1-93 3.5 System Mode .................................................................................................. 1-94 3.5.1 Function and Operating Procedure ................................................................... 1-94 Key operation and screen display .............................................................. 1-94 LOAD mode and SAVE mode .................................................................... 1-96 Display in LOAD/SAVE mode .................................................................... 1-96 3.6 Message Display ............................................................................................ 1-97 3.6.1 Error Messages and Error Status ..................................................................... 1-97 3.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 4.1.1 4.1.2 4.1.3
Before Operation .......................................................................................... 1-100 Checking Package Contents .......................................................................... 1-100 Part Names and Functions ............................................................................. 1-101 Details about the KV-D20 ............................................................................... 1-102 General specifications .............................................................................. 1-102 Functional specifications .......................................................................... 1-102 Dimensions .............................................................................................. 1-103 4.1.4 Installation and Environment .......................................................................... 1-104 Use environment ...................................................................................... 1-104 Panel mounting ........................................................................................ 1-105 4.1.5 Inspection and Maintenance ........................................................................... 1-106 Inspection ................................................................................................. 1-106 Maintenance ............................................................................................ 1-106 4.2 Overview and Operation .............................................................................. 1-107 4.2.1 Use Examples for the KV-D20 ........................................................................ 1-107
(14)