Professional Documents
Culture Documents
AS 92895 KVNano UM 717GB WW GB 1127 1
AS 92895 KVNano UM 717GB WW GB 1127 1
Chapter
OVERVIEW
1
Chapter SPECIFICATIONS
2 AND WIRING
Chapter UNIT INSTALLATION
Programmable Controller 3 AND MAINTENANCE
Chapter CPU BUILT-IN
KV Nano Series 4
Chapter
FUNCTIONS
LADDER
5 PROGRAMMING
User's Manual
• KV-N14AR
• KV-N14AT
• KV-N14ATP
• KV-N14DR
• KV-N14DT
• KV-N14DTP
• Base unit (terminal block type) • KV-N24AR
• KV-N24AT
• Expansion I/O unit (terminal block type) • KV-N24ATP
• Extension serial communication • KV-N24DR
• KV-N24DT
cassette • KV-N24DTP
• Extension access window cassette • KV-N40AR
• KV-N40AT
• Connecting transformer unit • KV-N40ATP
• KV-N40DR
• KV-N40DT
• KV-N40DTP
• KV-N60AR
• KV-N60AT
• KV-N60ATP
Preface
This manual describes how to connect to and maintain the KV Nano Series. It also describes the CPU
built-in functions and how to create ladder programs. This manual also includes the specifications and
usage methods of the base unit, expansion I/O unit, extension serial communication cassette, and
extension access window cassette. For expansion special units other than those listed above, see the
user's manual of the corresponding unit.
When you are writing programs, read the "Instruction Reference Manual," "Script Programming
Manual," and "KV STUDIO User's Manual" together with this manual.
Store this manual in a safe place so that you can retrieve it whenever necessary.
Provide this manual to the end-users of the device.
Name Description
This manual, which describes the system configuration and
Base unit (terminal block type) specifications of the KV Nano Series. It also describes the CPU built-
in functions and how to create ladder programs.
This manual describes system configurations and specifications, built-
KV Nano Series Base Unit
in functions in the CPU unit, and how to create ladder programs for
(connector type) User's Manual
the KV Nano Series (connector type).
KV-7000/5000/3000/1000 Series
This manual describes the instructions that are available in ladder
and KV Nano Series
programming.
Instruction Reference Manual
KV-7000/5000/3000/1000 Series
This manual describes how to create script programs and the
and KV Nano Series
available operators, control sentences, and functions.
Script Programming Manual
KV STUDIO User's Manual This manual describes how to operate KV STUDIO.
Name Description
KV Nano Series This manual describes the specifications, handling methods, and
Serial Communication Function operating procedures of the serial communication cassette for
User's Manual terminal blocks and of the base unit's built-in serial port.
The KV Nano Series functions differ according to the CPU function version.
The CPU function version can be checked using "Tools (T)"→"Check CPU function version (X)"→"PLC
(P)" in the KV STUDIO menu (* KV STUDIO version 7 or later is required).
717GB 1
Safety Precautions
Symbols
This document contains notices that you should observe to ensure your own personal safety, as well as
to protect the device and connected equipment. These notices are marked according to the level of
danger as shown below.
Important It indicates cautions and limitations that must be followed during operation.
General Precautions
• Before you use this device, verify its functionality and performance at startup and during operation.
• Provide a safety circuit that bypasses the PLC to enable failsafe operation of the entire system in
the event that the PLC fails.
• Output circuit and internal circuit malfunctions sometimes prevent control from being performed
normally. Be sure to provide a safety circuit in control systems where circuit malfunctions may lead
to fire or other serious accidents.
• Proceed with care when modifying the device, or when using it in a manner that falls outside of the
ranges indicated in its specifications, since KEYENCE is unable to guarantee device functionality
or performance in such situations.
• Use this device in combination with other devices only after careful consideration, since the device
may fail to satisfy its functionality and performance capabilities as a result of factors such as its
usage conditions and the environment in which it is used.
• Do not use the device with the purpose of protecting human beings.
• This device is not intended for use as an explosion-proof product. Do not use this device in a
hazardous location or in a location that has a potentially explosive atmosphere.
• Before you use KV STUDIO, verify that the KV Nano Series functions correctly.
CE Marking
KEYENCE has confirmed that this product complies with the essential requirements of the applicable
EC directives, based on the following specifications. Be sure to consider the following specifications
when using this product in the member states of the European Union.
However, these specifications do not guarantee that the end product in which this product is
incorporated complies with the essential requirements of the EMC directive. The manufacturer of the
end product is solely responsible for ensuring that the end product complies with the EMC directive.
Be sure to consider the following specifications when using this product as a UL/C-UL certified product.
• Install the KV Nano Series in an IP54 or better enclosure (industrial control panel).
• Supply power to the KV Nano Series using a UL Listing certified power supply that provides Class
2 output as defined in NFPA 70 (NEC: National Electrical Code) of The United States of America.
• For wiring to the terminal block of I/O units (excluding KV-NC8ER), use a stranded copper wire
with a gauge of AWG #14 to #20, and a temperature rating of 60°C or higher (105°C or higher
when wiring to the terminal block of relay type output units.) Use a tightening torque of 0.59 to 0.88
N•m (5.2 to 7.8 lb.-In).
• For wiring to KV-NC8ER units, use a stranded copper wire with a gauge of AWG #16 to #28, and a
temperature rating of 105°C or higher. Use a tightening torque of 0.23 N•m.
• For wiring to KV-N3AM terminal blocks, use a stranded copper wire with a gauge of AWG #14 to
#20, and a temperature rating of 60°C or higher. Use a tightening torque of 0.59 to 0.88 N•m (5.2 to
7.8 lb.-In).
• For wiring to KV-NC4AD and KV-NC2DA units, use a stranded copper wire with a gauge of AWG
#16 to #28, and a temperature rating of 60°C or higher. Use a tightening torque of 0.23 N•m.
• For wiring to KV-NC4TP units, use a stranded copper wire with a gauge of AWG #16 to #24, and a
temperature rating of 60°C or higher.
• For wiring to KV-NC20L terminal blocks, use a stranded copper wire with a gauge of AWG #20 to
#22, and a temperature rating of 60 °C or higher. Use a tightening torque of 0.23 N•m.
• Use the product in an environment that corresponds to pollution degree 2.
• Use the product in an environment with an ambient temperature of 55°C or less.
Class A device
This is a class A product. In a domestic environment this product may cause radio interference in
which case the user may be required to take adequate measures.
Ͳ 匏͑匶匶͙͑ 櫋怺殯͑愯暧皻柦匶沖沲͚
決͑匶匶垚͑櫋怺殯 ͙Ͳ 匏 ͚͑洊沖砒洇穯匶匶嵢昢͑砖廪沖͑嬖垚͑斲殯沖垚͑決͑洖汊
渂汞穞柢匶͑愚岂彶 ͑͝儆洛歾汞͑滆櫳櫖昢͑斲殯穞垚͑冉汊͑徯洇求嵢͑穯城埪 ͟
1
OVERVIEW of the KV Nano Series, communication channels with PCs, and the
occupied areas of the units.
2
Chapter SPECIFICATIONS AND
This chapter provides the specifications of and describes how to wire
3
the KV Nano Series base unit, expansion I/O unit, extension cassette
2 WIRING
for the terminal block unit, and LCD extension cassette. 4
Chapter UNIT INSTALLATION This chapter describes how to install the KV Nano Series as well as 5
3 AND MAINTENANCE how to attach units, wiring precautions, and maintenance procedures.
This chapter describes various functions that you can use by using
Chapter LADDER
the positioning, high-speed counters, communication ports, I/O, and
5 PROGRAMMING
other built-in functions of the KV Nano Series base unit.
Chapter 1 OVERVIEW
1-1 System Configuration............................................................................................. 1-2
System Configuration Overview ·········································································· 1-2
(1) Base Unit ··································································································· 1-3
(2) Extension Serial Communication Cassette ························································ 1-3
(3) Extension Access Window Cassette (With Memory Cassette Function) ·················· 1-3
(4) Expansion units (terminal block) ····································································· 1-3
(5) Connecting transformer unit ··········································································· 1-4
(6) Expansion unit (connector) ············································································ 1-4
Connecting to Communication Devices································································· 1-5
Current Consumption Calculation ········································································ 1-7
1-2 Unit I/O Assignments.............................................................................................. 1-8
I/O Relay Assignment Rules ··············································································· 1-8
I/O Relay Assignment ······················································································· 1-9
Unit Reservation ·····························································································1-10
Chapter 2 SPECIFICATIONS
2-1 Series Common Specifications ............................................................................. 2-2
General Specifications ······················································································ 2-2
Performance Specifications ················································································ 2-3
Operation during Power Outages········································································· 2-4
2-2 Base Unit Shared Specifications........................................................................... 2-5
About the Base Unit Model Number ····································································· 2-5
Package Contents ···························································································· 2-5
Names and Functions of Parts ············································································ 2-6
Specifications ·································································································· 2-9
RUN-PROG Selector Switch and Error Clear Switch···············································2-13
Wiring ···········································································································2-14
2-3 Wiring and Internal Circuit Diagrams of the 14-Point Base Unit (KV-N14AR/AT/ATP/DR/DT/DTP) ....... 2-15
Relay Output Type KV-N14AR/N14DR ································································2-15
Transistor Output Type KV-N14AT/N14DT/N14ATP/N14DTP···································2-17
Example of Wiring a Transistor Output to a Servo Amplifier (SV Series) ·····················2-20
Outline Drawings·····························································································2-21
Mnemonic lists are included on the pages in which sample ladder programs are introduced.
You can use mnemonic lists to easily enter ladder programs.
3 In the ladder edit area of KV STUDIO, click the cell in which you want to insert a sample ladder
program, then, on the "Edit" menu, click "Edit list" to display the "List edit" dialog box.
Alternative procedure
• Ctrl + D
Terminology
Terminology Description
This refers to electronic equipment that you can use to freely control equipment by
Programmable controller
changing programs. They are also called PLC (Programmable Logic Controller).
KV-7500/7300/5500/5000/
This refers to KEYENCE programmable controllers.
3000/1000
CPU unit This refers to the KV-7500/7300/5500/5000/3000/1000.
This refers to the KV-N14**, KV-N24**, KV-N40**, KV-N60A*, and KV-NC32T
KV Nano Series
KEYENCE programmable controllers.
Base unit This refers to the KV Nano Series.
This refers to expansion I/O units and expansion special units, other than the base
Expansion unit
unit, that can be used with the KV Nano Series.
KV Nano Series
This refers to the KV-N14**, KV-N24**, KV-N40**, KV-N60A*.
(terminal block)
KV Nano Series (connector) This refers to the KV-NC32T.
Expansion units This refers to expansion units which connect to the KV Nano series (terminal block)
(terminal block) with a connection cable.
This refers to expansion units which connect to the KV Nano series (connector)
Expansion unit (connector)
with a connection connector.
KV STUDIO This refers to the software that supports the creation of KV Nano Series programs.
Ladder program This refers to programs that are created with KV STUDIO.
This refers to extension serial communication cassettes (KV-N10L and KV-N11L)
Extension cassette
and extension access window cassettes (KV-N1AW).
(1)
Base unit
KV Nano Series
KV-N14** (4) (5) (6)
KV-N24** Expansion units Connecting Expansion unit
KV-N40** (terminal block) transformer (connector)
Extension serial
(2) communication
cassette
KV-N60** (I/O and special) unit (I/O, special)
• To start the KV Nano Series, you must turn the power on.
Point
Because the power supplies vary depending on the model, check the power
supply before you turn the product on.
100 VAC to 240 VAC input 24 VDC input
• KV-N14AR/KV-N14AT/KV-N14ATP • KV-N14DR/KV-N14DT/KV-N14DTP
• KV-N24AR/KV-N24AT/KV-N24ATP • KV-N24DR/KV-N24DT/KV-N24DTP
• KV-N40AR/KV-N40AT/KV-N40ATP • KV-N40DR/KV-N40DT/KV-N40DTP
• KV-N60AR/KV-N60AT/KV-N60ATP
• The KV-N24**, KV-N40**, and KV-N60** use backup capacitors to store clock
data.
If you do not turn these products on for a long time, the clock data may be lost.
If you want to use the clock data, set it when you start the products. "5-12
Clock Function"
• You can use up to two expansion unit connection extension cables (but do not
use them connected to each other).
• You can connect connector type expansion units using the connecting
transformer unit KV-N1.
• You can connect only 1 each of the connecting transformer units KV-N1 and
KV-NC1.
• You can connect up to eight expansion units (up to three KV-N14** units).
• You can use up to 256 I/O points, 128 on the KV-N14**. (This does not include
the I/O points of the base unit).
• If you connect two or more extension access window cassettes (KV-N1AW) to a
single base unit, the base unit will not operate.
OVERVIEW
(1) Base Unit
Supply power to the base unit through the terminal block on the top of the unit. You can connect
1
System Configuration
extension cassettes to the cassette slots on the front of the unit. Connect expansion units on the right
side of the unit. You do not need to connect an end unit on the far-right of the expansion units.
When you use the extension access window cassette (KV-N1AW), you can read and write ladder
programs and device data to memory cassettes, perform motor control using built-in I/O, and use
functions such as the high-speed counter.
"Chapter 5 CPU BUILT-IN FUNCTIONS"
With the KV Nano Series, you can improve programming efficiency by using functions such as
modules, macros, local devices, and KV scripts.
"Chapter 4 LADDER PROGRAMMING"
"Instruction Reference Manual"
"Script Programming Manual"
If you are using an extension serial communication cassette (KV-N10L or KV-N11L), connect it to the
cassette slot of the KV Nano Series. (You cannot connect a cassette when the KV Nano Series is on.
Be sure to turn the KV Nano Series off before you connect the cassette.)
For the KV-N14** and KV-N24**, you can connect one cassette per base unit. For the KV-N40** and
KV-N60**, you can connect two cassettes per base unit. The KV Nano Series operates even if an
extension serial communication cassette is not installed.
If you are using an extension access window cassette (KV-N1AW), connect it to the cassette slot of the
KV Nano Series. (You cannot connect a cassette when the KV Nano Series is on. Be sure to turn the
KV Nano Series off before you connect the cassette.)
You can connect just one cassette per base unit. The KV Nano Series operates even if an extension
access window cassette is not installed.
Be sure to connect expansion I/O units and expansion special units on the right side of the base unit.
You can connect up to eight expansion units (up to three KV-N14** units) per base unit (excluding some
expansion units).
"2-7 Expansion Input Unit (KV-N8EX and KV-N16EX)" (page 2-47)
"2-8 Expansion Output Unit (KV-N8ER/ET/ETP and KV-N16ER/ET/ETP)" (page 2-51)
"2-9 Expansion I/O Unit (KV-N8EXR and KV-N8EXT)" (page 2-56)
"Expansion Special Unit User's Manuals"
When installing the connector type expansion I/O unit or special expansion unit on the base unit
(terminal block), be sure to install it to the right of the connecting transformer unit (KV-N1). Up to 8 units
can be connected to the base unit together with a terminal block type expansion unit. (Excluding some
expansion units)
"KV Nano Series (terminal block) User's Manual"
"Each Special Expansion Unit's User's Manual"
OVERVIEW
Connecting to Communication Devices
This section describes the communication channels that are used to perform communications between
1
the KV Nano Series and a PC or touch panel.
System Configuration
Reference The environmental specifications vary depending on the devices used. Use the devices
after first checking their environmental specifications.
Base unit
KV Nano Series
KV-N14/N24/N40/N60
USB port (USB communication)
KV-N10L
Port 0 Port 1 Port 2
Serial port (RS-422A/485)
Base unit
KV Nano Series
KV-N14/N24/N40/N60 Serial port
(RS-232C) USB port
(USB communication)
KV-N10L
Serial port
(RS-422A/485)*
Ethernet port
VT3-E3 (Ethernet)
KV-N10L DT Series
* You cannot use the RS-485 interface to connect through the DT Series.
• To perform communications through the USB interface, you have to install the
Point
USB driver.
• If your operating system is Windows 7, Windows Vista, or Windows XP, the
driver will be automatically installed when you install KV STUDIO. For Windows
2000, you may have to install the USB driver manually.
• For the procedure for installing the USB driver, see "5-8 USB
Communication" (page 5-192).
• For the DC power supply type, the SGs of the base unit's USB and serial ports
are shared with 0 V of the power supply. A potential difference between the
product being connected to and the SGs will lead to damage to the base unit
and to the product being connected to.
- KV Nano Series(terminal block type) User’s Manual - 1-5
1-1 System Configuration
OVERVIEW
• Insert the modular cable included with the unit into the communication
port on the rear panel of the KV-D30.
When you are supplying power from the modular connector, the KV-D30 cannot
Point
be used in an environment that has an ambient temperature of 40°C or higher.
OVERVIEW
Current Consumption Calculation
With the KV Nano Series, power is supplied to the extension cassettes and expansion units from the
1
System Configuration
base unit. What's more, the AC power supply type base unit (KV-N**A*) has a service power supply
(24 V). Use the KV Nano Series so that the total current consumption from supplying power to the
expansion units and from the service power supply is less than the rated value.
Power supplied from the base unit Rated value of the base unit (2 A)
Temperature controller
• If the current consumption exceeds the rated value, the AC power supply type
Point
KV Nano Series will operate as shown below.
• The power LED will light in orange, and operations will be stopped.
• Power supply to the expansion units and to the service power supply will
be stopped.
• If you are using extension access window cassettes, the access window
displays will be turned off.
• To recover the system to normal operation, turn the power off, remove the
cause of the overcurrent, and then turn the power on.
• If the current consumption exceeds the rated value, the DC power supply type
KV Nano Series will operate as shown below.
• The built-in fuse will blow.
To recover the system to normal operation, repairs are required.
* Even if you connect the maximum number of devices, the current
consumption will not exceed the rated value.
1.The leading numbers of the I/O relays are R (the expansion unit number) × 1000.
For the first unit from the left, the leading number of the I/O relay is R1000 because 1 × 1000 =
1000.
For the third unit from the left, the leading number of the I/O relay is R3000 because 3 × 1000 =
3000.
2.For input relays, 000 is added to the relay number. For output relays, 500 is added to the
relay number.
The assigned relay number differs depending on whether the relay is an input or output relay.
The connecting transformer units KV-N1 and KV-NC1 are not assigned relay
Point
numbers and are not added to the number of units.
Output units
Connected unit KV-NC8ER KV-NC16ET(P)
KV-NC32ET
number KV-N8** KV-N16**
1 R1500 to R1507 R1500 to R1515 R1500 to R1615
2 R2500 to R2507 R2500 to R2515 R2500 to R2615
3 R3500 to R3507 R3500 to R3515 R3500 to R3615
4 R4500 to R4507 R4500 to R4515 R4500 to R4615
5 R5500 to R5507 R5500 to R5515 R5500 to R5615
6 R6500 to R6507 R6500 to R6515 R6500 to R6615
7 R7500 to R7507 R7500 to R7515 R7500 to R7615
8 R8500 to R8507 R8500 to R8515 R8500 to R8615
OVERVIEW
I/O units
Connected unit KV-N8EXR/KV-N8EXT KV-NC16EXT
number Input Relays Output Relays Input Relays Output Relays 1
1 R1000 to R1007 R1500 to R1507 R1000 to R1015 R1500 to R1515
Unit Reservation
1 With the KV Nano Series, you can use the unit reservation function to use the same project to manage
units even if the unit configuration is different. For example, even if you have an installation in which an
Unit I/O Assignments
expansion analog I/O unit is attached as an option, you can use the same project to operate the
system. This makes project management easy.
Project A
0 1 2 3
C2 - -
OUT V2+ I2+ -
KV-N3AM
Unit reservation made
for the KV-N3AM
POWER
ERROR
C0 V1+ I1+
IN V0+ I0+ C1
Configuration A Configuration B
C2 - -
OUT V2+ I2+ -
KV-N3AM
POWER
ERROR
C0 V1+ I1+
IN V0+ I0+ C1
• When you make a reservation for a unit, if the unit is present in the actual
Point
configuration, a unit configuration error will not occur, and the system will
operate normally.
• Regarding units other than the ones that you are making reservations for, if the
information that you have used the Unit Editor to configure differs from the
information of the devices that are actually connected, a number of units error or a
unit classification error will occur, and you will not be able to operate the system.
• If you use the number of a unit that is not present in the actual configuration (a
reserved unit) as an operand in an instruction (a macro instruction or other
instruction), an error will not occur during conversion, but an operation error (a
minor error) will occur during execution. You can use the following methods to
avoid calculation errors.
• Include the expansion unit presence relay in a logical AND with the execution
conditions.
• Configure the CPU system settings (the operation when an error occurs) so
that the CPU operation is set to continuation (to ignore errors).
• You can use the expansion unit n presence relays (CR2201 to CR2208) to check
Reference
whether the expansion units of each unit number are actually connected.
• You can add expansion units to the right of reserved units.
• If you make consecutive reservations for multiple instances of the same unit to
connect less units in the actual configuration than the total number of units that you
have specified, the connected units operate with unit numbers assigned from the left.
For example, if you make reservations for unit numbers 1, 2, and 3 as KV-N16EXTs,
but only use two KV-N16EXTs, the connected units will be recognized as unit
numbers 1 and 2 when they operate (you cannot have a gap between unit numbers
such as assigning unit numbers 1 and 3).
1-10 - KV Nano Series(terminal block type) User’s Manual -
SPECIFICATIONS
2
SPECIFICATIONS
This chapter provides the specifications of and describes how to wire the KV
Nano Series base unit, expansion I/O unit, extension serial communication
cassette, and extension access window cassette.
This section provides the specifications of the KV Nano Series and describes the operation of the KV
Nano Series when the power is turned off.
General Specifications
2
Item Specification
Series Common Specifications
*1 The range in which the system is guaranteed (excluding items specially noted for the units and cassettes).
*2 Indicated on the lower, central part (30 mm) of the unit in the industrial control panel.
*3 These specifications correspond to situations in which the unit is mounted on a DIN rail and in which the unit
is mounted on another unit directly.
The KV Nano Series does not have battery backup, it uses backup capacitors to
Point store clock data (the KV-N14** does not have clock data). For the period that clock
data is held, see "How to set clock data (excluding the KV-N14**)" (page 3-21).
SPECIFICATIONS
Performance Specifications
Specification
Item
KV-N14** KV-N24** KV-N40** KV-N60** 2
Calculation control method Program storage method
Specification
Item
KV-N14** KV-N24** KV-N40** KV-N60**
Number of 10,000 20,000
Device comments
comments and When a maximum-length ladder program is written with no labels.
Power off hold Program memory Flash ROM can be rewritten 10,000 times
function Devices*4 Nonvolatile RAM
Self-diagnosis function CPU error, RAM error, and other problems
*1 You can also configure the settings so that automatic reset is not performed.
*2 Only open collectors are supported. Line drivers are not supported.
*3 The relay output types (KV-N***R) do not have the positioning pulse output function.
*4 You can set the target device by clicking "CPU system setting" and then "Power off holding" in KV STUDIO.]
*5 This may be limited by the maximum number of installable I/O units.
SPECIFICATIONS
About the Base Unit Model Number
Unit type
There are the following seven types of the KV Nano Series base unit.
Terminal block AC power supply relay output type . . . . . . . . . . . . KV-N14AR, KV-N24AR, KV-N40AR, and KV-N60AR
Terminal block AC power supply transistor output (sink) type . . . . KV-N14AT, KV-N24AT, KV-N40AT, and KV-N60AT
Terminal block AC power supply transistor (source) output type . . . KV-N14ATP, KV-N24ATP, KV-N40ATP, and KV-N60ATP
Terminal block DC power supply relay output type . . . . . . . . . . . . KV-N14DR, KV-N24DR, and KV-N40DR
Terminal block DC power supply transistor output (sink) type. . . . KV-N14DT, KV-N24DT, and KV-N40DT
Terminal block DC power supply transistor (source) output type . . .KV-N14DTP, KV-N24DTP, and KV-N40DTP
Connector DC power supply transistor output (sink) type. . . . . . . KV-NC32T
* This manual describes the terminal block type unit.
For details on other units, see the "KV Nano Series (connector type) User's Manual".
Package Contents
The package contains the following items. Before you use the product, make sure that the package
contains everything that it is supposed to contain.
KEYENCE
KV Nano Series
User's Manual
The utmost care has been exercised in packing the items, however, in the event that items malfunction
or are damaged, contact your KEYENCE representative.
Do not connect a USB cable to the modular connector (doing so may damage the
NOTICE
product).
SPECIFICATIONS
KV-N40** and KV-N60**
During standard usage
Do not connect a USB cable to the modular connector (doing so may damage the
NOTICE
product).
stopped).
Blinking in red (blinking at 2-second intervals): A minor error or an
alarm has occurred.
Off: No errors have occurred.
(10) USB access LED This lights to indicate that data is being transferred over USB.
(11) SD/RD LED This lights to indicate that serial communications are being
performed.
RD: Lights in red when data is being received.
SD: Lights in green when data is being transmitted.
(During data transmission and reception, this may appear to light in
orange.)
(12) Output indicators These indicate the output status of the output terminals.
Lit in red : Output is being generated.
Off : Output is not being generated.
(13) Power supply input These are the connectors for the power supply input (100 to 240
terminals VAC for the AC power supply type and 24 VDC for the DC power
supply type).
(14) RUN-PROG selector
This switch changes the mode between RUN mode and PROG
switch and error clear
mode.
switch
Also, use this switch when you want to clear errors.
(15) Analog volume knobs These set the analog volume values.
Vol.0: CM1630 (two words; 0 to 255)
Vol.1: CM1632 (two words; 0 to 255)
(*You can easily scale the analog volume values by using the APR
instruction. For details, see the ARP instruction in the KV-
7000/5000/3000/1000 Series and KV Nano Series "Instruction
Reference Manuals.")
(16) USB port This is the port for connecting to the USB interface.
(17) Modular connector This is the connector for connecting a modular plug. Use this
connector to connect a PC, touch panel, or similar device.
(18) Extension cassette This is the connector for connecting to an extension cassette. Use
connector this when you want to extend the number of access windows or
serial communication ports that are available.
(19) Service power supply These are the 24 VDC output terminals for the service power supply.
terminals Use these to supply power to a sensor or similar device.
(*Do not supply 24 V to the service power supply terminal.)
(20) Input terminals These terminals are used to receive input.
Expansion unit connection
(21) This connector is used to connect an expansion unit.
connector
(22) Output terminals These terminals are used to generate output.
Do not connect a USB cable to the modular connector (doing so may damage the
NOTICE product).
SPECIFICATIONS
Specifications
Input specifications
General input 2
KV-N14**: R000 to R003 (4 points)
10 μs or more ON
A-phase, 50%
5 μs or more 5μs or more
OFF
ON ON
OFF OFF
1.8μs or less 1.8μs or less T1 T2 T3 T4
T1, T2, T3, T4: 2.5μs or more
* If the impedance of the connecting wire is large, note that the input waveform may not meet the description given
above after the wave passes through the connecting wire.
SPECIFICATIONS
Output specifications
OFF90%
10%
ON
* The load of the above waveform is a resistive load. The influence of the connecting wire is not considered.
If the impedance of the connecting wire is large, note that the ON/OFF width might be smaller than the values written
above.
General output
Relay output type Transistor output type
KV-N14*R: R500 to R505 (6 points) KV-N14*T(P): R504 and R505 (2 points)
KV-N24*R: R500 to R509 (10 points) KV-N24*T(P): R504 to R509 (6 points)
KV-N40*R: R500 to R515 (16 points) KV-N40*T(P): R506 to R515 (10 points)
2 KV-N60*R: R500 to R607 (24 points) KV-N60*T(P): R508 to R607 (16 points)
Specification
Base Unit Shared Specifications
SPECIFICATIONS
RUN-PROG Selector Switch and Error Clear Switch
Reference When the selector switch is in the "RUN" position, you can use KV STUDIO to switch
between PROG mode and RUN mode.
Error clear
You can use the RUN-PROG selector switch and error clear switch to
clear errors.
Set the RUN-PROG selector switch and error clear switch to the Err.Clr
side (down) for 1 second or more to clear all errors that are currently
occurring.
When you release the RUN-PROG selector switch and error clear
switch, it will automatically return to the PROG mode position.
Wiring
Modular connector
2 You can use the modular connector to perform serial (RS-232C) communications with peripheral
devices such as PCs and touch panels.
Base Unit Shared Specifications
Modular connector
6
5
4
3
2
1
• The +5 V power supply output terminal is the power supply dedicated for
Point
supplying power to the KV-D30. It cannot be used for any other purpose.
• For the DC power supply type, the SGs of the base unit's USB and serial ports
are shared with 0 V of the power supply. A potential difference between the
product being connected to and the SGs will lead to damage to the base unit
and to the product being connected to.
SPECIFICATIONS
Relay Output Type KV-N14AR/N14DR
Wiring and Internal Circuit Diagrams of the 14-Point Base Unit (KV-N14AR/AT/ATP/DR/DT/DTP)
Power supply
AC_L AC_N 000 002 004 006
circuit terminals
FG FG
FG 24 V 0V FG
AC_L AC_N
000 to 003
510Ω
+
+ C0
Photo-coupler isolation
Internal circuit
+
Blue Blue Blue Blue Blue Blue Blue Blue + C0 560Ω
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Black
Black
Black
Black
Black
Black
Black
Black
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
Sensors
With the KV-N14AR, the service power supply can also be used for the 24 V power
Reference
supply that is used to supply power to sensors and other similar devices.
2 C0
000 R000
-
Yes
Input common (for R000 to R007)
High-speed counter 0, enable input -
001 R001 Yes High-speed counter 1, enable input -
Wiring and Internal Circuit Diagrams of the 14-Point Base Unit (KV-N14AR/AT/ATP/DR/DT/DTP)
Note that if you leave long-distance wiring to an input terminal open, the wiring
Point
will become an antenna for picking up noise, which may lead to incorrect input.
Reference You must use a converter to apply line driver output to the inputs.
503 to 505
With the KV-N14AR, the service power supply can also be used for the 24 V power
Reference
supplies of external loads.
SPECIFICATIONS
Transistor Output Type KV-N14AT/N14DT/N14ATP/N14DTP
Wiring and Internal Circuit Diagrams of the 14-Point Base Unit (KV-N14AR/AT/ATP/DR/DT/DTP)
KV-N14AT
terminals (AC power supply type only; 0V 500 501 502 503 505
NC for the DC power supply type) 24V C1 C1 C1 C1 504
FG FG
FG 24 V 0V FG
AC_L AC_N
000 to 003
510Ω
+
+ C0
Photo-coupler isolation
Internal circuit
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Black
Black
Black
Black
Black
Black
Black
Black
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
Sensors
With the KV-N14AT(P), the service power supply can also be used for the 24 V power
Reference
supply.
2
C0 - Input common (for R000 to R007)
000 R000 Yes High-speed counter 0, enable input Axis 1/axis 2, stop sensor input
001 R001 Yes High-speed counter 1, enable input Axis 1/axis 2, origin sensor input
Wiring and Internal Circuit Diagrams of the 14-Point Base Unit (KV-N14AR/AT/ATP/DR/DT/DTP)
High-speed counter 0,
002 R002 Yes Axis 1, Z-phase
Z-phase (preset)
High-speed counter 1,
003 R003 Yes Axis 2, Z-phase
Z-phase (preset)
004 R004 No High-speed counter 0, A-phase -
005 R005 No High-speed counter 0, B-phase -
006 R006 No High-speed counter 1, A-phase -
007 R007 No High-speed counter 1, B-phase -
Note that if you leave long-distance wiring to an input terminal open, the wiring
Point
will become an antenna for picking up noise, which may lead to incorrect input.
Reference You must use a converter to apply line driver output to the inputs.
Isolated protection
power supply
500 to 505
Internal circuit
L
0V 500 501 502 503 505
Protection
circuit
24V C1 C1 C1 C1 504
C1
*1
L L L L L L • C1 is shorted internally.
Output circuit
L
500 to 505
• With the KV-N14AT(P), the service power supply can also be used for the 24 V power
Reference supplies of external loads.
• The isolated protection power supply is shared between each common. If even a
single overcurrent is detected, until the cause of the problem is removed, the
protection operation (output turning OFF) and automatic recovery occur repeatedly
for all outputs within the shared common.
SPECIFICATIONS
Output terminal details
Wiring and Internal Circuit Diagrams of the 14-Point Base Unit (KV-N14AR/AT/ATP/DR/DT/DTP)
High-speed counter 1,
501 High speed R501 Axis 1, CCW
comparator matching output
C1* - - Output common (for R500 to R505)
502 High speed R502 - Axis 2, CW
C1* - - Output common (for R500 to R505)
503 High speed R503 - Axis 2, CCW
504 General R504 - Axis 1, deviation counter clear
505 General R505 - Axis 2, deviation counter clear
* All C1 terminals are shorted internally.
24 V (+)
2 Power supply
GND
Terminal Pin
Relay Signal Name
Number Number
COM Input common (for R000 to R007) C0 7 NP+ (reverse pulse input, positive)
R000 Axis 1, origin sensor input*1 000 34 PL1 (power supply for open collector instructions)
R001 Axis 1, stop sensor input*1 001 10 PP+ (forward pulse input, positive)
35 PL2 (power supply for open collector instructions)
R003 Axis 1, driver alarm*2 003 14 ALARM
R002 Axis 1, Z-phase 002 32 Z-phase (open collector)
R006 Axis 1, limit switch CW*3 006
R007 Axis 1, limit switch, CCW*3 007
24 V (+)
Power supply
GND
* Wire the EMG (forced stop), LSP (limit switch in forward direction), and LSN (limit switch in reverse direction) of the SV
Series separately. Alternatively, if you will not wire them, change the corresponding SV Series parameter settings to A
contact.
* We recommend that you use shielded, twisted-pair cables for the I/O cables. Ensure that the I/O connector cables are 3
m or less in length.
* If noise is present in the I/O signals of the sink type, you may be able to improve the problem by twisting the signal cable
in question together with a 0 V or +24 V cable, and then performing the wiring with this twisted-pair.
*1 You can use the parameter settings to change the assignments.
*2 General input is being used. You can freely change this assignment for ladder processing.
*3 General input is being used. Confirm the input status, and then use ladder programs to control CR8012 and CR8013.
*4 General output is being used. You can freely change this assignment for ladder processing.
SPECIFICATIONS
Outline Drawings
82
2-ø4.5
2
27.3
Wiring and Internal Circuit Diagrams of the 14-Point Base Unit (KV-N14AR/AT/ATP/DR/DT/DTP)
35.9
90
82
3.8
90 17.2 83.7
11
17
KV-N24AR
terminals (AC power supply type only; 0V 500 501 502 503 505 506 508 509
NC for the DC power supply type) 24V C1 C2 C3 C4 504 C5 507 C5
FG FG
AC_L AC_N FG FG
24 V 0V
000 to 003
008 to 013 510Ω
+
012 010 008 006 004 002 000 + C0
Photo-coupler isolation
Internal circuit
Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue
004 to 007 3.3kΩ
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
+
+ C0 560Ω
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
Sensors
With the KV-N24AR, the service power supply can also be used for the 24 V power
Reference
supply that is used to supply power to sensors and other similar devices.
SPECIFICATIONS
Input terminal details
Wiring and Internal Circuit Diagrams of the 24-Point Base Unit (KV-N24AR/AT/ATP/DR/DT/DTP)
002 R002 Yes - -
003 R003 Yes - -
004 R004 No High-speed counter 0, A-phase -
005 R005 No High-speed counter 0, B-phase -
006 R006 No High-speed counter 1, A-phase -
007 R007 No High-speed counter 1, B-phase -
008 R008 No High-speed counter 0, enable input -
009 R009 No High-speed counter 1, enable input -
010 R010 No High-speed counter 0, Z-phase (preset) -
011 R011 No High-speed counter 1, Z-phase (preset) -
012 R012 No - -
013 R013 No - -
Note that if you leave long-distance wiring to an input terminal open, the wiring
Point
will become an antenna for picking up noise, which may lead to incorrect input.
Reference You must use a converter to apply line driver output to the inputs.
Internal circuit
L L L L L L L L L L
C1
C2
C3
C4
C5
• C1 to C5 are independent.
The two C5 terminals are shorted internally.
With the KV-N24AR, the service power supply can also be used for the 24 V power
Reference
supplies of external loads.
2 C1
500
-
General
-
R500
High-speed counter 0,
Output common (for R500)
-
comparator matching output
Wiring and Internal Circuit Diagrams of the 24-Point Base Unit (KV-N24AR/AT/ATP/DR/DT/DTP)
KV-N24AT
FG FG
FG FG
AC_L AC_N 24 V 0V
SPECIFICATIONS
Input circuit diagram
Circuit configuration of inputs 000 to 003 and
Internal circuit
008 to 013
2
4.3kΩ Photo-coupler isolation
Internal circuit
000 to 003
008 to 013 510Ω
Wiring and Internal Circuit Diagrams of the 24-Point Base Unit (KV-N24AR/AT/ATP/DR/DT/DTP)
012 010 008 006 004 002 000
+ C0
013 011 009 007 005 003 001 C0
Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Photo-coupler isolation
Internal circuit
004 to 007 3.3kΩ
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
+
+ C0 560Ω
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
Sensors
With the KV-N24AT(P), the service power supply can also be used for the 24 V power
Reference
supply that is used to supply power to sensors and other similar devices.
Note that if you leave long-distance wiring to an input terminal open, the wiring
Point
will become an antenna for picking up noise, which may lead to incorrect input.
Reference You must use a converter to apply line driver output to the inputs.
Isolated power
2
supply
Isolated protection
power supply
500 to 509
Internal circuit
L
Wiring and Internal Circuit Diagrams of the 24-Point Base Unit (KV-N24AR/AT/ATP/DR/DT/DTP)
*1 For KV-N24*TP C1
Isolated power
supply
Protection
circuit
Internal circuit
Output circuit
L
500 to 509
• With the KV-N24AT(P), the service power supply can also be used for the 24 V power
Reference
supplies of external loads.
• The isolated protection power supply is shared between each common. If even a
single overcurrent is detected, until the cause of the problem is removed, the
protection operation (output turning OFF) and automatic recovery occur repeatedly
for all outputs within the shared common.
SPECIFICATIONS
Example of Wiring a Transistor Output to a Servo Amplifier (SV Series)
24 V (+)
Power supply
GND
2
KV-N24*T (Sink types) SV Series
Wiring and Internal Circuit Diagrams of the 24-Point Base Unit (KV-N24AR/AT/ATP/DR/DT/DTP)
Terminal Pin
Relay Signal Name
Number Number
COM Input common (for R000 to R013) C0 7 NP+ (reverse pulse input, positive)
R000 Axis 1, origin sensor input*1 000 34 PL1 (power supply for open collector instructions)
R001 Axis 1, stop sensor input*1 001 10 PP+ (forward pulse input, positive)
35 PL2 (power supply for open collector instructions)
R002 Axis 1, driver alarm*2 002 14 ALARM
R010 Axis 1, Z-phase 010 32 Z-phase (open collector)
R008 Axis 1, limit switch, CW*3 008
R009 Axis 1, limit switch, CCW*3 009
24 V (+)
Power supply
GND
* Wire the EMG (forced stop), LSP (limit switch in forward direction), and LSN (limit switch in reverse direction) of the SV
Series separately. Alternatively, if you will not wire them, change the corresponding SV Series parameter settings to A
contact.
* We recommend that you use shielded, twisted-pair cables for the I/O cables. Ensure that the I/O connector cables are 3
m or less in length.
* If noise is present in the I/O signals of the sink type, you may be able to improve the problem by twisting the signal cable
in question together with a 0 V or +24 V cable, and then performing the wiring with this twisted-pair.
*1 You can use the parameter settings to change the assignments.
*2 General input is being used. You can freely change this assignment for ladder processing.
*3 General input is being used. Confirm the input status, and then use ladder programs to control CR8012 and CR8013.
*4 General output is being used. You can freely change this assignment for ladder processing.
Outline Drawings
82
2 2-ø4.5
27.3
Wiring and Internal Circuit Diagrams of the 24-Point Base Unit (KV-N24AR/AT/ATP/DR/DT/DTP)
35.9
90
82
3.8
90 17.2 83.7
11
17
SPECIFICATIONS
Relay Output Type KV-N40AR/N40DR
Wiring and Internal Circuit Diagrams of the 40-Point Base Unit (KV-N40AR/AT/ATP/DR/DT/DTP)
AC_L AC_N 000 002 004 006 008 010 012 014 100 102 104 106
FG C0
KV-N40DA
0V 500 501 502 504 505 507 508 509 511 512 513 515 •
NC for the DC power supply type)
24V C1 C2 C3 503 C4 506 C4 C5 510 C5 C6 514 C6
FG FG
FG 24 V 0V FG
AC_L AC_N
Internal circuit
106 104 102 100 014 012 010 008 006 004 002 000
107 105 103 101 015 013 011 009 007 005 003 001 C0
Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
Sensors
With the KV-N40AR, the service power supply can also be used for the 24 V power
Reference
supply that is used to supply power to sensors and other similar devices.
Circuit configuration of inputs 000 to 007 and Circuit configuration of inputs 008 to 013
014 to 107
4.3kΩ Photo-coupler isolation Photo-coupler isolation
Internal circuit
000 to 007
014 to 107 510Ω +
+ C0 560Ω
+
+ C0
2
C0 - Input common (for R000 to R107)
000 R000 Yes - -
001 R001 Yes - -
Wiring and Internal Circuit Diagrams of the 40-Point Base Unit (KV-N40AR/AT/ATP/DR/DT/DTP)
Note that if you leave long-distance wiring to an input terminal open, the wiring
Point
will become an antenna for picking up noise, which may lead to incorrect input.
Reference You must use a converter to apply line driver output to the inputs.
Internal circuit
0V 500 501 502 504 505 507 508 509 511 512 513 515
L L L L L L L L L L L L L L L L
SPECIFICATIONS
With the KV-N40AR, the service power supply can also be used for the 24 V power
Reference
supplies of external loads.
500
2
501
502 to 503
504 to 507
Internal circuit
508 to 511
Wiring and Internal Circuit Diagrams of the 40-Point Base Unit (KV-N40AR/AT/ATP/DR/DT/DTP)
512 to 515
C1
C2
C3
C4
C5
C6
• C1 to C6 are independent.
The two C4, C5, and C6 terminals are shorted internally.
AC_L AC_N 000 002 004 006 008 010 012 014 100 102 104 106
Wiring and Internal Circuit Diagrams of the 40-Point Base Unit (KV-N40AR/AT/ATP/DR/DT/DTP)
KV-N40AT
NC for the DC power supply type) 0V 500 501 502 504 505 507 508 509 511 512 513 515 •
FG
FG
24 V 0V FG
AC_L AC_N FG
Internal circuit
106 104 102 100 014 012 010 008 006 004 002 000
107 105 103 101 015 013 011 009 007 005 003 001 C0
Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
Sensors
With the KV-N40AT, the service power supply can also be used for the 24 V power
Reference
supply that is used to supply power to sensors and other similar devices.
Circuit configuration of inputs 000 to 007 and Circuit configuration of inputs 008 to 013
014 to 107
008 to 013
Internal circuit
3.3kΩ
000 to 007
014 to 107 510Ω +
+ C0 560Ω
+
+ C0
SPECIFICATIONS
Input terminal details
2
C0 - Input common (for R000 to R107)
000 R000 Yes -
001 R001 Yes - Axis 1/axis 2, stop sensor input
Wiring and Internal Circuit Diagrams of the 40-Point Base Unit (KV-N40AR/AT/ATP/DR/DT/DTP)
002 R002 Yes - Axis 1/axis 2, origin sensor input
003 R003 Yes -
004 R004 No - Axis 3, stop sensor input
005 R005 No - Axis 3, origin sensor input
006 R006 No - -
007 R007 No - -
008 R008 No High-speed counter 0, A-phase -
009 R009 No High-speed counter 0, B-phase -
010 R010 No High-speed counter 1, A-phase -
011 R011 No High-speed counter 1, B-phase -
012 R012 No High-speed counter 2, A-phase -
013 R013 No High-speed counter 2, B-phase -
014 R014 No - -
015 R015 No - -
100 R100 No High-speed counter 0, enable input -
101 R101 No High-speed counter 1, enable input -
102 R102 No High-speed counter 2, enable input -
103 R103 No - -
High-speed counter 0,
104 R104 No Axis 1, Z-phase
Z-phase (preset)
High-speed counter 1,
105 R105 No Axis 2, Z-phase
Z-phase (preset)
High-speed counter 2,
106 R106 No Axis 3, Z-phase
Z-phase (preset)
107 R107 No - -
Note that if you leave long-distance wiring to an input terminal open, the wiring
Point
will become an antenna for picking up noise, which may lead to incorrect input.
Reference You must use a converter to apply line driver output to the inputs.
0V 500 501 502 504 505 507 508 509 511 512 513 515
*1 *1
L L L L L L L L L L L L L L L L
*1 For KV-N40*TP
• With the KV-N40AT(P), the service power supply can also be used for the 24 V power
Reference
supplies of external loads.
• The isolated protection power supply is shared between each common. If even a
single overcurrent is detected, until the cause of the problem is removed, the
protection operation (output turning OFF) and automatic recovery occur repeatedly
for all outputs within the shared common.
- KV Nano Series(terminal block type) User’s Manual - 2-33
2-5 Wiring and Internal Circuit Diagrams of the 40-Point Base Unit (KV-N40AR/AT/ATP/DR/DT/DTP)
SPECIFICATIONS
Circuit configuration for sink types Circuit configuration for source types
C1
C2
Isolated power Isolated power
supply supply
2
Protection
circuit
Isolated protection 500 to 507
power supply
508 to 515
Internal circuit
Internal circuit
L Output circuit
Wiring and Internal Circuit Diagrams of the 40-Point Base Unit (KV-N40AR/AT/ATP/DR/DT/DTP)
Protection
circuit
L
C1 500 to 507
C2 508 to 515
SPECIFICATIONS
Example of Wiring a Transistor Output to a Servo Amplifier (SV Series)
24 V (+)
Power supply
GND
2
KV-N40*T (Sink types) SV Series
Wiring and Internal Circuit Diagrams of the 40-Point Base Unit (KV-N40AR/AT/ATP/DR/DT/DTP)
Terminal Pin
Relay Signal Name
Number Number
COM Input common (for R000 to R107) C0 7 NP+ (reverse pulse input, positive)
R000 Axis 1, origin sensor input*1 000 34 PL1 (power supply for open collector instructions)
R001 Axis 1, stop sensor input*1 001 10 PP+ (forward pulse input, positive)
35 PL2 (power supply for open collector instructions)
R002 Axis 1, driver alarm*2 002 14 ALARM
R104 Axis 1, Z-phase 104 32 Z-phase (open collector)
R006 Axis 1, limit switch, CW*3 006
R007 Axis 1, limit switch, CCW*3 007
24 V (+)
Power supply
GND
* Wire the EMG (forced stop), LSP (limit switch in forward direction), and LSN (limit switch in reverse direction) of the SV
Series separately. Alternatively, if you will not wire them, change the corresponding SV Series parameter settings to A
contact.
* We recommend that you use shielded, twisted-pair cables for the I/O cables. Ensure that the I/O connector cables are 3
m or less in length.
* If noise is present in the I/O signals of the sink type, you may be able to improve the problem by twisting the signal cable
in question together with a 0 V or +24 V cable, and then performing the wiring with this twisted-pair.
*1 You can use the parameter settings to change the assignments.
*2 General input is being used. You can freely change this assignment for ladder processing.
*3 General input is being used. Confirm the input status, and then use ladder programs to control CR8012 and CR8013.
*4 General output is being used. You can freely change this assignment for ladder processing.
Outline Drawings
2 2-ø4.5
122
27.3
Wiring and Internal Circuit Diagrams of the 40-Point Base Unit (KV-N40AR/AT/ATP/DR/DT/DTP)
35.9
90
82
3.8
17.2 83.7
44 (42) 44
130
11
17
SPECIFICATIONS
Relay Output Type KV-N60AR
Wiring and Internal Circuit Diagrams of the 60-Point Base Unit (KV-N60AR/AT/ATP)
AC_L AC_N 000 002 004 006 008 010 012 014 100 102 104 106 108 110 112 114 200 202
C0
KV-N60AR
•
C7
Service power supply (24 V) 0V 500 501 502 504 505 507 508 509 511 512 513 515 600 601 603 604 605 607 •
FG
AC_L AC_N FG
Internal circuit
202 200 114 112 110 108 106 104 102 100 014 012 010 008 006 004 002 000
203 201 115 113 111 109 107 105 103 101 015 013 011 009 007 005 003 001 C0
Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
Sensors
The service power supply can also be used for the 24 V power supply that is used to
Reference
supply power to sensors and other similar devices.
Circuit configuration of inputs 000 to 007 and Circuit configuration of inputs 008 to 015
100 to 203
Internal circuit
2
C - Input common (for R000 to R203)
000 R000 Yes - -
001 R001 Yes - -
Wiring and Internal Circuit Diagrams of the 60-Point Base Unit (KV-N60AR/AT/ATP)
Note that if you leave long-distance wiring to an input terminal open, the wiring
Point
will become an antenna for picking up noise, which may lead to incorrect input.
Reference You must use a converter to apply line driver output to the inputs.
SPECIFICATIONS
Output circuit diagram
Internal circuit
Wiring and Internal Circuit Diagrams of the 60-Point Base Unit (KV-N60AR/AT/ATP)
0V 500 501 502 504 505 507 508 509 511 512 513 515 600 601 603 604 605 607
L L L L L L L L L L L L L L L L L L L L L L L L
Reference The service power supply can also be used for the 24 V power supply.
500
501
502 to 503
504 to 507
508 to 511
Internal circuit
512 to 515
600 to 603
604 to 607
C1
C2
C3
C4
C5
C6
C7
C8
• C1 to C8 are independent.
The two C4, C5, C6, C7, and C8 terminals are shorted internally.
2
C1 - - Output common (for R500)
High-speed counter 0,
500 General R500 -
comparator matching output
Wiring and Internal Circuit Diagrams of the 60-Point Base Unit (KV-N60AR/AT/ATP)
SPECIFICATIONS
Transistor Output Type KV-N60AT/N60ATP
Wiring and Internal Circuit Diagrams of the 60-Point Base Unit (KV-N60AR/AT/ATP)
C0
KV-N60AT
•
C1 C1 C1 C1 C1 C2 C2 C2 C2 C3 C3 C3 C3
0V 500 501 502 504 505 507 508 509 511 512 513 515 600 601 603 604 605 607 •
Service power supply (24 V)
24V C1 C1 C1 503 C1 506 C1 C2 510 C2 C2 514 C2 C3 602 C3 C3 606 C3
circuit terminals
FG
AC_L AC_N FG
Internal circuit
202 200 114 112 110 108 106 104 102 100 014 012 010 008 006 004 002 000
203 201 115 113 111 109 107 105 103 101 015 013 011 009 007 005 003 001 C0
Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue Blue
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
Black
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
Sensors
The service power supply can also be used for the 24 V power supply that is used to
Reference
supply power to sensors and other similar devices.
Circuit configuration of inputs 000 to 007 and Circuit configuration of inputs 008 to 015
100 to 203
3.3kΩ
Internal circuit
008 to 015
000 to 007
100 to 203 510Ω +
+ C0 560Ω
+
+ C0
2
C0 - Input common (for R000 to R203)
000 R000 Yes -
001 R001 Yes - Axis 1/axis 2, stop sensor input
Wiring and Internal Circuit Diagrams of the 60-Point Base Unit (KV-N60AR/AT/ATP)
Note that if you leave long-distance wiring to an input terminal open, the wiring
Point
will become an antenna for picking up noise, which may lead to incorrect input.
Reference You must use a converter to apply line driver output to the inputs.
SPECIFICATIONS
Output circuit diagram
Internal circuit
515 607
2
0V 500 501 502 504 505 507 508 509 511 512 513 600 601 603 604 605
Wiring and Internal Circuit Diagrams of the 60-Point Base Unit (KV-N60AR/AT/ATP)
24V C1 C1 C1 503 C1 506 C1 C2 510 C2 C2 514 C2 C3 602 C3 C3 606 C3
L L L L L L L L L L L L L L L L L L L L L L L L
• The service power supply can also be used for the 24 V power supplies of external
Reference
loads.
• The isolated protection power supply is shared between each common. If even a
single overcurrent is detected, until the cause of the problem is removed, the
protection operation (output turning OFF) and automatic recovery occur repeatedly
for all outputs within the shared common.
Isolated power
supply
500 to 507
Isolated protection
power supply 508 to 515
600 to 607
Internal circuit
Protection
circuit
C1
C2
C3
Output circuit
L
500 to 507
508 to 515
600 to 607
2
C1 - - Output common (for R500 to R507)
High High-speed counter 0,
500 R500 Axis 1, CW
speed comparator matching output
Wiring and Internal Circuit Diagrams of the 60-Point Base Unit (KV-N60AR/AT/ATP)
SPECIFICATIONS
Example of Wiring a Transistor Output to a Servo Amplifier (SV Series)
24 V (+)
Power supply
GND
2
KV-N60*T (Sink types) SV Series
Wiring and Internal Circuit Diagrams of the 60-Point Base Unit (KV-N60AR/AT/ATP)
Terminal Pin
Relay Signal Name
Number Number
COM Input common (for R000 to R203) C0 7 NP+ (reverse pulse input, positive)
R000 Axis 1, origin sensor input*1 000 34 PL1 (power supply for open collector instructions)
R001 Axis 1, stop sensor input*1 001 10 PP+ (forward pulse input, positive)
35 PL2 (power supply for open collector instructions)
R002 Axis 1, driver alarm*2 002 14 ALARM
R104 Axis 1, Z-phase 104 32 Z-phase (open collector)
R006 Axis 1 limit switch, CW*3 006
R007 Axis 1, limit switch, CCW*3 007
24 V (+)
Power supply
GND
* Wire the EMG (forced stop), LSP (limit switch in forward direction), and LSN (limit switch in reverse direction) of the SV
Series separately. Alternatively, if you will not wire them, change the corresponding SV Series parameter settings to A
contact.
* We recommend that you use shielded, twisted-pair cables for the I/O cables. Ensure that the I/O connector cables are 3
m or less in length.
* If noise is present in the I/O signals of the sink type, you may be able to improve the problem by twisting the signal cable
in question together with a 0 V or +24 V cable, and then performing the wiring with this twisted-pair.
*1 You can use the parameter settings to change the assignments.
*2 General input is being used. You can freely change this assignment for ladder processing.
*3 General input is being used. Confirm the input status, and then use ladder programs to control CR8012 and CR8013.
*4 General output is being used. You can freely change this assignment for ladder processing.
Outline Drawings
2 2-ø4.5
167
27.3
Wiring and Internal Circuit Diagrams of the 60-Point Base Unit (KV-N60AR/AT/ATP)
35.9
90
82
17.2 83.7
3.8
44 (87) 44
175
11
17
SPECIFICATIONS
This section describes the names and functions of the parts of the KV-N8EX and KV-N16EX Expansion
Input Units. It also provides the specifications of the units.
24V
5V
(3) Input
indicators (1) POWER LED
Specifications
KV-N8EX KV-N16EX
Model
2 External connection
(8 Points) (16 Points)
Terminal block
method
Expansion Input Unit (KV-N8EX and KV-N16EX)
Input terminals 24 VDC mode 5 VDC mode 24 VDC mode 5 VDC mode
Maximum input
voltage 26.4 VDC
SPECIFICATIONS
Wiring and Internal Circuit Diagrams
3-wire
3-wire
3-wire
3-wire
Blue
Black
Blue
Black
Blue
Black
Blue
Black
C0
Brown
Brown
Brown
Brown
KV-N8EX
• 000 002
C0
• 005 007
Internal circuit
COM 004 006
F
• 005 007
IN
Brown
Brown
Brown
Brown
Circuit for
switching
Black
Black
Black
Black
Blue
Blue
Blue
Blue
between
5 V and 24 V
3-wire
3-wire
3-wire
3-wire
COM
Photo-coupler isolation
Input Sensors
power supply
* The COM terminals are internally shorted through a
fuse with a rating of 1.6 A. Carry out the wiring so
that an excessive current does not flow between the
upper and lower COM terminals.
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
Black
Blue
Black
Blue
Black
Blue
Black
Blue
Black
Blue
Black
Blue
Black
Blue
Black
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
• •
C0 •
Internal circuit
• 009 011 013 015 •
F
COM 008 010 012 014 •
IN
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Circuit for
switching
Black
Black
Black
Black
Black
Black
Black
Black
Blue
Blue
Blue
Blue
Blue
Blue
Blue
Blue
between
5 V and 24 V
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
COM
Photo-coupler isolation
Input Sensors
power supply
* The COM terminals are internally shorted through a
fuse with a rating of 1.6 A. Carry out the wiring so
that an excessive current does not flow between the
upper and lower COM terminals.
Outline Drawings
KV-N8EX
2
37
2-ø4.5
27.3
Expansion Input Unit (KV-N8EX and KV-N16EX)
35.9
90
82
3.8
45 17.2 83.7
KV-N16EX
57
2-ø4.5
27.3
35.9
90
82
3.8
65 17.2 83.7
SPECIFICATIONS
This section describes the names and functions of the parts of the KV-N8ER, KV-N16ER, KV-N8ET, and
KV-N16ET Expansion Output Units. It also provides the specifications of the units.
OUT OUT
(3) Output
indicators (1) POWER LED
OUT OUT
Specifications
Relay
(16 Points) (8 Points) (16 Points)
MOSFET (with overcurrent protection
function)*3,5
Expansion Output Unit (KV-N8ER/ET/ETP and KV-N16ER/ET/ETP)
External connection
Terminal block
method
Rated load 250 VAC/30 VDC, 2 A 30 VDC, 0.5 A
Leakage OFF current - 100 µA or less
0.8 VDC or less (with 0.5 A output)
Residual ON voltage -
0.6 VDC or less (with 0.3 A output)
ON resistance 50 m or less -
16 points/1
4 points/1 common 8 points/1 common
Common method Independent common
(8 terminals)*1 (4 terminals)*2
(8 terminals)*2*4
100 µs or less (with a load of 1 mA or
OFF ON
Response more)
10 ms or less
time 200 µs or less (with a load of 1 mA or
ON OFF
more)
Internal current
60 mA or less 100 mA or less 30 mA or less 40 mA or less
consumption
Weight 230 g 260 g 160 g 210 g
Electrical: 100,000 times or more
Relay life (20 times/min) -
Mechanical: 20,000,000 times or more
Relay replacement Impossible -
*1 The two C0, C1, C2, and C3 terminals of the KV-N16ER are shorted internally.
(C0, C1, C2, and C3 are independent.)
*2 The KV-N8ET(P) and KV-N16ET(P) COM terminals are shorted internally.
*3 If even a single overcurrent is detected, until the cause of the problem is removed, the protection
operation (output turning OFF) and automatic recovery occur repeatedly for all outputs within the
shared common*4.
*4 For KV-N16ET, the outputs within the shared common which are protected when overcurrents are
detected are outputs 000 to 007, or outputs 008 to 015.
*5 Sink output types use MOSFET (N-ch) output. Source output types use MOSFET (P-ch) output.
SPECIFICATIONS
Wiring and Internal Circuit Diagrams
KV-N8ER wiring diagram
P :
2
+
• C0 C1 C2 C3 • +
KV-N8ER
● ●
000 001 002 003
OUT
4 5 6 7
• C4 C5 C6 C7 •
● ●
C4 C5 C6 C7
P L P L P L P L
OUT
Load
C0
C1
C2
C3
C4
C5
C6
C7 Load power supply
C0 002 C0 C1 006 C1
KV-N16ER
000 001 003 004 005 007
OUT
8 9 10 11 12 13 14 15
C2 009 C2 C3 013 C3
C2 009 C2 C3 013 C3
P L L L L P L L L L
OUT
Load
C0
C1
C2
C3
2
C0 002 C0
*2
C0 002 C0
Expansion Output Unit (KV-N8ER/ET/ETP and KV-N16ER/ET/ETP)
OUT
000 001 003
KV-N8ET
*1
Isolated power
supply
Protection
circuit
C0
Output circuit
L
000 to 003
004 to 007
C0 002 C0 C0 006 C0
4 5 6 7
KV-N16ET
C0 and C1 terminals is
*1
internally shorted through a
Internal circuit
fuse with a rating of 5 A. Carry
F
OUT
08 10 11 12 14 15
OUT C1
C1 009 C1 C1 013 C1
008 010 011 012 014 015
flow between the C0 and C1
C1 009 C1 C1 013 C1
terminals.
*2 For KV-N16ETP
*2 *2
L L L L L L L L
SPECIFICATIONS
KV-N16ET internal circuit diagram
Isolated power
supply
Isolated protection
power supply 000 to 007
008 to 015
2
Internal circuit
Protection
C0
C1
Output circuit
L
000 to 007
008 to 015
Outline Drawings
KV-N8ET(P) KV-N8ER/KV-N16ER/KV-N16ET(P)
37 57
2-ø4.5 2-ø4.5
27.3
27.3
35.9
35.9
90
82
90
82
3.8
3.8
This section describes the names and functions of the parts of the KV-N8EXR and KV-N8EXT
Expansion I/O Units. It also provides the specifications of the units.
KV-N8EXT
(front panel) (Side panel)
(2) Input terminal block (5) Input voltage
selector switch
24V
(3) Input 4 5 6 7
5V
IN
indicators
KV-N16EXT
SPECIFICATIONS
Specifications
Common method
100 µs or less (with a load of 1 mA or
OFF ON
Runtime
more)
10 ms or less
200 µs or less (with a load of 1 mA or
ON OFF
more)
Electrical: 100,000 times or more
Relay life (20 times/min) -
Mechanical: 20,000,000 times or more
2
Sensors
C0 001 003 005 007 •
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
• 000 002 004 006 •
Blue
Black
Blue
Black
Blue
Black
Blue
Black
Blue
Black
Blue
Black
Blue
Black
Blue
Black
C0 01 03 05 07 •
IN
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
• 00 02 04 06 •
Expansion I/O Unit (KV-N8EXR and KV-N8EXT)
4 5 6 7
IN
KV-N16EXR
● 000 002 004 006 ●
OUT
8 9 10 11 12 13 14 15 Internal circuit
008 010 011 012 014 015
OUT C1 009 C1 C2 013 C2
P L L L L P L L L L
P : +
+
KV-N8EXR internal circuit diagram (input) KV-N8EXR internal circuit diagram (output)
000
001
002
000 to 007 4.3kΩ 003
004
Internal circuit
IN 005
Circuit for
switching 006
between 007
Internal circuit
5 V and 24 V OUT
C0
Load
Photo-coupler isolation
C0
Input C1
power supply
C2
C3
C4
C5
C6
C7 Load power supply
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
3-wire
Black
Blue
Black
Blue
Black
Blue
Black
Blue
Black
Blue
Black
Blue
Black
Blue
Black
C0 01 03 05 07 •
IN
Brown
Brown
Brown
Brown
Brown
Brown
Brown
Brown
• 00 02 04 06 •
4 5 6 7
IN
KV-N16EXT
● 000 002 004 006 ●
OUT
8 9 10 11 12 13 14 15
Internal circuit
008 010 011 012 014 015
OUT C1 009 C1 C1 013 C1
L L L L L L L L
KV-N8EXT internal circuit diagram (input) KV-N8EXT internal circuit diagram (output)
Isolated power
supply
000 to 007 4.3kΩ Isolated protection
Internal circuit
power supply
IN
Circuit for 008 to 015
Internal circuit
switching L
between
5 V and 24 V
COM0
Protection
Photo-coupler isolation circuit
Input C1
power supply
SPECIFICATIONS
Outline Drawings
KV-N8EXR/KV-N8EXT
57
2-ø4.5 2
27.3
65 17.2 83.7
This section describes the names and functions of the parts of the KV-N10L and KV-N11L Extension
Serial Communication Cassettes. It also provides the specifications of the cassettes.
For details, see the KV Nano Series "Serial Communication Function User's Manual."
KV-N10L KV-N11L
(3) Mounting
screw
SPECIFICATIONS
Specifications
General specifications
Usable Interface
Operation Mode KV-N10L KV-N11L
RS-232C RS-422A/485 (4-wire) RS-485 (2-wire)
KV mode (host link) Yes Yes No
KV mode (text transmission) Yes Yes Yes
KV STUDIO mode Yes Yes Yes
Non-procedure mode Yes Yes Yes
Modbus master mode Yes Yes Yes
Modbus slave mode Yes Yes Yes
Serial PLC Link mode No No Yes
Specification
Communication standard RS-232C
Interface
Connection D-sub 9-pin
1200, 2400, 4800, 9600, 19200, 38400, 57600,
Baud rate
115200 bps
Transmission method Full duplex
Start bit 1 bit
Data format Data bits 7 bits, 8 bits
Transmission
RS-232C Stop bits 1 bit, 2 bits
specifications
Error
Parity Even, odd, none
detection
RS/CS flow control Enabled, disabled
Transmission distance 15 m
Number of transmission units 1
Indication SD (orange), RD (orange)
KV-N11L
Specification
Communication standard RS-422A, RS-485 (4-wire), RS-485 (2-wire)
Interface European terminal block (cannot be removed
Connection
2 or reconnected)
1200, 2400, 4800, 9600, 19200, 38400, 57600,
Baud rate
115200 bps
Extension Serial Communication Cassette (KV-N10L and KV-N11L)
SPECIFICATIONS
Wiring and Internal Circuit Diagrams
KV-N10L
2
Pin
Signal Name Signal Direction
*1 When the product cannot receive data, this signal is set to low. It is normally set to high.
KV-N11L
220Ω
SDB(+)
Send data +
-
SDA(-)
220Ω
+ RDB(+)
Receive data
- RDA(-)
* SG is isolated from the internal
SG
GND of the base unit.
S/R(+)
Send data +
-
S/R(-)
220Ω
+
Receive data
- * SG is isolated from the internal
SG GND of the base unit.
Outline Drawings
KV-N10L
2 6.4 13.4
83.7
38.6
Extension Serial Communication Cassette (KV-N10L and KV-N11L)
48.6
(142)
KV-N11L
83.7
6.4 13.4
38.6
48.6
SPECIFICATIONS
This section describes the names and functions of the parts of the KV-N1AW Extension Access
Window Cassette. It also provides the specifications of the cassette.
Specifications
Item KV-N1AW
Operating environment As little dust and corrosive gases as possible
Operating ambient
0°C to 55°C
temperature
5%RH to 90%RH
(At 40°C or higher, use the product in an environment with an absolute
Operating ambient humidity
humidity that is less than or equal to the absolute humidity present at 40°C
with 90%RH.)
Storage ambient temperature -25°C to +75°C
35%RH to 85%RH (no condensation)
(At 40°C or higher, store the product in an environment with an absolute
Storage ambient humidity
humidity that is less than or equal to the absolute humidity present at 40°C
with 90%RH.)
Number of times that the
product can be connected and 200
disconnected
Memory save method Built-in flash ROM (can be rewritten 10,000 times)
Outline Drawings
83.7
2
4.5 13.5
38.6
Extension Access Window Cassette (KV-N1AW)
48.6
SPECIFICATIONS
This section describes the names and functions of the parts of the connecting transformer unit.
KV-N1 2
(front panel) (side panel)
(2)
Expansion unit
connection
connector
Outline Drawings
27.3
35.9
90
22.2
3.8
80.4
MEMO
2
Connecting transformer unit (KV-N1)
This section describes how to construct units and how to install units on DIN rails and similar objects.
• The KV-N24**, KV-N40**, and KV-N60** use backup capacitors to store clock
Point
data.
If you do not turn these products on for a long time, the clock data may be lost.
If you want to use the clock data, set it when you start the devices.
• You can use up to two expansion unit connection extension cables (but do not
use them connected to each other).
• If you connect two or more extension access window cassettes to a single base
unit, the base unit will not operate.
• You can connect only 1 each of the connecting transformer units KV-N1 and
KV-NC1.
• Connector type units can be used through the use of terminal block-connector
conversion unit KV-N1.
Constructing Units
As an example, this section describes how to construct the KV Nano Series Base Unit and the KV-
N16EX Expansion I/O Unit.
3
KV-N24DT KV-N16EX
Connecting Units
(left side) (right side)
Point Be sure to turn the units off before you construct them.
Connector (female)
Connector (male)
3
Expansion unit connection
Connecting Units
Reference Attach the expansion unit connection extension cable cover to a DIN rail.
KV-N24+KV-N1 KV-NC1EP
(left side) (right side)
Connecting Units
Point Be sure to turn the units off before you construct them.
3 Insert the right unit's lock lever into the lock lever
slot on the left unit.
• They can be easily connected by holding them
parallel and aligning the positions of the connectors.
Disconnecting Units
As an example, this section describes how to disconnect the KV Nano Series Base Unit and the KV-
N16EX Expansion I/O Unit.
3 Point Be sure to turn the units off before you construct them.
Connecting Units
1 Follow steps 1 and 2 of the procedure for when the units have been connected directly.
Connecting Units
the connector.
Attaching Cassettes
As an example, this section describes how to attach the KV-N1AW Extension Access Window Cassette
to the KV Nano Series Base Unit.
3
Connecting Units
KV-N24DT KV-N1AW
Point Be sure to turn the units off before you construct them.
• Ensure that the connector is perpendicular when you insert the cassette into the
Reference
socket. Inserting the cassette into the socket at an angle may damage the products.
Connecting Units
• If you are using the KV-N10L or KV-N11L, after you attach the cassette, tighten the
fixation screws to hold the cassette in place before you use the cassette.
• You will require the extension cassette socket cover to use the base unit after
removing the extension cassette. Therefore, be sure to store the extension cassette
socket cover in a safe place.
• When you want to use the base unit after removing the extension cassette, first attach
Reference
the extension cassette socket cover.
• For the extension serial communication cassette, first loosen the fixation screw, and
then remove the cassette.
NOTICE Be sure to turn the power off before you remove the cassette.
This section describes how to install connected units on and remove connected units from DIN rails.
Installing units
3 1 Hang the slot on the top of the DIN rail onto the DIN-rail
fasteners on the top of each unit.
Connecting Units
Top fastener
DIN rail
2 Insert the bottom part of the DIN rail into the DIN-rail
fasteners on the bottom of each unit.
• The lower black fasteners are attached to a spring. Press
down on these fasteners until you hear a click.
• In locations where it is difficult to install the units, first
release all locks, install the units on the DIN rail, and then
lock all the locks.
Fastener is Fastener is
properly locked not locked
Removing units
This section describes how to install connected units in and remove connected units from industrial
control panels.
Installing units
3
1 Use the screw holes on the upper-left and lower-right of
Connecting Units
each KV Nano Series unit to screw the units directly into the
panel surface.
Removing units
For the dimensions of the mounting holes, see each unit's outline drawings.
Reference
• Connector type expansion units cannot be installed directly onto the panel surface.
This section describes precautions regarding the installation environment of the units and describes the
panel mounting position.
Installation Environment
A location in which condensation forms A location with corrosive or A location with heavy dust, salt,
because of sudden temperature changes combustible gas iron powder, or soot
A location that is subject to A location that is subject to sprayed A location in which strong
direct vibration or shock liquids such as water, oil, and drugs magnetic and electric fields occur
Magnetic
Drugs Electric field
Oil field
Installation Position
Device orientation
When you install the KV Nano Series Base Unit in a panel, ensure that the front surface faces out.
30 mm
30 mm
Series units
3
Below
Unit Installation
Allow 30 mm of space so that
you can insert your finger to remove
30 mm the lock lever.
If the panel temperature (the temperature indicated on the lower, central part (30
Point
mm) of the unit) exceeds the ambient usage temperature, reduce the temperature
by using methods such as forced air cooling and improving ventilation by
increasing the space around the device.
This section describes how to assemble connectors, the wiring and internal circuits of each unit, and
how to wire each unit.
Wiring precautions for I/O units and expansion I/O units are given below. Be sure to read these
Input
RL
Output
Grounding precautions
• Ground each device separately using D-type grounding facilities. In addition, ensure that the
grounding resistance in this situation is 100 or less.
• If separate grounding is not possible, ground all the devices from a common point. However, in this
situation, all cables must be the same length.
• Use the FG terminals to ground the devices (do not ground the power supply terminals).
B
A B A
Wiring Precautions
Wiring sink-type output Wiring source-type output
External External
power supply power supply
Peripheral Peripheral
device device
In environments with a great deal of noise, you may be able to reduce the effect of noise
Reference
by implementing the following counter-measures.
• Using separate 24 V power supplies for the KV Nano Series and for I/O.
• Using twisted-pair cables consisting of signal lines (+24 V or 0 V) inputting to the input
side common for the open collector output signal.
• Passing the 24 V and 0 V used for I/O through a ferrite core.
KV Nano KV Nano
Service Service
power supply power supply
+24V +24V
0V 0V Peripheral
device
C0 C0
Peripheral
device
R000 R000
The service power supply is only available with the AC power supply type KV
Point
Nano Series. The DC power supply type does not have the service power supply.
Use the 24 V that is supplied to the power supply terminals.
Contact protection
When you are using clutches, motors, solenoids, or other inductive loads, an inrush current will flow
when power is applied to the load, and inverting voltage will be generated when the load is turned off.
Inrush current and inverting voltage are major factors in reducing the life of the contact. To reduce the
occurrences of these phenomena, provide a contact protection circuit.
Contact protection circuit example
Contact
Wiring Precautions
L L
a b
L L
Zener diode
Non-linear resistance
• Supply voltage 24 to 48 V To position b
100 to 200 V To position a
Attach the power supply so that it behaves in this manner.
• Use a load coil that has a rating that is less than or equal to the capacity of the contact.
• Use a diode that has a withstand voltage at least 10 times the circuit voltage and that has a forward
current that is greater than or equal to the load current.
• Attach the diode, non-linear resistance, and CR circuit directly to the relay coil terminal.
B
d2
Compatible dimensions
B : 6 mm or less
L
Y terminal part dimensions
L : 13 mm or less
B : Y-shaped part outer size
d1 : Diameter of power line outlet d2 : 3.2 mm or more
d2 : Y-shaped part inner width
(part that the screw grips)
L : Total length d1
Recommended products
Hold the screwdriver so that it is perpendicular with the terminal block screws when
Reference
wiring cables to the terminal block. Tightening the screws with the screwdriver held in
any orientation other than perpendicular with the terminal block screws may damage the
terminal block.
Wiring Precautions
specifications.
Item Description
Compatible cable size AWG22 to AWG20 (0.3 mm2 to 0.5 mm2)
Length of stripped cable 4 to 5 mm
Tightening torque 0.2 N・m
Recommended tool Blade: 0.42 × 2.5 mm
Cables
Cables used with the terminal block
(1) When using stranded wires or single wires as is
(a) Twist the tip of stranded wires so that there are no loose wires.
(b) Do not solder plate the tips of single wires.
4 to 5 mm
(2) When using rod terminals with insulating sleeves
Insulating sleeve
Depending on the thickness of the wire's sheath, it may be difficult to
insert the wire into the insulating sleeve. Therefore, use the outline Contact part
diagram as a reference when you select wires.
6 mm
2 to 2.5 mm
10.5 to 12 mm
Manufacturer Shape
AI0.34-6BU (AWG22)
Phoenix Contact GmbH & Co. KG
AI0.5-6BU (AWG20)
Point Be sure to turn the power off before removing the terminal block.
3
1
Wiring Precautions
• You can remove the terminal block from the KV-N24**, KV-N40**, and KV-N60**.
Point
• You cannot remove the terminal block from the KV-N14**.
• You also cannot remove the terminal block from the expansion I/O units and
expansion special units.
Precautions When Using the USB Port or Serial Communication Port to Communicate with a PC or Other Peripheral
For the DC power supply type KV Nano Series base units, 0 V of the power supply is electrically
connected to the SGs of the USB port and the serial communication port. A potential difference
between the product being connected to and the SGs will lead to damage to the base unit and to the
product being connected to. For example, if you positively ground (perform grounding on the 24 V side)
the products, a potential difference will occur, and current will flow along the path shown in the following 3
figure. This may cause damage to the products. Do not wire the products in the manner shown in the
Wiring Precautions
following figure.
+24V +24V
Serial communication port SG SG Serial communication port
FG
This section describes how to inspect and maintain the units as well as how to replace batteries and
relays.
3 Inspection
When the KV Nano Series Base Unit and other units are used for a long time, problems such as the
Maintenance
connecting section of the connectors becoming loose occur. Continued use of the devices in this state
may cause operating difficulties.
For this reason, periodically inspect the main unit, the wired parts, and other sections of the KV Nano
Series Base Unit and other units of the KV Nano Series.
The main items to inspect are listed below.
• Are the connecting sections of the connectors of each unit disconnected or loose?
• Are the connecting sections of the connectors disconnected or loose?
• Are the terminal block screws loose?
• Are the wiring cables between the unit and the other devices damaged?
Maintenance
Dirt adheres to the base unit and other units when they are used over a prolonged period of time.
Clean off any dirt from the units using a clean, dry cloth.
Dust and dirt on fine components such as connectors can be removed with a cotton swab or similar
item after first removing the connector.
About Maintenance
Battery
The KV Nano Series does not have a battery. Data such as ladder programs, device comments, and
setting information is recorded on flash ROM. Data such as CPU positioning parameters, device
values, and the error log is recorded on nonvolatile RAM.
However, backup capacitors are used to save the clock data, so this data may be cleared.
"How to Set Clock Data" (page 3-21)
Replacing relays
You cannot replace relays on the KV Nano Series.
Maintenance
Temperature TYP MIN
25°C 60 days 15 days
40°C 40 days 10 days
75°C 12 days 3 days
If necessary, use one of the following methods to set the clock data.
• While using KV STUDIO to perform monitoring, on the "Debug" menu, click "Setup calendar timer."
• Use the WTIME instruction in a ladder program.
• Use an extension access window cassette, and set the data using a clock.
• If you are using a touch panel (VT3 Series), use the PLC time and date synchronization function.
(If you are using the restoration function, the time will be adjusted automatically.)
"VT STUDIO Reference Manual"
If the clock data is cleared, the following functions may not operate correctly.
Reference
• Tracing function (the trace execution times will be incorrect)
• Error monitor function (the error occurrence times will be incorrect)
• Weekly contact instructions
3-4 Maintenance
Restoration Method
3 more.
"RUN-PROG Selector Switch and Error Clear Switch" (page 2-13)
Maintenance
• If you are using an extension access window cassette, use the error clear function on the cassette.
"Error Clear" (page 5-214)
• While using KV STUDIO to perform monitoring, you can clear the error from the dialog box that
appears when the error occurs.
• Use a ladder program to set the error clear request relay (CR3909). (This method can only be used
for minor errors).
• Restart the product.
For some serious errors that are related to the system, you may have to restart the
Reference
product.
The CPU function version can be updated by updating the system program on the KV Nano Series.
The update procedure is as follows.
1 The version can be confirmed through "Tools (T)"→"Check CPU function version (X)"→"System
program update (U)" on the KV STUDIO menu (* KV STUDIO version 7 or later is required).
3
Maintenance
2 The dialog box below is displayed. Confirm that the KV Nano Series and USB cable are
connected, and click "OK".
Point • System program updates can be carried out when connected via USB.
3 Check if the connected KV Nano Series is the latest version. If it is the latest version, click the
"OK" button to start a system version update.
3-4 Maintenance
• If the system program is already the latest version, the dialog box below is
Point
displayed and the program update finishes.
If this happens, the programs in the unit are not deleted.
3
Maintenance
LADDER PROGRAMMING
LADDER
PROGRAMMING
This chapter describes the specifications and setup methods of the functions
that you have to use when creating ladder programs. You can improve
programming efficiency by using modules, macros, and local devices.
conditions of the equipment and devices are recorded in control units in advance. When operations are
started, the target operations are executed in sequence according to the status and conditions of the
equipment and devices in order to assemble the vehicle. This is called sequence control.
PLCs (Programmable Logic Controllers) such as the KV Nano Series are used as the devices for
sequence control.
4
What Is Sequence Control?
Reference • In JIS (Japan Industrial Standards), sequence control is defined as "control for
successively advancing each step of a control procedure according to a predetermined
order or an order determined according to a fixed logic."
• In PLC control, in addition to sequence control, feedback control is also available.
Feedback control is the process of detecting the current value of the object and
comparing this with the target value and then repeatedly performing control until the
values match.
(Examples) Temperature control, pressure control, and speed control
LADDER PROGRAMMING
Let's take a close look at a fully automatic washing machine as an example of sequence control.
When you press the start button, the fully automatic washing machine follows the predetermined order
to automatically carry out the washing sequence. The washing sequence control is shown below.
ON
(1) Insert the clothes to be washed, and
Start press the start button.
Basic sequence control is divided into three main groups: sequence control, condition control, and time
limit control. Target control circuits are designed by combining these types of control.
Sequence control
In sequence control, the next operation in a predetermined sequence starts when an external signal,
4 such as from a detector, indicates that the previous operation has finished.
Sequence control of the fully automatic washing machine
(2) Water intake I Water intake finishes (3) Washing (washing motor starts)
What Is Sequence Control?
(4) Drainage I Drainage finishes (5) Spin drying I (spin dry motor starts)
Reference Typical ladder program instructions used in sequence control include STG and JMP.
Condition control
In condition control, operations are performed when, in combination with the status signals of the object
being controlled, predetermined conditions are met.
Condition control of the fully automatic washing machine
(3) Washing The washing machine door is opened. Pause The washing machine door is
closed. (3) Washing
(5) Spin drying I The washing machine door is opened. Pause The washing machine door is
closed. (5) Spin drying I
Reference Typical ladder program instructions used in condition control include STP, STE, CJ, NCJ,
and LABEL.
Reference Typical ladder program instructions used in time limit control include TMR and LDWK.
LADDER PROGRAMMING
"Mnemonics" are used as the language for operating the programs that you have created on the KV
Nano Series. Also, the separation of 16-bit and 32-bit values and signed and unsigned values is
determined not by the instructions, but by the suffixes used.
Ladder Program
Ladder circuits are schematics of actual wiring diagrams. The ladder circuits that you write in KV
STUDIO are called ladder programs.
In KV STUDIO, in addition to the instructions for general switches and lamps that are available, you
4
Programming Language
have access to instructions such as useful ones for controlling ON time and OFF time and for PID
control. You can easily write sequence control programs by combining these instructions.
R000
T1
T1 R001 R500
T1 R002
T2
T2 R003 R501
In addition, you can use expanded ladder mode with KV STUDIO to reduce the number of ladder rungs
and make processing sequences clearer, both of which improve the readability of your programs.
"Expanded ladder mode" (page 4-159)
KV Script
Although ladder programs are suitable for sequence control programs, using ladder programs for
complicated calculation processing that handles values and processing that handles character strings leads
to complicated programs, which makes debugging and maintenance difficult.
KV script is a programming language that has been developed to compensate for these ladder program
problems. By using scripts as substitutes for the parts of a program that become too complicated when
written as a ladder program, you can create programs efficiently.
4
The script can be mixed together with a
Programming Language
You can write control sentences, so it You can write mathematical formulae
is easy to understand the flow of the without having to consider the calculation
program. processing and internal registers.
Reference Script programs are converted into ladder programs before they are executed.
You can monitor the operations of script programs after they have been converted into
ladder programs.
LADDER PROGRAMMING
Mnemonics
Mnemonics are the language that is used to make the ladder programs that you have created operate
on the KV Nano Series.
By simplifying mnemonics, expanded ladder programs are expressed in a manner that is easy to
understand visually.
Expanded ladder programs are converted to mnemonics lists when they are transmitted to the KV Nano
Series.
You can edit the mnemonics list in KV STUDIO, but this is not required when you create normal ladder 4
programs.
Programming Language
LD R000
OUT R500
LD R002
OUT R501
LD R003
OUT R502
Reference • To edit the mnemonics list, on the "Edit" menu, click "Edit list."
Alternative procedure Ctrl + D
• Mnemonics lists are included in this manual for CPU built-in functions and instruction
sample programs. You can use these mnemonics lists to easily enter sample programs.
"How to Use Mnemonic Lists" (page 16)
• When you create expanded ladder programs, you can reduce the production costs of
programming by entering instructions as mnemonics.
"Mnemonic entry" (page 4-142)
Suffixes
Suffixes are appended after an instruction. You can use them to change the way that device data is
handled. There are the following six types of suffixes.
Example
ADD(.U) MOV.(U)
Programming Language
ADD.S MOV.S
ADD.D MOV.D
ADD.L MOV.L
ADD.F MOV.F
ADD.DF MOV.DF
In KV STUDIO, .U is not displayed. Also, instructions that do not have a suffix are processed as 16-
bit, unsigned BIN data.
Instructions to which suffixes are applied are executed with BIN data treated as decimal values
according to the suffix.
Therefore, if the suffix is different, the results of executing an instruction may differ even if the BIN data
is the same.
LADDER PROGRAMMING
Project Configuration
Projects
Program
Unit settings
Device comments
Modules
Labels
Point You can use one project to manage the information of only one KV Nano Series.
Program
A program is constructed from modules and macros.
By repeatedly executing this program, you can perform various types of control.
"4-6 Program Structure and Operation" (page 4-61)
"4-8 Modules" (page 4-100)
"4-9 Macros" (page 4-112)
Unit settings
Use this to manage the unit configuration and the detailed settings of each unit. You can use KV
STUDIO to easily configure the settings.
See the "User's Manuals" of each expansion unit.
"Chapter 3 UNIT EDITOR" in the "KV STUDIO User's Manual"
Device comment
LADDER PROGRAMMING
By assigning a comment to each device, you can make it easier to see what functions are assigned to
each device.
"Device comments" (page 4-154)
Label
By managing the devices that correspond to the labels that have the names you have assigned, you
can write programs using the labels instead of the device names.
Set the following items, which are related to the system of the KV Nano Series.
Classification Item Description Reference Page
"Module Execution
Execute sequence of Set the execution sequence of the
Sequence" (page 4-
modules modules within the scan.
105)
"Scan Time"
(page 4-68)
User interrupt Set the priority order of interrupts.
Program setting "Interrupt Priority"
(page 4-81)
Set the fixed scantime operation and "Scan Time"
Scantime related
the END processing time (page 4-68)
"Project Protection
Protection setting Set the project's read/write protection.
Settings" (page 4-13)
Assign all local devices and configure "Local Device
Entire assignment
the settings of each module and Assignment" (page 4-
setting of local devices
macro. 136)
CPU unit buffer Set the buffer capacity of the tracing "Trace detail setting"
capacity function. (page 5-183)
LADDER PROGRAMMING
Program Capacity
Projects
Number of module objects 100
Number of steps 8 k steps 16 k steps
Bits 14,400 bits
Internal work consumption
Words 3,200 words
Maximum global device comment and
800 kB
local device comment size
Maximum total size of unit setting data,
extension function setting data, and 350 kB
recorded data
The percentage of the program capacity that is used is calculated automatically by KV STUDIO when
you convert the program and is displayed in the "Convert result" dialog box, so you do not have to
perform the calculations and manage this information by yourself.
If the number of steps, program capacity, object size, operand table size, or
Point
internal work consumption exceeds the maximum capacity, you will not be able to
transmit the program or perform operations.
approximately 10000 comments with the KV-N14** and approximately 20000 comments with
LADDER PROGRAMMING
the KV-N24**, KV-N40**, and KV-N60**. If you want to use labels to fill the remaining program
capacity, you can manage approximately 14000 labels with the KV-N14** and approximately
28000 labels with the KV-N24**, KV-N40**, and KV-N60**.
For details on the byte size of the instructions, see "Appendix 2 List of Instruction
Sizes" in the KV-7000/5000/3000/1000 Series and KV Nano Series "Instruction
Reference Manuals."
<Object size>
Object size is the total size in data (object) format when the KV Nano Series is actually
operating. The object size also is determined by the instructions and varies depending on
4 the types of operands, the instruction suffixes, and the presence of index modification.
Rung comments, device comments, and labels are not included in the object size
Projects
calculation.
For details on the object size of the instructions, see "Appendix 2 List of Instruction
Sizes" in the KV-7000/5000/3000/1000 Series and KV Nano Series "Instruction
Reference Manuals."
<Total steps>
The total number of steps is the total number of instructions and rung comments used in
the project.
The number of steps used is displayed on the left side of the ladder diagram after the
program is converted by KV STUDIO.
000610
000610
000610
The number of steps used in the module or macro is indicated
below each rung number.
000633
000638
000643
LADDER PROGRAMMING
Project Protection Settings
Item Description
The ladder programs stored on the base unit will be write protected (a 4
confirmation dialog box will be displayed when an attempt is made to
Write protection
Projects
write to these programs). You can use this to prevent the programs
from being overwritten by mistake.
The ladder programs stored on the base unit will be read protected (it
Read protection will not be possible to read the programs). You can use this to prevent
your valuable programs from being leaked.
When you read the ladder programs stored on the base unit, a dialog
box will be displayed asking you to enter the password.
Project password * When you have set read protection, the password entry dialog box
will not be displayed, and you will not be able to read the ladder
programs.
When you are editing a project, if you attempt to display the module or
Module and macro passwords
macro, a dialog box will be displayed asking you to enter the password.
Transfer to PLC
KV-N1AW
4
displayed.
• Writing projects to the base unit
You can set write protection so that a confirmation dialog box is displayed when an attempt is made
Projects
Reference When you have set a project password, if the password authentication fails, you will have
to wait a set amount of time until you can read the project again. Also, the wait time gets
longer each time that the authentication fails. The project password authentication
disabled status relay (CR2314) turns ON when you can no longer perform read
authentication due to repeated password authentication failures.
The number of consecutive password authentication failures and the total number of
password authentication failures are stored in CM1658, the number of consecutive
project password authentication failures, and CM1659, the total number of project
password authentication failures.
Using the extension access window cassette (KV-N1AW) to load and save
projects
• Loading
When you have set write protection, confirmation is performed before a project is loaded.
ロード Load
ライトプロテクト Protected
ロード OK? Load OK?
KVS PROJECT KVS PROJECT
• Saving
If you set the read protection and a project password, you will be able to save projects, but you will
only be able to read device values, not ladder programs.
Reference If you want to save programs on which you have set read protection and a project
password to an extension access window cassette, select the "Clear module/macro in
PLC" check box in KV STUDIO, perform a PLC transfer from KV STUDIO, and then save
the program from the extension window within 60 seconds.
Project passwords
LADDER PROGRAMMING
You can set passwords on projects to place restrictions on what can be read from the KV Nano Series.
Follow the procedure below to set a password.
1 Click "Workspace."
Projects
3 Click "Set password."
The "Setup password" dialog box is displayed.
4 Enter the password in both text boxes (the second is for confirmation), and then click "OK."
After you set the password, when an attempt is made to read this project from the KV Nano Series, a
dialog box will be displayed asking the user to enter the password.
The user has to enter the password to read the project from the KV Nano Series.
Also, when you transfer a project that has a different password to the PLC, to protect the projects on the
PLC, you have to enter the password, or transfer all items.
You can set protection on projects to place restrictions on writing to and reading from the KV Nano
Series.
To configure protection settings, in the workspace, click "CPU System Setting" and then "Protection
Setting."
4
Projects
Select the checkboxes, and then transfer programs to the KV Nano Series to enable the protection
settings.
If you transfer programs to the KV Nano Series when you have set read
Point
protection, you will not be able to monitor the execution status of the ladder
program from that point.
After you finish debugging, set read protection, and then transfer programs to the
PLC.
If you are using a password and read protection at the same time, the password
confirmation dialog box will not be displayed, and you will not be able to read
projects.
Reference For details on module and macro passwords, see "Module Passwords" (page 4-109)
and "Macro Passwords" (page 4-125).
LADDER PROGRAMMING
entries of the KV Nano Series. Devices are written behind instructions, and devices are used to provide
the data used by the instruction and to store the results of the instruction's execution.
Lists of Devices
Bit devices
Device
Name
Range*1
Number of
Points
Main
Function
Start of Operation Local Index
Device Modification
Indirect
Specification (*)*2 4
PROG (@)*1 (:Z/:#) Reference Storage
Power On
RUN
*1 Because this is used as a local device, the applicable range of global devices is limited by the number
of reserved local devices. "List of Local Devices" (page 4-135)
*2 The devices that have "Yes" in the Storage column can be written as "* (device)." The devices that
have "Yes" in the Reference column can be specified indirectly.
"Indirect Specification" (page 4-43)
*3 To perform direct processing, write "DR."
*4 The range of devices that can be used varies according to the unit.
KV-N14**: R000 to R007. KV-N24**: R000 to R013.
KV-N40**: R000 to R107. KV-N60**: R000 to R203.
*5 You can use the Unit Editor to set R1000 to R59915 to expansion I/O relays.
The unassigned input and output relays that have numbers smaller than R1000 are reserved for the
system, so you cannot use these relays.
*6 The range of devices that can be used varies according to the unit.
KV-N14**: R500 to R505. KV-N24**: R500 to R509.
KV-N40**: R500 to R515. KV-N60**: R500 to R607.
*7 You can change the clear/hold setting by using "Power off holding" in the CPU system settings (this
only applies to contacts and current values).
*8 Use hexadecimal numbers to specify the device numbers.
*9 The range of devices that can be used varies according to the unit.
KV-N14**: CTC0 to CTC3 (4). KV-N24**: CTC0 to CTC3 (4).
KV-N40**: CTC0 to CTC5 (6). KV-N60**: CTC0 to CTC7 (8).
- KV Nano Series(terminal block type) User’s Manual - 4-17
4-4 Devices and Constants
Word devices
LADDER PROGRAMMING
Indirect
Number Start of Operation Local Index
Device *
Specification (*)*2
Range 1 of Main Function Device Modification
Name PROG
Points Power On (@)*1 (:Z/:#) Reference Storage
RUN
Clear and
Data Memory DM0 to DM32767 32768 Hold Yes Yes Yes Yes
Devices that can store hold*3
numerical data (16 bit) Clear and
Link register W0 to W3FFF*5 16384 Hold No Yes Yes Yes
hold*3
Temporary Devices that can store
TM0 to TM511 512 Clear Clear Yes Yes Yes Yes
4
memory numerical data (16 bit)
Among T0 to Among T0 to
Current value and set
T9, only holds T9, only holds
Timer value of the 10 µs, 1 ms,
the devices the devices
Devices and Constants
(current value T0 to T511 512 10 ms, and 100 ms down Yes Yes Yes No
that are being that are being
and set value) timers and of the 10 ms
used by the used by the
up/down timer (32 bit)
UDT instruction UDT instruction
Current value and set
Counter
value of the down counter Clear and Clear and
(current value C0 to C255 256 Yes Yes Yes No
and up/down counter hold*4 hold*4
and set value)
(32 bit)
High-speed Current value of the
CTH0 to
counter 4*6 high-speed counter Hold Hold No No No No
CTH3*6
(current value) (32 bit)
High-speed
Set value of the
counter CTC0 to
8*6 high-speed counter Hold Hold No No No No
comparator CTC7*6
(32 bit)
(set value)
Devices that are used with
Index register Z1 to Z12*7 12 Clear Clear No No No No
index modification (32 bit)
Devices used to control
the PLC functions and to
Control memory CM0 to CM8999 9000 Hold*8 Hold*8 No Yes Yes No
capture the PLC status
(16 bit)
*1 Because this is used as a local device, the applicable range of global devices is limited by the number
of reserved local devices.
"List of Local Devices" (page 4-135)
*2 The devices that have "Yes" in the Storage column can be written as "* (device)." The devices that
have "Yes" in the Reference column can be specified indirectly.
"Indirect Specification" (page 4-43)
*3 You can change the clear/hold setting by using "Power off holding" in the CPU system settings. Up to
3072 words worth of data can be held in total over all of the devices whose values can be held when
the power turns off.
*4 You can change the clear/hold setting by using "Power off holding" in the CPU system settings (this
only applies to contacts and current values).
*5 Use hexadecimal numbers to specify the device numbers.
*6 The range of devices that can be used varies according to the unit.
KV-N14**: CTH0 and CTH1 (2), CTC0 to CTC3 (4).
KV-N24**: CTH0 and CTH1 (2), CTC0 to CTC3 (4).
KV-N40**: CTH0 to CTH2 (3), CTC0 to CTC5 (6).
KV-N60**: CTH0 to CTH3 (4), CTC0 to CTC7 (8).
*7 Z11 and Z12 are reserved for the system, so you cannot use these devices.
*8 Only for devices that need to be held. For details on the target devices, see "Lists of CR and CM
Devices" (page A-8).
LADDER PROGRAMMING
according to index constants)
• Modification according to index registers
After the device (R (DR), MR, LR, B, T, C, D, M, W, TM, CM, *DM, *W, or *TM), append ":Zn" (where "n"
is a number from 1 to 10).
Example
DM0:Z01 If the value of Z1 is 100, this means DM100.
R1000:Z01 If the value of Z1 is 100, this means R1604.
4
• Modification according to index constants
Example
DM0:#1 This means DM1.
R1000:#1 This means R1001.
Example
*DM0*TM100
"Indirect Specification" (page 4-43)
Example
@DM0 @R10000
XYM marking
You can use the following XYM marking to specify devices (R (DR), MR, LR, and DM).
To switch to XYM marking, in KV STUDIO, on the "Tools" menu, click "Options," "Display mode setting,"
and then "XYM marking."
KV-N14**
High-Speed Usage
Device Number Normal Usage
Interrupt High-Speed Counter Positioning
4 R002
Interrupt input INT
R002
High-speed counter 0,
Z-phase
Axis 1, Z-phase
High-speed counter 0,
R005 - -
B-phase
High-speed counter 1,
R006 - -
A-phase
High-speed counter 1,
R007 - -
B-phase
High-speed counter 0,
R500 - comparator matching Axis 1, CW
output
High-speed counter 1,
R501 - comparator matching Axis 1, CCW
output
Output relay (direct
R502 output possible area) - - Axis 2, CW
Axis 1, deviation
R504 - -
counter clear
Axis 2, deviation
R505 - -
counter clear
KV-N24**
LADDER PROGRAMMING
High-Speed Usage
Device Number Normal Usage
Interrupt High-Speed Counter Positioning
Interrupt input INT
R000 -
R000
R003
Interrupt input INT
R003
-
4
High-speed counter 0,
R004 - -
High-speed counter 0,
R005 - -
B-phase
High-speed counter 0,
R008 - -
enable input
High-speed counter 1,
R009 - -
enable input
High-speed counter 0,
R010 - Axis 1, Z-phase
Z-phase
High-speed counter 1,
R011 - Axis 2, Z-phase
Z-phase
R012 - - -
R013 - - -
High-speed counter 0,
R500 - comparator matching Axis 1, CW
output
High-speed counter 1,
R501 - comparator matching Axis 1, CCW
output
R502 - - Axis 2, CW
Axis 2, deviation
R505 - -
counter clear
R506 - - -
R507 - - -
R508 - - -
R509 - - -
KV-N40**
LADDER PROGRAMMING
High-Speed Usage
Device Number Normal Usage
Interrupt High-Speed Counter Positioning
R000 Interrupt input INT R000 -
R001 Interrupt input INT R001 - Axis 1/axis 2, stop
sensor input and
R002 Interrupt input INT R002 - origin sensor input
R003 Interrupt input INT R003 -
R004 - - Axis 3, stop sensor input
R005 - - and origin sensor input
R006 - - -
4 R007
R008
-
-
-
High-speed counter 0, A-phase
-
-
Devices and Constants
KV-N60** (1/2)
LADDER PROGRAMMING
High-Speed Usage
Device Number Normal Usage
Interrupt High-Speed Counter Positioning
Interrupt input INT
R000 -
R000
Interrupt input INT
R001 - Axis 1/axis 2, stop
R001
sensor input and origin
Interrupt input INT
R002 - sensor input
R002
Interrupt input INT
R003 -
4
R003
R004 - -
Axis 3/axis 4, stop
R005 - -
sensor input and origin
KV-N60** (2/2)
LADDER PROGRAMMING
High-Speed Usage
Device Number Normal Usage
Interrupt High-Speed Counter Positioning
R500 - High-speed counter 0, Axis 1, CW
comparator matching
output
R504 - - Axis 3, CW
R506 - - Axis 4, CW
R508 - - Axis 1,
deviation counter clear
R509 - - Axis 2,
Output relay (direct deviation counter clear
output possible area)
R510 - - Axis 3,
deviation counter clear
R511 - - Axis 4,
deviation counter clear
R512 - - -
R513 - - -
R514 - - -
R515 - - -
R600 - - -
R601 - - -
R602 - - -
R603 - - -
R604 - - -
R605 - - -
R606 - - -
R607 - - -
LADDER PROGRAMMING
The macro argument devices, which can only be used in macros, are listed below.
Indirect Local Index
Attribute Symbol Range Description Specification Device Modification
(*) (@) (:)
The device is received as the
Device P P0 to P9 No No Yes
argument.
The device's value or constant
Value V V0 to V9 No No No
is received as the argument.
Leading
R
UR
The leading relay (R) assigned
UR0 to UR9 to the expansion unit is received No No Yes 4
as the argument.
Constants
Constant Range Main Function
Used to specify decimal constants.
#0 to #65535 (unsigned 16 bit)
When you select
-32768 to +32767 (signed 16 bit) Reference
Decimal (#) XYM marking mode,
#0 to #4294967295 (unsigned 32 bit)
this is displayed as
-2147483648 to +2147483647 (signed 32 bit)
"K."
-3.4E + 38 ≤ N ≤ -1.2E - 38
Single precision
N=0 Used to specify single precision
floating-point real
+1.2E - 38 ≤ N ≤ +3.4E + 38 floating-point constants.
number
(Approximately 7 significant digits)
-1.79E + 308 ≤ N ≤ -2.23E - 308
Double precision
N=0 Used to specify double precision
floating-point real
2.23E - 308 ≤ N ≤ 1.79E + 308 floating-point constants.
number
(Approximately 16 significant digits)
Used to specify hexadecimal
constants.
$0000 to $FFFF (16 bit) When you select
Hexadecimal ($) Reference
$00000000 to $FFFFFFFF (32 bit) XYM marking mode,
this is displayed as
"H."
Fixed character Used to specify fixed character
Examples) "Model number ABC", "Month/08:30:15"
string (" ") strings.
Internal registers
Start of
Operation
Number of
Device Name Range Main Function (Power On,
Points
PROG
RUN)
A device used to temporarily store data
Internal register - 1 Clear
(16 bit, 32 bit, 64 bit)
The power failure holding function uses the nonvolatile RAM to hold the device values even when a
power failure occurs. The KV Nano Series can hold the values of up to 3072 words worth of devices.
To configure the settings, in the KV STUDIO workspace, open the "CPU system setting" dialog box,
and then click "System setting" and then "Power off holding."
Set the type and range of the device
that you want to hold.
*1 Only some of the devices are saved, the others are cleared. Built-in positioning and the area used in
configuring the KV-D30 can be held according to the CPU system settings.
*2 Only some of the devices are cleared, the others are saved.
4-26 - KV Nano Series(terminal block type) User’s Manual -
4-4 Devices and Constants
LADDER PROGRAMMING
Bit Devices
I/O relay R
Overview The input relays are the devices that are used to capture the ON/OFF information from
the peripherals and to transfer this information to the PLC.
The output relays are the devices that are used to transfer the ON/OFF instructions and
the calculation results from the PLC to the PLC peripherals.
R01012
Device name Device number (01000 to 59915)
Reference • "R" can be omitted when you write the device. (However, you cannot omit "R" for
operands in which you can enter a constant.)
• You can use zero suppression when you write your programs
(Example) R12
• This can be used as a word device.
"Processing bit devices in units of words" (page 4-47)
• If you include "D" in the device name, the relay will operate as a direct I/O relay.
(Example) DR500R500 will operate as a direct output relay.
"Direct I/O relay (DR)" (page 4-62)
• When you select XYM display mode, input relays are displayed as "X" and output
relays are displayed as "Y."
"XYM marking" (page 4-19)
Details • One bit of the input relay is assigned per one input terminal.
• One bit of the output relay is assigned per one output terminal.
• You can specify a contact (normally open) or b contact (normally closed).
• Do not use R204 to R415 because these are reserved for the system.
• Do not use R608 to R915 because these are reserved for the system.
- KV Nano Series(terminal block type) User’s Manual - 4-27
4-4 Devices and Constants
Default setting When the power is turned on and when the mode switches from PROG to RUN, the
LADDER PROGRAMMING
4
You can use zero
R05_00010 suppression when you
write your programs.
Channel number Contact number (Example) R5_10
Devices and Constants
Unit number: Starting with the base unit, numbers are assigned in the order
(00, 01, 02, 03, 04, and so on) that the units are connected.
Unit relay number: Starting from 00000, the number of relay points that will be
occupied are assigned as the relay number.
KV-N16EX,
KV-N24DT KV-N16EX, KV-N16EX,
16 inputs and
base unit 16 inputs 16 outputs
16 outputs
Unit relay number: (Input) R000 to R107 R1000 to R1015 R2500 to R2515 R3000 to R3015
Link relay B
Overview These relays are used to perform data linking in serial PLC link mode. Hexadecimal
notation is used to specify device numbers, which is different from other relays.
B1A6F
Device name Device number (0000 to 1FFF)
Reference • You can use zero suppression when you write your programs.
(Example) B7A
• This can be used as a word device.
"Processing bit devices in units of words" (page 4-47)
LADDER PROGRAMMING
• Use hexadecimal numbers (0 to F) to specify device numbers.
Point
• You cannot use local devices (@).
Application These relays can be used to perform data linking in serial PLC link mode.
Default setting When the power is turned on and when the mode switches from PROG to RUN, the
4
R
Overview You can use R devices that are not assigned to an actual I/O relay or to an expansion unit relay
as internal auxiliary relays.
R01012
Device name Device number (01000 to 59915)
Range R1000 to R59915 (excluding the numbers that are assigned as expansion input unit
numbers)
Default When the power is turned on and when the mode switches from PROG to RUN, the
status is cleared and the devices are turned OFF.
B
Overview You can use B devices that are not assigned to the link relays of simple PLC links as internal
auxiliary relays.
B1EE7
Device name Device number (0000 to 1FFF)
- KV Nano Series(terminal block type) User’s Manual - 4-29
4-4 Devices and Constants
LADDER PROGRAMMING
Reference • You can use zero suppression when you write your programs.
(Example) B7A
• This can be used as a word device.
"Processing bit devices in units of words" (page 4-47)
Default setting When the power is turned on and when the mode switches from PROG to RUN, the
status is cleared and the devices are turned OFF.
MR
Overview These devices can only be used with CPU internal functions.
MR02809
Device name Device number (00000 to 59915)
Default setting When the power is turned on and when the mode switches from PROG to RUN or from
RUN to PROG, the status is cleared and the devices are turned OFF.
LR (Latch relay)
Overview These devices can only be used with CPU internal functions. These devices are used to
hold the status of devices.
LR02308
Device name Device number (00000 to 19915)
LADDER PROGRAMMING
Details These cannot be assigned as unit devices of expansion units.
Overview Timers have a contact (1 bit), a set value (32 bits), and a current value (32 bits). These
devices function as follows: when the current value of a count-down timer is 0 (time is up)
or when the current value of a count-up or count-down timer matches the set value or 0,
the contact turns ON.
T0501
Device name
Overview The contact, current value, and set value are determined by the operands of the
instruction used.
Details There are five types of timers: the 1 ms timer, the 10 ms timer, the 100 ms timer, the 10 µs
timer, and the up/down timer.
Default setting When the power is turned on and when the mode switches from PROG to RUN, the
status is cleared and the devices are turned OFF.
When the power is turned on and when the mode switches from PROG to RUN, the
current value is set to the same value as the set value. (Among T0 to T9, only the current
values of up/down timers are held.)
The set value is held.
Reference You can use zero suppression when you write your programs.
(Example) T501
To program timer operations, specify in the timer instruction operands the timer number and settings
(the length of time until time is up) of the timer that you want to use.
(Example)
Contact number (000 to 511) Set value (0 to 4294967295)
Timer error
Timer error is shown below:
• TMR (100 ms timer): Within + (±100 ms + 1 scan time)
• TMH (10 ms timer): Within + (±10 ms + 1 scan time)
• TMS (1 ms timer): Within + (±1 ms + 1 scan time)
• TMU (10 µs timer): Within + (±10 µs + 1 scan time)
• UDT (up/down timer): Within + (±10 ms + 1 scan time)
(Example) Programming a timer instruction with a set value of 20 seconds between the SBN and RET
LADDER PROGRAMMING
instructions
8 seconds 20 seconds
ON
Execution
4
condition OFF
Timer
(set value: Current Seconds 20 ・18・16・14・ 12 0
ON
Contact
OFF
The timer's current value is not updated. When the timer restarts,
its contact is turned ON.
Reference • Note that the ONDL, OFDL, SHOT, and FLIK instructions also operate as explained
above.
If you use a timer instruction in a module or macro, when the execution of the module or macro is
stopped, the timer instruction is reset by the OFF processing, so the above phenomenon does not
occur.
"Standby module operation" (page 4-104)
"Macro Type" (page 4-115)
* When the power is turned on and when the mode switches from RUN to PROG, the set value that you
changed with the STA instruction is cleared and returned to its original value.
If a device is used to specify the set value of the timer instruction, the set value of the timer is updated
each scan to the value of the specified device.
When you change the value, if the current value is greater than the set value, the
Point
current value will be updated to match the set value.
Counter (contact) C
LADDER PROGRAMMING
Overview Counters have a contact (1 bit), a set value (32 bits), and a current value (32 bits).
These devices function as follows: when the counter's current value is the same as the
set value (counting is finished) the contact is turned ON.
4 C001
Device name
Devices and Constants
The contact, current value, and set value are determined by the operands of the
instruction used.
Details There are three types of counters: the counter, the output counter, and the up/down
counter.
Default setting With the default settings, the contact status, current value, and set value are all held.
By clicking "Power off holding" in the CPU system settings, you can configure the settings
so that the contact status, current value, and set value are cleared when the power is
turned on and when the mode switches from PROG to RUN.
Reference • You can use zero suppression when you write your programs.
(Example) C15
• You can use a device with the same number with both a timer and counter.
For details, see "Timer and Counter Instructions" in the KV-7000/5000/3000/1000 Series and KV Nano Series
"Instruction Reference Manuals."
LADDER PROGRAMMING
Counting is performed only when both the counter input ON time and OFF time are longer than the
scanning time.
The formulae are shown below. If a counting speed greater than that shown below is necessary, use a
high-speed counter or the interrupt function.
Duty cycle (%) 1
Maximum counting speed = X (Unit: times/second)
100 Scan time (sec)
* The ratio of the time that the signal is ON or the time
that the signal is OFF to the total time is called
the duty cycle.
4
T1 T2
T1
T2
T1 > T2: Duty cycle = X 100 (Unit: %)
T1+T2
* If a device is used to specify the set value of the counter instruction, the set value of the counter is updated
each scan to the value of the specified device.
When you change the value, if the current value is greater than the set value, the
Point
current value will be updated to match the set value.
Overview These devices function as follows: when the current value of the high-speed counter
matches the set value, the contact is turned ON.
Point If CTC is being used as an interrupt condition, CTC (the contact) is not turned ON.
Details CTC can also be used as an interrupt condition to execute an interrupt program.
Default setting With the default settings, the contact status and set value are both held.
Overview These are special internal auxiliary relays that are used to control the PLC functions and
to capture the PLC status.
4
Word Devices
Devices and Constants
Data memory DM
Overview A data memory entry is a device that is used to save the reference data during function
operations and to store the results of calculations. Each entry has 16 bits.
DM06143
Reference • You can omit "M" when writing "DM."
• You can use zero suppression when you write your programs.
(Example) DM6143
• You can use this as a bit device.
(Example) DM1100 ...............The lowest bit of DM1100 is processed.
• You can use this as a bit device by specifying the bit position.
(Example) DM1200.12 ..........The 13th bit of DM1200 is processed.
"Bit device processing of word devices" (page 4-48)
• When you select XYM marking mode, this is displayed as "D."
"XYM marking" (page 4-19)
Details • You can only assign data memory (DM) entries to the unit devices of expansion units.
• The bit width of one device is 16 bits. When the device is being used as an unsigned,
decimal value, it takes on a value in the range of 0 to 65535. When the device is being
used as a signed, decimal value, it takes on a value in the range of -32768 to +32767.
When the device is being used as a hexadecimal value, it takes on a value in the range
of $0 to $FFFF.
DM1
bit bit bit bit
15 8 7 0
16 bits
• You can also use two devices to process 32-bit data. For 32-bit data, the lower 16 bits
LADDER PROGRAMMING
will be stored in the data memory entry of the specified device number and the upper
16 bits will be stored in the data memory entry of the next device number. When the
devices are being used as an unsigned, decimal value, they take on a value in the
range of 0 to 4294967295. When the devices are being used as a signed, decimal
value, they take on a value in the range of -2147483648 to +2147483647. When the
devices are being used as a hexadecimal value, they take on a value in the range of $0
to $FFFFFFFF.
4
DM1 DM0
bit bit bit bit bit bit bit bit
31 24 23 16 15 8 7 0
32 bits
• When you are using data memory to specify the operands of an instruction that handles
32-bit data, specify only the number of the device in which the lower 16 bits are stored.
Default setting With the default settings, the values of DM00000 to DM01999 are held.
You can change the range to hold by using "Power off holding" in the CPU system
settings.
Unit number: Starting with the CPU, numbers are assigned in the order (00, 01,
02, 03, 04, and so on) that the units are connected.
Unit DM number: Starting from 0000, the amount of data memory that will be
occupied is assigned as the number.
(Example)
Unit number 00* 01 02 03
Link register W
LADDER PROGRAMMING
Overview These registers are used to perform data linking in serial PLC link mode. Hexadecimal
notation is used to specify device numbers, which is different from other word devices.
4 Reference
W3A6F
• You can use zero suppression when you write your programs.
(Example) W7A
Devices and Constants
• You can use this as a bit device. You can also specify the bit position.
(Example) W1200.12 ............The 13th bit of W1200 is processed.
"Bit device processing of word devices" (page 4-48)
Application These registers can be used to perform data linking in serial PLC link mode.
16 bits
• You can also use two devices to process 32-bit data. For 32-bit data, the lower 16 bits
will be stored in the data memory entry of the specified device number and the upper
16 bits will be stored in the data memory entry of the next device number. When the
devices are being used as an unsigned, decimal value, they take on a value in the
range of 0 to 4294967295. When the devices are being used as a signed, decimal
value, they take on a value in the range of -2147483648 to +2147483647. When the
devices are being used as a hexadecimal value, they take on a value in the range of $0
to $FFFFFFFF.
W2BE1 W2BE0
bit bit bit bit bit bit bit bit
31 24 23 16 15 8 7 0
32 bits
Default setting With the default settings, values are not held.
You can configure the settings so that the values are held by using "Power off holding" in
the CPU system settings.
LADDER PROGRAMMING
Overview Temporary data memory entries are word devices that can be processed in the same
manner as data memory. Each device has 16 bits. When you use calculation instructions,
a part of the device area can also be used to temporarily store the data for the calculation
and the result data.
For details on instructions such as DIV and MUL, see the KV-7000/5000/3000/1000 Series and KV
Nano Series "Instruction Reference Manuals."
For details on simple indirect specification, see "Indirect Specification" (page 4-43).
Default setting When the power is turned on and when the mode switches from PROG to RUN, values
are cleared and set to 0.
Reference • TM000 to TM003 are designed for usage with calculation instructions such as DIV and
MUL. We recommend that you do not use these devices for any other purpose.
• You can use zero suppression when you write your programs.
(Example) TM10
• TM devices are stored in the internal cache, so you can access them at high speeds.
Use timers as word devices when you set the value of the timer (32 bits) and when you read the current
value of the timer (32 bits).
Use counters as word devices when you set the value of the counter (32 bits) and when you read the
current value of the counter (32 bits).
Overview High speed counters are 32-bit counters used to collect short interval signals that cannot
be captured by common counter instructions.
Details • You can use these to process values in the range of 0 to 4294967295 or in the range of
4 -2147483648 to +2147483647.
• You can count not only external input, but the internal clock as well.
• The maximum response frequency is 50% duty cycle, single-phase, 100 kHz, and 50
Devices and Constants
Overview These devices store the set values (32 bits) of high-speed counters.
Details • You can set these devices to a value between 0 and 4294967295 or between
-2147483648 and +2147483647.
• You can configure two set values (CTC) per high-speed counter (CTH).
CTC0 and CTC1 .......For CTH0
CTC2 and CTC3 .......For CTH1
CTC4 and CTC5 .......For CTH2
CTC6 and CTC7 .......For CTH3
Default setting With the default settings, the contact status and set values are held.
By using "Power off holding" in the CPU system settings, you can configure the settings
so that the contact status and set values are cleared when the power is turned on and
when the mode switches from PROG to RUN.
Index register Z
Overview These are 32-bit word devices that are used to specify the value to add to the target
device number during index modification. You can use these devices in the same manner
as data memory to save data and to store calculation results.
Reference You can use zero suppression when you write your programs.
(Example) Z3
LADDER PROGRAMMING
Point • Z11 and Z12 are reserved for the system, so you cannot use these devices.
• You cannot specify the bit for word devices.
• There are no local devices. Use the ZPUSH and ZPOP instructions.
For details, see the ZPUSH instruction in the KV-7000/5000/3000/1000 Series and KV Nano
Series "Instruction Reference Manuals."
For details, see the ZPOP instruction in the KV-7000/5000/3000/1000 Series and KV Nano
Series "Instruction Reference Manuals."
Default setting When the power is turned on and when the mode switches from PROG to RUN, the
values are cleared and set to 0. 4
"Index Modification" (page 4-41)
Overview These are special word devices that are used to control the PLC functions and to capture
the PLC status.
Index Modification
Index modification is a method for specifying devices by the number that is calculated by adding the
value of the index register (Z) or a constant to devices.
Values in the signed, 32-bit range can be added.
The types of devices that you can use index modification with are R (DR), B, MR, LR, T, C, DM, W, CM,
and TM. Index modification can be performed over all device ranges.
Index modification can be used together with indirect specification (*) and local devices (@).
• You cannot perform index modification with CTH, CTC, CR, Z, and labels (label
Point
arrays) and when specifying the bit position of word devices.
"Label" (page 4-152)
"Bit device processing of word devices" (page 4-48)
• If you specify in a parameter a device that is outside of the usable range after
index modification, control relay CR2012 is turned ON and the instruction is not
executed. Operation will continue.
Point Z11 and Z12 are reserved for system, so you cannot use these devices. Series.
Example
The current value, which will be stored in DM10000, is saved when a trigger signal (the
rising edge of R001) is received. Recording starts on the rising edge of R000. Data is
saved in the data memory entries in order, starting from DM0.
R000 MOV.L
On the rising edge of R000,
+0 Z1
index register Z1 is set to 0.
Recording
start button
On the rising edge of R001,
R001 MOV the value of DM10000 is written to
DM10000 DM0:Z1
the target device that is being
4
Trigger signal index modified.
Current Leading save
value destination
Z1
Index register Z1 is incremented
Devices and Constants
INC.L
(+ 1).
DM99 1234
Reference • If you need to use 10 or more index registers (Z) in a project, use the index register
instructions (ZPUSH and ZPOP) to store and restore all the index registers of a module
or macro at once.
For details, see "Index Instructions" in the KV-7000/5000/3000/1000 Series and KV Nano Series
"Instruction Reference Manuals."
• In the above example, if the suffix of the MOV instruction was ".L," the value of
DM10000 to DM10001 would be saved as data in the following data memory entries:
DM0 to DM1, DM2 to DM3, ... DM98 to DM99.
Reference If you use modification according to index constants in a macro that uses unit devices, it is
easy to tell what number device is specified from the assigned leading device. This is also
effective when you use UR and UM as argument devices during macro creation.
(Example)
UR0:#2
UM1:#32
"Usage example" (page 4-121)
4-42 - KV Nano Series(terminal block type) User’s Manual -
4-4 Devices and Constants
LADDER PROGRAMMING
Indirect Specification
(Example)
When you write "*TM10"
Device Value
TM10・TM11 DM0 25
This value indicates * TM10 references 1234
DM1 1234
the address of DM1. or DM1.
DM2 0
DM3 96
• The devices that you can write in "*(device)" (that is, the addresses that can be
Point
stored) are DM, TM, and W.
• The devices that you can specify indirectly are R, MR, LR, B, T, C, DM, TM, W,
and CM.
Reference • If the device that you want to specify indirectly is a timer (T) or counter (C), the contact,
current value, and set value are determined by the operands of the instruction that you
use.
• When you are using local devices, write "*@(device)."
1 Use the address set instruction (ADRSET) to write the address of the device that you want to
LADDER PROGRAMMING
reference.
(Example)
ADRSET
The address of DM0 is
DM0 TM10
stored in TM10 and TM11.
The devices that can store addresses are TM, DM, W, and CM.
4
Point
Devices and Constants
For details, see the ADRSET instruction in the KV-7000/5000/3000/1000 Series and KV Nano Series
"Instruction Reference Manuals."
2 To use the operands of the instruction to indirectly specify the device, add the prefix "*" before
the device in which the address is stored.
(Example)
MOV
The value of DM10000 is
DM10000 *TM10
stored in DM0.
DM0
Before you add the prefix "*" in front of the device in which the address is stored,
Point
be sure to use the ADRSET instruction to store the address of the device that you
want to specify indirectly.
3 To change the device that you want to reference, use the specialized indirect specification
commands (ADRINC, ADRDEC, ADRADD, and ADRSUB) to change the stored address.
(Example)
MOV
The value of DM10000 is
DM10000 *TM10
stored in DM1.
DM1
Do not use normal calculation instructions (such as ADD, INC, SUB, and DEC) to
Point
change the address that you want to reference. The ladder program will not
operate correctly.
For details, see "Indirect Specification Instructions" in the KV-7000/5000/3000/1000 Series and KV Nano
Series "Instruction Reference Manuals."
LADDER PROGRAMMING
The rising edge of R001 is used as the trigger signal, which causes the current value stored in
DM10000 to be saved.
Recording starts on the rising edge of R000. Data is saved in the data memory entries in order, starting
from DM0.
4
R001 MOV On the rising edge of R001, the value of
DM10000 *TM10 DM10000 is written to the target device
Trigger that is being indirectly specified.
Current value Address storage
signal
destination
DM99 1234
(1) (2)
R000 +0 R002 ADRSET
DW.S DM0 TM10
Measurement Z1 Save Leading save Address storage
start button destination destination 1 destination
selection (3)
R002 ADRSET
DM1000 TM10
Save Leading save Address storage
destination destination 2 destination
selection
(4)
R001 MOV
DM10000 *TM10:Z1
Trigger
signal Measured Address storage
value destination
Z1
INC.L
(5)
You can use indirect specification that uses temporary data memory (TM) as "simple indirect
specification."
• You cannot use simple indirect specification together with index modification,
Point
indirect specification (*), or local devices (@).
• Simple indirect specification is supported so that existing programs may be
reused. If you are creating new programs, we recommend that you use index
10000 R000
10001 R001
10002 R002
Relay (R) device indirectly
specified
27913 R17913
27914 R17914
27915 R17915
The range of temporary data memory entries that can be used is TM0 to TM511. However, take care to
not overlap over TM0 to TM3, as these are used for calculations.
• With simple indirect specification, you can specify only DM and R devices and
Point
only the ranges of DM10000 to DM32767 and R18000 to R59915.
• If you attempt to perform simple indirect specification when the value of
temporary data memory is greater than 27915, control relay CR2012, the
calculation flag, will be turned ON when the attempt to execute the instruction
is made, and the instruction will not be executed. Operation will continue.
LADDER PROGRAMMING
Processing bit devices in units of words
R006 R1500
With an instruction like this one,
the processing target of both R006 and R1500 is 1 bit.
R
0
1
5
R
0
1
4
R
0
1
3
R
0
1
2
R
0
1
1
R
0
1
0
R
0
0
9
R
0
0
8
R
0
0
7
R
0
0
6
R
0
0
5
R
0
0
4
R
0
0
3
R
0
0
2
R
0
0
1
R
0
0
0
4
Processing target
Output relay
R R R R R R R R R R R R R R R R
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
In calculation instructions, bit devices can be grouped into 16 bits or 32 bits for processing.
If you specify a bit device as an operand of an instruction that processes data in units of words, the
specified bit device will be treated as the leading bit of the word data for processing.
Example
MOV
R1000 DM0
R1015 R1000
1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
MOV.D
R1000 DM0
1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
If the bit device specified as an operand is not the leading channel, the next channel will also be used to
LADDER PROGRAMMING
MOV
R1003 R1505
R1102 R1003
301ch 300ch
4 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
R1604 R1505
Devices and Constants
306ch 305ch
1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
When the word unit of data is taken across multiple channels for processing, the
Point
processing speed decreases.
Example
DM1200.12...........The 12th bit of DM1200 is processed.
DM1200
0 1 1 1 0 1 1 0 0 1 1 0 1 1 0 0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
If you specify a word device with an instruction other than those listed above, only the lowest bit of the
specified word device is processed as a bit device.
DM1200.12 R1000
LADDER PROGRAMMING
Example
When the value of DM1000 is #46563 ($B5E3)
DM1000 DM1001
DM1000=#46563($B5E3)
1 0 1 1 0 1 0 1 1 1 1 0 0 0 1 1
4
In the above example, the contact is turned ON, so the lowest bit of DM1001 is set to 1.
DM1001=#14($E)
0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0
DM1001=#15($F)
0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1
Reference Bits other than the lowest bit are not changed.
Constants
The constant value and range varies according to the instruction and suffix used.
#Decimal constants
Overview Values that are displayed with a bit width of 16 or 32 bits are represented in decimal
notation.
Notation • Unsigned (when the suffix is ".U" or ".D")
A decimal constant is represented by the prefix "#," which is followed by decimal
numbers.
(Example)
Symbol that indicates
this is a decimal value Value
#06143
• Signed (when the suffix is ".S" or ".L")
A decimal constant is represented by a sign, which is followed by decimal numbers.
Reference • You can use zero suppression when you write your programs.
• You can also prefix signed constants with "#." If you include "#," only "+" may be omitted.
• When you select XYM marking mode, you can append "K" when you write these
constants.
"XYM marking" (page 4-19)
$Hexadecimal constants
4 Overview Values that are displayed with two bit widths,16 bits and 32 bits, are represented in
hexadecimal notation.
Devices and Constants
$1AF7
Range • 16-bit constant: $0000 to $FFFF
• 32-bit constant: $00000000 to $FFFFFFFF
If you enter a hexadecimal value that contains letters A to F without the prefix "$,"
Point
an error will occur. If you enter a hexadecimal value that does not contain letters
A to F without the prefix "$," the hexadecimal value will be recognized as a relay
(R).
Reference • You can use zero suppression when you write your programs.
• When you select XYM marking mode, you can append "H" when you write these
constants.
"XYM marking" (page 4-19)
LADDER PROGRAMMING
Overview These constants can be written as the operands of double precision floating-point
instructions.
Notation • Signed decimal values can be written as-is for these constants.
• For 15 digits or more, exponential notation is used.
4
Range -1.79E + 308 ≤ N ≤ -2.23E - 308
N=0
+2.23E - 308 ≤ N ≤ +1.79E + 308 (approximately 16 significant digits)
Overview These can be written as the operands of character string processing instructions and
calendar contact instructions.
If you do not include the opening and closing quotation marks, the string will be
Point
processed as a label.
Reference To process the quotation mark as a character, escape it by entering two quotation marks.
Internal Registers
An internal register is a device that is used to store the calculation results of application instructions,
calculation instructions, and expansion instructions and to temporarily store data during calculations.
The data stored in an internal register is not changed until the next time that new data is stored in the
internal register.
When the power is turned on and when the mode switches from PROG to RUN, the values are cleared
and set to 0.
4 The usage of the internal registers is automatically separated into the 16-bit, 32-bit, and 64-bit internal
registers according to the instruction and suffixes used.
"Suffixes" (page 4-8)
Devices and Constants
The lower 16 bits of the 32-bit internal register are known as the 16-bit internal register. The 32-bit
internal register consisting of the lower 16 bits and the upper 16 bits is known as the 32-bit internal
register.
LADDER PROGRAMMING
(Expansion) Word-unit handling of a
Data memory (internal auxiliary)
DM Current value of a timer
Temporary data memory relay or control relay
TM Constant or counter R00000 to R59915
Control memory #$ MR00000 to MR59915
CM T, C, CTH LR00000 to LR19915
Index register
Z CR0000 to CR3915
4
LDA instruction
Example
The value of DM0 is read into the internal registers. This value is then multiplied by
2, the value of DM1 is added to the product, and the result is then stored in DM2.
values, hexadecimal values, binary coded decimal (BCD) values, single precision floating-point real
numbers, and double precision floating-point real numbers.
The character codes that can be processed are ASCII code and shift JIS code.
Binary Data
On the KV Nano Series, all data is processed by devices and internal registers as binary data.
4 One digit of a binary value is processed as a bit unit. A bit indicates two states: 0 (OFF) and 1 (ON).
16 bits (16 binary digits) of data are normally processed in units of words. For an unsigned decimal
value, one word indicates a value in the range of 0 to 65535.
(Example)
Highest bit
0 0 1 0 0 1 1 1 0 0 0 1 0 0 0 0
Weight of
=
=
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 each bit
32768 16384 8192 4096 2048 1024 512 256 128 64 32 16 8 4 2 1 Decimal
number value
0 + 0 +8192 + 0 + 0 +1024+512 +256 + 0 + 0 + 0 +16 + 0 + 0 +0 +0 = 10000
Highest bit
If you are using a DM, TM, or other 16-bit word device to process a 32-bit device, 2 consecutive words
will be used. The lower 16 bits of data are processed by the word device with the smaller number, and
the upper 16 bits of data are processed by the word device with the larger number.
Reference Whether a device is processed as 16-bit data or 32-bit data is determined by the suffix.
"Suffixes" (page 4-8)
LADDER PROGRAMMING
Value Notation
Binary BIN
The internal binary data of the KV Nano Series is indicated as 0s and 1s without any changes. When a
digit is greater than 1, the digit is carried.
Highest bit
bit
15
bit
8
bit
7
bit
0 4
=
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 each bit
32768 16384 8192 4096 2048 1024 512 256 128 64 32 16 8 4 2 1 Decimal
number value
(Example) 0110110100110001
Decimal DEC
The internal binary data of the KV Nano Series is indicated as decimal values.
Unsigned
For 16-bit data, the range of values that can be processed is 0 to 65535. For 32-bit data, the range of
values that can be processed is 0 to 4294967295.
Signed
Whether a value is positive or negative is determined by the highest bit (0: positive; 1: negative).
For 16-bit data, the range of values that can be processed is -32768 to +32767. For 32-bit data, the
range of values that can be processed is -2147483648 to +2147483647.
Reference These values can be entered as instruction operands. Prefix the value with "#" or a sign.
(Examples) #1000, +12, and -25489
Hexadecimal HEX
The internal binary data of the KV Nano Series is indicated as hexadecimal values.
For hexadecimal values, four bits are processed as one digit. Because the values that can be
expressed in a single digit are 0 to 15 in decimal notation, A, B, C, D, E, and F are used for values
greater than 9. When a digit is greater than F, the digit is carried.
For 16-bit data, the range of values that can be processed is $0000 to $FFFF. For 32-bit data, the range
of values that can be processed is $00000000 to $FFFFFFFF.
Reference These values can be entered as instruction operands. Prefix the value with "$."
(Example) $00FF
With binary coded decimal notation, 4 bits are processed as 1 digit in the same manner as hexadecimal
notation. In the same manner as decimal notation, when a digit is 9, the digit is carried, so the letters A
to F are not used.
For 16-bit data, the range of values that can be processed is 0000 to 9999. For 32-bit data, the range of
values that can be processed is
00000000 to 99999999.
4 Example
15 8 7 0
0 0 0 0 1 0 0 1 1 0 0 0 0 1 1 1
When 16-bit data is stored as shown above, while the actual value is $0987
(#2439 in decimal notation), in binary coded decimal, this value is handled in
decimal notation as "0987."
0 0 0 0 1 0 0 1 1 0 0 0 0 1 1 1
Thousands Hundreds Tens Ones
position position position position
0 9 8 7
Binary coded decimal is a useful notation to use when processing data that comes from an external
source (such as a digital switch).
However, this data must be processed as binary data in calculations performed by the KV-5500/5000/
3000. When reading data from an external source, use the TBIN instruction to convert the data to
binary data. When outputting data to an external device (such as a digital display), use the TBCD
instruction to convert the data to binary coded decimal data.
Reference To enter binary coded data values as instruction operands, prefix the value with "$" to
enter the value in hexadecimal notation.
LADDER PROGRAMMING
Double precision floating-point real numbers are processed as values in which 64-bit data has a
decimal point.
You can use values in the following range (N).
-1.79 × 10+308 ≤ N ≤ -2.23 × 10-308
N=0
+2.33 × 10-308 ≤ N ≤ +1.79 × 10+308
Reference • These values can be entered as double precision floating-point instruction operands.
In addition to the normal notation using the decimal point (example: -1.2345), you can
also use an exponential notation using "E."
(Examples) -2.1437956 × 1012 -2.1437956E + 12 4
-4
+7.63259856 × 10 +7.63259856E - 4
The correlations between binary values, decimal (unsigned and signed) values, hexadecimal values, and
binary coded decimal values are shown below.
16-bit data
Decimal Binary
Hexa-
Coded
decimal Binary (BIN) Binary (BIN)
Unsigned Signed Decimal
(HEX)
(BCD)
0 +0 0 0000 0000 0000 0000 0000 0000 0000 0000 0000
1 +1 1 0000 0000 0000 0001 0001 0000 0000 0000 0001
2 +2 2 0000 0000 0000 0010 0002 0000 0000 0000 0010
3 +3 3 0000 0000 0000 0011 0003 0000 0000 0000 0011
4 +4 4 0000 0000 0000 0100 0004 0000 0000 0000 0100
5 +5 5 0000 0000 0000 0101 0005 0000 0000 0000 0101
6 +6 6 0000 0000 0000 0110 0006 0000 0000 0000 0110
7 +7 7 0000 0000 0000 0111 0007 0000 0000 0000 0111
8 +8 8 0000 0000 0000 1000 0008 0000 0000 0000 1000
9 +9 9 0000 0000 0000 1001 0009 0000 0000 0000 1001
10 +10 A 0000 0000 0000 1010 0010 0000 0000 0001 0000
11 +11 B 0000 0000 0000 1011 0011 0000 0000 0001 0001
12 +12 C 0000 0000 0000 1100 0012 0000 0000 0001 0010
13 +13 D 0000 0000 0000 1101 0013 0000 0000 0001 0011
14 +14 E 0000 0000 0000 1110 0014 0000 0000 0001 0100
15 +15 F 0000 0000 0000 1111 0015 0000 0000 0001 0101
16 +16 10 0000 0000 0001 0000 0016 0000 0000 0001 0110
...
...
...
...
...
...
99 +99 63 0000 0000 0110 0011 0099 0000 0000 1001 1001
100 +100 64 0000 0000 0110 0100 0100 0000 0001 0000 0000
...
...
...
...
...
...
32767 +32767 7FFF 0111 1111 1111 1111 0999 0000 1001 1001 1001
32768 -32768 8000 1000 0000 0000 0000 1000 0001 0000 0000 0000
...
...
...
...
...
...
65534 -2 FFFE 1111 1111 1111 1110 9998 1001 1001 1001 1000
65535 -1 FFFF 1111 1111 1111 1111 9999 1001 1001 1001 1001
32-bit data
LADDER PROGRAMMING
Decimal Hexadecimal
Binary (BIN)
Unsigned Signed (HEX)
0 +0 0 0000 0000 0000 0000 0000 0000 0000 0000
1 +1 1 0000 0000 0000 0000 0000 0000 0000 0001
2 +2 2 0000 0000 0000 0000 0000 0000 0000 0010
3 +3 3 0000 0000 0000 0000 0000 0000 0000 0011
4 +4 4 0000 0000 0000 0000 0000 0000 0000 0100
5 +5 5 0000 0000 0000 0000 0000 0000 0000 0101
6 +6 6 0000 0000 0000 0000 0000 0000 0000 0110
4 7
8
+7
+8
7
8
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0111
1000
+9
How Data Is Processed
...
...
...
99 +99 63 0000 0000 0000 0000 0000 0000 0110 0011
100 +100 64 0000 0000 0000 0000 0000 0000 0110 0100
...
...
...
...
2147483647 +2147483647 7FFFFFFF 0111 1111 1111 1111 1111 1111 1111 1111
2147483648 -2147483648 8000000 1000 0000 0000 0000 0000 0000 0000 0000
...
...
...
...
4294967294 -2 FFFFFFFE 1111 1111 1111 1111 1111 1111 1111 1110
4294967295 -1 FFFFFFFF 1111 1111 1111 1111 1111 1111 1111 1111
...
...
...
Changes to values when the value is greater than the maximum value or
LADDER PROGRAMMING
smaller than the minimum value
When the result of an arithmetic operation is greater than the maximum value or smaller than the
minimum value, the value is changed according to the data format as shown below. Whether data is
processed as unsigned values or signed values is determined by the suffix.
"Suffixes" (page 4-8)
16-bit data
Changes to values when 65535 is exceeded Changes to values when the value is greater than
the maximum value or smaller than the minimum
4
value
⋮
⋮
Reference Whether a device is processed as 16-bit data or 32-bit data is determined by the suffix.
"Suffixes" (page 4-8)
32-bit data
Changes to values when 4294967295 is exceeded Changes to values when the value is greater than
the maximum value or smaller than the minimum
value
Unsigned decimal notation Hexadecimal notation Unsigned decimal notation Signed decimal notation
3 00000003 3 00000003
2 00000002 2 00000002
1 00000001 1 00000001
0 00000000 0 00000000
4294967295 FFFFFFFF -1 FFFFFFFF
4294967294 FFFFFFFE -2 FFFFFFFE
4294967293 FFFFFFFD -3 FFFFFFFD
⋮
⋮
⋮
0 ∞ ("----" is displayed)
0 ∞ ("----" is displayed)
Character Codes
The numbers that are assigned to the characters that are used to process ladder programs in terms of
character strings are called character codes.
With KV STUDIO, you can use the following character codes.
ASCII code
This character code uses 8 bits to represent 1 half-width character.
(Examples) A ... $41 1 ... $31
Reference These can be entered as the operands of character processing instructions and calendar
contact instructions. Enclose character strings in quotation marks.
(Examples) "ModelABC" "Month/08:30:15"
LADDER PROGRAMMING
Base Unit Operation
The KV Nano Series follows the procedure shown below to execute programs repeatedly.
Control processing
Automatic refreshing
Reference Apart from the three processing stages shown above, there is also interrupt processing
caused by the execution of external input, high-speed counter comparators, and system
interrupts (peripheral processing).
"4-7 Interrupts" (page 4-76)
Control processing
One control processing stage is called a scan. Scan time is the execution time of one scan.
Automatic refreshing
The status and values of devices assigned to the CPU built-in functions and expansion units are
updated. First, the device status and values to be generated are transferred to each unit. Next, the
status and values of each unit are transferred to the input devices.
Program execution
Calculation processing of the stored program method is performed. The ladder program instructions
are executed one instruction at a time in order starting from the first step.
END processing
The peripheral processing is applied to control processing. Also, all system errors are checked.
Reference Normally, the END processing time is determined automatically according to the program
execution time. However, you can set the END processing time in situations such as
when there is a great deal of data communications with the peripherals.
"Setting the END processing time" (page 4-70)
Peripheral processing
In this process, information other than that used in program processing, such as communications and
data management information, is processed. In addition, instructions related to calendar timers and
similar items are executed.
Not all operations are carried out during END processing. Part of the data management is executed as
a system interrupt during program processing, which optimizes the control processing.
Direct processing
LADDER PROGRAMMING
As written above, automatic refreshing processing, in which the status and values of devices assigned
to the CPU built-in functions and expansion units are updated, is normally performed only once per
scan. To update information during program execution (direct processing), use one of the following
methods.
will be updated when the instruction is executed. For details on the instructions with which you can use
"DR," see the KV-7000/5000/3000/1000 Series and KV Nano Series "Instruction Reference
Manuals."
Example)
DR000 DR500
Reference If you are using XYM marking, write "DX" and "DY."
"XYM marking" (page 4-19)
CR2002 MOV
DM0 R500
Always ON
Calculation result
RFSY
R500 #16
For details, see the RFSX and RFSY instructions in the KV-7000/5000/3000/1000 Series and KV Nano Series
"Instruction Reference Manuals."
Reference The expansion I/O units and expansion special units of the KV Nano Series do not
support direct refreshing.
LADDER PROGRAMMING
The following items are checked when the power is turned on. If everything is OK, operations are
started.
• Hardware check and initialization
• Device check and initialization "Configuring Power Failure Holding Settings (Latching)" (page 4-26)
4
Power on/off log
Error handling
LADDER PROGRAMMING
There are two types of errors: serious errors that stop operation and minor errors in which operation
continues.
For details on the KV Nano Series errors, see "A-1 List of PLC Unit Errors" (page A-2).
For details on the expansion unit errors, see the "User's Manual" of each expansion unit.
Error log
You can retain up to 32 serious error log entries and 32 minor error log entries. If an attempt is made to
store more than 32 log entries, existing log entries are deleted starting with the oldest one. In addition,
while using KV STUDIO to perform monitoring, you can view the log in the "Error monitor".
LADDER PROGRAMMING
The detailed information of the latest error is recorded in control memory entries.
Control Memory Description
CM2200 Year and month represented as a decimal number (the last
two digits represent the month, and the digits starting from
the hundreds digit represent the year)
Example: 1210 October 2012
CM2201 Day
Hour
4
CM2202
CM2203 Minute
Second
: :
: :
CM2226 Detailed information, piece #20*
CM2252 Hour
CM2253 Minute
: :
: :
CM2276 Detailed information, piece #20*
* The detailed information varies as shown below according to the number of the error that occurred.
Detailed
Description
Information, Piece n
Error details
0 (Not used.)
1 Incorrect indirect specification.
2 The indirectly specified target is T/C.
3 Incorrect simple indirect specification.
4 Outside of operand range.
5 Floating-point real number overflow.
6 Incorrect device specification.
7 The ROOT instruction operand is negative.
4 8
9
No bits set to ON with the ENCO instruction.
Floating-point real number format error.
10 Incorrect trigonometric function instruction operand.
Program Structure and Operation
• Error numbers 50, 53, 55, 56, 58, and 59 (unit ID errors)
LADDER PROGRAMMING
Detailed
Description
Information, Piece n
Detailed information, Unit number (the unit number will not be stored if it cannot be determined according to the occurrence
piece 1 conditions of the error)
Detailed information, Fixed to 00H
pieces 2 to 20
• Error number 96, 97, 98, 99, or 101 (extension cassette ID error)
Detailed
Description
Information, Piece n
Detailed information, Extension cassette slot number
piece 1 (0 is stored when the slot number cannot be determined)
Detailed information, Reserved for the system
piece 2
Detailed information, Fixed to 00H
pieces 3 to 20
Scan Time
The time required to execute one control processing sequence (automatic refreshing program
execution END processing) is called the scan time. The scan time varies according to the program
size and the type of instructions that are used.
Scan time Scan time Scan time
4
refreshing processing refreshing processing refreshing processing
If the scan time exceeds 300 ms, a scan time over error (CPU error number 30) will
Program Structure and Operation
Point
occur, and operations will stop (the mode will be switched to PROG mode).
Reference • To view the actual measured scan time, while using KV STUDIO to perform monitoring,
on the "Debug" menu, click "Scan time monitor."
• You can use CM720 (in units of 10 µs) to check the actual measured scan time.
"A-2 Lists of CR and CM Devices" (page A-8)
During normal program execution, the scan time varies according to factors such as (1) the execution
status and processing details of each module and (2) interrupt processing.
By using the fixed scan time processing function, you can maintain a fixed scan time.
Not using the fixed scan time operation function (normal operation)
0.9 ms 1.1 ms 1.0 ms
The scan time varies according to the execution status of each instruction of each module and macro.
LADDER PROGRAMMING
Example) When the value is set to 1.2 ms:
1.2 ms 1.2 ms
In one scan, after all processing is completed, operations do not proceed to the next step until the set
amount of time elapses, so it is possible to fix the scan time.
Point
• If the scan time is longer than the set time, the scan time will be extended. 4
Be sure to confirm the actual measured scan time of the target program before
Point Set a value that is larger than the actual scan time.
Reference • You can use CM720 (in units of 10 µs) to check the actual measured scan time.
"A-2 Lists of CR and CM Devices" (page A-8)
• If the scan time value is exceeded, CR2304 is set to ON for one scan only.
During normal program execution, the scan time varies according to factors such as (1) the execution
status and processing details of each module and (2) interrupt processing.
If you set the END processing time, END processing is executed for a fixed length of time in each scan.
Because the maximum scan time is large regardless of whether there is a great deal of data
communications with the peripherals, use this function in situations such as when you cannot set the
fixed scan time operation.
2ms 2ms
Reference You can use CM723 (in units of 10 µs) to check the actual measured END processing
time.
"A-2 Lists of CR and CM Devices" (page A-8)
LADDER PROGRAMMING
Program Configuration
In a single scan, program execution consists of the modules being executed in the predetermined
order, and within each module, the main routine program being executed step by step from its first step.
Module 1
Automatic refreshing
Module 2 4
END processing
Module n
In each module, you can create the main routine program, subroutine programs, and interrupt
programs.
Module
Subroutine programs
Interrupt programs
Reference Although you can call macros from within modules, macros themselves are constructed of
a main routine program and subroutine programs. You cannot create interrupt programs
in macros.
"4-9 Macros" (page 4-112)
The program from the start of the module or macro to the END instruction is called the main routine
program.
If you will not write any subroutine or interrupt programs, write the ENDH instruction immediately after
the END instruction.
4
Main routine program
Program Structure and Operation
END
ENDH
Point If the END or ENDH instruction is not present, a conversion error will occur.
Reference The END and ENDH instructions are inserted automatically when you create a new
module or macro, so do not delete these instructions.
Subroutine programs
Subroutine programs are programs that are executed from the main routine program by using the CALL
(call subroutine) or ECALL (call subroutine between modules) instruction. When the execution
condition of the CALL instruction turns ON, the subroutine program is executed.
If you want to perform the same processing in multiple locations of the main routine or if you want to
process a program only when the set conditions are met, you can execute the program only when
necessary by writing it as a subroutine program.
You can write up to 100 subprograms (numbered from 0 to 99) between the END and ENDH
instructions.
Each subroutine program starts with the SBN (subroutine entry) instruction and ends with the RET
(subroutine return) instruction.
In one module or macro, you cannot give multiple subroutine programs the same number. In the main
routine program, you can make multiple CALL instructions to the same subroutine program number.
For details, see the CALL, SBN, and RET instructions in the KV-7000/5000/3000/1000 Series and KV Nano
Series "Instruction Reference Manuals."
CALL #0
Main routine program
CALL #1
END
Modules and macros
SBN #0
RET
Subroutine programs
SBN #1
RET
ENDH
4-72 - KV Nano Series(terminal block type) User’s Manual -
4-6 Program Structure and Operation
LADDER PROGRAMMING
• If the SBN instruction that corresponds to the CALL instruction does not exist,
Point
a conversion error will occur.
• If the SBN instruction that corresponds to the ECALL instruction does not
exist, a conversion error or a calculation error will occur.
• The INT, RETI, STG, JMP, and ENDS instructions cannot be used in subroutine
programs.
• Be careful when you use differential execution type instructions, timer
instructions, and macro instructions in subroutine programs.
For details, see "Precautions for Differential Execution Type Instruction" in the KV-7000/
5000/3000/1000 Series and KV Nano Series "Instruction Reference Manuals."
"Precautions when using Timer instructions" (page 4-32)
"Macro instructions" (page 4-126)
4
R001 #0
Main routine CALL
program
END
SBN
#1
Subroutine
programs RET
SBN Call
#0
Subroutine R000 #1
programs CALL
RET
ENDH
Interrupt programs
Use the interrupt function when you are acquiring short signals, during input response, and when you
are performing highly accurate time measurements. When the interrupt conditions are met, the
processing of the main routine program is interrupted, and the interrupt program is executed
immediately. After interrupt processing is completed, the processing of the main routine program begins
again from the point where it was interrupted.
There are the following three types of interrupt conditions: external input, high-speed counter
comparators, and the relay for the matching of two comparators of the CPU positioning function.
- KV Nano Series(terminal block type) User’s Manual - 4-73
4-6 Program Structure and Operation
LADDER PROGRAMMING
Interrupt
condition met
4 Input
Interrupt program
processing
Program Structure and Operation
END
Module
INT R000
RETI
Interrupt programs
INT CTC0
RETI
ENDH
LADDER PROGRAMMING
Reference • There are no restrictions on the order that you write subroutines and interrupt programs.
END
Module
SBN #1
INT R000
RET
RETI
Subroutine programs
Interrupt programs
4
• Interrupt programs are executed even when their modules are not being executed.
• Interrupt programs are executed regardless of the execution status of the module, so
you can make it easier to understand the project structure by managing a single stand-
by module as the one that contains all the interrupt programs.
Overview
Normal PLCs execute ladder sequences by repeating the following cycle: input processing, program
execution, and then output processing. Therefore, signals shorter than the scan time cannot be applied.
If you use the interrupt function, you can execute processing at the point in time that an interrupt occurs
regardless of the scan time.
When an interrupt occurs, even if a program is being executed, the execution is temporarily interrupted,
and the interrupt program that corresponds to the interrupt condition is executed. After the interrupt
4 program is completed, the processing of the interrupted program begins again.
Interrupts
Input processing
KV-N24**:R000 to R013
Interrupt program KV-N40**:R000 to R107
Program
execution KV-N60**:R000 to R203
execution
KV-N14**:R500 to R505
Output processing KV-N24**:R500 to R509
KV-N40**:R500 to R515
KV-N60**:R500 to R607
Device processing
Device processing when an interrupt occurs is shown below.
For details on I/O processing, see "I/O Processing during Interrupts" (page 4-83).
(3)
LADDER PROGRAMMING
When an interrupt program starts, the values of the internal registers, the operation flags, R000 to
R203, TM0 to TM3, and Z11 and Z12 are recorded in the system. When the interrupt program finishes,
the recorded values are restored.
Even if these values are changed during interrupt processing, the main routine program will not be
affected. Changed values are only valid within the interrupt program.
After the interrupt program finishes, the current value of the high-speed counter (CTH) is set to the
value that was acquired during the input processing of the interrupt program.
For other devices, if the values were changed during the interrupt program, these new values take
effect in the main routine program after the interrupt program finishes. 4
Interrupts
You can use the "User interrupt" screen on the "CPU system setting" dialog box
Point
to specify whether to save and restore index registers Z1 to Z10.
Reference To update to the latest status device values that are not automatically refreshed:
• Use "DR" to write an I/O relay.
• Write the RFSX or RFSY instruction.
• Write the RFSCTH instruction.
"Direct processing" (page 4-62)
Processing time
When all of the following conditions are met, the time until an interrupt program starts is within 100 µs
(50 µs) TYP.
• The "Enable interrupt in instruction execution" checkbox on the "User interrupt" screen of the "CPU
system setting" dialog box is selected.
• No other interrupt programs with a priority higher than this interrupt program are being used.
The starting and ending processing times (refreshing, saving, and restoring devices) of the interrupt
program are as follows: starting processing time: 30 µs and ending processing time: 15 µs.
To make interrupt processing possible, write your programs in the following way.
Interrupt program example
CR2008
EI
HSP
R000
4 Main routine program
If you do not use the EI instruction, interrupt programs
cannot be executed.
Interrupts
END Use the HSP instruction (10 μs) or set a value in CM1620
and turn CR2305 ON to set the input time constant.
INT
R000
Interrupt program
Write interrupt programs between the "END" and "ENDH"
RETI
instructions.
ENDH
Reference • To disable interrupts, use the interrupt disable (DI or DIC) instructions.
• When interrupts are disabled, even if an interrupt occurs, the interrupt program will not
be executed until interrupts are enabled.
• The interrupt program starts when interrupts are enabled.
• Even if you have not executed the interrupt enable (EI) instruction, system interrupts
caused by peripheral processing are executed.
"EI Instructions" (page 4-94)
"DI Instructions" (page 4-94) and "DIC Instructions" (page 4-96)
LADDER PROGRAMMING
Between the END and ENDH instructions, write the INT instruction with operands to set the interrupt
condition.
After the INT instruction, program the interrupt processing details, and then finally write the RETI
instruction.
You can only write one INT instruction per interrupt condition.
Point
• Some instructions cannot be used in interrupt programs.
See "Instructions That Cannot Be Used in Interrupt Programs" (page 4-82).
• To shorten the input time constant, you have to use the HSP instruction (10 µs)
or data memory entry CM1620 to enter the input time constant, and then turn 4
CR2305 ON.
Interrupts
For details on the input time constant, see the HSP instruction in the KV-
7000/5000/3000/1000 Series and KV Nano Series "Instruction Reference
Manuals."
CR2008
EI
CR2008 #0 CR2305
EI DW SET or
CM1620 CR2002 HSP
R000
Use input relays as the interrupt condition. Interrupts are executed through input relays R000 to R003.
Use control relays to set the polarity of the interrupt condition, that is, whether it is detected on rising or
falling edges.
Point Use the SET and RES instructions to turn special auxiliary relays ON and OFF.
Input capturing
LADDER PROGRAMMING
INT R000 to INT R003 of the external input interrupts have the input capture function. When interrupts
occur, this function captures the current value of the high-speed counter into control memory. Just by
specifying the high-speed counter to reference, the current value of the high-speed counter is
transmitted to CM1600 to CM1607 automatically when an interrupt occurs.
For details, see "Input Capture Function" (page 4-86).
4 You can use high-speed counter comparators as interrupt conditions. Interrupt processing is performed
when the current value of high-speed counter CTH is the same as the value of high-speed counter
Interrupts
comparator CTC.
You can use the CPU positioning parameter comparator 2 as the interrupt condition. During positioning
and speed control, interrupt processing is performed when the number of pulses output (the current
value) is the same as the value of comparator 2. You can perform simple multi-stage control by
changing the operation speed in the interrupt program.
For details, see "Changing the speed during operation" (page 5-40).
Reference CR8415, CR8515, CR8615, and CR8715 are not actually turned ON and OFF. They are
only used as symbols in ladder programming in KV STUDIO.
LADDER PROGRAMMING
Interrupt Priority
You can set the interrupt priority for the case in which multiple interrupt conditions are met at the same
time.
To configure this setting, from the KV STUDIO workspace, open the "CPU system setting" dialog box,
and then click "Program setting" and then "User interrupt setting."
Interrupts
You can set the priority to "High", "Middle", or "Low". When an interrupt program is being executed, the
programs of higher order interrupts will be executed, but the programs of same-level and lower order
interrupts will have to wait until the interrupt program currently being executed is finished.
Also, if you select the "Enable interrupt in instruction execution" checkbox, you can suppress variations
in interrupt response time because interrupts will be executed mid-process for instructions that have
long processing times.
If a different interrupt occurs while an interrupt program is being executed, the operation varies
according to the priority settings. See the following table.
Priority of Program Whose Interrupt Has
Priority of Interrupt Program Being Occurred (B)
Executed (A)
High Middle Low
High Wait Wait Wait
Execute
Middle Wait Wait
immediately
Execute Execute
Low Wait
immediately immediately
Wait: After the currently executing interrupt program (A) finishes, the program whose
interrupt has occurred (B) will be executed.
Execute immediately: The currently executing interrupt program (A) is interrupted, and the program
whose interrupt has occurred (B) is executed.
After interrupt program (B) finishes executing, interrupt program (A) continues
from the point it was interrupted at.
ANPB and ANFB AND pulse bar and AND pulse fall bar
Interrupts
FLIK Flicker
ALT Alternate
TMR, TMH, TMS, and Timer, high-speed timer, 1 ms high-speed timer, and 10
TMU µs high-speed timer
C Counter
Timer and counter OUTC Out counter
instructions
ITVL Interval timer
W-UE and W-DE Wait rising edge and wait falling edge
instructions
Operation
Data control RAMP, TPOUT, and Ramp signal, time division proportion output, and
instructions LLFLT advancement delay filter
Data processing
HKEY and SORTN Hexadecimal key input and binary data division sort
instructions
Cam switch ABSENC and
Expansion instructions
LADDER PROGRAMMING
I/O Processing during Interrupts
Input processing
When the interrupt program starts, the status of the input relays (R000 to R203) is captured. (Direct
processing.) The status of other input relays is that captured during the input processing of that scan (I/
O refresh) even when an interrupt program is executed.
The status of the input relays that are captured when the interrupt program starts (R000 to R203) is
only valid during the interrupt program. After the interrupt program is finished, the status captured
during that scan's input processing (automatic refreshing) is used in the main routine program. 4
Example
Interrupts
Interrupt condition met
ON
R000
OFF
ON
R001
OFF
ON
R1000
OFF
R001:OFF R001:ON
R1000:OFF R1000:ON
Input
Interrupt program
processing
R001:ON
R1000:OFF
OFF ON OFF ON
4 R005
INT
R000
R1000
When input relay R000 is ON,
the interrupt program is executed.
RETI
ENDH
Output processing
Interrupt programs have no output processing. After an interrupt program is finished, output is
generated by the output processing (automatic refreshing) of the main routine program.
However, if you write a DR device (such as DR500) on an output relay (R500 to R607), output is
generated immediately when the program is executed (direct output).
Example
R1500: Output
Input
(1) (2) (3)
processing
CR2002 DR500
(1) SET
CR2002 DR501
(2)
CR2002 DR1500
(3) SET
LADDER PROGRAMMING
Example
• If you want to perform direct output within an interrupt program, use a DR device
on an output relay. (Alternatively, you can also use direct output by using the SET
or RES instruction to specify a device from R500 to R607.)
• Even if in an interrupt program, direct output will not be generated in the following
cases. In these cases, output is generated during that scan's output processing.
(1) When the output source is specified with an instruction other than SET or RES.
(2) When a relay other than R500 to R607 is specified as the device with the SET or
RES instruction or through the use of indirect specification or index
modification. 4
(3) When the SET or RES instruction is executed from a macro or subroutine
Interrupts
called from the interrupt program.
INT
R001 When input relay R001 is ON,
CR2002 R501
the interrupt program is executed.
SET Direct output relay R501 is turned ON.
RETI
ENDH
Reference To update to the latest status device values that are not automatically refreshed:
• Use "DR" to write an I/O relay.
• Write the RFSX or RFSY instruction.
• Write the RFSCTH instruction.
"Direct processing" (page 4-62)
The input capture function captures the current value of the high-speed counter in data memory when
an interrupt condition occurs. This function is enabled when the interrupt condition is an external input
(only R000 to R003 can be used). You do not have to configure any settings to use this function.
The captured value is stored in control memory entries CM1600 to CM1607.
High-Speed Counter Storage Destination
Interrupt Condition
Whose Current Value
(External Input) Upper Bits Lower Bits
Will Be Captured*
4 INT R000 occurring CTH0 CM1601 CM1600
INT R001 occurring CTH0 CM1603 CM1602
Interrupts
* You can use the user interrupt settings of the CPU system settings to change which high-speed
counters the input capture function will capture the current values of.
The timing with which input capturing is executed depends on the polarity
Point
settings of the interrupts set with CR2600 to CR2607.
Difference between the input capture function and the current value of
high-speed counters during interrupt program execution
• Input capture function
...The value is captured the instant that the interrupt condition occurs.
• Current value of high-speed counters during interrupt program execution
...The current value of the high-speed counter is captured through input processing of the interrupt
program by using the LDA and MOV instructions during interrupt program execution.
In the following situations, the captured values are different.
High-speed counter
CTH0, current value ... 10 11 12 ... 99 100 101 ... ... 999 1000 1001
(1) (2)
100 1000
(1) Because the input capture function captures the value the instant that the interrupt condition occurs,
the current value of high-speed counter CTH0 is #100.
(2) Because the interrupt program captures the value during its input processing, the current value of
captured high-speed counter CTH0 is #1000.
As shown above, if there is a time difference between the point in time that the interrupt condition
occurs and the point in time that the interrupt program is executed, there will be a difference in the
current value of the captured high-speed counter.
Reference After the interrupt program finishes, the current value of the high-speed counter (CTH) is
set to the value that was acquired during the input processing of the interrupt program.
LADDER PROGRAMMING
Sample Program
Interrupts
ON
ON
<Mnemonics list>
CR2008
When the power is turned LD CR2008
EI
on, interrupts are enabled. EI
LD CR2002
CR2002 HSP HSP R000
R000 The input time constant of LD R500
input relay R000 is set to TMR #0 #10
R500 #10 T0 R500 10 μs. CON
T0 RES Output relay R500 is AND T0
turned ON for just 1 RES R500
second. END
END INT R000
LD CR2002
SET R500
INT RETI
R000 When input relay R000 ENDH
turns ON, output R500 is
R500 turned ON.
CR2002
SET
RETI
ENDH
• When the high-speed counter input value from input relay R004 is
#10000, output relay R500 is turned ON.
• When input relay R000 is turned ON, output relay R500 is turned
4 OFF.
Interrupts
Scan
ON
ON
ON
INT
CTC0 When the value of high-speed
counter comparator CTC0 is
R500 #10000, the interrupt program is
CR2002
SET executed, and output relay R500
is turned ON.
RETI
ENDH
LADDER PROGRAMMING
The pulse widths of pulses applied to the input relay are
measured.
ON
Pulse width
4
units of 1 µs.
• The input capture value (CM1610 and CM1611) when input relay R000 is turned ON is stored in data
memory entries DM10 and DM11.
Interrupts
The value stored in DM10 and DM11 is subtracted from the input capture value when R000 is turned OFF.
This value is the pulse width.
• The measured value is stored in data memory entries DM0 and DM1 in units of µs.
<Mnemonics list>
CR2008 When the power is
EI turned on, interrupts are LD CR2008
EI
enabled.
LD CR2002
CR2002 HSP The input time constant HSP R000
R000 of input relay R000 is set LD CR2002
to 10 μs. CTH.D #0 CR4201
CR2002 CTH.D 0 END
CR4201 High-speed counter INT R000
CTH0 is used to count LDB CR2601
the 1 μs internal clock. LDA.D CM1600
END CON
STA.D DM10
Input relay R000 is used CON
INT to execute the interrupt. LD CR2601
R000 First, an interrupt is LDA.D CM1600
executed on the rising CON
edge of R000. The SUB.D DM10
CR2601 CM1600 DM10 KEEP current value of CTH0 CON
LDA.D STA.D SET
([CM1600 and CM1601]) STA.D DM0
CR2601 at this point in time is CON
stored in [DM10 and KEEP CR2601
CR2601 CM1600 DM10 DM0
DM11]. What's more, RETI
LDA.D SUB.D STA.D RES
CR2601 is turned ON, ENDH
which changes the
RETI interrupt polarity to falling
edge.
Next, an interrupt is
ENDH executed on the falling
edge of R000. The pulse
width of R000 can be
determined by subtracting
the value of [DM10 and
DM11], which were stored
on the rising edge, from
the current value of CTH0
at this time ([CM1600 and
CM1601]).
The result is stored in
[DM0 and DM1]
Finally, CR2601 is turned
OFF to change the
interrupt polarity to rising
edge.
• The elapsed time between input relays R002 and R003 is measured.
4 • The measured value is stored in data memory entries DM0 and DM1 in units of 1 µs.
CR2008 CR2604 CR2605 CR2606 CR2607 on, interrupts are enabled LD CR2008
EI RES RES RES RES and the interrupt polarities of EI
input relays R002 and R003 CON
are set to rising edge. RES CR2604
CR2002 HSP
The input time constant of CON
R002
R002 is set to 10 μs. RES CR2605
CON
HSP The input time constant of RES CR2606
R003 R003 is set to 10 μs. CON
RES CR2607
LD CR2002
CR2002 CTH.D1 High-speed counter HSP R002
CR4401 CTH1 is used to count HSP R003
the 1 μs internal clock. LD CR2002
END CTH.D #1 CR4401
END
INT R002
When INT002 is RETI
INT INT R003
R002 executed, the current
value of CTH1 is LD CR2002
automatically stored LDA.D CM1606
RETI (input captured) in CON
[CM1604 and CM1605]. SUB.D CM1604
CON
STA.D DM0
INT RETI
R003 When INT003 is
executed, the current ENDH
value of CTH1 is
CR2002 CM1606 CM1604 DM0 automatically stored
LDA.D SUB.D STA.D (input captured) in
[CM1606 and CM1607].
The elapsed time
RETI
between the two points is
determined by subtracting
the input capture value of
ENDH INT002 from the input
capture value of INT003.
The result is stored in
[DM0 and DM1]
LADDER PROGRAMMING
Interrupt Processing Instructions
Interrupts
Executes the interrupt program from this instruction to the RETI
Interrupt INT 4-98
instruction
Interrupt return RETI Indicates the end of the interrupt program 4-98
Available Devices
4 Operand
Bit Devices Word Devices Const
Ind
Spec Device
Index
Local Modify
MR DM
Interrupts
Operand Description
D Specifies the device number of the relay whose input time constant you want to make smaller*1
*1 The relays that you can use vary depending on the unit.
KV-N14**: R000 to R007
KV-N24**: R000 to R013
KV-N40**: R000 to R107
KV-N60**: R000 to R203
Operation Description
When the execution condition turns ON, the input time constant of the device specified with D is set
to 10 µs.
When the execution condition turns OFF, this value is set to the input time constant specified with
CR2305 and CM1620.
Be sure to set these values when you use the INT and CTH instructions.
When the input time constant is set by both control relay CR2305 and the HSP
Point
instruction, the HSP instruction will be given priority.
• For details on changing the input time constant of the base unit, see "Input Time Constant
Setting" (page 5-198).
• Use the Unit Editor of KV STUDIO to set the input time constants of expansion input units. For details
on changing these values, see "Chapter 3 UNIT EDITOR" in the "KV STUDIO User's Manual."
Operation flags
Sample Program
MEMO
LADDER PROGRAMMING
4
Interrupts
DI DI
Disable
interrupts
Disables the execution of interrupt
programs
EI EI
Enable
interrupts
Enables the execution of interrupt programs
Execution condition
4 DI D I
Interrupts
Available Devices
Index
Ind Local Modify
Bit Devices Word Devices Const
Operand Spec Device
MR DM
R DR LR T C CTC CR TM T C CTH CTC Z CM #/$ #TM * @ :#/:Z
B W
- - - - - - - - - - - - - - - - - - - -
Operation Description
DI When the execution condition turns ON, the execution of interrupt programs is disabled.
Use this instruction when you want to temporarily disable interrupts.
EI When the execution condition turns ON, the execution of interrupt programs is enabled.
Use this instruction to enable the interrupt programs that have been disabled with the DI
instruction.
• When the EI instruction is executed, interrupts are enabled until the DI instruction is executed.
• When operations start, interrupts are disabled.
• If interrupts occur while the DI instruction is being executed (while interrupts are disabled), the
execution of the interrupt programs will be put on hold.
When the EI instruction is executed, the interrupts that were put on hold are executed.
When an interrupt program starts, interrupts are enabled (EI). During the execution of an interrupt
program, to execute further interrupt programs, the priority of these further interrupts must be set higher
than that of the currently executing interrupt program. To set priorities, click "CPU system setting" and
then "User interrupt." You can set up to three levels of priorities.
Operation flags
LADDER PROGRAMMING
Sample Program
When input relay R000 is turned ON, the execution of interrupt programs is disabled.
When R000 is turned OFF, the execution of interrupt programs is enabled.
Interrupts
DIC DIC
Interrupt disabled
range
Sets the interrupt disabled range
4 EI
Interrupts
Available Devices
Index
Ind Local Modify
Bit Devices Word Devices Const
Operand Spec Device
MR DM
R DR LR T C CTC CR TM T C CTH CTC Z CM #/$ #TM * @ :#/:Z
B W
D - - - - - - - - -
Operand Description
D Specifies the bit device that generates the interrupt enabled/disabled status*1
*1 If you specify a word device, the lowest bit is used. The bits other than the lowest bit will not be
changed.
Operation Description
If interrupts were enabled prior to the execution of the DIC instruction, the device
LADDER PROGRAMMING
specified by D is set. If interrupts were disabled, the device is reset.
CR2002 D CR2002 D
DIC DIC
4
D D
EI EI
Interrupts
OFF ON
Interrupts disabled Interrupts enabled
Input
Interrupt program
processing
Operation flags
Sample Program
Interrupts are disabled during operation processing. After the DIC instruction is executed, the status of
interrupt processing is returned to the status that was present prior to the DIC instruction being
executed.
<Mnemonics list>
CR2002 R1000
LD CR2002
DIC Interrupt processing is
DIC R1000
disabled. LD CR2002
CR2002 DM0 DM10 DM100 LDA DM0
DM100=DM0+DM10
LDA ADD STA CON
ADD DM10
CON
MR1000
STA DM100
EI The interrupt enabled or LD MR1000
disabled status is recovered. EI
RETI RETI
Interrupt return Indicates the end of the interrupt program
4 ( )
I S
Interrupt program
Interrupts
RETI
R E T I
( I R E T )
Available Devices
Index
Ind Local Modify
Bit Devices Word Devices Const
Operand Spec Device
MR DM
R DR LR T C CTC CR TM T C CTH CTC Z CM #/$ #TM * @ :#/:Z
B W
S - - - - - - - - - - - - - - - -
Operand Description
S Specifies the bit device*1
*1 The devices that you can specify vary depending on the unit.
KV-N14**: R000 to R003, CTC0 to CTC3, CR8415, and CR8515
KV-N24**: R000 to R003, CTC0 to CTC3, CR8415, and CR8515
KV-N40**: R000 to R003, CTC0 to CTC5, CR8415, CR8515, and CR8615
KV-N60**: R000 to R003, CTC0 to CTC7, CR8415, CR8515, CR8615, and CR8715
Operation Description
The internal registers, index registers, operation flags, R000 to R203, and TM0 to
Point
TM3 are stored automatically when an interrupt program starts. When the
interrupt program is finished, the stored values are restored. By default, the only
index registers that are saved and restored are Z11 and Z12. You can use the
"User interrupt" screen on the "CPU system setting" dialog box to specify
whether to save and restore index registers Z1 to Z10.
Operation flags
LADDER PROGRAMMING
Instruction Execution Timing
INT and RETI The instruction is executed on the rising or falling edge of the operand.
Scan
Interrupts
Sample Program
<Mnemonics list>
CR2002 LD CR2002
EI EI
END
END INT R000
LD CR2002
SET R500
INT
R000 RETI
ENDH
CR2002 R500
SET
RETI
ENDH
Overview
A normal ladder program that is used to control a device involves multiple processes such as
initialization, automatic operation, manual operation, and error handling. Traditionally, these multiple
processes have been managed consecutively in a single ladder program. With KV STUDIO, you can
create programs within a project for the different aspects such as processes and functions, and then
manage these programs as independent components (modules).
4 Project Project
[Error processing]
Modules
[Automatic operation]
[Manual operation]
[Automatic operation]
Modules
All processing is written in You can separate the ladder program into
order in a single ladder different functions and processes,
program that is like a long and manage each of them as its own
scroll. module.
Module management
In KV STUDIO, modules are managed from the workspace of each project.
You can easily reuse programs by importing modules and macros.
Importing
modules and
macros
To display the workspace, click the corresponding item on the "View" menu. You can also use the icons
LADDER PROGRAMMING
on the toolbar to show and hide this element.
You can change the display position of this element.
Reference You can also reuse modules by opening multiple instances of KV STUDIO and copying the
modules between applications.
Module features
It's easy to understand the structure of an entire program 4
When you use the workspace of KV STUDIO, each module is displayed as a tree, so even individuals
Modules
who did not create the program can understand its entire structure at a glance.
Modules are
displayed as a
list.
Module E Module G
To prevent the contents of modules from being changed easily, you can set a password.
When you set a password, the module program cannot be displayed or edited without first entering the
password.
Use the "Module/macro properties" dialog box to set the password.
"Module Passwords" (page 4-109)
"Macro Passwords" (page 4-125)
Module Type
4 Modules are categorized under the following headings: "Every-scan execution type," "Initialize module,"
and "Standby module."
Modules
Use the KV STUDIO workspace to manage these different types of modules that you create. You can
also change the module type after you create modules.
These modules are executed from the first scan when operations start (when power is turned on and
when the mode is switched from PROG to RUN).
You can use the module instructions, module stop (MDSTOP) and module start (MDSTRT), to control
the execution status of the module during operation.
Operations when you use the module instructions are the same as the standby module operations.
"Standby module operation" (page 4-104)
Reference • If you use a module instruction but do not control the execution status, the module will
be executed during each scan.
• When you create a new project in KV STUDIO, one every-scan execution type module
with the same name as the project will be created automatically.
Initialize module
These modules are executed only during the first scan when operations start. Use these modules to
perform initializations such as the initial processing of devices and restoring the default settings of KV
Nano Series functions. Even if there are no initialize modules in the project, the KV Nano Series can
operate. Create these modules as necessary.
<Traditionally> <KV STUDIO>
Initial processing 1 Initial processing module
CR2008
CR2008
. . .
CR2008: This is turned ON for only one scan when operation starts.
By registering modules as initialize modules, you can reduce the scan time by the time that is required
to process the initialize module programs because these modules will not be executed from the second
scan.
4-102 - KV Nano Series(terminal block type) User’s Manual -
4-8 Modules
LADDER PROGRAMMING
• Some instructions cannot be used in initialize modules.
Point
"List of Unusable Instructions" (page A-32)
• You cannot use the module instructions (MDSTRT and MDSTOP) to control the
execution status of initialize modules.
• You cannot operate the KV Nano Series with only initialize modules. Be sure to
use these modules together with at least one every-scan execution type
module or standby module.
Standby module
4
Modules
These modules are stopped when operations start. You can use the module instructions (MDSTRT and
MDSTOP) to control the execution status of these modules during operation.
"Module instructions" (page 4-110)
Main
・・
Execution
starts R000
MDSTRT
Automatic
operation
Execution R000 MDSTOP
stops Automatic
operation
・・・
END
ENDH
You cannot operate the KV Nano Series with only standby modules. Be sure to
Point
use these modules together with at least one every-scan execution type module
or initialize module.
Reference You can control the execution status of every-scan execution type modules in the same
way.
4
Module A
Executing Executing Executing Executing Executing Executing
(every-scan
execution
type)
Modules
Module B Module B
Execution starts Execution stops
Reference The initial status of the differential execution instruction when the execution of a standby
module starts is ON when a rising edge is detected and OFF when a falling edge is
detected. For example, if this is turned ON from the first scan when execution starts,
rising edge differentials will not be detected.
Instruction Status
OUB Turned OFF.
OFDL
Reset.
SHOT
C The status is held.
CJ, NCJ, and GOTO Execution does not jump.
Reference The ladder program within the module operates the same as when the execution
condition of the MC instruction is turned OFF for just one scan before operations are
stopped.
For details, see the MC and MCR instructions in the KV-7000/5000/3000/1000 Series and KV
Nano Series "Instruction Reference Manuals."
LADDER PROGRAMMING
Module Execution Sequence
You can set the execution sequence within a scan of the modules registered in a project.
Normally, this is the order in which the modules are created. Only when the execution sequence within
a scan of the ladder programs has an effect on operations should you change the sequence.
From the workspace, open the "CPU system setting" dialog box, and then click "Program setting" and
then "Execute sequence of modules."
Modules
the order can be changed
2 HSPInit Initialize
The following rules apply to setting the execution sequence of modules within a scan.
• You can change the order of initialize modules, but you cannot switch the order of initialize modules
with those of other types of modules.
• You can change the order of every-scan execution type and standby modules, but you cannot move
these modules ahead of the initialize modules in the sequence.
[Legend]
4
Modules
Configuration by functions
Modules are created according to process details, connected devices, and expansion units.
Use the every-scan execution type and standby modules differently depending on the execution
conditions when operations start.
Stopping the unnecessary modules makes debugging easier and reduces scan time.
Module control*
* The execution status of each function is controlled by the "Project" module. Create the "Project" module if
necessary.
4-106 - KV Nano Series(terminal block type) User’s Manual -
4-8 Modules
Configuration by processes
LADDER PROGRAMMING
Modules are created according to processes and operations.
In this example, the modules to be executed when operations start are created as every-scan
execution type modules and all other modules are created as standby modules.
Process 1
Process 2 4
Modules
※
Error
Process 3
surveillance*
Process 5
Reference Because the module execution sequence is the execution sequence within a scan, there
is also no need to consider the module execution sequence when creating programs by
processes.
A module system device is a device that is used to capture the operation status of a module.
Only the bit that is turned ON during execution can be referenced by other modules and macros.
4 Reference KV STUDIO automatically assigns module system devices to the KV Nano Series work
area.
Modules
Bit that is turned ON for only one scan when module execution starts,
"@CR2008"
This bit is turned ON for only the first scan after module execution starts.
From the second scan, it is turned OFF.
This bit can only be referenced from its own module. It cannot be referenced from the macros executed
in its own module.
In KV STUDIO, this device is represented by "@CR2008."
Bit that is turned OFF for only one scan when module execution starts,
"@CR2007"
This bit is turned OFF for only the first scan after module execution starts.
From the second scan, it is turned ON.
This bit can only be referenced from its own module. It cannot be referenced from the macros executed
in its own module.
In KV STUDIO, this device is represented by "@CR2007."
Example
_AutoExec _main
LADDER PROGRAMMING
Module Passwords
Module passwords
You can limit who can display modules in KV STUDIO by setting passwords on the modules.
Follow the procedure below to set a password.
2 Right-click, and then click "Module/macro property" in the menu that is displayed.
4
Alternatively, click "Set password" in the menu that is displayed when you right-click a module
Modules
in the workspace.
Alternative procedure On the "File" menu, click "Module/macro property."
The "Module/macro property" dialog box is displayed.
4 Enter the password in both text boxes (the second is for confirmation), and then click "OK."
After you set the password, when an attempt is made to display the module in KV STUDIO, a dialog
box will be displayed asking the user to enter the password.
If the user does not enter the password, they will not be able to display the module in KV STUDIO.
Module instructions
Available Devices
Index
Ind Local Modify
Bit Devices Word Devices Const
Operand Spec Device
MR DM
R DR LR T C CTC CR TM T C CTH CTC Z CM #/$ #TM * @ :#/:Z
B W
S *1
- - - - - - - - - - - - - - - - - -
Operand Description
*1
S Specifies the module name
*1 You cannot use quotation marks, "#", and "$." Directly enter the module name that you used KV
STUDIO to set.
You can specify up to 24 half-width alphanumeric characters and up to 12 full-width alphanumeric
characters.
Operation Description
MDSTRT When the execution condition is turned ON, the module specified with S starts.
The specified module starts operating from the next scan.
If the specified module is already operating, nothing happens.
MDSTOP When the execution condition is turned ON, the module specified with S stops.
The specified module stops operating after the OFF processing of the next scan is
completed.
If the specified module has already stopped, nothing happens.
You can use this instruction to stop the instruction's own module.
See "Standby module operation" (page 4-104).
• The initial status of the differential execution instruction when the execution of a
Point
module starts is ON when a rising edge is detected and OFF when a falling edge
is detected. Differentials will not be detected immediately after execution starts.
• If multiple MDSTRT and MDSTOP instructions are executed in the same scan to
manipulate the same module, operation is performed according to the last such
module instruction to be executed.
• Do not stop all modules. If you stop all modules, all programs will not be
executed. In this situation, use one of the following methods to recover
operation. (You have to stop programs temporarily to recover operation.)
◆ Restart the KV Nano Series main unit.
◆ Use the RUN-PROG selector switch of the KV Nano Series main unit to switch to
• During OFF processing, the same processing as when the execution condition
of the MC instruction is turned OFF is performed for only one scan. For details
on the operations of the instructions, see the MC instruction.
• You cannot start and stop the execution of initialize modules.
Operation flags
LADDER PROGRAMMING
CR2009 No change in status
CR2010 No change in status
CR2011 No change in status
CR2012 No change in status
Sample Program
When a rising edge is detected on input relay R000, the module selected by the mode selector (R001 to
4
Modules
R003) is executed. When input relay R009 is turned ON, the execution of all modules stops. When a
module is being executed, you cannot start the execution of other modules.
R003 MDSTRT
Module3 When R001 is turned ON, "Module3" is executed.
R009 MDSTOP
Module1
MDSTOP
Module3
<Mnemonics list>
LDP R000
ANB _module1
ANB _module2
ANB _module3
MPS
AND R001
MDSTRT module1
MRD
AND R002
MDSTRT module2
MPP
AND R003
MDSTRT module3
LD R009
MDSTOP module1
MDSTOP module2
MDSTOP module3
*1 For details on the bit that is turned ON during module execution, see "Module System Devices"
(page 4-108).
Overview
A macro is a section of a ladder program that has been registered with a name so that it can be used
repeatedly in a project. By creating macros, you can use the sections of ladder programs in the same
way that ladder instructions are used, which enables you to reduce the amount of time you spend
writing programs. When you make changes to the program, just by modifying the data in the location
that is registered as a macro, all the process details executed when the corresponding macro
instruction is called in the project are changed. This reduces the amount of time that you spend
changing programs and also prevents mistakes that occur during program modifications.
4 <Before the introduction of macros> <After the introduction of macros>
Macros
Project 1 Project 1
[ModuleA] [ModuleA]
MacroC
[ModuleB]
Macro call
[ModuleB] instructions
MacroC
MacroC
Register the
same
[MacroC]
processing
as a macro.
Macro management
In KV STUDIO, the workspace is used to manage macros for each project.
Also, you can easily reuse programs by registering frequently used macros in the user macro library.
Workspace
Macro features
LADDER PROGRAMMING
Macros can be used as original instructions
If you register a ladder program segment that occurs multiple times in the program as a macro, you can
reduce the amount of time you spend writing programs and you can also reduce input mistakes.
As a result, the number of rungs in the ladder program decreases, which makes it easier to understand
the program structure.
You can assign any name to the macro that you want to register.
Macros
"Setting Arguments" (page 4-120)
Usage Procedure
LADDER PROGRAMMING
Macro Type
There are two types of macros: subroutine macros and self-hold macros.
Subroutine macros
Overview
Subroutine macros operate the same as subroutines in that the macro may only be executed when its
execution condition is turned ON. The program within the macro is executed each time that the macro
call instruction (MCALL) is executed. After the macro finishes executing, execution proceeds to the next
4
step after the macro call instruction. If the execution condition is turned OFF, the program within the
Macros
macro is not executed, and execution proceeds to the next step.
Usage method
To start a subroutine macro, use the MCALL instruction from a module.
Operation description
An explanation of the operation of subroutine macros is shown in the following figure.
In this example, macro A is called twice from within module 1.
Reference To differentiate between the objects of the created macro, "#(management number)" is
appended after the macro name.
In KV STUDIO, this is only displayed during monitoring and simulation.
Module1
Macro objects (MacroA#1 and MacroA#2) are created
separately by each MCALL instruction.
When the execution conditions of the MCALL
instruction are ON, execution leaves Module1, and
the macro is executed.
ON
MCALL MacroA
MacroA#1
OFF
MCALL MacroA
×
MacroA#2
In only the one scan in which execution conditions are turned OFF, subroutine macros are executed
with all execution conditions turned OFF.*
Operations are stopped in the following scan.
4
Macros
Execution condition
OFF ON ON OFF OFF
to call MacroA
Instruction Status
OUB Turned OFF.
OFDL
Reset.
SHOT
C The status is held.
CJ, NCJ, and GOTO Execution does not jump.
Reference When macro execution stops, the same processing as when the execution condition of
the MC instruction is turned OFF is performed for only one scan.
For details, see the MC and MCR instructions in the KV-7000/5000/3000/1000 Series and KV
Nano Series "Instruction Reference Manuals."
Self-hold macros
Overview
Self-hold macros operate the same as subroutine macros in that the macro may only be executed when
its execution condition is turned ON. The program within the macro is executed each time that the macro
call instruction (MSTRT) is executed. Once the macro has started, it is continually executed during
subsequent scans, regardless of the execution condition of the macro call instruction, until the macro
execution stop instruction (MEND) is called from within the macro.
Usage method
To start a self-hold macro, use the MSTRT instruction from a module.
Operation description
LADDER PROGRAMMING
An explanation of the operation of self-hold macros is shown in the following figure.
In this example, macro A is called twice from within module 1.
1 When the execution condition is turned ON, macro A starts.
Module1
ON
4
MSTRT MacroA
MacroA#1
Macros
MEND
ON
MSTRT MacroA
MacroA#2
MEND
Reference To differentiate between the objects of the created macro, "#(management number)" is
appended after the macro name.
In KV STUDIO, this is only displayed during monitoring and simulation.
2 Once the macro is started, it continues to be executed regardless of the status of the MSTRT
instruction's execution condition.
Module1
ON
MSTRT MacroA
MacroA#1
condition is OFF,
execution continues.
OFF
MSTRT MacroA
MacroA#2
MEND
3 When the execution condition of the MEND instruction in the macro is turned ON, all execution
LADDER PROGRAMMING
conditions will be turned OFF in the next scan, and the program in the macro is executed for
only one scan.*
Operations are stopped in the following scan.
Module1
When the execution condition of the MEND
instruction is turned ON, from the next scan,
macros are executed for only one scan with all
execution conditions turned OFF.
4 OFF
MSTRT MacroA
Macros
MacroA#1
ON MEND
OFF
MSTRT MacroA
MacroA#2
ON MEND
Instruction Status
OUB Turned OFF.
OFDL Reset.
SHOT
C The status is held.
CJ, NCJ, and GOTO Execution does not jump.
Reference When macro execution stops, the same processing as when the execution condition of
the MC instruction is turned OFF is performed for only one scan.
For details, see the MC and MCR instructions in the KV-7000/5000/3000/1000 Series and KV
Nano Series "Instruction Reference Manuals."
LADDER PROGRAMMING
In only the one scan after the macro stop instruction (MEND) was executed, self-hold macros are
executed with all execution conditions turned OFF. They will be stopped from the following scan.
[Image of the operation of a self-hold macro]
Execution condition
to call Macro A
OFF ON *1 *1 OFF*2 OFF*3
4
Macros
Execution condition of - OFF OFF ON *1 -
the MEND instruction
within Macro A
Executing with
Macro A Stopped Executing Executing Executing Stopped
conditions turned OFF
Setting Arguments
4 Module1
Macros
Argument 1 MOV
Argument 2 DM0
When the macro is called,
the specified devices and
values are used during
the execution of the R001 MOV
macro's ladder program. #50 DM0
Usage example
LADDER PROGRAMMING
A usage example of argument devices is shown in the following figure.
In this example, the macro call instruction of macro 1 is executed from module 1.
Macros
DM10000 to DM10021
Module1
@CR2008 MCALL Macro1 マクロ命令
Macro instruction
#1 MR000 #1000
Argument 1 Argument 2 Argument 3
DM0
Argument 4
UM0: DM10000
UR0: R1000
Call P0: MR000
V0: #1000
Module1 V1: #1234
R1000 R1001
UR0:#02 P0
SET
R1002 MR000
P0 MOV
#0 UM0:#4
MR000 DM10004
MOV
V1 UM0:#3
#1000
If you are using character strings as arguments, use argument device "P", and
Point
specify the leading device in which the character string is stored. You cannot use
argument device "V" to designate character strings directly.
A macro system device is a device that is used to capture the operation status of a macro.
Only the bit that is turned ON during execution can be referenced by other modules and macros.
4 Reference KV STUDIO automatically assigns macro system devices to the KV Nano Series internal
work area.
Macros
Bit that is turned ON for only one scan when macro execution starts, "@CR2008"
This bit is turned ON for only the first scan after macro execution starts.
From the second scan, it is turned OFF.
This bit can only be referenced from its own macro. It cannot be referenced from the module that called
this macro.
In KV STUDIO, this device is represented by "@CR2008."
Bit that is turned OFF for only one scan when macro execution starts,
"@CR2007"
This bit is turned OFF for only the first scan after macro execution starts.
From the second scan, it is turned ON.
This bit can only be referenced from its own macro. It cannot be referenced from the module that called
this macro.
In KV STUDIO, this device is represented by "@CR2007."
Example
_BatchSend_2 _ParamCalc_1
Reference To use this bit that is turned ON during macro execution, you need an ID number for each
macro that you want to call.
"Bit That Is Turned ON during Macro Execution" (page 4-123)
LADDER PROGRAMMING
Bit That Is Turned ON during Macro Execution
Overview
This bit is turned ON when the macro is being executed. Because this bit can be referenced from all
modules, it is useful in situations such as when you want to reference the bit before calling the macro to
control macro execution.
To use this bit that is turned ON during macro execution, you need an ID number for each macro that
you want to call.
In KV STUDIO, this device is represented by "_(macro name)_(ID number)."
4
Macros
How to set the bit that Is turned ON during execution
To use this bit that is turned ON during execution, select the "ID No.('in execution')" check box in the
"Instruction/macro/pack pallet" dialog box.
1 Select the "IdentNo. (execution bit)"check box in the "Instruction/macro/pack pallet" dialog box.
You cannot use this bit that is turned ON during macro execution if you do not
Point
select the "IdentNo. (execution bit)" check box.
To use the same macro repeatedly in the same project, change the number each time that you want to
use the macro.
If you specify the same number for different instances of the same macro, a
Point
conversion error will occur.
Usage example
LADDER PROGRAMMING
@DM0 #100
Macro4_1
MSTRT Macro4_2
4 @DM10 #1000
Macro4_2 Macro4_2
Macros
If you write the bit that is turned ON during execution of an unused macro (a
Point
macro that is not specified by a macro call instruction in the project), a
conversion error will occur.
Reference You can use macro call instructions that call a macro with an ID number together with
macro call instructions that call the same macro without an ID number.
@DM0 #100
@DM10 #1000
LADDER PROGRAMMING
Macro Passwords
Macro passwords
You can limit who can display macros in KV STUDIO by setting passwords on the macros.
Follow the procedure below to set a password.
2 Right-click, and then click "Module/macro property" in the menu that is displayed.
4
Alternative procedure On the "File" menu, click "Module/macro property."
Right-click a macro in the workspace, and then click "Set password" in the menu that is
Macros
displayed.
The "Module/macro property" dialog box is displayed.
4 Enter the password in both text boxes (the second is for confirmation), and then click "OK."
After you set the password, when an attempt is made to display the macro in KV STUDIO, a dialog box
will be displayed asking the user to enter the password.
If the user does not enter the password, they will not be able to display the macro in KV STUDIO.
Macro instructions
Available Devices
Index
Ind Local Modify
Bit Devices Word Devices*1 Const
Operand Spec Device
MR DM
R DR LR T C CTC CR TM T C CTH CTC Z CM #/$ #TM * @ :#/:Z
B W
S - - - - - - - - - - - - - - - - - -
Operand Description
S Specifies the macro name*1
*1 The number of operands (0 to 10) starting from the second operand and the attributes of these
operands vary according to the argument settings specified by the macro that will be executed.
The devices that you can use with the different attributes are shown below.
Available Devices
Index
Ind Local Modify
Bit Devices Word Devices Const Spec Device
Attribute
MR DM
R DR LR T C CTC CR TM T C CTH CTC Z CM #/$ #TM * @ :#/:Z
B W
Device - *4 *4 *4 *4 - - - - -
Value - - - - -
Unit - - - - - - - - - - - - - - *5 - - - -
*2 You cannot use quotation marks, "#", and "$." Directly enter the macro name that you used KV
STUDIO to set.
You can specify up to 12 half-width alphanumeric characters and up to 6 full-width alphanumeric
characters.
*3 When you are using ID numbers, the format becomes "(macro name)_(ID number)."Example)
"batch send_2"
For details on ID numbers, see "Bit That Is Turned ON during Macro Execution" (page 4-123).
*4 Timers and counters are handled differently according to the instructions that you use within the
macro.
Example) For the MOV instruction, the current value is processed. For details, see each
instruction.
*5 Specify the expansion unit number. If you are using the "Instruction/macro/pack pallet" dialog
box, specify the target expansion unit by selecting it from the list.
LADDER PROGRAMMING
Operation Description
MCALL While the execution condition is turned ON, the subroutine macro specified with S is
executed during each scan.
The specified macro starts executing from the scan in which the execution condition
changed from OFF to ON.
Off processing is performed in the scan in which the execution condition changes from
ON to OFF.
MSTRT While the execution condition is turned ON, the self-hold macro specified with S is
executed during each scan.
The specified macro starts executing from the scan in which the execution condition 4
changed from OFF to ON.
Macros
Once the macro is executed, it will continue to operate even when the execution condition
is turned OFF.
MEND When the execution condition is turned ON, the OFF processing of the self-hold macro in
which this MEND instruction is written will be performed in the subsequent scan, and the
macro will stop executing in the scan after OFF processing is performed.
Scan
ON
Execution condition
OFF
MEND Executing
• If you add, delete, or change the calling order of MCALL and MSTRT
Point instructions, you will not be able to write data during RUN mode.
• To stop the execution of self-hold macros, use the MEND instruction in the
macro.
While the execution condition of the MSTRT instruction is turned ON, the MEND
instruction will be ignored.
• You cannot write the MEND instruction in modules and in subroutine macros.
• You cannot use the MEND instruction to stop other macros.
• The previous status of differential execution instructions within a macro is
initialized each time that the macro starts executing (rising edge differential: ON
and falling edge differential: OFF).
• If the attribute of an MCALL or MSTRT instruction is a value operand, and if T,
C, CTH, or CTC is specified for this operand, the following values will be passed
to the macro.
T or C: Current value (32-bit data)
CTH: Current value (32-bit data)
CTC: Set value (32-bit data)
• If you write an MCALL or MSTRT instruction between the MC and MCR
instructions, when the MC instruction's execution condition is turned OFF
during macro execution, off processing will be performed during that scan, and
then operations will be stopped during the subsequent scan.
• If you write an MCALL or MSTRT instruction in a subroutine (between the SBN
and RET instructions), in a condition transfer (between the CJ or NCJ and
LABEL instructions), in a step (between the STP and STE instructions), or in an
interrupt (between the INT and RETI instructions), when the instructions
between these opening and closing instructions are not executed during macro
execution, the macro execution will be suspended. The next time that the
instructions between these opening and closing instructions are executed, the
macro execution will be restarted. In this situation, the previous status of
differential execution instructions in the macro will not be initialized. (If you
write these instructions in an initialize module, they will only be executed
during the first scan when operation starts.)
• If you write an MCALL or MSTRT instruction in a stage (between the STG and
JMP instructions), when the STG instruction's relay is turned OFF during macro
execution, for subroutine macros, the macro is executed for that scan with all
execution conditions within the macro turned OFF, and then the macro
execution stops in the subsequent scan. For self-hold macros, the macro
execution is suspended.
• If a macro is being executed when the module in which the MCALL or MSTRT
instruction is written stops, the macro's OFF processing is performed at the
same time as the module's OFF processing, and the macro execution stops in
the subsequent scan.
• During OFF processing, the same status as when the execution condition of the
devices with the OUT or OUB instruction in the macro, a duplicate coil will
occur.
Operation flags
Point The MEND instruction does not cause the operation flags to change.
MCALL While the execution condition is turned ON, this instruction is executed in each
scan.
Scan
ON
Execution condition
OFF
MSTRT While the execution condition is turned ON, this instruction is executed in each
scan.
MEND While the execution condition is turned ON, this instruction is executed in each
scan.
LADDER PROGRAMMING
Sample Program
While input relay R000 is turned ON, subroutine macro "MacroA" is executed with argument 1 set to
DM0 and argument 2 set to #10.
<Mnemonics list>
R000 MCALL MacroA LD R000
DM0 #10 MCALL MacroA DM0 #10
On the rising edge of input relay R001, self-hold macro "MacroB" starts executing with argument 1 (the
unit number) set to #1 and argument 2 set to #10.
4
Macros
<Mnemonics list>
R001 MSTRT MacroB LDP R001
↑ #1 #10 MSTRT MacroB #1 #10
When input relay R002 is turned ON, the execution of self-hold macro "MacroB" is stopped.
MacroB <Mnemonics list>
LD R002
・
・
MEND
・
・
R002 MEND
・
・・
・
The same as subroutine programs, call instructions are used to start macros. In this section we will
show a comparison of the macro and subroutine operations.
For details on subroutine programs, see "Subroutine programs" (page 4-72).
Object creation
4 Macro
The number of objects that will be created is equal to the total number of macro call instructions
(MCALL or MSTRT) that you write in a module.
Macros
Module1 MacroA#1
Call
MCALL MacroA
MacroA#2
Call
MCALL MacroA
Call MacroA#3
MCALL MacroA
Module2
MacroA#4
Call
MCALL MacroA
Reference • Macros that are registered in the project but that are not called (unused macros) are not
transferred to the KV Nano Series. Unused macros are not included in the targets to be
verified during project verification and during verification with the PLC.
• To differentiate between the objects of the created macro, "#(management number)" is
appended after the macro name. In KV STUDIO, this is only displayed during
monitoring and simulation.
Subroutine
LADDER PROGRAMMING
Subroutines are written between the END and ENDH instructions of a module or macro, and they are
executed by the subroutine call instruction (CALL) that is written in the main routine program of the
module or macro. Objects are not created each time that a call instruction is executed.
Module1 Module2
You can execute
#0 the subroutines of
CALL other modules by
using the ECALL
#0
CALL
instruction.
4
#0
Macros
CALL
END END
SBN SBN
#0
Call
× #0
RET RET
ENDH ENDH
Callable position
[Macro]
In a module, you can write macro call instructions anywhere in the main routine, in subroutines, and in
interrupt routines. You cannot write macro call instructions in macros.
[Subroutine]
Subroutine call instructions are only valid in the module or macro in which the subroutine is created. To
execute subroutines in other modules, use the inter-module subroutine call instruction.
Name
[Macro]
You can freely assign names to macros.
"List of Characters That Cannot Be Used" (page A-45)
[Subroutine]
Numbers are used to manage subroutines.
Arguments
LADDER PROGRAMMING
[Macro]
Macros have arguments.
[Subroutine]
Subroutines do not have arguments.
the program in the macro turned OFF. For example, the devices written with the OUT instruction are
automatically turned OFF.
"Macro Type" (page 4-115)
[Subroutine]
The program in the subroutine is not executed. The written devices retain their status from the last time
the subroutine was executed.
[Subroutine]
The same as macros, except that the operation is only performed when execution starts for the first
time. When execution starts for the second time and later, the status is set to that of the previous
execution.
Operation when the program is called between the MC (master control) and MCR
(master control reset) instructions
• When the MC instruction's execution condition is turned ON
Macros and subroutines operate normally.
[Subroutine]
Subroutines are not executed.
Applications
LADDER PROGRAMMING
When you want to retain the status and values of the devices that you are using in the locations that
programs are called
[Macro] ...........Better
Because separate objects are created for each call instruction, if you use macros together with local
devices, you can retain the status from the previous execution without having to consider problems
such as device conflicts.
[Subroutine] ....Good
Because the same program is executed, you have to use indirect specification or a similar method to
4
Macros
create a program that stores and restores the status of the devices that you are using.
[Subroutine] ....Good
You have to write the program so that the execution condition is not turned OFF until the operations are
finished.
Also, when you want to execute multiple instances of this type of processing at the same time, you
have to write the program while considering device conflicts and the various operation statuses.
[Subroutine] ....Better
Because the number of objects created remains the same no matter how many times the subroutine is
called, the more times the subroutine is called, the more you can reduce the number of steps.
Therefore, it was necessary for the user to manage all devices used in the program.
In KV STUDIO, for each module or macro, local devices can be processed as separate devices. Even if
you use a local device with the same number in a different module or macro, because it will be
processed as a separate device, you can easily manage the assignments of devices that are used only
within the module or macro.
In contrast with the local devices that are valid only within a module or macro, devices that are shared
within the entire project are called global devices.
ModuleA
Local
Program
devices
ModuleB
Program (Global)
Devices Local (Global)
Program
devices Devices
MacroC
Program Local
devices
Example
Global devices Local devices
DM0 @DM0
MR0 @MR0
You have to write this as "@device number" only when you want to specify the
Point
device number as the operand of a timer or counter instruction.
Mnemonic input example: TMR @0 #100
LADDER PROGRAMMING
List of Local Devices
The number of local and global devices that are reserved when you create a project and the default
ranges of these devices are shown below. To change the reserved number of local devices, from the
workspace, open the "CPU system setting" dialog box, and then click "Entire assignment setting of local
devices."
Local Device Global Device
Reserved Number of Total Number of
Device Name*1 Number of Devices
Devices in the Entire
Project*2
and Range
Devices
4
9600 (600 channels) 9600
Local Devices
Relay (R)*3 None
R000 to R59915 (600 channels)
1600 8000 (500 channels) 9600
Internal auxiliary relay (MR)*3
(100 channels) MR000 to MR49915 (600 channels)
320 3560 (180 channels) 3200
Latch relay (LR)*3
(20 channels) LR000 to LR17915 (200 channels)
412
Timer (T)*4 100 512
T0 to T411
206
Counter (C)*4 50 256
C0 to C205
27768
Data memory (DM) 5000 32768
DM0 to DM27767
512
Temporary data memory (TM) None 512
TM000 to TM511
*1 Link relays (B), link registers (W), high-speed counters (CTH), high-speed counter comparators
(CTC), control relays (CR), control memory entries (CM), and index registers (Z) cannot be used
as local devices.
*2 When you create a new project, ensure that the area is large enough for all the devices that can
be used as local devices. (To calculate the area, assume that 10 modules will be used and that
there will be 50 macro calls.)
You can freely change the number of reserved devices.
*3 Set the number of devices used in units of channels (ch).
*4 You have to write this as "@device number" only when you want to specify the device number as
the operand of a timer or counter instruction. Mnemonic input example: TMR @0 #100
• If you are using relays (R) and temporary memory entries (TM) as local devices,
Point
you have to set the number of devices that you will use.
• The following devices must be processed as global devices.
• KV Nano Series I/O relays
• Devices assigned to expansion units
• Devices that are referenced by connected peripherals such as touch panels
• Devices that are common to the entire project
• Devices that have to transfer data between modules
• The first local device is number 0. Use local devices with as small numbers as
possible.
• Because R devices are assigned to expansion units, an area that is used as
global devices is required. For local devices, use MR devices with a higher
priority.
• If you use a local device or global device outside of the usable range, a
conversion error will occur.
• When you are using instructions in which you specify the leading device in the
operands, index modification, and indirect specification, do not exceed the
usable range of local and global devices.
During conversion, local devices are automatically assigned to the reserved areas that have been
prepared for the different device types in advance.
Device area
Leading device
Project 1
4 ModuleA
Global devices
Local of Project 1
Program
Local Devices
devices
Convert
ModuleB
Global
devices Local Local devices of
Program
devices ModuleA
Convert
Local devices
MacroC
of ModuleB
Local Reserved area of
Program Convert local devices
devices Local devices
of MacroC
Not used
Last device
For macros, the number of local devices assigned corresponds directly to the
Point
number of times that the macro is called in the project.
Reference Just like global devices, you can assign device comments to local devices.
LADDER PROGRAMMING
The number of local devices that are reserved for usage in a project is set in advance, but you can
change the number of devices used per type of device. The changes that you make are saved in KV
STUDIO, so there is no need to make the same changes each time that you create a new project.
From the workspace, open the "CPU system setting" dialog box, and then click "Entire assignment
setting of local devices."
Local Devices
Configuring device settings for modules and macros
You can set the number of reserved local devices for usage in each module or macro, and you can
make this setting for each type of device. The default setting is "Auto." With this setting, the number of
local devices used in a module or macro is set automatically, so there is normally no need to consider
the number of local devices.
From the workspace, open the "CPU system setting" dialog box, and then click "Set module/macro type
device."
Typical examples of errors occuring during ladder conversion are shown below.
An attempt is made to use as a global device the device area that has been reserved for local
devices.
•Check the "Global device range" settings on the "Entire assignment setting of local devices" screen.
Leading device Last device
Entire assignment Global devices Reserved area of local devices
An attempt is made to use a local device that has been assigned outside of the range for local
devices.
This error can only occur when you configure settings manually.
Check the settings on the "Set module/macro type device" screen.
Example
@DM0 @DM1999
Assigned separately to modules and macros
Setting range @DM3000
LADDER PROGRAMMING
Check the settings under "Display local assignment" on the "Entire assignment setting of local
devices" screen. See if there are devices whose settings, such as the number of devices used, are
displayed in red. Configure the settings—by increasing the reserved number of applicable devices
or by decreasing the number of local devices set for each module and macro—so that the number
of devices that can be used (the number of reserved local devices) is greater than the number of
devices used.
Insufficient number of
Leading device Last device
reserved devices
Entire assignment Global devices Reserved area of local devices
4
Number of local devices used
Local Devices
Module 1 Module 3
Module 2 Module 4
The procedure from KV Nano Series installation to operation is shown in the figure below.
4
Push-button switch PB2:OFF PB2 is a b contact switch
Lit status of pilot lamp PB1 PB2
Push-button switch PB1:OFF
(PL) is maintained
Operation details Push-button switch PB2:OFF
even if PB1 is turned OFF.
consideration
Programming Skills
Timing chart RL
ON
PB1 contact
OFF
ON
PB2 contact
OFF
ON PL
PL
OFF
Unit Configuration
When there are many pieces of I/O equipment used in control and
when you are using expansion functions, consider using extension
expansion units.
LADDER PROGRAMMING
Programs are converted when they are transmitted to a PLC for
monitoring and when you switch to the simulator. If a conversion error
occurs, remove the cause of the error while referring to the output
window.
Program "Conversion" (page 4-168)
"4-10 Local Device Input and Errors during Conversion" (page 4-
conversion
138)
"Appendix 1 Error Message Lists" in the "KV STUDIO User's
Manual"
"Key Points to Program Creation" (page 4-159)
4
Programming Skills
Program
Change and add programs.
changes
"Creating Clear, Legible Programs" (page 4-154)
and "Online editing" (page 4-171)
additions "Writing data during RUN mode" (page 4-169)
Use the useful monitor and simulator functions to debug the program.
Monitor "Monitor" (page 4-170)
Monitor and Simulator "Simulator" (page 4-172)
simulator
Completion
This section will explain some convenient functions that can reduce your entry and modification
workload during ladder program creation.
Mnemonic entry
When you perform mnemonic entry, you can enter instructions without using a mouse, so you can
4 create programs in less time than is required if you use the "Instruction/macro/pack pallet" dialog box.
Programming Skills
Entry mode
Use the keyboard to enter the first character of the instruction.
(Example) Entering the MOV instruction
Reference On the "Tool" menu, click "Option," click the "Setup edit/key" tab, and then select the
"Zoom out direct entry dialog box" check box to minimize the display of the "mnemonic
direct entry" dialog box.
For details on the instructions, see the KV-7000/5000/3000/1000 Series and KV Nano Series
"Instruction Reference Manuals."
LADDER PROGRAMMING
Reference • You can omit the target devices and values that are specified by the instruction and
operands when you enter the instruction.
(Example) A 0 LD R000
"App-6 List of Abbreviated Mnemonics" (page A-33)
• To use the "mnemonic direct entry" dialog box to edit cells that have already been
entered, press Esc or F2 . (If you click "Option" on the "Tool" menu, click the
"Setup edit/key" tab, and then select the "Start up direct entry by Enter key" check box,
the Enter key will be assigned to the "mnemonic direct entry" dialog box.)
Entry assistance 4
Programming Skills
There are several functions that can assist you in entering instructions when you are using mnemonic
entry.
Shortcut keys
LADDER PROGRAMMING
If you use shortcut keys, you can perform operations with just the keyboard and without using a mouse.
Also, because this reduces the number of keystrokes, it also reduces the amount of time spent entering
data.
This section will explain typical shortcut keys.
"App-7 List of Shortcut Keys" (page A-35)
The "mnemonic direct entry" dialog box is displayed, and you can use it to directly enter and edit
mnemonics.
Enter
Ctrl + M
If a cell with an existing entry has been selected, the "Operand" dialog box described above is
displayed, and you can edit the comment.
+ X / C / V
LADDER PROGRAMMING
Ctrl
Ctrl + Shift + V
Set the number of items to paste to paste multiple times.
In addition, you can offset the included devices. 4
See in "5-1 About Edit Functions - Multiple Paste" in the "KV STUDIO User's Manual."
Programming Skills
Ctrl + Z / Y
These are standard editing shortcut keys for Windows applications.
Ctrl + Z Undo
Ctrl + Y Redo
Ctrl + /
Move the cursor in units of ladder circuit blocks.
Ctrl +
Select the entire line in which the selected cell resides.
Ctrl + Shift + /
Change the operand number of the selected cell.
Insertion
LADDER PROGRAMMING
Insert
4 Shift + Delete
Delete a rung.
Programming Skills
Ctrl + Enter
Insert rung comments.
"Rung comments" (page 4-156)
Draw a connecting line from the selected cell to the end of the line.
Alt + / / /
If there is no connecting line in the direction of the arrow key, draw a connecting line in this direction.
If there is a connecting line in the direction of the arrow key, delete this connecting line.
Ctrl + F
The "Device search" tab of the "Search/replace" dialog box is displayed.
"Search and replace" (page 4-148)
Ctrl + H
The "Device replace" tab of the "Search/replace" dialog box is displayed.
Space
View
LADDER PROGRAMMING
Ctrl + F7
Ctrl + E
The "Device use list" window is displayed.
You can use this to easily check the unused devices.
See "6-2 About View Functions - Device Use List" in the "KV STUDIO User's Manual."
4
Programming Skills
Page
Ctrl + Up / Ctrl + Page
Down
Ctrl + Space
Shows and hides comments in the ladder editor.
You can search for instructions and operands that match the specified conditions. You can also display
the items that match the search conditions as a list in the output window.
When searching for devices, use the cross reference function. You can display this list just by pressing
the space bar.
"Cross references" (page 4-148)
• Ctrl + F
You can set the target to "Device," "Constant," "Module/macro," "Device Comment," "Label," or
"Reserve/Disable."
Cross references
The search result list of the specified device is displayed in the output window.
1 Select the device (ladder symbol) whose cross references you want to create.
3 Double-click the item that you want to check in the search result list.
LADDER PROGRAMMING
When you double-click a device that is displayed in the list, the cursor moves to the corresponding
device (symbol) on the ladder.
Alternative procedure • F3
• Shift + F3
Programming Skills
4 When you want to move the cursor focus to the next item, press F3 .
Window menu
LADDER PROGRAMMING
Using the Window menu can help you improve your program creation efficiency.
This section will explain "Tile" and "Split," which are commands in the Window menu.
Tile
This function is useful when you want to create or debug multiple modules and macros at the same
time.
4 On the "Window" menu, click "Tile."
The currently open modules and macros are displayed in a tiled format on the screen.
Programming Skills
Reference You can copy and paste parts of ladder programs between modules and macros.
Split
You cannot display a program in its entirety if the program is too long.
You can use the "Split" function to split the display of a program into two, so that you can view two parts
of the program at the same time.
LADDER PROGRAMMING
A separating
line is displayed.
Use the mouse
4
to determine
the split position.
Programming Skills
2 Click to fix the split position.
[Split screen]
After you
determine
the split position,
you can freely
change
the height.
When you determine the split position, the upper and lower screens both display the start of the
program by default.
Use the scroll bars on the right side of the upper and lower screens to display the desired program
positions.
Alternative procedure If you move the mouse cursor to the position shown in the following figure, the mouse
cursor will change to " ," and you can drag the cursor to start splitting the program
display.
Release the mouse cursor at the position that you want to fix the split.
Reference • You can copy and paste parts of the ladder program between the upper and lower
screens.
• You can also set the display sizes of the screens independently.
- KV Nano Series(terminal block type) User’s Manual - 4-151
4-11 Programming Skills
Label
LADDER PROGRAMMING
By managing devices that correspond to the labels in which you have added conditions, you can write
programs using labels instead of device names. KV STUDIO automatically assigns local labels to the
internal work area, so you can write programs without considering devices.
Reference Even if you add local labels, you will not be able to write to them during RUN mode.
Entry mode
1 2 3 4
You can use the labels of the devices that have been registered in the "Label edit" window to create
ladder programs.
(Example)
Automatic Automatic
operation operation
starts in progress R000 R500
MOV MOV
Automatic
#1000 operation speed #1000 DM0
Display method
LADDER PROGRAMMING
After you set labels, on the "View" menu, click "Displaying Labels" to show and hide the global labels.
Alternative procedure Ctrl + space
Back
Programming Skills
1
The default setting is Auto (the check boxes are selected). With this setting, local work areas are
assigned automatically according to local label settings and the content of KV scripts, so there is
normally no need to consider the number of local work areas.
Reference • You can display the items that local labels are assigned to during monitoring. When the
data format is bit, this is displayed as "VB." When the data format is word, this is
displayed as "VM." For timers and counters, this is displayed as the devices in the local
device usage area.
"Displaying the assignment destinations of local devices and local labels" (page 4-175)
• If a conversion error occurs when you execute a program that performs character string
processing using KV scripts, increase the number of work areas for script character
strings.
- KV Nano Series(terminal block type) User’s Manual - 4-153
4-11 Programming Skills
LADDER PROGRAMMING
Device comments
person other than the program's creator views the program. Device comments can be used on both
global devices and local devices. When bit processing is being performed on a word device, you can
use device comments in units of bits.
R4000
Entry mode
LADDER PROGRAMMING
The following two methods are available for entering device comments.
• Enter the comments in the "Operand" dialog box ( Ctrl + M ).
• Enter the comments in the "Device comment edit" window.
Reference It is useful to write programs with the "Device comment edit" window displayed, because
you can enter instructions while viewing the device comments. You can display up to three
of these windows at the same time.
4
Programming Skills
Display method
After you set device comments, on the "View" menu, click "Display cmnts" to show and hide the device
comments on the ladder editor.
Alternative procedure Ctrl + Space
Rung comments
LADDER PROGRAMMING
You can write comments on every rung in the ladder editing window.
Rung comments make it easy to understand the contents of each circuit block at a glance during
program editing.
Also, you can display just rung comments in a list and move to the rung of a specific rung comment.
Circuit
4 block
description
Programming Skills
Entry mode
Follow the procedure below to enter rung comments.
1 In the ladder editing window, position the cursor on the rung in which you want to enter a rung
comment.
2 Right-click, and then click "Insert rung comment" in the menu that is displayed.
Alternative procedure • On the "Edit" menu, click "Insert," and then "Rung cmnt."
• Ctrl + Enter
The rung comment editor is displayed as shown below. Enter the rung comment.
LADDER PROGRAMMING
Display the rung comments in the ladder editing window as a list. You can move to the rung whose
comment you select from this list.
Follow the procedure below to search for rung comments.
Alternative procedure Ctrl + L
Programming Skills
The "Search/replace" dialog box is displayed.
4 Double-click the rung comment whose rung you want to jump to.
LADDER PROGRAMMING
The rung of the selected rung comment will be displayed in the ladder editing window.
4
Double-click
Programming Skills
KV script
Write calculations, character string processing, and other parts that are tedious to write in ladder
programs as KV script.
Ladder program
The ladder program contains multiple
rungs, so the program flow is hard to
understand.
When you have to use simple
calculations such as addition,
subtraction, multiplication, and division
as well as when you have to use
specialized instructions, it is hard to
understand the program with just
comments assigned to each circuit block.
KV script
For details, see the KV-7000/5000/3000/1000 Series and KV Nano Series "Script Programming Manuals."
4-158 - KV Nano Series(terminal block type) User’s Manual -
4-11 Programming Skills
Program organization
LADDER PROGRAMMING
To create programs that are easy to debug and reuse, write programs in modules (components) for
each function and process, and assign easily understandable names to these modules. Also, extract
frequently used ladder circuit blocks to macros (original instructions), and assign to these macros easy-
to-remember names that can be entered concisely like the instructions.
"4-8 Modules" (page 4-100)
"4-9 Macros" (page 4-112)
Device defaults 4
Programming Skills
Use the "Setup defaults device" dialog box to manage the programs in which initializing the devices is
tedious when done by writing all the initializations in the ladder program. When operations start, the
registered values are all written automatically.
Click "device default" in the workspace.
This section explains the information and precautions that you should understand to create ladder
programs.
In KV STUDIO, you can switch between expanded ladder input mode and normal ladder input mode.
Follow the procedure below to switch between the modes.
Reference • When the expanded ladder mode is enabled, "Expanded ladder mode" on the menu is
displayed with a check mark, and the icon is displayed with a frame surrounding it.
• When you select expanded ladder mode, the cursor does not automatically move to the
right side of the rung when you enter an output instruction, and you can continue
entering instructions on the same rung. When you are in normal ladder mode, the
cursor automatically moves to the right side of the rung when you enter an output
instruction.
• In the default settings, expanded ladder mode is disabled.
As shown below, ladder programs are executed from left to right and from top to bottom.
(3)
R002
(5) (6)
R003 MOV
#1000 DM0
LD R000................................... (1)
ANB R001................................... (2)
OR R002................................... (3)
OUT R500................................... (4)
LD R003................................... (5)
MOV #1000 DM0......................... (6)
• To set the module execution sequence, in KV STUDIO, open the "CPU system setting"
dialog box, and then click "Execute sequence of modules."
"4-8 Module Execution Sequence" (page 4-105)
LADDER PROGRAMMING
Typical patterns that cause conversion errors are shown below.
Programming Skills
Reference The ladder program to
the right is unconnected, A B
so a conversion error will
occur. C
R500
Internal
You cannot write instructions such as those for R500 auxiliary relay R500
output coils, timers, and counters directly from
the rail.
If execution conditions are not required, insert
the b contact of an unused internal auxiliary #10 CR2002 #10
relay or control relay CR2002 (the contact that is T0 T0
always turned ON) as a dummy.
(Incorrect) (Correct)
A B D R500 E
R500
4
A B C
Programming Skills
D R501
Reference When you use KV STUDIO to create a new module or macro, the "END" or "ENDH"
instruction is automatically inserted. Write the "END" or "ENDH" instruction in a ladder
program. If you write these in a script, the program may not operate correctly.
LADDER PROGRAMMING
Non-convertible ladders Convertible ladders
C
4
Programming Skills
In the circuit shown in the figure to the right, A R1000 A R1000 R500
R500 will not be output.
By rewriting the circuit, the output can be
generated for only one scan.
C E R500 C E
F F E
E R501 C E R501
Duplicate coil
LADDER PROGRAMMING
If you use two or more of the same OUT or OUB instruction for the same device within a project, the
last instruction to be executed within a scan is given priority, and the other instructions are ignored.
If the instructions are on separate rungs or exist in different modules or macros, they are processed as
shown below.
(Example) As shown in the figure below, when the R500 output instruction is used twice
・・・
R003 R500 R003 R1001
・・・
R1000 R500
A conversion error will not occur for duplicate coils, but do not use them because they make operations
complicated.
To check whether duplicate coils exists, in KV STUDIO, on the "Convert" menu, click "Duplicate coil
check."
If you call the same macro two or more times, a duplicate coil will occur if an OUT
Point
or OUB instruction that uses a global device is present in the macro.
LADDER PROGRAMMING
If you make two or more calls to a macro in which an OUT or OUB instruction that uses a global device
is present, a duplicate coil will occur. You can avoid these duplicate coils by performing processing as
shown below.
(1) Set the operand of the OUT or OUB instruction in the macro to argument P.
(2) Use the argument added by (1) that you specify by the macro call instruction to specify a different
4
internal auxiliary relay per call.
Programming Skills
MCALL MacroA MCALL MacroA
DM0 DM0 R1000
・・・
・・・
P1
P1
(3) Add the ladder program to generate using logical OR outside of the macro.
R1000 R500
R1001
Interlock
In programs, when one party acts, another party cannot act to prevent simultaneous actions by both
parties. This exclusive processing composition mode is called interlock.
Although this is often necessary for actual equipment, its operations are very complicated to explain, so
it is omitted from the sample programs introduced in the KV-7000/5000/3000/1000 Series and KV
Nano Series "Instruction Reference Manuals."
(Example) A circuit that prevents R500 and R501 from being turned ON at the same time
If you use the bit that is turned ON during module or macro execution, you can easily create an
interlock circuit.
"Bit That Is Turned ON during Macro Execution" (page 4-123)
"Macro System Devices" (page 4-122)
When the scan time becomes long, the update period of I/O and values becomes long, so the response
of the machines and equipment worsens. Also, if the scan time exceeds 300 ms, a "Scan time over
error" (CPU error number 30) will occur, and it will not be possible to continue operations.
You can reduce the scan time by using the following methods.
4 instructions (MDSTRT and MDSTOP) to only execute the modules when necessary.
"Module instructions" (page 4-110)
Programming Skills
Reference The same concept holds when you use the CJ or GOTO instructions to create programs
with looped processing.
Specifying devices with even numbers to 32-bit and 64-bit processing operands
Use even-numbered devices to specify 16-bit word devices such as DM, W, and TM for the operands of
instructions that process 32-bit or 64-bit data such as those with the .D, .L, .F, or .DF suffix. If you use
two words from an odd number, the processing speed will decrease.
Reference In the same manner, for DM and TM, use even numbers for local devices. During
conversion, even-numbered local devices are always assigned to even-numbered global
devices, and odd-numbered local devices are assigned to odd-numbered global devices.
Therefore, more device areas than those assigned to the module or macro may be used.
• Because R and DM devices are assigned to expansion units, an area that is used as global devices is
LADDER PROGRAMMING
required. Give priority to MR and LR when using local devices.
"4-10 Local Devices" (page 4-134)
For details on local labels, see "Label" (page 4-152).
<Index modification>
4
Better The specification method is simple.
Programming Skills
Good You cannot change the type of devices that are specified.
Good You cannot use index register Z as a local device.
You can use the "ZPOP" and "ZPUSH" instructions without considering how many
index registers you can use.
<Indirect specification>
Better You can change the type of devices that are specified.
Good The specification method is complicated (to process addresses, you have to use
dedicated instructions).
Unless you want to change the device type, we recommend that you use index modification, which is
easier to handle.
"Modification according to index registers" (page 4-41)
Conversion
LADDER PROGRAMMING
Before you use the monitor or simulator, you have to convert the ladder program that you have created
to a format that can be processed by the KV Nano Series.
4 • Ctrl + F9
Programming Skills
Reference • On the "Monitor/Simulator" menu, click "PLC transfer monitor mode" to automatically
convert and transfer the data and to start the monitor.
• On the "Monitor/Simulator" menu, click "Simulator" to automatically convert the data
and start the simulator.
Reference On the "Convert" menu, click "Convert individual modules/macros" to convert module and
macro data separately. Use this function in situations such as when there are many errors
and when it is difficult to determine the cause of an error.
Transfer
On the "Monitor/Simulator" menu, click "Transfer to PLC" to transfer the converted ladder program to
the KV Nano Series.
LADDER PROGRAMMING
With the default settings, the modules and macros stored on the PLC will not be
Point
deleted when you transfer a program. To delete unused modules when you
transfer programs, select the "Clear module/macro in PLC" check box in the
"Transfer program" dialog box.
Reference On the "Monitor/Simulator" menu, click "PLC transfer monitor mode" to automatically
convert and transfer the data and to start the monitor.
Programming Skills
program.
This function enables you to overwrite the executing ladder program when the KV Nano Series is in the
RUN state. You can make fine operation adjustments and parameter changes without stopping the
device and the production line.
Writing data during RUN mode extends the scan time by a maximum of 2 ms. (So long as there are less
than 5000 changes to timer and counter instructions.)
4 Point
• When data finishes being written during RUN mode, even if the execution
condition ON/OFF state changes, differential instructions within the range of
Programming Skills
Monitor
The monitor is used to transfer the ladder program that you have created with the ladder editor to the
KV Nano Series, execute the program, and view the operating status.
On the "Monitor/Simulator" menu, click "PLC transfer monitor mode" to start the monitor. Before you
carry out this process, connect the KV Nano Series and the PC, and configure both devices so that they
can communicate with each other.
• Ctrl + F8
Reference The current status (such as monitor, online editing, or editor) is displayed in the KV
STUDIO title bar.
For details on the different functions, see "Chapter 9 MONITOR & SIMULATOR" in the "KV
STUDIO User's Manual."
Online editing
LADDER PROGRAMMING
You can use the online editing function to change ladder programs directly from the KV STUDIO
monitor screen. This function is useful when you want to make on-site adjustments during the final
debugging of program creation and when you want to change simple programs.
While you are monitoring, on the "Monitor/Simulator" menu, click "Start Online Edit" to start online
editing.
The location being edited is displayed in light blue, which enables you to see which cell is being edited
at a glance.
When the program finishes being transferred, the light blue of the location being edited returns to the
4
original background color.
Programming Skills
Alternative procedure • Select "Online edit" from the mode list.
• Click .
• F10
If the online editing function is used while the PLC is in the RUN state, incorrect
operations may cause serious damage to equipment and serious injury to
workers. Thoroughly check the following precautions to ensure correct use of
this function.
• Thoroughly check the area around the equipment, and ensure that no damage
to equipment and injury to workers will arise even if problems occur when you
CAUTION use the function.
• Do not add circuits that operate immediately after the program is transferred
(such as circuits whose execution condition is the B contact). Doing so may
cause the equipment to run out of control.
• If you delete output instructions that have been turned ON (such as OUT) and
then transfer the program, the output will be retained as being turned ON.
Reference When you transfer data during online editing, only the changed circuit blocks are written
to the PLC. However, changed modules and macros are written in their entirety in the
following situations.
• When several modules have been changed.
• When scripts have been edited so that the local work area is exceeded.
• When local labels have been added so that the local work area is exceeded.
• When the program inside of a macro has been edited (the macro is transferred in its
entirety).
• When the number of individual local device assignments has been changed.
• When a macro call has been added.
• When the ENDH instruction has been edited.
For limitations and precautions of writing data during RUN mode, see "Writing data during RUN
mode" (page 4-169).
For details on the online editing function, see "9-9 Online Edit" in the "KV STUDIO User's Manual."
Simulator
LADDER PROGRAMMING
The simulator simulates on a PC without connecting the PLC the operation of the ladder programs that
you have created with the ladder editor.
You can use the simulator to:
• View the operating status of the program by using the ladder monitor, registration monitor (time
chart), and batch monitor.
• Perform simulations with various execution methods such as continuous scan/continuous step and
continuous step.
• Easily change the set values and current values of timers, counters, and devices.
• Register forced sets and resets of contacts.
On the "Monitor/Simulator" menu, click "Simulator" to start the simulator.
• Click .
• Ctrl + F2
Reference The current status (such as simulator, monitor, or editor) is displayed in the KV STUDIO
title bar.
For details on the different functions, see "9-11 Simulator - Executing Simulator" in the "KV
STUDIO User's Manual."
For details, see "9-11 Simulator - Simulator Restrictions" in the "KV STUDIO User's Manual."
Reference There may be variations in the numeric values of timers because of the performance of
your PC.
Monitor functions
LADDER PROGRAMMING
This section explains the functions that are useful when using the monitor and simulator to debug
efficiently.
For details on how to operate each function, see the "KV STUDIO User's Manual."
Programming Skills
Alternative procedure Select the cell whose bit device status you want to change, and then press Space .
During monitoring, the contacts and external I/O relays of timers and counters
Point
cannot be turned ON and OFF.
Reference To force an external I/O relay to turn ON or OFF during monitoring, on the "Debug" menu,
click "Forced set/reset register" or "Inhibit input refresh."
The "Correct device value" window is displayed. If you select multiple cells and then press F2 , all the
devices contained within the selected range are displayed.
You can change the values by entering values in the "Current value" column.
Reference If you select an instruction in which index modification or indirect specification is being
used, the referenced device is displayed.
To register a device in the Register monitor or Batch monitor, select the instruction that includes the
device you want to monitor. Move the cursor to the edge of the cell until it becomes a " ," and then
drag the cell to the "Register monitor" dialog box.
4
Programming Skills
Reference • If you select multiple cells and drag them all to the dialog box, all the devices contained
within the selected range will be registered.
• You can also enter devices directly in the "Register monitor" dialog box.
Watch window
This function is used to automatically monitor all the devices that are contained within the circuit block
of the selected cell.
To show and hide this window, on the "Monitor/Simulator" menu, click "Hide/show monitoring window."
LADDER PROGRAMMING
In the monitor or simulator, you can display the local devices and local labels in the ladder program that
you have created as the assignment destination devices that are assigned at the time of conversion.
On the "Tool" menu, click "Option" to display the "Setup option" dialog box. On the "Set display mode"
tab, select the "Display local assign devs during mon" check box.
Programming Skills
Select this check box.
In the workspace, right-click "KV Nano Series," and then click "Built-in function monitor" in the menu
that appears to display the "Built-in function monitor selection" dialog box. Select the functions that you
want to monitor, and then click "Display" to display a built-in function monitor for each function.
4
Programming Skills
When using the simulator, there are limits on the operation of some functions and
Point
devices.
For details, see "9-10 Simulator - Simulator Restrictions" in the "KV STUDIO
User's Manual."
Monitoring instructions
You can monitor the devices used in the PIDAT instructions that are written in the ladder program.
Right-click a PIDAT instruction, and on the menu that appears, click "Command monitor" and then
"PIDAT."
This is useful when monitoring measured values, set values, and other parameters that are used with
PIDs.
Alternative procedure On the "Monitor/Simulator" menu, click "Command monitor," and then "PIDAT."
For details, see "Command monitor" in the "KV STUDIO User's Manual."
LADDER PROGRAMMING
programs (Performance monitor)
You can monitor the execution time of the module, macro, or interrupt program that is currently being
executed.
Programming Skills
Monitoring expansion units
In the workspace, right-click an expansion unit, and then click "Unit Monitor" in the menu that appears
to display the unit monitor.
Alternative procedure • On the "View" menu, click "Unit Monitor."
• When you are monitoring from the Unit Editor, you can display the unit monitor by
right-clicking a unit and clicking the appropriate menu item in the menu that appears.
(Example) KV-N3AM
Point This cannot be displayed when you are using the simulator.
MEMO
LADDER PROGRAMMING
4
Programming Skills
Built-In I/O
Motor control of multiple axes Using rotation positioning to control
• "Motor (Positioning) Control" (page 5-4) output
• "High-Speed Counter" (page 5-98) • "Cam Switch"
(page 5-163)
5 Reset switch,
stop sensor, etc.
Y1 axis
Overview of Built-In Functions
Built-In Tracing
Function
Temperature 5
controller
Reference The positioning function cannot be used with relay output type base units.
You can use the built-in positioning function of the KV Nano Series to perform the following operations.
Positioning control while changing the target coordinate by the ladder program
"Reference example of specifying the point parameters directly and starting the positioning operation"
(page 5-87)
After you configure settings such as the target coordinate (number of pulses), the starting speed, the
operating speed, and the deceleration rate, positioning control is performed using a trapezoidal time
chart such as the one shown below.
Frequency (Hz)
Acceleration rate
Operating speed
Deceleration rate
Starting speed
(stopping speed)
Target coordinate/travel
(number of output pulses)
Time (ms)
Acceleration time Deceleration time
5
"Reference Example of Positioning Control" (page 5-
(3) Execute the program.
78)
Motor (Positioning) Control
No Do you want to
change the parameter details "Lists of Devices and Error Codes for Positioning"
during execution? (page 5-88)
"Changing the speed during operation" (page 5-40)
Yes "Reference example of changing speed during
operation" (page 5-82)
Change the parameter.
"Reference example of executing positioning control
with more than 21 points" (page 5-86)
Setting Parameters
Parameters are divided into two types: point parameters and system parameters.
To set parameters, use "Set CPU positioning parameters" in KV STUDIO.
On the "Tool" menu, click "Set CPU positioning parameters."
Other
method Click .
Right-click in the ladder editing window, and select "Set CPU positioning parameters" from the menu.
Point parameters
Point parameters, such as the travel target point (position), operating and starting speed, and
deceleration time, are the basic parameters for trapezoidal control.
"How to use the menu" (page 5-7)
System parameters
System parameters are used to set the sensor input, pulse output, comparator, origin returning
operation, and JOG operation.
"I/O settings" (page 5-15)
"Comparator settings" (page 5-33)
"Origin returning operation" (page 5-22)
"JOG settings" (page 5-31)
Control memory (CM) entries are used to manage all parameters. You can also change parameters
during operation by using ladder programs to rewrite values.
To save changed parameters in the case of power outages, you have to set "Power off holding" to
"Hold" in the CPU system setting window.
(6) Show
assignment
button
(7) Show
column
button
(8) Monitor
button 5
Point parameters
(1) Point number (6) Deceleration rate [Hz/ms]
CPU BUILT-IN FUNCTIONS
(4) Target coordinate/travel [PLS] (9) Travel after stop sensor input [PLS]
(5) Acceleration rate (10) Comment
[Hz/ms]
5
Motor (Positioning) Control
Default
Function Name Setting Range See Page
Value
(1) Point number 1 to 20 5-9
KV-N14*T(P) and KV-N24*T(P): 2
KV-N40*T(P): 3
(2) Axis number KV-N60*T(P): 4 5-9
* You can also hide this information by
clearing the check boxes.
Positioning INC
Positioning ABS Positioning
(3) Operation mode 5-9
Speed control CW INC
Speed control CCW
Target coordinate/travel
(4) -2147483648 to 2147483647 0 5-11
[PLS]
(5) Acceleration rate [Hz/ms] 0, 1 to 65535 10 5-11
(6) Deceleration rate [Hz/ms] 0, 1 to 65535 10 5-11
(7) Operating speed [Hz] 1 to 100,000 1000 5-12
(8) Stop sensor setting Enabled, disabled Disabled 5-12
0 to 65535
Travel after stop sensor
(9) (This can only be set when the stop sensor 0 5-13
input [PLS]
setting is enabled.)
Up to 32 single-byte characters (16 double-
byte characters)
* If you specify the point number in the
operands of a KV STUDIO positioning
instruction, the set comment will be
(10) Comment
displayed on the ladder diagram.
Also, when you are using the RT editing
function, comments are displayed in the
entry completion candidates of the point
number operand.
Reference • The set parameters are stored in control memory (CM) entries of the CPU.
• You can display only the parameters of the required axes by selecting and clearing the
appropriate axis display check boxes.
5
Execution PSTRT
condition
Unit number Axis number Point number
#0 #1 #2
When the above ladder program is executed, the pulse will be generated according to the point
parameters of point number 2 of axis number 1.
"PSTRT Instructions" (page 5-46)
Operation mode
Position control (Positioning INC and Positioning ABS) moves an object from a certain position to a
target value or by the specified travel amount.
Speed control (Speed control CW and Speed control CCW) moves an object in the specified direction
until the stop sensor turns on.
Positioning INC
In this mode, relative coordinates are used for position control.
The distance from an object's current position to the travel target point is specified as the travel. For
example, in the following figure, to move the object at A to B, specify a value of +100 for the travel.
Next, to move the object from B to C, specify a value of +200. To return the object from C to B, specify
a value of -200.
If the current position overflows, the warning relay will be turned ON. However, pulse output will not be
stopped.
"Lists of Devices and Error Codes for Positioning" (page 5-88)
A B C
+100 +200
-200
Current Coordinate
position 0 (origin) 100 200 300
Positioning ABS
In this mode, absolute coordinates are used for position control.
CPU BUILT-IN FUNCTIONS
The distance from the origin to the travel target point is specified as the target value. For example, in
the following figure, to move the object at A to B, specify a value of +100 for the target value. Next, to
move the object from B to C, specify a value of +300. To return the object from C to B, specify a value
of +100.
If you execute this type of positioning when the warning relay is turned ON, an error will occur and
pulse output will be stopped.
"Lists of Devices and Error Codes for Positioning" (page 5-88)
A B C
5 100 300
100
Motor (Positioning) Control
Current Coordinate
position 0 (origin) 100 200 300
Speed control CW
In this mode, regardless of the number of pulses to be generated, pulses are continuously generated in
the CW (clockwise) direction at the specified speed.
Speed
CW
Time
CCW
CCW
Speed
Reference Parameter storage position: Parameters are stored in bit 0 and bit 1 of CM8006 + ((point
number - 1) × 10) + ((axis number - 1) × 200), as shown below.
Target coordinate/travel
The travel target point is called the target coordinate or the travel.
Operating speed
Starting speed
(stopping speed) 5
Speed
Setting range : 0 (to start at the operating
speed or to stop Operating
suddenly), 1 to 65535 speed
(Hz/ms)
0 Time
If you specify 0, the
operation during acceleration or deceleration will be as shown in the
chart to the right.
Parameter storage position : Acceleration rate: CM8002 + ((point number - 1) × 10) +
((axis number - 1) × 200)
Deceleration rate: CM8003 + ((point number - 1) × 10) +
((axis number - 1) × 200)
Reference You cannot configure settings based on the acceleration time or deceleration time.
Operating speed
This specifies the speed of the pulses to be output to the motor during operation.
CPU BUILT-IN FUNCTIONS
Setting range : 1 to 100000 (Hz; specify a value that is greater than or equal to the
starting operating speed)
Parameter storage position : Upper 16 bits: CM8005 + ((point number - 1) × 10) +
((axis number - 1) × 200)
Lower 16 bits: CM8004 + ((point number - 1) × 10) +
((axis number - 1) × 200)
(1)If the starting operating speed and the operating speed are equivalent, the
Motor (Positioning) Control
Point
operation will be as shown in the following chart.
Speed
Starting speed
(stopping speed)
0 Time
In this situation, the acceleration rate and deceleration rate are ignored.
(2)Trapezoidal control over a short time period (over a short distance) will be as
shown in the following charts.
Speed Speed
Operating Operating
speed speed
Deceleration rate Deceleration rate
Starting Acceleration rate Starting Acceleration rate
operating speed operating speed
0 Time 0 Time
With trapezoidal control, the acceleration rate and deceleration rate are
always controlled to uniform values.
Therefore, during trapezoidal control over a short time period, the speed is
decreased before it reaches the operating speed.
Parameter storage position : Parameters are stored in bit 4 of CM8006 + ((point number - 1) × 10) +
((axis number - 1) × 200), as shown below.
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
bit4 Setting Details
0 Disabled
1 Enabled
If you specify 0, pulse output will be stopped immediately when the stop sensor input turns ON.
The deceleration rate is ignored.
5
Immediate stop
If you specify 65535 (the maximum value), when the stop sensor input turns ON, the speed is
decelerated according to the deceleration rate, and pulse output is stopped after the starting speed is
reached.
Deceleration rate
Setting range : 0 to 65534, 65535 (decrease the speed according to the deceleration
rate and then stop pulse output)
Parameter storage position : CM8008 + ((point number - 1) × 10) + ((axis number - 1) × 200)
5
Function Name Setting Range Default Value See Page
Motor (Positioning) Control
Reference • Set the starting operating speed separately for each axis. For details on changing the
value for each point parameter, see "Reference example of specifying the point
parameters directly and starting the positioning operation" (page 5-87).
• You can display only the parameters of the required axes by selecting and clearing the
appropriate axis display check boxes.
I/O settings
See
Function Name Setting Range Default Value Page
Origin sensor
Axis 1 CR8014, R000, R001, R002, R003*1 R000
(1) Input 5-17
Axis 2 CR8114, R000, R001, R002, R003*1 R002*2
(2) Polarity NO (A contact), NC (B contact) NO (A contact)
Stop sensor
Axis 1 CR8015, R000, R001, R002, R003*1 R001*3
(3) Input 5-17
Axis 2 CR8115, R000, R001, R002, R003*1 R003*4
(4) Polarity NO (A contact), NC (B contact) NO (A contact)
Z-phase
Axis 1 R010 (fixed) R010*5
(5) Input 5-18
Axis 2 R011 (fixed) R011*6
(6) Polarity NO (A contact), NC (B contact) NO (A contact)
Limit switch CW
Axis 1 CR8012 (fixed) CR8012
(7) Input 5-18
Axis 2 CR8112 (fixed) CR8112
(8) Polarity NO (A contact), NC (B contact) NO (A contact)
Limit switch CCW
Axis 1 CR8013 (fixed) CR8013
(9) Input 5-18
Axis 2 CR8113 (fixed) CR8113
(10) Polarity NO (A contact), NC (B contact) NO (A contact)
(11) Select output type 1-pulse, 2-pulse 1-pulse
Output pulse during forward
(12) Forward pulse, Reverse pulse Forward pulse
operation
*1 You cannot specify R002 and R003 on the KV-N14*T.
*2 R001 on the KV-N14*T
*3 CR8015 on the KV-N14*T
*4 CR8115 on the KV-N14*T
*5 R002 on the KV-N14*T
*6 R003 on the KV-N14*T
See
CPU BUILT-IN FUNCTIONS
Reference You can display only the parameters of the required axes by selecting and clearing the
appropriate axis display check boxes.
Origin sensor
The origin is the position that is used as the reference for position control. Attach the origin sensor at
CR8*14 (control relay)......Control relay CR8*14 will be set as the origin sensor.
R000 to R007 ...................The input relays will be set as the origin sensors.
NO, NC.............................The logic of the origin sensor input will be set to the value that you specify.
If you specify R000 to R007, the set input is used as the origin sensor input to the origin returning
operation.
To use input other than the R000 to R007 relays as the origin sensor input, set this parameter to control
relay CR8*14, and then use a ladder program to turn control relay CR8*14 ON and OFF.
5
Stop sensor
During operation, the moving object travels to the stop sensor position. If the stop sensor is ON, the
moving object will decelerate and stop immediately from this position or continue to travel a certain
distance (the travel after stop sensor input), then decelerate and stop.
However, if no stop sensor is specified in the point parameters, input from the stop sensor will be
ignored.
CR8*15 (control relay)......Control relay CR8*15 will be set as the stop sensor.
R000 to R007 ...................Input relays R000 to R007 will be set as the stop sensors.
NO, NC.............................The logic of the stop sensor input will be set to the value that you specify.
If you specify R000 to R007, the set input is used as the stop sensor input to stop travelling.
To use input other than the R000 to R007 as the stop sensor input, set this parameter to control relay
CR8*15, and then use a ladder program to turn control relay CR8*15 ON and OFF.
Example
Using input relay R1001 as the stop
R1001 CR8015
sensor input of axis 1
Z-phase
The Z-phase is used to improve the position accuracy after origin returning operations complete. This is
CPU BUILT-IN FUNCTIONS
The Z-phase input terminal is fixed for each base unit and each axis. You cannot change this terminal.
NO, NC............................ The logic of the Z-phase input will be set to the value that you specify.
5 Axis
Storage
Destination
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
bit12 Setting Details
Axis 1 CM8801 0 NO (normally open: A contact)
Motor (Positioning) Control
CR8*12, CR8*13 (control relays) .......Control relays CR8*12 and CR8*13 will be set as the limit
switches.
You cannot set the input relays as the limit switch.
NO, NC...............................................The logic of limit switch input will be set to the value that you
specify.
The limit switch that is installed on the end in the CW direction is called limit switch CW.
Travel in the CW direction
Limit switch CW
The limit switch that is installed on the end in the CCW direction is called limit switch CCW.
Travel in the CCW direction
Limit switch CW
Use the input relays that are actually connected to the limit switches to turn control relays CR8*12 and
CR8*13 ON and OFF.
Limit switch CW polarity CR8012 (axis 1), CR8112 (axis 2), CR8212 (axis 3), CR8312 (axis 4)
Limit switch CCW polarity CR8013 (axis 1), CR8113 (axis 2), CR8213 (axis 3), CR8313 (axis 4)
Axis
Storage
Destination
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
bit9 Setting Details 5
Axis 1 CM8801 0 NO (normally open: A contact)
Example
Using input relay R1002 as limit switch R1002 CR8012
CW of axis 1 and input relay R1003 as
limit switch CCW of axis 1
R1003 CR8013
When a limit switch is turned ON, a limit error (error code 31, 32, or 33) occurs and the workpiece
decelerates and stops. Remove the cause of the error, and use the error clear relay CR8*02 to clear the
error status.
• For safety reasons, use NC (normally closed) limit switches whenever possible.
If you use NO (normally open) limit switches, the switch will not operate in the
event of breaks in the line, which is very dangerous.
• After positioning equipment is installed, be sure to verify that limit switches
NOTICE
operate normally.
• To prevent objects from crossing the limit switch in the event that motors
decelerate and stop, the near-point detector of the limit switch must be
sufficiently wide.
axes.
Base Unit Axis 1 Axis 2 Axis 3 Axis 4
KV-N14*T(P) R500 and R501 R502 and R503 - -
KV-N24*T(P) R500 and R501 R502 and R503 - -
KV-N40*T(P) R500 and R501 R502 and R503 R504 and R505 -
KV-N60AT(P) R500 and R501 R502 and R503 R504 and R505 R506 and R507
Storage bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Axis Destination bit0 Setting Details
Axis 1 CM8814 0 1-pulse mode
Axis 2 CM8854 1 2-pulse mode
Axis 3 CM8894
Axis 4 CM8934
Connection example
(1-pulse mode) (2-pulse mode)
* You cannot use axis 3 and axis 4 on the KV-N14*T and KV-N24*T.
You cannot use axis 4 on the KV-N40*T.
1-pulse mode
Forward rotation pulse Reverse-rotation pulse
Increased by 1 Decreased by 1 Increased by 1 Decreased by 1
Pulse
Rotation
OFF ON
ON
OFF ON
OFF
Pulse
Rotation
OFF ON
OFF
OFF ON
ON
5
direction direction
Reference "ON" and "OFF" in the above tables refer to the output transistor logic output.
If a power outage occurs during positioning, and if the axes are moved manually while the power is off,
the position of the object recorded by the KV Nano Series and the object's actual position will be
different.
By performing an origin returning operation, you can match the actual origin and the internal current
position (the current value).
(1) Starting speed [Hz] (4) Operating speed [Hz] (7) Clear deviation counter
(5) Origin return
(2) Acceleration rate [Hz/ms] direction (8) Automatic home position
(3) Deceleration rate [Hz/ms] (6) Origin return method (9) Home coordinate setting value
5
Motor (Positioning) Control
See
Function Name Setting Range Default Value
Page
(1) Starting speed [Hz] 1 to 65535 200 5-22
(2) Acceleration rate [Hz/ms] 0, 1 to 65535 10 5-22
(3) Deceleration rate [Hz/ms] 0, 1 to 65535 10 5-22
(4) Operating speed [Hz] 1 to 100000 1000 5-23
(5) Origin return direction CW, CCW CCW 5-24
Origin sensor up edge
Medium point of the origin sensor
Origin sensor and Z-phase Origin sensor up
(6) Origin return method 5-24
Dog type (Z-phase not used) edge
Dog type (Z-phase used)
Dog type (press-against)
(7) Clear deviation counter Output, No output No output 5-25
(8) Automatic home position Move, Not move Not move 5-24
(9) Home coordinate setting value -2147483648 to 2147483648 0 5-26
Starting speed
Set the starting output pulse speed for origin returning and home position operations.
Setting range : 1 to 65535 (however, specify a value that is less than or equal to the
operating speed)
Parameter storage position : Axis 1 CM8809
Axis 2 CM8849
Axis 3 CM8889
Axis 4 CM8929
On the KV Nano Series, you can set the acceleration rate and the deceleration rate to separate values.
Setting range : 0 (to start at the operating speed or to stop suddenly),
1 to 65535
Reference You cannot configure settings based on the acceleration time or deceleration time.
Operating speed 5
Set the speed of the pulse to output to the motor during origin returning and home position operations.
(1) If the starting speed and the operating speed are equivalent, the operation will
Point
be as shown in the following chart.
Speed
Starting speed
(stopping speed)
0 Time
In this situation, the acceleration rate and deceleration rate are ignored.
(2) Trapezoidal control over a short time period (over a short distance) will be as
shown in the following charts.
Speed Speed
Operating Operating
speed speed Deceleration rate
Acceleration rate
Starting Deceleration rate Starting
Acceleration rate
speed speed
0 Time 0 Time
With trapezoidal control, the acceleration rate and deceleration rate (slopes)
are always controlled to uniform values.
Therefore, during trapezoidal control over a short time period, the speed is
decreased before it reaches the operating speed.
5 Axis 2 CM8854 1 CW
Axis 3 CM8894
Motor (Positioning) Control
Axis 4 CM8934
have been set in KV STUDIO. In addition, even if one of the CW and CCW limit switches is ON, the
origin returning operation can be performed so long as the error is cleared.
If the origin returning direction is CW, use the text in parentheses below.
Limit switch * During step (1), if the limit switch on the travel direction side turns
Acceleration rate ON, the workpiece decelerates and stops, and remains stopped
for 300 ms. After that, the operations of step (2) are performed.
* During step (3), if the limit switch on the travel direction side turns
ON, an emergency stop occurs.
* "Clear deviation counter" is turned ON for 50 ms when the origin
returning operation completes.
Start position: CCW (CW) side (2) When the origin direction stop position is within the origin sensor range after a
limit switch turns ON
(1) The workpiece accelerates to the operating speed, and travels in
5
Limit switch Acceleration rate
* Clear deviation counter" is turned ON for 50 ms when the origin
returning operation completes.
Start position: Within the range of the origin sensor
You have to set "Clear deviation counter" to "Output" in the system parameters.
Point
"Clear deviation counter" (page 5-25)
When "Origin return method" is set to "Medium point of the origin sensor"
Origin return direction: CCW (CW)
Origin sensor (1) After the operation at the origin sensor's rising edge completes,
Acceleration rate Deceleration rate the workpiece travels at the starting speed in the opposite
(3) direction of the origin returning operation to a position at which the
[Operating speed]
Speed in the (2) origin sensor turns OFF. The workpiece then stops moving. The
[Starting speed] position of the workpiece after the operation at the origin sensor's
CW (CCW)
direction rising edge completes is recorded as position B.
Origin (2) The workpiece moves at the starting speed until the origin sensor
CCW (CW) CW (CCW) turns ON. The position at which the origin sensor turned on is
Origin at the "origin recorded as position C.
Speed in the sensor's rising edge" (3) The workpiece travels from position C to position B according to
CCW (CW) trapezoidal control, and then stops.
[Starting speed]
direction (1) (4) (4) According to trapezoidal control, the workpiece travels to the
[Operating speed] central position of the origin sensor as calculated from position B
and position C, and then stops. (This is the end of the origin
returning operation.)
(C) Medium point (B)
of the origin sensor Note "Clear deviation counter" is not turned ON.
Z-phase
When "Origin return method" is set to "Dog type (Z-phase not used)"
Origin return direction: CCW (CW)
CPU BUILT-IN FUNCTIONS
(3) Deceleration (2) When the limit switch (CCW) turns ON, the workpiece decelerates
Speed in the (2) and stops. The workpiece remains stopped for 300 ms and then
Acceleration rate rate
CW (CCW) [Starting moves in the opposite direction.
direction speed] (3) When the near-point detector signal is detected as turning OFF,
CCW (CW) CW (CCW) the workpiece decelerates to the starting speed, and then moves
[Starting in the opposite direction.
Speed in the (5) speed] (4) When the near-point detector signal turns ON, the workpiece
(1) (4) Acceleration
CCW (CW) decelerates to the starting speed.
Acceleration rate rate
direction (5) The workpiece travels to a position at which the near-point
[Operating
speed] detector signal turns OFF. The workpiece then stops moving.
Deceleration Deceleration rate * "Clear deviation counter" is turned ON for 50 ms when the origin
rate Limit switch Near-point detector
(CCW) returning operation completes.
Near-point detector
• If the range in which the near-point detector signal turns ON is narrow, the
Point
workpiece cannot decelerate to the starting speed, which may cause variations
in the origin position. Widen the range in which the near-point detector signal
turns ON, reduce the operating speed, or increase the deceleration rate so that
the near-point detector signal can turn OFF after the workpiece decelerates to
the starting speed.
• Ensure that the near-point detector signal turns ON for 10 ms or more. To
prevent chattering, do not detect the near-point detector signal turning OFF for
10 ms after it turns ON.
• For details on wiring to the origin sensor, see " Origin return wiring" (page 5-25).
• If the range in which the near-point detector signal turns ON is narrow, the
Point
workpiece cannot decelerate to the starting speed, which may cause variations
in the origin position. Widen the range in which the near-point detector signal
turns ON, reduce the operating speed, or increase the deceleration rate so that
the near-point detector signal can turn OFF after the workpiece decelerates to
the starting speed.
• Ensure that the near-point detector signal turns ON for 10 ms or more. To
prevent chattering, do not detect the near-point detector signal turning OFF for
10 ms after it turns ON.
• For details on wiring to the origin sensor, see " Origin return wiring" (page 5-25).
5 Deceleration rate
the torque limit signal turns ON or a limit switch turns ON before the
near-point detector signal turns ON, an error will occur, and the
workpiece will stop moving. If the origin returning direction is CCW
(CW), ensure that the start position is not on the CCW (CW) side.
Start position: Within the range of the origin sensor
Acceleration rate (1) The workpiece moves in the opposite direction of the origin
Deceleration rate
Z-phase returning operation while accelerating to the operating speed.
(2) When the near-point detector signal turns OFF, the workpiece
[Operating speed] decelerates to the starting speed, and then moves in the opposite
Speed in the
(1) (2) direction.
Starting
CW (CCW) position (3) When the near-point detector signal turns ON, the workpiece
direction [Starting speed] decelerates to the starting speed.
Origin (4) After the near-point detector signal turns OFF, the workpiece
CCW (CW) CW (CCW)
stops moving the first time the Z-phase turns ON (switches from
[Starting speed] OFF to ON).
Speed in the (4) * "Clear deviation counter" is turned ON for 50 ms when the origin
CCW (CW)
direction (3) returning operation completes.
[Operating speed]
• When you have set "Origin return method" to "Dog type (press-against)," you
Point
have to wire the torque limit signal of the motor that you are using to the Z-
phase input.
• Before the near-point detector signal turns ON, the torque limit signal turning
ON will be ignored. Check the arrangement of the mechanisms.
• If the range in which the near-point detector signal turns ON is narrow, the
workpiece cannot decelerate to the starting speed, which may cause variations
in the origin position. Widen the range in which the near-point detector signal
turns ON, reduce the operating speed, or increase the deceleration rate so that
the near-point detector signal can turn OFF after the workpiece decelerates to
the starting speed.
• Ensure that the near-point detector signal turns ON for 10 ms or more. To
prevent chattering, do not detect the near-point detector signal turning OFF for
10 ms after it turns ON.
• For details on wiring to the origin sensor, see " Origin return wiring" (page 5-25).
JOG settings
(1) Starting speed [Hz]
Starting speed
Set the starting output pulse speed for JOG operation.
If you turn ON the CW or CCW execution condition with the HIGH execution condition of the JOG
instruction turned OFF, operations will be performed at the starting speed.
Setting range : 1 to 65535 (however, specify a value that is less than or equal to the high
speed)
Parameter storage position :
Axis 1 CM8815
Axis 2 CM8855
Axis 3 CM8895
Axis 4 CM8935
The higher the value, the faster the acceleration will become, and the shorter the
travel time will be. If you specify 0, the starting speed will be the same as the high
speed.
Deceleration rate: The rate at which the speed decreases from the high speed to the starting speed.
The higher the value, the faster the deceleration will become, and the shorter the
travel time will be. If you specify 0, operations will stop immediately.
Reference The acceleration and deceleration rates are only valid when you specify HIGH with the
JOG instruction. When you do not specify HIGH, operations start at the starting speed
5 and stop immediately.
On the KV Nano Series, you can set the acceleration rate and the deceleration rate to separate values.
Motor (Positioning) Control
High speed
Set the pulse speed to output to the motor when you specify HIGH with the JOG instruction. Set this to
a value that is greater than or equal to the starting speed.
When you specify HIGH with the JOG instruction, the acceleration rate and
Point
deceleration rate (slopes) are always controlled to uniform values.
Therefore, if you specify HIGH with the JOG instruction while you are performing
JOG operation over a short time period, the workpiece will decelerate before it
reaches the specified high speed.
Comparator settings
Function selection
Not used ...........................No operation is performed when the comparator is matched.
CPU BUILT-IN FUNCTIONS
Stop sensor ......................The stop sensor performs the same operation as that entered.
Soft limit switch CW..........The CW direction limit switch performs the same operation as that entered.
Soft limit switch CCW .......The CCW direction limit switch performs the same operation as that entered.
Comparator 0
Storage bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Axis destination bit5 bit4 Operation When the Current Position and Comparator 0 Match
Axis 1 CM8814 0 0 Not used
Comparator 1
Storage bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Axis destination bit7 bit6 Operation When the Current Position and Comparator 1 Match
Axis 1 CM8814 0 0 Not used
Axis 2 CM8854 0 1 Used as a stop sensor
Axis 3 CM8894 1 0 Used as a limit switch in the CW direction
Axis 4 CM8934 1 1 Used as a limit switch in the CCW direction
Setting value
Set the value (the comparator value) that will be compared with the number of output pulses (the
current position—the current value).
The values for interrupts (axis 1: CM8807 and CM8806, axis 2: CM8847 and
Point
CM8846, axis 3: CM8887 and CM8886, axis 4: CM8927 and CM8926) that the KV
Nano Series recognizes are each axis' PSTRT, JOG, ORG, HOME, and CHGSP*
instructions. Just writing the values to control memory is not enough to make
this function operate correctly.
If you want to use interrupts, write the value to the control memory entries, and
then execute the PSTRT, JOG, ORG, HOME, or CHGSP* instruction.
"Reference example of changing speed during operation" (page 5-82)
* Comparator 0 and comparator 1 are not applied when the CHGSP instruction is executed.
Error (axis 1: CR8402, axis 2: CR8502, axis 3: CR8602, and axis 4: CR8702)
These control relays are turned ON when an error occurs. Error codes are stored in CM8834 (axis 1),
CM8874 (axis 2), CM8914 (axis 3), and CM8954 (axis 4).
To clear the error status (error clear), turn the error clear relays ON.
If an error occurs during pulse output, operations will be stopped.
For details on error codes, see "Lists of Devices and Error Codes for Positioning" (page 5-88).
Error clear (axis 1: CR8002, axis 2: CR8102, axis 3: CR8202, and axis 4: CR8302)
When an error has occurred (error relays are turned ON), turn these relays ON to clear the error status
(error clear).
When you are clearing errors, leave the error clear relays (CR8002, CR8102, CR8202, and CR8302)
turned ON until the error relays (CR8402, CR8502, CR8602, and CR8702) are turned OFF.
Pulse output in progress (axis 1: CR8400, axis 2: CR8500, axis 3: CR8600, and
axis 4: CR8700)
These relays will be turned ON during pulse output.
Deceleration stop (axis 1: CR8001, axis 2: CR8101, axis 3: CR8201, and axis 4:
CR8301)
If you turn these relays ON while the pulse output in progress relays are turned ON, the workpiece will
decelerate according to the deceleration rate and then stop. When the workpiece decelerates and then
stops, the positioning complete relays are not turned ON.
When the workpiece is decelerating and stopping, requests to change the target coordinate, change
the speed, or change the deceleration rate will not be accepted.
Even while the deceleration stop relays are turned ON, you can start positioning.
Example)
Axis 1
deceleration stop
Forced stop (axis 1: CR8000, axis 2: CR8100, axis 3: CR8200, and axis 4: CR8300)
If you turn these relays ON while the pulse output in progress relays are turned ON, pulses will be
stopped immediately, and an error (a forced stop error) will occur.
Positioning complete (axis 1: CR8401, axis 2: CR8501, axis 3: CR8601, and axis
4: CR8701)
These relays are set when positioning is completed and when origin returning operations are
completed. When the automatic home position function is enabled, these relays are set when the travel
to home position operation is finished. They are reset the next time a pulse is output. 5
* The positioning complete relays will be set even if pulse output is not generated when the PSTRT
Relay
Operation Control Memory Entry to Store the New Value In
Number
Axis 1: Current coordinate
CR8004 CM8825 (upper bits) and CM8824 (lower bits)
change request
Axis 2: Current coordinate
CR8104 CM8865 (upper bits) and CM8864 (lower bits)
change request
Axis 3: Current coordinate
CR8204 CM8905 (upper bits) and CM8904 (lower bits)
change request
Axis 4: Current coordinate
CR8304 CM8945 (upper bits) and CM8944 (lower bits)
change request
Example)
MR008 CR8400 CM8830 MOV.L
<> +0 CM8824
Current Axis 1 #0
Axis 1 Axis 1 current coordinate
coordinate change pulse output change value
in progress current coordinate
CR8004 CR8004
Reference This function is not executed while the error relays are turned ON.
turned ON.
Store the new values in control memory entries in advance.
"Operating Speed Change Request" page 4-34
5 Example)
MR009 CR8400 MOV.L
+1000 CM8826
Motor (Positioning) Control
Reference • If, in relation to the coordinate speed specified by the speed change, the remaining
travel of the point being executed is small, before the workpiece accelerates to the
specified speed to change to, the operation will switch to deceleration.
• This function will not be executed if a deceleration stop function is being performed
because of the deceleration stop relays (CR).
• If the specified speed to change to is smaller than the starting speed (for example, if the
new speed is 0), operations will be performed at the starting speed.
• If you specify an operating speed that exceeds the upper limit, an error will not occur,
but operations will be performed at the upper limit.
Target coordinate change request (axis 1: CR8006, axis 2: CR8106, axis 3:
CR8206, and axis 4: CR8306)
During positioning control, the target coordinate is changed when these relays are turned ON.
Store the new values in control memory entries in advance.
"Target Coordinate Change Request" page 4-34
Reference • If the current coordinate has gone too far in relation to the target coordinate specified
with the target coordinate change, the return operation will be executed.
• This function will not be executed if a deceleration stop function is being performed
because of the deceleration stop relays (CR).
• This function will not be executed if the positioning operation is within 250 µs of
completion.
• During fixed dimension operations caused by the stop sensor input, this function will be
ignored.
• This function will only be executed during positioning operations caused by the PSTRT
instruction.
5-38 - KV Nano Series(terminal block type) User’s Manual -
5-2 Motor (Positioning) Control
Warning (axis 1: CR8403, axis 2: CR8503, axis 3: CR8603, and axis 4: CR8703)
These relays are turned ON when an overflow occurs at the current position.
Pulse output will not be stopped if a warning occurs. 5
Current position overflow
Warning clear (axis 1: CR8003, axis 2: CR8103, axis 3: CR8203, and axis 4:
CR8303)
When the warning relays are turned ON, turn these relays ON to clear the warnings.
When you are clearing warnings, leave the warning clear relays (CR8003, CR8103, CR8203, and
CR8303) turned ON until the warning relays (CR8403, CR8503, CR8603, and CR8703) are turned
OFF.
Axis n present (axis 1: CR8414, axis 2: CR8514, axis 3: CR8614, and axis 4:
CR8714)
For models that can use axis n (n: 1 to 4), these relays are turned ON. For other models, these relays
are turned OFF.
In situations such as when the units used with the KV Nano Series are changed, you can create
interlocks so that instructions related to nonexistent axes cannot be executed.
Axis 3 present
* If the base unit is the KV-N40*T(P) or KV-N60AT(P), point number 1 of axis 3 is executed. If the base unit
is the KV-N14*T(P) or KV-N24*T(P), positioning control is not started.
Reference With the KV Nano Series, you can share programs of different base units by using the
model change function.
If you specify the axis numbers that cannot be used and then execute an instruction such
as PSTRT, errors will not occur. However, by using the "axis n present" flag, you can
create interlocks for when the base unit varies.
CPU BUILT-IN FUNCTIONS
Operating point number (axis 1: CM8835, axis 2: CM8875, axis 3: CM8915, axis 4:
5 CM8955)
These control memory entries store the starting point numbers when instructions such as PSTRT, JOG,
Motor (Positioning) Control
and ORG are executed. Also, "1001" is stored when the JOG instruction is executed, "1000" is stored
when the ORG instruction is executed, and "1002" is stored when the HOME instruction is executed.
* "1000" is stored when the automatic home position function is being executed.
Current speed (axis 1: CM8832 and CM8833, axis 2: CM8872 and CM8873,
axis 3: CM8912 and CM8913, and axis 4: CM8952 and CM8953)
These control memory entries store the current speed (Hz).
For details on changing the speed during operation, see "Changing the speed during operation"
(page 5-40).
Error code (axis 1: CM8834, axis 2: CM8874, axis 3: CR8914, and axis 4: CR8954)
These control memory entries store the error codes.
"Lists of Devices and Error Codes for Positioning" (page 5-88)
You cannot specify a speed that is less than the starting speed. If you specify a
Point
speed that is less than the starting speed, the starting speed will be used.
Reference • If you use the comparator 2 interrupt relay (axis 1: CR8415, axis 2: CR8515, axis 3:
CR8615, and axis 4: CR8715), you can request changes to the speed when a
prescribed position is reached.
• When changing speed, the point number acceleration/deceleration rate is read, and the
speed is changed according to the acceleration/deceleration rate.
Execution
processing
processing
processing
processing
Main routine condition CHGSP
Output
Output
Input
Input
program Unit number Axis number Speed change value
#0 #1 #10000
Speed
Using the comparator 2 interrupt relay (axis 1: CR8415, axis 2: CR8515, axis 3:
CR8615, and axis 4: CR8715) to change the speed
Comparator 2 compares the current position with the value of comparator 2 that was set in the
comparator settings of the system parameters. If the values match, an interrupt is generated.
Axis Interrupt Relay Storage Position for the Comparator 2 Values
Axis 1 CR8415 CM8807 (upper bits) and CM8806 (lower bits)
Axis 2 CR8515 CM8847 (upper bits) and CM8846 (lower bits)
Axis 3 CR8615 CM8887 (upper bits) and CM8886 (lower bits)
Axis 4 CR8715 CM8927 (upper bits) and CM8926 (lower bits)
To use comparator 2, use the INT instruction. However, this control relay will not actually be turned ON
or OFF. It is only used as a symbol in ladder programming.
Example
(Axis 1) INT (Axis 2) INT (Axis 3) INT (Axis 4) INT
CR8415 CR8515 CR8615 CR8715
When an interrupt condition according to comparator 2 occurs, the operating speed is immediately
changed to the value specified by S .
CPU BUILT-IN FUNCTIONS
Axis 1 The current value (CM8831 and CM8830) equals the value of comparator 2 (CM8807 and CM8806).
An interrupt according to Axis 2 The current value (CM8871 and CM8870) equals the value of comparator 2 (CM8847 and CM8846).
comparator 2 occurs. Axis 3 The current value (CM8911 and CM8910) equals the value of comparator 2 (CM8887 and CM8886).
Axis 4 The current value (CM8951 and CM8950) equals the value of comparator 2 (CM8927 and CM8926).
processing
processing
processing
processing
Main routine
Output
Output
Input
Input
processing program
Input
5 END
Speed INT
Motor (Positioning) Control
CR8415
S
CR2002 CHGSP
Unit number Axis number Speed change value
#0 #1 #10000
RETI
The values for interrupts according to comparator 2 (axis 1: CM8807 and CM8806,
Point
axis 2: CM8847 and CM8846, axis 3: CM8887 and CM8886, and axis 4: CM8927 and
CM8929) are recognized by the KV Nano Series when the PSTRT, JOG, ORG,
HOME, or CHGSP instruction is being executed. Just writing the values to control
memory is not enough to make this function operate correctly.
When using comparator 2 as an interrupt condition, write the value to the control
memory entries, and then execute the PSTRT, JOG, ORG, HOME, or CHGSP
instruction.
"Reference example of changing speed during operation" (page 5-82)
Using operating speed change request relays CR8005 (axis 1), CR8105 (axis 2),
CR8205 (axis 3), and CR8305 (axis 4)
During pulse output, when the operating speed change request relays are turned ON, the speed is
changed to the operating speed change values (axis 1: CM8827 and CM8826, axis 2: CM8867 and
CM8866, axis 3: CM8907 and CM8906, and axis 4: CM8947 and CM8946).
Execution Execution Operating speed
condition condition change request
turns ON recognition relay turns ON
Execution
processing
processing
processing
processing
Output
Input
Input
program S CM8826
Speed
CR8005
SET
CM8827
CM8826
Target coordinate
n1 CHGSPX
n2 S
coordinate
Using the target coordinate change request relay (axis 1: CR8006, axis 2:
CR8106, axis 3: CR8206, and axis 4: CR8306)
During pulse output, when the target coordinate change request relay is turned ON, the target
coordinate is changed to the target coordinate change values (axis 1: CM8829 and CM8828, axis 2:
CM8869 and CM8868, axis 3: CM8909 and CM8908, and axis 4: CM8949 and CM8948).
Execution Execution Target coordinate change
condition turns ON condition recognition request relay turns ON
Deceleration stop ○ ○ ○ ○ ○ ○ ○
Forced stop ○ ○ ○ ○ ○ ○ ○
Limit switch ○* ○ ○ ○ ○ ○ ○
○: The support function can be executed while the control function is being executed.
- : The support function cannot be executed while the control function is being executed.
* Control relay limit switches are valid, but limit switch functions that use comparator 0 or comparator 1 are
ignored.
5
Travel to home position HOME Starts the travel to home position operation 5-60
Speed change CHGSP Changes the speed during operation 5-62
Target coordinate change CHGTGT Changes the target coordinate during operation 5-66
Available Devices
Index
Local
Bit Devices Word Devices Const Ind Spec Device Modify
Operand
MR DM
5 R DR LR
B
T C CTC CR TM
W
T C CTH Z CM #/$*1 #TM * @ :#/:Z
n1 - - - - -
Motor (Positioning) Control
n2 - - - - -
n3 - - - - -
Description
n1 Specifies the unit number; this is fixed to "0" (0: CPU built-in function)*2
n2 Specifies the axis number (1 to 4)*2, 3
n3 Specifies the point number (1 to 20)*2
Operation Description
When the execution conditions are met, on the unit specified by n1 's axis number specified by
n2 with the setting details of the point number specified by n3 , the positioning operation is
started.
When the operation is completed, the workpiece stops moving.
Frequency (Hz)
Target value/travel (number of output pulses)
Operating
speed
Operating
OFF
ON
CR8401, CR8501,
CR8601, CR8701 OFF
(positioning complete)
• When the pulse output in progress flags are turned ON, the PSTRT instruction
Point
cannot be executed.
• When the error flags are turned ON, the PSTRT instruction cannot be executed.
• The pulse output in progress flags are turned OFF during the first END process
after pulse output is completed.
• If pulse output is stopped due to an emergency stop, the duty cycle of the final
pulse when output is stopped is not guaranteed.
• If you set the parameters so that the number of output pulses is 0, the pulse
output in progress flags will not be turned ON. The positioning complete relays
will be turned ON. In this situation, no warnings will occur.
- KV Nano Series(terminal block type) User’s Manual - 5-47
5-2 Motor (Positioning) Control
Operation flags
CPU BUILT-IN FUNCTIONS
n3 : If this parameter is outside of its range, an operation error will not occur.
* If CR2012 is turned ON, the instruction will not be executed.
5 When CR2012 is turned ON, the detailed error information is stored in CM2250 to CM2276.
"Lists of CR and CM Devices" (page A-8)
Motor (Positioning) Control
Sample Program
When a rising edge causes input relay R000 to be turned ON, a pulse is generated according to the setting
details of point number 2 of axis 1.
<Mnemonics list>
LDP R000
R000 PSTRT PSTRT #0 #1 #2
Unit number Axis number Point number
#0 #1 #2
MEMO
JOG
JOG CW
JOG operation Executes the JOG operation
CPU BUILT-IN FUNCTIONS
CCW
HIGH
HIGH signal n2
HIGH
5 Available Devices
Local
Index
Bit Devices Word Devices Const Ind Spec Device Modify
Motor (Positioning) Control
Operand
MR DM
R DR LR T C CTC CR TM T C CTH Z CM #/$*1 #TM * @ :#/:Z
B W
n1 - - - - -
n2 - - - - -
Description
n1 Specifies the unit number; this is fixed to "0" (0: CPU built-in function)*2
n2 Specifies the axis number (1 to 4)*2, 3
Operation Description
When the CW or CCW signal turns ON, on the unit specified by n1 's axis number specified by
n2 , pulse output starts at the starting speed.
When the HIGH signal is turned ON, pulses will be generated at the operating speed.
The workpiece stops moving after pulse output is completed.
HIGH signal
CW/CCW signal HIGH signal HIGH signal CW/CCW signal
ON ON OFF OFF
Operating speed
Acceleration rate
Deceleration rate
Starting speed
(stopping speed)
Time (ms)
Positioning
Pulse Output in Operating
Axis Complete Error Code Error Flag
Progress Flag Point Number
Relay
During the JOG operation, the pulse output in progress flags are turned ON and 1001 is stored in the
control memory entries indicated in the operating point number column.
When the operation is finished, the pulse output in progress flags are turned OFF.
Scan
Execution condition
ON 5
OFF
CW (signal)
ON
CR8400,CR8500,
CR8600,CR8700 OFF
(pulse output in progress flag)
• When the pulse output in progress flags are turned ON, the JOG instruction
Point
cannot be executed.
• When the error flags are turned ON, the JOG instruction cannot be executed.
• When a limit error occurs (error code 31 or 32), if you turn the error flags OFF,
even if the limit switch is turned ON, the JOG instruction can be executed in the
direction opposite to the direction of travel when the limit error occurred.
• The pulse output in progress flags are turned OFF during the first END process
after pulse output is completed.
• If pulse output is stopped due to a forced stop, the duty cycle of the final pulse
when output is stopped is not guaranteed.
• The origin returning operation relays and the positioning complete relays are
turned OFF when pulse output starts.
Operation flags
CPU BUILT-IN FUNCTIONS
5 Sample Program
Motor (Positioning) Control
When input R000 is turned ON, CW-JOG is executed. When input R001 is turned ON, CCW-JOG is
executed. When input R002 is turned ON at the same time as the other two inputs, the high-speed JOG
operation is executed.
<Mnemonics list>
R000 JOG
CW LD R000
LD R001
R001 #0
LD R002
CCW JOG #0 #1
R002 #1
HIGH
MEMO
Available Devices
Index
Local
Bit Devices Word Devices Const Ind Spec Device Modify
Operand
MR DM
5 R DR LR
B
T C CTC CR TM
W
T C CTH Z CM #/$*1 #TM * @ :#/:Z
n1 - - - - -
Motor (Positioning) Control
n2 - - - - -
Description
n1 Specifies the unit number; this is fixed to "0" (0: CPU built-in function)*2
n2 Specifies the axis number (1 to 4)*2, 3
Operation Description
When the execution condition turns ON, on the unit specified by n1 's axis number specified by
n2 , the origin returning operation starts. The operation stops when pulse output is complete.
Origin Origin
Pulse
Returning Returning Positioning Operating
Output In Error Error
Axis Operation In Operation Complete Point
Progress Code Flag
Progress Complete Relay Number
Flag
Flag Relay
Axis 1 CR8400 CR8404 CR8405 CR8401 CM8835 CM8834 CR8402
Axis 2 CR8500 CR8504 CR8505 CR8501 CM8875 CM8874 CR8502
Axis 3 CR8600 CR8604 CR8605 CR8601 CM8915 CM8914 CR8602
Axis 4 CR8700 CR8704 CR8705 CR8701 CM8955 CM8954 CR8702
During the origin returning operation, the pulse output in progress flags are turned ON and 1000 is
stored in the control memory entries indicated in the operating point number column.
When the workpiece travels to the origin (0) position, the pulse output in progress flags are turned OFF,
and the origin returning operation complete relays and positioning complete relays are turned ON. The
workpiece then stops moving.
When the next pulse output starts, the origin returning operation complete relays and positioning
complete relays are turned OFF.
Operating
OFF
CR8405,CR8505, ON
CR8605,CR8705
OFF
(origin returning operation complete)
5
CR8401,CR8501,
CR8601,CR8701
(positioning complete)
• When the pulse output in progress flags are turned ON, the ORG instruction
Point
cannot be executed.
• When the error flags are turned ON, the ORG instruction cannot be executed.
• The pulse output in progress flags are turned OFF during the first END process
after pulse output is completed.
• If pulse output is stopped due to a forced stop, the duty cycle of the final pulse
when output is stopped is not guaranteed.
Operation flags
CPU BUILT-IN FUNCTIONS
5 Sample Program
Motor (Positioning) Control
On the rising edge of R000, the origin return operation of axis 1 is started.
<Mnemonics list>
LDP R000
R000 ORG ORG #0 #1
Unit number Axis number
#0 #1
MEMO
value
Available Devices
Index
Local
Bit Devices Word Devices Const Ind Spec Device Modify
Operand
MR DM
5
R DR LR T C CTC CR TM T C CTH Z CM #/$*1 #TM * @ :#/:Z
B W
n1 - - - - -
Motor (Positioning) Control
n2 - - - - -
n3 - - - - -
Description
n1 Specifies the unit number; this is fixed to "0" (0: CPU built-in function)*2
n2 Specifies the axis number (1 to 4)*2, 3
n3 Specifies the point number to set the target coordinate to
Operation Description
When the execution condition turns ON, on the unit specified by n1 's axis number specified by
n2 , the current value is read and stored in the target coordinate or the travel of the point number
specified by n3 .
Target coordinate or travel (N is the
Axis Current position
point number)
Axis 1 CM8000 + ((N - 1) × 10) CM8831 and CM8830
Axis 2 CM8200 + ((N - 1) × 10) CM8871 and CM8870
Axis 3 CM8400 + ((N - 1) × 10) CM8911 and CM8910
Axis 4 CM8600 + ((N - 1) × 10) CM8951 and CM8950
The storage position changes depending on the axis number and the point number.
"Lists of Devices and Error Codes for Positioning" (page 5-88)
Example
Recording the current position of axis 1 as the target coordinate of point number 1
(1)The TCHX instruction is executed.
(2)The contents of CM8830 and CM8831 (the current position of axis 1) are
transmitted to CM8000 and CM8001 (the target coordinate or travel of point
number 1).
R000 TCH
Unit number Axis number Point number
#0 #1 #2
• When the pulse output in progress flags are turned ON, the TCH instruction
Point
cannot be executed.
Operation flags
Sample Program
Set the target coordinate of point number 2 to the current position of axis 1, which was moved by a JOG
operation.
R002 #1
HIGH
R003 TCH
Unit number Axis number Point number
#0 #1 #2
Available Devices
Index
Local
Bit Devices Word Devices Const Ind Spec Device Modify
Operand
MR DM
5 R DR LR
B
T C CTC CR TM
W
T C CTH Z CM #/$*1 #TM * @ :#/:Z
n1 - - - - -
Motor (Positioning) Control
n2 - - - - -
Description
n1 Specifies the unit number; this is fixed to "0" (0: CPU built-in function)*2
n2 Specifies the axis number (1 to 4)*2, 3
*1 You cannot use "$."
*2 When you specify a bit device, 16 continuous bits will be occupied. When you specify a word device, 1
word will be occupied.
*3 The numbers of the axes that can be used vary depending on the unit.
KV-N14*T(P) and KV-N24*T(P): 1 and 2
KV-N40*T(P): 1 to 3
KV-N60AT(P): 1 to 4
Operation Description
When the execution condition turns ON, on the unit specified by n1 's axis number specified by
n2 , the travel to home position operation starts. The operation stops when pulse output is complete.
Pulse Output Positioning
Home Position Operating
Axis In Progress Complete Error Code Error Flag
Coordinate Point Number
Flag Relay
Axis 1 CM8820 CR8400 CR8401 CM8835 CM8834 CR8402
Axis 2 CM8860 CR8500 CR8501 CM8875 CM8874 CR8502
Axis 3 CM8900 CR8600 CR8601 CM8915 CM8914 CR8602
Axis 4 CM8940 CR8700 CR8701 CM8955 CM8954 CR8702
During HOME instruction execution, the pulse output in progress flags are turned ON and 1002 is
stored in the control memory entries indicated in the operating point number column.
When the workpiece travels to the point in which the current values equal the values stored in the
control memory entries indicated in the home position coordinate column, the pulse output in progress
flags are turned OFF, the positioning complete relays are turned ON, and the workpiece stops moving.
When the next pulse output starts, the positioning complete relays are turned OFF.
Scan
Execution condition
OFF
ON
CR8401, CR8501,
CR8601, CR8701 OFF
(positioning complete)
Error stop and emergency stop of the travel to home position operation
• If an error occurs during operation, the workpiece will stop moving (this is an error stop).
5
• To force operation to stop, turn the forced stop flags ON.
• When the pulse output in progress flags are turned ON, the HOME instruction
Point
cannot be executed.
• When the error flags are turned ON, the HOME instruction cannot be executed.
• The pulse output in progress flags are turned OFF during the first END process
after pulse output is completed.
• If pulse output is stopped due to a forced stop, the duty cycle of the final pulse
when output is stopped is not guaranteed.
Reference The starting speed, acceleration/deceleration time, and operating speed are the same as
for the origin returning operation.
Operation flags
Sample Program
When a rising edge on axis 1 causes input relay R000 to be turned ON, the travel to home position
operation is executed.
;<Mnemonics list>
R000 HOME LDP R000
Unit number Axis number HOME #0 #1
#0 #1
Available Devices
Index
Local
Bit Devices Word Devices Const Ind Spec Device Modify
Operand
MR DM
5 R DR LR
B
T C CTC CR TM
W
T C CTH Z CM #/$*1 #TM * @ :#/:Z
n1 - - - - -
Motor (Positioning) Control
n2 - - - - -
S - - - - -
Description
n1 Specifies the unit number; this is fixed to "0" (0: CPU built-in function)*2
n2 Specifies the axis number (1 to 4)*2, 3
S Specifies the speed to change to (1 to 100000)*4
Operation Description
When the execution condition turns ON during pulse output, on the unit specified by n1 's axis
number specified by n2 , the operating speed is changed to the value specified by S .
Execution condition Execution condition CHGTGT
turns ON recognition processing execution
Speed n1 CHGSPX
n2 S
• You cannot specify a speed that is less than the starting speed. If you specify a
Point
speed that is less than the starting speed, the starting speed will be used.
An interrupt according to
comparator 2 occurs.
5
Output Input Main routine Output Input
END
Input
processing
Interrupt program
INT
Speed CR8415
R000 CHGTGT
Unit number Axis number Speed change value
S #0 #1 #10000
RETI
ENDH
Reference Using operating speed change request relays CR8005 (axis 1), CR8105 (axis 2), CR8205
(axis 3), and CR8305 (axis 4)
Execution condition Execution condition Operating speed change
turns ON recognition request relay turns ON
Speed CR8005
CM8826
CM8827 Axis 1
operating speed
change request
Time
Speed change
For details on the operating speed change request relays, see "Lists of Devices and Error Codes
for Positioning" (page 5-88).
Reference • When you are using the operating speed change request relays to change the
operating speed, the operating speed change values are stored in CM8826 and
CM8827 (axis 1), CM8866 and CM8867 (axis 2), CM8906 and CM8907 (axis 3), and
CM8946 and CM8947 (axis 4).
• When changing speed, the point number acceleration/deceleration rate is read, and the
speed is changed according to the acceleration/deceleration rate.
- KV Nano Series(terminal block type) User’s Manual - 5-63
5-2 Motor (Positioning) Control
Operation flags
CPU BUILT-IN FUNCTIONS
5
Sample Program
Motor (Positioning) Control
Only when a rising edge causes input relay R000 to be turned ON, the operating speed of axis 1 is
changed to 10000 Hz.
CHGSP ;<Mnemonics list>
R000
Unit number Axis number Speed change value LD R000
#0 #1 #10000 CHGSP #0 #1 #10000
MEMO
Target
CHGTGT CHGTGT
coordinate
Changes the target coordinate
during positioning operation
CPU BUILT-IN FUNCTIONS
change
Available Devices
Index
Local
Bit Devices Word Devices Const Ind Spec Device Modify
Operand
MR DM
5 R DR LR
B
T C CTC CR TM
W
T C CTH Z CM #/$*1 #TM * @ :#/:Z
n1 - - - - *1 -
Motor (Positioning) Control
n2 - - - - *1 -
S - - - - -
Description
n1 Specifies the unit number; this is fixed to "0" (0: CPU built-in function)*2
n2 Specifies the axis number (1 to 4)*2, 3
S Specifies the target coordinate change value*4
*1 You cannot use "$."
*2 When you specify a bit device, 16 continuous bits will be occupied. When you specify a word device, 1
word will be occupied.
*3 The numbers of the axes that can be used vary depending on the unit.
KV-N14*T(P) and KV-N24*T(P): 1 and 2
KV-N40*T(P): 1 to 3
KV-N60AT(P): 1 to 4
*4 When you specify a bit device, 32 continuous bits will be occupied.
When you specify a word device, 2 continuous words will be occupied.
If you specify a relay other than the channel's leading relay (such as R002, R106, and R1012), the next
channel will also be used to provide the necessary 32 bits.
Operation Description
When the execution condition turns ON during pulse output, on the unit specified by n1 's axis
number specified by n2 , the target coordinate is changed to the value specified by S .
Target coordinate
n1 CHGSPX
n2 S
coordinate
• Requests to execute this function will not be accepted when the positioning
Point
operation is within 250 µs of completion, when a deceleration stop is in
progress due to the deceleration stop relay, and during fixed dimension
Reference Using target coordinate change request relays CR8006 (axis 1), CR8106 (axis 2),
CR8206 (axis 3), and CR8306 (axis 4)
5
Execution condition Execution condition Target coordinate change
Time
Target coordinate change
For details on the target coordinate change request relays, see "Lists of Devices and Error Codes
for Positioning" (page 5-88).
Reference When you are using the target coordinate change request relays to change the target
coordinate, the target coordinate change values are stored in CM8828 and CM8829 (axis
1), CM8868 and CM8869 (axis 2), CM8908 and CM8909 (axis 3), and CM8948 and
CM8949 (axis 4).
Operation flags
Sample Program
Only when a rising edge causes input relay R000 to be turned ON, the target coordinate of axis 1 is
changed to 10000.
;<Mnemonics list>
R000 CHGTGT LD R000
Unit number Axis number Target coordinate CHGTGT #0 #1 #10000
#0 #1 #10000
Available Devices
Index
Local
Bit Devices Word Devices Const Ind Spec Device Modify
Operand
MR DM
5 R DR LR
B
T C CTC CR TM
W
T C CTH Z CM #/$*1 #TM * @ :#/:Z
n1 - - - - -
Motor (Positioning) Control
n2 - - - - -
Description
n1 Specifies the unit number; this is fixed to "0" (0: CPU built-in function)*2
n2 Specifies the axis number (1 to 4)*2, 3
*1 You cannot use "$."
*2 When you specify a bit device, 16 continuous bits will be occupied. When you specify a word device, 1
word will be occupied.
*3 The numbers of the axes that can be used vary depending on the unit.
KV-N14*T(P) and KV-N24*T(P): 1 and 2
KV-N40*T(P): 1 to 3
KV-N60AT(P): 1 to 4
Operation Description
RFSPS When the execution condition turns ON, on the unit specified by n1 's axis number
specified by n2 , the current coordinate (axis 1: CM8830, axis 2: CM8870, axis 3:
CM8910, and axis 4: CM8950) and current speed (axis 1: CM8832, axis 2: CM8872,
axis 3: CM8912, and axis 4: CM8952) are updated to the newest values.
Axis Current Coordinate Current Speed
Axis 1 CM8831 and CM8830 CM8833 and CM8832
Axis 2 CM8871 and CM8870 CM8873 and CM8872
Axis 3 CM8911 and CM8910 CM8913 and CM8912
Axis 4 CM8951 and CM8950 CM8953 and CM8952
Operation flags
Sample Program
5
#10000 #20000 Axis 1
Axis 1 Axis 2 stop sensor input
current current
coordinate coordinate CR8115
The functions that are used during positioning control are listed below.
For details on each function, see the reference page specified.
5
Travel to home position HOME Starts the travel to home position operation 5-74
Speed change CHGSP Changes the speed during operation 5-75
Target coordinate change CHGTGT Changes the target coordinate during operation 5-76
Motor (Positioning) Control
Operation Description
PSTRT When the execution condition turns ON, on the unit specified by n1 's axis number
specified by n2 with the setting details of the point number specified by n3 , the
positioning operation is started.
When the operation is completed, the workpiece stops moving.
Format example
PSTRT(MR0,0,1,2)
MR000 PSTRT
Unit number Axis number Point number
#0 #1 #2
Execution condition
• When the pulse output in progress flags are turned ON, the PSTRT function
Point
cannot be executed.
• When the error flags are turned ON, the PSTRT instruction cannot be executed.
• The pulse output in progress flags are turned OFF during the first END process
after pulse output is completed.
• If the pulse output is stopped by an emergency stop, the current position
information may be lost.
Also, the duty cycle of the final pulse when pulse output is stopped cannot be
guaranteed.
• If you set the parameters so that the number of output pulses is 0, the pulse
output in progress flags will not be turned ON. The positioning complete relays
will be turned ON. In this situation, no warnings will occur.
Origin
*1 The values within the brackets may be omitted. (If you omit the execution conditions, the function will
Motor (Positioning) Control
Operation Description
ORG When the execution condition turns ON, on the unit specified by n1 's axis number
specified by n2 , the origin returning operation starts. The operation stops when pulse
output is complete.
Format example
ORG(MR0,0,1)
MR000 ORG
Unit number Axis number
#0 #1
Execution condition
• When the pulse output in progress flags are turned ON, the ORG instruction
Point
cannot be executed.
• When the error flags are turned ON, the ORG instruction cannot be executed.
• The pulse output in progress flags are turned OFF during the first END process
after pulse output is completed.
• If the pulse output is stopped by a forced stop, the current position information
may be lost.
Also, the duty cycle of the final pulse when pulse output is stopped cannot be
guaranteed.
TCH Teaching
Operation Description
TCH When the execution condition turns ON, on the unit specified by n1 's axis number
specified by n2 , the current value is read and stored in the target coordinate or the travel
of the point number specified by n3 .
Format example
TCH(MR0,0,1,2)
MR000 TCH
Unit number Axis number Point number
#0 #1 #2
Execution condition
• When the pulse output in progress flags are turned ON, the TCH instruction
Point
cannot be executed.
• When the error flags are turned ON, the TCH instruction cannot be executed.
Home
*1 The values within the brackets may be omitted. (If you omit the execution conditions, the function will
Motor (Positioning) Control
Operation Description
HOME When the execution condition turns ON, on the unit specified by n1 's axis number
specified by n2 , the travel to home position operation starts. The operation stops when
pulse output is complete.
Format example
HOME(MR0,0,1)
MR000 HOME
Unit number Axis number
#0 #1
Execution condition
• When the pulse output in progress flags are turned ON, the HOME instruction
Point
cannot be executed.
• When the error flags are turned ON, the HOME instruction cannot be executed.
• The pulse output in progress flags are turned OFF during the first END process
after pulse output is completed.
• If the pulse output is stopped by a forced stop, the current position information
may be lost.
Also, the duty cycle of the final pulse when pulse output is stopped cannot be
guaranteed.
S Speed change
value
Specifies speed change value
(1 to 100,000) .U .U .D .D - - - 5
R Return value Return value - - - - - - - - - -
Operation Description
CHGSP When the execution condition turns ON during pulse output, on the unit specified by n1 's
axis number specified by n2 , the operating speed is changed to the value specified by
S .
Format example
CHGSP(MR0,0,1,50000)
MR000 CHGSP
Unit number Axis number Speed change value
#0 #1 #50000
Execution condition
• You cannot specify a speed that is less than the starting speed. If you specify a
Point
speed that is less than the starting speed, the starting speed will be used.
• When the execution condition is turned ON, the new value to change the speed
to is always applied. (It takes a maximum of 1.2 ms until the change is applied
to operation.)
Change target
5 S Target coordinate
change value
Specifies the target coordinate change value. .U .U .D .D - - -
*1 The values within the brackets may be omitted. (If you omit the execution conditions, the function will
always be executed—every scan.)
*2 You cannot use "$" (hexadecimal specification only).
*3 The numbers of the axes that can be used vary depending on the unit.
KV-N14*T(P) and KV-N24*T(P): 1 and 2
KV-N40*T(P): 1 to 3
KV-N60AT(P): 1 to 4
Operation Description
CHGTGT When the execution condition turns ON during pulse output, on the unit specified by n1 's
axis number specified by n2 , the target coordinate is changed to the value specified by
S .
Format example
CHGTGT(MR0,0,1,100000)
MR000 CHGTGT
Unit number Axis number Target coordinate
#0 #1 #100000
Execution condition
• Requests to execute this function will not be accepted when the positioning
Point
operation is within 250 µs of completion, when a deceleration stop is in
progress due to the deceleration stop relay, and during fixed dimension
operations caused by the stop sensor input.
• When the target coordinate is changed to a coordinate that is in the direction
opposite to the direction of travel (example: if you specify a target coordinate
that is smaller than the current coordinate during operation in the normal
direction), an operation will be performed to move the workpiece in the reverse
direction.
• After the execution condition turns ON, it takes a maximum of 1.2 ms until the
change is applied to operation.
Operation Description
RFSPS When the execution condition turns ON, on the unit specified by n1 's axis number
specified by n2 , the current coordinate (axis 1: CM8830, axis 2: CM8870, axis 3:
CM8910, and axis 4: CM8950) and current speed (axis 1: CM8832, axis 2: CM8872, axis 3:
CM8912, and axis 4: CM8952) are updated to the newest values.
Format example
RFSPS(MR0,0,1)
MR000 RFSPS
Unit number Axis number
#0 #1
Execution condition
Output common
MR004 Point 0 travel
R500 instruction
R501 FG
Stepping motor
R502
R503
1 Click on the KV STUDIO toolbar to display the "CPU positioning parameter edit" window.
Program examples
MR003 #1
HIGH
JOG operating speed mode
5
= ONDL
Unit number Axis number Point number
point 3 ONDL #100 MR012
#0 #1 #3 CON
Axis 1 positioning #2 MR012
complete relay Axis 1 operating AND MR012
point number PSTRT #0 #1 #3
INT
R000
CR2002 PSTRT
Unit number Axis number Point number
#0 #1 #1
Always turned ON
RETI
ENDH
Using comparator 2 interrupt relays CR8415 (axis 1), CR8515 (axis 2), CR8615
CPU BUILT-IN FUNCTIONS
Interrupt processing
<Mnemonics list>
CR2008 LD CR2008
EI
END
LD CR2002
INC DM5000 5
RETI
ENDH
DM5000 MOV.D
= #150000 CM8806
#2
Axis 1
comparator 2
CHGSP
Unit number Axis number Speed change value
#0 #1 #25000
DM5000 CHGSP
= Unit number Axis number Speed change value
#2 #0 #1 #20000
CR2002 DM5000
INC
Always turned ON
RETI
ENDN
Speed
CPU BUILT-IN FUNCTIONS
25000
20000
15000
Starting
speed
Reference For details about the timing that the speed is changed with, see "Changing the
Using operating speed change request relays CR8005 (axis 1), CR8105 (axis 2),
Motor (Positioning) Control
On the rising edge of MR104, the speed change request relay is turned ON, the value 3000 is written to
CM8826 and CM8827 (the speed to change to), and the PSTRT instruction is used to start pulse
output.
On the rising edge of MR105, 5000 is written to CM8826 and CM8827 (the speed to change to).
On the rising edge of MR106, 6000 is written to CM8826 and CM8827 (the speed to change to).
On the rising edge of MR107, 7000 is written to CM8826 and CM8827 (the speed to change to).
On the rising edge of MR108, the speed change request relay is turned OFF, stop sensor input CR8015
is turned ON, and the workpiece decelerates and stops.
<Mnemonics list>
MR104 MOV.D
#3000 CM8826 LDP MR104
CM8826
5
Axis 1
stop sensor input
3000
Time
Reference For details about the timing that the speed is changed with, see "Changing the
speed during operation" (page 5-40).
The target value or travel of each point is stored in CM entries, so you can perform positioning with
multiple points by using a ladder circuit to rewrite the contents of CM entries.
For example, you can change the target value of point number 1 of axis 1 by rewriting the appropriate
target value or travel contents (CM8000, CM8001).
Example
5
Axis 1 point 1 target
value/travel
MR111 +20000 PSTRT
DW_L Unit number Axis number Point number
Motor (Positioning) Control
#0 #1 #1
CM8000
Axis 1 point 1 target
value/travel
MR112 +60000 PSTRT
ONDL Unit number Axis number Point number
#0 #1 #1
CM8000
Axis 1 point 1 target
value/travel
"How to use the menu" (page 5-7)
Reference For details about operations when the coordinate is changed, see "Changing the
target coordinate during operation" (page 5-43).
5
Axis 1 point target MOV #20 CM8003
value/travel MOV.L +60000 CM8004
MOV.L
MPS
#20 CM8002 SET CM8006.0
Attribute
Axis 1 Axis 2 Axis 3 Axis 4 Description R: Read only
Blank: Read/write
CR8000 CR8100 CR8200 CR8300 Forced stop
CR8001 CR8101 CR8201 CR8301 Deceleration stop
CR8002 CR8102 CR8202 CR8302 Error clear
CR8003 CR8103 CR8203 CR8303 Warning clear
Current coordinate Only valid when pulse
CR8004 CR8104 CR8204 CR8304
5 CR8005 CR8105 CR8205 CR8305
change request
Operating speed
stop in progress
Only valid when pulse
change request output in progress
Motor (Positioning) Control
Attribute
Axis 1 Axis 2 Axis 3 Axis 4 Description R: Read only
Blank: Read/write
5
0 0 Not used as stop or origin sensor input
0 1 Used as stop sensor input
1 0 Used as origin sensor input
Motor (Positioning) Control
1 1 Invalid setting
bit5 bit4 R002 Input Setting
0 0 Not used as stop or origin sensor input
0 1 Used as stop sensor input
1 0 Used as origin sensor input
1 1 Invalid setting
bit7 bit6 R003 Input Setting
0 0 Not used as stop or origin sensor input
0 1 Used as stop sensor input
1 0 Used as origin sensor input
1 1 Invalid setting
bit9 bit8 R004 Input Setting
0 0 Not used as stop or origin sensor input
0 1 Used as stop sensor input
1 0 Used as origin sensor input
1 1 Invalid setting
bit11 bit10 R005 Input Setting
0 0 Not used as stop or origin sensor input
0 1 Used as stop sensor input
1 0 Used as origin sensor input
1 1 Invalid setting
bit13 bit12 R006 Input Setting
0 0 Not used as stop or origin sensor input
0 1 Used as stop sensor input
1 0 Used as origin sensor input
1 1 Invalid setting
bit15 bit14 R007 Input Setting
0 0 Not used as stop or origin sensor input
0 1 Used as stop sensor input
1 0 Used as origin sensor input
1 1 Invalid setting
*1 CW direction limit switch enable and CCW direction limit switch enable
If these bits are not set to 1 (enabled), the limit switch input will not be received.
These settings have higher priority than any other settings related to limit switches. Even if the
limit switches are assigned by the current position comparator settings, these bits must be set to
1 (enabled).
When you are using KV STUDIO to set parameters, these bits are automatically set to enabled.
5 0
0
0
1
Not used
Stop sensor
1 0 Soft limit switch CW
Motor (Positioning) Control
Status
Attribute
Axis 1 Axis 2 Axis 3 Axis 4 Description R: Read only
Blank: Read/write
Current coordinate
CM8830 CM8870 CM8910 CM8950
(Can be changed through current
CM8831 CM8871 CM8911 CM8951
coordinate change requests)
CM8832 CM8872 CM8912 CM8952 R
Current speed
CM8833 CM8873 CM8913 CM8953
CM8834 CM8874 CM8914 CM8954 Error code
CM8835 CM8875 CM8915 CM8955 Execution point number
Point parameters
Attribute
bit
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Error codes
Operations were stopped because a forced Turn the forced stop relay OFF or switch the
30 stop relay (CR) was turned ON or because mode to RUN mode, and then execute the
the mode was switched to PROG mode. operation again.
A limit error occurred. Operations were Remove the workpiece from the range of the
31 stopped because of input from the CW limit limit switch.
switch. If the limit switch was erroneously turned ON,
check the wiring and the polarity of the limit
A limit error occurred. Operations were switch. If there are no problems with the
32 stopped because of input from the CCW limit wiring and the polarity, check that the limit
switch.
switch is operating correctly.
The motor's rotation direction and the actual
The workpiece moved in the CW (CCW) orientation of the limit switch are reversed.
33 direction, and input from the CCW (CW) limit Reverse the motor rotation direction, change
switch was detected. the wiring of the limit switch, or attach the
limit switch in the correct orientation.
Even if you turn the error clear relay ON, the
error will not be cleared. To clear the error,
switch from PROG mode to RUN mode or
An attempt was made to perform positioning restart the product.
80 control with the number of a non-existant axis To prevent the same error from occurring
or with a relay output type base unit. again, specify axis numbers that match the
number of axes of the base unit.
The positioning operation cannot be
performed with relay output types.
An internal device may not be operating
correctly. If the same error still occurs even
90 A system error has occurred. after you restart the product, or if the same
error occurs frequently, contact your
KEYENCE representative.
You can use PLSOUT, the dedicated instruction for specified frequency pulse output, to easily generate
pulses at the specified frequency from the CPU's output relay just by specifying the high-speed counter
to use, the output frequency, and the duty cycle.
PLSOUT instruction
5
CTH1 Pulse output from R501
frequency
Available Devices
Index
Local
Bit Devices Word Devices Const Ind Spec Device Modify
Operand
MR DM
5 R DR LR
B
T C CTC CR TM
W
T C CTH CTC Z CM #/$*1 #TM * @ :#/:Z
n1 - - - - - - - - - - - - - - - - - -
Specified Frequency Pulse Output
S - - - - -
n2 - - - - -
Operand Description
n1 Specifies the number of the high-speed counter to use (0 to 3)*1, 3
Specifies the frequency (0 to 100000) in Hz, or specifies the leading device that is storing the frequency
S When you specify a bit device, 32 continuous bits will be occupied. When you specify a word device, 2
words will be occupied.*1, 2
Specifies the duty cycle (-499 to 499) of the output pulse, or specifies the leading device that is storing
the duty cycle
When you specify a bit device, 16 continuous bits will be occupied. When you specify a word device, 1
word will be occupied.*1, 2
Value -499 … …
(Duty cycle - 50) × 10 0 499
n1
Duty cycle
TON/(TON + TOFF) 0.1% … 50.0% … 99.9%
ON ON ON
Operation Description
While the execution condition is turned ON, pulses are generated from the output relay at the frequency
specified by S . The number of the high-speed counter to use is specified with n1 . The duty
cycle of the pulses to generate is specified with n2 .
Pulse output is stopped when the execution condition is turned OFF.
"Specified Frequency Pulse Output" (page 5-95)
• You cannot simultaneously execute two or more PLSOUT instructions that use
Point
the same high-speed counter (specified by its number).
Operation flags
5
CR2009 No change in status
Sample Program
While R000 is turned ON, pulses will be generated from R501 at the frequency (duty cycle: 50%) specified by
DM1 and DM0 (CTH1 will be used).
;<Mnemonics list>
R000 DM0
LD R000
PLSOUT 1
PLSOUT #1 DM0 +0
+0
the set value matches the current value, the high-speed counter comparator is turned ON.
You can use CTH and CTC to perform interrupt processing and pulse output that do not rely on the
scan time.
Item Specification
5 Number of channels
Input response frequency
KV-N14** and KV-N24**: 2. KV-N40**: 3. KV-N60**: 4.
Single-phase: 100 kHz; phase difference: 50 kHz
High-Speed Counter
Other functions or instructions that use the same high-speed counter (specified
Point
by its number) cannot be used at the same time.
For details about the input relays, see “Wiring and Internal Circuit Diagrams” for each base unit.
Input terminal 0 Count input 0 32-bit, high-speed counter CTH0 input capture function
5
A-phase External input (A-phase and B- function 0 Input capture condition *1
B-phase phase) CTH0 Storage device*2
Internal clock
Direct clock pulse input
Control circuit 0 Output terminal 0
High-Speed Counter
Enable input Comparator matching
Preset (Z-phase) input (preset value) output
Input terminal 1 Count input 1 32-bit, high-speed counter CTH1 input capture function
A-phase External input (A-phase and B- function 1 Input capture condition *1
B-phase phase) CTH1 Storage device*2
Internal clock
Direct clock pulse input
Control circuit 1 Output terminal 1
Enable input Comparator matching
Preset (Z-phase) input (preset value) output
Input terminal 2 Count input 2 32-bit, high-speed counter CTH2 input capture function
A-phase External input (A-phase and B- function 2 Input capture condition *1
B-phase phase) CTH2 Storage device*2
Internal clock
Direct clock pulse input
Control circuit 2 Output terminal 2
Enable input Comparator matching
Preset (Z-phase) input (preset value) output
Input terminal 3 Count input 3 32-bit, high-speed counter CTH3 input capture function
A-phase External input (A-phase and B- function 3 Input capture condition *1
B-phase phase) CTH3 Storage device*2
Internal clock
Direct clock pulse input
Control circuit 3 Output terminal 3
Enable input Comparator matching
Preset (Z-phase) input (preset value) output
Direct
clock pulse*3
*1 This is direct clock pulse output that can be counted with a high-speed counter.
*2 These are the relay numbers that are generated by comparator matching output.
High-Speed Counter
specifies the count range, input mode, and values. However, if you use the CPU high-speed counter
setup wizard, all you have to do is specify the items as indicated by the wizard, and the ladder program
that is required for the high-speed counter will be created automatically.
• If you want to use the CPU high-speed counter setup wizard, see page 5-105 to page 5-112.
• If you want to create and edit the ladder program while checking the items, see page 5-113 to page 5-
155.
If you use the CPU high-speed counter setup wizard, all you have to do is select the setup items, and
the ladder program that is required to use the CPU built-in high-speed counter will be created
automatically. The ladder program will be registered under a name from "INIT_CTH0" to "INIT_CTH3"
according to the scanning module.
Execute counting
The execution condition of the high-speed counter instruction (the CTH instruction) is turned ON.
"CTH Instructions" (page 5-132)
Reference With the KV Nano Series, the counter numbers that can be used vary depending on the
model.
If you create a program that can be used on all KV Nano Series models and then use this
program after changing models in your project to match the scope of your system, you can
5 use the "CTH present" flag to create programs in which the counter instruction is not
executed if the specified counter number indicates a unit that does not exist.
High-Speed Counter
Example) If you create a ladder program like that shown below, the CTH instruction will
not be executed on the KV-N14** and KV-N24**, which do not have high-speed
counter 2.
When you are using a high-speed counter, set the following items through a ladder program.
Count range
Set the range within which counting is performed.
• Linear counter...Counting is performed within a 32-bit range.
• Ring counter .....The upper and lower limits are set to arbitrary values, and counting is performed
within the specified range.
"Setting the Count Range" (page 5-114)
Input mode
Set the mode to use for count input, and log the high-speed counter instruction (the CTH instruction).
• External input....The single phase, phase difference, and 2-pulse pulse input is counted.
• Internal clock.....The 50 ns, 1 µs, 10 µs, and 100 µs internal clocks are counted.
• Direct clock pulse (specified frequency pulse) output...... Output pulses using another high-speed
counter are counted.
"Count Input Settings" (page 5-116)
Set Value
Set the count up or count down value (CTC).
Reset
Set the current value of the high-speed counter (CTH) to 0.
• RES instruction
• CTH instruction
• Automatic reset based on comparator matching
• External preset input
• Reset based on counter enable function
"Reset Mode" (page 5-121)
5
Count enable and disable
High-Speed Counter
You can use the count enable function to enable and disable the execution of the counter.
"Enabling and Disabling Counting (Counter Enable Function)" (page 5-126)
The settings that are configured with the CPU high-speed counter setup wizard are described below.
Channel selection
CH0
Step 1, (page 5-105)
CH1
CH2
CH3
Operation mode selection
Up/down count
Step 2, (page 5-105)
Preset count
Set count
Count range
Step 4, (page 5-108)
Count mode
Initial value setting
Consistent comparator
When current value=set value
operation setting
Setting default value
Step 5, (page 5-109)
When the operation When the operation When the operation mode
mode is up/down count mode is preset count is enable accu count
1 In KV STUDIO, on the "Tool" menu, click "CPU high-speed counter setting wizard" to start the
CPU high-speed counter setup wizard.
Specify the high-speed counter channel that you want to set, and then click Next.
High-Speed Counter
Reference The number of channels that you can select varies depending on the base unit that you
are using.
KV-N14** and KV-N24**: CTH0 and CTH1
KV-N40**: CTH0 to CTH2
KV-N60**: CTH0 to CTH3
Up count
Count input
Down count
Overflow*
(1)
Current value
(2)
Overflow*
5 * Overflows do not occur when the ring counter counting mode is selected.
Reference • Use page 2/4 of the CPU high-speed counter setup wizard to set the count mode and
count range.
• If an overflow is detected, CR4206 (CTH0), CR4406 (CTH1), CR4606 (CTH2), and
CR4806 (CTH3) are all turned ON.
Preset count mode
In this mode, when a preset input (external input) is applied, the current value is changed to the preset
value.
Up count
Count input
Down count
Preset input
(1)
Preset value
Current value
(2)
Reference Use page 2/4 of the CPU high-speed counter setup wizard to set the count mode and
count range.
5-106 - KV Nano Series(terminal block type) User’s Manual -
5-4 High-Speed Counter
ON
Enable input
OFF
(1)
Current value 5
High-Speed Counter
(2)
ON
Enable input
OFF
(1)
Current value
Reset value
(2)
Reference Use page 2/4 of the CPU high-speed counter setup wizard to set the count mode and
count range.
5
High-Speed Counter
Item Description
Select this when you want to use the high-speed counter to count external
External input
input.
Select the count input mode from the list.
Options : 1-phase (w/o direction), 1-phase (w/ direction), Phase difference (1x),
Count input mode
Phase difference (2x), Phase difference (4x), and 2-pulse
"Count Input Settings" (page 5-116)
Select the input time constant from the list.
Input time constant Options : 10µs, 20µs, 110µs, 500µs, 1ms, 2.5ms, 5ms, and 10ms
"Input Time Constant Setting" (page 5-198)
Select this when you want to use the internal clock and direct pulses (specified
Internal input
frequency pulses) to perform counting.
Select an internal clock from the list.
Internal clock input Options : 50ns, 1.0µs, 10.0µs, and 100.0µs
"Counting the Internal Clock" (page 5-119)
Select this when you want to count direct clock pulses or specified frequency
pulse output.
CTH0: R500; CTH1: R501; CTH2: R502; and CTH3: R503
Direct clock pulse input
* You cannot specify the number of the currently set high-speed counter.
"Counting Direct Clock Pulse (Specified Frequency Pulse) Output" (page 5-
119)
Item Description
Set the count (current value) range.
5
not be turned ON.
"Ring counter" (page 5-115)
When the CPU operation mode changes from PROG to RUN, the current value
Initial value setting
High-Speed Counter
is overwritten with the specified default value.
Item Description
If you select this check box, the output relay will operate when the current
Use comparator
value and the comparator value (the set value) match.
With the KV Nano Series, the relay that output is generated from when the
Output relay comparator matches the current value is fixed.
CTH0: R500; CTH1: R501; CTH2: R502; and CTH3: R503
When current value (CTH0, Configure the settings to indicate the behavior when the current value (CTH0,
CTH1, CTH2, or CTH3)= CTH1, CTH2, or CTH3) is equal to the set value (CTC0, CTC1 or CTC2,
set value (CTC0, CTC1 or CTC3 or CTC4, CTC5 or CTC6, or CTC7). For the current value, you can
CTC2, CTC3 or CTC4, CTC5 select "Zero clear" or "No zero clear." For the output relay, you can select
or CTC6, or CTC7) "ON," "OFF," "Inverted," or "No change."
Setting (CTC0, CTC1 or
CTC2, CTC3 or CTC4, CTC5 Specify the default setting of the high-speed counter comparator (CTC0,
or CTC6, or CTC7) default CTC1 or CTC2, CTC3 or CTC4, CTC5 or CTC6, or CTC7).
value
The following steps vary according to the operation mode that you selected in step 2.
• If the mode is "Up/down count" ...................................Go to step 8
• If the mode is "Preset count" .......................................Go to step 6
CPU BUILT-IN FUNCTIONS
5
High-Speed Counter
Item Description
Specify the preset value that the current value will be rewritten as when preset
input is applied.
Specify a preset value that is within the range that you have specified with the
"Count range" setting.
* The number of the device on which the preset value will be stored varies
Preset value
according to the counter number.
Device number 0: CM4807 and CM4806
Device number 1: CM4817 and CM4816
Device number 2: CM4827 and CM4826
Device number 3: CM4837 and CM4836
Select the input polarity of the preset input relay.
NO contact: The preset is executed when the external input is turned ON.
NC contact: The preset is executed when the external input is turned OFF.
Polarity of preset input
* The preset input relay varies according to the type of the base unit and the
relay
counter number.
"High-Speed Counter Device Numbers Categorized by Function" (page 5-
100)
Select the timing with which the preset is performed when preset input is
applied.
Up edge : The preset is executed on the rising edge of the external preset
input relay.
Down edge : The preset is executed on the falling edge of the external preset
Preset timing
input relay.
Level : When the polarity of the external preset input relay is NO (A
contact), the preset will be executed while the relay is turned ON.
When the polarity of the external preset input relay is NC (B
contact), the preset will be executed while the relay is turned OFF.
High-Speed Counter
Item Description
Select the enable condition of counting.
When an internal relay is in the enabled state:
When an internal relay is turned ON, counting is enabled.
When an external input is in the enabled state:
If the external input polarity is NO, counting is enabled when the
external input is turned ON.
If the external input polarity is NC, counting is enabled when the
external input is turned OFF.
Counting enable condition
When an internal relay is in the enabled state and an external input is in the
enabled state:
Counting is enabled when the internal relay is turned ON and the
external input is in the enabled state.
When an internal relay is in the enabled state or an external input is in the
enabled state:
Counting is enabled when the internal relay is turned ON or the external
input is in the enabled state.
Select the input polarity of the external enable input relay.
NO contact : When external input is turned ON: .............. Enabled
When external input is turned OFF: ............ Disabled
NC contact : When external input is turned ON: .............. Disabled
External input polarity When external input is turned OFF: ............ Enabled
* The external enable input relay varies according to the type of the base unit
and the counter number.
"High-Speed Counter Device Numbers Categorized by Function" (page 5-
100)
This is fixed to "Fix of NO contact." This setting cannot be changed.
* The internal relays that are used with the enable input vary according to the
Polarity of internal relay counter number.
"High-Speed Counter Device Numbers Categorized by Function" (page 5-
100)
8 Specify the name of the module to output and confirm the high-speed counter settings.
Specify the name of the module that will be generated as a ladder program that contains the settings
CPU BUILT-IN FUNCTIONS
you have configured with the CPU high-speed counter setup wizard.
Confirm the CPU high-speed counter settings, and then click Finish to complete the setup process.
5
High-Speed Counter
High-Speed Counter
Input capture
When an interruption occurs, the current value of the high-speed counter is stored in control memory
(CM).
"Acquiring the Current Value Based on Input Capture" (page 5-130)
Reference You can easily generate pulses by using the specified frequency pulse output function.
Expansion function
You can use dedicated instructions to easily execute expansion functions that use the high-speed
counter.
• Frequency measurement function ..............Measures the frequency of external pulse input
"5-5 Frequency Counter" (page 5-156)
• Rotation speed measurement function .......Measures the rotation speed of external pulse input
"5-5 Frequency Counter" (page 5-156)
• Specified frequency pulse output function ..Generates pulses at the specified frequency
"5-3 Specified Frequency Pulse Output" (page 5-95)
Use the count mode and the signed status of values to set the range of the value that you will count
using the high-speed counter.
Linear counter
The linear counter counts the value within a 32-bit counting range.
Unsigned 32-bit
Up counting and down counting are performed in the range of 0 to 4294967295.
5
If up counting is performed when the value is 4294967295, the value will become 0. If down counting is
performed when the value is 0, the value will become 4294967295.
In these situations, the overflow detection relays (CR4206, CR4406, CR4606, and CR4806) will be
High-Speed Counter
turned ON.
Signed 32-bit
Up counting and down counting are performed in the range of -2147483648 to +2147483647.
If up counting is performed when the value is +2147483647, the value will become -2147483648. If
down counting is performed when the value is -2147483648, the value will become +2147483647.
In these situations, the overflow detection relays (CR4206, CR4406, CR4606, and CR4806) will be
turned ON.
The overflow detection relays will remain turned ON until they are turned OFF with an RES instruction or
similar instruction.
Up count
Count input
Down count
Unsigned Signed
Overflow
Upper limit 4294967295 +2147483647
($FFFFFFFF) ($7FFFFFFF)
Count value
Overflow detection
CTH0:CR4206, CTH1:CR4406,
CTH2:CR4606, CTH3:CR4806
Counting will not stop even if an overflow is detected. Counting will only stop
Point
when the count input is stopped.
Ring counter
You can use the ring counter to set arbitrary upper and lower limits to the high-speed counter.
Setting ranges of the count value and storage destinations of the upper and lower limits
Count Mode
Selection
Signed Setting Count Value Range
Upper
Limit
Lower
Limit 5
CR4210 ON CM4801 OFF 0 to 4294967295 CM4805 CM4803
CTH0
High-Speed Counter
(ring counter) bit 7 ON -2147483648 to +2147483647 CM4804 CM4802
CR4410 ON CM4811 OFF 0 to 4294967295 CM4815 CM4813
CTH1
(ring counter) bit 7 ON -2147483648 to +2147483647 CM4814 CM4812
CR4610 ON CM4821 OFF 0 to 4294967295 CM4825 CM4823
CTH2
(ring counter) bit 7 ON -2147483648 to +2147483647 CM4824 CM4822
CR4810 ON CM4831 OFF 0 to 4294967295 CM4835 CM4833
CTH3
(ring counter) bit 7 ON -2147483648 to +2147483647 CM4834 CM4832
Example
Ring counter settings of MOV.D
CR2008
high-speed counter #10000 CM4804
• Overflows will not be detected even if the upper or lower limit is exceeded.
Point
Up count
Count input
Down count
CTH0:[CM4805・CM4804]
CTH1:[CM4815・CM4814]
Upper limit
CTH2:[CM4825・CM4824]
CTH3:[CM4835・CM4834]
• If you change the current value of the high-speed counter or the upper or lower
limit of the ring counter, and if the current value of the counter is then within the
range specified by the lower and upper limits, the counter's current value will
be corrected during the execution of the END instruction.
• If the current value exceeds the upper limit, it will be corrected to the upper
limit.
• If the current value is smaller than lower limit, it will be corrected to the lower
limit.
• Do not set the limits so that the upper limit is less than or equal to the lower
limit. Doing so will prevent normal counting from being executed.
The high-speed counter can count three values: external input, the internal clock, and direct clock pulse
output.
5 CTH0
A-Phase B-Phase A-Phase B-Phase A-Phase B-Phase A-Phase B-Phase
R004 R005 R004 R005 R008 R009 R008 R009
CTH1 R006 R007 R006 R007 R010 R011 R010 R011
High-Speed Counter
Example
Using high-speed counter HSP
CTH0 to count external R004
CTH.D 0
R004
When you are using external input, be sure to set the input time constant.
Point
You can use the HSP instruction to set the input time constant to 10 µs.
"Input Time Constant Setting" (page 5-198)
You can use one of the count input modes shown below (single phase, phase difference, and 2-pulse)
to count external input with the high-speed counter.
Set the count input mode in combinations of CR4313 to CR4315 (CTH0), CR4513 to CR4515 (CTH1),
CR4713 to CR4715 (CTH2), and CR4913 to CR4915 (CTH3).
High-Speed Counter
(1) Single phase
Select this option when you want to count single-phase pulses.
W/ direction ....... Up counting is performed on A-phase rising edges when the B-phase is turned OFF.
Down counting is performed on the A-phase rising edges when B-phase is turned ON.
OFF OFF
ON ON
(B-phase) (B-phase)
OFF OFF
1x..............When the B-phase is turned OFF, up counting is performed on A-phase rising edges.
When the B-phase is turned OFF, down counting is performed on A-phase falling edges.
ON
(A-phase)
OFF
ON
(B-phase)
OFF
(Counter value)
0 1 2 3 4 3 2 1 0
2x..............When the B-phase is turned OFF, up counting is performed on A-phase rising edges.
When the B-phase is turned OFF, down counting is performed on A-phase falling edges.
When the B-phase is turned ON, down counting is performed on A-phase rising edges.
CPU BUILT-IN FUNCTIONS
When the B-phase is turned ON, up counting is performed on A-phase falling edges.
ON
(A-phase)
OFF
ON
(B-phase)
OFF
(Counter value)
5
0 1 2 3 4 5 6 7 8 7 6 5 4 3 2 1 0
4x..............When the B-phase is turned OFF, up counting is performed on A-phase rising edges.
High-Speed Counter
When the B-phase is turned OFF, down counting is performed on A-phase falling edges.
When the B-phase is turned ON, down counting is performed on A-phase rising edges.
When the B-phase is turned ON, up counting is performed on A-phase falling edges.
When the A-phase is turned OFF, down counting is performed on B-phase rising edges.
When the A-phase is turned OFF, up counting is performed on B-phase falling edges.
When the A-phase is turned ON, up counting is performed on B-phase rising edges.
When the A-phase is turned ON, down counting is performed on B-phase falling edges.
ON
(A-phase)
OFF
ON
(B-phase)
OFF
(Counter value)
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(3) 2-pulse
Select this option when you want to count pulses that are applied with the 2-pulse mode.
Up counting is performed on A-phase rising edges. Down counting is performed on B-phase rising
edges.
ON
(A-phase)
OFF
ON
(B-phase)
OFF
(Counter value)
0 1 2 3 4 3 2 1 0
Example
Using high-speed counter
CTH.D 0
CTH0 to count the internal CR4201
clock (1.0 µs)
5
"CTH Instructions" (page 5-132)
High-Speed Counter
Counting Direct Clock Pulse (Specified Frequency Pulse) Output
When you are counting direct clock pulse or specified frequency pulse output, specify the following
output relays.
"Direct Clock Pulse Output" (page 5-145)
"5-3 Specified Frequency Pulse Output" (page 5-95)
Example
Because the comparator matching output (R500 to R503) is processed within the
Point
PLC, the processing is not reflected in the status of the ladder program.
"Comparator Matching Output" (page 5-128)
Use high-speed counter comparators CTC0 to CTC7 to set the values of the high-speed counters.
CTH0 is matched against CTC0 or CTC1.
CTH1 is matched against CTC2 or CTC3.
CTH2 is matched against CTC4 or CTC5.
CTH3 is matched against CTC6 or CTC7.
If CTH and CTC match when no CTC interrupt program is available, the CTC contact is turned ON.
Use the RES instruction or a similar instruction to turn the contact OFF. When a CTC interrupt program
is available, the CTC contact will not be turned ON.
5 Signed Setting Count Value Range
High-Speed Counter
Comparator
High-Speed Counter
Example
The value of CTC0 is set to
HSP
100 and the value of CTC1 is R004
set to 100000.
CTH.D 0
R004
#100
CTC 0
#100000
CTC 1
CTC 0
CTC 1
CTC0
RES
CTC1
RES
When the current value is rewritten to be the same as the value of CTC, the CTC
Point
contact will not be turned ON.
It will only be turned ON when the current value is the same as the value of CTC
after up counting or down counting.
"CTC Instructions" (page 5-132)
Reset Mode
The timings with which resets are performed for each mode are displayed below.
Point
5
Reset Mode Reset Timing
High-Speed Counter
The point in time that the RES
Reset based on the RES instruction
instruction is executed
Reset based on the CTH instruction (execution The point in time that the CTH
condition OFF) instruction is executed
The point in time that the current
Automatic reset based on comparator matching value and the comparator value
match
The point in time that the external
Reset based on external preset input
preset input is turned ON
Reset based on the Internal enable relay in use
The point in time that the enable
counter enable Internal enable relay and external
signal changes from disabled to
function enable input in use together
enabled or from enabled to disabled
External enable input in use
Example
The reset is performed
CTH0
based on the RES RES
instruction.
Scan
Execution
condition
Example
The reset is performed
based on the CTH Execution
condition CTH.D 0
instruction (execution R004
Scan
CTH
CTH = CTC
* The reset is performed when CTH and CTC are equal.
Example
The automatic reset is
CR2008 CR4303 CR4503
performed based on SET SET
comparator matching.
High-Speed Counter
"Preset Function" (page 5-124)
Scan
External preset
input
CTH
* The reset is performed when the external preset input is turned ON.
Disabled Enabled
Counter input
Enabled
Enable
Disabled
CTH
Enabled Disabled
Counter input
Enabled
Enable
Disabled
CTH
Example
To configure the high
speed counter to be CR2008 CM4801.4 CM4801.5
SET SET
reset based on the
counter enable function
(enabled disabled)
Preset Function
CPU BUILT-IN FUNCTIONS
This function changes the current value of the high-speed counter to the preset value. The value is
changed based on external input.
Preset signal
5 A
Count value
High-Speed Counter
Preset value
The concept of the preset function and the preset signal settings are described below.
level ON.
OFF
Disables preset
OFF OFF The preset is not executed.
input
Executes preset Falling edge of the
ON OFF
B contact
CTH0 R104
CM4807 (upper bits) and 5
CM4806 (lower bits)
High-Speed Counter
CM4817 (upper bits) and
CTH1 R105
KV-N40** CM4816 (lower bits)
CM4827 (upper bits) and
CTH2 R106
CM4826 (lower bits)
CTH3 - -
CM4807 (upper bits) and
CTH0 R104
CM4806 (lower bits)
CM4817 (upper bits) and
CTH1 R105
CM4816 (lower bits)
KV-N60**
CM4827 (upper bits) and
CTH2 R106
CM4826 (lower bits)
CM4837 (upper bits) and
CTH3 R107
CM4836 (lower bits)
You can use the counter enable function to enable and disable count input.
Use the combination of the external enable input and internal enable relay to control count input.
In addition, you can reset the current value when the counter enable signal changes from disabled to
enabled and from enabled to disabled.
Down count
Enabled
Enable signal
5
Disabled
Count value
Reset value 0
Reset value 0
Count value
Reset value 0
High-Speed Counter
Internal Enable Relay
CR4212 (CTH0)
CR4412 (CTH1) Enable Status
CR4612 (CTH2)
CR4812 (CTH3)
OFF A contact Enabled
ON B contact Disabled
Enable signal
Use the combination of the external enable input and internal enable relay to set the enable signal.
Combination Setting
Description
Bit 2 Bit 1 Bit 0
OFF OFF OFF
Normal enable (counting is performed all the time, regardless
OFF ON OFF
of whether the external enable input and internal enable relay
ON OFF OFF are enabled or disabled).
ON ON OFF
CM4801 (CTH0) Counting is performed when the internal relay is in the
CM4811 (CTH1) OFF OFF ON
enabled state.
CM4821 (CTH2) Counting is performed when the external enable input is in
CM4831 (CTH3) OFF ON ON
the enabled state.
Counting is performed when the internal enable relay and
ON OFF ON
external enable input are in the enabled state.
Counting is performed when the internal enable relay or the
ON ON ON
external enable input is in the enabled state.
Current value reset setting when changing between enabled and disabled
You can set whether to reset the current value when switching between the enabled and disabled state
of the enable count (count start and count stop).
Bit 5 Bit 4 Operation
OFF OFF
The current value is not reset.
CM4801 (CTH0) OFF ON
CM4811 (CTH1) The current value is reset when the state changes from disabled to
ON OFF
CM4821 (CTH2) enabled.
CM4831 (CTH3) The current value is reset when the state changes from enabled to
ON ON
disabled.
This function turns the output relay ON and OFF when the comparator value matches the current value.
Use control relays to set this method. Comparator matching output is not affected by the scan time.
CR4304 CR4305 ON: R500 is turned OFF. OFF: R500 is not turned OFF.
CTC0 ON: Disabled CR4306 ON: R500 is turned ON. OFF: R500 is not turned ON.
OFF: Enabled CR4307 ON: R500 is inverted. OFF: R500 is not inverted.
5 CTH0
CR4308 CR4309 ON: R500 is turned OFF. OFF: R500 is not turned OFF.
CTC1 ON: Disabled CR4310 ON: R500 is turned ON. OFF: R500 is not turned ON.
High-Speed Counter
OFF: Enabled CR4311 ON: R500 is inverted. OFF: R500 is not inverted.
CR4504 CR4505 ON: R501 is turned OFF. OFF: R501 is not turned OFF.
CTC2 ON: Disabled CR4506 ON: R501 is turned ON. OFF: R501 is not turned ON.
OFF: Enabled CR4507 ON: R501 is inverted. OFF: R501 is not inverted.
CTH1
CR4508 CR4509 ON: R501 is turned OFF. OFF: R501 is not turned OFF.
CTC3 ON: Disabled CR4510 ON: R501 is turned ON. OFF: R501 is not turned ON.
OFF: Enabled CR4511 ON: R501 is inverted. OFF: R501 is not inverted.
CR4704 CR4705 ON: R502 is turned OFF. OFF: R502 is not turned OFF.
CTC4 ON: Disabled CR4706 ON: R502 is turned ON. OFF: R502 is not turned ON.
OFF: Enabled CR4707 ON: R502 is inverted. OFF: R502 is not inverted.
CTH2
CR4708 CR4709 ON: R502 is turned OFF. OFF: R502 is not turned OFF.
CTC5 ON: Disabled CR4710 ON: R502 is turned ON. OFF: R502 is not turned ON.
OFF: Enabled CR4711 ON: R502 is inverted. OFF: R502 is not inverted.
CR4904 CR4905 ON: R503 is turned OFF. OFF: R503 is not turned OFF.
CTC6 ON: Disabled CR4906 ON: R503 is turned ON. OFF: R503 is not turned ON.
OFF: Enabled CR4907 ON: R503 is inverted. OFF: R503 is not inverted.
CTH3
CR4908 CR4909 ON: R503 is turned OFF. OFF: R503 is not turned OFF.
CTC7 ON: Disabled CR4910 ON: R503 is turned ON. OFF: R503 is not turned ON.
OFF: Enabled CR4911 ON: R503 is inverted. OFF: R503 is not inverted.
*1 When power is turned on, the comparator matching output disabled flag is turned ON (disabled).
*2 If, for a single comparator, you have turned ON multiple relays for controlling the operation when CTC is
turned ON, the operation will be performed with the settings of the relay that has the smallest device
number.
(Example: If both CR4305 and CR4306 are turned ON, output will be turned OFF.)
5
• The change direction is updated once per scan. After operation is completed,
Point
High-Speed Counter
the change direction before operation completed is stored.
• The maximum time required to update the change direction is "change
direction detection time constant + 1 scan period." You can update the value to
the latest value by executing the RFSCTH instruction.
"RFSCTH Instructions" (page 5-136)
(2) Setting the current value's (CTH) change direction detection time constant
Use the MOV instruction or the DW instruction to set the change direction detection time constant.
For details, see the MOV instruction in the KV-7000/5000/3000/1000 Series and KV Nano Series "Instruction
Reference Manuals."
Example
Set the change direction MOV
detection time constant #1 CM4800
or
of CTH0 to 100 µs. #1
DW
CM4800
Input capture is a function that stores the current value of the high-speed counter in control memory
when an interrupt condition occurs. This function operates when the interrupt condition is external input.
You can use this function just by selecting a high-speed counter.
The acquired value is stored in the control memory entries CM1600 to CM1607.
*1 To change the high-speed counter whose current value will be acquired, In KV STUDIO, click "CPU
system setting" and then "User interrupt setting."
*2 The numbers of the high-speed counters that you can set vary depending on the unit that you are
using.
KV-N14** and KV-N24**: CTH0 and CTH1
KV-N40**: CTH0 to CTH2
KV-N60**: CTH0 to CTH3
For details about interrupts, see "4-7 Interrupts" (page 4-76).
High-Speed Counter
32-bit,
CTH CTH(.D)
CTH.L
CTH
high-speed Input response frequency, maximum 100
kHz, 32-bit
CPU BUILT-IN FUNCTIONS
counter
(unsigned: 0 to 4294967295,
High-speed
CTC CTC(.D)
CTC.L
CTC counter
comparator
signed: -2147483648 to 2147483647) up
counting and down counting operations
5 S
CTC n C T C n S
CTC n
High-Speed Counter
Available Devices
Index
Local
Bit Devices Word Devices Const Ind Spec Device Modify
Operand
MR DM
R DR LR T C CTC CR TM T C CTH CTC Z CM #/$ #TM * @ :#/:Z
B W
n - - - - - - - - - - - - - - - - - -
CTH
S - - - - - - - - - - - - - - - - -
n - - - - - - - - - - - - - - - - - -
CTC
S - - - - - - - - - - - - - - - - - -
Operand Description
n Specifies the counter number from 0 to 3 *1, 3
CTH
S Specifies the count input
n Specifies the comparator number from 0 to 7 *2, 3
CTC Specifies the high-speed counter value with in the range of 0 to 4294967295 (unsigned) and
S
-2147483648 to +2147483647 (signed)
*1 The numbers that can be specified vary depending on the unit.
* KV-N14** and KV-N24**: 0 and 1
* KV-N40**: 0 to 2
* KV-N60**: 0 to 3
*2 The numbers that can be specified vary depending on the unit.
* KV-N14** and KV-N24**: 0 to 3
* KV-N40**: 0 to 5
* KV-N60**: 0 to 7
*3 n : If a number that cannot be specified by the unit is entered in this operand, the instruction will
not be executed.
Operation Description
CTC(.D) While the high-speed counter is operating, when the value specified with matches
5
S
the current value of the high-speed counter, CTC(.D) is turned ON.
CTC.L When the suffix is ".D," specify n in the range of 0 to 42497295.
High-Speed Counter
When the suffix is ".L," specify n in the range of -2147483648 to +2147483647.
Use control relays (CR) and data memory (DM) entries to set the count mode and reset mode of the
high-speed counter function. Read the explanation of each setting.
Reading and changing the current value and changing the set value
(1) Reading the current value
Use the LDA or MOV instruction to read the current value.
For details, see the LDA instruction and the MOV instruction in the KV-7000/5000/3000/1000 Series and
KV Nano Series "Instruction Reference Manuals."
Example
The current value of CTH0 is
CTH0 DM0
stored into data memory LDA.D STA.D
entries DM0 and DM1. or
MOV.D
CTH0 DM0
#100000
DW.D
5 CTH0
High-Speed Counter
Example
The current value of CTH0 is
MOV.L
changed to -100000. −100000 CTH0
−100000
DW.L
CTH0
MOV.D
#100000 CTC0
#100000
DW.D
CTC0
MOV.L
−100000 CTC0
−100000
DW.L
CTC0
High-Speed Counter
if you change the value of CTC to a value less than CTH, the CTH value will be
set to "CTC value - 1."
• When the value is signed and the CTC value is negative, if you change the value
of CTC to a value greater than CTH, the CTH value will be set to "CTC value + 1."
"Automatic reset based on comparator matching" (page 5-122)
Sample Program
An encoder is counted with high-speed counter 0 (R004 and R005) with a 1x phase difference. When
the value matches the value of high-speed counter comparator CTC0, output relay R500 is turned ON.
Available Devices
Index
Local
Bit Devices Word Devices Const Ind Spec Device Modify
Operand
5 R
MR
DR LR
B
T
DM
C CTC CR TM T
W
C CTH CTC Z CM #/$ #TM * @ :#/:Z
n - - - - - - - - - - - - - - - - - -
High-Speed Counter
Operand Description
n Specifies the number of the high-speed counter (0 to 3).*1, 3
Operation Description
Operation flags
CR2009 No change in status
CR2010 No change in status
CR2011 No change in status
CR2012 No change in status
Sample Program
The latest value of high-speed counter 0 is used to change the state of output relays R1500 and R1501.
CR2002 RFSCTH <Mnemonics list>
#0 LD CR2002
Always turned ON RFSCTH #0
LD<.D CTH0 #10000
CTH0 R1500 OUT R1500
<.D LD>=.D CTH0 #10000
#10000 Output 0 AND<.D CTH0 #20000
OUT R1501
CTH0 CTH0 R1501
>=.D <.D
#10000 #20000 Output 1
5-136 - KV Nano Series(terminal block type) User’s Manual -
5-4 High-Speed Counter
Device Attribute
R: Read only Description ON OFF
Number Blank: Read/write
CR4200 R Internal clock (50 ns) - -
CR4201 R Internal clock (1 µs) - -
CR4202 R Internal clock (10 µs) - -
CR4203 R Internal clock (100 µs) - -
Do not
CR4211 CTH0 preset disable Execute
execute
High-Speed Counter
execute
Do not
CR4304 Disables comparator matching output (R500) when CTC0 is turned ON Execute
execute
Do not
CR4305 Turns comparator matching output (R500) OFF when CTC0 is turned ON Execute
execute
Do not
CR4306 Turns comparator matching output (R500) ON when CTC0 is turned ON Execute
execute
Inverts the ON/OFF setting of comparator matching output (R500) when Do not
CR4307 Execute
CTC0 is turned ON execute
Do not
CR4308 Disables comparator matching output (R500) when CTC1 is turned ON Execute
execute
Do not
CR4309 Turns comparator matching output (R500) OFF when CTC1 is turned ON Execute
execute
Do not
CR4310 Turns comparator matching output (R500) ON when CTC1 is turned ON Execute
execute
Inverts the ON/OFF setting of comparator matching output (R500) when Do not
CR4311 Execute
CTC1 is turned ON execute
Do not
CR4312 Automatically resets CTH0 when CTC1 is turned ON Execute
execute
Device Attribute
R: Read only Description ON OFF
Number Blank: Read/write
CR4205 R CTH0 function Present Not present
CR4206 Overflow detection Detected Not detected
CR4207 R Change direction of current value Down counting Up counting
CR4210 CTH0 ring counter Ring Linear
Reference The default value of CR4304 and CR4308 is ON. Other control relays are turned OFF.
Use the SET instruction to turn control relays ON and the RES instruction to turn
Point
control relays OFF.
Device Attribute
CPU BUILT-IN FUNCTIONS
Attribute
Device Number R: Read only Description
Blank: Read/write
Sets the combination condition of the external enable input and the
internal enable relay
Bit 0 Bit 2 Bit 1 Bit 0 Description
OFF OFF OFF Normal enable (counting is performed all the
OFF ON OFF time, regardless of whether the external
ON OFF OFF enable input and internal enable relay are
ON ON OFF enabled or disabled).
Counting is performed when the internal relay
Bit 1 OFF OFF ON
is in the enabled state.
Counting is performed when the external
OFF ON ON
enable input is in the enabled state.
Counting is performed when the internal
ON OFF ON enable relay and external enable input are in
the enabled state.
Bit 2 Counting is performed when the internal
ON ON ON enable relay or the external enable input is in
the enabled state.
CM4801 Bit 3 Reserved for the system
Current value reset mode setting based on the counter enable function
Device Attribute
CR4504 Disables comparator matching output (R501) when CTC2 is turned ON Execute
Do not
execute 5
Do not
CR4505 Turns comparator matching output (R501) OFF when CTC2 is turned ON Execute
High-Speed Counter
execute
Do not
CR4506 Turns comparator matching output (R501) ON when CTC2 is turned ON Execute
execute
Inverts the ON/OFF setting of comparator matching output (R501) when Do not
CR4507 Execute
CTC2 is turned ON execute
Do not
CR4508 Disables comparator matching output (R501) when CTC3 is turned ON Execute
execute
Do not
CR4509 Turns comparator matching output (R501) OFF when CTC3 is turned ON Execute
execute
Do not
CR4510 Turns comparator matching output (R501) ON when CTC3 is turned ON Execute
execute
Inverts the ON/OFF setting of comparator matching output (R501) when Do not
CR4511 Execute
CTC3 is turned ON execute
Do not
CR4512 Automatically resets CTH1 when CTC3 is turned ON Execute
execute
Device Attribute
R: Read only Description ON OFF
Number Blank: Read/write
CR4405 R CTH1 function Present Not present
CR4406 Overflow detection Detected Not detected
CR4407 R Change direction of current value Down counting Up counting
CR4410 CTH1 ring counter Ring Linear
Reference The default value of CR4504 and CR4508 is ON. Other control relays are turned OFF.
Use the SET instruction to turn control relays ON and the RES instruction to turn
Point
control relays OFF.
Device Attribute
CPU BUILT-IN FUNCTIONS
Value #0 #1 #2 #3 #4 #5 #6 #7
CM4810 Travel direction
No
detection time 100 µs 500 µs 1 ms 2.5 ms 5 ms 10 ms 50 ms
filter
constant
CM4812 Ring counter lower limit (lower bits)
CM4813 Ring counter lower limit (upper bits)
CM4814 Ring counter upper limit (lower bits)
5 CM4815 Ring counter upper limit (upper bits)
CM4816 Preset value (lower bits)
High-Speed Counter
Attribute
Device Number R: Read only Description
Blank: Read/write
Sets the combination condition of the external enable input and the
internal enable relay
Bit 0 Bit 2 Bit 1 Bit 0 Description
OFF OFF OFF Normal enable (counting is performed all the
OFF ON OFF time, regardless of whether the external
ON OFF OFF enable input and internal enable relay are
ON ON OFF enabled or disabled).
Counting is performed when the internal relay
Bit 1 OFF OFF ON
is in the enabled state.
Counting is performed when the external
OFF ON ON
enable input is in the enabled state.
Counting is performed when the internal
ON OFF ON enable relay and external enable input are in
the enabled state.
Bit 2 Counting is performed when the internal
ON ON ON enable relay or the external enable input is in
the enabled state.
CM4811 Bit 3 Reserved for the system
Current value reset mode setting based on the counter enable function
Bit 4 Bit 5 Bit 4 Description
OFF OFF
The current value is not reset.
OFF ON
The current value is reset when the state changes
ON OFF
Bit 5 from disabled to enabled.
The current value is reset when the state changes
ON ON
from enabled to disabled.
Bit 6 Reserved for the system
ON: Signed
Bit 7 Turns ON the count value's signed setting
OFF: Unsigned
ON: B contact
Bit 8 Polarity setting of the external preset input
OFF: A contact
ON: B contact
Bit 9 Polarity setting of the external enable input
OFF: A contact
Bit 10 to bit 15
Device Attribute
CR4704 Disables comparator matching output (R502) when CTC4 is turned ON Execute
Do not
execute 5
Do not
CR4705 Turns comparator matching output (R502) OFF when CTC4 is turned ON Execute
High-Speed Counter
execute
Do not
CR4706 Turns comparator matching output (R502) ON when CTC4 is turned ON Execute
execute
Inverts the ON/OFF setting of comparator matching output (R502) when Do not
CR4707 Execute
CTC4 is turned ON execute
Do not
CR4708 Disables comparator matching output (R502) when CTC5 is turned ON Execute
execute
Do not
CR4709 Turns comparator matching output (R502) OFF when CTC5 is turned ON Execute
execute
Do not
CR4710 Turns comparator matching output (R502) ON when CTC5 is turned ON Execute
execute
Inverts the ON/OFF setting of comparator matching output (R502) when Do not
CR4711 Execute
CTC5 is turned ON execute
Do not
CR4712 Automatically resets CTH2 when CTC5 is turned ON Execute
execute
Device Attribute
R: Read only Description ON OFF
Number Blank: Read/write
CR4605 R CTH2 function Present Not present
CR4606 Overflow detection Detected Not detected
CR4607 R Change direction of current value Down counting Up counting
CR4610 CTH2 ring counter Ring Linear
Reference The default value of CR4704 and CR4708 is ON. Other control relays are turned OFF.
Use the SET instruction to turn control relays ON and the RES instruction to turn
Point
control relays OFF.
Device Attribute
CPU BUILT-IN FUNCTIONS
Value #0 #1 #2 #3 #4 #5 #6 #7
CM4820 Travel direction
No
detection time 100 µs 500 µs 1 ms 2.5 ms 5 ms 10 ms 50 ms
filter
constant
Attribute
Device Number R: Read only Description
Blank: Read/write
Sets the combination condition of the external enable input and the
internal enable relay
Bit 0 Bit 2 Bit 1 Bit 0 Description
OFF OFF OFF Normal enable (counting is performed all the
OFF ON OFF time, regardless of whether the external
ON OFF OFF enable input and internal enable relay are
ON ON OFF enabled or disabled).
Counting is performed when the internal relay
Bit 1 OFF OFF ON
is in the enabled state.
Counting is performed when the external
OFF ON ON
enable input is in the enabled state.
Counting is performed when the internal
ON OFF ON enable relay and external enable input are in
the enabled state.
Bit 2 Counting is performed when the internal
ON ON ON enable relay or the external enable input is in
the enabled state.
CM4821
Bit 3 Reserved for the system
Current value reset mode setting based on the counter enable function
Bit 4 Bit 5 Bit 4 Description
OFF OFF
The current value is not reset.
OFF ON
The current value is reset when the state changes
ON OFF
Bit 5 from disabled to enabled.
The current value is reset when the state changes
ON ON
from enabled to disabled.
Bit 6 Reserved for the system
ON: Signed
Bit 7 Turns ON the count value's signed setting
OFF: Unsigned
ON: B contact
Bit 8 Polarity setting of the external preset input
OFF: A contact
ON: B contact
Bit 9 Polarity setting of the external enable input
OFF: A contact
Bit 10 to bit 15
Device Attribute
CR4904 Disables comparator matching output (R503) when CTC6 is turned ON Execute
Do not
execute 5
Do not
CR4905 Turns comparator matching output (R503) OFF when CTC6 is turned ON Execute
High-Speed Counter
execute
Do not
CR4906 Turns comparator matching output (R503) ON when CTC6 is turned ON Execute
execute
Inverts the ON/OFF setting of comparator matching output (R503) when Do not
CR4907 Execute
CTC6 is turned ON execute
Do not
CR4908 Disables comparator matching output (R503) when CTC7 is turned ON Execute
execute
Do not
CR4909 Turns comparator matching output (R503) OFF when CTC7 is turned ON Execute
execute
Do not
CR4910 Turns comparator matching output (R503) ON when CTC7 is turned ON Execute
execute
Inverts the ON/OFF setting of comparator matching output (R503) when Do not
CR4911 Execute
CTC7 is turned ON execute
Do not
CR4912 Automatically resets CTH3 when CTC7 is turned ON Execute
execute
Device Attribute
R: Read only Description ON OFF
Number Blank: Read/write
CR4805 R CTH3 function Present Not present
CR4806 Overflow detection Detected Not detected
CR4807 R Change direction of current value Down counting Up counting
CR4810 CTH3 ring counter Ring Linear
Reference The default value of CR4904 and CR4908 is ON. Other control relays are turned OFF.
Use the SET instruction to turn control relays ON and the RES instruction to turn
Point
control relays OFF.
Device Attribute
CPU BUILT-IN FUNCTIONS
Value #0 #1 #2 #3 #4 #5 #6 #7
CM4830 Travel direction
No
detection time 100 µs 500 µs 1 ms 2.5 ms 5 ms 10 ms 50 ms
filter
constant
CM4832 Ring counter lower limit (lower bits)
CM4833 Ring counter lower limit (upper bits)
CM4834 Ring counter upper limit (lower bits)
5 CM4835
CM4836
Ring counter upper limit (upper bits)
Preset value (lower bits)
CM4837 Preset value (upper bits)
High-Speed Counter
Attribute
Device Number R: Read only Description
Blank: Read/write
Sets the combination condition of the external enable input and the
internal enable relay
Bit 0 Bit 2 Bit 1 Bit 0 Description
OFF OFF OFF Normal enable (counting is performed all the
OFF ON OFF time, regardless of whether the external
ON OFF OFF enable input and internal enable relay are
ON ON OFF enabled or disabled).
Counting is performed when the internal relay
Bit 1 OFF OFF ON
is in the enabled state.
Counting is performed when the external
OFF ON ON
enable input is in the enabled state.
Counting is performed when the internal
ON OFF ON enable relay and external enable input are in
the enabled state.
Bit 2 Counting is performed when the internal
ON ON ON enable relay or the external enable input is in
the enabled state.
Overview
For pulse output, internal clock pulses are counted with a high-speed counter (CTH). Each time that the
current value matches the value of the high-speed counter comparator (CTC), the output relay state is
5
switched between ON and OFF, and a pulse is generated.
High-Speed Counter
Count value
CTC
ON ON
• Be sure to start direct clock pulse output with the output in the OFF state.
Point
• Normally, programs do not have access to the output relays during direct clock
pulse output. (The state of the contacts cannot be checked, and the ON/OFF
state cannot be controlled with output instructions.)
OFF Pulse
width
Pulse period
5
CTC value = pulse period (µs)/internal clock (µs)/2
High-Speed Counter
OFF Pulse
width
Pulse period
CTC value for pulse width = pulse width (µs)/internal clock (µs)
CTC value for pulse period = pulse period (µs)/internal clock (µs)
• If you have set CR4200, CR4400, CR4600, and CR4800 in the high-speed
Point
counter (CTH) operands, set the CTC value to 100 or more. If you specify a
value smaller than 100, the clock pulses will not be generated correctly.
• If you have set CR4201, CR4401, CR4601, and CR4801 in the high-speed
counter (CTH) operands, set the CTC value to 5 or more. If you specify a value
smaller than 5, the clock pulses will not be generated correctly.
• If you are using two comparators for a single high-speed counter (for example,
CTC0 and CTC1 for CTH0) to generate clock pulses, do not specify the same
values for the comparator settings.
• The pulse width that is determined using the above formula is the width of the
pulses that are generated internally within the KV Nano Series. Because pulses
pass through the output circuit when they are actually output, the actual pulse
width may vary due to the influence of response delay and the connected load.
Use an oscilloscope or similar instrument to observe the actual output
waveform, and then set the pulse width.
CR4304
Automatically resets the current value of CTH0
R500 control
ON: Execute
ON: Disabled
execute
OFF: Enabled
5
OFF: Do not
CR4305 Turns OFF comparator matching output of R500 ON: Execute
High-Speed Counter
CTC0 execute
OFF: Do not
CR4306 Turns ON comparator matching output of R500 ON: Execute
execute
OFF: Do not
CR4307 Inverts the ON/OFF setting of R500 output ON: Execute
execute
CR4308 R500 control ON: Disabled OFF: Enabled
OFF: Do not
CR4309 Turns OFF comparator matching output of R500 ON: Execute
execute
OFF: Do not
CR4310 Turns ON comparator matching output of R500 ON: Execute
CTC1 execute
OFF: Do not
CR4311 Inverts the ON/OFF setting of R500 output ON: Execute
execute
OFF: Do not
CR4312 Automatically resets the current value of CTH0 ON: Execute
execute
• By turning ON CR4304 or CR4308, you can stop clock pulse output. By turning OFF CR4304 or
CR4308, you can generate clock pulse output.
• You can only turn ON one relay from CR4304 to CR4307 and one relay from
Point
CR4308 to CR4311.
• Use the SET, RES, or STA instruction to turn ON and OFF CR4303 to CR4312.
• If the pulse period is variable, be sure to turn ON CR4303 or CR4312 to enable
automatic resetting of the CTH0 current value. If you do not turn CR4303 or
CR4312 ON, the pulse period cannot be changed.
• If you turn ON multiple relays within the range of CR4304 to CR4307 and within
the range of CR4308 to CR4311, the relay with the smallest number in each
range will be given priority.
CTC4 CTC4
CTC5
ON ON ON ON ON ON
5 CTC2
CR4505 Turns OFF comparator matching output of R501 ON: Execute
OFF: Do not
execute
OFF: Do not
CR4506 Turns ON comparator matching output of R501 ON: Execute
High-Speed Counter
execute
OFF: Do not
CR4507 Inverts the ON/OFF setting of R501 output ON: Execute
execute
CR4508 R501 control ON: Disabled OFF: Enabled
OFF: Do not
CR4509 Turns OFF comparator matching output of R501 ON: Execute
execute
OFF: Do not
CR4510 Turns ON comparator matching output of R501 ON: Execute
CTC3 execute
OFF: Do not
CR4511 Inverts the ON/OFF setting of R501 output ON: Execute
execute
OFF: Do not
CR4512 Automatically resets the current value of CTH1 ON: Execute
execute
• By turning ON CR4504 or CR4508, you can stop clock pulse output. By turning OFF CR4504 or
CR4508, you can generate clock pulse output.
ON ON ON ON ON ON
CTC4
CR4705 Turns OFF comparator matching output of R502 ON: Execute
OFF: Do not
execute 5
OFF: Do not
CR4706 Turns ON comparator matching output of R502 ON: Execute
High-Speed Counter
execute
OFF: Do not
CR4707 Inverts the ON/OFF setting of R502 output ON: Execute
execute
CR4708 R502 control ON: Disabled OFF: Enabled
OFF: Do not
CR4709 Turns OFF comparator matching output of R502 ON: Execute
execute
OFF: Do not
CR4710 Turns ON comparator matching output of R502 ON: Execute
CTC5 execute
OFF: Do not
CR4711 Inverts the ON/OFF setting of R502 output ON: Execute
execute
OFF: Do not
CR4712 Automatically resets the current value of CTH2 ON: Execute
execute
• By turning ON CR4704 or CR4708, you can stop clock pulse output. By turning OFF CR4704 or
CR4708, you can generate clock pulse output.
• You can only turn ON one relay from CR4704 to CR4707 and one relay from
Point
CR4708 to CR4711.
• Use the SET, RES, or STA instruction to turn ON and OFF CR4703 to CR4712.
• If the pulse period is variable, be sure to turn ON CR4703 or CR4712 to enable
automatic resetting of the CTH2 current value. If you do not turn ON CR4703 or
CR4712, the pulse period cannot be changed.
• If you turn ON multiple relays within the range of control relay CR4704 to
CR4707 and within the range of control relay CR4708 to CR4711, the relay with
the smallest number in each range will be given priority.
CTC4 CTC4
CTC5
ON ON ON ON ON ON
5 CTC6
CR4905 Turns OFF comparator matching output of R503 ON: Execute
OFF: Do not
execute
OFF: Do not
CR4906 Turns ON comparator matching output of R503 ON: Execute
High-Speed Counter
execute
OFF: Do not
CR4907 Inverts the ON/OFF setting of R503 output ON: Execute
execute
CR4908 R503 control ON: Disabled OFF: Enabled
OFF: Do not
CR4909 Turns OFF comparator matching output of R503 ON: Execute
execute
OFF: Do not
CR4910 Turns ON comparator matching output of R503 ON: Execute
CTC7 execute
OFF: Do not
CR4911 Inverts the ON/OFF setting of R503 output ON: Execute
execute
OFF: Do not
CR4912 Automatically resets the current value of CTH3 ON: Execute
execute
• By turning ON CR4904 or CR4908, you can stop clock pulse output. By turning OFF CR4904 or
CR4908, you can generate clock pulse output.
ON ON ON ON ON ON
High-Speed Counter
Internal clock and CTC0 values
Determine the internal clock, and obtain the corresponding CTC0 value from the following formula.
Program example
• CR4204 to CR4207 are used to set the pulse output of
CR2008 CR4203 CR4204 CR4205 CR4206 CR4207 CTH0 output R500.
00001 SET RES RES RES SET RES
In this example, the settings are configured so that the
CR2002 CTH.D 0 comparator matching output of R500 is enabled
00002 CR4202 (CR4204 is turned OFF) and the R500 output is
#50 inverted each time that CTH0 and CTC0 are equal
00003 CTC.D 0 (CR4207 is turned ON).
• CR4203 is turned ON to specify that CTH0 will be reset
by CTC0.
Count value Therefore, the current value of CTH0 will be repeatedly
cleared according to the value set by CTC0.
CTC0 • When operation starts, the current value of CTH0 will
be reset (the RES CTH0 part).
Therefore, the pulse width of the clock pulse will be
output correctly from the first pulse.
ON ON
• During clock pulse output, the CTH0 enable input relay
is always turned ON.
If you use the enable input of a high-speed counter to start or stop the clock
Point
pulse, the response may be delayed up to one scan period when the clock pulse
is started.
Important tip
When you are using external input to control clock pulse output (enable or disable), turn CR4304 ON
CPU BUILT-IN FUNCTIONS
When using the SET and RES instructions When using the KEEP instruction
RES RES
Let us substitute a pulse width of 200 µs, a pulse period of 500 µs, and an internal clock of 10 µs (the
values for CR4202) into the above formulae and then determine the value of CTC2 and CTC3.
The value of CTC3 is "20" and the value of CTC2 is "50."
The values that are calculated using the other internal clocks are shown below. Use these values as a
reference.
Control Relay Internal Clock CTC2 Value CTC3 Value
CR4400 50 ns 10000 4000
CR4401 1.0 µs 500 200
CR4402 10.0 µs 50 20
CR4403 100.0 µs 5 2
Program example
CR2008 CR4503 CR4504 CR4505 CR4506 CR4507 • CR4504 to CR4507 and CR4508 to CR4511 are
00001 SET RES RES SET RES used to set the pulse output of output R501.
CTC2
CTC3 5
High-Speed Counter
ON ON ON ON
• If you use the enable input of a high-speed counter to start or stop the clock
Point
pulse, then the response may be delayed up to one scan period when the clock
pulse is started. It may also be delayed by up to one scan period when the clock
pulse is stopped.
• For details on starting and stopping the clock pulse output, see the "Important
Tip" below.
Important tip
When you are using external input to control clock pulse output (enable or disable), turn CR4504 ON
and OFF to control the clock pulse output.
Use the SET, RES, or KEEP instruction to turn CR4504 ON and OFF.
The clock pulse must start from the OFF state and must end in the OFF state.
If one of the programs shown in the following figures is added to the example on the previous page, the
clock pulse will be output from R501 only when R000 is turned ON.
When using the SET and RES instructions When using the KEEP instruction
R000 CR4504 R000 KEEP
SET SET
CR4504
R000 CR4504 R000
RES RES
• You can change the clock pulse period (frequency) by using the STA instruction to rewrite the value
of high-speed counter comparator CTC2.
The internal clock, CTC0, and CTC1 values are shown below.
Control Relay Internal Clock CTC0 Value CTC1 Value
CR4200 50 ns 10000 40000
CR4201 1.0 µs 500 200
CR4202 10.0 µs 50 20
CR4203 100.0 µs 5 2
Program example
• CR4304 to CR4307 and CR4308 to CR4311 are used
CR2008 CR4303 CR4304 CR4305 CR4306 CR4307 to set the pulse output of output R500.
00001 EI SET RES SET SET RES
In this example, the settings are configured so that the
CR4308 CR4309 CR4310 CR4311 CR4312 comparator matching output of R500 is enabled
00002 RES SET RES RES RES (CR4304 is turned OFF) and the R500 output is turned
ON with CTC0 (CR4306 is turned ON) and is turned
CR4503 CTH0 CTH1 OFF with CTC1 (CR4309 is turned ON).
00003 SET RES RES
• CR4303 is turned ON to specify that CTH0 will be
R000 R1000 R1000 CR4305 reset by CTC0.
00004 DIFU RES Therefore, the pulse width of the clock pulse will be
CTH.D 0
output correctly from the first pulse.
CR2002
00005 CR4201
• The EI instruction is used to enable interrupts.
When the current value of high-speed counter CTH1
#50 matches the value of high-speed counter comparator
00006 CTC.D 0
CTC2 (when 10000 pulses have been output), an
#20 interrupt program (INT CTC2) will be used to stop
00007 CTC.D 1 clock pulses.
• CR4503 is turned ON to specify that CTH1 will be
CR2002 CTH.D 1 reset by CTC2.
00008 R500 Therefore, operations can be performed repeatedly
#10000 over the specified number of pulses (10000).
00009 CTC.D 2 • During clock pulse output, the CTH0 enable input relay
is always turned ON.
END
00010 • During clock pulse counting, the CTH1 enable input
relay is always turned ON.
INT • The internal clock (CR4202) is specified on the clock
00011 CTC2 input of high-speed counter CTH0, and R500 is
CR2002 CR4305 specified on the clock input of high-speed counter
00012 SET CTH1.
Therefore, CTH0 is used for clock pulse output and
RETI CTH1 is used for clock pulse counting.
00013
• The number of clock pulses is set by the value of high-
ENDH speed counter comparator CTC2.
00014 • Clock pulse output starts when input R000 is turned
ON.
To restart clock pulse output, turn input R000 ON
again.
Important tip
You can use the SET, RES, LDA, and STA instructions to turn CR4303 to CR4311 ON and OFF. If you
CR2008 CR4303 CR4304 CR4305 CR4306 CR4307 CR2008 $0268 CR4300 CTH0 CR4503 CTH0 CTH1
EI SET RES SET SET RES EI LDA STA RES SET SET RES
• LDA $0268
When LDA $0268 is executed, the following values will be entered in the internal register.
5
[0] [2] [6] [8]
High-Speed Counter
Internal register 0 0 0 0 0 0 1 0 0 1 1 0 1 0 0 0
When STA CR4300 is executed, the value of the internal register will be assigned to auxiliary relays
CR4300 to CR4315.
**: 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
Control relay 0 0 0 0 0 0 1 0 0 1 1 0 1 0 0 0
CR43**
By using dedicated instructions, you can easily measure the frequency (Hz) or rotation speed (rpm) of
external pulse input.
If you use the frequency counter input source switching function, you can count the external input
terminal signals and at the same time use a different high-speed counter to measure frequency or
rotation speed.
5
A-phase R004(R008) CTH0
B-phase R005(R009)*1
Frequency Counter
If you are using the input source switching function to perform counting and at
Point
the same time measure frequency or rotation speed, you have to use two high-
speed counters.
Frequency Counter
High-Speed Counter External Input Terminal to Measure
Channel KV-N14** KV-N24** KV-N40** KV-N60**
A-phase, R004 A-phase, R004 A-phase, R008 A-phase, R008
Channel 0
B-phase, R005 B-phase, R005 B-phase, R009 B-phase, R009
A-phase, R006 A-phase, R006 A-phase, R010 A-phase, R010
Channel 1
B-phase, R007 B-phase, R007 B-phase, R011 B-phase, R011
A-phase, R012 A-phase, R012
Channel 2 - -
B-phase, R013 B-phase, R013
A-phase, R014
Channel 3 - - -
B-phase, R015
When the frequency counter input source switching method relay is turned ON
Reference For example, if the channel 1 frequency counter input source switching method relay
(CR5505) of the KV-N40** is turned ON and the value of the frequency counter external
input source (CM4914) is 2, counting will be performed with the input of R012 set to
A-phase and the input of R013 set to B-phase.
pulse input
Available Devices
Index
Local
Bit Devices Word Devices Const Ind Spec Device Modify
Operand
5
MR DM
R DR LR T C CTC CR TM T C CTH CTC Z CM #/$ #TM * @ :#/:Z
B W
n - - - - - - - - - - - - - - - - - -
Frequency Counter
S1 - - - - - - - - - - - - - - - - - -
S2 - - - - -
D - - - - - - - - -
Operand Description
n Specifies the number of the high-speed counter (0 to 3).*1, 3
Specifies the pulse input mode. If this value is out side of the range, only the lower two bits are used.*1
S1 0 = single phase w/o direction; 1 = single phase w/ direction; 2 = phase difference 1x; 3 = 2-pulse
"Count Input Settings" (page 5-116)
Specifies the number of scans within the range of 0 to 65535. If you specify the value "0," the average of
100 scans will be used.
S2
When you specify a bit device, 16 continuous bits will be occupied. When you specify a word device,
1 word will be occupied.*2
Specifies the leading device in which the measured results (Hz) will be stored. When you specify a bit
D
device, 32 continuous bits will be occupied. When you specify a word device, 2 words will be occupied.
Operation Description
On the rising edge of the execution condition, the S1 and S2 settings are read. This is performed
during each scan while the execution condition is turned ON. The value (measured result) stored in the
device specified by [ D and D+1 ] is updated once per scan in which the number of scans is
specified by S2 . The number of the high-speed counter to use is specified with n .
When the execution condition is turned ON, the time between external input pulses is measured
continuously, and the frequency is calculated during END processing from the time between pulses.
Frequency (Hz) = 1/(time between pulses)
S2 : The average value (simple average) of the scans whose number is specified by this parameter
is the frequency's measured result and is stored in the device specified with [ D and D+1 ].
The update period will not be less than or equal to the value given by the scan time × (the number of
scans specified by S2 ).
When the execution condition is turned OFF, measurement will be stopped.
5-158 - KV Nano Series(terminal block type) User’s Manual -
5-5 Frequency Counter
• You cannot execute two or more FCNT instructions that use the same high-
Point
speed counter (specified by its number) at the same time.
•
5-198)
n : Do not change the control relay (CR) or control memory (CM) entry
5
related to the high-speed counter whose number is specified by this parameter.
Frequency Counter
• Measurements are started and stopped when a scan is completed. (Not when
the instruction is executed.)
• If there is no pulse input within 1 s, the frequency is set to 0 (Hz).
• S1 and S2 : When you change these parameters, switch the execution
condition from OFF to ON.
• You cannot use this function in interrupt programs and initialization modules.
Operation flags
Sample Program
Using CTH0, the frequencies (Hz) of encoder input R004 (A-phase) and R005 (B-phase) are
measured, and the result is stored in DM0 and DM1.
R000 FCNT 0
#2 #10 DM0
Available Devices
Index
Local
Bit Devices Word Devices Const Ind Spec Device Modify
Operand
5 R
MR
DR LR T
DM
C CTC CR TM T C CTH CTC Z CM #/$ #TM * @ :#/:Z
B W
Frequency Counter
n - - - - - - - - - - - - - - - - - -
S1 - - - - - - - - - - - - - - - - - -
S2 - - - - - - - -
D - - - - - - - - -
Operand Description
n Specifies the number of the high-speed counter to use (0 to 3).*2, 4
Specifies the pulse input mode. If this value is out side of the range, only the lower two bits are used.*1
S1 0 = single phase w/o direction; 1 = single phase w/ direction; 2 = phase difference 1x; 3 = 2-pulse
"Count Input Settings" (page 5-116)
Specifies the leading device in which the parameters will be stored. When you specify a bit device, 48
continuous bits will be occupied. When you specify a word device, 3 words will be occupied.*2
S2 + 0..Measurement mode (0: measured from the pulse interval; 1: measured from the time per
S2
rotation)
S2 + 1..Number of pulses per rotation
• When measurements are being performed from the pulse interval: 1 to 65535
• When measurements are being performed from the time per rotation: 1 to 32767
S2 + 2..Number of scans (0 to 65535); if you specify "0," the average of 100 scans will be used.
Specifies the leading device in which the measured results (rpm) will be stored. When you specify a bit
D
device, 32 continuous bits will be occupied. When you specify a word device, 2 words will be occupied.*3
Operation Description
Frequency Counter
The update period will not be less than or equal to the value given by the scan time × (the number of
scans specified by S2 + 2).
When the execution condition is turned OFF, measurement will be stopped.
Measuring the rotation speed from the time per rotation (when S2 + 0 is 1)
When the execution condition is turned ON, the number of external input pulses are counted, the time
required to reach the number of pulses specified by S2 + 1 (the time per rotation) is calculated
continuously, and the rotation speed is calculated during END processing from the time between the
specified number of pulses.
Rotation speed (rpm) = 60/(the time per rotation)
S2 + 2: The average value of the scans whose number is specified by this parameter and constant is
the rotation speed's measured result and is stored in the device specified with [ D and D + 1].
The update period will not be less than or equal to the value given by the scan time × (the number of
scans specified by S2 + 2).
When the execution condition is turned OFF, measurement will be stopped.
• You cannot execute two or more RCNT instructions that use the same high-
Point
speed counter (specified by its number) at the same time.
• n : The high-speed counter whose number is specified by this parameter
can only be used by one function or instruction at a time, so other functions or
instructions that use it cannot be executed at the same time.
• The measured result is updated after enough pulses for at least one rotation
have been applied after the execution condition is turned ON.
• When you want to use this instruction, use the HSP instruction and control
relays to set the input time constant to 10 µs. "5-2Motor (Positioning) Control"
(page 5-4)
• n : Do not change the control relays (CR) or control memory entries (CM),
other than those listed above, that are related to the high-speed counter whose
number is specified by this parameter.
• Measurements are started and stopped when a scan is completed. (Not when
the instruction is executed.)
• When measurements are being performed from the pulse interval, if the pulse
interval becomes 1 second or more, the rotation speed will be set to 0 (rpm).
• When measurements are being performed from the time per rotation, if the time
per rotation becomes 1.5 seconds or more, the rotation speed will be set to 0
(rpm).
• S1 and S2 : When you change these parameters, switch the execution
condition from OFF to ON.
• You cannot use this function in interrupt programs and initialization modules.
Operation flags
CPU BUILT-IN FUNCTIONS
Sample Program
Frequency Counter
Using CTH0, the rotation speed (rpm) of encoder inputs R004 (A-phase) and R005 (B-phase) are
measured, and the result is stored in DM0 and DM1.
MOV
#2500 DM101
MOV
#10 DM102
RCNT 0
#2 DM100 DM0
The function compares the multiple ranges that you have set in advance with the current values from
an encoder or a similar instrument.
The function detects which range the current value is within, and then turns ON the output destination
device that corresponds to this range.
・Encoder Range setting Output destination
・CPU internal device device
OFF Value ON Value Range to turn ON
Cam Switch
Current
value
(31) OFF Value (31) ON Value (31) ON ≤ (current value) < (31) OFF
(32) OFF Value (32) ON Value (32) ON ≤ (current value) < (32) OFF
Absolute encoder ABSENC Performs cam operations using an absolute encoder 5-168
Incremental encoder INCENC Performs cam operations using an incremental encoder 5-172
MCMP
Available Devices
MR DM
R DR LR T C CTC CR TM T C CTH CTC Z CM #/$ #TM * @ :#/:Z
B W
S1 - - - - - - - - - - - -
S2 - - - - -
D - - - - - - - - - - -
n - - - - -
Operand Description
S1 Specifies the leading device of the data block that will be compared *1
S2 Specifies the device that will be compared *2,
D Specifies the leading device in which the comparison results will be stored *3
Specifies the amount of data that will be compared or the device in which the data that will be compared
n
is stored (1 to 32) *4, 5
*1 When you specify a bit device, the n × 32 consecutive bits from the start of the channel will be
used. When you specify a word device, n × 2 words will be used.
*2 When you specify a bit device, 16 continuous bits will be used.
If you specify a relay other than the channel's leading relay (such as R002, R106, and R1012), the next
channel will also be used to provide the 16 necessary bits.
*3 When you specify a bit device, n bits will be occupied.
When you specify a word device, the result is stored in the lowest bit of the word device. The bits other
than the lowest bit will not be changed.
*4 "$" cannot be used.
*5 When you specify a bit device, 16 continuous bits will be occupied.
When you specify a word device, 1 word will be occupied.
Operation Description
D +
n +2 ON
5
S1 +2(
n -1)+1 30 30 S1 +2(
n -1) D +
n +1 OFF
Cam Switch
If the OFF value is greater than the ON value
When OFF value > S2 ≥ the range of the ON value, D is turned ON.
If the OFF value is less than the ON value
When OFF value > S2 or S2 ≥ the range of the ON value, D is turned ON.
If the OFF value equals the ON value
The operand D is always turned OFF.
Even if the execution condition is turned OFF, there will be no change to the
Point
output.
Operation flags
* If CR2012 is turned ON, the instruction will not be executed. When CR2012 is turned ON, the detailed
error information is stored in CM2250 to CM2276.
"Error log" (page 4-64)
Sample Program
The value of data memory entry DM0 is compared with the set value, and the output relays are turned
ON according to the following conditions.
When DM0 is greater than or equal to #100 and is less than #200, R1500 is turned ON.
When DM0 is greater than or equal to #300 and is less than #400, R1501 is turned ON.
When DM0 is greater than or equal to #500 and is less than #600, R1502 is turned ON.
When DM0 is greater than or equal to #700 and is less than #800, R1503 is turned ON.
When DM0 is greater than or equal to #900 and is less than #1000, R1504 is turned ON.
When DM0 is greater than or equal to #1100 and is less than #1200, R1505 is turned ON.
;<Mnemonics list>
CR2008 MOV
CPU BUILT-IN FUNCTIONS
MOV
Cam Switch
#600 DM15
MOV
#700 DM16
MOV
#800 DM17
MOV
#900 DM18
MOV
#1000 DM19
MOV
#1100 DM20
MOV
#1200 DM21
R000 MCMP
DM10 DM0 R1500
#6
MEMO
Cam Switch
encoder
absolute encoder
Available Devices
5 Bit Devices Word Devices
Local
Index
Const Ind Spec Device Modify
Operand
Cam Switch
MR DM
R DR LR T C CTC CR TM T C CTH CTC Z CM #/$ #TM * @ :#/:Z
B W
S1 - - - - - - - - - - - -
S2 - - - - - -
D1 - - - - - - - - - - -
D2 - - - - - - - - - - -
Operand Description
Specifies the leading device of the data block in which the angle value to compare (0 to 3599, in units of
S1
0.1°) is stored *1
S2 Specifies the device in which the absolute encoder value is stored *2
D1 Specifies the leading device in which the comparison results will be stored *3
D2 Specifies the leading device in which parameters are stored *4
*1 When you specify a bit device, the [ D2 + 0] × 32 consecutive bits from the start of the channel will be
used.
When you specify a word device, [ D2 + 0] × 2 words will be used.
*2 When you specify a bit device, 16 continuous bits will be used. If you specify a relay other than the
channel's leading relay (such as R002, R106, and R1012), the next channel will also be used to provide
the necessary 16 bits.
*3 When you specify a bit device, [ D2 + 0] bits will be occupied.
When you specify a word device, the result is stored in the lowest bit of the word device. The bits other
than the lowest bit will not be changed.
*4 When you specify a bit device, 128 consecutive bits from the start of the channel will be occupied.
When you specify a word device, 8 words will be occupied.
Operation Description
Device Details
Amount of data
D2 +0 Sets the amount of data to compare (1 to 32)
to compare
D2 +1 Resolution Sets the encoder resolution (32 to 32768)
Sets the residual gray code (0 to 16384)
Residual (Example) 32, 64, 128, 256, 512, 1024,
Resolution 36 360 720
D2 +2 2048, 4096, 8192, 16384, 32768
gray code
Residual
gray code 0 14 76 152
D2 +3
Zero degree
Sets the value to specify as zero degrees (0 to resolution - 1)
5
value
Cam Switch
Stores the current angle after compensation (0 to 3599)
Current angle • S2 - [ D2 + 2] ≥ [ D2 + 3]:
D2 +4 (in units of (3600/[ D2 + 1]) × ( S2 - [ D2 + 2] - [ D2 + 3])
0.1°) • S2 - [ D2 + 2] < [ D2 + 3]:
(3600/[ D2 + 1]) × ([ D2 + 1] + S2 - [ D2 + 2] - [ D2 + 3])
Device Details
D2 + 5 D1 D2 +4
Bit 0: Output response error
Conditions
If, within a scan period, the ON and OFF values differ between
two or more output destination devices that are changed or if
there are differences between the ON values or OFF values,
an error will occur. No
Change
No error will occur in the following cases. change
D2 +5 Operation error • When the ON values and OFF values of the outputs that are
changed at the same time are the same.
• When the ON values of the outputs that are changed at the
same time are the same and when the OFF values of the
outputs that are changed at the same time are the same.
Bit 1: Input value out of range error
No
When the encoder's input value is outside of the setting range, No change
change
this will be turned ON.
Use a ladder program to reset the data.
D2 +6
Work area (This cannot be used by the user.)
D2 +7
When the execution condition is turned ON, starting from S1 , the first [ D2 + 0] sets of 32-bit data
(each comprised of two sets of 16-bit, unsigned BIN data indicating the OFF value and ON value) are
compared with the current angle value stored in the device specified with [ D2 + 4], and the results
are stored in the bit devices starting from D1 .
• If you change the values during operation, the change will immediately be
Point reflected in the output. If you do not want to reflect the changes in the output,
turn the execution condition OFF.
• Do not use the CR2002 (normally turned ON) control relay as the execution
condition.
• Even if the execution condition is turned OFF, there will be no change to the
output.
• You cannot use this function in interrupt programs and initialization modules.
Operation flags
* If CR2012 is turned ON, the instruction will not be executed. When CR2012 is turned ON, the detailed
error information is stored in CM2250 to CM2276.
"Error log" (page 4-64)
Sample Program
The input values R000 to R007 from the absolute encoder are stored in DM0 and are compared with
the set value. Output relays are then turned ON according to the following specifications.
Resolution: 256/rotation. Residual gray code: 0. Zero-degree teaching value: 12.
R000
Absolute value type to
encoder R007
KV Nano Series
When DM0 is greater than or equal to 10.0° and is less than 20.0°, R30001 is turned ON.
When DM0 is greater than or equal to 30.0° and is less than 40.0°, R30001 is turned ON.
When DM0 is greater than or equal to 50.0° and is less than 60.0°, R30002 is turned ON.
Cam Switch
MOV STA DM0
#12 DM113 LD CR2002
MOV #100 DM10
MOV #200 DM11
CR2002 R000 $FF DM0 MOV #300 DM12
LDA ANDA STA MOV #400 DM13
Always turned ON MOV #500 DM14
CR2002 MOV MOV #600 DM15
#100 DM10 MOV #700 DM16
Always turned ON MOV #800 DM17
MOV #900 DM18
MOV MOV #1000 DM19
#200 DM11 MOV #1100 DM20
MOV #1200 DM21
MOV LD MR000
#300 DM12 ABSENC DM10 DM0 R1500 DM110
MOV
#400 DM13
MOV
#500 DM14
MOV
#600 DM15
MOV
#700 DM16
MOV
#800 DM17
MOV
#900 DM18
MOV
#1000 DM19
MOV
#1100 DM20
MOV
#1200 DM21
MR000 ABSENC
DM10 DM0 R1500
DM110
encoder
incremental encoder
D1 D2 D1 D2
Available Devices
5
Index
Local
Bit Devices Word Devices Const Ind Spec Device Modify
Operand
MR DM
Cam Switch
Operand Description
Specifies the leading device of the data block in which the angle value to compare (0 to 3599, in units of
S1
0.1°) is stored *1
S2 Specifies the number of the high-speed counter to use (0 to 3) *2, 5, 6
Specifies the encoder count input mode (0 to 5)
0 = single phase w/o direction; 1 = single phase w/ direction; 2 = phase difference 1x;
S3
3 = phase difference 2x; 4 = phase difference 4x; 5 = 2-pulse
"Count Input Settings" (page 5-116)
D1 Specifies the leading device in which the comparison results will be stored *3
D2 Specifies the leading device in which parameters are stored *4
*1 When you specify a bit device, the [ D2 + 0] × 32 consecutive bits from the start of the channel will
be used. When you specify a word device, [ D2 + 0] × 2 words will be used.
*2 You cannot use "$."
*3 When you specify a bit device, [ D2 + 0] bits will be occupied.
When you specify a word device, the result is stored in the lowest bit of the word device. The bits other
than the lowest bit will not be changed.
*4 When you specify a bit device, 80 consecutive bits from the start of the channel will be occupied.
When you specify a word device, 5 words will be occupied.
*5 The numbers that can be specified vary depending on the unit.
KV-N14** and KV-N24**: 0 and 1
KV-N40**: 0 to 2
KV-N60**: 0 to 3
*6 S2 : If the number of a high-speed counter that cannot be specified by the unit is entered in this
operand, the instruction will not be executed.
Operation Description
Cam Switch
Device Details
D2 +4 D1 D2 +3
Bit 0: Output response error
Conditions
If, within a scan period, the ON and OFF values differ between
two or more output destination devices that are changed or if
there are differences between the ON values or OFF values,
an error will occur. No
Change
No error will occur in the following cases. change
D2 +4 Operation error • When the ON values and OFF values of the outputs that are
changed at the same time are the same.
• When the ON values of the outputs that are changed at the
same time are the same and when the OFF values of the
outputs that are changed at the same time are the same.
Bit 1: Input value out of range error No
No change
When the encoder's input value is outside of the setting range. change
Use a ladder program to reset the data.
When the execution condition is turned ON, starting from S1 , the first [ D2 + 0] sets of 32-bit data
(each comprised of two sets of 16-bit, unsigned BIN data indicating the OFF value and ON value) are
compared with the current angle value stored in the device specified with [ D2 + 3], and the results
are stored in the bit devices starting from D1 .
5 different.
Example) D ...The ON values and OFF values of two or more output
destination devices that are changed within the scan
period are different.
OFF value of output destination device (4) does not
Cam Switch
• If you change the values during operation, the change will immediately be
Point
reflected in the output. If you do not want to reflect the changes in the output,
turn the execution condition OFF.
• When the high-speed counter is reset (RES instruction or Z-phase external
input) during operation, an error may occur according to the output response
error condition ([ D2 + 4], bit 0).
• Do not use the CR2002 (normally turned ON) control relay as the execution
condition.
• Even if the execution condition is turned OFF, there will be no change to the
output. The count value is held.
• S2 : Other functions or instructions that use the same high-speed counter as
that specified by this parameter cannot be used at the same time.
• INCENC instructions that use the same S2 cannot be used.
• Before you use the INCENC instruction, use the HSP instruction and the control
relays to set the input time constant to 10 µs.
"Input Time Constant Setting" (page 5-198)
• Because this instruction uses the high-speed counter function, do not use
ladder programs or similar methods to directly change the control relays,
control memory entries, CTH, and CTC related to the high-speed counter.
• The value of the high-speed counter is held when the power is turned off. To
clear this value, use the RES or CTH instruction.
• You cannot use this function in interrupt programs and initialization modules.
• Be careful when writing data during RUN mode.
"Writing data during RUN mode" (page 4-169)
Operation flags
Sample Program
Cam Switch
When the CTH1 value is greater than or equal to 10.0 and is less than 20.0, R1500 is turned ON.
When the CTH1 value is greater than or equal to 30.0 and is less than 40.0, R1501 is turned ON.
When the CTH1 value is greater than or equal to 50.0 and is less than 60.0, R1502 is turned ON.
When the CTH1 value is greater than or equal to 70.0 and is less than 80.0, R1503 is turned ON.
When the CTH1 value is greater than or equal to 90.0 and is less than 100.0, R1504 is turned ON.
When the CTH1 value is greater than or equal to 110.0 and is less than 120.0, R1505 is turned ON.
5
MOV #1100 DM20
MOV #1200 DM21
MOV LD R000
#300 DM12 INCENC DM10 #1 #5 R1500 DM110
Cam Switch
LD R001
MOV RES CTH1
#400 DM13
MOV
#500 DM14
MOV
#600 DM15
MOV
#700 DM16
MOV
#800 DM17
MOV
#900 DM18
MOV
#1000 DM19
MOV
#1100 DM20
MOV
#1200 DM21
R000 INCENC
DM10 #1 #5
R1500 DM110
R001 CTH1
RES
Overview
Tracing
Date and time DM11 DM12 DM13
Date and time DM11 DM12 DM13 Data before
Date and time DM11 DM12 DM13 the trigger
Date and time DM11 DM12 DM13
File save
trigger Date and time DM11 DM12 DM13
Date and time DM11 DM12 DM13 Data after
the trigger PC
Date and time DM11 DM12 DM13
Date and time DM11 DM12 DM13 The data saved to the
internal memory can be
Date and time DM11 DM12 DM13
viewed in the KV STUDIO
real-time chart monitor.
Logging is
performed constantly
Logging trigger
Execution relay
Reference On the KV Nano Series, you cannot use the logging function or the trace function together
with a memory card.
Usage Procedure
CPU BUILT-IN FUNCTIONS
Settings
Use KV STUDIO to configure the settings that you need to use the tracing function.
To use the tracing function, you have to set the:
• Device to trace.
• Trigger.
• Tracing details.
You can create up to 10 instances of the tracing function, which are identified by their tracing ID (0 to 9).
Set devices and triggers for each tracing ID.
Tracing
Item Description
Status Displays the current execution status during monitoring editing.
Function Displays the set function (fixed to the tracing function).
File path preview On the KV Nano Series, this is fixed to indicate the internal memory.
Comment Displays the set file comment.
Click this to display the "Logging/Trace setting" dialog box. You can use this
Setup
dialog box to configure the settings of the selected logging or tracing ID.
Delete Click this to delete the settings of the selected logging or tracing ID.
OK Click this to confirm the changes that you have made and close the dialog box.
Cancel Click this to cancel the changes that you have made and close the dialog box.
Click this to display the built-in function monitor of the selected logging or tracing
Built-in function monitor
ID. This is only available during monitoring.
Click this to start the execution of the selected logging or tracing ID (ladder
Start
programs are given priority). This is only available during monitoring.
Click this to stop the execution of the selected logging or tracing ID (ladder
Stop
programs are given priority). This is only available during monitoring.
2 Select the logging or tracing ID that you want to configure, and then click "Setup."
The "Logging/Trace setting" dialog box is displayed.
Item Description
File path preview On the KV Nano Series, this is fixed to indicate the internal memory.
File comment Set the file comment (up to 64 single-byte characters).
Function Select the function (this is fixed to tracing).*
* You can select a function other than tracing, but when you close the "Logging/Trace setting" dialog box,
the following dialog box will be displayed.
(An error will not occur.)
CPU BUILT-IN FUNCTIONS
5
"Tracing function" (page 5-177)
Tracing
File name
Device
Example
(1) Setting all devices to bit devices:
The ON/OFF status (0 or 1) of 128 bit devices will
be logged.
(2) Setting all devices to decimal, 16-bit word devices:
The values of 128 decimal, 16-bit word devices will 5
be logged.
Tracing
(3) Setting all devices to decimal, 32-bit word devices:
The values of 64 decimal, 32-bit word devices will
be logged.
Item Description
Click "Add" to display the "Logging/Trace device setting" dialog box. Add the device that you
Add
want to trace.
Select the device that you want to change and then click "Change" to display the "Logging/
Change Trace device setting" dialog box. Make changes to the settings of the device that you want
to trace.
Click "Delete" to delete the selected device (you can select multiple devices at the same
Delete
time).
Up Click this to move the selected device up in the registered sequence.
Down Click this to move the selected device down in the registered sequence.
Item Description
Set the device that you want to trace.
Target device*1 Press the button to select from the device comments.
Select the data format from "DEC 16BIT," "DEC 32BIT," "±DEC 16BIT," "±DEC 32BIT,"
Data format "HEX 16BIT," "HEX 32BIT," "ASCII 16BIT," and "FLOAT."
* To save data in SJIS format, select "ASCII 16BIT."
Only set this value when "Data format" is set to "ASCII 16BIT."
Word number
Setting range: 1 to 16
Set the target device as the leading device, and set how many devices that follow this
Cont. number
device consecutively will be logged or traced.
Trigger
CPU BUILT-IN FUNCTIONS
Use this tab to set the timing with which to start the tracing of the recorded devices.
5
Tracing
Item Description
Select the trigger type from "Bit device," "Cycle," and "Logging instructions
Type*1
(TRGD)."
Set a bit device.
Bit device Press the button to select from the device comments.
After a trigger occurs, the values of devices that are specified during END
Point
processing are acquired. Therefore, a maximum delay of one scan interval
may occur between a trigger occurring and the device values being saved.
Option
You can only configure the settings on this tab when you select the tracing function.
Use this tab to set the trigger that is used to save files and the file saving mode.
Tracing
Item Description
File saving Set a bitdevice.*3
Device Press the button to select from the device comments.
trigger
Trigger data quantity Set the amount of data after the trigger as a percentage. You can also
Trigger (%) use the slider to set the value.
position Trigger data quantity The amount of data after the trigger that you have set as a percentage
(Point)*1 is displayed as a number of points.
Select the file save destination from "Memory card" and "Internal
Saving location*2 memory."
Note that this setting is fixed to "Internal memory."
*1 To set the amount of data to save, from the workspace, open the "CPU system setting" dialog box, and
then click "System setting," "CPU unit buffer capacity."
CPU BUILT-IN FUNCTIONS
5
Tracing
If you increase the capacity of the ID that you are using, the amount of data that can be saved
(the number of samples) will be increased.
When configuring these settings, do not exceed a total capacity of 320 kB.
*2 Use the real-time chart monitor to read the data.
See "Real-time Chart Monitor" in the "KV STUDIO User's Manual."
Data saved in internal memory will be lost when the power is turned off.
You can also save the read data as .CSV files.
"KV STUDIO User's Manual"
*3 When you set the trigger type to "TRGD instruction" the file save trigger status is only confirmed when
the TRGD instruction and function are executed.
Logging Instructions
To execute logging, create a program that uses the logging instructions.
Instruction Mnemonic Operation Overview Page
Logging and tracing
enable LOGE 5-186
Enable and disable the execution of the logging and
Logging and tracing tracing functions of the specified ID
LOGD 5-186
disable
Logging data capture TRGD Captures the logging data of the specified ID 5-188
MEMO
Tracing
LOGE LOGE
Logging and tracing
enable
Enable and disable the
execution of the logging and
CPU BUILT-IN FUNCTIONS
Execution condition n
LOGD L O G D n
5 Available Devices
Index
Local
Bit Devices Word Devices Const Ind Spec Device Modify
Tracing
Operand
MR DM
R DR LR T C CTC CR TM T C CTH CTC Z CM #/$ #TM * @ :#/:Z
B W
n - - - - *1 - -
Operand Description
n Specifies the logging or tracing ID (0 to 9) *1, 2
Operation Description
LOGE When the execution condition is turned ON, tracing of the ID specified with n is
enabled.
After the instruction is executed, the CPU unit buffer of the specified ID is cleared, and the
logging and tracing execution relays are set. When a trigger occurs, tracing is executed.
Regardless of the status of the execution condition of the LOGE instruction, the execution
enabled status continues until a file save trigger is applied or the LOGD instruction is
executed.
You can use the same execution condition to enable the execution of tracing for all logging
IDs.
LOGD When the execution condition is turned ON, tracing of the ID specified with n is disabled.
After the instruction is executed, the logging and tracing execution relays are reset for each
ID, and tracing is then stopped. Until tracing is stopped, the tracing contents are stored in
buffer memory.
Logging ID Logging Execution Relay
0 CR000
1 CR100
2 CR200
3 CR300
4 CR400
5 CR500
6 CR600
7 CR700
8 CR800
9 CR900
Trigger
(bit device)
Executing
Executing
Executing
Logging or tracing Executing
execution
Scan
5
Logging and tracing
execution relay
Trigger (period)
Tracing
Executing
Executing
Executing
Executing
Logging or tracing
execution
Operation flags
Sample Program
Available Devices
Index
Local
Bit Devices Word Devices Const Ind Spec Device Modify
Operand
5 R
MR
DR LR T
DM
C CTC CR TM T C CTH CTC Z CM #/$ #TM * @ :#/:Z
B W
Tracing
n - - - - *2 -
Operand Description
Specifies the tracing ID whose data you want to capture or the leading device in which the data of the
n
tracing ID is being stored *1, 3
*1 For the logging ID, specify a value between 0 and 10. Specify the value "10" when you are using
instruction triggers during real-time chart monitoring.
*2 You cannot use "$" to specify the device.
*3 n : When you use this parameter to specify a bit device, 16 continuous bits will be occupied.
Operation Description
TRGD When the execution condition is turned ON, the data of the tracing ID specified with n
is captured.
• The data that is present when the TRGD instruction is executed is captured.
When you are using bit devices or periods to trigger tracing, data is captured during END
processing. However, you can capture data at any point during the ladder program by
using the TRGD instruction.
Operation flags
Sample Program
Tracing
memory entries.
Control relays and control memory entries are updated during END processing,
Point
so even if you access them during ladder operation, the results will not be
reflected until END processing.
Devices of IDs
Reference With the KV Nano Series, you cannot use the logging and memory card functions.
Device Details
If this relay is turned OFF before the file save trigger occurs, the data remaining in the buffer is all
discarded when the file save trigger occurs.
If this relay is turned OFF after the file save trigger occurs, even if all the data after the file save trigger
CPU BUILT-IN FUNCTIONS
occurred has not been captured, the subsequent data will not be captured, and only the data stored in
the buffer when the file save trigger occurred can be displayed on the real-time chart monitor.
The next time that the LOGE instruction is executed, this relay will be turned OFF.
Saving speed
• During tracing, the scan time may be extended by a maximum of (the number of IDs in use) ms.
• If multiple triggers occur at the same time, it is easy for the scan time to be extended.
Tracing
before a file save trigger occurs, the data remaining in the buffer is all discarded when the file save
trigger occurs.
If you switch from RUN mode to PROG mode after the file save trigger occurs, even if all the data after
the file save trigger occurred has not been captured, the subsequent data will not be captured, and only
the data stored in the buffer when the file save trigger occurs can be displayed on the real-time chart
monitor.
In addition, when you switch from PROG mode to RUN mode, all traces will be stopped, so to start
them again, you have to execute the LOGE instruction.
Character restrictions
(1) Character strings in CSV files : File comments and device comments
(2) ASCII character strings : When you have set the device's data format to "ASCII character
string"
There are limits to the characters that can be used in these
situations.
Item Description
Character strings in CSV files • You cannot use "," in this situation.
All ASCII codes are saved as is. Control characters, quotation marks, and
ASCII character strings
similar characters are also saved as is.
Reference If you use "KV COM+ for Excel/KV COM+ Library," you can read and write PLC device
values.
How to Connect to a PC
Use a USB cable (OP-35331) to connect the PC and the KV Nano Series.
• Before you connect the KV Nano Series to the PC's USB connector, be sure to install
5 Point
KV STUDIO.
• For a DC power supply type, the USB port's SG is shared with 0 V of the power
USB Communication
supply. A potential difference between the product being connected to and the SG will
lead to damage to the base unit and to the product being connected to.
You only have to install the USB driver the first time that you connect the device to a Windows 2000 PC.
From the second time that you connect the device, or from the first time that you connect the device to
a Windows 7, Vista, or XP PC, because the device is automatically detected, you do not have to install
the driver.
This section will explain the procedure for performing the installation on Windows 2000.
1 Log on as Administrator or as another user that has access rights to the system settings.
2 Use a USB cable to connect the USB ports on the PC and the KV Nano Series.
The message "Found New Hardware" is displayed, and then the Found New Hardware Wizard is
displayed.
3 Select "Search for a suitable driver for my device," and then click "Next."
4 Select only the "Specify a location" check box, and then click "Next."
Specify the location that KV STUDIO is installed in.
* The default installation location is "C:\Program Files\KEYENCE\KVS7E\KVS."
Serial Communication
What You Can Do with Serial Communications
Built-In
Function Name Description KV-N10L KV-N11L
Port
This mode is used to perform
communications with the KEYENCE
KV mode (uplink) ○ ○ ○ *1
proprietary protocol. No communication
program is required on the base-unit side.
This mode is used to send and receive
KV mode (send and
data with the STX header and ETX ○ ○ ○
receive text data)
delimiters.
This mode is used to communicate with
KEYENCE products such as the ladder
KV STUDIO mode ○ ○ ○
support software and the V3 Series of
touch panel displays.
This mode is used to freely set the
communication procedure format (header,
delimiter, and data length) to match the
Non-procedural
communication procedure of peripherals ○ ○ ○
mode
and to communicate with the peripherals.
Use ladder programs to configure all
format settings.
This mode is used to control the
Modbus master temperature and perform other operations
mode ○ ○ ○
on the Modbus communication target as
the Modbus master unit.
This mode is used to perform
communications as the slave unit in
Modbus slave mode ○ ○ ○
response to signals from the Modbus
master.
Serial This mode is used to form links between
- - ○ *2
PLC link mode PLCs.
*1 This can only be used with RS-422A/485 (4-wire).
*2 This can only be used with RS-485 (2-wire).
Reference If you will use the device in a mode other than KV STUDIO mode, use the Unit Editor to
configure the settings.
KV Nano Series "Serial Communication Function User's Manual"
Item Specification
Communication standard RS-232C
Communication mode Full-duplex
Isolation mode Not isolated (the 24 V power supply's 0 V and the SG are shared)
Synchronization mode Start-stop synchronization
Operation mode KV STUDIO mode (default value)
Baud rate Automatic
Data bit length 8 bits
5 Parity check
Stop bit length
Even
1 bit
Serial Communication
How to Connect to a PC
To connect the KV Nano Series and a PC, use the dedicated connection cable (OP-26487) and a D-
Sub 9-pin connector (OP-26401 or OP-26486).
On DC power supply types, the power supply and internal GND are not isolated,
Point
so connecting to a positively grounded device may damage the KV Nano Series.
KV Nano
OP-26401
OP-26486
USB RS-232C
conversion
connector
To the modular connector OP-26487 PC
(cable length: 2.5 m)
KV side PC side
RD 3 3 SD
SD 5 2 RD
4 DR
6 ER
7 RS
8 CS
1 2 3 4 5 6 SG 4 5 SG
Reference SG of the DC power supply type KV Nano Series devices is shared with the 0 V power
supply input terminal.
5-194 - KV Nano Series(terminal block type) User’s Manual -
5-9 Serial Communication
OP-26484:5 m
OP-35403:1 m
To PORT2 5
Serial Communication
To the modular connector
KV Nano Touch panel display
VT3 Series
OP-26401
OP-26486
To PORT3
OP-24025:5 m
To the modular connector OP-24045:1 m
KV Nano Touch panel display
VT3 Series
Reference • You do not have to configure any settings on the KV Nano Series side.
• For details on connecting to a VT3 Handy Series or VT3-W4 Series device,
see the "VT3 PLC Connection Manual."
For details on the settings on the VT3 side, see the "VT3 PLC Connection
Manual."
To connect the KV Nano Series to peripherals, see the following diagram for wiring to a PC, and
connect the devices according to the shape of the connector on the peripheral that you are using.
5
*3.9kΩ 1/4W *3.9kΩ 1/4W
Pin numbers on the
KV unit side Straight cable OP-26487 Straight cable OP-26487
+ +
On the unit side, pins 1 and D-sub 9-pin connector OP-26486 D-sub 25-pin connector OP-26485
Serial Communication
Reference When you are connecting a modem, use a cross-over cable such as OP-96607 instead of
OP-26487.
I/O
Input time constant setting "Input Time Constant Setting" (page 5-198)
Input refresh disabling "Input Refresh Disabling" (page 5-199)
Output disabling "Output Disabling" (page 5-200)
General I/O
If the base unit's I/O is not used for interrupt input, for the high-speed counter, for the frequency
counter, for the cam switch, for specified frequency pulse output, or for motor (positioning) control, this
I/O can be used as general I/O.
For terminal numbers of I/O, see "Specifications" (page 2-9).
Useful usage methods when using I/O as general I/O are described below. In addition, these methods
can also be used in the same manner with expansion I/O units.
I/O Refresh
Normally, during program execution, the status of I/O signals is updated (refreshed) only once per scan
(during END processing). You can use the following methods to update the I/O signals at arbitrary
positions in programs (direct processing).
Example
DR000 DR500
DR can only be used with the built-in I/O of the KV Nano Series.
Interrupt processing
During interrupt processing, the base unit input relays will be refreshed before the program is executed.
In addition, when the SET or RES instruction is executed, the base unit output relays are refreshed
immediately without waiting for the program's END processing.
"4-7 Interrupts" (page 4-76)
- KV Nano Series(terminal block type) User’s Manual - 5-197
5-10 I/O
The input time constant switching function can set the input time constant as the pulse width that is
accurately acquired as signals from the input contact. If you make the input time constant small, you
can obtain pulses with a narrower width. On the other hand, if you make the input time constant large,
the input time constant can be used as a simple noise filter.
If you connect a non-contact signal in which chattering does not occur or when you are acquiring high-
speed signals from an encoder or similar device, you can handle high-speed signals by reducing the
input time constant.
Reference There are three methods to set the input time constant: using the high-speed instruction
5 (HSP), using a control relay and a control memory entry (CR2305 and CM1620), and
using the Unit Editor. (Expansion I/O units can only be set from the Unit Editor.)
"Chapter 3 UNIT EDITOR" in the "KV STUDIO User's Manual"
I/O
If the HSP instruction and control relay CR2305 are used at the same time, the HSP instruction is given
priority, so the input time constants of the specified relays will not be set to the value specified with
CM1620.
Example
The input time constant is set to 1 ms.
CR2008 #3 CM1620 CR2305
LDA STA SET
The input time constant is set when the scan is completed. Therefore, changes
Point
that you specify will be enabled starting with the next scan.
Unit Editor
You can use the Unit Editor to change the input time constant of the input relays of the KV Nano Series.
I/O
Input Refresh Disabling
If you disable input refreshing, the input relay (built-in input relays and relays assigned to the expansion
input units) status will not be updated according to the actual input signals. Because the actual input
relay settings can be forcibly turned ON and OFF during monitoring with KV STUDIO, you can use this
function to perform debugging that is not influenced by the connection status of peripherals.
Reference When you are using expansion I/O units, you can perform forced sets and forced resets
from KV STUDIO.
See "Forced Set/reset Register" in the "KV STUDIO User's Manual."
If you are using an extension access window cassette with the KV Nano Series, you can enable input
refreshing by operating the extension access window cassette.
See "Debugging" (page 5-239)
Reference • When you use the RUN-PROG selector switch to switch between RUN mode and
PROG mode, input refreshing is enabled (it is not enabled when you switch between
RUN mode and PROG mode from the KV STUDIO monitor).
• When input refreshing is disabled, the RUN LED blinks (it does not blink during PROG
mode).
• The function is also enabled when you turn the power off, clear the RAM, or execute an
Output Disabling
I/O
If you disable output, output is not generated to the output relays (built-in output relays and relays
assigned to the expansion output units) even if you turn the output coil ON and OFF in your program, so
you can debug the program without actually generating output to the peripherals.
Reference • When you use the RUN-PROG selector switch to switch between RUN mode and
PROG mode, output is enabled (it is not enabled when you switch between RUN mode
You can forcibly set and reset the specified device while ignoring the refresh status and the ladder
program. 5
Because you can even forcibly set and reset the relay numbers that are actually assigned to I/O, this
I/O
enables you to debug problems efficiently.
Reference • You can only specify the R and B devices (excluding local devices).
• You can specify up to 16 devices.
• You can use ladder programs, communications, and similar methods to change the
target device, but it will be overwritten with the value registered to forced sets and
resets during END processing.
When the forced set or reset is cleared on a relay, the relay temporarily returns to
Point
its initially registered state. Therefore, forced set or reset relays that are actually
turned ON may be turned OFF for a moment when the forced set or reset is
cleared.
Using an extension access window cassette to clear forced sets and resets (the
cassette cannot be used to perform registrations)
You can use an extension access window cassette to clear forced sets and resets.
Reference • When you use the RUN-PROG selector switch to switch between RUN mode and
PROG mode, forced sets and resets are cleared. (They are not cleared when you
switch between RUN mode and PROG mode from the KV STUDIO monitor.)
• When forced sets or resets are registered, the RUN LED blinks (it does not blink during
PROG mode).
• Forced sets and resets are also cleared when you turn the power off, clear the RAM, or
execute an all clear operation.
You can install an extension access window cassette (KV-N1AW) in the KV Nano Series.
The KV-N1AW is a compact, two-color, back-lit LCD display.
The LCD is displayed in green in RUN mode and in red in PROG mode (when operations are stopped).
5 ・ロード
Load/Save
Axis1
CPU monitor
・セーブ ポイントNo. 0
Access Window
・プロパティ P +0
・アキヨウリョウ V 0
・Load Axis1
・Save PointNo. 0
・Properties P +0
・Data Clear V 0
Reference You can install cassettes in the left side and right side of the KV-N40** and KV-N60** base
units. However, you cannot use a base unit when two cassettes are installed in it.
List of functions
You can attach one extension access window cassette (KV-N1AW) to the KV Nano Series, and by
Device mode
This mode can be used to display internal devices and change their settings.
"Device Mode" (page 5-206)
Error clear
This mode can be used to clear serious base unit errors.
"Error Clear" (page 5-214)
5
Access Window
I/O test
This mode can be used to check the I/O status of the base unit or expansion I/O units.
"I/O Test" (page 5-216)
CPU monitor
This mode can be used to monitor the status of the CPU's positioning and frequency counter functions.
Also, you can check the project names of the programs that are contained in the main unit.
"CPU Monitor" (page 5-221)
Alarm monitor
This mode can be used to monitor alarms and to check the alarm log.
"Alarm" (page 5-227)
Debugging
This mode can be used to clear forced sets and resets that have been registered and to enable input
refreshing and output from the access window.
* You can only register forced sets and resets and disable input refreshing and output from KV STUDIO.
"Debugging" (page 5-239)
RAM clear
This mode can be used to clear device values.
"RAM Clear" (page 5-241)
CPU BUILT-IN FUNCTIONS
All clear
This mode can be used to clear all of the settings.
"All Clear" (page 5-242)
Menu Structure
Use the menu screen to switch between modes.
Press "M" to display the menu. (If a different unit is selected, press "M" twice.)
5 Press "▼" to display the menu items that are not displayed on the screen. Press "" and "" to move
through the pages of the menu.
Access Window
1.デバイスモード 1.DeviceMode
2.エラークリア 2.ErrorClear
3.LANGUAGE 3.Language
4.I/Oテスト 4.I/O TEST
In the examples shown, Japanese characters are shown on the left and English characters are shown
on the right.
Reference The default language is English. To switch between Japanese and English:
• Use "3.Language" to configure the setting.
"Language" (page 5-215)
• Use the access window initial screen display function.
"Access Window Initial Screen Display Function" (page 5-243)
For details on how to clear errors, see "Error Clear" (page 5-214).
1.DeviceMode
Access Window
Record
ClearRecord
8.Load/Save Load
Save
Properties
Data Clear
Data Lock
9.Debug ForcedSet
Input
Output
10.Contrast
11.RAMClear
12.All Clear
5
Access Window
(1) Access window.................Displays the current values and set values of each device as well as
error messages.
(2) Setup operation keys........These keys are used to move between modes and to change the
settings of each mode. The functions of the keys differ depending on the
mode. For details, see the operating instructions for each mode.
Unit Monitor
You cannot monitor and configure the settings of expansion units and special units, such as I/O units,
that are connected to the base unit. Use the input indicator of each unit to monitor the units.
Device Mode
This mode can be used to monitor and change the PLC device values.
You cannot monitor the status of the contacts of timers, counters, and high-speed
Point
counter comparators.
XYM marking
Relays (R), internal auxiliary relays (MR), latch relays (LR), and data memory entries (DM) can be
Device Number
Device Name Default Marking XYM Marking
during XYM Marking
Input X 0000 to 599F
Relay R Output Y 0000 to 599F
Internal auxiliary R 0000 to 59915
Internal auxiliary relay MR M 00000 to 9599 5
Latch relay LR L 00000 to 3199
Access Window
Data memory DM D 00000 to 32767
Operating Instructions
1 Press "M."
A menu is displayed. (If a different unit is selected, press "M" twice.)
R0
OFF
R1
OFF
You can use the "" and "" keys to change the number of the device that you are monitoring.
R500
ON
R501
OFF
5 ・R
・MR
・LR
Access Window
・B
3 "•TM" flashes.
Press " ."
・DM
・W The screen for selecting the number of
・CM the device that you want to display
・TM
appears.
ジャンプ JUMP The current device number blinks on
TM TM
the third line from the top.
0 0
10 10
The numerical value displayed on the fourth line is the amount to change the device number by.
Use the "" and "" keys to change the device number.
In the example shown here, each time you press "," the device number will increase by 10.
Press " " to switch the amount to change the device number by between 1 and 10.
Use the "," "," and " " keys to select the number of the device that you want to display.
Press " " to display the TM of the specified number.
TM53
0
TM54
100
・R
・MR
・LR
・B 5
Access Window
3 The display format selection screen appears.
16Bit-BASE10 16Bit-BASE10
フゴウナシ UnSigned
On/Off On/Off
R500
ON
R501
OFF
The display formats that you can select are shown in the following table.
R500
ON
R501
OFF
・R
・MR
・LR
・B
Default Default
4 The screen for selecting whether to display the device name or comments appears.
Use the "" and "" keys to select whether to display the device name or comments.
Press "" to display "Comment."
コメント Comment
5 Press " " to select the comment display and return to the device mode monitor.
In the example shown in the following screens, the comment "Sensor A" is registered in R0, and no
comment is registered in R1.
センサー A Sensor A
OFF OFF
R1 R1
OFF OFF
1 With the device that you want to change displayed, hold down " " for 1 second or more.
5
Access Window
If two devices are displayed on the screen, the device whose value can be changed is the device
displayed on the higher row. (In this situation, when you press the key, the device on the lower row is
hidden.)
R1000
OFF
R1000
OFF
R1000
OFF
3 Set the device value to the value that you want to store, and then hold down " " for 1 second
or more.
The value stops blinking, and is stored. If you hold down the key for less than 1 second, the value is not
stored, and the screen returns to the monitor display.
R1000
ON
• When the display format is a format other than On/Off (excluding T, C, and CTH/CTC devices)
As an example, the following explains how to change the value of DM1000 from 100 to 201.
1
CPU BUILT-IN FUNCTIONS
With the device that you want to change displayed, hold down " " for 1 second or more.
DM1000
100
DM1001
101
5 DM1000
100
Access Window
3 Press "."
The change amount is added to the device value. The device value display changes to "101."
(The value will not be stored in the device at this point in time.)
DM1000
101
DM1000
101
10
DM1000
101
100
DM1000
201
100
7 Set the device value to the value that you want to store, and then hold down " " for 1 second
or more.
The value is stored, and the screen returns to the monitor display.
If you hold down the " " key for less than 1 second, the value is not stored, and the screen returns to
the monitor display.
• When the display format is a format other than On/Off (T, C, or CTH/CTC devices)
You can change both the set value and the current value for T, C, and CTH/CTC devices.
Access Window
in the figure to the left.
Error Clear
CPU BUILT-IN FUNCTIONS
Reference If an error occurs on the base unit or on an expansion unit, the detailed information of the
error is displayed automatically. If the error is minor, you can press any key on the access
window to clear the error and return to the previous display. If the error is serious, the
error display will be cleared, but the error itself will not be. The error will be displayed
again if you do not perform any operations on the access window for 30 seconds or when
you switch the RUN PROG selector switch to RUN. Also, " " is displayed in the upper
5 right of the access window screen even during the normal screen display.
1.DeviceMod
Access Window
2.ErrorClear
3.Language
4.I/O TEST
Operating instructions
1 Press "M."
A menu is displayed. (If a different unit is selected, press "M" twice.)
エラーナシ No Error
3 If an error has occurred, hold down " " for 1 second or more.
The displayed serious error is cleared.
Language
You can switch the display language between Japanese and English. For Japanese, text will be
displayed in Katakana.
1 Press "M." 5
A menu is displayed. (If a different unit is selected, press "M" twice.)
Access Window
2 Use the "" and "" keys to select "3.Language," and then press " ."
Language Language
Japanese English
4 Use the "" and "" keys to switch between Japanese and English.
Language Language
English Japanese
Reference Even if you change the language to Japanese, the text displayed on the Language menu
will not be displayed in Japanese.
To confirm the language, press "M" to display the menu.
I/O Test
CPU BUILT-IN FUNCTIONS
This mode can be used to check the I/O status of the base unit's built-in I/O and of the expansion I/O
units.
Reference You can even check the I/O status when projects that include the settings of the unit
structure that you configure in KV STUDIO have not been transmitted to the base unit.
Operating instructions
Switching to I/O test
1 Press "M."
A menu is displayed. (If a different unit is selected, press "M" twice.)
3 Press "" and "" to select the unit, and then press " ."
The I/O status of the selected unit is displayed (to display the status of the base unit, select unit number
0).
Input units
The unit's number of points (8 or 16) and "IN" is displayed.
You can use the "" and "" keys to move the relay position that you want to check. The position is
moved in 16-bit intervals.
Output units
The unit's number of points (8 or 16) and "OUT" is displayed.
You can use the "" and "" keys to move the relay position that you want to check. The position is
moved in 8-bit intervals.
You can use the " " key to invert the output status (ON/OFF) at the cursor position.
You can use the " " key to change the cursor position.
Operate this mode after first sufficiently confirming the status of the connected
5
Point
control equipment.
Access Window
I/O units
The unit's number of points (8 or 16) and "IN" or "OUT" is displayed.
You can use the "" and "" keys to move the relay position that you want to check. The position is
moved in 8-bit intervals.
You can use the " " key to invert the output status (ON/OFF) at the cursor position.
You can use the " " key to change the cursor position.
Operate this mode after first sufficiently confirming the status of the connected
Point
control equipment.
Clock
CPU BUILT-IN FUNCTIONS
5 The clock function cannot be used with the KV-N14**. All the information is
Point
displayed as "-."
Access Window
Operating instructions
Switching to the clock
1 Press "M."
A menu is displayed. (If a different unit is selected, press "M" twice.)
2012/06/14
12:34:56
Thu
2012/06/14
12:34:56
Thu
2 Use the " " key to select the item that you want to set.
Each time that you press " ," the item being set switches in the following order: year month day
hour minute second day of the week year. 5
Access Window
2012/06/14
12:34:56
Thu
3 Use the "" and "" keys to set the selected item.
2012/06/14
12:34:56
Thu
4 Repeat steps 2 and 3. When you are finished configuring the settings, hold down " " for 1
second or more.
"Exec" is displayed on the right side of the bottom row to indicate that the request to change the date
and time settings has been received.
(The settings have not been applied at this point in time.)
Release the " " key to apply the date and time settings and return to the date and time display.
2012/06/14 2012/06/14
12:34:56 12:34:56
Thu Thu
ジッコウ Exec
If you release the " " key before "Exec" is displayed, the date and time settings will not be applied,
and the screen will return to the date and time display.
Set the year, month, day, hour, minute, second, and day of the week accurately.
Point
If the day of the week matches the year, month, day, hour, minute, and second is
not checked.
0-second adjustment
0-second adjustment is a function for setting the seconds value to 0.
CPU BUILT-IN FUNCTIONS
2012/06/14 2012/06/14
15:59:44 15:59:44
Thu Thu
アジャスト Adjust
5 "Adjust" is displayed on the bottom row to indicate that the time can be adjusted.
Access Window
(To cancel time adjustment, press " " again. The string "Adjust" disappears, and the screen returns to
the date and time display.)
2012/06/14 2012/06/14
16:00:00 16:00:00
Thu Thu
アジャスト ジッコウ Adjust Exec
If you release the " " key before "Exec" is displayed, the time adjustment will not be applied, and the
screen will return to the date and time display.
CPU Monitor
Access Window
You can monitor the CPU built-in serial function and the
extension serial communication function. You can monitor
the mode, communication conditions, Modbus-related
settings, and PLC link-related settings.*1 The only settings
that you can change are "Baud Rate" in the
シリアル Serial
communication conditions and "Modbus No." (which can
only be changed in PROG mode) and "PLC Link Station
No." in the Modbus-related settings.
See the KV Nano Series "Serial Communication
Function User's Manual."
Turn the analog volume knob on the unit surface to
ボリューム Volume change this value. (You cannot change the value from the
access window.)
*1 When you are using the built-in serial communication port, you cannot perform monitoring.
Operating instructions
Switching to the CPU monitor
1 Press "M."
A menu is displayed. (If a different unit is selected, press "M" twice.)
・プロジェクトメイ ・ProjectName
・イチギメ ・AxisControl
・シュウハスウカウンタ ・FreqCounter
・シリアル ・Serial
Project name
1 Select "ProjectName" from the CPU monitor menu, and then press " ."
CPU BUILT-IN FUNCTIONS
ProjectA ProjectA
transmitted.
For details on the access window display comments, see the "KV STUDIO User's Manual."
Reference When you create a ladder program, the project name that you set with KV STUDIO is
stored in CM1740 to CM1756 after data is transmitted.
Positioning
1 Select "Pos Control" from the CPU monitor menu, and then press " ."
The status of the positioning function is displayed.
The positioning monitor has five monitor functions.
You can switch between these functions by using the "" and "" keys.
The monitored contents are shown below.
• Monitoring the point number being executed, current value, and current speed of axis n (n: 1 to 4)
• During pulse output, an asterisk is displayed.
Axis1 CR8000
76543210
L _ _ ■ _ ■ _ ■■ CR8000
H _ ■_■■ _ _ _ CR8008
CR8015
Axis1 CR8400
76543210
L _ _ ■_■ _■■ CR8400
H _ ■ _■■ _ _ _ CR8408
CR8415
Frequency counter
1 Select "Freq Count" from the CPU monitor menu, and then press " ."
Access Window
+12345 +12345
rpm rpm
The display when you are not using the frequency counter is shown below.
You can use the "" and "" keys to change the channel number of the frequency counter that is
displayed.
Serial
1 Select "Serial" from the CPU monitor menu, and then press " ."
The serial monitor screen is displayed.
2 Select the port number—internal port: 0, extension cassette (left): 1, and extension cassette
(right): 2—and then press " ."
0 1 2
・Port0 ・Port0
・Port1 ・Port1
・Port2 ・Port2
モード Mode
KVSモード KVS Mode
• Interface monitor
5
The communication mode is displayed.
Access Window
• Parity monitor
Access Window
for the built-in ports)
• PLC link type monitor (only during serial PLC link mode; * not displayed for the built-in ports)
• Serial PLC link station number monitor (only during serial PLC link mode; * not displayed for the built-
in ports)
The station number used during serial PLC link mode is displayed.
If you have configured the settings so that the serial PLC link station number is set from the Unit
Editor, this setting can only be changed in PROG mode.
• How to set the value
CPU BUILT-IN FUNCTIONS
• Monitor of the communication status (station number: 0 to 7) of serial PLC link communication (only
during serial PLC link mode; * not displayed for the built-in ports)
5
シリアル Port1 Serial Port1
PLCリンク ツウシン PLCLinkState
76543210 76543210
________ ________
Access Window
The communication status (station number: 0 to 7) of serial PLC link communication is displayed.
• Monitor of the communication status (station number: 8 to F) of serial PLC link communication (only
during serial PLC link mode; * not displayed for the built-in ports)
The communication status (station number: 8 to F) of serial PLC link communication is displayed.
• Monitor of the error status (station number: 0 to 7) of serial PLC link communication (only during
serial PLC link mode; * not displayed for the built-in ports)
The error status (station number: 0 to 7) of serial PLC link communication is displayed.
• Monitor of the error status (station number: 8 to F) of serial PLC link communication (only during
serial PLC link mode; * not displayed for the built-in ports)
The error status (station number: 8 to F) of serial PLC link communication is displayed.
• Monitor of the period of serial PLC link communication (only during serial PLC link mode—master; *
not displayed for the built-in ports)
Volume
You can monitor the status of the analog volume knob. To change the value, turn the analog volume
Reference • The display value of the analog volume knob is between 0 and 255.
• Even if you do not turn the analog volume knob, the value may change due to causes
such as changes in the temperature.
• When you turn the analog volume knob, the access window display automatically
switches to show the volume. However, the display does not change:
• During saving, loading, and data clearing.
• During all clear and RAM clear operations.
• During device value monitoring. 5
• Operating instructions
Access Window
Switching to the volume display
1 Select "Volume" from the CPU monitor menu, and then press " ."
The volume monitor screen is displayed.
Displays the CM1630 device
comment
Volume0 Volume0 ("Volume0" if no comment is set)
50 50
Volume1 Volume1
100 100
Displays the CM1632 device
comment
Alarm
If you register messages as device comments to the alarm relays (CR3300 to CR3415) in advance,
these messages are automatically displayed in the access window when the alarm relays are turned
ON. In addition, you can also view and clear the log of alarms that have occurred.The alarm can be
checked on the KV STUDIO error monitor.
Usage method
The devices that you can use with alarms are shown below.
Be sure to use the SET and RES instructions to operate alarm relays. You can
Point
also use the ARES instruction to reset alarm relays during operation and to clear
all the alarm log entries at the same time.
Alarm log
Each log entry stores the alarm relay number, the time and date (year, month, day, hour, minute, and
second), and the ON/OFF status.
• When the ON OFF log relay (CR3501) is turned OFF
The log is only saved when alarm relays switch from OFF to ON.
• When the ON OFF log relay (CR3501) is turned ON
The log is saved when alarm relays switch from OFF to ON and from ON to OFF.
Turn CR3502 ON to clear the alarm relay log. When the clearing operation is finished, CR3502 will be
turned OFF.
Operating Instructions
Switching to alarms
1 Press "M."
A menu is displayed. (If a different unit is selected, press "M" twice.)
・モニタ ・Monitor
・リレキ ・Record
・リレキクリア ・ClearRecord
Monitor
1 Select "Monitor" from the alarm menu, and then press " ."
①
アラーム モニタ Alarm Mon
01/03 01/03
② Work Error Work Error
5
(1) 01/03
Access Window
This indicates the number of the alarm that is currently displayed/the total number of alarms that are
currently occurring.
When several alarms occur, the alarm with the smallest alarm relay number is displayed first.
(2) Work Error
This is the device comment of the device that corresponds to the currently displayed alarm.
Log display
1 Select "Record" from the alarm menu, and then press " ."
The alarm log will be displayed.
Press "" and "" to display the previous log entry and subsequent log entry, respectively.
リレキ 01/04 ①
② PressureOver
2012/06/14
④
15:49:39 ↓ ③
(1) 01/04
This indicates the number of the alarm log entry that is currently displayed/the total number of alarm
log entries.
The newest log entry number is "01."
(2) Press Alarm
This is the device comment of the device that corresponds to the currently displayed log entry.
(3) Down arrow
This indicates that the log entry was recorded when the alarm relay switched from ON to OFF. Log
entries that were recorded when alarm relays switched from OFF to ON are indicated by an up
arrow.
(4) 2012/06/14 15:49:39
This indicates the date and time that the log entry was recorded.
Log clear
1 Select "Clr Record" from the alarm menu, and then press " ."
CPU BUILT-IN FUNCTIONS
A message asking you to confirm that you want to clear the log is displayed.
You can perform operations such as saving data to and loading files from the extension access window
cassette.
The operations that you can perform are shown below.
Operating instructions
Access Window
The load/save menu is displayed.
・ロード ・Load
・セーブ ・Save
・プロパティ ・Properties
・データクリア ・Data Clear
Loading
1 Select "Load" from the extension access window cassette menu, and then press " ."
A message asking you to confirm that you want to load data is displayed.
ロード Load
ロード OK? Load OK?
KVS PROJECT KVS PROJECT
2 Hold down " " for 1 second or more to load the data.
During loading, the following screen is displayed.
To cancel loading, press "M" or " " for less than 1 second.
ロード Load
KVS PROJECT KVS PROJECT
プログラム Program
65% 65%
ロード Load
ライトプロテクト Protected
ロード OK? Load OK?
KVS PROJECT KVS PROJECT
ロード Load
CPU BUILT-IN FUNCTIONS
Reference To load a project stored on an extension access window cassette, you have to perform
operations from the access window or from control relays (CR).
Saving
5 1 Select "Save" from the extension access window cassette menu, and then press " ."
A message asking you to confirm that you want to save CPU data is displayed.
Access Window
セーブ Save
セーブ OK? Save OK?
2 Hold down " " for 1 second or more to save the data.
While data is being saved, the names of the files currently being saved and the overall progress are
displayed.
セーブ Save
DM .ZDV DM .ZDV
80% 80%
Reference If a project with the same name already exists, a message asking you to confirm that you
want to overwrite the existing project will be displayed.
セーブ Save
ウワガキ OK? OverwriteOK?
KVS PROJECT KVS PROJECT
Point Never turn the power off while data is being saved.
セーブ Save
Reference • You can save project data and device values to extension access window cassettes.
• If you have enabled read protection or set passwords in the CPU system settings, you
will be unable to save projects, and instead you will only be able to save device values.
• To save to an extension access window cassette a project whose read protection has
been enabled or whose project password has been set, transfer the project, and then
perform the save operation within 60 seconds.
5-232 - KV Nano Series(terminal block type) User’s Manual -
5-11 Access Window
Reference To save a project to an extension access window cassette, you have to perform
operations from the access window or from control relays (CR).
KVS PROJECT
KV N24
2012/06/14
12:34:56
5
2 Use the "" and "" keys to display the CPU function version of the project.
Access Window
KVS PROJECT
CPU Function
Version:
v1.0
Data clear
1 Select "Data Clear."
3 Hold down " " again for 1 second or more to delete the data.
A message indicating that the data is being deleted is displayed.
4 When the deletion is complete, the screen will return to the file list display.
Data lock
1 Select "Data Lock" from the extension access window cassette menu, and then press " ."
CPU BUILT-IN FUNCTIONS
5 データロック
カイジョ OK?
Data Lock
Unlock OK?
Access Window
Loading
You cannot load programs during RUN mode. Switch to PROG mode, and operate the control relays.
Access Window
Project load execution failure
List of devices
Device Attribute
Description
CPU BUILT-IN FUNCTIONS
R: Read only
Number Blank: Read/write
This is the project load execution request flag. When this changes from
CR3000 OFF to ON, the project is loaded (the project cannot be loaded in RUN
mode).
This is the project load execution completion flag. When a project finishes
CR3004 R loading, this is turned ON. When the project load execution request flag
changes from OFF to ON, this is turned OFF.
This is the project load execution failure flag. When a project fails to load,
CR3005 R this is turned ON. When the project load execution request flag changes
from OFF to ON, this is turned OFF.
5 Reference program
Access Window
Saving
When you are using a ladder program to control the control relays, use the SET or KEEP instructions to
save programs.
List of devices
Device Attribute
Description
Reference program 5
Use the SET instruction to save a project.
Access Window
<Mnemonics list>
MR200 CR3002 LDP MR200
SET SET CR3002
Project save
execution LD CR3006
request RES CR3002
CR3006 CR3002 LD CR3007
RES SET MR201
Project save Project save
execution completion execution RES CR3002
request
CR3007 MR201
SET
Project save Save failure
execution failure
CR3002
RES
Project save
execution
request
Occurs
Number Title Cause Remedy
In
Loading at power on was not
1 Not executed Loading
executed.
No project data is saved on the AW Check whether project data is
4 No data Loading
cassette. present.
Loading
5 No AW No AW cassette is present. Connect an AW cassette. and
saving
A program was being transferred or Wait for the program transfer or
Loading
Project access read from a different source, so reading operation to be completed,
6 and
contention loading and saving could not be and then perform the loading or
saving
performed. saving operation.
• Read protection or a project You cannot load projects on which
password has been set, so the read protection or a project
Data Loading
project could not be saved. The password has been set.
7 protection in and
devices have been saved. You cannot load or save projects on
place saving
• Write protection has been set, so which read protection or a project
the project could not be loaded. password has been set.
The project data within the AW On the AW menu, select "8.Load/
8 Data lock cassette is locked, so the data could Save" and then "• Data Lock" to Saving
not be saved. release the AW cassette data lock.
Occurs
Number Title Cause Remedy
In
Base unit The load operation could not be On the AW menu, select "8.Load/
CPU BUILT-IN FUNCTIONS
9 model performed because the models are Save" and then "• Properties" to Loading
discrepancy different. check the model of the base unit.
Loading cannot be performed in Switch to PROG mode, and then
11 RUN mode Loading
RUN mode. load the data.
Loading
AW data The data on the AW cassette is
14 Save data to the AW again. and
abnormality abnormal.
saving
Load the data again.
Loading of the data on the AW If this error occurs frequently,
1000 Load error Loading
cassette failed. contact your KEYENCE
5 representative.
Save the data again.
Saving data to the AW cassette If this error occurs frequently,
Access Window
• You can insert and remove the extension access window cassette up to 200
Point
times.
• If no saved data exists on the extension access window cassette, data cannot
be loaded.
• To save read-protected data on an extension access window cassette, select
the "Clear module/macro in PLC" check box for the base unit, and then transfer
the data. Save the data within 60 seconds of transferring it.
Operating procedure
1 While holding down the "M" key on the extension access window cassette, turn on the power.
Debugging
Reference When, because of KV STUDIO or values written to CR and CM, registration is being
performed or when functions are disabled, the access window will automatically indicate
that registration or function disabling is in progress. You can press any key to return to the
previous screen. However, registration will not be cleared and the disabled function will
not be enabled.
5
Items that can be cleared and enabled
Access Window
Japanese English Description
When forced sets and resets are registered, you can clear them
キョウセイセット ForceSetRegi
at the same time.
ニュウリョク Input You can enable the input refresh function if it has been disabled.
シュツリョク Output You can enable the output if it has been disabled.
Operating instructions
Switch to debugging
1 Press "M."
A menu is displayed. (If a different unit is selected, press "M" twice.)
・キョウセイセット ・ForceSet
・ニュウリョク ・Input
・シュツリョク ・Output
キョウセイセットリセット ForceSetRegi
イッセイカイジョ Cancel
OK? OK?
Point This function cannot be executed if no forced set or reset devices are registered.
キョウセイセットリセット ForceSetRegi
イッセイカイジョ Cancel
カンリョウ Done
5 ニュウリョクリフレッシュ
キンシ カイジョ
InputRefresh
Inhibit
OK? Cancel OK?
Access Window
ニュウリョクリフレッシュ InputRefresh
キンシ カイジョ Inhibit
カンリョウ Cancel Done
Enabling output
1 Select "Output" from the debug menu, and then press " ."
A message asking you to confirm that you want to enable output is displayed.
Contrast
1 Press "M."
A menu is displayed. (If a different unit is selected, press "M" twice.)
2 Use the "" and "" keys to select "10.Contrast," and then press " ."
The access window setup menu is displayed.
コントラスト Contrast
5
6 6
Access Window
Use "" and "" to increase and decrease the contrast value until you have adjusted the
contrast to a level that is easy to see.
You can set the contrast to a value between 1 and 11.
コントラスト Contrast
5 5
RAM Clear
You can use the RAM clear mode to clear the device values, alarm logs, and error logs at the same
time. This mode also returns the language and contrast settings to their default values.
Performing a RAM clear initializes R, MR, LR, B, CR, T/C (current values), CTH, CM, DM, and Z.
Ladder programs, unit setup information, comments, T/C (set values), CTC, and logging setup
information will not disappear.
Point The RAM clear operation can only be executed in PROG mode.
1 Press "M."
A menu is displayed. (If a different unit is selected, press "M" twice.)
2 Use the "" and "" keys to select "11.RAMClear," and then press " ."
A message asking you to confirm that you want to perform the RAM clear operation is displayed.
3 While holding down the " " key, hold down " " for 1 second or more.
The confirmation screen is displayed again.
4 When the confirmation screen is displayed for a second time, hold down " " for 1 second or
more to perform the RAM clear operation.
CPU BUILT-IN FUNCTIONS
The following screen will be displayed while the RAM clear operation is being performed. When the
RAM clear operation is finished, the device will automatically restart.
オマチクダサイ... Wait...
If you do not hold down the " " key for 1 second or more, the message "Wait. . ."
Point
5
will not be displayed, and the RAM clear operation will be canceled.
Access Window
All Clear
The all clear mode returns all settings on the base unit to their defaults. (This means that the ladder
program and device values are cleared.)
Point The all clear operation can only be executed in PROG mode.
1 Press "M."
A menu is displayed. (If a different unit is selected, press "M" twice.)
2 Use the "" and "" keys to select "12.All Clear," and then press " ."
A message asking you to confirm that you want to perform the all clear operation is displayed.
3 While holding down the " " key, hold down " " for 1 second or more.
The confirmation screen is displayed again.
Press "M" or " " to cancel the all clear operation and return the screen to the menu display.
4 When the confirmation screen is displayed for a second time, hold down " " for 1 second or
more to perform the all clear operation.
The following screen will be displayed while the all clear operation is being performed. When the all
clear operation is finished, the device will automatically restart.
If you do not hold down the " " key for 1 second or more, the message "Wait for
Point
30 sec..." will not be displayed, and the all clear operation will be canceled.
You can use this function to use ladder programs to set the access window screen that is displayed
when the access window is turned on.
If you do not use this function, the page that was in use the last time the power was turned off will be
displayed.
5
Display method
Access Window
When the access window is on, you can use ladder programs or a similar method to store values in
control memory (CM) entries to specify the initial screen of the access window when it turns on.
To use the access window initial screen display function, store "1" in CM1780 and use CM1781 to
CM1789 to set the screen to display.
Reference On the KV Nano Series, decimal values are represented with "#" and hexadecimal values
with "$."
List of control memory entries for the access window initial screen display
Device Number Function
Enables and disables the access window initial screen display function
CM1780
(0: disable, 1: enable)
CM1781 Specifies the device type*1
CM1782
Specifies the display screen
CM1783
CM1784
Specifies the device number*1
CM1785
CM1786 Specifies the display format of the device*1
Selects the device name representation*1
CM1787
(0: device number, 1: device comment)
Selects the key lock status
CM1788
(0: key lock disabled, 1: key lock enabled)
Selects the display language
CM1789
(0: Japanese, 1: English)
*1 The display screen type is only valid in device mode.
Enabling and disabling the access window initial screen display function
The value stored in CM1780 determines whether the function is used.
CM1780 = 1: The screen specified by CM1781 to CM1789 is displayed.
CM1780 = 0: The screen displayed the last time the power was turned off is displayed.
Device type specification range (only valid when the display screen type is
device mode)
CPU BUILT-IN FUNCTIONS
Use the value stored in CM1781 to specify the type of the device to be displayed.
CM1781 CM1781
Device Type Device Type
(Hexadecimal) (Hexadecimal)
TM $0008 Z $0030
R $0000 MR $0011
CR $0001 LR $0012
T $0002 B $001B
C $0003 W $001C
CTH/CTC $0004
5 DM
CM
$0006
$0007
Access Window
Device number specification range (only valid when the display screen type is
device mode)
Example
Specifying R1000
aaa = 10, bb = 0
5
N = 16 × 10 + 0 = 160
Access Window
MOV.D
#160 CM1784
The value of CM1784 and CM1785 is 160 ($A0).
Specifying R10011
aaa = 100, bb = 11
N = 16 × 100 + 11 = 1611 MOV.D
#1611 CM1784
The value of CM1784 and CM1785 is 1611 ($064B).
• For B and W, use the number (hexadecimal number) of the device that you want to display to specify
the device.
Example
Specifying B1000
MOV.D
The value of CM1784 and CM1785 is 4096 ($1000). $1000 CM1784
Specifying W1FFF
MOV.D
The value of CM1784 and CM1785 is 8191 ($1FFF). $1FFF CM1784
• For T, C, DM, CM, and TM, use the number (decimal number) of the device that you want to display
to specify the device.
Example
Specifying DM1000
MOV.D
The value of CM1784 and CM1785 is 1000 ($3E8). #1000 CM1784
Specifying DM8191
MOV.D
The value of CM1784 and CM1785 is 8191 ($1FFF). #8191 CM1784
1. Configure the settings so that the top menu is displayed in the access window when it turns on.
Save the following settings in CM entries.
1.デバイスモード CM Value
Device Number Setting Details
2.エラークリア (Hexadecimal)
3.トリマ
AW initial screen display
4.I/Oテスト CM1780 $0001
enabled
CM1781 - -
CM1782
$00000000 Top menu
CM1783
CM1784
- -
CM1785
CM1786 - -
CM1787 - -
CM1788 $0000 Key lock disabled
CM1789 $0000 Japanese
2. Configure the settings so that the On/Off display of R200 is displayed in device mode in the access
window when it turns on.
Save the following settings in CM entries.
R200 CM Value
Device Number Setting Details
ON (Hexadecimal)
R201
AW initial screen display
OFF CM1780 $0001
enabled
CM1781 $0000 R
CM1782
$01000000 Device mode
CM1783
CM1784
$00000020 200
CM1785
CM1786 $0000 Default
CM1787 $0000 Device numbering
CM1788 $0000 Key lock disabled
CM1789 $0000 Japanese
User Messages
Access Window
(1) Using the AWNUM instruction (user message 1) and the AWMSG instruction (user message 2)
You can use the dedicated instructions to easily display user messages without having to worry about
control relays (CR) and control memory (CM) entries.
When user message 1 and user message 2 are both turned ON, user message 1 (the value) is given
priority and is displayed.
For details on these instructions, see "5-14 Access Window Instructions" in the KV-7000/5000/3000/1000
Series and KV Nano Series "Instruction Reference Manuals."
(2) Create a ladder program using control relays (CR) and control memory (CM) entries.
To display user message 1, store the value to display in CM1720 and turn CR2900 ON.
To display user message 2, store the character string to display (ASCII code) in CM1721 to CM1732
and turn CR2901 ON.
When CR2900 and CR2901 are turned ON at the same time, CR2900 is given priority.
(The value stored in CM1720 is displayed.)
Display examples
User Message 1
When CR2900 is turned ON, the value stored in CM1720 is displayed on the screen.
In the screen example, the value of CM1720 is "12345." The entire screen blinks.
ユーザーメッセージ1 UsrMessage1:
12345 12345
The screen will return to the original display in the following cases.
• When you press an access window key. In this situation, CR2900 will be turned OFF.
• When CR2900 is turned OFF.
User message 2
When CR2901 is turned ON, the character string starting at CM1721, which consists of the first 24 half-
CPU BUILT-IN FUNCTIONS
width ASCII characters or the string terminated with end code NULL (00H), is displayed.
ユーザーメッセージ2 UsrMessage2:
Emergency Emergency
Stop!! Stop!!
You can disable the operations of the access window separately according to different functions.
The functions whose operations you can disable and the corresponding items are shown below.
Function Item
Unit monitor Changing settings
Device mode Changing device value
Alarm Clearing the alarm log
Loading and saving Load, save, and delete
Access window setup Change settings
All clear Clearing
RAM clear Clearing
For setting the disabled operations, 1 bit of CM1738 is assigned to each function. When a bit is turned ON, the
operation is disabled.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Access Window
All clear and RAM clear
(operation execution disabled)
When an attempt is made to perform a disabled operation, the following screen is displayed.
AWメッセージ AW Message:
Example
Disabling writing in device mode Disabling reading and writing of data
during loading and saving
MOV MOV
$0002 CM1738 $0010 CM1738
If you disable device writing in device mode, you will no longer be able to enable
Point
the operation from the access window.
Key Lock
CPU BUILT-IN FUNCTIONS
The key lock function enables you to disable the key operations of the access window. Use this function
when you want to prevent changes to the settings or when you want to fix the screen that is displayed.
Operating instructions
To set or release the key lock, while holding down the " "key, hold down "M" for 3 seconds or more.
AWメッセージ AW Message
Access Window
While the keys are locked, the above screen is displayed when you perform any operations other than
releasing the key lock.
AWメッセージ AW Message
Reference • Large-capacity capacitors are used to maintain the built-in clock, so if the device
remains off for two weeks or more (at +25°C), the clock data will be cleared and then
set to January 1, 2000. 5
• If clock data lost errors occur when the clock data is cleared, use the setting for the
Clock Function
operation when an error occurs in the CPU system settings to set the time error CPU
operation to continuation (minor error). (The default setting is continuation, that is, the
error is ignored.)
• When the clock data is cleared, CR2311 is turned ON. It is turned OFF when the clock
data is written.
CM700 Year 0 to 99 The year indicates the last two digits of the year, assuming that "00"
indicates "2000."
CM701 Month 1 to 12
CM702 Day 1 to 31
CM703 Hour 0 to 23 All data is written in 16-bit binary data format.
CM704 Minute 0 to 59
CM705 Second 0 to 59
CM706 Day of the week 0 to 6 The numbers correspond to the days of the week as follows:
0 indicates Sunday, 1 indicates Monday, 2 indicates Tuesday,
3 indicates Wednesday, 4 indicates Thursday, 5 indicates Friday,
and 6 indicates Saturday.
• This data can be read directly by ladder programs (the data is read-only.)
panels, you can synchronize the date and time of the KV Nano Series with the date and time of the VT3
Series.
Reference Versions 4.6 and later of VT STUDIO have a function for restoring the time and date.
If the clock data of the connected base unit is cleared, the time and date will automatically
be synchronized to the time and date of the touch panel.
Whether an error is a serious error or a minor error is determined by the error's group.
Serious errors Scan time over errors, system errors, and setting errors
Minor errors Time errors, calculation errors, and unit errors
APPENDICES
APPENDICES
Comm Error If this error occurs frequently,
contact your KEYENCE
representative.
カクチョウ
バスレンジ Contact your KEYENCE
58 System error A system error has occurred.
ExpansionBus representative.
Comm range
ユニットバージョン An attempt was made to connect an
Turn the power off, and then
expansion unit, which cannot be
59 Setting error connect all the expansion units that
Unit Version connected to the base unit, to the
have been set in the Unit Editor.
base unit.
99 System error Hot Plugged/ An extension unit was hot swapped. Turn the power off before you
Unplugged connect or disconnect an extension
unit.
ゾウセツバージョン A built-in function or extension unit
Check the versions of the base unit
101 Setting error Extension Unit function that isn't supported by the
and the extension unit.
Version base unit has been set.
POWER OFF エラー If a noise source (for example, a
cable in which a large current flows
such as a motor cable) is close to
the units, distance the units from the
The data save process could not noise source.
List of PLC Unit Errors
APPENDICES
The number of system errors that
125 Other error オーバーフロー Clear the errors.
have occurred exceeds the limit.
ErrorBuffer Overflow
オートローディング Data cannot be loaded when no
シッパイ data is present or when the data is
from a different model PLC.
The automatic loading function
The automatic loading operation cannot be used when the projects
127 Setting error
failed. stored on the PLC are write
Auto Loading Failed protected.
In situations other than those
described above, check the
automatic loading completion code.
16 Divide by zero.
17 Illegal logging ID.
18 Direct processing error.
19 Unit on which direct processing cannot be performed.
20 Jump destination subroutine does not exist.
21 Data being written during RUN mode, so instruction cannot be
executed.
22 Error for expansion unit-dedicated instructions (unit number).
23 Reserved for the system.
24 PIDAT, outside of operation setting range.
25 PIDAT, outside of sampling period range.
26 PIDAT, outside of comparison constant range.
27 PIDAT, outside of integral constant range.
28 PIDAT, outside of differential constant range.
29 PIDAT comparison constant, two-degree freedom parameters outside
of range.
30 PIDAT integral constant, two-degree freedom parameters outside of
range.
31 PIDAT differential constant, two-degree freedom parameters outside of
range.
32 PIDAT, outside of operation quantity upper limit or lower limit range.
33 PIDAT, outside of operation quantity change width limit range.
34 PIDAT, outside of measured value change width range.
35 PIDAT, AT state transition error.
36 PIDAT, outside of operation control flag range.
37 Operation period exceeded.
38 PIDAT, outside of AT adjustment parameter range.
39 PIDAT, outside of AT hysteresis range.
40 PIDAT, outside of AT timeout range.
41 PIDAT, outside of AT calculation control mode setting range.
42 PIDAT, AT timeout.
43 PIDAT, AT comparison constant exceeded.
44 PIDAT, AT integral constant exceeded.
45 PIDAT, AT differential constant exceeded.
46 Root of negative number cannot be calculated.
47 Incorrect ABS instruction operand.
48 Calculation overflow.
49 UR, UM, or UV unit not connected.
50 Unit device (R) not assigned.
51 Unit device (DM) not assigned.
A-6 - KV Nano Series(terminal block type) User’s Manual -
1 List of PLC Unit Errors
• Error numbers 50, 53, 55, 56, 58, and 59 (unit number errors)
Detailed Information, Piece n Description
Unit number (the unit number will not be stored if it cannot be
Detailed information, piece 1
determined according to the occurrence conditions of the error)
APPENDICES
Detailed information, pieces 2 to 20 Fixed to 00H
• Error number 54 (number of units error)
Detailed Information, Piece n Description
Detailed information, piece 1 The number of units as specified in the unit setup information
Detailed information, piece 2 The number of units that are actually connected
Detailed information, pieces 3 to 20 Fixed to 00H
• Error number 60 (number of expansion I/O points error)
Control relays (CR0000 to CR8915) can be used to perform operations such as checking the operation
status of the base unit and setting and monitoring the built-in functions.
Control relays reserved for the system cannot be used.
Attribute
CR R: Read only Function
Blank: Read/write
Logging and tracing execution (ON: enabled, OFF:
CR0000
disabled)
APPENDICES
Attribute
CR R: Read only Function
Blank: Read/write
CR2209 to
− Reserved for the system
CR2215
CR2300 External output disabled (ON: execute, OFF: do not execute)
CR2301 External input refresh disabled (ON: execute, OFF: do not execute)
CR2302 − Reserved for the system
CR2303 Fixed scan time operation (ON: enabled, OFF: disabled)
Turned ON for just one scan when the scan time setting (the fixed scan time operation and END
CR2304 R
processing time settings) is exceeded
Sets the input time constant of all inputs of the base unit
CR2305
APPENDICES
(ON: the value is set according to CM1620, OFF: the value is not set)
CR2306 − Reserved for the system
CR2307 Clears the minimum and maximum scan time values
Sets the END processing time (ON: enabled, OFF: disabled; if CR2303 is turned ON at the same
CR2308
time, CR2303 is given priority)
CR2309 Reserved for the system
CR2310 R Indicates the presence of a calendar timer (ON: present, OFF: not present)
CR2311 R This is turned ON when a clock data lost error occurs (it is turned OFF when the clock data is written)
CR2312 Reserved for the system
CR2608 to
Reserved for the system
CR2813
Zero suppression during execution of DASC and FASC instructions (all suffixes; ON: execute,
CR2814
OFF: do not execute)
Omission of "+" during execution of DASC.S, DASC.L, and FASC instructions (ON: execute,
CR2815
OFF: do not execute)
User message display 1
CR2900
(ON: displayed, OFF: hidden)
Access window
User message display 2
CR2901
(ON: displayed, OFF: hidden)
CR2902 to
− Reserved for the system
CR2914
CR2915 R Indicates the presence of an access window cassette (ON: connected, OFF: not connected)
CR3000 Project load execution request
CR3001 − Reserved for the system
CR3002 Project save execution request
Attribute
CR R: Read only Function
Blank: Read/write
CR3003 − Reserved for the system
CR3004 Project load execution completion
CR3005 Project load execution failure
CR3006 Project save execution completion
CR3007 Project save execution failure
CR3008 to
− Reserved for the system
CR3215
CR3300 to
− Alarm relays
CR3415
APPENDICES
CR3500 R Alarm operation relay (ON: one of CR3300 to CR3415 is turned ON)
Record an entry in the log when an alarm relay switches from ON to OFF (ON: record, OFF: do
CR3501
not record)
CR3502 The alarm relay log is cleared when this switches from OFF to ON
CR3503 to
Reserved for the system
CR3513
CR3514 Disables multiple keys
HKEY instruction
CR3515 R Scan completion
CR3600 to
Lists of CR and CM Devices
CR3715 Disables page switching using the "▲" and "▼" keys
(ON: disabled, OFF: enabled)
CR3800 Sets external output 0 to ON when this is turned ON
CR3801 Sets external output 1 to ON when this is turned ON
CR3802 to
− Reserved for the system
CR3815
CR3900 The serious error log is cleared when this switches from OFF to ON
CR3901 The minor error log is cleared when this switches from OFF to ON
CR3902 R Indicates that the serious error log is full
CR3903 R Indicates that the minor error log is full
CR3904 R RUN-PROG selector switch status (ON: RUN, OFF: PROG)
CR3905 R A serious error has occurred
CR3906 R A minor error has occurred
CR3907 The power on log is cleared when this switches from OFF to ON
CR3908 The power off log is cleared when this switches from OFF to ON
CR3909 Clears the current error
CR3910 to
− Reserved for the system
CR4115
CR4200 R CTH0 dedicated internal clock (50 ns)
CR4201 R CTH0 dedicated internal clock (1 µs)
CR4202 R CTH0 dedicated internal clock (10 µs)
Attribute
CR R: Read only Function
Blank: Read/write
CR4203 R CTH0 dedicated internal clock (100 µs)
CR4204 − Reserved for the system
CR4205 R Indicates the presence of CTH0 (ON: present, OFF: not present)
CR4206 Detects overflows and underflows of CTH0 (ON: detected, OFF: not detected)
CR4207 R Indicates the change direction of CTH0 (ON: down counting, OFF: up counting)
CTH0 external signal preset
CR4208 Not Used Rising Edge Falling Edge Level
and
CR4208 OFF ON OFF ON
CR4209
APPENDICES
CR4209 OFF OFF ON ON
Attribute
CR R: Read only Function
Blank: Read/write
CR4411 CTH1 preset disabled (ON: execute, OFF: do not execute)
CR4412 CTH1 internal enable relay (ON: counting enabled, OFF: counting disabled)
CR4413 to
− Reserved for the system
CR4502
Automatic reset of CTH1 (ON: execute, OFF: do not
CR4503
execute)
Comparator matching output disabled when comparator
CR4504
CTC2 is turned ON (ON: execute, OFF: do not execute)
Comparator matching output turned OFF when
APPENDICES
CR4505 Action when high-speed counter comparator CTC2 is turned ON (ON: execute, OFF: do
comparator CTC2 is turned ON not execute)
Comparator matching output turned ON when comparator
CR4506
CTC2 is turned ON (ON: execute, OFF: do not execute)
Comparator matching output inversion (ON/OFF) each
CR4507 time that comparator CTC2 is turned ON (ON: execute,
OFF: do not execute)
Comparator matching output disabled when comparator
CR4508
CTC3 is turned ON (ON: execute, OFF: do not execute)
Comparator matching output turned OFF when
Lists of CR and CM Devices
Attribute
CR R: Read only Function
Blank: Read/write
Automatic reset of CTH2 (ON: execute, OFF: do not
CR4703
execute)
Comparator matching output disabled when comparator
CR4704
CTC4 is turned ON (ON: execute, OFF: do not execute)
Comparator matching output turned OFF when
CR4705 Action when high-speed counter comparator CTC4 is turned ON (ON: execute, OFF: do
comparator CTC4 is turned ON not execute)
Comparator matching output turned ON when comparator
CR4706
CTC4 is turned ON (ON: execute, OFF: do not execute)
Comparator matching output inversion (ON/OFF) each
APPENDICES
CR4707 time that comparator CTC4 is turned ON (ON: execute,
OFF: do not execute)
Comparator matching output disabled when comparator
CR4708
CTC5 is turned ON (ON: execute, OFF: do not execute)
Comparator matching output turned OFF when
CR4709 comparator CTC5 is turned ON (ON: execute, OFF: do
not execute)
Action when high-speed counter Comparator matching output turned ON when comparator
CR4710
comparator CTC5 is turned ON CTC5 is turned ON (ON: execute, OFF: do not execute)
Comparator matching output inversion (ON/OFF) each
Attribute
CR R: Read only Function
Blank: Read/write
Comparator matching output disabled when comparator
CR4908
CTC7 is turned ON (ON: execute, OFF: do not execute)
Comparator matching output turned OFF when
CR4909 comparator CTC7 is turned ON (ON: execute, OFF: do
not execute)
Action when high-speed counter Comparator matching output turned ON when comparator
CR4910
comparator CTC7 is turned ON CTC7 is turned ON (ON: execute, OFF: do not execute)
Comparator matching output inversion (ON/OFF) each
CR4911 time that comparator CTC7 is turned ON (ON: execute,
OFF: do not execute)
APPENDICES
Single Phase
1x 2x 4x 2-Pulse
CR4913 to W/O Direction W/ Direction
CR4915 CR4913 OFF ON OFF ON OFF ON
CR4914 OFF OFF ON ON OFF OFF
CR4915 OFF OFF OFF OFF ON ON
Lists of CR and CM Devices
CR5000 to
− Reserved for the system
CR5315
CR5400 Start operation (ON: execute, OFF: do not execute)
CTH0 input source setting
Single Phase Double
CR5401 W/O W/ Phase 2-Pulse
and Direction Direction 1x
CR5402
CR5401 OFF ON OFF ON
Frequency counter (CTH0)
CR5402 OFF OFF ON ON
Attribute
CR R: Read only Function
Blank: Read/write
CR5600 Start operation (ON: execute, OFF: do not execute)
CTH2 input source setting
Single Phase Double
CR5601 W/O W/ Phase 2-Pulse
and Direction Direction 1x
CR5602
CR5601 OFF ON OFF ON
Frequency counter (CH2)
CR5602 OFF OFF ON ON
APPENDICES
Function in which one rotation is performed to update the
CR5604
rotation speed (ON: use, OFF: do not use)
Input source switching function (ON: use, OFF: do not
CR5605
use)
CR5606
and − Reserved for the system
CR5607
CR5608 Specified frequency pulse output (CTH2; ON: execute, OFF: do not execute)
CR5609 Specified frequency pulse output (CTH2) error
Attribute
CR R: Read only Function
Blank: Read/write
CR8000 Forced stop
CR8001 Deceleration stop
CR8002 Error clear
CR8003 Warning clear
CR8004 Current coordinate change request (level detection)
CR8005 Operating speed change request (level detection)
CR8006 CPU positioning function, axis 1 Target coordinate change request (level detection)
CR8007 to
− Reserved for the system
CR8011
APPENDICES
Attribute
CR R: Read only Function
Blank: Read/write
CR8400 R Turned ON during pulse output
CR8401 R Positioning complete relay
CR8402 R Error
CR8403 R Warning
CR8404 R Origin returning operation in progress
CR8405 R CPU positioning function, axis 1 Origin returning operation complete
CR8406 to
− Reserved for the system
CR8413
Indicates the presence of axis 1 (ON: present, OFF: not
APPENDICES
CR8414 R
present)
CR8415 R Comparator 2 matching relay
CR8500 R Turned ON during pulse output
CR8501 R Positioning complete relay
CR8502 R Error
CR8503 R Warning
CR8504 R Origin returning operation in progress
CR8505 R CPU positioning function, axis 2 Origin returning operation complete
Control memory entries (CM0000 to CM8999) can be used to perform operations such as checking the
operation status of the base unit and setting and monitoring the built-in functions.
Control memory entries reserved for the system cannot be used.
Attribute Hold
CM R: Read only Function ○: Hold
Blank: Read/write Set: Holding can be set
CM0000
APPENDICES
CM0008
and Reserved for the system Set
CM0009
CM0010 to
Page 1 to 19 (the same as CM0000 to CM0009) Set
CM0199
CM0200
and Attribute setting displayed on the first line Set
CM0201
CM0202
and Attribute setting displayed on the second line Set
CM0203
CM0204 Operator panel KV-D30
and Page 0 Attribute setting displayed on the third line Set
CM0205
CM0206
and Attribute setting displayed on the fourth line Set
CM0207
CM0208 Template 1 setting Set
CM0209 Template 2 setting Set
CM0210 to
Page 1 to 19 (the same as CM0200 to CM0209) Set
CM0399
CM0400 For enabling and disabling transitions Set
CM0401 For the page switching setting Set
CM0402 Current page displayed Set
CM0403 to
Operator panel KV-D30 Reserved for the system Set
CM409
CM0410 to
Direct access function Set
CM415
CM0416 to
Reserved for the system Set
CM0499
CM0500 to
− Reserved for the system
CM699
CM0700*1 R Read from RTC (year)
CM0701*1 R Read from RTC (month)
CM0702*1 R Read from RTC (day)
CM0703*1 R Read from RTC (hour)
CM0704*1 R Read from RTC (minute)
CM0705*1 R Read from RTC (second)
CM0706*1 R Read from RTC (day of the week)
CM0707 − Reserved for the system
Attribute Hold
CM R: Read only Function ○: Hold
Blank: Read/write Set: Holding can be set
CM0708
R 32-bit, 1 ms, free-run counter
and CM709
CM0710 Reserved for the system
CM0711 R CPU function version
CM0712 to
− Reserved for the system
CM719
CM0720 R Scan time measured value (in units of 10 µs)
CM0721 Set value during fixed scan time operation (in units of 10 µs)
Scan time (in units of 10 µs) when the scan time setting (the fixed scan time
CM0722 R
APPENDICES
operation and END processing time settings) is exceeded
CM0723 R END processing time measured value (in units of 10 µs)
CM0724
− Reserved for the system
and CM725
CM0726 R Minimum scan time value (in units of 10 µs)
CM0727 R Maximum scan time value (in units of 10 µs)
CM0728 END processing time set value (in units of 10 µs)
END processing time (in units of 10 µs) when the scan time setting (the fixed
CM0729 R
scan time operation and END processing time settings) is exceeded
CM0730 to
Attribute Hold
CM R: Read only Function ○: Hold
Blank: Read/write Set: Holding can be set
CM1688 R Logging or tracing file save counter ○
CM1689 R Logging or tracing file save counter ○
CM1690 to
− Reserved for the system
CM1709
CM1710 R Completion code of automatic loading when power is turned on ○
CM1711 to
Reserved for the system
CM1713
CM1714 R Completion code during project loading ○
CM1715 Reserved for the system
APPENDICES
Attribute Hold
CM R: Read only Function ○: Hold
Blank: Read/write Set: Holding can be set
CM2250 Year and month ○
CM2251 Day ○
CM2252 Hour ○
CM2253 Minute ○
CM2254 Detailed information of Seconds ○
CM2255 the latest minor error, 1 Number ○
CM2256 unit*1 Detailed information, number of valid pieces of data ○
CM2257 Detailed information, piece 01 ○
CM2258 Detailed information, piece 02
APPENDICES
○
: ○
CM2276 Detailed information, piece 20 ○
CM2277 to
− Reserved for the system
CM2388
CM2389 R Number of connected expansion units
CM2390 R Error code for memory card instructions
CM2391 to
− Reserved for the system
CM2395
CM2396 to
Attribute Hold
CM R: Read only Function ○: Hold
Blank: Read/write Set: Holding can be set
CM4820 Constant when rotation direction is detected ○
CM4821 Enable, clear, and sign setting ○
CM4822
and Ring counter lower limit ○
CM4823
CM4824
and High-speed counter Ring counter upper limit ○
CM4825 function (CTH2)
CM4826
and Preset input ○
APPENDICES
CM4827
CM4828
and − Reserved for the system
CM4829
CM4830 Constant when rotation direction is detected ○
CM4831 Enable, clear, and sign setting ○
CM4832
and Ring counter lower limit ○
CM4833
CM4834
Lists of CR and CM Devices
Attribute Hold
CM R: Read only Function ○: Hold
Blank: Read/write Set: Holding can be set
CM4930
and R Frequency measured result (Hz or rpm)
CM4931
CM4932 Frequency counter Number of pulses per rotation ○
function (CTH3)
CM4933 Number of scans ○
CM4934 External input source ○
CM4935 − Reserved for the system
CM4936 Set frequency (Hz) ○
Specified frequency pulse
CM4938 Duty cycle (0 to 100%) ○
output function (CH3)
APPENDICES
CM4939 Reserved for the system
CM4940 to
− Reserved for the system
CM4999
CM5000 to
For built-in serial assignment
CM5999
CM6000 to
For extension function assignment 1
CM6999
CM7000 to
For extension function assignment 2
CM7999
CM8000
Attribute Hold
CM R: Read only Function ○: Hold
Blank: Read/write Set: Holding can be set
CM8600
and Target value or travel Set
CM8601
CM8602 Acceleration rate Set
CM8603 Deceleration rate Set
CM8604 CPU positioning function,
and axis 4 Operation frequency Set
CM8605 Point parameter 1
CM8606 Operation mode Set
CM8607 Reserved for the system Set
APPENDICES
CM8804
and Comparator 1, current value Set
CM8805
CM8806
and Comparator 2, positioning Set
CM8807
CM8808 Starting speed Set
CM8809 Origin returning operation: starting frequency Set
CM8810 Origin returning operation: acceleration rate Set
CM8811 Origin returning operation: deceleration rate Set
CM8812
and Origin returning operation: operation frequency Set
CM8813
CM8814 Origin returning operation: detailed settings Set
CM8815 JOG operation: starting frequency Set
CM8816 JOG operation: acceleration rate Set
CM8817 JOG operation: deceleration rate Set
CM8818
and CPU positioning function, JOG operation: operation frequency Set
CM8819 axis 1
CM8820
and Home position Set
CM8821
CM8822
and − Reserved for the system
CM8823
CM8824
and Current coordinate change value Set
CM8825
CM8826
Operation speed change value during speed
and Set
control mode
CM8827
CM8828
and Target coordinate change value Set
CM8829
CM8830
and R Output pulse, current coordinate Set
CM8831
CM8832
and R Output frequency, current value Set
CM8833
CM8834 R Error code Set
CM8835 R Execution point number Set
CM8836 to
− Reserved for the system
CM8839
Attribute Hold
CM R: Read only Function ○: Hold
Blank: Read/write Set: Holding can be set
CM8840 I/O setting Set
CM8841 Sensor enable Set
CM8842
and Comparator 0, current value Set
CM8843
CM8844
and Comparator 1, current value Set
CM8845
CM8846
and Comparator 2, positioning Set
APPENDICES
CM8847
CM8848 Starting speed Set
CM8849 Origin returning operation: starting frequency Set
CM8850 Origin returning operation: acceleration rate Set
CM8851 Origin returning operation: deceleration rate Set
CM8852
and Origin returning operation: operation frequency Set
CM8853
CM8854 Origin returning operation: detailed settings Set
Attribute Hold
CM R: Read only Function ○: Hold
Blank: Read/write Set: Holding can be set
CM8880 I/O setting Set
CM8881 Sensor enable Set
CM8882
and Comparator 0, current value Set
CM8883
CM8884
and Comparator 1, current value Set
CM8885
CM8886
and Comparator 2, positioning Set
APPENDICES
CM8887
CM8888 Starting speed Set
CM8889 Origin returning operation: starting frequency Set
CM8890 Origin returning operation: acceleration rate Set
CM8891 Origin returning operation: deceleration rate Set
CM8892
and Origin returning operation: operation frequency Set
CM8893
CM8894 Origin returning operation: detailed settings Set
Lists of CR and CM Devices
Attribute Hold
CM R: Read only Function ○: Hold
Blank: Read/write Set: Holding can be set
CM8920 I/O setting Set
CM8921 Sensor enable Set
CM8922
and Comparator 0, current value Set
CM8923
CM8924
and Comparator 1, current value Set
CM8925
CM8926
and Comparator 2, positioning Set
APPENDICES
CM8927
CM8928 Starting speed Set
CM8929 Origin returning operation: starting frequency Set
CM8930 Origin returning operation: acceleration rate Set
CM8931 Origin returning operation: deceleration rate Set
CM8932
and Origin returning operation: operation frequency Set
CM8933
CM8934 Origin returning operation: detailed settings Set
0 1 2 3 4 5 6 7 8 9 A B C D E F
N D S
0 U
L
L
E P 0 @ P ` p ー タ ミ
S D
1 O C ! 1 A Q a q 。 ア チ ム
APPENDICES
H 1
S D
2 T
X
C
2 ” 2 B R b r 「 イ ツ メ
E D
3 T
X
C
3 # 3 C S c s 」 ウ テ モ
E D
4 O
T
C
4 $ 4 D T d t 、 エ ト ヤ
E N
5 N A % 5 E U e u ・ オ ナ ユ
Q K
ASCII Code Table
A S
6 Y & 6 F V f v ヲ カ ニ ヨ
Lower four bits
C
K N
B E
7 B ’ 7 G W g w ァ キ ヌ ラ
E T
L
B CA
8 S N( 8 H X h x ィ ク ネ リ
9 HT EM ) 9 I Y i y ゥ ケ ノ ル
A LF UB * : J
S
Z j z ェ コ ハ レ
B VT SC + ; K [
E
k { ォ サ ヒ ロ
C FF → , < L \ l | ャ シ フ ワ
D CR ← ー = M ] m } ュ ス ヘ ン
E SO ↑ . > N ^ n ~ ョ セ ホ ゛
D
F SI ↓ / ? O _ o E
L ッ ソ マ °
Description
Execution
Condition
Page
Mnemonic Symbol Processing Outline
APPENDICES
Logging instructions
n
TRGD Captures the logging data of the specified ID 5-188
List of Instructions
TRGD
.L
single-phase: 100 kHz; phase difference: 50 kHz 5-132
.D and at 32 bits (0 to 4294967295 or
CTC S
.L CTC n -2147483648 to 2147483647)
S1 S2 D
input frequency
ABSENC
ABSENC S1 S2 D1 Performs cam operations using an absolute encoder 5-168
D2
INCENC
Performs cam operations using an incremental
INCENC S1 S2 S3 5-172
D1 D2
encoder
Classification
Description
Execution
Condition
Page
Mnemonic Symbol Processing Outline
Positioning instructions
Trapezoidal
control
PSTRT
PSTRT n1 n2 n3 Starts trapezoidal control 5-46
APPENDICES
JOG
operation
CW
n1
JOG
ORG
ORG n1 n2 Starts the origin returning operation 5-54
List of Instructions
HOME
HOME n1 n2 Starts the travel to home position operation 5-60
Current value Target coordinate Operating
speed
CHGSP
CHGSP n1 n2 S Changes the operating speed 5-62
change
CHGTGT
CHGTGT n1 n2 S Changes the target coordinate 5-66
update
Classification
Description
Execution
Condition
Page
Mnemonic Symbol Processing Outline
APPENDICES
EI EI Enables the execution of interrupt programs 4-94
D
DIC Sets the interrupt disabled range 4-96
Interrupts
DIC
List of Instructions
RETI
RETI Indicates the end of the interrupt program − 4-98
Module instructions
MDSTRT
MDSTRT S Starts the execution of the specified module
Modules
4-110
MDSTOP
MDSTOP S Stops the execution of the specified module
Macro instructions
MCALL
MCALL Varies depending on the macro to be executed Executes the specified subroutine macro
Macros
MSTRT
MSTRT Varies depending on the macro to be executed Executes the specified self-hold macro 4-126
MEND
MEND Stops execution of the self-hold macro
C Counter
Timer and counter OUTC Out counter
instructions
ITVL Interval timer
UDC Up/down counter
UDT Up/down timer
Connection/end
MEP and MEF Mep and mef
instruction
Shift instruction SFT Shift
instructions
Application
Data control RAMP, TPOUT, and Ramp signal, time division proportion output, and
instructions LLFLT advancement delay filter
Data processing
HKEY and SORTN Hexadecimal key input and binary data division sort
instructions
Cam switch ABSENC and
Absolute encoder and incremental encoder
instructions
Expansion
instructions INCENC
Frequency counter
FCNT and RCNT Frequency and rotation speed measurements
instructions
PID instructions PID and PIDAT PID and PID with automatic tuning
Access window AWNUM and
User message 1 and user message 2
instructions AWMSG
Macros
Instruction Type Instruction
Application
Macro instructions MCALL and MSTRT Macro call and macro start
instructions
* Write the MEND (macro end) instruction in self-hold macros. This instruction cannot be used in modules
and subroutine macros.
Subroutine programs
Instruction Type Instruction
Application Stage processing STG, JMP, and Stage, jump, and end stage
instructions instructions ENDS
High-speed processing
Expansion instructions INT and RETI Interrupt and interrupt return
instructions
Instructions
Instruction Abbreviation
LD and AND A and X
LDB and ANB B, LDI, LDNOT, ANI, ANDNOT, and /*3
Contact instructions ORB ORI and ORNOT
APPENDICES
LDP and ANP P
LDF and ANF F
BLD and BAND BA
Bit contact instructions
BLDB and BANB BB
LD= and AND= =
LD< and AND< <
LD> and AND> >
Comparison instructions
Instruction Abbreviation
Logic calculation EORA XOR and XORA
instructions ENRA XNORA
Data control instructions APR SCL
DFLOAT FLTD, DFLTD, DBL, and DBLL
DINTG INTD, DINTD, FIXD, and FIXLD
Floating-point instructions
FTODF ECON
DFTOF EDCON
DASC DSTR
APPENDICES
RDASC DVAL
Text processing HASC HSTR
instructions RHASC HVAL
FASC FSTR
RFASC FVAL
CAL+ +
CAL- -* 2
List of Abbreviated Mnemonics
CAL* *
CAL/ / *3
Simple calculation CAL& & and WAND
instructions CAL| | and WOR
CAL~ ~ and WXOR
CAL^ ^, NOT, and CML
CAL>> >> and SFR
CAL<< << and SFL
High-speed processing INT I
instructions RETI IRET
*1 You can enter timer and counter instructions without a space between the instruction and the
device number.
(Example) TMR 0002 DM00001 T2 D1
*2 If you enter "-" directly in the ladder editing window, a horizontal connecting line will be inserted.
If you enter "-" in the direct entry dialog box ( Esc ), "CAL-instruction" will be inserted.
*3 If you enter "/" directly in the ladder editing window, the "LDB" instruction will be inserted.
If you enter "/" in the direct entry dialog box ( Esc ), "CAL/instruction" will be inserted.
Device names
APPENDICES
Home
rung
Cut Ctrl + X Move cursor to end of
Copy Ctrl + C rung
End
Paste Ctrl + V Delete configured units Delete
Delete Delete Shift +
Multi select
Unit comments Ctrl + Shift + U ← • → •↑ • ↓
Block comment Ctrl + Shift + B
Operations in unit selection window
Window
Unit configuration area Alt + U
Select unit Alt + 1
Setup unit Alt + 2
Refresh setting Alt + 3
Message area Alt + 4
Help
How to use Unit Editor F1
Items that are indicated with a "" can be assigned to other shortcut key sequences.
File Monitor/Simulator
New project Ctrl + N PLC monitor Ctrl + F1
Open project Ctrl + O Read from PLC Ctrl + F5
APPENDICES
View
Workspace Alt + 1
Output window Alt + 2
APPENDICES
position
Delete instruction to the left Increment device number Ctrl + Shift + ↑
of cursor position Backspace ↑
Decrement device number Ctrl + Shift +
Delete instruction at cursor
position Delete * This is only valid when the display of the ladder editing
window is split.
Directly enter instruction at
cursor position Esc View
Move symbol at the cursor Workspace
position to the right Ins Alt + 1
Monitor/Simulator Tool
Ctrl + Shift + Unit Editor Ctrl + U
Monitor mode
F3
Help
PLC transfer monitor
mode Ctrl + F8 Instruction help F1
PLC read monitor mode Ctrl + F1 Instruction Reference
Manual Ctrl + 1
PLC read Ctrl + F5
Start Online Edit F10
Simulator Ctrl + F2
APPENDICES
Edit View
Search Ctrl + F or Workspace Alt + 1
Rung or rung Output window Alt + 2
step number Ctrl + Shift + G
Zoom in Ctrl + PageUp
List of Shortcut Keys
Edit View
Search Ctrl + F ( ) Workspace Alt + 1
Rung selection Ctrl + → Output window Alt + 2
Top Ctrl + Home Zoom in on ladder display Ctrl + PageUp
Bottom Ctrl + End Zoom out from ladder
display Ctrl + PageDown
Previous block Ctrl + ↑ Display label Ctrl + Backspace
APPENDICES
Next block Ctrl + ↓ Display cmnts Ctrl + (space)
Previous symbol Shift + Tab
Display unit device Shift + (space)
Next symbol Tab
Jump Change device value F2
Home Home
End End
Monitor/Simulator
Prev. changed
block Ctrl + Alt + ← Return to Editor Ctrl + F1
Monitor/Simulator Help
Return to Editor Ctrl + F1 Instruction help F1
Ctrl + Shift + Instruction Reference
Monitor mode Manual Ctrl + 1
F3
Online edit transfer F11
Simulator Ctrl + F2
Display/hide watch window Alt + 3
APPENDICES
List of GPPQ and GPPA Format Shortcut Keys
Ctrl + / (slash)
APPENDICES
Ctrl + / (slash) Ctrl + / (slash)
Ctrl + / (slash)
Ctrl + / (slash)
/ (slash)
• Suffix
/ (slash)
/ (slash) / (slash)
APPENDICES
List of Shortcut Keys
/ (slash)
/ (slash)
/ (slash)
If you press this key when a cell with no instruction is selected, an NC contact
will be entered.
/ (slash)
APPENDICES
Characters that cannot be used
(space)
Characters that cannot be used as the
first character
Character and character strings that cannot
be used as the last character or characters
Character string that cannot be used Global
ARRAY, OF,
AT,
CASE, END_CASE,
CONFIGURATION, END_CONFIGURATION,
CONSTANT,
EN, ENO,
EXIT,
• F_EDGE,
List of Characters That Cannot Be Used
APPENDICES
Yes, (SDHC
Memory card -
compatible)
Base unit CTH 2 3 4 3
devices CTC 4 6 8 6
Number Yes, 100 kHz, Yes, 100 kHz, Yes, 100 kHz,
Positioning*2 Yes, 100 kHz, 2 axes
of axes 3 axes 4 axes 3 axes
Number Yes, 100 kHz, Yes, 100 kHz, Yes, 100 kHz,
Yes, 100 kHz, 2 channels
of CH 3 channels 4 channels 3 channels
A-phase:
*1 You can use the following control relays (CR) to determine whether the functions can be used.
You can improve program reuse by performing logical AND on these control relays and the
execution conditions of the related programs.
• CR2310 (calendar timer present)
• CR4205, CR4405, CR4605, and CR4805 (CTH n present)
• CR8414, CR8514, CR8614, and CR8714 (axis n present)
*2 This cannot be used on relay type models.
N14*T, an error will not be generated when the ladder program is executed, but
operation will be stopped.
The instructions that may not operate on execution are listed below.
INT, CTH, CTC, RFSCTH, INCENC, FCNT, RCNT, PLSOUT, HSP, PSTRT, JOG,
ORG, TCH, HOME, CHGSP, CHGTGT, and RFSPS
• If you are using instructions related to calendar timers with the KV-N14** (for
example, the LDWK instruction), a warning will be displayed when conversion is
performed by KV STUDIO, and the instructions will not operate when the ladder
program is executed (for contact instructions, the same operation as when the
Precautions When Changing from One KV Nano Series Model to Another
Item Description
You cannot make replacements.
Functions that cannot be used by the model are deleted or initialized when you
Hardware functions change the model. After you change the model, check the specifications, and
use the model within the specified range.
"Differences Related to Functions Such as CPU Special Hardware Functions"
APPENDICES
Devices other than control relays (CR) and control memory (CM) entries cannot
be automatically replaced. To replace devices, use the function for replacing
devices in KV STUDIO.
"Device Range Comparison Table"
Devices See the information on device replacement in the "KV STUDIO User's
Manual."
Automatic replacement of control relays and control memory entries can only
be performed on devices that can be replaced.
"Differences between Control Relays and Control Memory Entries"
Precautions When Changing between a KV-5000/3000 Series Model and a KV Nano Series Model
You cannot make replacements. However, between units that have the same
Extension cassettes functions, you can import and export some settings to make replacements.
"Software Settings That Can Be Imported"
You cannot make replacements.
You can reuse ladder programs by changing the assigned leading device.
(To replace the output relays of I/O units, use the function for replacing devices
Expansion I/O units in KV STUDIO.)
"Expansion I/O Unit Differences"
"Model Replacement Procedure"
Depending on the instructions:
• Labels may be converted to unregistered labels.
• Instructions and operands may be changed to the appropriate values
Instructions automatically.
• Changes will not be made, but operations may not be performed on
execution.
"Instructions That Have Differences"
When you change models, the software functions are deleted.
Software functions You can export and import the settings of some functions.
"Software Settings That Can Be Imported"
1 Use the function for replacing devices in KV STUDIO to replace the devices that cannot be
used with the KV Nano Series.
2 In KV STUDIO, on the "File" menu, click "Change model" to execute the model change.
Reference The results of changing the model are saved as the "conversion result text." View the
"conversion result text" to check whether problems such as labels being changed to
unregistered labels have occurred.
APPENDICES
1 In KV STUDIO, on the "File" menu, click "Change model" to execute the model change.
Reference The results of changing the model are saved as the "conversion result text." View the
"conversion result text" to check whether problems such as labels being changed to
unregistered labels have occurred.
1 Use the function for replacing devices in KV STUDIO to replace the devices that cannot be
used with the KV Nano Series.
2 If there are software settings that can be imported, use the setting dialog boxes to save the
settings.
APPENDICES
Precautions When Changing between a KV-5000/3000 Series Model and a KV Nano Series Model
3 In the Unit Editor options, set the device assignment format to the KV Nano Series format,
and then change the device assignments.
Reference • On the KV Nano Series, devices are assigned starting from R1000 (this is the default
value).
By changing the KV-5000/3000 Series device assignments, the devices will be
assigned automatically after the changes are completed, which enables you to
perform operations.
• When changing from the KV-5000/3000 Series I/O unit (KV-B8XTD) to the KV Nano
Series I/O unit (KV-N8EXT), you have to change device assignments.
The KV-B8XTD output relay is assigned to the leading device number + 100.
The KV-N8EXT output relay is assigned to the leading device number + 500, so after
you change the model, use the function for replacing devices in KV STUDIO to
replace the output relay.
4 In KV STUDIO, on the "File" menu, click "Change model" to execute the model change.
5 Open the Unit Editor, and configure the expansion unit settings.
APPENDICES
Precautions When Changing between a KV-5000/3000 Series Model and a KV Nano Series Model
6 The results of changing the model are saved as the "conversion result text." View the
"conversion result text" to check whether problems such as labels being changed to
unregistered labels have occurred.
Reference • Expansion units are configured as dummy units. Delete these, and then configure the
correct expansion units.
• You can easily configure expansion unit settings, Serial PLC Link settings, and other
similar settings by starting two instances of KV STUDIO and using them to visually
compare the settings.
• When you have changed the device assignments in step 3, if the number of
expansion I/O unit points is consistent, you can perform operations without
configuring expansion unit settings.
• After changing models, you have to import (read the settings of) the files that you
saved in step 2.
1 If there are software settings that can be imported, use the setting dialog boxes to save the
settings.
APPENDICES
Precautions When Changing between a KV-5000/3000 Series Model and a KV Nano Series Model
2 In the Unit Editor options, set the device assignment format to the KV-5000/3000 Series
format, and then change the device assignments.
Reference On the KV-5000/3000 Series, devices are assigned starting from R30000 (this is the
default value).
The KV Nano Series I/O unit (KV-N8EXT) output relay is assigned to the leading device
number + 500. When you change to the KV-5000/3000 I/O unit (KV-B8XTD), the output
relay changes to the leading device number + 100, so after you change the model, use
the function for replacing devices in KV STUDIO to replace the output relay.
3 In KV STUDIO, on the "File" menu, click "Change model" to execute the model change.
4 Open the Unit Editor, and configure the expansion unit settings.
APPENDICES
Precautions When Changing between a KV-5000/3000 Series Model and a KV Nano Series Model
5 The results of changing the model are saved as the "conversion result text." View the
"conversion result text," and check any locations in which the conversion was not
successful.
Reference • You can easily configure expansion unit settings, CPU positioning settings, and other
similar settings by starting two instances of KV STUDIO and using them to visually
compare the settings.
• After changing models, you have to import (read the settings of) the files that you
saved in step 2.
KV-5500/
KV-N60A* KV-N40** KV-N24** KV-N14**
5000/3000
24 VDC
100 to 240 100 to 240 24 VDC (KV-N**D*)
Power supply
VAC VAC 100 to 240 VAC (KV-N**A*)
(KV-U7)
Access window Present Extension cassette (KV-N1AW) required
APPENDICES
Battery Present Not present
Base
Yes
communication Yes
(KV-3000 only)
port (RS-232)
Analog volume No 2 channels
260 k steps
Base Program (160 k steps
specifications 16 k steps 8 k steps
capacity on the
KV-3000)
Precautions When Changing between a KV-5000/3000 Series Model and a KV Nano Series Model
Base
10 ns 50 ns
instructions
Device 96000
comment (30000 on the 20,000 10,000
capacity KV-3000)
SRAM backup
Power failure
using the Backup of 3072 words using nonvolatile RAM
holding
battery
Fixed-period
1 No
modules
16
(line driver
Inputs 36 24 14 8
input
supported)
24 16 10 6
Outputs (relays) No
(KV-N60AR) (KV-N40*R) (KV-N24*R) (KV-N14*R)
I/O Outputs 24 16 10 6
8
(transistors) (KV-N60AT(P)) (KV-N40*T(P)) (KV-N24*T(P)) (KV-N14*T(P))
Screw terminal
Screw terminal block
Connector MIL connector block (not
(removable)
removable)
Service power
+5 V +24 V (AC power supply type only)
supply output
Access window Present Extension cassette required
The following devices are not present.
Access Device mode No
EM, FM, ZF, and TRM
window
Default
Japanese English
language
KV-5500/
KV-N60A* KV-N40** KV-N24** KV-N14**
5000/3000
Interrupt 10
4
conditions (input (R000 to
(R000 to R003)
relays) R009)
Interrupt
conditions 4 8 6
4
(high-speed (CTC0 to CTC (CTC0 to (CTC0 to
(CTC0 to CTC3)
counter 3) CTC7) CTC5)
Interrupts
comparators)
16 36 24 14 8
APPENDICES
KV-5500/
KV-N60A* KV-N40** KV-N24** KV-N14**
5000/3000
4 3 2
Number of axes 2
No (the relay output type is not supported)
• Origin
sensor rising
• Origin sensor rising edge
edge
• Origin sensor middle point
• Origin
Origin returning • Origin sensor and Z-phase
sensor
operation • Dog type (Z-phase not used)
middle point
• Dog type (Z-phase used)
• Origin
• Dog type (press-against)
APPENDICES
sensor and
Motor Z-phase
(positioning) Changing the
control target
No CHGTGT instruction
coordinate
during operation
Error and The same
Separate relays
error clear relays
Immediate
Precautions When Changing between a KV-5000/3000 Series Model and a KV Nano Series Model
Limit stop Deceleration stop
stop
32 points
Point (shared 20 points
parameters between 2 (each axis)
axes)
PLSX and
PLXY,
ORGX and
ORGY, PSTRT,
JOGX and ORG,
JOGY, JOG,
HOMEX and HOME,
Instructions
HOMEY, TCH,
TCHX and CHGSP,
TCHY, CHGTGT, and
CHGSPX and RFSPS
CHGSPY, and
Motor RFSPSX and
(positioning) RFSPSY
control Minimum
operating 50 Hz 1 Hz
speed
Deceleration Time
Rate specification
unit specification
Turned OFF
Rotation
with normal
direction output Turned ON with normal direction rotation
direction
in 1-pulse mode
rotation
Power off
holding
Parameters Power off holding settings required
settings not
required
KV mode (host link)
KV mode
KV mode (text transmission)
(host link)
KV STUDIO mode
Serial KV mode (text
Operation mode Non-procedural mode
communication transmission)
Modbus master mode
KV STUDIO
Modbus slave mode
mode
Serial PLC Link mode (only when using a KV-N11L)
Saving and reading project data Memory card Extension access window cassette
- KV Nano Series(terminal block type) User’s Manual - A-57
10 Precautions When Changing between a KV-5000/3000 Series Model and a KV Nano Series Model
KV-5500/
KV-N60A* KV-N40** KV-N24** KV-N14**
5000/3000
Module
No Up to 32 characters
passwords
Macro Up to 6
Password Up to 32 characters
passwords characters
Project Up to 6
Up to 32 characters
passwords characters
During
Break monitoring and Only during simulating
simulating
APPENDICES
Number of units
connected to Up to 1 on the
Up to 2 on the front panel Up to 1 on the front panel
function left side
extension slots
Expansion unit
Function Yes, Yes,
extension No up to 2 ports up to 1 port
(serial) (115.2 kbps max.) (115.2 kbps max.)
Function
extension Yes,
No
(access up to 1 unit
window)
KV-5500/
KV-N60A* KV-N40A** KV-N24** KV-N14**
5000/3000
CPU input
R000 to R015 R000 to R203 R000 to R107 R000 to R013 R000 to R007
relays
CPU input
relays and R500 to R507 R500 to R603 R500 to R515 R500 to R509 R500 to R505
output relays
APPENDICES
R01000 to
R01000 to R59915
Internal auxiliary R99915
relays MR00000 to
MR00000 to MR59915
MR99915
LR00000 to
Latch relays LR00000 to LR19915
LR99915
Control relays CR0000 to
CR0000 to CR8915
CR3915
Precautions When Changing between a KV-5000/3000 Series Model and a KV Nano Series Model
T0000 to
Timers T000 to T511
T3999
C0000 to
Counters C000 to C255
C3999
Data memory DM00000 to
DM00000 to DM32767
entries DM65534
EM00000 to
Base unit −
EM65534
devices FM00000 to
Expansion data
memory entries FM32767 (×
4) −
(ZF00000 to
ZF131171)
Temporary data
TM000 to TM511
memory entries
Control memory CM0000 to
CM0000 to CM8999
entries CM5999
High-speed CTH0 and
CTH0 to CTH3 CTH0 to CTH2 CTH0 and CTH1
counters CTH1
High-speed
counter CTC0 to CTC3 CTC0 to CTC7 CTC0 to CTC5 CTC0 to CTC3
comparators
B0000 to
Link relays B0000 to B1FFF
B3FFF
Link data
W0000 to W3FFF
memory entries
Index registers Z01 to Z12
TRM0 to
Digital trimmers −
TRM7
MRMDIR,
MDEL,
MPRINT,
Operations will not be
Memory card MREADL, A warning will be
− performed.
instructions MCOPY, displayed.
An error will not occur.
MMOV,
MREN,
MFREEK,
MSTAT,
LOGE,
Precautions When Changing between a KV-5000/3000 Series Model and a KV Nano Series Model
LOGD, and
TRGD
When using the KV-
N1AW,
operations will be
performed normally.
Access AWNUM, and A warning will be
− When not using the
window instructions AWMSG displayed.
KV-N1AW,
operations will not be
performed (an error
will not occur).
PSTRT #1
PLSX Operations will be
Replaced with points −
Points #0 to #19 performed normally.
#1 to #20
PSTRT #1
PLSX
Converted to An error will occur. −
Points #20 to #31
unregistered labels
PSTRT #2
PLSY Operations will be
Replaced with points −
Points #0 to #19 performed normally.
#1 to #20
PSTRT #2
PLSY
Converted to An error will occur. −
Points #20 to #31
unregistered labels
Operations will be
JOGX Converted to JOG #1 −
performed normally.
Operations will be
JOGY Converted to JOG #2 −
Positioning performed normally.
instructions Operations will be
ORGX Converted to ORG #1 −
performed normally.
Operations will be
ORGY Converted to ORG #2 −
performed normally.
Converted to HOME Operations will be
HOMEX −
#1 performed normally.
Converted to HOME Operations will be
HOMEY −
#2 performed normally.
Converted to CHGSP Operations will be
CHGSPX −
#1 performed normally.
Converted to CHGSP Operations will be
CHGSPY −
#2 performed normally.
Operations will be
RFSX Converted to RFS #1 −
performed normally.
Converted to RFSPS Operations will be
RFSPSY −
#2 performed normally.
APPENDICES
performed (an error
Clock processing WTIME and A warning will be will not occur).
instructions AJST − displayed. A unit other than the
KV-N14**
Operations will be
performed normally.
KV-N14**
LDWK,
Operations will not be
LDWKB,
performed.
Weekly contact ANDWK, A warning will be
− A unit other than the
instructions ANDWKB, displayed.
Precautions When Changing between a KV-5000/3000 Series Model and a KV Nano Series Model
KV-N14**
ORWK, and
Operations will be
ORWKB
performed normally.
KV-N14**
LDCAL,
Operations will not be
LDCALB,
performed.
Calendar timer ANDCAL, A warning will be
− A unit other than the
instructions ANDCALB, displayed.
KV-N14**
ORCAL, and
Operations will be
ORCALB
performed normally.
FRSET,
File register Converted to
FRSTM, and An error will occur. −
instructions unregistered labels
FRLDM
Digital trimmer Converted to an
TMIN An error will occur. −
instruction unregistered label
If the device is not
supported
A warning will be
DR* − Operations will not be
displayed.
performed (an error
will not occur).
If the device is not
Direct supported
RFSX* and A warning will be
refresh instructions RFSY* − Operations will not be
displayed.
performed (an error
will not occur).
UREAD and Unit number
An error will occur. −
UWRIT converted to "???"
Unit-specific Converted to
An error will occur. −
instructions unregistered labels
Devices, such as
Converted to
Other instructions EM, that cannot be An error will occur. −
unregistered labels
used
* If the conversion destination device does not support direct I/O
(There are no precautions if direct I/O is supported.)
#3 and #4
Converted to
unregistered labels
#1
JOGX #1 and #2 #1 and #2
#2 A warning will be Operations will be
JOG JOGY displayed. performed normally.
#3 and #4 #3 and #4 #3 and #4
Converted to An error will occur.
Precautions When Changing between a KV-5000/3000 Series Model and a KV Nano Series Model
−
unregistered labels
#1
ORGX #1 and #2 #1 and #2
#2 A warning will be Operations will be
ORG ORGY displayed. performed normally.
#3 and #4 #3 and #4 #3 and #4
Converted to An error will occur. −
unregistered labels
#1
HOMEX #1 and #2 #1 and #2
Positioning
#2 A warning will be Operations will be
instructions
HOME HOMEY displayed. performed normally.
#3 and #4 #3 and #4 #3 and #4
Converted to An error will occur. −
unregistered labels
#1
TCHX #1 and #2 #1 and #2
#2 A warning will be Operations will be
TCH TCHY displayed. performed normally.
#3 and #4 #3 and #4 #3 and #4
Converted to An error will occur. −
unregistered labels
#1
CHGSPX #1 and #2 #1 and #2
#2 A warning will be Operations will be
CHGSP CHGSPY displayed. performed normally.
#3 and #4 #3 and #4 #3 and #4
Converted to An error will occur. −
unregistered labels
#1
RFSPSX #1 and #2 #1 and #2
#2 A warning will be Operations will be
RFSPS RFSPSY displayed. performed normally.
#3 and #4 #3 and #4 #3 and #4
Converted to An error will occur. −
unregistered labels
Converted to
CHGTGT An error will occur. −
unregistered labels
APPENDICES
ADRSET
Other Converted to
(when a CM device is An error will occur. −
instruction unregistered labels
used in an operand)
For details on the difference between CR (control relays) and CM (control memory entries), in KV
Precautions When Changing between a KV-5000/3000 Series Model and a KV Nano Series Model
STUDIO, on the "Help" menu click "Handy-Nav(reference programs/tech materials)," and then see
"CR_CM_ConvertTableInChangeModel.xls."
The settings of the following function can be exported and imported between KV-5000/3000 Series and
KV Nano Series expansion units and extension cassettes that have the same functions.
Function KV-5000/3000 Series Function KV Nano Series Function
High-speed multi-link unit Extension serial communication
Serial PLC Link function
KV-LM21V cassette KV-N11L
The assignment methods used for each expansion unit vary between the KV-5000/3000 Series and the
KV Nano Series.
Function KV-5000/3000 Series KV Nano Series
KV-N14** Inputs: R000 to R007
Outputs: R500 to R505
KV-N24** Inputs: R000 to R013
Inputs: R000 to R015 Outputs: R500 to R509
Built-in I/O
Outputs: R500 to R507 KV-N40** Inputs: R000 to R107
Outputs: R500 to R515
KV-N60** Inputs: R000 to R203
Outputs: R500 to R607
Assigned per 10 channels starting from
R1000
Expansion unit automatic Assigned per 10 channels starting from
assignment (default value) R30000 Input: (Unit number) × 1000 + 000
Output: (Unit number) × 1000 + 500
Special: (Unit number) × 1000 + 000
Input and output are assigned with no
I/O unit assignment space between them. The input and output are assigned with
(* Changes ladder Input: Leading device + 000 500 blank entries between them.
programs automatically Output: Leading device + 100 (200)* Input: Leading device + 000
when changing models) *The value in parentheses is for the Output: Leading device + 500
KV-C32XTD.
When you replace the KV-10/16/24/40 with the KV Nano Series, only some devices can be replaced
automatically. R and DM devices which are not replaced are converted to a disabled operand. TM
devices which are not replaced are changed to unregistered labels.
To replace the other devices, use the function for replacing devices in KV STUDIO while referring to the
following table.
KV-10/16/24/40 KV Nano Series
TM2 and TM3 TM102 and TM103
The scan time when the set
TM28 −
value is exceeded.
The set value of fixed scan time
TM29 −
operation
CTH1 value (when an INT3
TM30 −
interrupt has occurred)
TM31 Scan time measured value CM720 Scan time measured value
#TM102 and
#TM2 and #TM3
#TM103
#TM28 and #TM29 −
DM1000 to DM1199 Devices related to port A −
DM1200 to DM1399 Devices related to port B −
Devices related to cam
DM1400 to DM1469 −
switches
Devices related to trapezoidal
DM1480 to DM1486 −
operation
DM1500 to DM1577 Devices related to QL −
DM1580 to DM1599 Devices related to the KV-D20 −
DM1600 to DM1663 Devices related to KL −
APPENDICES
DM1926 and CM4816 and
CTH1 preset input CTH1 preset value
DM1927 CM4817
DM1928 to DM1935 Input capture CM1600 to CM1607 INT R00000 input capture
DM1936 Frequency pulse set value −
Expansion unit connection
DM1937 −
information
DM1938 and
Digital trimmers −
DM1939
APPENDICES
setting
R2410 INT2 interrupt polarity CR2604 INT R00002 interrupt polarity
R2411 INT2 interrupt polarity CR2605 INT R00002 interrupt polarity
R2412 INT3 interrupt polarity CR2606 INT R00003 interrupt polarity
R2413 INT3 interrupt polarity CR2607 INT R00003 interrupt polarity
R2414 CTH1 ring counter CR4410 CTH1 counter mode selection
R2415 CTH1, ignore B-phase −
R2500 to R2513 Devices related to the KV-D30 −
APPENDICES
Device notation for relay (R) units ................... 4-28 Feedback control ...............................................4-2
Device orientation ............................................ 3-12 Fixed character strings ....................................4-51
DI instruction .................................................... 4-94
DIC instruction ................................................. 4-96
Differences between Macros and G
Subroutines ................................................ 4-130
Direct Clock Pulse Output ............................. 5-145 General Specifications .......................................2-2
Direct output .................................................... 4-74 Global device .................................................4-134
Global device notation ...................................4-134
Index
Disconnecting Units ........................................... 3-6
Display and setting of time .................5-218, 5-251 Grounding precautions ....................................3-14
0-second adjustment .................................. 5-220
Clock .......................................................... 5-218
Functions of setup operation keys ............. 5-218 H
Operating instructions ................................ 5-218
Setting the date and time ........................... 5-219 HEX .................................................................4-55
Switching to the clock ................................ 5-218 Hexadecimal ....................................................4-55
Display Language .......................................... 5-215 Hexadecimal Constants ...................................4-50
Double precision floating-point constants ........ 4-51 High-Speed Counter .............................. 4-40, 5-98
Double precision floating-point real numbers Acquiring the Current Value Based on Input
DOUBLE-FLOAT .......................................... 4-57 Capture ...................................................5-130
Comparator Matching Output .....................5-128
Enabling and Disabling Counting (Counter
E Enable Function) ....................................5-126
High-Speed Counter Specifications .............5-98
Edit list ............................................................... 4-7 Preset Function ..........................................5-124
EI instruction .................................................... 4-94 Reading and changing the current value and
Entry assistance ............................................ 4-143 changing the set value ............................5-133
Every-scan execution type ............................ 4-102 Reading the Current Value’s
Expansion I/O Unit Change Direction ....................................5-129
Names and Functions of Parts ..................... 2-56 Reset Mode ................................................5-121
Specifications ............................................... 2-57 High-speed counter (current value) CTH .........4-40
Wiring and Internal Circuit Diagrams ........... 2-58 High-speed counter comparator ..... 2-3, 4-35, 4-40
Expansion Input Unit High-speed counter comparator CTC .... 4-35, 4-40
Names and Functions of Parts ..................... 2-47 High-Speed Counter Comparator Interrupts ....4-80
Outline Drawings .......................................... 2-50 HOME instruction .............................................5-60
Specifications ............................................... 2-48 How to handle the set value and
Wiring and Internal Circuit Diagrams ........... 2-49 current value of a counter ............................4-35
Expansion Output Unit How to handle the set value and
Names and Functions of Parts ..................... 2-51 current value of a timer ................................4-33
Outline Drawings .......................................... 2-55 How to program counter operations ................4-34
Specifications ............................................... 2-52 How to program Timer operations ...................4-32
Wiring and Internal Circuit Diagrams ......2-53, 2-54 How to search for rung comments .................4-157
Extension Access Window Cassette How to set the bit that Is turned ON
Names and Functions of Parts ..................... 2-65 during execution .........................................4-123
Outline Drawings .................................2-66, 2-67 HSP instruction ................................................4-92
Specifications ............................................... 2-65
Initialize module ................................... 4-102, A-32 List of CX Format Shortcut Keys ................. A-42
Input relay .................................................2-3, 4-27 List of GPPQ and GPPA Format
Inspection ........................................................ 3-20 Shortcut Keys .......................................... A-41
Installation Position .......................................... 3-12 Shortcut Keys That Are Valid in
Installing Units Directly in an Industrial KV STUDIO ............................................. A-36
Control Panel ............................................... 3-11 Shortcut Keys That Are Valid in the
Installing Units on DIN Rails ............................ 3-10 Unit Editor ................................................ A-35
Instruction list display .................................... 4-143 List of Unusable Instructions ........................... A-32
Index
O S
APPENDICES
Object creation .............................................. 4-130 Saving ..............................................................4-74
Online editing ................................................. 4-171 Self-hold macros ............................................ 4-116
Operation during Power Outages ...................... 2-4 Sequence control ...............................................4-4
Operation when the execution condition is turned Serial Communication ....................................5-193
OFF ............................................................ 4-132 Series Common Specifications ..........................2-2
Operation when the program is called between the Set display mode ...........................................4-175
MC (master control) and MCR Setting Disabled Operations ..........................5-248
Index
(master control reset) instructions .............. 4-132 Setting the polarity of external input interrupts ........4-79
Option ............................................................ 5-183 Shift JIS code ...................................................4-60
ORG instruction ............................................... 5-54 Shortcut keys that are valid during
Output relay ..............................................2-3, 4-27 online editing ............................................... A-39
Edit .............................................................. A-39
Help ............................................................. A-41
P Monitor/Simulator ........................................ A-41
Script ........................................................... A-40
Package Contents ............................................. 2-5 View ............................................................ A-40
Password ......................................................... 4-15 Shortcut keys that are valid in editor mode ..... A-36
Performance Specifications ............................... 2-3 Convert ........................................................ A-37
PLSOUT instruction ......................................... 5-96 Edit .............................................................. A-36
Precautions When Connecting Units ..........3-2, 3-8 File .............................................................. A-36
Precautions When Using the USB Port or Help ............................................................. A-38
Serial Communication Port to Communicate Monitor/Simulator ........................................ A-38
with a PC or Other Peripheral ...................... 3-19 Script ........................................................... A-37
Precautions when using Timer instructions ..... 4-32 Tool .............................................................. A-38
Processing Bit Devices in Units of Words ....... 4-47 View ............................................................ A-37
Processing bit devices in units of words .......... 4-47 Shortcut keys that are valid in monitor mode ....... A-38
Program capacity ............................................. 4-11 Debugging ................................................... A-38
Programming without considering modules ... 4-107 Edit .............................................................. A-38
Project property ............................................... 4-15 Help ............................................................. A-38
PSTRT instruction ........................................... 5-46 Monitor/Simulator ........................................ A-38
View ............................................................ A-38
Shortcut keys that are valid in
R simulator mode ............................................ A-39
Edit .............................................................. A-39
R .............................................................4-27, 4-29 Help ............................................................. A-39
RAM Clear ..................................................... 5-241 Monitor/Simulator ........................................ A-39
RCNT instruction ........................................... 5-160 View ............................................................ A-39
Read protection ............................................... 4-15 Shortcut Keys That Are Valid in the
Register and batch monitors .......................... 4-174 Unit Editor ................................................... A-35
Removing the cassette ...................................... 3-9 Convert ........................................................ A-35
Removing the Terminal Block ..........................3-18 Edit .............................................................. A-35
Reserved area ............................................... 4-136 File .............................................................. A-35
Restoration Method Help ............................................................. A-35
How to clear errors .......................................3-22 Operations in message area ....................... A-35
How to clear the PLC status ........................ 3-22 Operations in the unit configuration area .... A-35
- KV Nano Series(terminal block type) User’s Manual - A-71
12 Index
APPENDICES
Index
E 1101-3
Copyright (c) 2017 KEYENCE CORPORATION. All rights reserved. 084490E 1127-1 717GB Printed in Japan