0% found this document useful (0 votes)
476 views526 pages

KV-5000/3000 Series: Programable Controller

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
476 views526 pages

KV-5000/3000 Series: Programable Controller

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 526

Programable Controller

KV-5000/3000 Series
User’s Manual
■ Hardware
CPU unit AC power unit Extension I/O unit
Extension unit Error output unit

■ CPU built-in function


■ Ladder programming
Preface
This manual describes how to connect and maintain KV-5000/3000 series PLC, CPU built-in functions
and how to prepare ladder programs. In addition, also record specification and operating method of CPU
unit/AC power supply unit/expansion I/O unit/expansion unit/error output unit. For special expansion
units other than the above-mentioned, please refer to user manual of the units.
During actual programming, please read "command reference manual"/"script programming manual"/
"KV STUDIO user manual" etc simultaneously.
Keep this Manual in a safe place for later reference.
Please handover this manual to the end-users who are going to use the KV-5000/3000 Series.

■ KV-5000/3000 Series User Manual


All the following PDF manuals can be found and opened in the help file of KV STUDIO. In addition, the
latest version of PDF manuals can be downloaded from the Keyence web site.

Name Description
KV-5000/3000 series To describe system configuration/specification, CPU built-in function,
User's Manual ladder programming method etc of KV-5000/3000 Series.
KV-5000/3000/1000 Series
This Manual describes available instructions for ladder programming.
Instruction Reference Manual
KV-5000/3000/1000 Series This Manual describes script programming and available operators, control
Script Programming Manual statements and functions.
KV STUDIO
This manual describes how to operate KV STUDIO.
User's Manual
KV-5000/3000/1000 Series This manual describes the system macros available for the KV-5000/
System Macro Manual 3000/1000 series.

● KV-5000CPU built-in Ethernet/FL-net function related manual


When use KV-5000 CPU built-in Ethernet/FL-net function etc functions, the following manual is
required.

Name Description of Manual


KV-LE20V To describe specification, use operating method, operation steps etc Ethernet
User's Manual unit KV-LE20V.
KV-FL20V To describe specification, use operating method, operation steps etc Ethernet
User's Manual unit KV-LE20V.

"2-6 Ethernet/FL-net Communication (KV-5000 only)", Page 2-82

● KV-3000CPUKV-3000 CPU built-in serial communication function related manual


And use KV-3000 CPU built-in serial communication port, read write PLC device value, the following manual is required.

Name Description of Manual


KV-L20V To describe specification, use operating method, operation steps of
User's Manual serial communication KV-L20V.

"2-5 Serial Communication (KV-3000 only)", Page 2-74


Safety Precautions
■ Symbols
This document contains notices which you should observe to ensure your own personal safety, as well
as to protect the product and connected equipment. These notices are highlighted in the manual by a
warning triangle and are marked as follows according to the level of danger:
Differentiate display.

Danger Indicates that death or severe personal injury will result if proper precautions are not taken.

Warning Indicates that death or severe personal injury can result if proper precautions are not taken.

Caution Indicates that damage to property can result if proper precautions are not taken.

Important
Indicates that an undesirable result or status can occur if the relevant notice is ignored.

Note
Describes cautions for easily mistaken operations.

TIP Indicates useful information or information that aids understanding of text descriptions.

Indicates a reference item or page to be referred to in this manual and other manuals.

■ General Precautions
· Verify that this device functions correctly at startup and during operation.
· Provide a safety circuit that bypasses PLC to enable failsafe operation of the entire system in the event that the PLC fails.
· Output circuit or internal circuit malfunctions sometimes prevent control from being performed normally.Be sure to
provide a safety circuit in control systems where circuit malfunction may lead to fire or other serious accidents.
· Proceed with care when modifying the KV-L20R, 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 product in combination with other devices only after careful consideration, since the product may fail to
satisfy its functionality and performance capabilities as a result of the conditions and environment in which it is used.
· Do not use the product with the purpose of protecting human beings.
· Verify that the KV-5000/3000 function correctly when using the KV STUDIO.

■ Note
When use as per the condition or environment shown below, operating method with rating, function margin
Or fault self-recovery (Safety measures) etc safety countermeasures, at the same time, contact and
negotiate with business personnel of our company.
· Use of the product under conditions not described in this manual.
· Use of the product in nuclear power control, railroad facilities, aviation facilities, vehicles,
combustion devices, medical equipment, entertainment machinery, safety equipment, etc.;
· Use of the product in applications that may have a significant impact on human life or property, or
that place a high priority on safety.
- KV-5000/3000 Series User’s Manual - 1
■ Precautions for CE Marking
Keyence Corporation has evaluated compliance with the requirements of the EU Directive when the
following conditions were satisfied, and have confirmed that this product satisfies those requirements.
Accordingly, be sure to satisfy the following conditions when using this product in EU countries.

● About EMC instruction (2004/108/EC)


· Applicable Standard EN55011(EMI)、EN61131-2(EMS)
· Setting: KV-5000/3000 series model is open type equipment, must be arranged in control panel.
<Concerning control panel>
· Please select conductive control panel.
· When joint exists in roof plate or soleplate etc control panels, please peel painting layer
to keep conductivity.
· Control panel grounding should use thick ground wire to ensure low impedance at high
frequency.
· Power line: when KV-5000/3000 series power supply uses our company's KV-U7, please wrap two
turns of ferrite core on power cable.In addition, when KV-5000/3000 series DC power
supply input terminal is used to connect power supply, it is also the same.
(ferrite core used by our company for evaluation: TDK ZCAT-3035-1330)
· Ground wire: grounding diagram from KV-U7 etc power supply FG terminals to control panel, thick
and short (below 30cm) special wire should be used.
· Signal line: cable led from expansion unit outwards to control panel must use shielded cable. When
shielded cable is not used, or ground processing of shielded cable is inappropriate, noise
resistance will not satisfy specification value.
<Concerning grounding of shielded cable>
· Execute ground processing of shielded cable near expansion unit, ensure that
grounded cable will not receive electromagnetic induction from the cable before
grounding.
· The shielded part exposed after shielded cable is partially peeled should be grounded
to control panel with large contact surface.(when clamp etc are used, peel painting
layer of the contact part.)
· Weld wire on shielding wire, implement grounding processing method for this wire, its
high frequency impedance will increase, will not exert shielding effect, therefore such
grounding method should be avoided.

● About low-voltage instruction (2006/95/EC)


The Low-voltage Directive is applied to only the KV-U7 / KV-B16RC/KV-B16RA.Other models may be
not limited by Low-voltage Directive.

· Applicable Standard EN61131-2(KV-B16RC/KV-B16RA)


EN60950-1(KV-U7)
· Overvoltage category II
· Degree of pollution 2

· When the KV-U7 power supply is used for the KV-5000/3000 series, since the KV-U7 is designed
to be a class I machine, so the protective conductor terminal installed on the power terminal must
be connected to the protective grounding wire of the building.
· Please install the KV-5000/3000 series into a conductive enclosure of IP54 above(e.g. control
panel).
· Rated load of KV-B16RC/RA relay is 8A at each common point. That is, when all 4 channels are
used, max. load of each channel is 1A; when 2 channels are used, max. load of each channel is
2A.
2 - KV-5000/3000 Series User’s Manual -
■ Precautions for UL Approval
The KV-5000/3000 series meets the following UL standards, and has passed the UL certification.
UL marks are available in the nameplate of every unit for an UL -approval product.

· Applicable standards UL508 Industrial Control Equipment


· UL File No. E207185

· Please install the KV-5000/3000 series into a conductive enclosure of IP54 above(e.g. control
panel).
· KV-5000/3000 series power supply must use our company KV-U7 special power supply, or up to
USA standard NFPA70 (NEC: National Electrical Code) specified UL certified power supply with
Class 2 output.
· When the KV-U7 power supply is used for the KV-5000/3000 series, since the KV-U7 is designed
to be a class I machine, so the protective conductor terminal installed on the power terminal must
be connected to the protective grounding wire of the building.
· The wire that is connected to the KV-U7 terminal block should have a wire gauge of AWG #14-#22,
and a rated temperature of 105℃ above. The tightening torque when wiring is 0.6 Nm.
· Except I/O unit and KV-DN20, wiring of all special unit terminals must adopt conductor with wire
size AWG#16-#22, wire material overmatching copper wire, rated temperature above 60 ℃ .The
tightening torque when wiring is 0.5 Nm.
· When replacing lithium battery , must use special lithium battery (OP- 51604).Wrong usage method
of lithium battery might cause explosion etc.Please do not charge, break down lithium battery or
put it into fire.
· For wiring to KV-5000/3000 (CPU unit) power supply terminal block, please always use stranded
copper wire with size AWG16-#20, its temperature rating should be above 60 ℃ .The tightening
torque when wiring is 0.5 Nm.

- KV-5000/3000 Series User’s Manual - 3


MEMO

4 - KV-5000/3000 Series User’s Manual -


How This Manual Is Organized
This chapter describes specifications and how to use system
configuration/connection methods and CPU unit, AC power unit,
Chapter 1 HARDWARE
extension I/O unit. extension unit and error output unit of KV-5000/
3000 series.

To describe various functions of access window, memory card slot, 1


Chapter 2 CPU BUILT IN FUNCTION communication ports, I/O, high speed counter etc provided for CPU
unit KV-5000/3000. 2
To describe function specification or setup method required for
3
Chapter 3 LADDER PROGRAMMING preparation of ladder program. In addition, module, macro, local
device may be used to increase programming efficiency.
A

Records KV-5000/3000 series control relay (CR)/control memory


APPENDICES
(CM) list or error list, list of commands used in this book etc.

- KV-5000/3000 Series User’s Manual - 5


Contents
Safety Precautions ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1
How This Manual Is Organized •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 5
Contents•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 6
Conventions Used In This Manual •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••13
Page Configuration and Symbols•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 13
How to Use Mnemonics List •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 15
Terminology•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 16

Chapter1 Hardware
1-1 System Configuration ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••1-2
System Overview •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••1-2
(1) About Power•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••1-3
(2) About Output Error Unit •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••1-3
(3) About CPU Unit •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••1-3
(4) About Expansion Unit••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••1-3
1-2 Unit Connection••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••1-4
Precautions on Connecting Unit •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••1-4
Unit Assembly •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••1-5
Mounting Onto the DIN Rail ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••1-6
1-3 Unit Wiring ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••1-7
Precautions on Wiring Each unit•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••1-7
Connector Assembly and Wiring•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••1-9
Removing the Terminal Block •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-13
1-4 Unit Installation •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-14
Installing Environment ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-14
Installation Position ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-14
1-5 System General Specification•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-16
General Specification •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-16
Performance Specifications••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-17
Operation During Power off ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-18
1-6 CPU Unit ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-20
Package Contents •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-20
Names and Functions of Parts ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-21
Specification ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-24
RUN-PROG Selector Switch ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-28
Wiring and Internal Circuit Diagram ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-28
Outline Dimensions••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-34
1-7 AC Power Unit •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-35
Name and Function of Each Part •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-35
Specification ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-36
How to Wire •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-37
Outline Dimensions••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-37
1-8 Expansion Input Unit
Name and Function of Each Part •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-38
Specification ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-39

6 - KV-5000/3000 Series User’s Manual -


Wiring and Internal Circuit Diagram ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-40
Outline Dimensions••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-44
1-9 Expansion Output Unit••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-45
Name and Function of Each Part •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-45
Specification ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-46
Wiring and Internal Circuit Diagram ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-47
Outline Dimensions •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-51
1-10 Expansion Unit ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-52
Name and Function of Each Part •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-52
Specification ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-53
About Connection / Setting ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-53
About Power Supply Switching •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-54
Outline Dimensions •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-55
1-11 Error Output Unit •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-56
Name and Function of Each Part •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-56
Specification ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-56
About Error Output ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-56
Wiring and Internal Circuit Diagram ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-57
Outline Dimensions••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-57
1-12 Maintenance •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-58
About Inspection and Maintenance ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-58
Replace Battery ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1-58

Chapter2 CPU Internal Functions


2-1 Access Window ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-2
Operations that Can be Implemented Through Access Window ••••••••••••••••••••••••••••••••2-2
Unit Monitor ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-6
Device Mode•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-9
Error Clear ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-15
Digital Trimmer •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-17
I/O Test•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-18
Data ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-20
CPU Monitor ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-22
Alarm •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-25
Memory Card •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-28
Commission•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-32
Access Window Setup ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-34
SRAM Clear Mode•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-36
All Clear Mode••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-37
User Message ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-38
Operation Disable Setting ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-39
Key Lock Function •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-41
2-2 Memory Card ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-42
About the Memory Card ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-42
About the Memory Card ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-43

- KV-5000/3000 Series User’s Manual - 7


Writing/Reading Project Data••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-47
Auto Load Function••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-50
Memory Card Instructions••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-51
2-3 Logging/Tracing ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-52
Overview ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-52
How to Use••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-53
Setup •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-53
About CSV File •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-61
Log Instructions ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-63
LOGE Enable logging/tracing •••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-64
LOGD Disable logging/tracing••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-64
TRGD Capture log data •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-66
Device List for Logging/Tracing •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-67
Logging/Tracing Function Precautions ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-70
2-4 USB Communication ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-73
Method of Connecting PC••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-73
Installing the USB Driver •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-73
2-5 Serial Communication (KV-3000 only) ••••••••••••••••••••••••••••••••••••••••••••••••••• 2-74
Communication Specification••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-74
How to Connect to PC ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-74
How to Connect to VT3 Series ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-75
How to Connect to Peripherals••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-75
Communication Setting Initialization and Communication Speed Setting ••••••••••••••••••• 2-76
Reading/writing of PLC Device Value••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-77
Sending/Receiving Text Data••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-77
ASCII Code Table••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-81
2-6 Ethernet/FL-net Communication (KV-5000 only)•••••••••••••••••••••••••••••••••••••• 2-82
Operations that Can be Implemented through CPU's Built-in Ethernet/FL-net Communication Function••••••• 2-82
Unit Editor Setting •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-82
2-7 I/O •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-83
Common I/O ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-83
Input Time Constant Setting •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-84
Disable Input Refresh •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-85
Disable Output •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-86
2-8 High-speed Counter •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-87
High-speed Counter Specification ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-87
Configuration of High-speed Counter ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-87
Setting Item List of High-speed Counter ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-88
How to Set High-speed Counter ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-88
How to Operate High-speed Counter ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-97
Function List of High-speed Counter•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-98
Setting of Counting Range •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-99
Setting of Counting Input •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-101
Setting Values in Hi-speed Counter (CTC) •••••••••••••••••••••••••••••••••••••••••••••••••••••••2-104
Reset Mode •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-105
Preset Function ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-108

8 - KV-5000/3000 Series User’s Manual -


Counter Enable Function •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-109
Comparator Matching Output•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-111
Read the Change Direction of Current Value••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-112
Capture the Current Value Based on Input ••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-113
High-speed Counter Instructions ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-113
CTH 32-bit High-speed counter••••••••••••••••••••••••••••••••••••••••••••••••••••••2-114
CTC High-speed Comparator ••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-114
RFSCTH High-speed counterc Refresh •••••••••••••••••••••••••••••••••••••••••••••••••2-118
Device List for High-speed Counter •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-119
Direct Clock Pulse Output••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-123
2-9 Frequency Counter ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-133
Frequency Counter Function Overview •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-133
Frequency Counter Instructions•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-133
FCNT Frequency measurementRotation speed measurement •••••••••••••••••2-134
RCNT Rotation speed measurement •••••••••••••••••••••••••••••••••••••••••••••••••2-136
2-10 Cam Switch ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-139
Cam Switch Function Overview•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-139
Cam Switch Instructions••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-139
MCMP Multi-stage comparator •••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-140
ABSENC Absolute encoder ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-144
INCENC Incremental encoder ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-148
2-11 Specifed Frequency Pulse Output •••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-153
Specified Frequency Pulse Output Overview ••••••••••••••••••••••••••••••••••••••••••••••••••••2-153
About Output Relay Switching ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-153
Specified Frequency Pulse Output Instruction •••••••••••••••••••••••••••••••••••••••••••••••••••2-153
PLSOUT Specified frequency pulse output •••••••••••••••••••••••••••••••••••••••••••••2-154
2-12 Motor (positioning) Control••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-157
Specification of Positioning Control ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-157
Concept of Positioning Control ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-157
Procedure for Positioning Control ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-158
Parameter Setup •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-158
ladder program •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-179
Positioning instruction List •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-185
PLSX Trapezoidal control X-axis •••••••••••••••••••••••••••••••••••••••••••••••••••••2-186
PLSY Trapezoidal control Y-axis •••••••••••••••••••••••••••••••••••••••••••••••••••••2-186
JOGX Jog operation X-axis ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-188
JOGY Jog operation Y-axis ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-188
ORGX Origin return X-axis ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-190
ORGY Origin return Y-axis ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-190
TCHX Teaching X-axis ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-192
TCHY Teaching Y-axis ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-192
HOMEX Moving to home position of X-axis••••••••••••••••••••••••••••••••••••••••••••2-194
HOMEY Moving to home position of Y-axis••••••••••••••••••••••••••••••••••••••••••••2-194
CHGSPX Cchange speed X-axis••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-196
CHGSPY Change speed Y-axis •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-196
RFSPSX Refresh current value X-axis ••••••••••••••••••••••••••••••••••••••••••••••••••2-198

- KV-5000/3000 Series User’s Manual - 9


Refresh Y-axis current value2-198
Reference example of Positioning Control••••••••••••••••••••••••••••••••••••••••••••••••••••••••2-199
Lilst of Devices/error Codes for Positioning ••••••••••••••••••••••••••••••••••••••••••••••••••••••2-208
2-13 Clock Function ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-214

Chapter3 Ladder Programming


3-1 What Is Sequence Control ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••3-2
Sequence Control Type••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••3-4
3-2 Programming Language•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••3-5
Extended Ladder••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••3-5
KV Script •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••3-7
Mnemonics •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••3-8
3-3 Project ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••3-9
Project Configuration•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••3-9
Program Capacity••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-11
Project Protection Setup••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-13
3-4 Program Structure and Operation •••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-15
CPU Unit Operation •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-15
Scanning Time •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-22
Program Configuration••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-26
3-5 Interrupt •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-31
Overview ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-31
Execution Of interrupt routine •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-33
External Input Interrupt •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-34
High-Speed Counter Comparer Based Interrupt•••••••••••••••••••••••••••••••••••••••••••••••••• 3-35
CPU Positioning Parameter Comparator 2 Interrupt ••••••••••••••••••••••••••••••••••••••••••••• 3-35
Interrupt Priority ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-36
Unavailable Instructions for Interrupt Routine ••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-37
I/O Processing During Interrupt •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-38
Input Capture •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-41
Sample Program •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-42
Interrupt Processing Instructions •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-45
3-6 Device and Constant ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-52
Device List ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-52
Set Power Failure Holding (latching)•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-57
Bit Device••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-57
Word Device ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-67
Index Modification •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-73
Indirect Specifying •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-75
The word unit processing for bit device •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-80
The bit device processing for a word device •••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-81
Constant •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-82
Internal register•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-84

10 - KV-5000/3000 Series User’s Manual -


3-7 Data Processing ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-86
BIN Data •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-86
Representation •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-87
Relationship Between Different Numbering Systems•••••••••••••••••••••••••••••••••••••••••••• 3-89
Character Code ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-92
Suffix •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-93
3-8 Module•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-94
Overview ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-94
Module Type ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-96
Module Execution Sequence ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••3-102
Example: Module Configuration•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••3-103
Module Device •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••3-105
3-9 Macro ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-109
Overview ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••3-109
The procedure to use a macro •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-111
Macro Type ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-112
Argument Setting •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-117
Macro System Device••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-119
Execution ON Bit•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••3-120
Difference Between Macro and Subroutine•••••••••••••••••••••••••••••••••••••••••••••••••••••••3-126
3-10 Local Device •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-131
Local Device Programming ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••3-131
Local Device List •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••3-132
Local Device Assignment ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••3-133
Typical Local Device entry and Conversion Error •••••••••••••••••••••••••••••••••••••••••••••••3-135
3-11 File Register •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-137
Overview ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••3-137
Bank Switchover •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••3-137
Defaults ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••3-138
File Register Setting•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••3-138
File Register Instructions •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••3-140
3-12 Programming Skills ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-148
From Installation to Operation •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••3-148
Programming Tips •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••3-152
Prepare Clear, Legible Program ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••3-164
Programming Key Points •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••3-169
Program Troubleshooting Debug •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••3-177

Appendices
1 PLC unit Error List ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• A-2
2 CR/CMlist ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• A-7
Control Relays CR••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• A-7
Control Memory CM •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• A-13
3 ASCII Code Table ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••A-19
ASCII Code Table••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• A-19

- KV-5000/3000 Series User’s Manual - 11


4 Instruction List •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••A-20
5 Unusable Instruction List••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••A-23
6 Shorted input list of mnemonic symbol •••••••••••••••••••••••••••••••••••••••••••••••••••••A-24
7 List of Shortcut Keys •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••A-26
Effective Shortcut Key for Unit Editor ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• A-26
KV STUDIO Valid Shortcut Keys ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• A-27
GPPQ/GPPA Mode Shortcut Keys List ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• A-32
CXList of Mode Shortcut Keys ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• A-33
/ How to Use this Manual •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• A-34
8 Unusable Character String List ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••A-36
9 Index ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••A-37

12 - KV-5000/3000 Series User’s Manual -


Conventions Used In This Manual
The following shows how pages are configured, and the symbols and terminology used in this Manual.

Page Configuration and Symbols

Headline 2-3 Making Modules Mid-headline


Indicates the main content of the is the title that further
chapter. Making New Modules classify contents in
Make new modules by the following procedure.
headline.
Procedures 1 Select {Modules/macros(M)} ĺ{New module(G)} from the menu.
Different Procedure • Click the icon.
• Select [New module(M)] from the menu that appears by right-clicking on [Workspace].
2 Index
Other procedure The [New module] dialog box is displayed.
Indicates the related chapters.

USING MODULES
2 Set the details of the new module.
Determine the name and type of the module.

Setting Screen. 1 Chapter title.


Setting Screen. 2

Is a list to display setup


frame content. No. Item Description Setting Range
1 Module name Enter the module name here. Max. 24 1-byte characters
(default: New_module)
"List of Unavailable Characters" (page A-
61)
2 Module type Select the type of module. Every-scan module/Initialization module/
Indicates the page or manual to refer to. "Types of Modules" (page 2-5) Standby module
(default: type of module currently selected

The page or manual containing the on [Workspace])

related information is indicated here. Note


• Once a module is deleted it cannot be restored. Note
• When a module currently specified by a module instruction is deleted, a conversion
error occurs. Describes cautions for
Note
easily mistaken operations.
• Disabled modules are not transferred to the KV-1000 when the ladder program is

The product designation from transferred to the KV-1000. Be sure to read carefully.
• When a module currently specified by a module instruction is disabled, a
Keyence is expressed capital letter. conversion error occurs.
Important information.
Expressed in uppercase letters.
• When the ladder program is verified against the ladder program on the KV-1000,
disabled modules are not targeted in this verify.
Indicates that an undesirable
result or status can occur if
Prompt information Tip • The name and type of module can be changed at Module properties after a new module is
made. the relevant notice is ignored.
Information that needs further "Changing the Type of Module" (page 2-22)
Be sure to read carefully.
understanding, helpful 2-15

information once known.


* cining page components, and differs from an actual page.

- KV-5000/3000 Series User’s Manual - 13


2-1 Contact Instructions

KV-5000 LD Load Connected in parallel to NO contact.


Command and processing
KV-3000
LDB Load bar Connected in parallel to NC contact.
outline are as shown in the table.
KV-1000
AND AND Connected in series to NO contact.

ANB AND bar Connected in series to NC contact.

BASIC INSTRUCTIONS
OR OR Connected in parallel to NO contact.

ORB OR bar Connected in parallel to NC contact.

Ladder program Input mode Display the method to


S㩷 L D S A
X
S
S input from keyboard.
Display basic format of command 2 L D B S
B
L D I
S
S
L D N O T S
through ladder program.
Contact Instructions

A N I S
A N D N O T S
A N D S A S
S X S
L D S
A N B S B S
L D I S
L D N O T S
A N I S
A N D N O T S
L D B N O T S
O R S
O R B S O R I S
S **For B, “1” is filled in . O R N O T S

Display the device that Available Devices ( ): Only for KV-5000/3000 Index
Indirect Local Modific
Bit device Word device  Const specifying Device ation
may be set in the selected Operand
MR DM EM
R (DR) LR T C CTC CR FM (ZF) T C CTH CTC Z CM #/$ #TM * @ : #/: Z
operand. KV-5000/3000 ƻ
(B) TM (W)

S ƻ ƻ ƻ ƻ ƻ ƻ ƻ - - - - - ƻ - - ƻ *2 ƻ ƻ *2
KV-1000 -
For read method of this list, please Operand Explanation
Is outline description of
refer to KV-5000/3000/1000 Series S Specifies the bit to be connected to the left power rail.
*1 When word device is specified in S , state of the LSB is loaded. operand content.
Command Reference Manual "1-7 KV-5000/3000 Bit specifying of word device can be performed.
KV-1000 BLD/LBDB instruction can be used if state other than that of LSB is to be loaded.

Read Method and Precautions for *2 KV-5000/3000 Can not be used when bit specifying of word device is used in S .

Operand List ". Description of Operation


LD S is connected to the power rail as a NO contact.
ON/OFF state of S is transferred to the instructions after LD.
LDB S is connected to the power rail as a NC contact.
Is description concerning command The inverted ON/OFF state of S is transferred to the instructions after LD.
AND S is connected in series to the circuit block as a NO.
action (processing) content. ANB S is connected in series to the circuit block as a NC.
OR S is connected in parallel to the circuit block as a NO.
ORB S is connected in parallel to the circuit block as a NC.

2-2 - KV-5000/3000/1000 Series Reference Instruction Manual -

* This page was made for the purpose of explaining page components, and differs
from an actual page.

2-1 Contact Instructions


BASIC INSTRUCTIONS

Scan
ON
S
OFF

LD instruction ON
AND instruction
OR instruction OFF

LDB instruction ON
ANB instruction
ORB instruction OFF
2
TIP There is no restriction to the number of contacts that can be connected in parallel or in series.
Contact Instructions

Note
Parallel connection that includes a intruction other than contact instruction is not

Reference displays the information that allowed.

is useful after understood and grasped. Note


Describes cautions for easily
Instructions other than contact
mistaken operations.
Operation Flag Be sure to read these.
CR2009 No change in status
CR2010 No change in status
CR2011 No change in status To describe operation
CR2012
ON when the indirect specifying or index modification range is inappropriate or expansion I/O unit
is not real-time supported unit; Otherwise OFF. It will not change when indirect specifying or index
marking change action
modification is not specified for DR in the operand. when operation error
* The contact does not turn OFF when CR2012 is ON.
KV-5000/3000 When CR2012 is ON, error details is stored in CM5100 to CM5176.
occurs.
"A-3 CR/CM List", Page A-39 Indicates the page or manual to
Command action (processing) content Sample Program refer to. The page or manual
is described through example. Ƶ KV-5000/3000 containing the related
When 3 bits of either of input relays R000 and DM0 is ON (or both are ON) and R00001 are OFF, R500 of
output relay will be ON.
information is indicated here.
R000 DR001 R500 ;(mnemonics list)
LD R000
OR DM0.3
DMO.3 ANB DR001
OUT R500
Mnemonic symbol list.
After copy, paste to
Ƶ KV-5000/3000
KVSTUDIO, input ladder
When 0 bit of input relays R000 and DM0 is ON (or both are ON) and R001 is OFF, R500 will be ON.
R000 R001 R500 ;(mnemonics list)
program simply.
LD R000

DMO
OR DM0
ANB R001
"How to Use
OUT R500
Mnemonics List", Page 15
- KV-5000/3000/1000 Series Reference Instruction Manual - 2-3

* This page was made for the purpose of explaining page components, and differs from an actual page.

14 - KV-5000/3000 Series User’s Manual -


How to Use Mnemonics List

Mnemonics lists are describes in the corresponding pages of sample ladder programs.
Use this mnemonic symbol list to input ladder program simply.

1 User’ Manual can be opened by Adobe Reader.


Adobe Reader is included in KV STUDIO Ver.4 CD-ROM.

2 Mnemonics lists can be copied with "Select tool".

3 In ladder edit zone of KV STUDIO, click the cell to insert reference ladder program, select "edit
(e)"-> "list edit (l)" from the menu, pop up "list edit " dialog box.
Other procedure

· +
Paste the copied mnemonic symbol list into
popup " list edit " dialog box.
Paste operation, select " paste (P) " from right
click menu of " list edit " dialog box.

- KV-5000/3000 Series User’s Manual - 15


4 Click "insert(I)" button, the sample ladder program appears.

Terminology

This manual uses the following terminology excluding some instances.

Terminology Description
Is electronic equipment that could control equipment freely by changing program,
PLC
is alsocalled PLC (Programmable Logic Controller).
KV-5000/3000 Is programmable controller produced by our company.
CPU unit KV-5000/3000.
Refers to expansion I/O unit, special expansion unit other than KV-5000/3000
Expansion unit
series CPU unit.
Is a general term of expansion unit that may be connected with CPU unit KV-5000/
KV-5000/3000 series
3000.
KV STUDIO Is software that supports KV-5000/3000 series programming.
Ladder program Is program prepared by KV STUDIO.

16 - KV-5000/3000 Series User’s Manual -


1

HARDWARE
HARDWARE
This chapter describes system configuration, connection methods of KV-5000/
3000 series, and specification and application method of CPU unit, AC power
unit, expansion input/output unit, expansion unit, and error output unit, etc.

1-1 System Configuration ••••••••••••••••••••••••••••••••••••• 1-2


1-2 Unit Connection •••••••••••••••••••••••••••••••••••••••••••• 1-4
1-3 Unit Wiring••••••••••••••••••••••••••••••••••••••••••••••••••• 1-7
1-4 Unit Installation ••••••••••••••••••••••••••••••••••••••••••• 1-14
1-5 System General Specification ••••••••••••••••••••••••• 1-16
1-6 CPU Unit••••••••••••••••••••••••••••••••••••••••••••••••••• 1-20
1-7 AC Power Unit •••••••••••••••••••••••••••••••••••••••••••• 1-35
1-8 Expansion Input Unit •••••••••••••••••••••••••••••••••••• 1-38
1-9 Expansion Output Unit •••••••••••••••••••••••••••••••••• 1-45
1-10 Expansion unit •••••••••••••••••••••••••••••••••••••••••••• 1-52
1-11 Error output unit •••••••••••••••••••••••••••••••••••••••••• 1-56
1-12 Maintenance •••••••••••••••••••••••••••••••••••••••••••••• 1-58

- KV-5000/3000 Series User’s Manual - 1-1


1-1 System Configuration
HARDWARE

System Overview

System configuration of KV-5000/3000 is shown as follows.


1 Before connecting every unit, you must disconnect the power.
System Configuration

(1)
AC power unit
KV-U7
˄DC24V 1.8A˅
KV-U7

OC

OUTPUT
24VDC
1.8A
(2) (3) (4)
CPU unit
Error output unit Expansion unit End unit
N
INPUT KV-5000/3000
100-240V
AC
50/60Hz KV-DR1 (I/O, special) (attached to CPU unit)
L
0.98A

(16-input +8-output)
(1-point relay output)

or

Start unit
(attached to CPU unit)

SD memory card Expansion unit


KV-M256/128 KV-EB1SǂǂǂǂKV-EB1R

Cable
˄1m˅
˄OP-42142˅

Multimedia card
Cable
KV-M128C
˄2m˅
˄OP-42141˅

Ladder support software


KV STUDIO

PC
· IBM PC and PC/AT compatible

1-2 - KV-5000/3000 Series User’s Manual -


1-1 System Configuration

HARDWARE
(1) About Power

■ Use AC100 to AC100


When operating KV-5000/3000 series models via AC100 to 240V voltage, connect AC power unit "KV-U7" to
the most left side. 1 CPU unit can only connect 1 KV-U7. When using KV-U7, start unit will not be
1

System Configuration
connected.
"1-7 AC Power Unit"
■ Use DC24V
When operating KV-5000/3000 series models via DC24V voltage, AC power unit KV-U7 is not used, so
start unit shall be connected (when using error output unit, start unit + KV-DR1 will be used). DC24V is
supplied by DC power input terminal block of KV-5000/3000.
"1-6 CPU Unit"

(2) About Output Error Unit

When error output unit KV-DR1 is used, it should be connected to the the left side of KV-5000/3000. 1
CPU unit can only connect 1 KV-U7. However, error output unit is not the unit required for the operation
of KV-5000/3000 series.
"1-11 Error output unit"

(3) About CPU Unit

AC power unit and error output unit can be connected on the left side of CPU unit, expansion input/
output unit or expansion special unit can be connected on the right side. Terminal unit must be
connected on the right side if expansion unit is not connected.
"1-6 CPU Unit"
Ladder program device data can be read/written from/to SD memory card, and high-speed counter or
motor control functions, etc. based on internal I/O can be used.
"2 CPU INTERNAL FUNCTIONS"
KV-5000/3000 series can use module/macro/local device/KV script functions, etc., to further improve
programming efficiency.
"3 LADDER PROGRAMMING"
Script Programming Manual
KV STUDIO User Manual

(4) About Expansion Unit

Expansion input/output unit or expansion special unit must be connected to right side of CPU unit. Up to
16 expansion units can be connected to a single CPU Unit. If 2 expansion units are used, maximal 48
uints can be connected. (except some special expansion units)
Terminal unit must be connected on right side of the most right expansion unit.
"1-8 Expansion Input Unit", "1-9 Expansion Output Unit", "1-10 Expansion unit"
" User manual of every expansion special unit "

- KV-5000/3000 Series User’s Manual - 1-3


1-2 Unit Connection
HARDWARE

This section describes how to assemble each unit and how to mount it on to DIN rail.

Precautions on Connecting Unit

1 When connecting each unit, you must observe following points.


· Before connecting each unit, be sure to disconnect the power.
Unit Connection

· Start unit, power unit or error output unit must be connected on the right side of CPU unit.
· Be sure to connect the End Unit on the right of the last connected unit.

Start unit

Expansion unit
Max. 16 (48 when using the expansion unit)
KV-DR1 KV-5000/3000 End unit
Error output unit CPU unit

Or

KV-U7
Power unit
KV-U7

OC

OUTPUT
24VDC
1.8A

N
INPUT
100-240V
AC
50/60Hz
0.98A
L

Note
During shipment of KV-5000/3000 CPU unit, the battery is removed to prevent capacity
drop. Please connect battery before first use.
"1-6 CPU Unit"

■ Max. number of connected units


1 CPU unit can connect maximal 16 expansion units (power unit, error output unit; except start/erminal unit).
If 2 expansion units are used, then maximal 48 uints can be used.

"1-10 Expansion unit"

1-4 - KV-5000/3000 Series User’s Manual -


1-2 Unit Connection

HARDWARE
Unit Assembly

This is explained as follows through an example of assembling KV-5000/3000 CPU unit and KV-B16XC
expansion input unit.
1

Unit Connection
KV
-B1
6X
C

KV-5000/3000 KV-B16XC
(left) (right)

Note
Assembly must be conducted when the power of each unit is OFF .

1 Remove the locking bar at upper and lower side of


right unit.
· Insert finger into the notch, draw toward front of the
unit and remove it.

V V
24 24

2 Insert the locking bar of right unit into the slot for
locking bar at left unit, and connect.
· Hold two units and make them parallel, press down
once they are aligned to the connector, it's easy to
KV

do connection. -B1
6X
C

3 Lock the locking bar at upper and lower side of


right unit.
· Same as step 1, press down the notch by finger and KV
-B1
6X
C

push toward reverse direction of the unit. In this


case, you shall check whether there is any gap
between units. If there is any gap, then the
connection is not right.

- KV-5000/3000 Series User’s Manual - 1-5


1-2 Unit Connection
HARDWARE

Mounting Onto the DIN Rail

This section describes how to install/remove the connected unit to/from DIN rail.

1 ■ Installing Unit
Unit Connection

1 Hang the slot at upper side of DIN rail onto


the installing claws of DIN rail at upper side

LO
CK
of each unit.

Top fastener

DIN rail

2 Insert lower side of DIN rail into the


installing claws of DIN rail at lower side of

LO
each unit.

C
K
· The lower black claw can move under action
of spring. Press down until it "clicks".
· Where it is difficult to install, please first
remove all lock catches, and lock them after
installing onto DIN rail.

3 Check the installing claws of DIN rail at


lower side to be sure it is inserted (locked).
Locked Unlocked

■ When removing

1 Pull down the lower DIN rail installing claw.

Note
Do not pullout the claw of
backup battery.
unlocked

2 Remove DIN rail from the unit according to


the sequence reversed to installation.

1-6 - KV-5000/3000 Series User’s Manual -


1-3 Unit Wiring

HARDWARE
This chapter describes how to assemble connectors and how to wire units and internal circuits.

Precautions on Wiring Each unit

Precautions on wiring I/O units and expansion I/O units are described as follows. The contents of this 1
part must be read before wiring.

Unit Wiring
■ Precautions on I/O unit wiring
Please note the following points when wiring I/O units.
· Wire the input and output cables separately.
· I/O signal cables should be laid away from power cables. Otherwise, operation errors caused by high
voltage or current will occur. I/O signal cables should be laid at least 100mm away from power cables.
· DC 24V I/O cables should be laid separately with AC 100V and AC 200V power cables.
· Ensure that the cable conduits are grounded securely if they are used for wiring.

When it can not be laid separately from power line…


All wires can use shielded cable and can be grounded.
(According to different environment, grounding on the opposite side of PLC required sometimes)

PLC Shielded cable


Sensor etc.

Input

RL

Output

DC24V D-type grounding

Connecting wire of expansion unit must be separated from power cable.

■ Precautions on grounding
· Provide a D-type grounding individually for each of the devices. In addition, the grounding resistance
in this case should be lower than 100Ω.
· If a separate grounding is not possible, a common grounding point should be used. But in this case,
the cable length must be the same.

PLC Other PLC Other PLC Other


equipment equipment equipment

B
A B A

D-type ground A˙B A˚B


A˘B

- KV-5000/3000 Series User’s Manual - 1-7


1-3 Unit Wiring
HARDWARE

■ About contact protection


When clutch, motor, electromagtic coil or other inductive load are used, surge current will occur when power is applied to
the load, and inverting voltage will be generated when the load is turned off. Surge current and inverting voltage will
greatly reduce the life of the contact. To suppress this effect, a protection circuit should be arranged.
1 Example of contact protection circuit

AC load (1) DC load (1)


Unit Wiring

Contact

Contact
L L

Load CR circuit Load Diode


AC load (2) DC load (2)

a b
L L

Zener diode
Voltage-sensitive resistor
࡮Supply voltage When 24 to48V, please install to position b
ǂǂǂǂ When 100to200V, please install to position a

· The rating of the load coil should be lower than the capacity of the contact.
· The inverting withstand voltage of the diode should be at least 10 times that of the circuit voltage, and
forward current should be greater than the load current.
· Diode, non-linear resistance and CR circuit shall be directly installed to relay coil terminal.

■ Wiring to terminal block unit


Use Y-shaped terminals of the following size.
B
d2

Fitted size
B: 6mm below
Dimensions of Y terminal L
B: outside dimension of Y ferminal L: 13mm below
d1: diameter of the inserted terminal
d2: 3.2mm above
of wire
d2: Y inside (screw engaging part)
width
L: Total length d1

1-8 - KV-5000/3000 Series User’s Manual -


1-3 Unit Wiring

HARDWARE
Connector Assembly and Wiring

When connecting equipment on each unit, please connect the wire from each equipment on the
connector (femal) on the unit side.
1
■ Precautions on wiring (OP-22184/51404/23139/42224)

Unit Wiring
The following points must be noted before wiring:
· The following matching cable must be used:
Wire gauge : AWG24 to 22 (twistd wire)
Cross-section area: 0.2 to 0.3mm2
Sheath O.D.: Ø1.5 to Ø1.1
· Top of wire shall be cut off straight to make it flat.
· After wiring, make sure that wire has been clamped completely by the fixed part, and inserted inside.
· No burr shall be left at cutting on the cuting part of wire (it's not necessary to strip the sheath).
· AWG28 to 26 fine line contact OP-30594 is supplied.
(please use with OP-22184, OP-51404, OP- 23139 and OP-42224, etc.)
Wire gauge : AWG28 to 26
Cross-section area: 0.08 to 0.14mm2
Sheath O.D.: Ø1.3 to Ø1.1

Note The unit is made of synthetic resin. It may be dissolved after touching with strong
solvents such as acetone, trichloroethylene and gasoline, etc. Besides, it may be
damaged if too large force is applied in crimp connection. Be sure to take care.

Note
Please use OP- 42224 connector (34-pin) for 64 points unit.
Do not use OP-23139.

■ Special-purpose crimping tool (OP-21734)


When crimping wire, using special crimping tool can simplify the operation.
Please prepare the following special crimping tool in advance.

Note
If no special crimping tool is available, it is necessary to solder.

Name of each part


Special crimping tool: type OP-21734

Handle
Crimping plier
Body

Needle for pulling off contact


Guide Cover
Connector receive part

- KV-5000/3000 Series User’s Manual - 1-9


1-3 Unit Wiring
HARDWARE

■ About the Connector


Upper and lower covers are installed on
Cover
the connector. When wiring, firstly Remove
remove the upper and lower cover. screw

1
Unit Wiring

Shielded cover
Vertical cover Vertical cover
OP-23139(34-pin) OP-42224(34-pin)
OP-22184(40-pin) OP-51404(40-pin)

Connector terminal No.


Connector can be divided into two kinds according to unit type: 34 pins and 40 pins . Terminal No. is
shown as follows. During wiring operation, please check against "Wiring and Internal Circuit Diagrams
of Each unit".

34-pin connector: type: OP-23139, OP-42224


Hang up the clip
▼ Symbol Up

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
Below
40-pin connector: type:OP-22184ǃOP-51404
▼ Symbol Up

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
Below

1-10 - KV-5000/3000 Series User’s Manual -


1-3 Unit Wiring

HARDWARE
■ Connector wiring
The wiring method of using special crimping tool is introduced below. Contact, shield sleeve and wire
shall be prepared.

1 Break off it starting from the breakdown


position at clamp part of contact toward the
1
breaking-off direction of arrow.

Unit Wiring
Clamp part

Contact-break position

2 Insert contact into the contact stand of special crimping tool and contact directly (Fig. A).

3 Insert the wire straight to contact crimping slot (Fig. B).


Figure A Crimping pliers Figure B

Crimping groove

Cover
Wire
Guide

Contact
Power circuit program

Crimping
Handle pliers
Crimping groove
Cover
Body
Wire Guide
Needle for pulling off contact
Guide Cover
Connector receive part

4 Hold the handle of special crimping tool, until


the wire is clamped completely. The clamp part should
wrap the wires.

Insert the wire inside

5 Pull the wire lightly, take the contact of the


crimp connection wire out of special crimping
tool.

Wire

- KV-5000/3000 Series User’s Manual - 1-11


1-3 Unit Wiring

6
HARDWARE

Straight insert along the slot of shield sleeve


without contact.

Shielded cover

1
Unit Wiring

7 Install shield sleeve to contact, fit cover.


Mount screw firmly

Shielded cover
Close it here
8 Fix the wire with band as shown.

Belt

● When removing contact


Remove the contact from connector as follows.

1 Align the terminal to be removed with the When removing contact


arrow on box of special crimping tool.

2 Press the contact, and pull out the wire. Pull the wiring

Needle for pulling off contact

1-12 - KV-5000/3000 Series User’s Manual -


1-3 Unit Wiring

HARDWARE
Removing the Terminal Block

The followings describes how to remove the terminal block.

Note
Power must be disconnected before removal. 1

Unit Wiring
1 Open terminal block cover installed on the unit.

C
6X
-B1
KV
V
24

5V

2 Unscrew fixing bolt, remove terminal block.


· Black bolts are used to fix terminal board.

C
6X
-B1
KV
V
24

5V

3 Drag terminal board toward yourself and remove it.


· Please slightly drag towards yourself.

C
6X
-B1
KV
V
24

5V

- KV-5000/3000 Series User’s Manual - 1-13


1-4 Unit Installation
HARDWARE

This chapter describes important matters concerning unit installation environment and installation
position inside the panel.

Installing Environment
1
Don't install it in the following places:
Unit Installation

Location with direct Location with ambient Location with ambient humidity
sunshine temperature exceeding 0 to +50°C exceeding 10~95% RH

Location with dewing due to Location with corrosive gas Location with heavy dust,
sharp change in temperature and combustible gas salt, chip and oily smoke

Place that is directly under Place to which water, oil and Place with strong magnetic
vibration and shock drug is sprayed and electric field

Magnetic
Chemicals Electric field
Oil field

· The place where installation sea level height exceeds 2000m

Installation Position

■ Installation direction
During installation inside panel, the front panel and input/output connector of KV-5000/3000 CPU unit
must be frontward.

CK
LO
24V
2
4
V

5V
5
V

KV LO
-B CK
16
XA
KV
-C
32
XA
24
V

5V
LOCK

1-14 - KV-5000/3000 Series User’s Manual -


1-4 Unit Installation

HARDWARE
■ Distance from surroundings
During installation, 30mm above interval must be kept between equipment, inner wall and other
equipment.

30mm 1

Unit Installation
30mm
Unit Below
Allow 30mm of space so
that you can insert your
30mm finger and remove the lock
lever.

Left
Allow 30mm of space for heat dissipation.

Note
When temperature inside panel (temperature below the unit) exceeds ambient
temperature, adopt the methods such as forced air cooling, enlarging surrounding
gap or improving ventilation, etc. to reduce temperature.

- KV-5000/3000 Series User’s Manual - 1-15


1-5 System General Specification
HARDWARE

This section describes the specification of KV-5000/3000 series models and the operation during power
off.

General Specification
1
Item Specification
System General Specification

Supply voltage DC 24V (±10%)


Internal current consumption KV-5000 : < 320mA
(Except input circuit drive current) KV-3000 : < 320mA
Operating ambient temperature 0 to +50°C (no icing)*1*2
Storage ambient temperature -20 to +70°C*1
Operating relative humidity 10 to 95%RH(condensation not allowed)*1
1500V AC for 1 minute
Withstand voltage
Between power terminal and input/output terminal, batch external terminals and housing
1500 V peak-to-peak or more, pulse width 1µs, 50 ns (by noise simulator)
Noise immunity
Conforms to IEC standard (IEC61000-4-2/3/4/6)
Intermittent vibration Scan times
Frequency Acceleration half amplitude
Compatible 5 to 9Hz - 3.5mm 10 times
with JIS B 9 to 150Hz 9.8m/s2 - in X/Y/Z
Vibration resistance
3502/ Continuous vibration direction
IEC61131-2 Frequency Acceleration half amplitude respectively
5 to 9Hz - 1.75mm (100 minutes)
9 to 150Hz 4.9m/s2 -
Shock resistance Acceleration 150m/s2, application time 11ms, 2 times in X, Y, Z direction respectively
50MΩ or more
Insulation resistance (DC500V megger measurement between power terminal and input/output
terminal, all external terminals and case body)
Operating atmosphere less dust and corrosive gases
Elevation < 2,000m
Overvoltage category II (when using KV-U7)
Pollution degree 2
KV-5000: ca. 320g KV-3000: ca.300g
Weight
Start unit: 20g Start unit: 30g
*1 System guarantee range.
*2 Temperature below the unit inside control panel.

1-16 - KV-5000/3000 Series User’s Manual -


1-5 System General Specification

HARDWARE
Performance Specifications

Item Specification
Operation control method Program storage method
I/O control method Reresh mode 1
Program language Expansion Ladder KV script mnemonic

System General Specification


Basic instruction: 79 kinds 162 Application instruction: 39 kinds 56
The number of instructions Calculus instruction: 104 kinds 243 Expansion instruction
Total: 307 kinds 581
instruction Basic Instructions Min. 10ns
execution speed Application Instructions Min. 20ns
Program capacity KV-5000: about 260K steps KV-3000: about 160k steps
Maximal installation quantity of I/O unit 16 units (connect expansion unit: 48 units)
During expansion max. 3096 points (KV-EB1S/KV-EB1R: add 2
Maximal I/O points
units, when using 48 units 64-point unit)
Input relay R
Output relay R Total 16000 points 1 bit(R000 to R99915)
Internal auxiliary relay R
Link relay B 16384 points 1 bit (B0 to B3FFF)
Internal auxiliary relay MR 16000 points 1 bit (MR000 to MR99915)
Latch relay LR 16000 points 1 bit (LR000 to LR99915)
control relay CR 640 points 1 bit (CR000 to CR3915)
Timer T 4000 points 32 bits (T0 to T3999)
Counter C 4000 points 32 bits (C0 to C3999)
Data memory DM 65535 points 16 bits (DM0 to DM65534)
Extended data memory EM 65535 points 1 bit (EM0 to EM65534)
Current bank mode FM (FM0 to FM32767)×4 Bank
File register Consecutive 131072 points16 bits
ZF (ZF0 to ZF131071)
number mode
Link register W 16384 points 16 bits (W0 to W3FFF)
Temporary memory TM 512 points 16 bits (TM0 to TM511)
2 points 32 bits (CTH0 to CTH1) automatic reset counter*1
High-speed counter CTH
(Input response: 100kHz / single phase, 50kHz / phase difference) *2
(high-speed counter comparator) CTC 4 points 32 bits (2 points/ high-speed counter)
Index register Z 12 points 32 bits (Z01 to Z12)
Control memory CM 6000 points 16 bits (CM0 to CM5999)
Positioning pulse output 2 points (maximum output frequency 100kHz)
Input : 16 points, output: 8 points
CPU unit I/O Input common point : 7 points (000 to 009 : 1 point 010 to 015: 6 points)
Output common point : 1 point
KV-5000: about 96,000 (Ladder 260k step, no lable)
Comment / the Device Comment
KV-3000: about 30,000 (Ladder 260k step, no lable)
number of label
KV-5000: about 137,000 (Ladder 260k step, no lable)
save-store Label
KV-3000: about 44,000 (Ladder 60k step, no lable)
Program memory EEPROM can be rewritten for one hundred thousand times
Power off holding
Storage battery (lithium battery) 5 years (application environmental
function Device *3
temperature +25°C, power off holding status)
Self-diagnosis function CPU abnormal, RAM abnormal, others
*1 It can be also set to no automatic reset.
*2 Line driver input specification. For specification of open circuit input, please see "2-8 High-speed Counter", Page 2-87.
*3 Target device can be set via "CPU system setting" -> "Power off holding setting" of KV STUDIO.

- KV-5000/3000 Series User’s Manual - 1-17


1-5 System General Specification
HARDWARE

Operation During Power off

Battery voltage low


· After mains voltage is low, "KV-5 000/3000" will stop and set output to OFF.
1 Auto reset
· After mains voltage recovers, operation will be automatically restarted.
System General Specification

Instant power off detection


· When using KV-U7, DC power, even if instant power off below 10ms, 2ms occurs, the operation still
lasts.

1-18 - KV-5000/3000 Series User’s Manual -


1-5 System General Specification

HARDWARE
MEMO

System General Specification

- KV-5000/3000 Series User’s Manual - 1-19


1-6 CPU Unit
HARDWARE

Package Contents

The package contains the following items. Before using, make sure that the package contains
1 everything that it is supposed to contain.
Start End
CPU Unit

Unit CPU Unit Unit


(attached with CPU unit) KV-5000/3000 (attached with CPU unit)

Battery
(attached with CPU unit)

Instruction Manual

KEYENCE

KV-5000/3000
Instruction Manual

We hope package will be completed. In case of any error, damage, please contact the nearest
marketing department listed on back cover.

■ During first power connection


Please install storage battery to CPU unit during the first use.

1 Insert battery (battery case) into the lower part of the unit.

2 Fix with screws.


  Fastening torque: 0.2N·m(2kgf·cm)
˄1˅
˄2˅

1-20 - KV-5000/3000 Series User’s Manual -


1-6 CPU Unit

HARDWARE
Names and Functions of Parts

● KV-3000
Front side of CPU unit
(1) Input voltage toggle
switch (top of unit)
1

CPU Unit
(2) Access window

(3) I/O display part


(7) Memory card
access LED
(6) RUN-PROG
toggle switch (4) Setup key

(8) Memory card


insertion port (5) I/O connector
(9) SERIAL access LED

(10) USB access LED


(12) USB connector
(13) Lock used for memory
card slot cover

(11) Modular connector

Bottom of CPU unit

(18) Connector for connecting


the CPU function expansion
unit (side of bady, including
sealing parts).

(14) Connector for connecting


(16) Connector for connecting the expansion unit (side
the CPU function expansion of unit)
unit (side of unit, including
sealing parts).
(17) Backup battery

(15) DC power input terminal block *(MAX3.5A)

* Left side is +24VDC terminal and right is 0V terminal.

- KV-5000/3000 Series User’s Manual - 1-21


1-6 CPU Unit
HARDWARE

● KV-5000
Common
ľࡔ ࡝ࠞ to KV-3000
࠼ except (9) to (12).
ǂᤓܹষ Ļܹߎ࡯ࠦࡀࠢ࠲
(10) USB access LED (9) Ethernet access
LED
1 (11) RJ-45 (Ethernet)
(12) USB connector
CPU Unit

connector

No. Name Function


Switch input voltage. (R000 to R009)
(1) Input voltage selector switch
5V <=> 24V
Set unit monitor display.
(2) Access window
Backlight is used to display operating status. RUN: green; PROG: red
Display I/O status of unit channel when pressing direct access switch.
(3) I/O display During CPU status display, column A indicates input R000 to R015;
Column B indicates output R500 to R507.
(4) Setup key Used for operation of the access window.
(5) I/O connector I/O connector (40-pin)*.
(6) RUN-PROG selector switch Switch between RUN mode and PROG mode.
(7) Memory card access LED The lamp lits when accessing memory card.
(8) Memory card slot Memory card insertion slot.
KV-5000 Ethernet Link indicates link status of other party's machine.
Operation LED Green lamp on: link established in Ethernet mode
Red lamp on: link established in FL-net mode
Orange lamp on: add FL - net in FL-net mode
Lamp off: link disconnected
(9)
ACT displays data sending/receiving status.
Lamp lits: sending data
Lamp off: data not sent
KV-3000 SERIAL The lamp lits during serial communication.
Operation LED RD: red during data receiving; SD: green during data sending
(10) USB access LED The lamp lits when USB cable is used in data sending/receiving.
KV-5000 RJ-45 connector Network connector cable connector (RJ-45 modular connector)
(11) (10BASE-T/100BASE-TX).
KV-3000 Modular connector For connecting modular plug. It is used for PC connection, etc.
(12) USB Connector For connecting with USB interface.
Memory card insertion slot cover Slide upward to remove latch and open slot cover of memory card.
(13)
latch Cover VTS files
(14) Expansion unit Connector for connecting the of expansion unit.
(15) DC power input terminal block Terminal block for 24 VDC mains input. MAX3.5A
(16) KV-U7 connector KV-U7 (power unit), KV- DR1 (error output unit) connector.
(17) Backup battery OP-51604 (with CPU unit)
CPU function expansion unit
(18) KV-DR1 (error output unit) connector.
connector
* conform to MIL-C-83503

1-22 - KV-5000/3000 Series User’s Manual -


1-6 CPU Unit

HARDWARE
Note
· Communication may interrupt due to noise influence and unstable USB communication
status. In this case, please pull out USB cable and then plug again.
· Under extremely unstable communication status (quite severe environment noise), to
protect PC, please wrap ferrite on cable.
1

CPU Unit
Note Do not connect USB cable to serial port, Ethernet port. (may lead to damage)

- KV-5000/3000 Series User’s Manual - 1-23


1-6 CPU Unit
HARDWARE

Specification

■ Input specification

1 ● R000 to R009 (Common input 10 point)


Item DC 24 V input mode*1 DC 5 V input mode*1
CPU Unit

Max. input voltage DC 26.4 V


Rated input voltage DC 24 V(3.5 mA*2) DC 5 V(1 mA*2)
Min. ON voltage DC 19 V DC 4.5 V
Max. OFF current 1.5mA -
Max. OFF voltage - DC 1.5 V
Common point mode 10 point/1 common (2 terminals)
Normal: 10 ms
Input time constant When using HSP command: 10µs
CR2305 ON: 10µs to 10ms, 8 level conversion (CM1620 setting)
"I/O Wiring Diagram", Page 1-32
*1 Use input voltage Selector Switch for switching. Please see "Names and Functions of Parts", Page 1-21 .
*2 It is reference value of input current.

● R010 to R013 (high speed A-phase/B-phase input, 2 channels, total 4 points)


Item line drivern input DC 5 V input (open collector) DC 24 V input (open collector)
Terminal No. 8,11,28,31 7,10,27,30
Max. input voltage DC 5.5 V DC 26.4 V
Rated input voltage - DC 5 V(20mA*1) DC 24 V(6.5mA*1)
Min. ON voltage DC 2.0 V DC 19 V
Max. OFF current - 1.5mA
Max. OFF voltage DC 1.0 V -
Common point mode Separate common point
Normal:10ms
Input time constant When using HSP command: 10µs
CR2305 ON: 10µs to 10ms, 8 level conversion (CM1620 setting)
100 kHz
Input signal : line driver 60kHz 60kHz
Response frequency
AM26LS31 or equivalent 5V±10%, Duty cycle 50% 24V±10%, Duty cycle 50%
Duty cycle 50%
"I/O Wiring Diagram", Page 1-32
It is reference value of input current.

1-24 - KV-5000/3000 Series User’s Manual -


1-6 CPU Unit

HARDWARE
Input wave (high speed A-phase/B-phase input)
· line drivern input
  Single phase, 100kHz, Duty cycle 50% Phase difference 50kHz, Duty cycle 50%
       *Time between start (end) points of A-phase/B-phase shall be above 2.5µs.

ON
20.0μs above
1
10.0μs above

CPU Unit
A phase 50%
5.0μs above 5.0μs above
OFF
ON ON

50% B phase 50%

OFF OFF

T1 T2 T3 T4
T1ǃT2ǃT3ǃT4 : 2.5μs above

* please note whether above waveform can be satisfied in case of larger impedance of connecting wire.

· Open collector output type, 24V;


  Single phase, 60kHz, Duty cycle 50% Phase difference 30kHz, Duty cycle 50%
   * rising edge / falling edge pulse width shall be below 3.0µs * Time between start (end) points of A-phase/B-phase shall be above 4µs.

33.3μs above

16.6μs above ON

A phase 50%
8.3μs above 8.3μs above
OFF
ON ON

50% B phase 50%

OFF OFF
3μs below 3μs below T1 T2 T3 T4

T1ǃT2ǃT3ǃT4 : 4.0μs above

* please note whether above waveform can be satisfied in case of larger impedance of connecting wire.

● R014 to R015 (high speed Z-phase 2 channels, total 2 points)


Item line drivern input DC 5 V input (open collector) DC 24 V input (open collector)
Connecting
14,34 13,33
terminal No.
Max. input voltage DC 5.5 V DC 26.4 V
Rated input voltage - DC 5 V (8.3 mA*1) DC 24 V (3.5 mA*1)
Min. ON voltage DC 2.0 V DC 19 V
Max. OFF current - 1.5mA
Max. OFF voltage DC 1.0 V -
Common point mode Separate common point
Normal: 10 ms
Input time constant When using HSP instruction: 10µs
CR2305 ON: 10µs to 10ms 8 level conversion (CM1620 setting)
"I/O Wiring Diagram", Page 1-32
It is reference value of input current.

- KV-5000/3000 Series User’s Manual - 1-25


1-6 CPU Unit
HARDWARE

Output waveform (high speed output)


· line drivern input:
   * ON pulse width, OFF pulse shall be above 30.0µs

30.0μs above 30.0μs above

1 ON

50%
CPU Unit

OFF

· Open collector output (24V/5V);


   * ON pulse width, OFF pulse shall be above 30.0µs

30.0μs above 30.0μs above

ON

50%

OFF

● Input derating
Continuous and simultaneous ON rate (%)

40ć 45ć
100

80

60
50%
26.4Vinput
40 40%
24Vinput

20

0
0 10 20 30 40 50
Ambient temperature (ć)

1-26 - KV-5000/3000 Series User’s Manual -


1-6 CPU Unit

HARDWARE
■ Output specification
● R500 to R503 (High speed output, 4 points)
Item Specification
Output mode Transistor NPN output
Rated load DC 30 V, 0.1A 1
Peak load current 0.2A

CPU Unit
Max. OFF voltage DC 30 V
Leak current at OFF 100µA
Residual current at ON DC 0.6 V below
Common point mode 8 point/1 common point
OFF -> ON : or less 1µs
ON/OFF response time
ON -> OFF : or less 5µs
Output frequency 100kHz (5 to 100mA)
"I/O Wiring Diagram", Page 1-32

Output waveform (high speed output)


 Output frequency 100kHz ( load current at Duty cycle 50% setting: 5 to 100mA)
2.0μs above 4.0μs above

OFF90%

10%
ON

The load of above output waveform is resisive load, not considering of the influence of connecting wire.
Please note, in case of larger impedance of connecting wire, ON/ OFF pulse width will be less than above value
sometimes.

● R504 to R507 (Common output, 4 points)


Item Specification
Output mode Transistor NPN output
Rated load DC 30 V, 0.1A
Peak load current 0.2A
Max. OFF voltage DC 30 V
Leak current at OFF 100 µA
Residual current at ON DC 0.6 V or less
Common point mode 8 point/1 common point
OFF -> ON : or less 5µs
ON/OFF response time
ON -> OFF : or less 30µs
Output frequency 10kHz (5 to 100mA)
"I/O Wiring Diagram", Page 1-32

■ +5V output power


Connecting terminal No.: 20
Name : S+5V
Insulated DC 5V service power. Used when connecting to equipment with 5V interface, such us motor
drive.

Item Specification
Voltage DC 5 V
Current Max. 100mA
"Reference Example of Positioning Control", Page 2-199
- KV-5000/3000 Series User’s Manual - 1-27
1-6 CPU Unit
HARDWARE

RUN-PROG Selector Switch

There are two modes for KV-5000/3000 CPU unit: RUN mode and
PROG mode.
1 Mode can be selected through the RUN-PROG Selector Switch shown
on the right.
CPU Unit

RUN mode : run program.


PROG mode : stop program,
all outputs OFF.

Note
In case of severe error, even if the switch is in RUN
position, it will be switched to PROG mode.

Tip When the switch is in RUN position, you can switch between PROG mode and RUN mode
via KV STUDIO.

Wiring and Internal Circuit Diagram

■ KV-3000
Serial( RS-232C) communication can be realized via peripheral equipment such as modular connector,
PC or touch panel, etc.
"2-5 Serial Communication(only KV-3000)", Page 2-74
Connector terminal No.
1 21
2 22
3 23
4 24
5 25
6 26
7 27
8 28
9 29
10 30
11 31
Modular connector I/O connector 12 32
13 33
14 34
15 35
16 36
17 37
18 38
19 39
20 40
1 2 3 4 5 6

"I/O connector wiring diagram", Page 1-30

Terminal No. Direction Signal name


1 - +5V output power
2 - +5V output power
3 Input RD
4 - SG
5 Output SD
6 - GND
** SG and GND are wired internally.

1-28 - KV-5000/3000 Series User’s Manual -


1-6 CPU Unit

HARDWARE
■ KV-5000
Ethernet communication can be realized via external equipment such as RJ-45 connector and PC or
touch panel, etc. Besides, FL-net communication can be also realized.
"2-6 Ethernet/FL-net Communication(only KV-5000)", Page 2-82

Connector terminal No.


1 21
1
2 22

CPU Unit
3 23
4 24
5 25
6 26
7 27
8 28
9 29
10 30
11 31
RJ-45˄Ethernet˅ I/O connector 12 32
connector 13 33
1 14 34
2 15 35
3 16 36
4 17 37
18 38
5 19 39
6 20 40
7
8
"I/O connector wiring diagram", Page 1-30

Pin No. MDI signal Signal function


1 TD+ Send data(+)
2 TD- Send data(-)
3 RD+ Receive data(+)
4 - -
5 - -
6 RD Receive data(-)
7 - -
8 - -

- KV-5000/3000 Series User’s Manual - 1-29


1-6 CPU Unit
HARDWARE

■ I/O connector wiring diagram


Term Support line Signal name
Directi
inal Type drivern Relay
on Abort High-speed counter Positioning
No. input
1 Input Common - R000 Interupt - Stop sensor input
1 2 Input Common - R002 Interupt - Origin sensor input

3 Input Common - R004 Interupt - X axis limit switch CW


CPU Unit

4 Input Common - R006 Interupt - X axis limit switch CCW DC24V/5V


5 Input Common - R008 Interupt High-speed counter 0 enable input -
6 *5
Input - - COM0 Input common point (R000 to R009)
7 A(+24V) -
High speed High-speed counter 0

Please refer to Page 1-31


8 Input ○ R010 - A(+5V) -
A phase A phase
9 A(-COM)*1 -
10 B(+24V) -
High speed High-speed counter 0
11 Input ○ R012 - B(+5V) -
B phase B phase
12 B(-COM)*1 -
13 Z(+24V)
High speed High-speed counter 0,
14 Input ○ R014 - Z(+5V) X axis, Z phase
Z phase Z phase (Preset)
15 Z(-COM)*1
16 Output High speed - R500 - High-speed counter 0 comparator matching output X axis CW
17 Output High speed - R502 - - Y axis CW
18 Output Common - R504 - (High-speed counter 0 comparator matching output)*2 -
19 Output Common - R506 - - X axis clear deviation counter
20 - - - S+5V +5V output power
21 Input Common - R001 Interupt - Stop sensor input
22 Input Common - R003 Interupt - Origin sensor input

23 Input Common - R005 Interupt - Y axis limit switch CW


24 Input Common - R007 Interupt - Y axis limit switch CCW
25 Input Common - R009 Interupt High-speed counter 1 enable input -
26 *5
Input - - COM0 Input common point (R000 to R009)
27 A(+24V) -
High speed High-speed counter 1
Please refer to page 1-31

28 Input ○ R011 - A(+5V) -


A phase A phase
29 A(-COM)*1 -
30 B(+24V) -
High speed High-speed counter 1
31 Input ○ R013 - B(+5V) -
B phase B phase
32 B(-COM)*1 -
33 Z(+24V)
High speed High-speed counter 1,
34 Input ○ R015 - Z(+5V) Y axis, Z phase
Z phase Z phase (Preset)
35 Z(-COM)*1
36 Output High speed - R501 - High-speed counter 1 comparator matching output X axis CCW
37 Output High speed - R503 - - Y axis CCW
38 Output Common - R505 - (High-speed counter 1 comparator matching output)*3 -
39 Output Common - R507 - - Y axis clear deviation counter
40 Output - - COM1 Input common point (R500toR5079) *4
* 1 A (-COM), B (-COM), Z (-COM) terminals are separate.
Load power supply
*2 When setting R500 output (CR2505 to OFF output to R500 ; when setting it to ON , output to R504)
*3 When setting R501 output (CR2505 to OFF output to R501 ; when setting it to ON , output to R505)
*4 +5V (S + 5V) GND is connected internally.
*5 Terminal No. 6 (COM0) , terminal No. 26 (COM0) is shorted internally.

1-30 - KV-5000/3000 Series User’s Manual -


1-6 CPU Unit

HARDWARE
Open collector connection (A phase)
Terminal No. Signal name
7,27 A(+24V)
8,28 A(+5V)
9,29 A(-COM)

Differential line driver (A phase)


1

CPU Unit
Terminal No. Signal name
7,27 A(+24V)
8,28 A(+5V)
9,29 A(-COM)

B phase and Z phase are same.

Note
· When using A (+24v) terminal, ensure open circuit of A (+5V) terminal.
Similarly, when using A (+5V) terminal, ensure open circuit of A (+24V) terminal.
So are B phase and Z phase.
· Please note, if connecting wire of input terminal is longer and naked, it will become noise-
initiating antennae, and error input may appear.

- KV-5000/3000 Series User’s Manual - 1-31


1-6 CPU Unit
HARDWARE

■ I/O Wiring Diagram


Input circuit (R000 to R009)

Photocoupler-isolation
R000̚R009

1 IN

Internal circuit
4.3kΩ
5Vǃ24V
CPU Unit

Switch circuit

COM0

Input circuit (R010 to R013)

3.3kΩ
A(+24V˅/B(+24V) Photocoupler-isolation
100Ω

Internal circuit
A(+5V˅/B(+5V)

1.3kΩ

A-COM/B-COM
110Ω

Input circuit (R014 to R015)

6.2kΩ
Z(+24V˅ Photocoupler-isolation
1.2kΩ
Z(+5V˅ Internal circuit

1kΩ

Z(-COM)

Output circuit (R500 to R503)

Insulated power +5V power output (S+5V)


+5V
R500to R503
Internal circuit

COM1

Output circuit (R504 to R507)

Insulated power +5V power output (S+5V)


+5V
Internal circuit

R504 to R507
L

COM1

1-32 - KV-5000/3000 Series User’s Manual -


1-6 CPU Unit

HARDWARE
■ Peripheral equipment input wiring example
● Input R010 to R013
Example1 Peripheral equipment belongs to open collector output

Counter input A,B ˇ24V Shielded twisted wire


24V*
1
Internal circuit

ˇ5V

CPU Unit
External equipment

-COM A/B phase

Example2 Peripheral equipment belongs to line driver output

Counter input A,B ˇ24V Shielded twisted wire


Internal circuit

External equipment
ˇ5V ˇ

-COM ˉ

● Input R014 to R015


Example3 Peripheral equipment belongs to open collector output

ˇ24V Shielded twisted wire


24V*
Counter input Z
ˇ5V
Internal circuit

External
equipment

-COM Z phase

Example4 Peripheral equipment belongs to line driver output

ˇ24V Shielded twisted wire


Counter input Z ˇ
Internal circuit

ˇ5V
External
equipment
-COM ˉ

Note · When connecting, do not mislead the polarity of load power on output side. If
polarity is reversed, equipment damage may result.
· Input waveform may distort in case of overlong cable. Please note during wiring.

- KV-5000/3000 Series User’s Manual - 1-33


1-6 CPU Unit
HARDWARE

Outline Dimensions

■ CPU Unit

1 Front view Side view


85
CPU Unit

27.3

90 35.9

80
3.5 84
72
96.5
(130)
12.1
Bottom view

12.6

12
Unit: [mm]

■ Start unit/End unit


Start unit End unit

90 90

8 9 8 80 Unit: [mm]

1-34 - KV-5000/3000 Series User’s Manual -


1-7 AC Power Unit KV-U7

HARDWARE
This sections describes name, function and technical specification of each part of KV-U7 AC power unit.

Name and Function of Each Part

Front of power unit Side of power unit


1

AC Power Unit
(6) Lock lever

KV-U7
(1) Output lever
LED OC

(2) Terminal block


cover

OUTPUT
(3) DC24V output 24VDC
1.8A

(4) PE terminal

N
INPUT

(5) Power input 100-240V


AC
50/60Hz

terminal L
0.98A

ǂAC100V to 240V

(6) Lock lever


(7) KV-5000/3000, KV-DR1, KV-EB1R connector

No. Name Function


LED lamp color
LED No.1 Green during voltage output
LED No.2 Green when output current is more than 30%
LED No.3 Green when output current is more than 50%
LED No.4 Green when output current is more than 60%
LED No.5 Yellow for output current more than 70%
(1) Output bar LED
LED No.6 It is read when overcurrent is detected

LED No. 1 2 3 4 5 6

OC
When LED No.5 yellow lamp lits, the power capacity is not sufficient,
please use other power.
(2) Terminal block cover Cover
Operation power shall use 24 VDC output terminal. Including ( M4
(3) 24 VDC output
screw) main power, total 1.8A.
Protective earthing terminal connected onto protective earthing
(4) PE terminal
conductor of buildings, etc. (M4 screw)
(5) Power input terminal Connect to AC100-AC100 (50 / 60Hz) power. (M4 screw)
(6) Lock lever Locks the connection of the unit.
KV-5000/3000, KV-DR1,
(7) KV-5000/3000, KV-DR1, KV-EB1R connector.
EB1R connector
- KV-5000/3000 Series User’s Manual - 1-35
1-7 AC Power Unit
HARDWARE

Note · When overcurrent (LED No.6 red lamp lits) occurs, please temporarily disconnect
power, eliminate the fault reason.
· In case of overvoltage, output stops (output display lamp off).
1 Please disconnect power for more than 30 seconds, and then turn on the power again.
· When using KV-U7, do not supply power from the power terminal of KV-5000/
AC Power Unit

3000

Note
· KV-U7 must be connected to the left side of KV-5000/3000 (CPU unit), KV-DR1 (error
output unit), KV-EB1R (expansion unit). Besides, when using KV-U7 24V will not be
output from power terminal of KV-5000/3000.
· When using KV-U7, to prevent poor start due to inrush current of the unit, please control
the total current consumption of the unit below 70% of KV-U7 output capacity (LED No.4
green light lits, about 1.3A).

Specification

Item Specification
Input power voltage AC 100 to 240V±10%(50/60Hz)
Output voltage DC 24V±10%
Output capacity 1.8A (total for power of all units and operation power)
Power consumption < 135 VA
Dwell time < 10ms
Start-up time Max. 2s

1-36 - KV-5000/3000 Series User’s Manual -


1-7 AC Power Unit

HARDWARE
How to Wire

KV-U7 AC power unit shall be wired as follows.

KV-U7 1
KV-U7

AC Power Unit
OC

OUTPUT
24VDC
1.8A

N
Other external INPUT
100-240V
AC

equipment (sensor ect.) L


50/60Hz
0.98A

D-type ground

AC100to 240V
±10%

Insulated transformer/noise filter etc.

Note
· To reduce line noise, please connect 1:1 insulated transformer and noise filter.
· To reduce induction influence, please twist the cable.
· When connecting power unit, be sure to supply protective grounding.

Outline Dimensions
2.8

KV-U7

OC 27.3

OUTPUT
24VDC
1.8A

90 35.9

N
INPUT
100-240V
AC
50/60Hz
0.98A
L

3.5 80
35 5.2 93.2 Unit: [mm]

- KV-5000/3000 Series User’s Manual - 1-37


1-8 Expansion Input Unit KV-B16XC/C32XC/C64XC
HARDWARE

This chapter describes name, function and technical specification of every part of KV-B16XC/C32XC/
C64XC expansion input unit.

Name and Function of Each Part


1 KV-B16XC KV-C32XC KV-C64XC
Expansion Input Unit

(Front) (Front) (Front) (Side)


(3) Direct access switch (5) Lock lever

24V 24V
5V 5V
L H

(4) Input terminal block (1) Input voltage toggle switch (2) Input connector (5) Lock lever

No. Name Function


(1) Input voltage selector switch Toggle input voltage. 5V <=> 24V
(2) Input connector Input connector.
After setting it to ON, you can monitor status of expansion unit via CPU
access window. In addition, you can also know the status of the expansion
unit through the color of the switch.
Lit (green) : Normal operation (with some exceptions*1)
(3) Direct access switch
Green LED blinking: when a unit is selected while the green LED is lit and
the switch is turned on.
Red LED lit: When a unit error has occurred (with some exceptions*2)
Red lamp off: when turning ON switch and selecting unit under red lamp on status
(4) Input terminal block Input terminal block. Can be removed. (M3 screws)
(5) Lock lever Locks the connection of the unit.
*1 This LED lights (green) in the following instances even if operation is not normal.
(1) When the number of connected units differs from the unit information on the CPU Unit when the
power is turned ON.
(2) When the model type connected differs from the unit information on the CPU Unit when the power is turned ON.
In this case, an error will be displayed in the access window.
*2 Red light will be ON in the following instance even if the unit is not in error state:
(1) When the power is turned on, and the CPU unit information becomes the configuration with one CPU.
In this case, an error will be displayed in the access window.
* KV-C32XC/C64XC 34-pin connector is supplied as an option.

Tip Direct processing can be realized. Although KV-B16XA/C32XA/C64XA/C64XB can be also


used, direct processing can not be realized.
"About Direct Processing", Page 3-16

1-38 - KV-5000/3000 Series User’s Manual -


1-8 Expansion Input Unit

HARDWARE
Specification

KV-B16XC KV-C32XC KV-C64XC


Model
(16 point) (32 point) (64 point)
External connection
Removable terminal block Connector (MIL standard)*1 Connector (MIL standard)*1
1
mode

Expansion Input Unit


Input terminal DC 24 V mode DC 5 V mode DC 24 V mode DC 5 V mode DC 24 V mode*4
Max. input voltage DC 26.4 V
DC 24 V, DC 24 V,
Rated input voltage DC 5 V,1mA DC 5 V,1mA DC 24 V , 4.1mA
5.3mA 5.3mA
Min. ON voltage 19V 3.5V 19V 3.5V 19V
Max. OFF current 1.5mA - - 1.5mA 1.5mA
Max. OFF voltage - 1.5V - 1.5V -
Common point mode 16 point/1 common (2 terminals)*2 32 point/1 common (2 terminals)*2 32point/1 common (2 terminals)×2*3

Constant setting OFF->ON ON->OFF


during input TYP MAX TYP MAX
Input time constant 25µsec 25µs 65µs 75µs 120µs
(4 level conversion) 300µs 275µs 365µs 275µs 420µs
1ms 1ms 1.2ms 1ms 1.2ms
10ms 10ms 12ms 10ms 12ms

Input impedance 4.3kΩ 5.6kΩ


Internal current 25mA or less
15mA or less
consumption
Weight approx. 120g approx. 110g approx. 140g
* 1 Conform to MIL-C-83503 standard
* 2 2 COMs for KV-C32XC and KV-B16XC, connected internally.
* 3 4 COMs for KV-C64XC, internal H side( 2 points), L side( 2 points), connected internally.
"KV-B16XC internal circuit diagram", Page 1-40 "KV-C32XC internal circuit diagram", Page 1-41
"KV-C64XC internal circuit diagram", Page 1-42
*4 All terminals support 2-wire connection (but 2-wire non-contact sensor EV series not supported)

Note · If the number of inputs in ON status exceeds the specified range, the unit may fail.
· Relationship between continuous simultaneous ON rate and ambient temperation
of the KV-C32XC 2-wire terminal and KV-C64XC 2-wire terminal is shown as
follows.
KV-C32XCǂDerating factor KV-C64XCǂDerating factor
Continuous and simultaneous ON rate (%)

Continuous and simultaneous ON rate (%)

120 120
20ć 33ć 25ć 35ć 48?
100 100

80 80
70ˁ
60 60ˁ 60
50ˁ
26.4V Input 26.4V Input
40 40 40ˁ
24V Input 24V Input

20 20

0 0
0 10 20 30 40 50 0 10 20 30 40 50
Ambient temperature ć) Ambient temperature (ć)

- KV-5000/3000 Series User’s Manual - 1-39


1-8 Expansion Input Unit
HARDWARE

Wiring and Internal Circuit Diagram

KV-B16XC Wiring diagram KV-B16XC internal circuit diagram

1 Terminal No.
Expansion Input Unit

1 000̚015 4.3kΩ

Internal circuit
0
3 IN
2 5V. 24V
5
4 Switch circuit
7 COM0
6 Photocoupler-isolation
C0
8 COM1
9 Input supply
10
11
12
13
14
15
C1

Terminal No. Direction Signal name


0 Input 000
1 Input 001
2 Input 002
3 Input 003
4 Input 004
5 Input 005
6 Input 006
7 Input 007
C0 Input COM0
8 Input 008
9 Input 009 DC24V/5V
10 Input 010
11 Input 011
12 Input 012
13 Input 013
14 Input 014
15 Input 015
C1 Input COM1

DC24V/5V
* COM circuit-shorted internally

1-40 - KV-5000/3000 Series User’s Manual -


1-8 Expansion Input Unit

HARDWARE
KV-C32X Wiring diagram KV-C32XC internal circuit diagram

Connector pin No.

1 18
2 19
3 20
000̚015
100̚115 4.3kΩ 1
4 21

Internal circuit
IN

Expansion Input Unit


5 22 5V. 24V
Switch circuit
6 23 COM0
7 24 Photocoupler-isolation
8 25 COM1
Input supply
9 26
10 27
11 28
12 29
13 30
14 31
15 32
16 33
17 34

Pin No. Direction Signal name Pin No. Direction Signal name
1 Input 000 18 Input 100
2 Input 001 19 Input 101
3 Input 002 20 Input 102
4 Input 003 21 Input 103
5 Input 004 22 Input 104
6 Input 005 23 Input 105
7 Input 006 24 Input 106
8 Input 007 25 Input 107
9 Input 008 26 Input 108
10 Input 009 27 Input 109
11 Input 010 28 Input 110
12 Input 011 29 Input 111
13 Input 012 30 Input 112
14 Input 013 31 Input 113
15 Input 014 32 Input 114
16 Input 015 33 Input 115
17 Input COM0 34 Input COM1

DC24V/5V DC24V/5V

* COM circuit-shorted internally

Note Input continuous and simultaneous ON rate should not exceed the range of
technical specification. Otherwise, equipment damage may result.

- KV-5000/3000 Series User’s Manual - 1-41


1-8 Expansion Input Unit
HARDWARE

KV-C64XC Wiring diagram


L side H side
connector pin No. connector pin No.
1 18 1 18
2 19 2 19

1 3 20
4 21
3 20
4 21
Expansion Input Unit

5 22 5 22
6 23 6 23
7 24 7 24
8 25 8 25
9 26 9 26
10 27 10 27
11 28 11 28
12 29 12 29
13 30 13 30
14 31 14 31
15 32 15 32
16 33 16 33
17 34 17 34

Pin Pin Pin Pin


Signal name Signal name Signal name Signal name
No. No. No. No.
1 000 100 18 1 200 300 18
2 001 101 19 2 201 301 19
3 002 102 20 3 202 302 20
4 003 103 21 4 203 303 21
5 004 104 22 5 204 304 22
6 005 105 23 6 205 305 23
7 006 106 24 7 206 306 24
8 007 107 25 8 207 307 25
9 008 108 26 9 208 308 26
10 009 109 27 10 209 309 27
11 010 110 28 11 210 310 28
12 011 111 29 12 211 311 29
13 012 112 30 13 212 312 30
14 013 113 31 14 213 313 31
15 014 114 32 15 214 314 32
16 015 115 33 16 215 315 33
17 COM0 COM1 34 17 COM2 COM3 34

DC24V DC24V

* COM0, COM1 circuit-shorted internally.


ǂCOM2, COM3 circuit-shorted internally.
ǂ(COM0, 1)-(COM2, 3) not circuit-shorted internally.

KV-C64XC internal circuit diagram


000̚015
100̚115
200̚215
300̚315 5.6kΩ
Internal circuit

IN

470Ω
COM0̚3

Photocoupler-isolation

Input supply

1-42 - KV-5000/3000 Series User’s Manual -


1-8 Expansion Input Unit

HARDWARE
Note Input continuous and simultaneous ON rate shoud not exceed the range of technical
specification. Otherwise, equipment damage may result.

Expansion Input Unit


Note
Please use OP- 42224 connector (34-pin) for 64-point unit.
Do not use OP-23139.

- KV-5000/3000 Series User’s Manual - 1-43


1-8 Expansion Input Unit
HARDWARE

Outline Dimensions

KV-B16XC
2.8

1
Expansion Input Unit

27.3

90 35.9

3.5 80
9 29 3 96.5) Unit: [mm]

KV-C32XC
2.8

27.3

90 35.9

3.5 80
9 23 3 96.3
(125) Unit: [mm]

KV-C64XC

2.8

27.3

90 35.9

3.5 80
9 29 3 96.3
(125) Unit: [mm]

1-44 - KV-5000/3000 Series User’s Manual -


1-9 Expansion Output Unit KV-B16RC/B16TC(P)/C32TC(P)/C64TC(P)

HARDWARE
This section describes name, function and specification of each part of KV-B16RC/B16TC(P)/
C32TC(P)/C64TC(P) expansion output unit.

Names and Functions of Each Part

KV-B16RC/B16TC(P) KV-C32TC(P) KV-C64TC(P)


1
(Front) (Front) (Front) (Side)

Expansion Output Unit


(2) Direct access switch (4) Lock lever

(3) Output terminal block (1) Output connector (4) Lock lever

No. Name Function


(1) Output connector Output connector.
After setting the switch to ON, you can monitor the status of expansion unit
through the CPU Acess Window. In addition, you can also know the status
of the expansion unit through the color of the switch.
Lit (green) : Normal operation (with some exceptions*1)
(2) Direct access switch Green LED blinking: when a unit is selected while the green LED is lit and
the switch is turned ON.
Red LED lit: When a unit error has occurred (with some exceptions*2)
Red light OFF: when a unit is selected while the red light is ON and the
switch is turned ON.
(3) Output terminal block Output terminal block. Can be removed (M3 screws)
(4) Lock lever Locks the connection of the unit.
*1 This LED lights (green) in the following instances even if operation is not normal.
(1) When the number of connected units differs from the unit information on the CPU Unit when the power is turned ON.
(2) When the model type connected differs from the unit information on the CPU Unit when the power is turned ON.
In this case, an error will be displayed in the access window.
*2 Red light will be ONin the following instance even if the unit is not in error state:
(1) When the power is turned on, and the CPU unit information becomes the configuration with one CPU
In this case, an error will be displayed in the access window.
* KV-C32TC/C64TC/C32TCP/C64TCP 34-pin connector will be supplied as an option.

Tip Direct processing can be realized. Although KV-B16RA/B16TA/C32TA(P)/C64TA(P) can also


be used, direct processing can not be realized。
"About Direct Processing", Page 3-16

- KV-5000/3000 Series User’s Manual - 1-45


1-9 Expansion Output Unit
HARDWARE

Specification

KV-B16TC KV-B16TCP KV-C32TC KV-C32TCP KV-C64TC KV-C64TCP


Model KV-B16RC(16 point)
(16 point) (16 point) (32 point) (32 point) (64 point) (64 point)
1 Output mode Relay
NPN
transistor
PNP
transistor
NPN
transistor
PNP
transistor
NPN
transistor
PNP
transistor
Connector*1
Expansion Output Unit

External connection mode Removable the terminal block


AC 250V/DC 30V
Rated load DC 30V 0.2A
2A(8A/1common point)
OFF leak current - < 100µA
Residual current at ON - < 0.5V
ON resistance < 50mΩ -
8 point/1 16 point/1 common 32 point/1 common 64 point/1 common
Common point mode
common point (2 terminals)*2 (2 terminals)*2 (4 terminals)*3
Response OFF -> ON < 10µs < 50µs
< 10ms
Time ON -> OFF < 200µs
Internal current
< 120mA < 30mA < 45mA < 100mA
consumption
Weight approx. 190g approx. 130g approx. 100g approx. 140g
Electrical: more than
100 thousand cycles

Relay life (20 cycles/min)
Mechanical: more than
20 million cycles
Replace relay Impossible -
*1 Conform to MIL-C-83503 standard
*2 2 COMs of KV-B16TC, B16TCP, C32TC, C32TCP are shorted internally.
*3 4 COMs of KV-C64TC, C64TCP are shorted internally.
"KV-B16RC internal circuit diagram", "KV-B16TC internal circuit diagram", "KV-B16TCP internal circuit diagram", Page 1-47
"KV-C32TC internal circuit diagram", Page 1-48 "KV-C32TCP internal circuit diagram", Page 1-48
"KV-C64TC internal circuit diagram", Page 1-49 "KV-C64TCP internal circuit diagram", Page 1-50

Note
KV-C32TC(P)/C64TC(P) is 1.6A/ 1 common point.

Note When the number of ON output points exceeds


specified range, unit error may eccur. KV-B16RC Derating factor
Continuous and simultaneous ON rate (%)

30 ć
Ambient temperature and continuous and 100

simultaneous ON rate are shown as follows.


80

60

40
37.5ˁ

20

0
0 10 20 30 50
Ambient temperature (ć)

1-46 - KV-5000/3000 Series User’s Manual -


1-9 Expansion Output Unit

HARDWARE
Wiring and Internal Circuit Diagram
KV-B16RC/B16TC/B16TCP Wiring diagram
Terminal No.
1
0
3
5
2
4
1
7

Expansion Output Unit


6
C0
8
9
10
11
12
13
14
15
C1 KV-B16RC internal circuit diagram
000 to007
Terminal No. Signal name (008to015)
Signal name Terminal No. OUT
L 1 001 Load

Internal circuit
000 0 L
L 3 003
002 2 L
L 5 005
004 4 L COM0
L 7 007
006 6 L ˄COM1˅
C0 COM
008 8 L
L 9 009
010 10 L
L 11 011 Load power supply
012 12 L
L 13 013
014 14 L
L 15 015
COM C1

* COM not circuit-shorted internally.

KV-B16TC internal circuit diagram

Terminal No. Signal name


Signal name Terminal No. Insulation power
L 1 001
000 0 L
L 3 003
002 2 L
L 5 005 000 to015
004 4 L
L 7 007
006 6 L
OUT
C0 COM0
Internal circuit

008 8 L Load
L 9 009
010 10 L
L 11 011
012 12 L
L 13 013
014 14 L Photocoupler-isolation COM0
L 15 015
COM1 C1
COM1
* COM circuit-shorted internally. Load power supply

KV-B16TCP internal circuit diagram


Load power supply
COM0
Terminal No. Signal name
Signal name Terminal No.
L 1 001 COM1
Internal circuit

000 0 L
L 3 003
002 2 L
L 5 005
004 4 L OUT
L 7 007 Load
006 6 L
C0 COM0 000 to015
008 8 L
L 9 009
010 10 L
L 11 011
012 12 L
L 13 013
014 14 L
L 15 015 Insulation power
COM1 C1

* COM circuit-shorted internally.

- KV-5000/3000 Series User’s Manual - 1-47


1-9 Expansion Output Unit
HARDWARE

KV-C32TC/C32TCP Wiring diagram


Connector pin No.

1 18
2 19
3 20
4 21

1 5 22
6 23
7 24
Expansion Output Unit

8 25
9 26
10 27
11 28
12 29
13 30
14 31
15 32
16 33
17 34
KV-C32TC internal circuit diagram
Pin No. Signal name Signal name Pin No.
Insulation
L 1 000 100 18 L power
L 2 001 101 19 L
L 3 002 102 20 L
000to 015
L 4 003 103 21 L 100 to 115
Internal circuit
L 5 004 104 22 L OUT
Load
L 6 005 105 23 L
L 7 006 106 24 L
L 8 007 107 25 L
Photocoupler-isolation COM0
L 9 008 108 26 L
L 10 009 109 27 L
COM1
L 11 010 110 28 L Load power supply
L 12 011 111 29 L
L 13 012 112 30 L
L 14 013 113 31 L
L 15 014 114 32 L
L 16 015 115 33 L

17 COM0 COM1 34
DC * COM circuit-shorted internally. DC
KV-C32TCP internal circuit diagram
Load power supply
Pin No. Signal name Signal name Pin No. COM0

L 1 000 100 18 L
Photocoupler-isolation
Internal circuit

COM1
L 2 001 101 19 L
L 3 002 102 20 L
L 4 003 103 21 L
OUT
Load
L 5 004 104 22 L
000to 015
L 6 005 105 23 L 100to 115
L 7 006 106 24 L
L 8 007 107 25 L
L 9 008 108 26 L Insulation
L 10 009 109 27 L power

L 11 010 110 28 L
L 12 011 111 29 L
L 13 012 112 30 L
L 14 013 113 31 L
L 15 014 114 32 L
L 16 015 115 33 L

17 COM0 COM1 34
DC * COM circuit-shorted internally. DC

1-48 - KV-5000/3000 Series User’s Manual -


1-9 Expansion Output Unit

HARDWARE
KV-C64TC Wiring diagram KV-C64TC internal circuit diagram

L side H side
Connector pin No. Connector pin No.
1 18 1 18
2 19
3 20
2 19
3 20 Insulated power 1
4 21 4 21

Expansion Output Unit


000 to 015
5 22 5 22 100to 115
200 to 215
6 23 6 23 300 to 315

Internal circuit
7 24 7 24 OUT
Load
8 25 8 25
COM0
9 26 9 26
COM1
10 27 10 27
Photocoupler-isolation COM2
11 28 11 28
12 29 12 29
COM3
13 30 13 30 Load power supply
14 31 14 31
15 32 15 32
16 33 16 33
17 34 17 34

Pin No. Pin No. Pin No. Pin No.


Signal name Signal name Signal name Signal name

L 1 000 100 18 L L 1 200 300 18 L


L 2 001 101 19 L L 2 201 301 19 L
L 3 002 102 20 L L 3 202 302 20 L
L 4 003 103 21 L L 4 203 303 21 L
L 5 004 104 22 L L 5 204 304 22 L
L 6 005 105 23 L L 6 205 305 23 L
L 7 006 106 24 L L 7 206 306 24 L
L 8 007 107 25 L L 8 207 307 25 L
L 9 008 108 26 L L 9 208 308 26 L
L 10 009 109 27 L L 10 209 309 27 L
L 11 010 110 28 L L 11 210 310 28 L
L 12 011 111 29 L L 12 211 311 29 L
L 13 012 112 30 L L 13 212 312 30 L
L 14 013 113 31 L L 14 213 313 31 L
L 15 014 114 32 L L 15 214 314 32 L
L 16 015 115 33 L L 16 215 315 33 L
17 COM0 COM1 34 17 COM2 COM3 34

* COM circuit-shorted internally.

Note
Please use OP-42224 connector (34-pins) for 64-point unit.
Do not use OP-23139.

- KV-5000/3000 Series User’s Manual - 1-49


1-9 Expansion Output Unit
HARDWARE

KV-C64TCP Wiring diagram KV-C64TCP internal circuit diagram

L side H side
Connector pin No. Connector pin No.
1 18 1 18 Load power supply
COM0

1 2 19
3 20
2 19
3 20 Photocoupler-isolation COM1

Internal circuit
4 21 4 21 COM2
Expansion Output Unit

5 22 5 22 COM3

6 23 6 23 OUT
Load
7 24 7 24 000 to 015
8 25 8 25 100 to 115
200 to 215
9 26 9 26 300 to 315
10 27 10 27
11 28 11 28 Insulation power
12 29 12 29
13 30 13 30
14 31 14 31
15 32 15 32
16 33 16 33
17 34 17 34

Pin No. Pin No. Pin No. Pin No.


Signal name Signal name Signal name Signal name

L 1 000 100 18 L L 1 200 300 18 L


L 2 001 101 19 L L 2 201 301 19 L
L 3 002 102 20 L L 3 202 302 20 L
L 4 003 103 21 L L 4 203 303 21 L
L 5 004 104 22 L L 5 204 304 22 L
L 6 005 105 23 L L 6 205 305 23 L
L 7 006 106 24 L L 7 206 306 24 L
L 8 007 107 25 L L 8 207 307 25 L
L 9 008 108 26 L L 9 208 308 26 L
L 10 009 109 27 L L 10 209 309 27 L
L 11 010 110 28 L L 11 210 310 28 L
L 12 011 111 29 L L 12 211 311 29 L
L 13 012 112 30 L L 13 212 312 30 L
L 14 013 113 31 L L 14 213 313 31 L
L 15 014 114 32 L L 15 214 314 32 L
L 16 015 115 33 L L 16 215 315 33 L
17 COM0 COM1 34 17 COM2 COM3 34
DC DC DC DC
* COM circuit-shorted internally.

Note
Please use OP-42224 connector (34-pin) for 64-point unit.
Do not use OP-23139.

1-50 - KV-5000/3000 Series User’s Manual -


1-9 Expansion Output Unit

HARDWARE
Outline Dimensions

KV-B16RC/B16TC/B16TCP Wiring diagram


2.8

Expansion Output Unit


27.3

90 35.9

3.5 80
9 29 3 96.5) Unit: [mm]

KV-C32TC/C32TCP
2.8

27.3

90 35.9

3.5 80
9 23 3 96.3
(125) Unit: [mm]

KV-C64TC/C64TCP

2.8

27.3

90 35.9

3.5 80
9 29 3 96.3
(125) Unit: [mm]

- KV-5000/3000 Series User’s Manual - 1-51


1-10 Expansion Unit KV-EB1S/ KV-EB1R
HARDWARE

This section describes name, function and technical specification of each part of KV-EB1S/KV-EB1R expansion
unit.

Name and Function of Each Part


1 KV-EB1S KV-EB1R
(1) Power monitor LED
Expansion Unit

(6) OP cable

24V 0V
(4) Power toggle switch (bottom)

(2) Extensiion connector (3) DC power input terminal block


(5) KV-U7 connector for connection (side)

No. Name Function


(1) Power monitor LED Power monitor LED. *1
(2) Extension connector Extension cable connector.
DC power input terminal
(3) Terminal block for 24 VDC mains input. (Max. 3.5A)*2, *3
block
Switch for toggle power to expansion unit.
(4) Power selector switch INT : when using power on KV- 1000 PLC side.
EXT : when using EB1R or U7 DC power.
(5) KV-U7 connector Connector for KV-U7 power unit *3, *4
Connect KV-EBIS and KV-EBIR.
(6) Extension cable
(OP-42142 1m), (OP-42141 2m)
*1 The orange or red LED may light up, due to mains voltage drop. Please check power supply.
*2 Ensure power connection not reversed. Although reverse connection protective circuit is designed,
protection function is not started under power connection in some cases.
Please note the current consumption of expansion unit, guarantee current supplied from terminal block below 3.5A.
*3 When power capacity on KV-5000/3000 side is under certain limit, please supply power from this point
to expansion unit side.
*4 When connecting KV-U7, please note current consumption of expansion unit.

Note
When toggling power or switch, be sure to disconnect power.

1-52 - KV-5000/3000 Series User’s Manual -


1-10 Expansion Unit

HARDWARE
Specification

Model KV-EB1S KV-EB1R


Supply voltage DC24V±10%
Internal current consumption < 15mA < 25mA 1
Weight approx. 90g approx. 115g

Expansion Unit
About Connection / Setting

KV-EB1S is connected to the rightmost end of the section before extension.


KV-EB1S is connected to the leftmost end of the section before extension.

Unit configuration example (Max.) KV-EB1S


Max. 16 units
KV-5000/3000

KV-EB1R > 60mm

Vertical

KV-EB1S

KV-EB1R

■ About connection cable and the number of sections


· When using 1m extension cable (OP-42142)
The maximal number of vertical sections is 3s (connect maximal 48 units)
· When using 2m extension cable (OP-42141)
The maximal number of vertical sections is 2s (connect maximal 32 units)

■ About setting
When using expansion unit, please consider of heat influence, the gap between the upper unit and the
lower unit shall be 60mm above.
When temperature inside panel (temperature below the unit) exceeds environmental temperature used
by the unit, please adopt the methods such as forced air cooling, enlarging surrounding gap or
improving ventilation, etc. to reduce temperature.

- KV-5000/3000 Series User’s Manual - 1-53


1-10 Expansion Unit
HARDWARE

About Power Supply Switching

Power supply to expansion unit can be switched.

1
■ Use the power on previous section
Expansion Unit

POWER When using the power from the previous section supplied via OP cable, set
INT EXT power switch to "INT".
KV-U7 or other power need not to be used during operation. However, total
current consumption should not exceed rating value of power.

■ Using external power


POWER When using KV-U7 or other power, set supply power switch to "EXT".
INT EXT

● Using KV-U7
Connect KV-U7 to left side of KV-EB1R.
KV-U7 KV-EB1R
KV-U7

OC

OUTPUT
24VDC
1.8A

N
INPUT
100-240V
AC
50/60Hz
0.98A
L

● Use separate power


Connect other power to DC power terminal block.

Note When supplying power separately from KV-EB1R, please note the following points.
· Turn ON power: please supply power from KV-EB1R side first.
· Turn OFF power: Please disconnect power from KV-5000/3000 side first.
(when an error occurs and after the error is cleared in access window or KV
STUDIO , it will operate when switching from PROG- >RUN.)

Note
· When using KV-EB1 for 3 section addition, and using other powers for each equipment,
please wrap 2 turns of ferrite core on power cable (Beichuan Industry: RFC-10). When
using KV-U7, please adopt anti-noise measures such as FG grounding, etc.

1-54 - KV-5000/3000 Series User’s Manual -


1-10 Expansion Unit

HARDWARE
Outline Dimensions

KV-EB1S
2.8

Expansion Unit
27.3

35.9
90

9 29 3.5 80
(130)

KV-EB1R

27.3

35.9
90

3.5 80
29 3 (105)
(130)

Unit: [mm]

- KV-5000/3000 Series User’s Manual - 1-55


1-11 Error Output Unit KV-DR1
HARDWARE

This chapter describes name, function and technical specification of every part of KV-DR1 error output unit.

Name and Function of Each Part

1 (Front) (3) Lock lever (side)


Error Output Unit

(1) Output
terminal block

(2) Terminal block cover


(3) Lock lever

No. Name Item


(1) Output terminal block Error output terminal block. (M4 screw)
(2) Terminal block cover Cover
(3) Lock lever Locks the connection of the unit.

Specification

Item Specification
Output mode Relay
Rated load DC 24 V, 0.5A
ON resistance < 50m
OFF -> ON < 10ms
Response time
ON -> OFF 5ms or less
Internal current consumption Below DC5V 30mA (supplied by CPU unit)
Weight approx. 90g
Electrical: more than 100 thousand cycles (20 cycles/min)
Relay life
Mechanical type: more than 20 million cycles
Replace relay Impossible

About Error Output

During normal condition, KV-DR1 output is ON.


Output is OFF only when power is not connected or a severe error (such as CPU unit stops) occurs.

Tip · Output is also ON in case of no error even in PROG mode.


·If error occurs during power on, output is not ON.

1-56 - KV-5000/3000 Series User’s Manual -


1-11 Error Output Unit

HARDWARE
Wiring and Internal Circuit Diagram

Error Output Unit


Internal circuit

Load

+
Load power supply

Outline Dimensions

Unit: [mm]

81.5
2.8

27.3

90
35.9

3.5

26 5.2 80 (4.4)
91

- KV-5000/3000 Series User’s Manual - 1-57


1-12 Maintenance
HARDWARE

This section describes unit repair and maintenance procedure as well as how to replace battery and
relays.

About Inspection and Maintenance


1
Maintenance

■ Service
When KV-5000/3000 Series units are used for a long time, the connecting part of the connectors
becomes loose or the battery is worn down. Continued use of KV-5000/3000 Series units in this state
may cause KV-5000/3000 trouble.
So, periodical check shall be conducted for each unit body, wiring part, etc. of KV-5000/3000 or KV-
5000/3000 series.
The main service items are as follows:
· Whether the lock at each unit’s connection part is dropped or loose?
· Whether the connector's connection part is mismatched or loose?
· Whether the terminal screw of terminal block is loose?
· Battery low?
· Whether the wiring cable between unit and equipment is damaged?

■ Daily care
Dust will be adhered on CPU unit and every unit after long term use.
Clean off any dirt from the KV-LE20A using a clean, dry cloth.
Dust and dirt on fine components can be removed with a cotton bud after removing the connector.

Replace Battery

■ When battery power is low


When "CPU Error No83" is displayed in check window, please immediately replace the internal lithium
battery.
When battery error occurs, CR2306 will be turned on (ON).
After battery error occurs, the data can be maintained for minimal 1 week (normal temperature).
Error checking will be performed every 4096s after power is turned ON or power is used up.

■ When battery power is used up


When battery power is used up, SRAM backup error will occur, the data on memory card (DM/EM),
control memory card (CM) will disappear, but Ladder program will not disappear. For disappearing of DM, EM ,
CM message, etc. will not influence Ladder program operation. Implementing SRAM clear in access window can
temporarily start the program.
The following battery shall be purchased.
Replaceable lithium battery model: OP-51604

1-58 - KV-5000/3000 Series User’s Manual -


1-12 Maintenance

HARDWARE
Note · Battery life is 5 years at +25°C. The life will be shortened when used at higher
temperature.
· Battery shall be replaced within 2 years when used under hot environment(
ambient temperature: more than +40°C). 1
· Battery shall be replaced within 1 year during power off storage under hot

Maintenance
environment (ambient temperature: +50°C).
· Before changing battery, if power is not connected for more than 10 minutes, the
data will disappear. Battery replacement shall be completed within 10 minutes.
· Never throw KV-5000/3000 battery into fire, or disassemble the battery. Besides,
the battery is an rechargeable battery, do not change it. Otherwise, the battery
may explode.
· Using other batteries other than OP-51604 may lead to fire or explosion, so be
sure to use specified battery.

■ Steps for replacing battery

1 The power shall be turned on for more than 10 minutes and off before replacement.

2 Remove screws for backup battery, and remove the old battery.
· Replacement shall be completed within 10 minutes.

3 Insert a new battery.

4 Fix with screws (tightening torque 0.2N·m (2kgf·cm)).

5 Turn on power, verify whether error is displayed in check


window.

˄1˅
˄2˅

- KV-5000/3000 Series User’s Manual - 1-59


1-12 Maintenance
HARDWARE

MEMO

1
Maintenance

1-60 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2
CPU INTERNAL FUNCTIONS
This chapter describes various functions that can be realized by access
window, memory card slot, communication ports, I/Os, high speed counters
etc. of the CPU unit KV-5000/3000.

2-1 Access Window •••••••••••••••••••••••••••••••••••••••••••• 2-2


2-2 Memory Card ••••••••••••••••••••••••••••••••••••••••••••• 2-42
2-3 Logging/Tracing •••••••••••••••••••••••••••••••••••••••••• 2-52
2-4 USB Communication •••••••••••••••••••••••••••••••••••• 2-73
2-5 Serial Communication (KV-3000 only) ••••••••••••••• 2-74
2-6 Ethernet/FL-net Communication (KV-5000 only) •• 2-82
2-7 I/O ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 2-83
2-8 High-speed Counter ••••••••••••••••••••••••••••••••••••• 2-87
2-9 Frequency Counter •••••••••••••••••••••••••••••••••••••2-133
2-10 Cam Switch ••••••••••••••••••••••••••••••••••••••••••••••2-139
2-11 Specify Frequency Pulse Output•••••••••••••••••••••2-153
2-12 Motor (positioning) Control ••••••••••••••••••••••••••••2-157
2-13 Clock Function•••••••••••••••••••••••••••••••••••••••••••2-214

- KV-5000/3000 Series User’s Manual- 2-1


2-1 Access Window
CPU INTERNAL FUNCTIONS

This section describes the Access Window used to monitor data of the CPU unit or perform change
operations.

Operations that Can be Implemented Through Access Window.

The KV-5000/3000 is provided with a compact LCD display with 2-color backlight.

2 The LCD is displayed green in the Run mode and red in the PROGRAM mode.
Access Window

Memory card Digital trimmer

▪Load TRMO Direct


▪Save 0
▪File List L _____
▪Free Space 1

Unit Monitor User message

KV-AD40 CHOM Usr Message2


ANALOG
+1.23 STOP!!
V

Alarm log Display device Clock mode

Record 01/31 Sensor A 2007/06/14


Temp. Alarm OFF 12:34:56
2007/06/14 RLY1 Thu
10:10:10 OFF

2-2 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-1 Access Window

■ Function list
The KV-5000/3000 unit is equipped with an Access Window for easily changing and monitoring data.
The Access Window also allows the user to check error codes that may occur.
The Access Window has the following functions.

Unit Monitor
In this mode, state of the unit can be monitored on the Access Window by pressing the direct access
switch connected to the CPU.
2

Access Window
"Unit Monitor", Page 2-6

Device mode
In this mode, internal devices can be displayed and their settings changed.
"Device Mode", Page 2-9

Error clear
Clear serious errors of the CPU unit.
"Error Clear", Page 2-15

Digital trimmer
In this mode, trimmers can be set digitally. The maximum resolution is 4294967296.
"Digital Trimmer", Page 2-17

I/O Test
Can confirm I/O status of expansion I/O unit.
"I/O Test", Page 2-18

Display and setting of time


In this mode, internal clock can be displayed and time can be set.
"Date", Page 2-20

CPU monitor
In this mode, the state of CPU positioning and frequency counter functions can be monitored. Also,
name of the program project contained on the unit can be checked.
"CPU Monitor", Page 2-22

Monitoring alarm
In this mode, the alarms can be monitored and alarm log can be checked.
"Alarm", Page 2-25

Memory card operation


In this mode, operations such as storing/loading files to and from the Memory Card, and displaying list
of files can be performed.
"Memory Card", Page 2-28

Commission
Can release forced set/reset register, input update disable/output disable from the Access Window.
"Commission", Page 2-32

- KV-5000/3000 Series User’s Manual - 2-3


CPU INTERNAL FUNCTIONS

2-1 Access Window

Access Window setup


In this mode, you can set the contrast of the Access Window, display language, and other related
settings.
"Access Window Setup", Page 2-34

SRAM clear mode


In this mode, device values can be cleared.
2 "SRAM Clear Mode", Page 2-36
Access Window

All Clear mode


In this mode, all settings can be cleared.
"All Clear Mode", Page 2-37

■ Menu Structure
Switching among modes is implemented by menu.
Pressing the "M" key displays a menu. (When other units are selected, press the direct access key for
the unit, or press 'M' key twice.)
If not all of the menu items fit in the screen, press the "▼" key to display the rest of the menu. Press the
"▲" and "▼" keys t scroll the menu up and down.
1 . デバイスモード 1 . DeviceMode
2 . エラークリア 2 . Error Clr
3 . トリマ 3 . Trimmer
4 . I/ Oテスト 4 . I/ O TEST

In the examples shown, Japanese characters are shown on the left and English letters on the right.
Switching between Japanese/ English is implemented through “AW Setting".
"Access Window Setup", Page 2-34
The following table shows the CPU menu items.
Japanese English Japanese English
1.デバイスモード 1. DeviceMode 7.アラーム 7. Alarm
2.エラークリア 2. Error Clr 8.メモリカード 8. MemoryCard
3.トリマ 3. Trimmer 9.デバッグ 9. Debug
4.I/Oテスト 4. I/O TEST 10.AWセッテイ 10. AWSetting
5.トケイ 5. Date 11.SRAMクリア 11. SRAM Clr
6.CPUモニタ 6. CPU Mon 12.オールクリア 12. All Clr

TIP When severe error occurs and its log hasn't been cleared, ' ' will be displayed on the upper
right of Access Window.

1 . デバイスモート 1 . DeviceMod
2 . エラークリア 2 . Error Clr
3 . トリマ 3 . Trimmer
4 . I/ Oテスト 4 . I/ O TEST

For the Method of use, see "Error Clear", Page 2-15.

2-4 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-1 Access Window

The Access Window menu is configured as follows:

1. Device mode
2. Error clear
3. Trimmer
4. I/O test
5. Data
6. CPU monitor Project name 2
Positioning

Access Window
Frequency counter
Ethernet (only KV-5000)
7. Alarm Monitor
Log
Log clear
8. Memory card Load
Save
File list
Free space
9. Commission Forced set/reset register release
Input refresh disable release
Output disable release
10. AW setting Contrast (3 to 9)
Language (Japanese/English)
11. SRAM clear
12. all clear

- KV-5000/3000 Series User’s Manual - 2-5


CPU INTERNAL FUNCTIONS

2-1 Access Window

■ Names and Functions of Parts

(1)Access window

2 (2)Setup key
Access Window

(1) Access Window Displays the current values and setting values of each device, and error
messages.
Information of each unit is displayed by pressing the direct access switch for
the respective unit.

(2) Setup key Used for swithing between modes and changing settings in each mode. Key
functions differ according to each mode. For detailes, see the operation
instructions for each mode.

Unit Monitor

Units can be monitored and set in the Access Window by pressing the direct access switch for special
units or expansion units such as the I/O unit connected to the CPU.
To return to the original screen from the expansion unit or special unit screen, press the direct access
switch of the unit currently displayed on the Access Window.

TIP When unit error occurs, the direct access switch will turn red, and the error contents will be
displayed in the Access Window.
For details on monitor items and settings for each unit, refer to the User's Manual for the respective unit.

■ Functions of setup key


The following table summarizes key functions when monitoring or setting up units.
Setup Key General Function When Changing Numerical Values
M Menu display Menu display
Changes the digit of value to be
Not used.
incremented/decremented.
Switches pages, or changes options when
▲ Increments the current set value.
changing settings.
Switches pages, or changes options when
▼ Decrements the current setting.
changing settings.
Changes are applied to settings when Changes are applied to settings when
holding down this key for at least 1s. holding down this key for at least 1s.

2-6 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-1 Access Window

■ Method of Operation (example: on I/O Unit)


We will take KV-C32XC for example to describe the operation methods.

● Switch to Unit Monitor

1 Press the direct access switch on the unit.


The direct access switch for the selected unit flashes. 2

Access Window
Direct access switch

2 The relay No. and relay ON/OFF state assigned to the unit is displayed.
The LED indication changes as follows according to the currently selected unit.

RLY30000 RLY30100
76543210 76543210
L__■____■ L__■____■
H■___■___ H■___■___

RLY30000
76543210 Display leading No. of relay occupied by KV-C32XC in
L__■____■ access window (R30000)
H■___■___

LED display: 16-point X 2 column


  Left column (A): leading No. +0 to +15
  Right column (B): leading No. +100 to +115
 R30000 is at the top left and R30115 at the bottom right.

Press " ▲ " and " ▼ " to switch the pages.

- KV-5000/3000 Series User’s Manual - 2-7


CPU INTERNAL FUNCTIONS

2-1 Access Window

● Menu display

1 Press the "M" key with the direct access switch for the unit flashing (selected).
The menu for the unit is displayed.

モニタ Monitor
ジテイスウ Input Filter

2
Access Window

● Changing Settings
Let's take altering the input time constant as an example.

1 Press the key to select "Time constant", then press " " key.
The currently set time constant can be checked.

KV-C3 2 X* KV-C3 2 X*
ジテイスウ Input Filter
1 0 ms 1 0 ms

2 Hold down the " " key for at least one second in this state.
The setting value flashes, and the unit enters the change mode. (Change operation is not possible in
the Run mode. Values can be changed only in PROG mode.)

KV-C3 2 X* KV-C3 2 X*
ジテイスウ Input Filter
1 0 ms 1 0 ms

3 Change the setting value using the up/down keys, and hold down the " " key for at least one
second.
The setting value stops flashing and is set. (Holding down the key for less than one second cancels the
newly set value.)

KV-C3 2 X* KV-C3 2 X*
ジテイスウ Input Filter
1 ms 1 ms

2-8 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-1 Access Window

Device Mode

In this mode, PLC device values can be monitored and changed.

■ Displaying devices and changing their settings


The following table summarizes devices that can be displayed and set.
Display Name Display Name
2

Access Window
R Relay W Link register
MR Internal auxiliary relay CM Control memory
LR Latch relay TM Temporary data memory
B Link relay T Timer
CR Control relay C Counter
DM Data memory CTH High-speed counter
EM Extended data memory CTC High-speed counter comparator
FM File register (memory bank switching mode) TRM Digital trimmer
ZF File Register (consecutive number mode) Z Index register

Note
The contact states of timers, counters, and high-speed counter comparators cannot be monitored.

● About XYM marking


XYM marking can be performed on relay (R), internal auxiliary relay (MR), latch relay (LR), data memory (DM),
expansion data memory (EM) and file register (FM).
Default marking/XYM marking can be automatically switched by the setting of items (KV STUDIO's Tool > Options
> Display mode setting > XYM marking).
Device name Default marking XYM marking Device No. @XYM marking
Input X 0000 to 999F
Relay R Output Y 0000 to 999F
Internal auxiliary R 0000 to 99915
Internal auxiliary relay MR M 00000 to 15999
Latch relay LR L 00000 to 15999
Data memory DM D 00000 to 65534
Extended data memory EM E 00000 to 65534
File register FM F 00000 to 32767

■ Functions of Setup key


The following table summarizes key operations in the device mode:
Setup Key General Function When Changing Numerical Values
M Menu display Menu display
Registers/cancels new values.
Switch to the setting value change mode.
Hold down for at least one second to register(apply).
Press and hold for more than 1s.
Registration is canceled if held down for less than one second.
▲/▼ Selection of device No. Increments/decrements value to be changed.
Selection of device
Selects the digit of the value to be
Selection of display attribute
changed.
Selection of device name representation method.

- KV-5000/3000 Series User’s Manual - 2-9


CPU INTERNAL FUNCTIONS

2-1 Access Window

■ Operation method
● Switch to the Device mode
1 Press the "M" key.
A menu is displayed.(If other units are selected, press the "M" key twice.)

2 Select "JOG", and press the " " key.


2 The monitor screen is displayed in the device mode.

R0
Access Window

OFF
R1
OFF

The trimmer No. to be displayed can be changed by the "▲"“▼”keys.

● Changing type of device to be monitored

1 Press the " " key in device mode

R500
ON
R501
OFF

2 A list of device types is displayed.


Select the device to display using the "▲" and "▼" keys.
In this example, select device "TM".

R
MR
LR
B

The device types are displayed in the following order: R->MR->LR->B->CR->DM->EM->FM->ZF->W->CM-


>TM->T->C->CTH/CTC->TRM->Z. When the "▼" key is pressed with Z selected, "R" will be selected again.
Likewise, when the "▲" key is pressed with "R" selected, "Z" will be selected .

3 "·TM" is displayed flashing.

ZF Press the " " key.


W
CM
TM
The screen for determining the
ジャンプ JUMP
TM TM desired device No. is displayed.
0 0 The current device No. is displayed on
10 10
the 3rd line.

The numerical value displayed on the 4th line is the device No. change increment.
Change the device No. using the "▲" and "▼" keys.
As shown in this diagram, device No. will increase by an increment of 10 after pressing "▲" key.
The device No. change increment will become 1/10 by pressing the " " key.
Determine the device No. to display using the "▲", "▼" and " " keys.

2-10 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-1 Access Window

TM53 Press the " " key. This displays the TM of the specified No.
0
TM54
100

■ Changing the device value display format

1 Press the " " key in device mode


2

Access Window
R500
ON
R501
OFF

2 Press the " " key with the list of device types displayed.

R
MR
LR
B

3 This displays the display format selection screen.

ヒョウジケイシキ Disp Format

1 6 Bit-BASE2 1 6 Bit-BASE2

4 Select the display format.


Select the display format using the "▲" and "▲" keys.

ヒョウジケイシキ Disp Format

On/ Off On/ Off

5 Press the " " key. This displays the monitor value in the selected display format.
The display format selected here is applied to all devices.

R500
ON
R501
OFF

The following table summarizes display formats that can be selected.


Format Display contents
Default According to Device Types (Refer to appendix)
ON/OFF ON/OFF display
16Bit-BASE10 unsigned Data width 16-bit unsigned, DEC display
16Bit-BASE10 signed Data width 16-bit signed, DEC display
16Bit-BASE16 Data width 16-bit, HEX display
16Bit-BASE16 Data width 16-bit, HEX display
32Bit-BASE10 unsigned Data width 32-bit unsigned, DEC display
S32Bit-BASE10 signed Data width 32-bit signed, DEC display
32Bit-BASE16 Data width 32-bit, HEX display

- KV-5000/3000 Series User’s Manual - 2-11


CPU INTERNAL FUNCTIONS

2-1 Access Window

Formats of devices that can be displayed:


◎: Can be displayed (Default); ○: Can be displayed; × : Cannot be displayed
16Bit- 16Bit- 32Bit- 32Bit-
OFF-> 16Bit- 16Bit- 32Bit-
Device type BASE10 BASE10 BASE10 BASE10
ON: BASE16 BASE16 BASE16
unsigned signed unsigned signed
R/MR/LR/B/CR ◎ ○ ○ ○ ○ × × ×
2 DM/EM/FM/ZF/W/CM/
TM
× ◎ ○ ○ ○ ○ ○ ○
Access Window

T/C/CTH/CTC/TRM × × × × × ◎ ○ ○
Z × × × × × × ◎ ○

The display format that can be selected varies according to the device type. When a display format that cannot be
applied is selected, the default display format is selected.

● Device name/comment display switching

1 Press the " " key in device mode.

R500
ON
R501
OFF

2 Press the " " key with the list of device types displayed.

R
MR
LR
B

3 Press the " " key in the display format selection screen.

Disp Format

Default

4 The screen for selecting device name/comment display is displayed.


Select whether to display the device name or comment using the "▲" and "▼" keys.
Pressing the "▼" key displays the comment.

Device Name

Comment

5 Press the " " key. This selects comment display, and the display returns to the device mode.
The following screen shows that comment "Sensor A is registered to R0, and not registered to R1.
Sensor A
OFF
R1
OFF

2-12 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-1 Access Window

About comments that can be displayed in the Access Window


· Up to 12 half-width alphanumeric characters can be displayed. Comments above 13th characters
cannot be displayed.
· Available display characters are ASCII codes 20 to 7e (HEX) and a1 to df (HEX). If characters other
than these are used, the device name is displayed.
· CTH comments cannot be displayed. CTC comments are displayed.
· Comments can not be set up for Z. 2

Access Window
● Changing device values
· When display format is ON/OFF

1 Hold down the " " key for at least one second with the device to change displayed.
If two devices are currently displayed in one screen, the device whose value can be changed is the
device displayed on the previous row of the screen. (In this case, the device on the next row is no
longer displayed).

R1000
OFF
R1000
OFF

2 The value of the device is displayed flashing.


In this state, press the "▼" and "▲" keys. This toggles the display in the order ON->OFF->ON->··
·.
(In this case, device value will not be stored)

R1000
OFF

3 To set the desired device value and hold down the " " key for at least one second.
Flashing stops and device value will be stored. If the key is released within one second, then storing is
not executed, and the screen returns to the monitor display.

R1000
ON

- KV-5000/3000 Series User’s Manual - 2-13


CPU INTERNAL FUNCTIONS

2-1 Access Window

· When displaying format is other than ON/OFF (except T, C, CTH/CTC, TRM)


The following example describes how to change the value of DM1000 No. from "100" to "201".

1 Hold down the " " key for at least one second with the device to change displayed.

DM1000
100
DM1001
101
2
2
Access Window

The value of the desired device flashes.


The "increment" is displayed on the bottom row of the screen.
DM1000
100

3 Press the "▲" key.


The device value is incremented by the amount set , and the device value changes to "101".
(In this case, the device value will not be stored into device.)
DM1000
101

4 Press the " " key once.


This changes the digit of the increment. Each press of the key changes a digit one time.
To change the hundreds digit, press the key twice.

DM1000
101

10

5 The increment value changes to "100".


DM1000
101

100

6 Press the "▲" key once.


The device value is incremented by the "100" and the display changes to "201".
(In this case, the device value is not stored into device.)

DM1000
201

100

7 Adjust the device value to a suitable value, and hold down the " " key for at least one second.
This stores the value, and the screen returns to the monitor display.
If press and hold "' " key for less than 1 second, write operation will not be executed, and the screen
will return to monitor display.

2-14 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-1 Access Window

· When display format are not ON/OFF(T, C, CTH/CTC, TRM)


The setting value and current value can be changed in the case of T, C, CTH/CTC, and TRM devices.

T0 Timer current value C50 Counter current value


100 200
S 5000 S 6000
Timer setting value Counter setting value
2
CTH0 CTC0 CTH value TRM0

Access Window
(High-speed counter) Value of trimmer
300 400
S 6000 L 7000
Upper limit of trimmer
CTH value
(High-speed comparator) Not displayed when
C0 upper limit is not set.
----- It will be shown as left when
S ----- devices are not used (not registered) "Digital Trimmer",
in Ladder Page 2-17

<How to change setting values>


To change device values, hold down the " " key for at least one second. The following items can be
changed:
 T : Timer setting value
 C : Counter setting value
 CTH/CTC : CTC (high-speed counter comparator)
 TRM : Trimmer

<How to change current values>


The following items can be changed by holding down the " " key for at least one second with the " " key
pressed.
 T : Timer current value
 C : Counter current value
 CTH/CTC : CTH (high-speed counter current value)
 TRM : Trimmer upper limit value (The trimmer upper limit value is assigned to CM.)
"Digital Trimmer", Page 2-17

Error Clear

Clear serious error of the CPU unit.

TIP When an error occurs on CPU or expansion unit, detailed information will be displayed automatically. You
can press a certain key in Access Window to clear a slight error and return to the previous display. In the
case of a severe error, the display can disappear, but the error cannot be cleared. If you don't operate the
Access Window for 30s, or switch RUN PRG toggle RUN, the error will be displayed again. Moreover,
" " will be generally displayed on the upper right of Access Window in the screen.

1 . デバイスモート 1 . DeviceMod
2 . エラークリア 2 . Error Clr
3 . トリマ 3 . Trimmer
4 . I/ Oテスト 4 . I/ O TEST

For the error information, see "Error Handling", Page 3-19.


- KV-5000/3000 Series User’s Manual - 2-15
CPU INTERNAL FUNCTIONS

2-1 Access Window

■ Functions of Setup key


The following summarizes key functions when clearing the error.
Setup Key Function
M Menu display
Error in the display can be cleared by pressing and holding for more than 1s.
The operation will be cancelled automatically the key is pressed for less than 1s. When

2 ▲
no error occurs, the operation is also invalid.
disabled
Access Window

▼ disabled
disabled

■ How to operate

1 Press the "M" key.


A menu is displayed. (If other units are selected, press the "M" key twice.)

2 Select '"2. Clear error' and press " "key.


The following screen is displayed.

· Screen example when an error occurs

エラークリア Error Clr


No. 4 0 No. 4 0
ラダーナシ No Ladder

· Screen example when no error occurs

エラークリア Error Clr

エラーナシ No Error

3 After changing the value, hold down the " " key again for at least one second.
Serious error displayed can be cleared.
If several severe errors occur, the other ones will be displayed. Press " " key for more 1s to clear
them. When all the errors are cleared, "No Error" will be displayed.

TIP When KV-DR1 is connected, KV-DR1's output is ON if all errors are cleared.

2-16 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-1 Access Window

Digital Trimmer

In numeric tuner mode, the trimmer's value can be changed simply through device mode.
Use TMIN instruction to read the value of trimmer in ladder diagram.
Please refer to KV-5000/3000/1000 Series PLC Instruction Reference Manual, “TMINInstruction"

■ Functions of setup key 2


The following table summarizes key operations when changing the trimmer value:

Access Window
Setup key Function
M Menu display
Changes the No. of the trimmer displayed.
Each press increments the device No.(TRM0 to 9)
▲ Increments the trimmer value.
▼ Decrements the trimmer value.
Changes the digit of the incremented value. Each press of the key increases a digit.
When the tenth digit is exceeded, it will return to the ones digit.

Changing values in this mode differs from changing values in the device mode. In the digital trimmer
mode, changes to values are reflected directly without pressing the " " key.

■ How to operate

1 Press the "M" key.


A menu is displayed. (If other units are selected, press the "M" key twice.)

2 Select '2.trimmer" and press ' ' key.

TRM0 Direct
1
L 10000
1
The value of the 3rd row indicates the trimmer upper limit value. When the
upper limit value setting is not used, it will not be displayed.

3 The trimmer No. displayed can be changed by the " " key.
Select the trimmer No. to change.

TRM0 Direct
1
L 0
10

4 Change the increment value by the " " key.

TRM0 Direct
11
L 0
10

- KV-5000/3000 Series User’s Manual - 2-17


CPU INTERNAL FUNCTIONS

2-1 Access Window

5 Pressing the "▲" key increases the trimmer value by the increment value, and pressing the "▼"
key decreases the trimmer value by the decrement value.
The digital trimmer mode differs from the device mode in that changes to values are reflected directly
without pressing the " " key.

TIP · The current trimmer value can be read by the TMIN instruction.
· To enable setting of upper limit, it's necessary to set on KV STUDIO. ("CPU system setting"
2 -> "Setting of digital trimmer's upper limit".)
· Upper limit can be set in KV STUDIO or Access Window's device mode (CM1700 to CM1715).
Access Window

· When the setting of upper limit is enabled, the upper limit will change to 4294967295
automatically if the setting value of upper limit is set to "0".
· The upper limit is stored in the following CM.
Trimmer No. Device
TRM0 upper limit CM01700, CM01701
TRM1 upper limit CM01702, CM01703
TRM2 upper limit CM01704, CM1705
TRM3 upper limit CM1706, CM1707
TRM4 upper limit CM1708, CM1709
TRM5 upper limit CM1710, CM1711
TRM6 upper limit CM1712, CM1713
TRM7 upper limit CM1714, CM1715

I/O Test

Can be used to verify I/O status of expansion I/O unit.

Note
Can be executed only in PROM mode.

TIP This can also be verified when the settings of unit configuration set through KV STUDIO
haven't been transmitted to CPU.

■ Functions of setup key

Setup key Function


M Returns to unit configuration screen.
Input unit: disabled
Output unit: reverse the output state of cursor position (ON/OFF)
Input unit: shift 16 digits for the displayed number of points.
▲/▼
Output unit: shift 8 digits for the displayed number of points.
Input unit: disabled
Output unit: shift the cursor position 1 digit forward.

2-18 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-1 Access Window

■ How to operate
● Switch to I/O test

1 Press the "M" key.


A menu is displayed. (If other units are selected, press the "M" key twice.)

2 Select "4. I/O test", and press the " " key.
The following screen appears.
2

Access Window
I/ Oテスト I/ O Test

ダイレクトアクセスSW Push Direct


ヲ オシテクダサイ Access SW

3 Select the direct access switch of verified expansion I/O unit.


The direct access switch of the selected unit flashes.

Direct access switch

● In the case of input unit


Number of points of the unit ("16", "32", "64"+"DI")

*:High bit/low bit is displayed by H/L only for 64-point unit

テスト 3 2 DI * TEST 3 2 DI *
76543210 76543210
+0 ________ +0 ________
+8 ________ +8 ________

Shift the verified relay position according to every 16 digits by pressing " ▲" "▼".

- KV-5000/3000 Series User’s Manual - 2-19


CPU INTERNAL FUNCTIONS

2-1 Access Window

● In the case of output unit


     Number of points of the unit ("16", "32", "64"+"DO")

*: High bit/low bit will be displayed by H/L only for 64-point unit

テスト 3 2 DO * TEST 3 2 DO *
76543210 76543210
+0 ________ +0 ________
2 +8 ________ +8 ________
Access Window

Shift the verified relay position according to every 8 digits by pressing " ▲" "▼".
Press " " key to reverse the output state of cursor position (ON/OFF).
Press " " key to change the cursor position.

Note
Please operate after verifying the state of connected control equipment.

Date

The date/time can be displayed and set.


The time will be displayed in 24-hour format.
The day of the week is displayed as follows:
Sun : Sunday Thu : Thursday 2007/06/14
12:34:56
Mon : Monday Fri : Friday
Thu
Tue : Tuesday Sat : Saturday
Wed : Wednesday

■ Functions of setup key


The following table summarizes key operations when setting the date/time.
Setup key Function
M Menu display
Switches the setting items.
Switches to decide if 0s adjustment is performed.
▲ Increments settings values when setting the date/time.
▼ Decrements setting values when setting the date/time.
Holding down this key for at least one second in the date/time display sets the date/time.
Holding down this key for at least one second when setting the date/time applies this setting.
Holding down this key for at least one second then releasing the key when adjusting
the date/time applies the newly adjusted time.

■ How to operate
● Switching clock

1 Press the "M" key.


A menu is displayed. (If other units are selected, press the "M" key twice.)

2-20 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-1 Access Window

2 Select "5. Date" and press " " key. 


The following screen appears.

2007/06/14
12:34:56
Thu

2
● Date/time setting

Access Window
1 Press " " key for more than 1s in date/time.
The "Year" segment flashes.

2007/06/14
12:34:56
Thu

2 Select a settings by pressing the " " key.


Each press of the " " key switches the items as follows: "Year" > "Month" > "Day" > "Hour" > "Minute"
> "Second" > "Day of week" > "Year"···and so on.

2007/06/14
12:34:56
Thu

3 Select the item using the "▲" and "▼" keys.

2007/06/14
12:34:56
Thu

4 Repeat steps 2 and 3. After setting, hold down the " " key for at least one second..
"Exec" is displayed at the most right bottom row of the screen.
(In this case, the date/time has not been set.)
Release the " " key. This appplies setting of date/time, and returns the screen to the date/time display.

2007/06/14
12:34:56
Thu
Exec

If you release the " " key before "Exec" is displayed, the date/time setting is not executed, and the
screen returns to the date/time display.

Note
Set year, month, day, hour, minute, second, and day of the week accurately.
The day of the week is not checked corresponding to the year, month, day, hour, minute, and
second.

- KV-5000/3000 Series User’s Manual - 2-21


CPU INTERNAL FUNCTIONS

2-1 Access Window

■ 0 second adjustment
0 second adjustment is a function for setting the seconds value to "0".
Current Seconds Value Operation
0 to 29 Only sets seconds value to "0".
30 to 59 Add 1 minute, and sets seconds value to "0".

1 Press the " " key in the date/time display state.


2
2007/06/14 2007/06/14
Access Window

15:59:44 15:59:44
Thu Thu
アジャスト Adjust

"Adjust" is displayed on the moset bottom row, indicating that the time can be adjusted.
(To cancel time adjustment, press the " " key again. The "Adjust" display disappears, and the screen
returns to the date/time display.)

2 Hold down the " " key for at least one second.

"Exec" is displayed at the right of the most bottom row of the display. (In this case, time adjustment has
not been executed.)
Release the " " key. This executes the time adjustment.

2007/06/14 2007/06/14
16:00:00 16:00:00
Thu Thu
アジャスト ジッコウ Adjust Exec

If you release the " " key before "Exec" is displayed, time adjustment is not executed, and the screen
returns to date/time display.

CPU Monitor

CPU's internal functions can be monitored. Meanwhile, the names of projects stored in CPU unit can be displayed.

■ The items that can be monitored


The items that can be monitored via Access Window are shown as follows.
Japanese English Function
The names of projects stored in CPU unit can be
プロジェクトメイ ProjectName
displayed. (Name can be set through KV STUDIO)
イチギメ Pos Control You can monitor CPU's built-in positioning function.
シュウハスウカウンタ Freq Count You can monitor CPU's built-in frequency counter.
You can monitor CPU's built-in Ethernet/ FL-net functions,
and display the attributes of KV-5000. The contents that
イーサネット Ethernet
can be monitored are the same as KV-LE20V/KV-FL20V
(Refer to User's Manual of each unit).

2-22 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-1 Access Window

■ How to operae
● Switch to CPU monitor

1 Press the "M" key.


A menu is displayed. (If other units are selected, press the "M" key twice.)

2 Select "6. CPU Monitor" and press " " key.


CPU monitor menu is displayed.
2

Access Window
ProjectName
Pos Control
Freq Count
Ethernet

● Project Name

1 Select "ProjectA" in the CPU monitor menu, and then press " " key.
Project name will be displayed.

Project Name

ProjectA

Project names that can be displayed in the Access Window


· Up to 12 half-width alphanumeric characters can be displayed.
· Available display characters are ASCII codes 20 to 7e (HEX) and a1 to df (HEX).

Project names are registered in the form of project properties of KV STUDIO.


When the Access Window displays the comment, the input item names will be stored into CM1757 to CM1763
after data transmission.
For comment display of the Access Window, see KV STDIO User's Manual.

TIP When ladder program is created, the project names set by KV STUDIO will be stored into
CM1740 to CM1756 after data transmission.

- KV-5000/3000 Series User’s Manual - 2-23


CPU INTERNAL FUNCTIONS

2-1 Access Window

● Positioning

1 Select "Pos control" in the CPU monitor menu, and then press " " key.
Status of positioning function is displayed.
There are five monitor functions in positioning monitor, which can be switched by "▲" and "▼".
The monitoring contents are as follows:

2 · Code M, current value, current speed of X axis.


 '*' is displayed in the pulse output process.
Access Window

Display “*” during pulse output


Display error code when error occurs
X
M-Code 0
P +0 P current value
V 0 V current speed
· Relays related to X axis.

X CR3000
76543210
L__■_■_■■ CR30
H_■_■■___ CR30
8
CR30
15
· Code M, current value, current speed of Y axis.
 '*' is displayed in the pulse output process.
Y Y
Mコード 0 M-Code 0
P +0 P +0 P current value
V 0 V 0 V current speed
· Relays related to Y axis

Y CR3100
76543210
L__■_■_■■ CR31
H_■_■■___ CR31
8
CR31
5
· Current value, current speed of X axis; Current value, current speed of Y axis.

P +123456789 The 2 top lines are for X axis X axis current value
V 2345 X axis current speed
P -123456789 The 2 bottom lines are for Y axis Y axis current value
V 1234 Y axis current speed

2-24 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-1 Access Window

● Frequency counter

1 Select "Freq. Counter" in the CPU monitor menu, and then press " " key.
The frequency counter monitor screen is displayed.
The display unit is either "Hz" or "rpm", depending on the frequency counter setting.
Example of "Hz" display

シュウハスウカウンタ
CH0
Freq Counter
CH0 2
+1 2 3 4 5 +1 2 3 4 5

Access Window
Hz Hz

Example of "rpm" display

シュウハスウカウンタ Freq Counter


CH0 CH0
+1 2 3 4 5 +1 2 3 4 5
rpm rpm

The display is as follows when the frequency counter is used.

シュウハスウカウンタ Freq Counter


CH0 CH0
_____ _____

The channel No. of displayed frequency counter can be changed through "▲" and "▼".

Alarm

After messages are registered in the alarm relays (CR3300 to CR3415) as device comment, the
messages will be displayed in Access Window automatically when alarm relay is ON. In addition, alarm
logs generated can also be confirmed or deleted.

■ How to use
Devices used during alarming are described below.
Control relay R/W Description
CR3300 to CR3415 R/W Alarm relay (32). Device comment is registered in advance.
Even if one alarm relay exists, CR3500 will also be ON.
CR3500 R When all the alarms in ON state are closed, CR3500 will
be OFF automatically.
CR3501 R/W ON->OFF log is stored.
CR3502 R/W The alarm record in P3-9 will be cleared when OFF->ON

Note
Be sure to operate the alarm relays by the SET and RES instructions. Currently operating
alarm relays can be reset and batch-cleared also by the ARES instruction.

- KV-5000/3000 Series User’s Manual - 2-25


CPU INTERNAL FUNCTIONS

2-1 Access Window

● Register of alarm message


Device comments are registered into alarm relays (CR3300 to CR3415).

Note
The maximum message length displayed in Access Window are half-width characters.
When there are characters other than HEXl 20 to 7e and HEXl al to df in ASCII code, the
device comment is hidden while alarm relay No. is displayed. When device comment isn't

2 set, alarm relay No. will also be displayed.


Access Window

● About alarm log


CPU unit can store up to 64 alarm logs.
In the event of excess of 64, the latest log will replace the earliest one on in sequence.
Each log will store alarm relay No., time (year/month/day/hour/minute/second) and ON/OFF State.
· When ON -> OFF log relay (CR3501) is in OFF state.
Alarm relay is only stored in OFF -> ON state.
· When ON -> OFF log relay CR3501 is in ON state.
Logs will be stored when alarm relay is in OFF -> ON and ON -> OFF state.
The alarm record in P3-9 will be cleared when CR3502 is ON, and CR3582 will be OFF when clearing
is completed.

■ The items that can be operated


The functions that can be operated from Access Window are as follows.
Japanese English Contents to be set
モニタ Monitor Alarm relay in ON state can be monitored in real-time.
リレキ Record Can monitor ON/OFF logs of alarm relay.
リレキクリア Clr Record Clear ON/OFF logs of alarm relay .

■ How to operate
● Switch to alarm

1 Press the "M" key.


A menu is displayed. (If other units are selected, press the "M" key twice.)

2 Select "7. Alarm", press " " key. 


Alarm menu is displayed.

・ モニタ ・ Monitor
・ リレキ ・ Record
・ リレキクリア ・ Clr Record

2-26 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-1 Access Window

● Monitor

1 Select "Monitor" in the Alarm menu, and then press " " key.
The alarm monitor is displayed.
When several alarm relays are in ON state, other alarms can be displayed by pressing "▲" and "▼".

(1)
アラーム モニタ Alarm Mon
2
01/03 01/03

Access Window
Work Error Work Error
(2) アラーム0 Alarm 0

(1) "01/03"
Alarm No. currently displayed/total number of alarms occurred.
When several alarms occur, the alarm with smaller alarm relay No. will be displayed first.
(2) "Work Error"
Comment of the destination device of currently displayed alarms.

TIP · After pressing a certain key, flashing stops.


· In case any alarm occurs when other screens are currently displayed, the alarm monitor
will be displayed automatically.

● Log display

1 Select "Record" in the Alarm menu, and then press " " key.
Alarm logs will be displayed.
Press "▲"key or "▼" key to display previous/next log.

Record 01/04 (1)


(2) Press Alarm
2007/06/14
(4)
15:49:39 ↓ (3)

(1) "01/04"
Alarm log No./ otal number of logs currently displayed.
The latest log No. is "01".
(2) "Press Alarm"
Comment of the destination device of currently displayed logs.
(3) "▼"
It indicates the log when alarm relay switches from ON to OFF. The log when alarm relay switches
from OFF to ON is indicated by "▲".
(4) "2007/06/14 15:49:39"
It indicates the log date and time.

- KV-5000/3000 Series User’s Manual - 2-27


CPU INTERNAL FUNCTIONS

2-1 Access Window

● Log clear

1 Select "ClrRecord" in the Alarm menu, and then press " " key.
The confirmation message of cleared logs will be displayed.

Clr Record

Clr OK?
2
Access Window

2 Hold down the " " key for at least one second.
The following contents are displayed when the logs are cleared.

Clr Record

Clr Done

Press "M" key to return to alarm menu display.

Memory Card

In the Access Window, you can save data and access files from the memory cards.
For details, please refer to"2-2 Memory Card", Page 2-42 .

■ Items that can be operated


The functions that can be operated from Access Window are as follows.
Japanese English Contents to be set
ロード Load Read data from any project folder into CPU unit.
Save the data of CPU unit into memory card. Save ladder
セーブ Save program, device value, device comment, unit setting
Information and log setting Information.
The directory and file list on the memory card are displayed.
ファイルイチラン File List
Moreover, any file in the file list can be deleted.
アキヨウリョウ Free Space Display free space of memory card.

Note
Loading can only be executed in PROM mode.

■ How to operate
● Switch to memory card

1 Press the "M" key.


A menu is displayed. (If other units are selected, press the "M" key twice.)

2-28 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-1 Access Window

2 Select "8. Mermory card" and press " " key.


Memory card menu is displayed.

・ ロード ・ Load
・ セーブ ・ Save
・ ファイルイチラン ・ File List
・ アキヨウリョウ ・ Free Space

2
● Load

Access Window
1 Select "Load" in the memory card menu, and then press " " key.
The folders (projects) in the folder path of memory card are displayed. (files hidden).
The names of file folders are shown as "KvSAVE00 <D>", in which the last three characters are
displayed as "<D>".

KVSAVE00 <D>
KVSAVE01 <D>
AUTO <D>

TIP The updated date and time of file folders can be confirmed by pressing " " key.

2 Select the folder to be loaded by pressing "▲" and "▼" , then press " " key.
Confirmation message of loading execution is displayed.

ロード Load
ロード OK? Load OK?
KVSAVE0 0 <D> KVSAVE0 0 <D>

3 Loading is executed if pressing " " key is displayed for more than 1s.
During loading, the following contents will be displayed.
If you want to cancel loading, press "M" or " " key for less than 1s.

ロード Load

KVSAVE0 0 . YCD KVSAVE0 0 . YCD


62% 62%

Note
If memory card is write-protected, the following diagram is displayed.
Forced loading is executed by pressing " " key for 1s.
Loading is canceled if "M" or " " key is pressed for less than 1s.

ロード Load
ライトプロテクト Protected
ロード OK? Load OK?
KVSAVE0 1 <D> KVSAVE0 1 <D>

- KV-5000/3000 Series User’s Manual - 2-29


CPU INTERNAL FUNCTIONS

2-1 Access Window

4 The following contents are displayed after loading is finished.

ロード Load

ロード カンリョウ Load Done

Press "M" key to return to memory card menu.


2
● Save
Access Window

1 Select "Save" in the memory card menu, and then press " " key.
Confirmation information is displayed, prompting whether CPU data is to be saved.

セーブ Save
セーブ OK? Save OK?

2 Saving is executed if " " key is pressed for more than 1s.
Folders with name KVSAVE?? (?? is 2 half-width number, and a folder with the smallest 2-digit number
will be created and saved.
While saving is implemented, the file names currently being saved and saving progress will be
displayed.

セーブ Save

DM . ZDV DM . ZDV
80% 80%

3 After saving is finished, the name of the saved project folder will be displayed.

セーブ Save
セーブカンリョウ Save Done
ディレクトリメイ Dir Name. .
KVSAVE0 0 KVSAVE0 0

Press "M" key to return to memory card menu.


For saved files, see "2-2 Memory Card", "Saving/reading of Project Data", Page 2-47.

● File list

1 Select "File list " in memory card menu, and press " " key.
The folders (projects) in the folder path of memory card are displayed.
The names of file folders are shown as "KvSAVE00 <D>", in which the last three characters are
displayed as "<D>".

KVSAVE00 <D>
KVSAVE01 <D>
README1 .TXT
README2 .TXT

2-30 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-1 Access Window

2 Select a (project) folder through "▲" and "▼" key, and press " " key.
The files in the directory (project folder) will be displayed.

. <D>
Return to root directory .. <D>
KVSAVE01 YLB
KVSAVE01 YCD

Note
2
The files in the (project) folder cannot be referenced.

Access Window
TIP Press " "key to confirm the updated date and time of file folder or files.

● File delete

1 Select the files or (project) folder to be deleted from the "File list".

2 Hold down the " " key for at least one second with the " " key held down.
The confirmation prompt of "Delete?" is displayed.
If you want to cancel delete operation, press "M" or " " key for less than 1s.
<File>

㩅㩂㩆㩨㨸 &GNGVG
㩅㩂㩆㩨㨸1-! &GNGVG1-!
-85#8'<%& -85#8'<%&

7,3 <Directory>

㩅㩂㩆㩨㨸1-! &GNGVG1-!
㩍㩨㨲㩤㩂㩎㩢㨼㩀 &GNGVG&KT
㩇㩗㩨㩍㩂㩢㨻㩅㩤㩙㩇 %QPVGPU
-85#8'& -85#8'&

3 Press " " key for more than 1s again to perform deleting.
The message for deleting is displayed.

Delete

Wait...

4 After deleting is finished, the screen will return to file list display.

- KV-5000/3000 Series User’s Manual - 2-31


CPU INTERNAL FUNCTIONS

2-1 Access Window

● Free space

1 Select "Free Space" in the memory card menu, then press the " " key.
The following screen will be displayed after free space is verified.

アキヨウリョウ Free Space

5 8 6 4 Kbyte 5 8 6 4 Kbyte
2
Access Window

Commission

Forced set/reset register, input refresh disable, output disable can be released from Access Window.

TIP When registering or disabling is in progress due to write operation to KV STUDIO or CR/CM,
registering or disabling in progress will be displayed automatically in the Access Window. You
can return to original screen by pressing a key, but registering or disabling setting cannot be
released.

■ Items that can be released

Japanese English Description


キョウセイセット Force Set When forced set/reset is registered, they can be released together.
ニュウリョク Input When input refresh disable is set, it can be cleared.
シュツリョク Output When output refresh disable is set, it can be cleared.

■ How to operate
● Switch to commission

1 Press the "M" key.


A menu is displayed. (If other units are selected, press the "M" key twice.)

2 Select "9. Commission" and press " " key.


The commisssion menu is displayed.

・ キョウセイセット ・ ForceSet
・ ニュウリョク ・ Input
・ シュツリョク ・ Output

2-32 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-1 Access Window

● Forced set/reset register release

1 Select "Force Set Regi" in the commission menu, and then press " " key.  
The verification message for collective releasing is displayed.

キョウセイセットリセット ForceSetRegi
イッセイカイジョ Cancel
OK? OK?
2

Access Window
Note
No operation can be performed if a device is not registered as forced set/reset.

2 Hold down the " " key for at least one second.
After collective releasing it, a completion message will be displayed.

キョウセイセットリセット ForceSetRegi
イッセイカイジョ Cancel
カンリョウ Done

● Releas of input refresh disable

1 Select "Input Refresh" in the commission menu, and then press " " key.
The confirmation information of input refresh disable is displayed.

ニュウリョクリフレッシュ InputRefresh
キンシ カイジョ Inhibit
OK? Cancel OK?

Note
No operation can be performed if input refresh disable isn't set.

2 Hold down the " " key for at least one second.
After disable setting is released, a completion message will be displayed.

ニュウリョクリフレッシュ InputRefresh
キンシ カイジョ Inhibit
カンリョウ Cancel Done

- KV-5000/3000 Series User’s Manual - 2-33


CPU INTERNAL FUNCTIONS

2-1 Access Window

● Release of output disable

1 Select "output" in the commission menu, and then press " " key.
The confirmation information of output refresh disable is displayed.

シュツリョク キンシ Output


カイジョ Inhibit
OK? Cancel OK?
2
Access Window

Note
No operation can be performed if output refresh disable isn't set.

2 Hold down the " " key for at least one second.
After disable setting is released, a completion message will be displayed.

シュツリョク キンシ Output


カイジョ Inhibit
カンリョウ Cancel Done

Access Window Setup

The following 2 settings can be changed through Access Window.


Japanese English Contents to be set
コントラスト Contrast Adjust the contrast of LCD screen. (3 to 9)
ゲンゴ Language Set up display language. (Japanese/English)

■ Contrast
To adjust the contrast of LCD screen.

1 Press the "M" key.


A menu is displayed.(If other units are selected, press the "M" key twice.)

2 Press the "▼" and "▲" key, select "7. AW Setting", then press the " " key.
The Access Window setup menu is displayed.

·Contrast
·Language

2-34 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-1 Access Window

3 Press the "▲" key and the "▼" key, select "Contrast", then press the " " key.

コントラスト Contrast

6 6

4 Scroll the contrast value by pressing "▲" and "▼", and adjust to a proper contrast.
Contrast can be set between 3 to 9. 2

Access Window
コントラスト Contrast

5 5

■ Display language
The display language can be selected between Japanese and English. Katakana of Japanese will be
displayed.

1 Press the "M" key.


A menu is displayed. (If other units are selected, press the "M" key twice.)

2 Press the "▲" key and the "▼" key, select "7. AW Setting", then press the " " key.
The Access Window setup menu is displayed.

・ コントラスト ・ Contrast
・ ゲンゴ ・ Language

3 Press the "▲" key and the "▼" key to select "Language", then press " " key for more than 1s.

ゲンゴ Language

ニホンゴ English

4 Switch between Japanese and English by pressing "▲" and "▼".

ゲンゴ Language

English ニホンゴ

5 Hold down the " " key for at least one second.
Language setup is finished.

- KV-5000/3000 Series User’s Manual - 2-35


CPU INTERNAL FUNCTIONS

2-1 Access Window

SRAM Clear Mode

The current memory Nos. of device value, alarm log/error log and file register can be cleared by SRAM
clear. It also restores details set by Access Window setup to their defaults.
Executing this function initializes R, MR, LR, B,CR, T/C (current values), CTH, CM, DM, EM, FM, ZF,W
and Z. Ladder programs, unit setup information, comments, T/C (setting values), CTC, and log setup
2 information will not disappear.
Access Window

Note
SRAM clear can be executed only in the PROG mode.

1 Press the "M" key.


A menu is displayed. (If other units are selected, press the "M" key twice.}

2 Select "11. SRAM clear" through "▲" and "▼" keys, and press " "key.
The SRAM clear confirmation message is displayed.

SRAMクリア S-RAM Clr


クリア OK? Clr OK?

3 Hold down the " " key for at least one second with the " " key held down.
The confirmation screen is displayed again.

SRAMクリア A-RAM Clr


クリア OK? Clr OK?
クリア OK? Clr OK?

4 Hold down the " " key for at least one second when confirmation screen is displayed again to
perform SRAM clear.
The following screen will be displayed while SRAM clear is being executed. When SRAM clear is
finished, a restart will be performed automatically.

オマチクダサイ. . . Wait. . .

Note
If " "key isn't pressed for more than 1s, the message "Please wait---" will not be
displayed, and SRAM clear will be canceled.

2-36 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-1 Access Window

All Clear Mode

The all clear mode returns all settings on the CPU unit to their defaults. (This means that the ladder
program and device values are cleared.)

Note
All clear can be executed only in the PROG mode.
2
1

Access Window
Press the "M" key.
A menu is displayed. (If other units are selected, press the "M" key twice.}

2 Select "12. All clear " through "▲" and "▼" key, and press " "key.
The all clear confirmation message is displayed.

オールクリア All Clr


クリア OK? Clr OK?

3 Hold down the " " key for at least one second with the " " key held down.
The confirmation screen is displayed again.

オールクリア All Clr


クリア OK? Clr OK?
クリア OK? Clr OK?

Pressing the "M" or the " " key cancels the all clear instruction, and the screen returns to the menu
display.

4 Hold down the " " key for at least one second when confirmation message screen is displayed
again to perform all clear.
The following screen will be displayed while all clear is being executed. Whenall clear is finished, a
restart will be performed automatically.

ヤク 3 プン Wait for


オマチクダサイ. . . about 3 min

Note
If " " key isn't pressed for more than 1s, the message "Please wait---" will not be
displayed, and all clear will be canceled.

5 System initialization complete message is displayed.

- KV-5000/3000 Series User’s Manual - 2-37


CPU INTERNAL FUNCTIONS

2-1 Access Window

User Message

User message function is used for displaying any numerical value or ASCII string within 24 half-width
characters in the Access Window through the ladder program.
User message come in two types, user message 1 and user message 2. User message 1 is used to
display values stored in CM1720. When CR2901 is ON, the ASCII 24 half-width characters stored with
2 CM1721 as the leading address, or the characters before end code NULL (00 H) will be displayed.
Access Window

■ How to Display User Message


There are two ways of displaying user message.

(1) Using the AWNUM instruction (user message 1) and AWMSG instruction (user message 2)
User messages can be displayed easily without worrying out control relays (CR) and control memory
(CM) by using dedicated instructions.
When user messages 1 and 2 are ON simultaneously, user message 1 numberical value is displayed
first.
For details on instructions, refer to the "KV-5000/3000/1000 Instruction Reference Manual", "5-14 Access
Window Instructions."

Ladder program Input mode


Execute condition S
AWNUM A W N U M S

Ladder program Input mode


Execute condition S
AWMSG A W M S G S

(2) Create a ladder program using the control relay (CR) and control memory (CM).
To display user message 1, store the displayed numerical value to CM01720 and turn CR2900 ON.
To display user message 2, store the displayed character string (ASCII code) to CM01721 to CM01732
and turn CR2901 ON.
When CR2900 and CR2901 are ON simultaneously, CR2900 is performed first.
(Value stored in CM01720 is displayed.)

■ Display example
● User Message 1
When CR2900 is ON, the numerical value currently stored in CM01720 will be displayed on screen.
In the screen example, the value of CM01720 is set to "12345", and the entire screen flashes.

UsrMessage1:

12345

The screen will return to the original display in the following cases.
· When any of the Access Window keys is pressed. In this case, CR2900 will be OFF.
· When CR2900 is OFF.

2-38 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-1 Access Window

● User Message 2
When CR2901 is ON, 24 half-width ASCII characters stored with CM1721 as the leading address or the
characters before end code NULL (00H) are displayed.

UsrMessage2:

Emergency
Stop!!
2

Access Window
CM No. CM Value (HEX) ASCII Representation
CM1721 $456d Em
CM1722 $6572 er
CM1723 $6765 ge
CM1724 $6e63 nc
CM1725 $7920 y (Space)
CM1726 $2020 (Space) (Space)
CM1727 $2020 (Space) (Space)
CM1728 $2020 (Space) (Space)
CM1729 $5374 St
CM1730 $6f70 op
CM1731 $2021 (Space) !
CM1732 $2100 !(00H)

The entire screen flashes when it displayed.


The screen will return to original display in the following cases.
· When any of the Access Window keys is pressed. In this case, CR2901 will be OFF.
· When CR2901 is OFF.

Operation Disable Setting

The operations on Access Window can be separately disabled according to different functions.
The functions and projects of operation disable setting are as follows.
Function Item
Unit Monitor Change settings
Device mode Change device value
Trimmer mode Change device value
Alarm Clear alarm log
Memory card Load, save, delete
Access Window setup Change settings
All Clear mode Clear
SRAM clear mode Clear

- KV-5000/3000 Series User’s Manual - 2-39


CPU INTERNAL FUNCTIONS

2-1 Access Window

Operation disable setting is used to assign 1 bit to CM1738 for each function, which will be disabled when the
bit is ON.

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

Reserved for system


Unit monitor (setting change disable)
2 Device mode (device value change disable)
Access Window

Trimmer (device value change disable)


Alarm (alarm history clear disable)
Memory card (write, save, delete disable)
AW setting (setting change disable)
All clear, SRAM clear (execute disable)

The following screen is displayed when an attempt is made to perform an disable operation.

AW Message:

Key Input
Disabled

Example
●Write disable setting of digital trimmer ●Write disable setting in device mode

MOV MOV
$0004 CM1738 $0002 CM1738

●Memory card read/write disable ●Setting change disable set by Access Window

MOV MOV
$0010 CM1738 $0020 CM1738

Note
In device mdoe, when device write disable is set, it can not be released in the Access
Window.

2-40 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-1 Access Window

Key Lock Function

Key lock function is used to disable operations in Access Window. This is used when you intend to
make the settings unchanged, or fix the display screen.

■ How to operate
Hold down the "M" key for at least three seconds with the " " key held down.
2

Access Window
● Incase of key unlock
Key lock state is entered when the following screen is displayed.

AW Message

Key Lock

Under the state of key lock, this display remains unchanged irrespective of any operation, unless you
release key lock.

● Incase of key lock


Key lock will be released when the following screen is displayed.

AW Message

Key UnLock

Note
· During the process of key lock, operation is disabled even if direct access switch is
pressed.
· Key lock cannot be achieved during Unit Monitoring and I/O test.

- KV-5000/3000 Series User’s Manual - 2-41


2-2 Memory Card
CPU INTERNAL FUNCTIONS

About the Memory Card

On the KV-5000/3000 Series PLC, you can exchange ladder programs, comments, and various unit
setup information using the memory card. You can also transfer ladder programs or save and load
device values by operation on the KV-5000/3000's access window using only the memory card without
the need for KV STUDIO.
2
· Transferring data from memory card to the CPU
Memory Card

Data can be read by selecting the sub-directory (project folder) on the memory card in the access
window.
Data includes the following: program data such as ladder programs, comments, unit setup
information and logging setup information, and device file data such as DM, EM, W, FM, ZF,CM, R,
MR, LR, and CR.
"Writing/Reading Project Data", Page 2-47

· Auto-read function
Files stored to the directory (project folder) named "AutoLoad" are automatically transferred to the
CPU when the power is turned ON. After storing into the folder named "Run Load", automatic read
will be executed automatically during PROG->RUN switching.
"Auto Load Function", Page 2-50

· Saving data from the CPU unit to the memory card


Program files (ladder programs, comments, unit setup information, logging setup information) and all
device files (DM, EM, W, FM, ZF, CM, R, MR, LR, B, CR) can be saved from the CPU to the memory
card. Saved files are stored to a newly created sub-directory (project folder). The files are saved into
the newly-created (project) folder. The name of folder is generated automatically, and displayed in
the Access Window after normal completion of operation.
"Writing/Reading Project Data", Page 2-47

· Log logging/tracking function


If the logged device and loaded timing (triggering) are registered through KV STUDIO, the data will
be saved automatically into the memory card. Since the data is saved in the format of CSV, it can be
directly loaded into Microsoft Excel, etc.
"2-3 Logging/Tracing", Page 2-52

· Ladder program-based memory card control


The memory card can be accessed from the ladder program when memory card instructions are
used.
Data values of devices on KV-5000/3000 can be saved on the memory card by ladder programs, or
data values of devices can be loaded into KV-5000/300 from the memory card. Free space on the
memory card can also be verified.
"memory card Instructions", Page 2-51

2-42 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-2 Memory Card

● Example for use of a memory card


· Maintenance can be performed easily by a memory card. This allows a quick response to equipment
maintenance and transmission of ladder data due to changes to specifications.

2
6DYHWRPHPRU\FDUG Read ladder

Memory Card
program from memory card
Dedicated terminal is unnecessary

· Logging of device values is easy. Data is tabulated from logs to create data sheets with greater ease.

. Total
Qty

Save data record Read record from memory card


Statistics and documentation with PC

About the Memory Card

■ Memory card that can be used


A memory card and adapter or card reader for reading the memory card are required. Be sure to use
the memory card specified by Keyence.
Operation through memory cards not specified by Keyence is not assured.

· KV-M256/128 256/128 MB, SD memory card

Type SD Memory card


Memory Flash ROM
Memory capacity 256/128MB
Read/Write cycles 300,000 operations (each block)
Operating temperature -25 to +85°C
Storage temperature -40 to +85°C

- KV-5000/3000 Series User’s Manual - 2-43


CPU INTERNAL FUNCTIONS

2-2 Memory Card

■ Used in PC
The connection methods may differ depending upon PCs.

● When the PC has a PCMCIA slot (laptop PC, etc.)


Connect the memory card to the card adapter, and insert the card adapter into the PCMCIA slot on the
personal computer.
2 ● When the PC has a USB port
Memory Card

Connect the USB card reader/writer to the USB port on the PC. Next, insert the memory card into the
card reader/writer.

Note
Only a PC pre-installed with Windows2000/XP Professional can be used.
INSERT

PC with PCMCIA slot


Card adapter

Memory card
KV-M256/128

PC with USB
Card reader

· Memory card adapter


This adapter is used when the memory card KV-M256/128 is to be inserted into the PC card slot on
the PC or card reader/writer on the PC. When the memory card adapter is used, the memory card
can be handled as a PCMCIA2.1/JEIDA4.2-compliant PC card (Type II).
For details on the memory card adapter, refer to the User's Manual provided with the memory card
adapter.
· Card reader/writer
This unit is for reading and writing data on memory cards KV-M256/128 on a PC that has a USB
port. It cannot be used on PCs that do not have a USB port.
For details on the USB card reader/writer for the memory card, refer to the User's Manual provided
with the card reader/writer.

2-44 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-2 Memory Card

■ Used on the KV-5000/3000


● Installing the memory card

1 Slide the lock on the memory card slot cover upwards to open
the memory card slot cover.

Memory Card
2 Insert the memory card into the memory card slot.
The labeling side at right hand is inserted properly with a "click"
sound.

3 After inserting the memory card, close the memory card slot
cover until it clicks into place.
(inside)

● Removing the memory card

1 Make sure that the memory card access LED is out, and slide the
lock on the memory card slot cover upwards to open the memory
card slot cover.

2 Press the memory card in the insertion direction (inwards)


You hear a click sound when the card is inserted properly.
Memory card LED during accessing
Draw out the memory card straight.

3 After removing the memory card, close the memory card slot cover until it clicks into place.

Note Do not use unnecessary force to open the memory card slot cover in a locked state.

- KV-5000/3000 Series User’s Manual - 2-45


CPU INTERNAL FUNCTIONS

2-2 Memory Card

■ Precautions When Using a memory card


The following describes general precautions when using a memory card.

Note · Data saved on a memory card may be lost in the following instances. Note
that Keyence can assume no liability whatsoever if recorded data is lost.

2 You must be very careful.


· When the user or a third party has misused the memory card
Memory Card

· When the memory card has been subjected to static electricity and
electrical noise
· When the memory card has been removed or other equipments have been
turned OFF while the memory card is being accessed (e.g. during saving
or deleting of data)
· We recommend backing up important data on MO disks, CD/DVD or other
storage media.
· Never remove the memory card or turn power OFF while the memory card
access LED on the PLC is lit (indicating that memory card is being read/
written). Doing so might corrupt the data on the memory card.

Note
· In environments subject to severe noise, it may take longer time to access the
memory card.
(In the worst case, this might damage the card or FAT (File AllocationTable).
In this case, attach a ferrite core onto the power cable before use.
·Also, install the unit away from equipment that emits strong electromagnetic fields.
· Accessing of the memory card can not be started with the memory card slot cover
open. Be sure to use memory card with the memory card slot cover closed.
· When the memory card slot cover is opened while the memory card is being accessed,
the process that was being performed is continued until it is completed. However,
subsequent accessing of memory card will not be performed.
· The SD memory card (KV-M256/128) is formatted for maximum performance before
it is shipped from the factory. SD memory cards formatted in Windows can be
used. However, the performance of the SD memory card may not be fully
demonstrated. If the memory card needs to be restored to its initial shipped state,
contact your nearest agent.

2-46 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-2 Memory Card

Writing/Reading Project Data

■ Structure of folder
The data managed by (project) folder on the memory card is described below.
Software File type File name Way of storing
CPU System setting
Ladder program 2
Global label □.YCD*1

Memory Card
Local label
Local Device Comment
Global device comment □.YGC*1 Access window
Setting information of initial KV STUDIO
value of device. □.YDR *1
(File>Memory card)
Communication setting
information □.YAS*1

Unit setting information □.YLB*1


Record/tracing setting
information □.YLG*1

DM DM.ZDV
EM EM.ZDV
KV-5000/3000
FM FM.ZDV*2 *5
CM CM.ZDV
R R.ZDV Access window
Device KV STUDIO
MR MR.ZDV
File (Monitor/simulator
LR LR.ZDV  >Batch change window)
CR CR.ZDV
B B.ZDV
W W.ZDV
ZF ZF.YDV*5
CPU Positioning function KV STUDIO
CPUMB.ZSH*3
Parameter file (File>Memory card)
Access window
Email setting information. MAIL*.YSH(*=0 to 48)*4 KV STUDIO
(Email setup tool)
PROTOCOL STUDIO
KV-L20R PB*.ZSH(*=1A to 48B)*3 PROTOCOL STUDIO
File
PROTOCOL STUDIO 2
File (PS1 compatibe PB*.ZSH(*=1A to 48B)*3 PROTOCOL STUDIO 2
KV-L20V (standard/Large) mode)
PROTOCOL STUDIO 2 Access window
PB*.YSH(*=1A to 48B)
File (Protocol Studio2 mode) PROTOCOL STUDIO 2
Positioning unit
MB*.ZSH(*=1 to 48)
Parameter file
Positioning unit MOTION BUILDER
Positioning unit
MC*.ZSH(*=1 to 48)
Comment file
MV-L40
MLS*.ZSH(*=1 to 18)
Parameter file
MV-L40 MV LINK STUDIO
MV-L40
MLC*.ZSH(*=1 to 18)
Comment file
KV-DN20 KV STUDIO
KV-DN20 DN*.ZSH(*=1 to 48)
Parameter file (KV-DN20 Setup Tool)
KV-CL20 KV STUDIO
KV-CL20 CL*.ZSH(*=1 to 48)
Parameter file (KV-CL20 Setup Tool)
- KV-5000/3000 Series User’s Manual - 2-47
CPU INTERNAL FUNCTIONS

2-2 Memory Card

*1 "□" file name is the same with the name of project folder.
*2 FM saves the FM of current bank, and read to FM of current bank.
*3 You cannot save it from Access Window to memory card. The setting itself is to save in DM or CM, so normal
operation is possible even if the project data not containing such files are read.
*4 When performing email setup through KV-5000's CPU built-in Ethernet function, the setting will be saved by
"MAIL0.YSH".
*5 If reading FM and ZF, it's required to firstly read the data of ZF and then data of FM.

■ Access window
2 ● How to save
Memory Card

If project data are saved from the Access Window of KV-5000/3000, project folders "KVSAVE **"
(**means serial No.: 00 to 99) will be generated automatically. The serial No. is the smallest two-digit
number not yet used for folder name in the memory card.
"Memory Card", Page 2-28

● How to read
Select and read the project folders from Access Window of KV-5000/3000.
"Memory Card", Page 2-28

Tip · Methods of only reading some data


· All data in (project) folder are generally read from memory card.
·For example, if you intend to save only the data of DM, or only save the program data, the
specific data are only read from memory card to CPU unit after they are saved into folders
in the memory card.
· Unnecessary files are deleted via PC from folders in the memory card.
· At power-on, project data saved in the "AutoLoad" (project) folder are read automatically.
· At PROG > RUN, project data saved in the "RunLoad" (project) folder are read automatically.

■ Use KV STUDIO
You can read/write project data of the memory card in the menu of KV STUDIO.

● Ladder program etc. (except device file)

1 Connect memory card to PC.


"Used in PC", Page 2-44

2 Select "File(F)"->"Memory card(M)"->"Write(W)" or "Read(R)" from the menu of KV STUDIO.

2-48 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-2 Memory Card

Create a folder. “New” button is


1 not displayed when reading the
memory card.
Select the drive to which memory
card is assigned DŽ

2
Select the folder for saving data
Display file types
saved in the selected
folder.
2

Memory Card
Note If you select to save in the original folder, the data will be overwritten, the previous
data will be lost.

Tip · If you intend to create new folder for saving, just click
"New" button and enter the folder name to generate an
project folder.The project folder will be created.
· The data in the memory card is managed separately
through project folder.
· To ensure the project data in the memory card is automatically read at power-on, it's
required to save it by the folder name of "AutoLoad".
· To ensure the project data in the memory card is automatically read at PROG->RUN, it's
required to save it by the folder name of "RunLoad".

● Device file

1 Connect memory card to PC.


"Used in PC", Page 2-44

2 Select "Monitor/simulator(N)"-> "Uniform change window(D)" from the menu of KV STUDIO.

- KV-5000/3000 Series User’s Manual - 2-49


CPU INTERNAL FUNCTIONS

2-2 Memory Card

3 Select "File (F)" -> "Read memory card (R)" or "Save to memory card (Z)" from the menu of the
uniform change window.
Read: specify the read drive and folder name.
Save: save the registered device and current value.

Tip If the device's default setting of KV STUDIO is employed, the device value can also be
2 managed through the memory card.
Memory Card

Auto Load Function

At power-on or PROG -> RUN, the project data saved in the memory card will be automatically.

■ Reading at power on.

1 Using KV STUDIO, write project data into the memory card by the folder name of "AutoLoad".
"Ladder program etc. (except device file)", Page 2-48

2 Insert the memory card into memory card slot of KV-5000/3000, close the slot cover until a
"click" is heard.

3 Turn on power of KV-5000/3000.


Data are read automatically.

Note
If CPU system of KV STUDIO is set to read/write protection, an error will occur and
operation can not be performed.

■ Read at PROG -> RUN

1 Using KV STUDIO, write project data into the memory card by the folder name of "RunLoad".
"Ladder program etc. (except device file)", Page 2-48

2 Insert the memory card into memory card slot of KV-5000/3000, close the slot cover until a
"click" is heard.

3 Perfom PROG->RUN switching of KV-5000/3000.


Data are read automatically and operation is started.

Note
If CPU system of KV STUDIO is set to read/write protection, an error will occur and
operation can not be performed.

2-50 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-2 Memory Card

Memory Card Instructions

The memory card can be accessed from the ladder program when memory card instructions are used.

Data stored in continuous speficied devices will be


stored in memory card after executing MWRIT Folder will be created in memory card after
executing MMKDIR instruction.
instruction.
Example: data stored in DM000 to DM 009 will be
stored in memory card in CSV format.
Example: create “\ABC” folder. 2

Memory Card
Delete specified folder and file after
executing MRKDIR/MDEL instruction.

MMKDIR

MRKDIR/MDEL
Read
MWRIT

Write
MREAD

MFREE Memory card PC


(Microsoft Excel etc.)
KV-5000/3000
Example: when storing data in DM0 to DM 9 in “XYZ” file in “ABC” folder
Read data stored in memory After executing on memory card in CSV format.
card and write to continuous MFREE , check \ABC\XYZ.CSV
devices after executing MREAD available space in
instruction. memory card and 12345, -123,0,678,9876,12, -45,67890,345,876
Example: read data stored in write the result to
DM0 to DM 09 in memory specified device in ↑ǂǂǂǂǂǂǂǂǂǂǂǂǂǂǂǂǂǂǂǂǂǂǂ↑
card in CSV format and byte. Used for DM0ǂUsed for DM9
write to PLC.

Please see KV-5000/3000/1000 series Instruction Reference Manual "5-9 Memory Card"

- KV-5000/3000 Series User’s Manual - 2-51


2-3 Logging/Tracing
CPU INTERNAL FUNCTIONS

Overview

● Logging function
The logging function of KV-5000/3000 means that the state or value of specified device is loaded by
any timing (triggering). The loaded data is automatically saved into the memory card in the format of

2 CSV. Device loading or triggering can be easily set through KV STUDIO。


Since the data is saved in the format of CSV, it can be directly loaded into Microsoft Excel, etc.
Logging/Tracing

Auto save device data


as CSV file
Read

Memory card PC
(Microsoft Excel etc.)
KV-5000/3000

● Tracing Function
As in the case of logging function, the state or value of device will be recorded in buffer memory.
According to the timing when saving the files, the preceding and subsequent files of specified data size
are extracted and recorded into memory card or internal memory.
For example, after trigger setting is made for saving files in the event of abnormality of equipment, the
data prior to or after occurrence of abnormality will be saved automatically, which facilitates abnormality
analysis.

SRAM Memory card


Time
Date time DM11 DM12 DM13 Buffer area
Date time DM11 DM12 DM13
Date time DM11 DM12 DM13
Date time DM11 DM12 DM13 Date before
Date time DM11 DM12 DM13 triggering
Date time DM11 DM12 DM13
File saving trigger Date time DM11 DM12 DM13
Date time DM11 DM12 DM13 Date after
Auto save as CVS file
triggering
Date time DM11 DM12 DM13
Date time DM11 DM12 DM13
Date time DM11 DM12 DM13

Routine record

TIP After the file save destination is set as "internal memory", the data saved can be read from the
real-time diagram monitor of KV STUDIO.

2-52 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-3 Logging/Tracing

How to Use

The steps of using logging/tracing functions are described below.

(1) Setup device and trigger


"Tool (T)" - "Logging/tracing setting (L)"
"Setup", Page 2-53
2

Logging/Tracing
(2) Create the ladder program
“LOGE””LOGD””TRGD" instruction
"Log Instructions", Page 2-63

(3) Transfer to KV-5000/3000


"Monitor/simulator (N)" - "PLC transmission" -> "Monitor (C)"

(4) Execute Logging/tracing


Install memory card onto KV-5000/3000, and execute
LOGE instruction to generate log trigger (file saving trigger
shall also be performed during tracing).

Setup

Set up through KV STUDIO to use logging/tracing function.


The following settings are required when using logging/tracing function.
· Save the settings of file name.
· Setting of logging/tracing device
· Setting of trigger.
· Options setting
· Detailed setting of tracing (only when tracing function is selected)
logging/tracing function permits to create up to 10 files, and divides them through logging/tracing ID (0 to 9).
Set separately the file names, device and trigger depending upon every logging/tracing ID.

- KV-5000/3000 Series User’s Manual - 2-53


CPU INTERNAL FUNCTIONS

2-3 Logging/Tracing

1 Select "Tool (T)" -> "Set up logging" from the menu.


"List of logging settings list" dialog box is displayed.

Other procedure ·Click the " " button.

2
Logging/Tracing

Item Description
Status The current execution state is displayed during monitoring/on-line edition.
Function The functions (logging/tracing) already set are displayed
File path preview An example of file saving position (file path) is displayed.
Comment File comment already set is displayed.
Setup "Logging/tracing setting" dialog box is displayed. The selected logging/tracing ID is set.
Delete Delete the setting of selected logging/tracing ID.
OK Confirm the setting contents and close the dialog box.
Cancel Cancel the setting contents and close the dialog box.
The customized monitor of selected logging/tracing ID is displayed during
Custom Monitor
monitoring process.
The selected logging/tracing ID is implemented only during monitoring process
Start
(Ladder Program first)
The selected logging/tracing ID is implemented only during monitoring process
Stop
(Ladder Program first)

2 Select logging/tracing ID to be set, and press "Set up" button.


Logging/tracing setting" dialog box is displayed.
Item Description
File path preview An example of file saving position (file path) is displayed.
Set the file comment,which can be inserted into 1st line of DBC case 64
File Comment
characters CSV files.
Function Selection (Logging/tracing).

2-54 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-3 Logging/Tracing

File name

To set the files to be saved.


Name of folder for saving files will be determineal depending on every logging/tracing ID. (LOG0 to
LOG9)
TIP If the file saving destination is "internal memory" when tracing function is used, the items
specific to "File Names" cannot be set.
2

Logging/Tracing
Data of log files are saved on the memory
card by the following forms.

Example
Folder File
Root

Item Description
File No. Select from "Auto numbering/Fixed/Dev val (lower 3 dgts)".
Auto numbering*1 Between 0 to 999, use the minimum unused file No.
No. upper limit Set the upper limit (0 to 999) of file NO.
Start operation Select operation at logging start from "New file/Add to latest file".
If there isn't remaining No., please select "Overwrite from the oldest file/
When noempty No.
Stop logging".
File No.

Fix Specify the fixed value between 0 to 999.


No. Set up file No.(0 to 999).
When the same files When there are same files, select "Add to the old file/Add".
Device value (use last 3
Specify using word device value (0 to 999) when enabling is performed.
digits)
Device Set the device for saving file No.
When the same file When there are same files, select "Add to the old file/Add".
String*2 Set the character strings attached to the file names.
If this option box is selected, the file name will contain date and time
information of creation. The date and time information is fixed as the time
when reading the new. So, the file name isn't changed when adding.
Date/time*2 Original files are deleted when overwriting the existing ones, so, the date
and time information of new files is the information when file is created.
Year (00 to 99), month(01 to 12), day(01 to 31), hour(00 to 23),
minute (00 to 59)

- KV-5000/3000 Series User’s Manual - 2-55


CPU INTERNAL FUNCTIONS

2-3 Logging/Tracing

*1 After retrieving of remaining No., you may prepare to save data to the files. In this case, the relay for
logging the working condition is ON. Buffer overflow is liable to occur if trigger is previously activated, so
don't activate the trigger after the relay for logging the working condition is ON.
The higher the upper limit of No., the longer the time for retrieving remaining NO. The required time is
about 15s when the upper limit of No. is 999.

*2 When log ID4, file NO. 2, character string "KEYENCE", time information (in YY/MM/DD/HH/MM) are
2 selected and file is created at 14:15, Jun 13, 2007, "log002_KEYENCE0706131415.csv" will be
generated under folder "log4" of the memory card.
Logging/Tracing

       File name:  log (File No.) _ (Character string) (Date)

Up to 32 half-width characters

Note
“KV-5000/3000" PLC identifies files through folder name (log ID) and file No. (without
consideration of character string, date and time.)
Under the same folder logging ID in the memory card, don't use PC to create several files of
different character strings or date/time with the same file No.

Device

To set the saved devices by mixing the bit device and word device.
At most 128 devices can be set for every logging ID.
Example

(1) When all 128 devices are set to the bit device:
ON/OFF state (0 or 1) of 128 bit devices will be logged.
(2) When all 128 devices are set to the word device with
1 words:
Values of 128 word devices with 1 words will be logged.
(3) When all 128 devices are set to the word device with
2 words:
Value of 64 word devices with 2 words will be logged.

Item Description
"Logging/tracing device setting" dialog box is displayed when "Add" button is pressed. The
Add
logging/tracing device is added.
Select the changed device. Press "Change" button to display "Logging/tracing device
Change
setting"dialog box. The logging/tracing device setting is changed.
Delete Press “Delete" button to delete the selected device. (Multiple device can be selected)
Up Shift the selected device up in the registering sequence.
Down Shift the selected device down in the registering sequence.

2-56 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-3 Logging/Tracing

Project Description
2

Logging/Tracing
Set the logging/tracing destination device.
Target device*1
Press the button to select from the device comments.

Select from "DEX16BIT/DEX 32BIT/±DEX 16BIT/±DEX 32BIT/


Data format
HEX 16BIT/HEX 32BIT/ASCII16BIT/FLOAT".
Set only when "ASCII16BIT" data format is selected.
Number of words
Setting range: 1 to 16
Place the device set through destination device on the front part, and set the number of
Continuous number
devices for continuous logging/tracing.

*1 Destination device
bit: R / MR / LR / CR / T (Contact) / C (Contact)/ CTC (Contact)
word: DM/EM/FM/ZF/W/CM/TM/TC(Timer current value)/CC(Counter current value)
CTH/TRM (trimmer) / Z

Trigger

To set timing of logging/tracing of registered devices.

- KV-5000/3000 Series User’s Manual - 2-57


CPU INTERNAL FUNCTIONS

2-3 Logging/Tracing

Item Description
Type *1 Select trigger types from "Bit device/period/trigger instruction (TRGD)".
Set bit device
Bit device
Press the button to select from the device comments.

cycle Set the cycle (1 to 86400000) (unit: ms).


Start

2 cycle
trigger
when If the checkbox is selected, trigger is activated when logging/tracing is started.
Logging/Tracing

starting
logging
Triggering occurs when TRGD instruction is executed.
Trigger instruction
"TRGD Instruction", Page 2-66
*1 Bit device
Logging/tracing is run when the specified bit device is in ON state.
Referenced to the processing state of END, the state of bit device isn't logged when ON/OFF during 1
scan.
   Device value at END processing of detecting trigger is saved.
If bit device is ON, the device value for each scan and END processing will be saved.

   cycle
Through the built-in timer of KV-5000/3000, logging/tracing according to the specified interval time is
run.
Device value at END processing of detecting trigger.
Every scanning is performed when specified time is less than scanning time.
Time interval is calculated starting from the operation of logging/tracing.
In PROG mode, the timing of time interval is reset.

Note
Through END processing after trigger is activated, the specified device value is read. Thus,
at most 1 scan can be delayed from trigger activation to device value saving.

   TRGD instruction
The device value when performing TRGD instruction is loaded, without the need of waiting for END
processing.
At most 8 value can be logged in the program for 1 ID.
Logging is also performed in the interruption program or fixed period module.

2-58 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-3 Logging/Tracing

Option

To set the detailed condition of additional information or operation. When the tracing functions is
selected, no setting can be done if the file saving destination is "internal memory".

Logging/Tracing
Item Description
Insert file comment into the If the checkbox is selected, file comment will be inserted at the beginning
leading of CSV file. of CSV file.
Add comments row of device *1 If the checkbox is selected, the device's comment line will be inserted.
Add instruction

Attach time stamp to each row *2 If the checkbox is selected, time interval at each line will be added.
If the checkbox is selected, data No. will be added at each line. Logging/
tracing will be started from 0. When setting file No. and selecting "Add", No.
Add data No. to each row will be started from 0 at the middle of file (the position for starting adding).
In the event of buffer overflow and unexpected situation, the time of
occurrence of unexpected situation can be clearly learnt from the data No..
Add data obtain span to each row The lapse time from Captured latest data is logged (unit: 1s), up to 3600s.
Write to memory eard at every If the checkbox is selected, saving on memory card will be performed
trigger*3 (only logging).
Operation

whenever trigger is activated.


If the checkbox is selected and memory card is removed during logging
Auto-restart logging by inserting
process, the logging data is saved in the memory of CPU until the memory
memory card*4(Only logging)
card is inserted next time. Memory card is restarted once inserted.
Upper limit of file capacity If the checkbox is selected, the upper limit of the file capacity can be set.
(Only logging) "About processing at capacity overflow", Page 2-72
Upper limit*5(Only logging) The upper limit is set by line or KB.
*1 The device for which the device comment is not transferred to CPU unit will be stored to a device No.(e.g. DM0).
*2 The year, month, day, hour, minute and second in the time stamp are saved in the format of CSV.
    Example 2004/12/13,14:15:16
*3 The files are always in open state during logging process. If power is switched off when the files are in
open state, the logged results will not be saved on the memory card.

- KV-5000/3000 Series User’s Manual - 2-59


CPU INTERNAL FUNCTIONS

2-3 Logging/Tracing

If the checkbox is selected (Write to memory card at every trigger), as long as saving is completed after
trigger, the logged results will remain in the memory card even if the power is off.
However, if the power is off when being saved into the memory card, the data in the memory card may be
lost.
To perform writing to memory card at each trigger, the access time to the memory card will become
longer. Thus, buffer overflow will likely occur. When the trigger interval is short, please uncheck "Write to
memory card at every trigger".
2 *4 This function is "Auto restart", not "Auto start". When LOGE instruction is executed and memory card isn't
inserted into the unit, the log error relay will be opened without starting logging.
Logging/Tracing

"Auto restart" refers to the function that a restart will be performed when the memory card is inserted.
*5 The number of lines, file comment and device comment occupy 1 line respectively.
File size indicates the size including all file comments and device comments.
"Program Capacity", Page 3-11

Trace detail setting

Setting is allowed when tracing function is selected.


Triggering or saving method when the files are saved will be set.

2-60 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-3 Logging/Tracing

Item Description
File *3
Set bit device
Saving Device Press the button to select from the device comments.
trigger
Trigger Trigger data size (%) Press % to set the data size after trigger. Slider can also set up.
position Trigger data size (point)*1 The data size set by % is displayed by number of points.
Saving (destination)*2 Select from "Memory card/internal memory".
*1 Open "CPU system setting" from work space, then set the data size to be saved through "System
2
setting" -> "CPU unit buffer capacity setting".

Logging/Tracing
After the used ID capacity is increased, the data size (number of samples) that can be saved will become bigger.
Avoid exceeding total capacity 1024kB when setting.
*2 When internal memory is selected, read data will be read from "Real-time diagram monitor".
KV STUDIO user's manual "Real-time diagram monitor"
When power is off, the data saved in the internal memory will be lost.
*3 When trigger type is "TRGD instruction", the file saving/triggering state will be confirmed only
when TRGD instruction/function executed.

About CSV File

■ CSV files
CSV files generated automatically through logging/tracing function comprise device data, additional
data information and additional file information. The character length column (separated by comma)
fixed. In the event of lacing characters of data, spaces will be inserted automatically. A half-width
character is counted as 1 character, and a full-width character is counted as 2 characters. In addition,
these letters align left if the data format is ACII character string, otherwise align right. 
● File additional information
The following items will be saved from the first line of the file according to the setting contents "Options"
tab of "logging/tracing setting" dialog box.
Item 1 column character length Example Note
The length of 1st line includes 64
File Comment 64 Header characters." " is not included in the
character length.

- KV-5000/3000 Series User’s Manual - 2-61


CPU INTERNAL FUNCTIONS

2-3 Logging/Tracing

Item 1 column character length Example Note


" " is not included in the character length.
File saving trigger state "TRIGGER DATA NO"
32 Llogged in 1st line according to the
(only tracing) "COMM TRIGGER DATA NO"
position of occurrence.
File saving trigger occurring The data No. is logged when file
10 1234567890
position (only tracing) saving trigger is activated.
Device Comments 32 …, "Starting relay" ,… " " is not included in the character length.

2 *Doesn't include comma.


Logging/Tracing

● Additional data information


According to the setting contents in the "Option", the following items are saved from the left side of device data in sequence.
Item 1 Column character length Example
Data No. 10 1234567890
Timing flag(date) 10 2007/06/11
Timing flag(time) 8 11:12:13
Data capture interval 10 1234567890
*Doesn't include comma.

● Device data
According to the setting of "Device", it's saved by the following character length.
Item 1 Column character length* Example Note
Bit device 1 …,1,… ON:1 OFF: 0
No "+" is added in the case of
±DEX16 bits 6 …, -1234,…
positive value.
decimal 16 bist 5 …, 1234,… -
No "+" is added in the case of
±DEX32 bits 11 …, 1234567890,…
positive value.
DEX 32 bits 10 …, 123456789,… -
HEX 16 bits 4 …,BA98,…
HEX 32 bits 8 …,BA987654,…
FLOAT 13 …, 2.4123E+12,… Exponent format is fixed.
If NULL exists in the character
ASCII16BIT (words)×2+2 …,”a123” … ,… string, the subsequent character
strings are not logged.

■ CSV File sample


Data No. File Comment Check time stamp Device Comment

Maf.Dim.Error File comment line


Qty. Dim.Error Total Qty. Abnormal Error Comment line of device

Data line

2-62 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-3 Logging/Tracing

Log Instructions
To implement the logging operation, a program for using logging instruction can be written.
Instruction mnemonics Description about instruction Page
Enable logging/tracing LOGE Set logging of ID logging/tracing to enabled/disabled 2-64
Disable logging/rracing LOGD state 2-64
Capture log data TRGD Capture log data of ID specified. 2-66
2

Logging/Tracing

- KV-5000/3000 Series User’s Manual - 2-63


CPU INTERNAL FUNCTIONS

2-3 Logging/Tracing

LOGE LOGE Enable logging/tracing Set logging of logging/


tracing to enabled/disabled
LOGD LOGD Disable logging/tracing state

Ladder program Input mode


Execute condition n
2 LOGE L O G E n

Execute condition n
Logging/Tracing

LOGD L O G D n

Available devices
Index
Cons Indirect Local change
Bit device Word device tant specifying Device
Operand
MR DM EM
R (DR) LR T C CTC CR FM (ZF) T C CTH CTC Z CM #/$ #TM * @ : #/: Z
B TM (W)
n ○ - ○ - - - ○ ○ ○ ○ ○ ○ ○ ○ *1 - ○ ○ ○

Operand Description
n Logging/tracing specifying ID (0 to 9).*1 *2
*1 Cannot be specified in "$".
*2 When bit device is specified in n , continuous 16 bit will be occupied.
If word device is specified, 1 word will be occupied.

Description of Operation

LOGE When execute condition is ON, n will set ID of specified logging/tracingto enabled state.
When the instruction is performed, CPU unit buffer of specified ID is cleared, and the
logging/tracing operation relay is set. When a trigger is activated, logging/tracing will be
performed.
Operation enable state will continue before LOGD instruction is executed, independent of
the execution condition of the LOGE instruction.
The logging/tracing of all log IDs can enter into operation enable state under the same
execution condition.

LOGD When execute condition is ON, n will set ID of specified logging/tracing as disabled state.
After the instruction is executed, logging/tracing operation relay of every ID is reset, then
logging/tracing is stopped. All log contents till now are output to memory card.
Log ID Logging operation relay
0 CR000
1 CR100
2 CR200
3 CR300
4 CR400
5 CR500
6 CR600
7 CR700
8 CR800
9 CR900

2-64 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-3 Logging/Tracing

Timing curve of logging/tracing


Scan

Logging/tracing operation relay

Trigger
(Bit device)

Execute

Execute
Execute

Execute
Execute record/tracing

Logging/Tracing
Scan

Logging/tracing operation relay

Trigger (cycle)
Execute

Execute
Execute

Logging/tracing operation relay Execute

Operation flag

CR2009 No change in status


CR2010 No change in status
CR2011 No change in status
It's ON when a value larger than 10 is specified in n , or in direct specifying and index change
CR2012 range are not suitable; it is OFF in other cases. There is no change when indirect specifying and
index change are not specified in operand.
* If CR2012 is ON, the instruction will be not executed.
When CR2012 is ON, the detailed error message is saved into CM5100 to CM5176.
"Error Log (CM)", Page 3-20

Sample Program

When input R000 is ON, logging/tracing of ID5 enters into operation enable state.

R000 #5 ;(mnemonics list)


LOGE LD R000
LOGE #5

When input R001 is ON, logging/tracing of ID5 enters into operation disable state.

R001 #5 ;(mnemonics list)


LOGD LD R001
LOGE #5

- KV-5000/3000 Series User’s Manual - 2-65


CPU INTERNAL FUNCTIONS

2-3 Logging/Tracing

TRGD TRGD Capture log data Capture log data of specified ID.

Ladder program Input mode


Execute condition n
TRGD T R G D n

2 Available devices
Index
Logging/Tracing

Cons Indirect Local Change


Bit device Word device
Operand tant specifying Device
MR DM EM
R DR LR T C CTC CR FM ZF T C CTH CTC Z CM #/$ #TM * @ : #/: Z
B TM (W)
n ○ - ○ - - - ○ ○ ○ ○ ○ ○ ○ ○ ○ - ○ ○ ○

Operand Description
n Specify the logging/tracing ID for capturing, or save the first device of logging/tracing ID. *1
*1 Specify the logging ID between 0 to 10. Please specify "10" when trigger by instruction is used in real-
time diagram monitor.

Description of Operation

TRGD When execution condition is ON, data of logging/tracing ID in n will be captured.


· Capture the data until TRGD instruction is performed.
Data can be Captured during END processing when bit device or period for triggering
logging/tracing; if TRGD instruction is used, data can be Captured anytime from the ladder.

Note
· At most 8 TRGD instructions can be used by 1 project for 1 ID.
· If data is captured through TRGD instruction, it's required to set the trigger type to
"instruction trigger" when setting up logging/tracing or "Real-time diagram monitor" of KV
STUDIO. In the absence of such settings, no data can be captured even if TRGD
instruction is performed.

Operation flag

CR2009 No change in status


CR2010 No change in status
CR2011 No change in status
· It is ON when the operand value is beyond the specified range.
· It is ON when indirect specifying, and pointer change range are not suitable.
CR2012
Otherwise, the value is OFF.
· No change will occur when n is specified as a constant.
* If CR2012 is ON, the instruction will not be executed.
When CR2012 is ON, detailed error info are stored in CM5100 to CM5176.
"Error Log (CM)", Page 3-20

2-66 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-3 Logging/Tracing

Sample Program

If the following ladder program is included in the fixed period module, logging will be performed every period.

CR2002 #0 ;(mnemonics list)


TGRD LD CR2002
TRGD #0
Always ON

2
Note

Logging/Tracing
When fixed period module is implemented, it's necessary to set it to interrupt enable state
(perform EI instruction).

"Fixed-Period Module", Page 3-99


"3-5 Interrupt", Page 3-31

Device List for Logging/Tracing

Control information and error information for logging/tracing are assigned to the control relay and
control memory.
Control relays include control relays for each logging/tracing ID and a relay only resvered for the
system.

Note
The control relay/control memory is reflected through END processing. Under locking state,
no results can be reflected prior to END processing, even if operation is performed.

■ Devices of IDs

Device No. of logging/tracing IDs (0 to 9) Attribute


R: Read only Content
ID0 ID1 ID2 … ID9 Blank: R/W

CR000 CR100 CR200 ··· CR900 Execute logging/tracing


CR001 CR101 CR201 ··· CR901 R Logging/tracing operation in progress
CR002 CR102 CR202 ··· CR902 R Logging/tracing file write complete
CR003 CR103 CR203 ··· CR903 R Alarm for 50% logging buffer or less
CR004 CR104 CR204 ··· CR904 R Logging buffer overflow
CR005 CR105 CR205 ··· CR905 R RUN writing during logging
CR008 CR108 CR208 ··· CR908 R Logging/tracing error
Error of insufficient capacity of
CR009 CR109 CR209 ··· CR909 R
memory card
CR010 CR110 CR210 ··· CR910 R Device/trigger setting abnormal
Monitoring of tracing file writing
CR011 CR111 CR211 ··· CR911 R
trigger
CR012 CR112 CR212 ··· CR912 R Tracing data capture complete
CM1660 CM1661 CM1662 ··· CM1669 R Buffer free space (in Kbyte)
CM1680 CM1681 CM1682 ··· CM1689 R File storing counter

- KV-5000/3000 Series User’s Manual - 2-67


CPU INTERNAL FUNCTIONS

2-3 Logging/Tracing

■ Common devices

Attribute
Device No. R: Read only Content
Blank: R/W

CR3210 R Arbitrary logging/tracing memory card in use


CR3211 R Memory card in use
CR3212 R Memory card identification complete

2 CR3213
CR3215
R
R
With memory card
Memory card write protect
CM2391 Power OFF during memory card access
Logging/Tracing

■ Details of devices
● Logging/tracing operation relay
To enable and disable logging/tracing. It is set when logging/tracing instruction (LOGE) is performed, or
logging/tracing is started through KV STUDIO, generally no direct operation is required.
When this relay is ON, all state relays of the same logging/tracing ID will be OFF.
It will be reset when an error occurs.

● Logging/tracing in progress relay


In fact, it's ON when logging/tracing is run.

● Logging/tracing file write complete relay


When logging is used: the relay is ON when data larger than upper limit of the specified file capacity are
saved in every file.
When tracing is used: the relay is ON when data have been written into file or internal memory
When the relay is ON, logging/tracing will be stopped; the logging/tracing operation relay will be OFF.
"About processing at capacity overflow", Page 2-72

● Alarm relay when the logging buffer is below 50%


Since the triggering frequency is higher than writing speed, the relay is ON when the residual capacity
of buffer is below 50%. When data larger than upper limit of the specified file capacity are stored, the
relay is ON.

● Buffer overflow relay


If the data cannot be duly written into the memory card, the logging/tracing buffer overflows.
When the relay is in ON state, data abnormity occurs. Observe the data No. to know when data
abnormity occurs.
Even if overflow occures, data will continue to be written into the memory card.
When overflow occurs, the following measures can be taken to alleviate overflow.
· Reduce the frequency of access to the memory card
· Reduce data size and frequency trigger
· Prolong the scanning time.

2-68 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-3 Logging/Tracing

● Store in RUN during logging/tracing relay


It will be ON when logging/tracing is in progress, and writing is performed in RUN.
When writing is performed in RUN, logging/tracing continues, the speed of writing into memory card will
change, leading to buffer overflow easily.

● Logging/tracing error relay


When tracing function is used, it's in ON state after writing file is triggered. In this case, the residual 2
data in the buffer will disappear. When LOGE instruction is executed the next time error will be cleared.

Logging/Tracing
● Memory card without remaining space error relay
When the memory card has no sufficient remaining space, it's ON.
When the relay is ON, logging/tracing will be completed. When logging/tracing failure relay is ON, the
logging/tracing relay will be OFF. In this case, the residual data in the buffer will disappear. When LOGE
instruction is executed the next time, error will be cleared.

● Device/trigger setting abnormal relay


In the case of abnormal device setting and trigger setting for logging/tracing, it's ON.
When the relay is ON, logging/tracing will be completed. When logging/tracing error relay is ON, the
logging/tracing relay will be OFF.

● Tracing file storing trigger monitor relay


When tracing function is used, it's in ON state after file storing is triggered.

● Tracing data capture complete relay


When tracing function is used, and after file writing is triggered, it's in ON state when the data size set
correspondingly has captured.

● Buffer free space (in Kbyte)


The buffer's free space is written in Kbyte.
When logging is used: you can control the bufferis free sapce. In case the value becomes smaller,
the possibility of buffer overflow increases.
When tracing is used: the buffer's overall capacity is shown before file storing is triggered. After file
writing is triggered, the captured residual data size will be displayed after
tracing is finished.

● File storing counter


Increase 1 each time file storing is performed.
Counting is performed within the range of 0 to 65535, and can be stored even if power is off.

● Arbitrary logging/tracing memory card in use relay


It's ON when more than one of logging/tracing ID 0 to 9 is in logging/tracing.
When other functions are used, it can e used to verify if logging/tracing is active.

- KV-5000/3000 Series User’s Manual - 2-69


CPU INTERNAL FUNCTIONS

2-3 Logging/Tracing

● Memory card is in use relay


When memory card is used, it's ON. This relay is ON when memory card is used independent of
logging/tracing functions.

● Memory card identification complete relay


When memory card is inserted, slot cover of memory card closed, initialization finished,and ready for
2 the relay will be ON when it's ready.
Logging/Tracing

● With memory card relay


When memory card is inserted and slot cover of memory card is closed, it will be ON.

● Memory Card write protect relay


It will be ON when memory card is inserted and wirte protected.

● Power OFF during memory card access


If the power is ON in the process of access to memory card, an error will occur, and the value except for
0 will be stored.
The value cannot be cleared automatically.

Logging/Tracing Function Precautions

The following describes the precautions on using the logging function.


"Used on the KV-5000/3000", Page 2-45 and "Precautions When Using a memory card", Page 2-46.

● Storing speed
· Max. scan time in execution of logging/tracing is "3+6 x number of IDs in use" ms.
· When several triggers are activated simultaneously, the access volume to the Memory Card
increases. So, the scan time will be longer, buffer overflow is liable to occur.
TIP The data failure can be improved by setting of certain scanning time or END processing time.
"Fixed Scan Time (FST) Operation", Page 3-23
"Enable END proceeding time", Page 3-25

● Order of accessing to Memory Card


· During logging/tracing, the order of accessing priority on the Memory Card is as follows:
Memory Card instructions -> logging/tracing instructions -> FTP server functions, file operations in the
access window
For this reason, the Memory Card sometimes cannot be used by other functions when a large
amount of logging triggers are being activated.

2-70 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-3 Logging/Tracing

● Power OFF, memory card insertion/removal


Before removing the Memory Card with the PLC still turned ON, make sure that the Memory Card access
LED is out. Data is not saved during logging/tracing if the Memory Card is not removed by this procedure.
Handling of the Memory Card slot cover
· Logging/tracing will not be started if the Memory Card slot cover is not closed.
Procautions during power off and card insertion/removal
· Never remove the Memory Card or turn the KV-1000 OFF while the Memory Card access LED on the 2
PLC is lit (indicating that data is being read from or written to the Memory Card). Doing so might

Logging/Tracing
corrupt the data on the Memory Card.
· When power is turned OFF while logging/tracing is being executed, data will not be saved to the Memory
Card.
· When the Memory Card slot cover is opened while the Memory Card is being accessed, the process
that is being performed at that time is continued until it is completed. However, subsequent
processing is no longer accepted on the Memory Card.
Replacing Memory Card
· Replace Memory Card by the following procedure.
"Used on the KV-5000/3000", Page 2-45
· If auto-restart is logging/tracing by Memory Card insertion is set in the logging settings of KVSTUDIO,
when Memory Card is removed during execution of logging, the logging data is stored in memory until
the Memory Card is next inserted. When the Memory Card is inserted, data stored in memory will be
written to the Memory Card. At this time, the logging error relay will not be ON. If there is a long period
between the Memory Card is inserted next time or many triggers have been generated, a buffer
overflow will occurs and some data may be lost.  
When "auto-restart logging/tracing by Memory Card insertion is not set, never remove the Memory
Card while logging is being executed. Doing so might corrupt the data on the Memory Card.

● Operation during rewriting in RUN mode


· Logging execution slows down very much when rewriting is performed in RUN mode. This makes it
more likely for buffer overflow to occur.In addition, you can write logging/tracing setting in RUN mode,
but this setting is enabled only when next logging/tracing is started.

● Operation when switching between RUN and PROG mode


· The logging function is active only in the RUN mode. When RUN -> PROG switching is performed, all
logging/tracing operations will stop.
As in the case when LOGD instruction is executed, the logging details up to this moment are output to the Memory
Card. Also, when PROG -> RUN swiching is performed, the LOGE instruction must be executed to
start logging/tracing, as all logging/tracing operations are in a stopped state.

● Processing at start of logging/tracing


When power is turned ON, and logging/tracing is enabled, if specified file exists (setting "Auto
numbering") without remaining No., the following procedures will be performed.
When specifying method of file No. is "Auto numbering."
· When performing "New file" without remaining No.:
Processed according to "Processing at capacity exceeded".

- KV-5000/3000 Series User’s Manual - 2-71


CPU INTERNAL FUNCTIONS

2-3 Logging/Tracing

· When "Add to latest file" is performed, and latest file capacity overflow occurs:
The files with remaining No. will be used. If no remaining No. exists, "Processing at capacity
exceeded" will be performed.
When the specifying method of file No. is "Fixed/Dev val"
· When same file exists and "Overwrite old file" is selected: old file will be deleted and file will be saved
by the same file name.
· When same file exists, and "Add" is selected:
2 Data are added to specified files. When the file capacity is full, if logging/tracing is started, the
logging/tracing error relay is started to stop logging/tracing.
Logging/Tracing

"Device List for Logging/Tracing", Page 2-67

● About processing at capacity overflow


The operation when the file capacity is exceeded may vary with specifying methods of file No..
About file capacity upper limit setting, see "Option", Page 2-59。

When specifying method of file No.is "Auto numbering."


When all file Nos. are used and the last file capacity is exceeded.
· When there are no remaining No.s, and "Overwrite old file" is selected:
Oldest data are deleted, and new file wll be created according to same file NO.
· When there are no remaining No.s, and "stop logging/tracing" is selected:
When logging/tracing is started, the logging/tracing error relay is started to stop logging/tracing.
When specifying method of file No.is "Fixed/Dev val"
When the same file exists whether "Overwrite old file"/"Add" is selected, logging/tracing will be
stopped。

● Character restriction
(1) Character string in CSV file: file comment, device comment
(2) File name character string : file name character string
(3) ASCII character string : there are restrictions on characters that can be used when "ASCII
character string" is selected as the device's data format.
Item Explanation
Character string in CSV files • "," cannot be used.
The following characters cannot be used.
• 12 half-width characters * / < > ? ¥ | % , : ; "
• 7 full-width characters / :  ? ¥ * [ ]
Character string in file names
• NEC special characters (8740H to 879CH)
• IBM extended characters for NEC (ED40H to EEFCH)
• IBM extended characters for IBM (FA40H to FC4BH)
All ASCII codes are saved directly. Control characters and " etc. are also
ASCII string
saved directly.

2-72 - KV-5000/3000 Series User’s Manual -


2-4 USB Communication

CPU INTERNAL FUNCTIONS


If USB port of CPU unit is used, then monitoring/debugging of ladder programs can be performed
through KV STUDIO.

TIP If DATA BUILDER is used, then PLC device values can be read/written.

Method of Connecting PC

Please connect USB cable to both PC and KV-5000/3000.


2

USB Communication
Note
It's required to install KV STUDIO properly before connecting KV-5000/3000 to PC
USB interface.

Installing the USB Driver

Be sure to install USB driver prior to first connection. For 2nd or subsequent connection, no program is
required to be installed due to auto identification function.
The steps of installing in Windows XP are described below.

1 Only the user with setting change right (such as administrator) can operate.

2 Connect computer USB port to KV-5000/3000 USB port using USB cable.
"Found New Hardware Wizard" is displayed, and then information of the hardware to be added is displayed.

3 Select "Install from a list or specific location


(Advanced)" button, and lick "Next".

4 Select "Search for the most suitable driver


in these locations" button and "Include this
location in the search" checkbox.
Specify the position of KV STUDIO already
installed.
* The default installation position: "C:\Program
Files\KEYENCE\KVS4E".

5 Continue to install according to the hint of


wizard.

- KV-5000/3000 Series User’s Manual- 2-73


2-5 Serial Communication (KV-3000 only)
CPU INTERNAL FUNCTIONS

If serial port of KV-3000 (modular connector is used), you can monitor of ladder program through KV
STUDIO, as in the case with USB port. In addition, communication is possible by connecting
peripherals with RS-232C interface, or connecting to our VT3 series touch panel.

Communication Specification

2 Item Specification
Communication
Serial Communication (KV-3000 only)

RS-232C
interface
Communication
Full-duplex
mode
Synchro mode Demodulation synchronization
Baud rate 9600, 19200, 38400, 57600, 115200bit/s (default 9600bit/s)
Data length 8-bit
Parity Even
End bit length 1-bit

Note
· Set the same communication specification as that set to connected peripherals.
Communication cannot be performed correctly if the settings are different.
· For details on the settings of connected peripherals, refer to the User's Manual for the
respective equipment.

How to Connect to PC

When connecting KV-3000 and PC, please use dedicated connection cable (OP-26487) and D-Sub 9-
pin connector (OP-26486).

KV-3000

OP-26486
To RS-232C connector

To modular connector OP-26487 PC


(cable length: 2.5m)

KV side PC side

RD 3 3 SD
SD 5 2 RD
4 DR
6 ER
7 RS
8 CS
˄2˅
˄3˅˄4˅
˄5˅ SG 4 5 SG
KV side pin No Modular connector D-Sub 9-pin connector

2-74 - KV-5000/3000 Series User’s Manual-


CPU INTERNAL FUNCTIONS
2-5 Serial Communication (KV-3000 only)

How to Connect to VT3 Series

When connecting KV-3000 to VT3 series touch panel, please use dedicated KV program-controlled
direct-connect cable (OP-26484 : 5m, OP-35403 : 1m).

● Connecting to PORT2 of VT3


2

Serial Communication (KV-3000 only)


OP-26484˖5m
OP-35403˖1m

To PORT 2

To modular connector
KV-3000 Touch display panel VT3 series

● Connecting to PORT3 of VT3

OP-26486

TO PORT3

OP-24025˖5m
To modular connector OP-24045˖1m
KV-3000 Touch display panel VT3 series

TIP No setting is required at KV-3000 side.


For the settings of VT3 side, refer to "VT3 PLC Connection Manual".

How to Connect to Peripherals

When connecting KV-3000 to peripherals, please refer to the following wiring diagram with PC, and
connect according to shape of the connectors of peripherals.

KV side PC side D-sub 9-pin KV side PC side D-sub 25-pin


RD 3 3 SD RD 3 2 SD
SD 5 2 RD SD 5 3 RD
+5V 1 4 DR +5V 1 6 DS
+5V 2 6 ER +5V 2 20 ER
SG 6 7 RS SG 6 4 RS
SG 4 8 CS SG
ǂ ǂ
4 5 CS
1 2 3 4 5 6 5 SG 7 SG
KV Straight core cable OP-26487 Straight core cable OP-26487
Unit side pin No ˇ ˇ
D-Sub 9-pin connector OP-26486ǂǂǂǂǂǂǂǂǂ D-Sub 25-pin connector OP-26485
(cross wiring)ǂǂǂǂǂǂ
1st and 2nd pin of unit side is 5V power
4th and 6th pin of unit side is GND

TIP When the connected equipment is a modem, please use cross cable OP-96607 instead of
OP-26487.

- KV-5000/3000 Series User’s Manual- 2-75


CPU INTERNAL FUNCTIONS

2-5 Serial Communication (KV-3000 only)

Communication Setting Initialization and Communication Speed Setting

■ Communication speed setting


Sending Break signal to KV-3000 allows to initialize the settings of
communication buffer and communication speed of KV-3000.
ˇV 100ms or more
2 Prior to communication with KV-3000, or during initialization of
communication settings, a Break signal over 100ms is only sent one
SD
ˉV

time, as shown on the right. Once communication is confirmed, no


Serial Communication (KV-3000 only)

Break signal is required to be sent.

Note
· To establish communication without turning KV-3000 OFF after communication is
performed between KV-3000 and KV STUDIO, the Break signal must be sent again.
· When the Break signal cannot be sent to PC, the communication settings of KV-3000 can
be initialized by turning the KV-3000 OFF then back ON again.
· Allow at least 10 ms to stop communication after sending the Break signal.

■ Communication speed setting “SP"


This command is used to change serial communication speed with KV-3000.
● Command

S P n C
R
53H 50H 20H

n : Commands communication speed.


  "0"…9600 bit/s
  "1"…19200 bit/s
  "2"…38400 bit/s
  "3"…57600 bit/s
  "4"…115200 bit/s
● Response

O K C L
R F
4FH 4BH

<Response during an Error>


If the command is not processed properly, "E1" is written.

Note
· Default value is 9600bit/s when power is turned ON.
· If Break signal is received, the communication speed is returned to 9600 bit/s.
· The communication speed will be changed after a response is sent. Please confirm the
response first, then send command according to the set communication speed.

2-76 - KV-5000/3000 Series User’s Manual-


CPU INTERNAL FUNCTIONS
2-5 Serial Communication (KV-3000 only)

Reading/writing of PLC Device Value

The device value or operating state of KV-3000 can be read/written from peripherals through the
protocol initiated by KEYENCE. As in the KV mode of KV-L20V (host link), KV-3000 will automatically
return response according to the instruction from peripherals. No communication program is required at
KV-3000 PLC side.
“KV-L20V User’s Manual", “Chapter 5 Programming In KV Mode (host link)" 2

Serial Communication (KV-3000 only)


Instruction

Instruction CR or PC (Host)
Instruction C L
R F

Response CR LF

Response
KV-3000

Note
· Once the power of KV-3000 is turned on and Break signal is received, communication
speed is set to 9600bit/s.
· When a communication error occurs, the communication speed will recover to 9600bit/s.
· If 1s is exceeded between the bytes of instruction, it's regarded as a timeout, and an error
response will be returned.

Sending/Receiving Text Data

Continuous text data (below 999 bytes or 1998 bytes) can received or sent collectively. Though data
format can be freely set, communication program should be written at KV-3000 side.

External equipment
STX Text data ETX

LASER
ON
STB

OK/N
G
TIMING

TEST

BL-70
0

Text data

KV-3000

- KV-5000/3000 Series User’s Manual- 2-77


CPU INTERNAL FUNCTIONS

2-5 Serial Communication (KV-3000 only)

Receiving Text Data

■ Data format for receiving


The receivable text data format of KV-3000 is: STX (02H) for 1st byte, text data after 2nd byte, and ETX
(03H) for last byte.

2 1st byte After 2nd byte

STX Text data (within 999 bytes or within 1998 bytes)


Final byte

ETX
Serial Communication (KV-3000 only)

The received data are stored into CM3000 to M3999.


The unit of storage is set through ON/OFF state of CR2805.
Storage unit CR2805 CM3000 CM3001 CM3002 to M3998 CM3999
Number of Data 2
word OFF Data 1 Data 999
data bytes data 3 to data 998
Number of Data1, Data 3, data 4, Data 1997,
byte ON
data bytes data 2 data 5, data 1996 data 1998

● When stored in word (CR2805: OFF)


Higher 8 bits of each control memory (CM) store "00", low 8 bits store 1 byte of received data.

Number of data bytes

Received data STX Data 1 Data 2 Data 3 Data999 ETX

Data memory LeadingCM3000


(Number of data bytes) LeadingCM+1 LeadingCM+2 LeadingCM+3 LeadingCM+999

bit15 bit0
Data memory bit
0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1

Higher 8 bits (00) Lower 8 bits (ASCII code)

● When stored in byte (CR2805: ON)


2 bytes of received text data are stored in 1 CM.

Number of data bytes

Received data STX Data1 Data2 Data3 Data1998 ETX

Data memory LeadingCM3000


(Number of data bytes) LeadingCM+1 LeadingCM+2 LeadingCM+3 LeadingCM+999

bit15 bit0
Data storage bit
0 0 1 1 0 0 1 0 0 0 1 1 0 0 0 1

Higher 8 bits (00) Lower 8 bits (ASCII code)

2-78 - KV-5000/3000 Series User’s Manual-


CPU INTERNAL FUNCTIONS
2-5 Serial Communication (KV-3000 only)

● Receiving
The receiving state can be confirmed through the following control relay.
Relay No. Content
CR2801 Only one scan period will be ON when text data are received.
Only one scan period will be ON when text data are received while
CR2802
CR2801is ON or when CR2803 is ON.
Only one scan period will be ON if an error occurs when receiving text
CR2803
data. 2

Serial Communication (KV-3000 only)


Note
· If there is ETX when text data are read, the data before ETX will be sent to the data
memory. But, the data after ETX won't be read.
· If parity error occurs when text data are received, the text data will not be sent to data
memory, CR2802 and CR2803 will be ON for only one scan period.
· Communication setting needs to be initialized before communication.
"Communication speed setting", Page 2-76

TIP You can change communication speed via "SP " instruction of KV mode (host link).
"Communication speed setting”, Page 2-76

Sending Text Data

■ Data format for sending


The data sent from KV-3000 to peripherals are stored into CM4000 to M4999.
The unit of storage is set through ON/OFF state of CR2806.
Storage
CR2806 CM4000 CM4001 CM4002 CM4003~M4998 CM4999
unit
Number of
word OFF Data 1 data2 Data 3 to data 998 data 999
data bytes
Number of Data 1997,
byte ON Data 1, 2 Data 3, 4 Data 5 to Data 9196
data bytes 1998

● When stored in word (CR2806: OFF)


Higher 8 bits of each control memory of CM store "00", lower 8 bits stores 1 byte of sent data by ASCII
code.

bit15 bit0
Data memory bit
0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1

Higher 8 bits (00) Lower 8 bits (ASCII code)

data memory LeadingCM4000


(Number of data bytes) LeadingCM+1 LeadingCM+2 LeadingCM+3 LeadingCM+999

Send data Data1 Data2 Data3 Data999

- KV-5000/3000 Series User’s Manual- 2-79


CPU INTERNAL FUNCTIONS

2-5 Serial Communication (KV-3000 only)

● When stored in byte (CR2806:ON)


2 bytes of sent data are stored in 1 CM.

bit15 bit0
Data memory bit
0 0 1 1 0 0 1 0 0 0 1 1 0 0 0 1

Higher 8 bits (ASCII code) Lower 8 bits (ASCII code)

2 data memory LeadingCM4000 LeadingCM+1 LeadingCM+2 LeadingCM+3


(Number of data bytes) LeadingCM+999
Serial Communication (KV-3000 only)

Sent data Data1 Data2 Data3 Data1998

■ Sending
Sending is performed through ON/OFF of the following control relay.
Relay No. Content
CR2804 Start/stop text data sending ON :send OFF :stop
CR2800 Start/stop Break signal sending ON :send OFF :stop

*CR2804 will be OFF automatically when sending is completed.

Note
Communication setting needs to be initialized before communication.
"Communication speed setting", Page 2-76

TIP You can change communication speed via "SP" instruction of KV mode (host link).
“KV-L20V User's Manual “, "Chapter 4 Programming in KV Mode" (host link)"

2-80 - KV-5000/3000 Series User’s Manual-


CPU INTERNAL FUNCTIONS
2-5 Serial Communication (KV-3000 only)

ASCII Code Table

Higher 4 bits

0 1 2 3 4 5 6 7 8 9 A B C D E F
0
N
U
D
L S
0 ? P ? p ࡯ ࠲ ࡒ
2
L E P

Serial Communication (KV-3000 only)


S D
1 O
H
C
1 ? 1 A Q a q ? ࠕ ࠴ ࡓ
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 ࡮ ࠝ ࠽ ࡙
Lower 4 bits

Q K
A S
6 C
K
Y
N ? 6 F V f v ࡥ ࠞ ࠾ ࡛
B E
7 E
L
T
B ’ 7 G W g w ࠔ ࠠ ࠿ ࡜
B C
8 S AN ? 8 H X h x ࠖ ࠢ ࡀ ࡝
H E
9 T M ? 9 I Y i y ࠘ ࠤ ࡁ ࡞
L SU
A F B ? ? J Z j z ࠚ ࠦ ࡂ ࡟
V ES
B T C ? ? K ? k ? ࠜ ࠨ ࡅ ࡠ
F
C F → ? ? L \ l ? ࡖ ࠪ ࡈ ࡢ
C
D R ← ࡯ ? M ? m ? ࡘ ࠬ ࡋ ࡦ
S
E O ↑ ? ? N ? n ? ࡚ ࠮ ࡎ ࠐ
S D
F I ↓ ? ? O ? o E
L ࠶ ࠰ ࡑ °
Characters within can be used.
ST ET L C
X ? X ? F ? R are used as data seperatorsDŽ

Other codes are used for controlling, and should not be used.

- KV-5000/3000 Series User’s Manual- 2-81


2-6 Ethernet/FL-net Communication (KV-5000 only)
CPU INTERNAL FUNCTIONS

Ethernet port (RJ-45 connector) of KV-5000 allows to achieve the same functions as those with KV-LE20V or KV-FL20V.

Note
· CPU's built-in Ethernet communication function and built-in FL-net communication function can be
used simultaneously.
· Optional "compatible mode" for KV-LE20V/KV-FL20V cannot be used.

2
Operations that Can be Implemented through CPU's Built-in Ethernet/FL-net Communication Function
Ethernet/FL-net Communication (KV-5000 only)

Item Reference manual See


Remote transmission and remote "9-1 About monitor/simulatior
KV STUDIO User's Manual
maintenance of ladder programs functions"
VT3 series and its connection VT/DT PLC Connection Manual "Chapter 2 Connect to Ethernet"
“Chapter 7 Mail Receiving/Sending
Mail receiving/sending
Function”
FTP Server “Chapter 8 FTP Server Functions”
“Chapter 4 Host Link Communication
Host link communication KV-LE20V User's Manual
Function”
MC protocol communication “Chapter 5 MC Protocol Communication”
"Chapter 6 KV Socket Communication
KV socket communication
Function"
Communication with DATA BUILDER DB-H1 User's Manual "2-5 Connection Destination Setup"
"Chapter 2 Specification and
Data sharing with other PLC KV-FL20V User's Manual
System Configuration"
Communicating via FL-net KV STUDIO User's Manual "9-1 About Monitor/simulator Function"

Unit Editor Setting

To use the built-in Ethernet port of KV-5000, please select KV-5000 in the Unit Editor of KV STUDIO to display the
unit setting. After the communication mode is set to "Ethernet/FL-net", the same functions as those with KV-LE20V/
KV-FL20V can be used.

For how to use KV STUDIO and Unit Editor, refer to "KV STUDIO User's Manual".
For the details of unit settings or various functions that can be used by Ethernet mode, refer to "KV-LE20V User's
Manual"
Please refer to the "KV-FL20A User's Manual."

2-82 - KV-5000/3000 Series User’s Manual-


2-7 I/O

CPU INTERNAL FUNCTIONS


KV-5000/3000 has built-in 16-point inputs and 8-point outputs. In addition to I/Os common, the following
functions can be used.

Item See
Interrupt input " Input Time Constant Setting", Page 2-84
High-speed counter "2-8 High-speed Counter", Page 2-87
Frequency counter "2-9 Frequency Counter", Page 2 133
Cam switch
Specified frequency pulse output
"2-10 Cam Switch", Page 2-139
"2-11 Specify Frequency Pulse Output", Page 2-153
2

I/O
Motor (positioning) control "2-12 Motor (positioning) Control", Page 2-157
Input time constant setting "Input Time Constant Setting", Page 2-84
Disable input refresh "Disable Input Refresh", Page 2-85
Disable output "Disable Output", Page 2-86

Common I/O

If high-speed counter, frequency counter, cam switch, specified frequency pulse output, motor
(positioning) control, CPU unit's I/O (R000 to R015, R500 to 507) are not used as interrupt input, they
can be used as common I/Os.
For terminal No.s of I/Os, see "I/O connector wiring diagram", Page 1-30。
The methods of using the common I/Os are described below. In addition, the following methods can
also be used for expansion I/O unit.

■ About I/O refresh


In the execution of programs, I/O signal state is refreshed once during scanning time (END
processing). When it's required to refresh I/O signal at any position of program (direct processing), the
following methods can be used.

● Direct I/O (DR)


Specify the relay No. to be used for operand to "DR", not "R".

Example
DR000 DR500

Whether or not DR can be used, please refer to KV-5000/3000 series Instruction Reference Manual.

● I/O refresh instruction (RFSX, RFSY)


I/O states of multiple bits will be refreshed uniformly.
Please refer to KV-5000/3000/1000 Series PLC Instruction Reference Manual, “RFSX/RFSY Instruction"

● Interrupt processing
During interruption processing, input relay (R000 to R015) will be refreshed before the program is
executed. In addition, when SET/RES instruction is executed, it's not required to wait for END
processing of the program, and the output relay (R500 to R507) will be refreshed directly.
"3-5 Interrupt", Page 3-31

- KV-5000/3000 Series User’s Manual- 2-83


CPU INTERNAL FUNCTIONS

2-7 I/O

Input Time Constant Setting

If input time constant selection function is used, the pulse width acquired reliably as signals from input
contact will be set as input time constant. If input time constant becomes smaller, shorter pulse can be
obtained, otherwise, it can be used as a simple noise filter.
When a non-contact signal without fluctuation is connected, and a high-speed signal (encoder, etc),
2 high-speed signal can be processed by reducing input time constant.
I/O

TIP When expansion I/O unit is used, input time constant can be set through Unit Editor (10ms/
1ms/300µs/25µs).
KV STUDIO User's Manual, "Chapter 3-6 Unit Editor"

● Hi-speed instruction (HSP)


When using HSP instruction, please set the input time constant of the specified input relay (R000 to R015)
to 10µs.
Please refer to KV-5000/3000/1000 Series PLC Instruction Reference Manual, “HSP instructions"

● Control relay/Control memory (CR2305/CM1620)


The input time constant of KV-5000/3000's input relay (R000 to R015) can be selected through
settings of control relay CR2305 and control memory CM1620.
The input time constant is generally 10 ms. But, if the control relay CR2305 is ON, the input time
constant of the input relay can be changed into a value set through CM1620.
control relay Operation content
OFF to ON: the setting of CM1620 is reflected at the rising edge of CR2305 .
CR2305
OFF: input time constant is fixed as 10 ms.

control memory Setting value Input time constant


0 10µs
1 20µs
2 500µs
3 1ms
CM1620 4 2.5ms
5 5ms
6 10ms
7 110μs
8 above Please don’t set up.

But, if HSP instruction and control relay CR2305 are used simultaneously, HSP instruction will be
processed first, the specified relay cannot be changed into a value set through CM1620.

Example
Input time constant is set to 1ms.
CR2008 #3 CM1620 CR2305
LDA STA SET

2-84 - KV-5000/3000 Series User’s Manual-


CPU INTERNAL FUNCTIONS
2-7 I/O

Note
Input time constant is set after one scanning is completed. The specified contents will be
enabled from the next scanning.

Disable Input Refresh


2
After input refresh is disabled, state of input relay (R000 to R015, assigned as the relays of expansion

I/O
input unit) will not be updated according to actual input signal. As the actual input relay can be ON/OFF
forcedly in the process of monitoring by KV STUDIO, commissioning operation can be performed
without being influenced by the connection state of peripherals.

Note
When "input refresh disabled" is used, the following functions cannot be disabled.
· Interrupt
· Hi-speed counter (internal clock not included)
· Positioning (origin sersor, stop sensor, Z-phase, limit switch) R000 to R015

TIP When expansion I/O unit is used, forced set/reset operation can be performed through KV
STUDIO.
"KV STUDIO User's Manual “, "Foreced set/reset registering"

● Disable/release through KV STUDIO


You can toggle disabling/enabling from menu in the process of monitoring through KV STUDIO.

1 Select "Debug (D)" -> "Disable Input refresh (F)" from menu.
After input refresh is disabled, the menu is in selected state, "input refresh disabled" is displayed in the
status bar. After the menu is selected while input refreshe is disabled, the input refresh disable can be
released.

● Disable/release through control relay (CR2301)


Enabling/disabling can be toggled through ON/OFF of CR2301.
control relay Operation content
ON : Input refresh is disabled through END processing.
Contents in input relay are not refreshed.
CR2301
OFF: Input refresh needs to be performed through END processing.
The input contents of relay are refreshed according to the state of input signal.

● Release through the access window


Disabling of input refresh can be released in the Access Window of KV-5000/3000.
"Commission", Page 2-32

- KV-5000/3000 Series User’s Manual- 2-85


CPU INTERNAL FUNCTIONS

2-7 I/O

Disable Output

After output is disabled, it's impossible to output to output relay (R500 to R507, assigned as the relay of
expansion output unit), even if ON/OFF operation is performed on the output coil in the program. Thus,
debugging of program is possible without actual output to peripherals.

2 Note
If CR2300 is ON, all outputs will be OFF.
For example, if CR2300 is ON while positioning pulse is output, the pulse output from output
I/O

terminal will be disabled (OFF). But, when CR2300 is OFF, output will restart (the pulse
output is processed as output content when CR2300 is ON) due to ongoing internal
operation.

● Disable/release through KV STUDIO


You can toggle disabling/enabling from menu in the process of monitoring through KV STUDIO.

1 Select "Debug (D)" -> "Disable output (O)" from the menu.
After output is disabled, the menu is under selected state, "Output disabled" is displayed in the status
bar. After the menu is selected while output is disabled, the output disabling wiil be released.

● Disable/release through control relay (CR2300)


Enabling/disabling output of CPU unit (R000 to R015) and the output of various relays assigned as
expansion output units.
control relay Operation content
ON : Output processing is disabled (OFF) through END processing.
CR2300 OFF: Output processing is performed through END processing.
During output, the contents of output coil are output.

● Release through the access window


The output disabling can be released through the Access Window of KV-5000/3000.
"Commission", Page 2-32

TIP Output process can be disabled during interrupt.

Enabling/disabling of output can be toogled through CR2302 during interrupt.


control relay Operation content
ON : Output processing is disable (OFF) during interrupt.
CR2302
OFF: Output processing is performed during interrupt.

"Commission", Page 2-32

2-86 - KV-5000/3000 Series User’s Manual-


2-8 High-speed Counter

CPU INTERNAL FUNCTIONS


High-speed counter (CTH) is a counter used to counting high-speed input signal that cannot be
counted through counter instructions (C, OUTC, UDC).
High-speed counter comparator (CTC) is a device used to specify the setting of high-speed counter. If
the setting value matches the current value, it's on (ON).
Interrupt processing or pulse output can be implemented by flexibly using CTH and CTC, independent
of the scan time.

High-speed Counter Specification


2

High-speed Counter
Item Specifications
Number of channels 2
Line driver input Single-phase: 100kHz phase difference: 50kHz
Input response frequency
Open collector input Single-phase: 60kHz phase difference: 30kHz

Note
Other functions or instructions using high-speed counter of the same No. cannot be used
simultaneously.

For details about input relays, see "Wiring and Internal Circuit Diagram", Page 1-28。

Configuration of High-speed Counter

KV-5000/3000 is equipped with 2 high-speed counters, each of which is fitted with 2 high-speed
counter comparator and dedicated internal clock.

High-speed counter clock diagram


Enable input R008
Preset (Z phase) input R014

Count input 32-bit high speed counter 0 CTH0 input capture function *1
A phase R010 CM1610, CM1611(INT R000)
External input CTH0
(B phase R012) R010 CM1612, CM1613(INT R001)
(R012)

Internal timer Control circuit CR2505


CR2414(50ns) ǂOFF R500
CR2100(1.0μs) ǂON R504
CR2101(10.0μs) CTH0 setting value (comparator matching output)*2
CR2102(100.0μs)
High-speed counter comparator Interrupt function
Direct clock pulse input CTC0
ǂǂR501 INT CTC0
CTC1 INT CTC1

(internal wiring)
(internal wiring)

Count input 32-bit high speed counter 1 CTH0 input capture function *1
Direct clock pulse input CM1614, CM1615(INT R002)
ǂǂR500 CTH1 CM1616, CM1617(INT R003)

CR2513
Internal timer ǂOFF R501
CR2415(50ns) Control circuit
ǂON R505
CR2200(1.0μs) (comparator matching output)*2
CR2201(10.0μs)
CR2202(100.0μs) CTH1 setting value
External input High-speed counter comparator Interrupt function
A phase R010
R011 CTC2
(B phase R012) (R013) INT CTC2
CTC3 INT CTC3

Enable input R009


Preset (Z phase) input R015

*1 "Input Capture", Page 3-41


*2 "Comparator Matching Output", Page 2-111

- KV-5000/3000 Series User’s Manual- 2-87


CPU INTERNAL FUNCTIONS

2-8 High-speed Counter

Setting Item List of High-speed Counter

When high-speed counter is used, the following items can be set through ladder program.

● Counting range
Counting range is set.

2 · Linear counter… counting within the range of 32 bits.


· Ring counter… random setting of upper/lower limit, and counting within this range.
High-speed Counter

"Setting of Count Range", Page 2-99

● Input mode
To set counting input mode, and log the instruction of high-speed counter (CTH instruction).
· External input… counting pulse input of single phase, phase difference and 2 pulses.  
· Internal clock…counting the internal lock of 50ns / 1µs / 10µs / 100µs.  
· Direct clock pulse (specified frequency pulse) output… counting the output pulse with high-speed counter.
"Counting Input Setting", Page 2-101

● Setting value
Set the setting value (CTC) of counting up/counting down.
"Settings of High-speed Counter (CTC)", Page 2-104

How to Set High-speed Counter

When CPU's built-in high-speed counter is used, it's required to write ladder program for specifying
ounting range, input mode and setting value. However, if CPU high-speed counter setup wizard is
used, it's only required to specify various items according to the screen instructions, and the ladder
program for high-speed counter will be generated automatically.

Functions of CPU High-speed Counter Setup wizard

When the CPU high-speed counter setup wizard is used, it's only required to select the setting item.
Ladder program CPU's built-in high-speed counter will be generated automatically, and will be
registered according to scanning module called "INIT_CTH0" or "INIT_CTH1".

2-88 - KV-5000/3000 Series User’s Manual-


CPU INTERNAL FUNCTIONS
2-8 High-speed Counter

Functions of CPU High-speed Counter Setup wizard

The setting contents of CPU high-speed counter setup wizard are described below.

Channel selection
CH0
-> Step 1, Page 2-90
CH1

2
Operation mode selection

High-speed Counter
Up/down count
-> Step 2, Page 2-90
Preset count
Enable accu count
Enable count

Input mode selection


External input
-> Step 3, Page 2-93
Internal input

Set count
Count range
-> Step 4, Page 2-93
Count mode
Initial value setting

Consistent comparator
operation setting Output relay
-> Step 5, Page 2-94 Operation in case of matching
Setting default value

Operation mode Operation mode Operation mode


up/down count Preset count Enable
accu count

Preset setting of external control input Setting of enable relay


-> Step 6, Page 2-95 Polarity of -> Step 7, Page 2-97
External input polarity
preseting put Poarity of internal relay
relay
Counting enable
Preset timing condition

Module name setting


To set up module name
-> Step 8, Page 2-97

- KV-5000/3000 Series User’s Manual- 2-89


CPU INTERNAL FUNCTIONS

2-8 High-speed Counter

Setting Steps of CPU High-speed Setup Wizard Counter

The steps for setting CPU high-speed counter setup wizard and various dialog boxes are described below.

1 Select "Tool (T)" -> "CPU high-speed counter setting wizard (H)" from the menu of KV STUDIO,
and start CPU high-speed counter setup wizard".
2 Specify the channel of setting the high-speed counter, and click "Next" button.
Step 1 Channel selection
High-speed Counter

2 Select operation mode.


Select an operation mode, then click the “Next" Button. Up/down Count mode
Step 2 select the operation mo

Operation mode Description


Up/down count Basic counting mode for counting the input.
If up/down counting is performed in this mode and preset input is performed,
Preset count
then the counting value is changed to preset value.
Enable accu count Counting is performed only when enable input is ON. Setting value is accumulated.
Counting is performed only when enable input is ON. Counting value is reset
Enable count
(zero clear) at rising edge of enable input.

2-90 - KV-5000/3000 Series User’s Manual-


CPU INTERNAL FUNCTIONS
2-8 High-speed Counter

● Up/down count mode


Mode of only counting the input.
up
Counting input
down

Overflow*
(1)

Current value
2

High-speed Counter
(2) *
Overflow

* No overflow occurs when the counting mode is "ring counter".

Current Count mode: linear counter Count mode: ring counter


value Count range: Count range: Count range: Count range:
range Unsigned 32-bit Signed 32-bit Unsigned 32-bit Signed 32-bit
Upper limit Upper limit
(1) 4294967295 +2147483647
(1 to 4294967295) (-2147483647 to +2147483647)
Lower limit Lower limit
(2) 0 -2147483648
(0 to 4294967294) (-2147483648 to +2147483646)

Tip · Count mode and count range are set through the CPU high-speed counter setup wizard
(page 2/4).
· When overflow is detected, CR2403 (CTH0) and CR2407 (CTH1) are ON.
● Preset count mode
A mode in which once preset input (external input) is input, the current value is changed to preset
value.
up
Count input
down

Preset input

(1)

Preset value
Current value

(2)

Current Count mode: linear counter Count mode: ring counter


value Count range: Count range: Count range: Count range:
range Unsigned 32-bit Signed 32-bit Unsigned 32-bit Signed 32-bit
Upper limit Upper limit
(1) 4294967295 +2147483647
(1 to 4294967295) (-2147483647 to +2147483647)
Lower limit Lower limit
(2) 0 -2147483648
(0 to 4294967294) (-2147483648 to +2147483646)

Tip Count mode and count range are set through the CPU high-speed counter setup wizard,
Page 2/4.

- KV-5000/3000 Series User’s Manual- 2-91


CPU INTERNAL FUNCTIONS

2-8 High-speed Counter

● Enable accumulative count mode


Counting performed only when enable input is ON. The current value is accumulated continuously.
up
Count input
down

ON
Enable input
OFF

2
(1)
High-speed Counter

Current value

(2)

Current Count mode: linear counter Count mode: ring counter


value Count range: Count range: Count range: Count range:
range Unsigned 32-bit Signed 32-bit Unsigned 32-bit Signed 32-bit
Upper limit Upper limit
(1) 4294967295 +2147483647
(1 to 4294967295) (-2147483647 to +2147483647)
Lower limit Lower limit
(2) 0 -2147483648
(0 to 4294967294) (-2147483648 to +2147483646)

Tip Count mode and count range are set through the CPU high-speed counter setup wizard, Page
2/4.

● Enable Count mode


Counting is performed only when enable input is ON. The current value is reset (zero clear) at the rising
edge of enable input.
up
Count input
down

ON
Enable input
OFF

(1)

Current value

Reset value

(2)

Current Count mode: linear counter Count mode: ring counter


value Count range: Counti range: Count range: Count range:
range Unsigned 32-bit Signed 32-bit Unsigned 32-bit Signed 32-bit
Upper limit Upper limit
(1) 4294967295 +2147483647
(1 to 4294967295) (-2147483647 to +2147483647)
Lower limit Lower limit
(2) 0 -2147483648
(0 to 4294967294) (-2147483648 to +2147483646)

Tip Count mode and count range are set through the CPU high-speed counter setup wizard, Page
2/4.

2-92 - KV-5000/3000 Series User’s Manual-


CPU INTERNAL FUNCTIONS
2-8 High-speed Counter

3 Set up counting input.


Please set count input, then click the “Next" button.
Step 3 select the input method.

High-speed Counter
Item Description
External input Selected when external input is counted through high-speed counter.
Select count input mode from the pull-down menu.
Selection range: 1-phase (w/ direction)/1-phase (w/o direction)/Phase difference
count input mode
(1x)/Phase difference (2x) / Phase difference (4x)/2-pulse
"Counting Input Setting", Page 2-101
Selected when counting is performed through internal clock or direct clock
Internal input
pulse (specified frequency pulse).
Select an internal clock from the pull-down menu.
Internal clock input Select range: 50ns/1.0µs/10.0µs/100.0µs
"When using internal clock", Page 2-103
Selected when direct clock pulse or specified frequency pulse output is counted.
Direct clock pulse input "When using direct clock pulse (specified frequency pulse) output", Page 2-
103

4 Perform counting setup.


Set "Count range", "Count mode" and "Default value setting", and click the "Next" button.
Step 4 counting setup

- KV-5000/3000 Series User’s Manual- 2-93


CPU INTERNAL FUNCTIONS

2-8 High-speed Counter

Item Description
Count range (current value) is set.
Count range Selection range: unsigned 32-bit (0 to 4294967295)/
signed 32-bit (-2147483648 to +2147483647)
Count mode Count mode is set.
Count is performed according to the set count range.

2 Linear count When the current value exceeds this range, the overflow detection relay is ON.
"Linear counter", Page 2-99
Counting is performed according to the set range of upper and lower limit.
High-speed Counter

Ring count Even if the current value exceeds the range, overflow detection relay will not be ON.
"Ring counter", Page 2-100
When operation mode of CPU is changed from PROG to RUN, the current
Default setting
value is rewritten to the specified default setting.

5 Set comparator matching operation.


Set "Output relay", "When current value=set value" and "default setting", and click the "Next" button.
Step 5 setting of matching opera
comparator

Item Description
After the this checkbox is selected, output relay will operate if current value
Use comparator
matches the comparator value (setting value).
Used to select the output relay when the comparator matches.

When the channel of CPU high-speed counter is CTH0:


Selection range: R500 (high-speed output: max. output frequency 100kHz)/
Output relay R504 (common output: max. output frequency10kHz)
When the channel of CPU high-speed counter is CTH1:
Selection range: R501 (high-speed output: max. output frequency 100kHz)/
R505 (Common output: max. output frequency10kHz)
When current value (CTC0/ When current value (CTH0/CTH1)=setting value ([CTC0/CTC1]/[CTC2/
CTC1) = setting value ([CTC0/ CTC3]), current value is set to "zero clear/no zero clear"; the output relay is
CTC1]/[CTC2/CTC3]) set to "ON/OFF/inverted/unchanged".
Default setting ([CTC0/ To specify the setting of the high-speed counter ([CTC0/CTC1]/[CTC2/
CTC1]/[CTC2/CTC3]) CTC3]).

2-94 - KV-5000/3000 Series User’s Manual-


CPU INTERNAL FUNCTIONS
2-8 High-speed Counter

The following steps will vary with the operation modes set in step 2.
· When the mode is "Up/down count" ............................go to step 8
· When the mode is "Preset count"................................go to step 6
· When the mode is "Enable accumulative count" ........go to step 7
· When the mode is "Enable count" ..............................go to step 7

6 Set up external control input (preset). 2


It is set only when operation mode is selected as "Preset counting".

High-speed Counter
Set "Preset value", "Polarity of preset input relay" and "preset timing", click the "Next" button, then go to step 8.
步骤 6 预置的设定

Item Description
To specify the preset value used to rewrite current value in the case of preset input.
Preset value (CM1604)
The preset value should be set within the range specified by "Counting range".
To select input polarity of preset input relay.
Polarity of preset input
N.O.(A contact) : Preset will be performed when external input is ON.
relay (R014/R015)
N.O.(B contact) : Preset will be performed when external input is OFF.
To select preset timing when preset input is performed.
Up edge : Preset is performed on the rising edge of external preset input relay
Down edge : Preset is performed on the falling edge of external preset input relay
Preset timing Level : When polarity of external preset input relay is N.O. (A
contact), preset will be performed while relay is ON.
: When polarity of external preset input relay is N.C. (B
contact), preset will be performed when the relay is OFF.

- KV-5000/3000 Series User’s Manual- 2-95


CPU INTERNAL FUNCTIONS

2-8 High-speed Counter

7 Setting of external control input (counter enable).


Setup is performed only when the operation mode is selected as "enable accumulative counting" or
"enable counting".
Set the "Polarity of external input (R008/R009)" and "Counting enable condition", and click "Next" button.
Step 7 Setting of counter enable

2
High-speed Counter

Item Description
To select enable condition of counting.
When internal relay is in enabled state: when internal relay is ON, counting is
enabled.
When external input is in enabled state: when polarity of external input is N.O.,
counting will be enabled when is ON; when the polarity of external input is
N.C., coun ting is enabled when it's OFF.
Counting enable condition
When internal relay is in enabled state and external input is in enabled state:
Counting is enabled when internal relay is ON and external input is in
enabled state.
When internal relay is in enabled state or external input is enabled state:
Counting is enabled when internal relay is ON or external input is in enabled
state.
To select the input polarity of external enable input relay (R008/R009).
N.O.(Contact A): When external input is ON enabled
External input (R008/R009)
When external input is ON disabled
polarity
N.O. (Contact B): When external input is ON disabled
When external input is ON enabled
Polarity of internal relay
Fixed for A contact (enable). The setting cannot be changed.
(CR2410/CR2411)

2-96 - KV-5000/3000 Series User’s Manual-


CPU INTERNAL FUNCTIONS
2-8 High-speed Counter

8 Specify the output module name and confirm the setting of high-speed counter.
Specify the setting content set through the CPU high-speed counter setup wizard as the module name
for ladder program output.
Confirm the setting content of CPU high-speed counter,and click the "Finish" button to finish setup.
Step 8 Set up name for module

High-speed Counter
How to Operate High-speed Counter

● Execute counting
The execution condition of high-speed counter instruction (CTH instruction) is set to ON.
"CTH Instruction", Page 2-114

● Reset
The current value of high-speed counter (CTH) is set to 0.
· RES instruction
· CTH instruction
· Automatic reset based on comparator matching
· External preset input
· Reset based on counter enable
"Reset Mode", Page 2-105

● Count enable/disable
The count enable/disable can be controlled with counter enable function.
"Counter Enable Function", Page 2-109

- KV-5000/3000 Series User’s Manual- 2-97


CPU INTERNAL FUNCTIONS

2-8 High-speed Counter

Function List of High-speed Counter

Various functions using high-speed counter are described below.

● Read the change direction of current value


The state of up or down counting of high-speed counter current value is read to the control relay (CR).

2 "Reading the Change Direction of Current Value", Page 2-112

● Current value refresh


High-speed Counter

When program is executed, the current value of high-speed counter is refreshed using the "RFSCTH"
instruction.
"RFSCTH Instruction", Page 2-118

● Input capture
In the case of interruption, the current value of high-speed counter is stored in control memory (CM).
"Capturing Current Value Based on Input Capture", Page 2-113

● Comparator based interrupt


If counter's current value (CTH) matches comparator's setting value (CTC), interrupt program will be
executed.
"3-5 Interrupt", Page 3-31

● Comparator matching based output


If current value of high-speed counter (CTH) matches comparator's setting value (CTC), ON/OFF
operation will be performed automatically on output relay of KV-5000/3000.
"Comparator Matching Output", Page 2-111

● Direct clock pulse output


Clock pulse not influenced by scan time is output.
"Direct Clock Pulse Output", Page 2-123

TIP If the specified frequency pulse output is used, then pulse can simply be output.

● Expansion function
You can use special instructions to simply use expansion functions of high-speed counter.
· Frequency counting function… To measure frequency of external pulse input.
"2-9 Frequency Counter", Page 2-133

· Rotary speed measuring function…To measure rotary speed of external pulse input.
"2-9 Frequency Counter", Page 2-133

· Pulse of specified frequency output function… To set any frequency and output pulse.
"2-11 Specify Frequency Pulse Output", Page 2-153

· Cam switch function… It is possible to use incremental encoder to perform cam control through PLC.
"2-10 Cam Switch", Page 2-139

2-98 - KV-5000/3000 Series User’s Manual-


CPU INTERNAL FUNCTIONS
2-8 High-speed Counter

Setting of Count Range

The count value range of high-speed counter can be set through counting mode and signs.

■ Linear counter
Linear counter is a counter used to count within 32-bit counting range.
2
Unsigned 32-bit

High-speed Counter
Up counting or down counting is performed in the range of 0 to 4294967295.
It will turn to 0 if up counting is performed from 4294967295; or it will turn to 4294967295 if down
counting is performed from 0.
In this case, overflow detection relay (CR2403/CR2407) will be ON.

Signed 32-bit
Up counting or down counting is performed in the range of -2147483648 to +2147483647.
It will turn to -2147483648 if up counting is performe from +2147483647; or turn to +2147483647 if
down counting is performed from -2147483648.
In this case, overflow detection relay (CR2403/CR2407) will be ON.

Counting value range and overflow detection relay


Count
Mode Sign Count value range Overflow detection
selection
CR2402 OFF CM1608 OFF 0 to 4294967295
CTH0 CR2403
(Linear counter) Bit 7 ON -2147483648 to +2147483647
CR2402 OFF CM1609 OFF 0 to 4294967295
CTH1 CR2407
(Linear counter) Bit 7 ON -2147483648 to +2147483647
Overflow detection relay will remain in ON state before it's turned ON through RES instruction.

Count input up

down

Without sign With sign


Overflow
Upper limit 4294967295 +2147483647
($FFFFFFFF) ($7FFFFFFF)

Counting
value
Lower limit 0 -2147483648
($00000000) ($80000000) Overflow

RES CR2403/CR2407 RES CR2403/CR2407

Overflow detection
CTH0:CR2403/CTH1:CR2407

Note
Counting will not stop even if overflow is detected. Counting will stop when counting input is
stopped.

- KV-5000/3000 Series User’s Manual- 2-99


CPU INTERNAL FUNCTIONS

2-8 High-speed Counter

■ Ring counter
Ring counter is one that allows random setting of upper and lower limits of high-speed counter.

Up counting or down counting is performed within the range of upper and lower limits.
It will be change to lower limit if up counting is performed from upper limit; It will be change to upper
limit if down counting is performed from lower limit.

2 In this case, overflow detection relay (CR2403/CR2407) will not be ON.

Setting range of counting value and storage destination of upper/lower limit


High-speed Counter

Count Setting value


Mode Upper Lower
selection Sign Range
limit limit
CR2402 ON CM1608 OFF 0 to 4294967295 CM1601 CM1597
CTH0
(Ring counter) Bit 7 ON -2147483648 to +2147483647 CM1600 CM1596
CR2406 ON CM1609 OFF 0 to 4294967295 CM1603 CM1599
CTH1
(Ring counter) Bit 7 ON -2147483648 to +2147483647 CM1602 CM1598

Example
Ring counting of high-speed
CR2008 #10000 CM1600
countor comparator CTC0 with LDA.D STA.D
1 scan ON #100 CM1596
upper limit 10000 and lower limit LDA.D STA.D
100 CR2402
SET

Note
· Overflow wll not be detected even if upper or lower limit is exceeded.

Counting input up

down

Upper limit CTH0:[CM1601・CM1600]


CTH1:[CM1603・CM1602]

Counting
value
Lower limit CTH0:[CM1597・CM1596]
CTH1:[CM1599・CM1598]

· Through changing current value of high-speed counter or upper/lower limit of ring counter
the current value can be corrected when the current value is outside the range between
upper limit and lower limit during executing of END instruction.
· If the current value exceeds the upper limit, then it is corrected to upper limit.
· If the current value is smaller than lower limit, then it is corrected to lower limit.
· Please do not set upper limit <= lower limit, otherwise normal counting is impossible.

2-100 - KV-5000/3000 Series User’s Manual-


CPU INTERNAL FUNCTIONS
2-8 High-speed Counter

Counting Input Setting

High-speed counter has 3 counting modes: external input, internal clock input, and direct clock pulse
input.

■ When using external input


When counting is performed on the external input through high-speed counter, each channel can use
2
the following relay No.

High-speed Counter
A-phase B-phase
CTH0 R010 R012
CTH1 R011 R013

Example
High-speed counter CTH0 is HSP
used to count external input R010

R010 and R012.


HSP
R012

%6*&
R010

Note
When external input is used, be sure to set the input time constant.
"Input Time Constant Setting", Page 2-84

"CTH Instruction", Page 2-114


"Wiring and Internal Circuit Diagram", Page 1-28

(1) Single phase


It is set when single pulse is counted.

w/o direction .........Rising edge of A-phase is counted.


  B-phase has no influence on counting operation. (can be used as common input.)

w/ direction ..........Up counting is performed on the up edge of A-phase when B-phase is OFF.
  Down counting is performed on the up edge of A-phase when B-phase is ON.
W/O direction W/ direction
ON ON
(A phase)R010 (A-phase)R010

OFF OFF

ON ON
(B phase)R012 (B-phase)R012

OFF OFF

(Counter value) CHT0 (Counter value)CTH0


0 1 2 3 4 5 6 0 1 2 3 2 1 0

- KV-5000/3000 Series User’s Manual- 2-101


CPU INTERNAL FUNCTIONS

2-8 High-speed Counter

(2) Phase difference


It is set it when phase difference pulse is counted.

1x..........................When B-phase is OFF, up counting is performed on the up edge of A-phase.


When B-phase is OFF, down counting is performed on the falling edge of A-phase.
ON
(A phase)
R010 OFF

2 (B phase)
R012
ON

OFF
High-speed Counter

(Counter value)
CTH0
0 1 2 3 4 3 2 1 0

2x..........................When B-phase is OFF, up counting is performed on the up edge of A-phase.


When B-phase is OFF, down counting is performed on the down edge of A-phase.
When B-phase is ON, down counting is performed on the up edge of A-phase.
When B-phase is ON, up counting is performed on the down edge of A-phase.
ON
(A phase)
R010 OFF
ON
(B phase)
R012 OFF

(Counter value)
CTH0
0 1 2 3 4 5 6 7 8 7 6 5 4 3 2 1 0

4x..........................When B-phase is OFF, up counting is performed on the up edge of A-phase.


When B-phase is OFF, down counting is performed on the down edge of A-phase.
When B-phase is ON, down counting is performed on the up edge of A-phase.
When phas B is ON, up counting is performed on the down edge of A-phase.
When phas A is OFF, down counting is performed on the up edge of B-phase.
When phas A is OFF, up counting is performed on the down edge of B-phase.
When phas A is ON, up counting is performed on the up edge of B-phase.
When phas A is ON, down counting is performed on the down edge of B-phase.
ON
(A phase)
R010 OFF
ON
(B phase)
R012 OFF

(Counter value)
CTH0

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

2-102 - KV-5000/3000 Series User’s Manual-


CPU INTERNAL FUNCTIONS
2-8 High-speed Counter

(3) 2-pulse burst


Pulse with 2-pulse burst mode is counted.

Pulse up counting is performed on the up edge of A-phase, and down count is performed on the down
edge of B-phase.
ON
(A phase)
R010 OFF

(B phase)
R012
ON

OFF
2

High-speed Counter
(Counter value)
CTH0
0 1 2 3 4 3 2 1 0

■ When using internal clock


When internal clock is counged, the following control relays can be used.
50ns 1.0µs 10.0µs 100.0µs
CTH0 CR2414 CR2100 CR2101 CR2102
CTH1 CR2415 CR2200 CR2201 CR2202

Example
Internal clock (1.0µs) is
CTH.D 0
counted with high-speed CR2100
counter CTH0.

"CTH Instruction", Page 2-114

■ When using direct clock pulse (specified frequency pulse) output


The following output relays are specified when direct clock pulse or specified frequency pulse output is
counted.
"Direct Clock Pulse Output", Page 2-123
"2-11 Specify Frequency Pulse Output", Page 2-153

Comparator
matching output
CTH0 R501
CTH1 R500

Example
The direct clock pulse output
CTH.D 0
R501 from R501 is counted through
high-speed counter CTH0.

High-speed counter CTH 1 is


CTH.D 1
used to count direct clock
R500
pulse output from R500.

- KV-5000/3000 Series User’s Manual- 2-103


CPU INTERNAL FUNCTIONS

2-8 High-speed Counter

Note
· When CR2513 is ON and CTH1's comparator matching output is set to R505, please
input R501 at operand of CTH instruction.
· When CR2505 is ON and CTH0's comparator matching output is set to R504, please
input R500 at operand of CTH instruction.
"Comparator Matching Output", Page 2-111

2
Settings of High-speed Counter (CTC)
High-speed Counter

The setting value of high-speed counter is set by high-speed counter comparator CTC0 to CTC3.
The matching with CTH0 is judged through CTC0 and CTC1.
The matching with CTH1 is judged through CTC2 and CTC3.
If no CTC interrupt program is available, and CTH matches CTC, then contact of CTC is ON.
CTC contact can be turned OFF through RES instruction. When CTC interrupt program is available, the
contact of CTC will not be ON.
High-speed counter
Sign Setting range
comparator
OFF 0 to 4294967295
CTH0 CM1608 bit7 CTC0 CTC1
ON -2147483648 to +2147483647
OFF 0 to 4294967295
CTH1 CM1609 bit7 CTC2 CTC3
ON -2147483648 to +2147483647

Example
Value of CTC0 is set to 100; HSP
value of CTC1 is set to 100000. R010

CTH.D 0
R010

#100
CTC 0

#100000
CTC 1
CTC 0

CTC 1

Note
When the current value is changed to the same value of CTC, contact of CTC will not be ON.
After up/down counting, the contact will be ON only when the current value is same as the
CTC value.

"CTC Instruction", Page 2-114

2-104 - KV-5000/3000 Series User’s Manual-


CPU INTERNAL FUNCTIONS
2-8 High-speed Counter

Reset Mode

Seting the current value of high-speed counter to is called "reset".


Reset modes can be divided into the following 5 types.
  Reset based on RES instruction
  Reset based on CTH instruction (execution condition OFF)
  Automatic reset based on comparator matching 2
  Reset based on external preset input

High-speed Counter
  Reset based on counter enable function

Note
The reset time of various reset modes is shown as follows.
Reset mode Reset time
Reset based on RES instruction The time for executing of RES instruction.
Reset based on CTH instruction (execution condition OFF) The time for executing CTH instruction.
Automatic reset based on comparator matching The time of comparator matching.
The time when external preset input
Reset based on external preset input
is ON.
Use internal enable relay
Reset based on The time for the enable signal to
Use internal enable relay and
counter enable change from disable -> enable or
external enable input
function enable -> disable.
Use external enable input

■ Reset based on RES instruction


The counter is reset through "RES CTH" when RES instruction is executed.
Scan

CTH current value

Execute "RES CTH"

Example
Reset based on RES instruction.
CTH0
RES

- KV-5000/3000 Series User’s Manual- 2-105


CPU INTERNAL FUNCTIONS

2-8 High-speed Counter

■ Reset based on CTH instruction (execution condition OFF)


Reset when the execution condition of the CTH instruction is turned OFF.
Scan

Execute condition

2
CTH current value
High-speed Counter

Execute "RES CTH"

Example
Reset based on CTH instruction
(execution condition OFF) Execute condition CTH.D 0
R010

Reset current value after set OFF status

■ Automatic reset based on comparator matching


When current value (CTH) matches setting value of comparator (CTC) during up counting or down
counting, the current value will be reset automatically.
It is set through control relay.

High-speed High-speed
counter Device No. Operation ON OFF
counter comparator
CTC0 CR2103 When CTH0=CTC0, auto reset Disable Enable
CTH0
CTC1 CR2112 When CTH0=CTC1, auto reset Disable Enable
CTC2 CR2203 When CTH1=CTC2, auto reset Disable Enable
CTH1
CTC3 CR2212 When CTH1=CTC3, auto reset Disable Enable

Scan

CTH

CTH˙CTC

* Reset when CTH=CTC.

Example
Automatic reset based on
CR2008 CR2103 CR2203
comparator matching SET SET

2-106 - KV-5000/3000 Series User’s Manual-


CPU INTERNAL FUNCTIONS
2-8 High-speed Counter

Note
Precautions on CTH change when auto reset is performed.
· In the case that the value is "unsigned" or "signed" and value of CTC is positive, even if
CTH is changed to above CTC, the CTH value will be "CTC value-1 ".
· In the case that the value is "signed" and value of CTC is negative, even if CTH is
changed to below CTC, the CTH value will be "CTC value +1".

2
■ Reset based on external preset input

High-speed Counter
Set through preset function.
Preset is performed by setting preset value to 0.
"Preset Function", Page 2-108

External preset input

CTH

Reset when external preset input is ON.

■ Reset based on counter enable function


Reset when counter switches from enable -> disable or disable -> enable.
Disabling/enabling of counter enable signal can be set through external enable input and internal
enable relay.
"Counter Enable Function", Page 2-109

Enable->Disable

Counter input
enable
enable
disable

CTH

Disable ->Enable

Counter input
enable
enable
disable

CTH

Example
Reset based on counter enable
CR2008 CM1608 CM1608
function (enable -> disable) BSET BSET
#4 #5

- KV-5000/3000 Series User’s Manual- 2-107


CPU INTERNAL FUNCTIONS

2-8 High-speed Counter

Preset Function

With this function, you can change the current value of high-speed counter to preset value. The current
value can be changed through external input.

Counter input up
down

2
High-speed Counter

Preset signal

A
Counting value

Preset value

Linear counter Ring counter


unsigned signed unsigned signed
A 4294967295 +2147483647 Upper limit (0 to 294967295) Upper limit(-2147483648 to +2147483647)
B 0 -2147483648 Lower limit (0 to 4294967295) Lower limit (-2147483648 to +2147483647)

Concept of the preset function setting of preset signal are described below.
Schematic diagram of preset function

Preset enable/disable
CR2408(CR2409)
Execute preset

External preset input CM1608 bit8 CR2400, CR2401


R014(R015) (CM1609 bit8) (CR2404, CR2405)

■ Setting destination storage address of external preset input and preset value
Destination storage address of preset value
External preset input
Higher bit Lower bit
CTH0 R014 CM1605 CM1604
CTH1 R015 CM1607 CM1606

■ Setting external enable preset input


Device No. Disable enable
CTH0 CR2408 OFF ON
CTH1 CR2409 OFF ON

2-108 - KV-5000/3000 Series User’s Manual-


CPU INTERNAL FUNCTIONS
2-8 High-speed Counter

Counter Enable Function

With the counter enable function, disabling /enabling of counting input can be controlled.
Control can be perform through external enable input (R008, R009) and internal enable relay (CR2410,
CR2411).
In addition, the current value can be reset when counter enable signal changes between enable ->
disable or disable -> enable. 2

High-speed Counter
Counter input up

down

enable
Disable signal
disable

When not reset


A

Counting
value

Reset value 0

when disable -> enable


A
Counting
value

Reset value 0

when enable -> disable


A

Counting
value

Reset value 0

Linear counter Ring counter


unsigned signed unsigned signed
Upper limit
A 4294967295 +2147483647 Upper limit (0 to 4294967295)
(-2147483648 to +2147483647)
Lower limit
B 0 -2147483648 Lower limit (0 to 4294967295)
(-2147483648 to +2147483647)
Setting of enable signal is decribed below.

- KV-5000/3000 Series User’s Manual- 2-109


CPU INTERNAL FUNCTIONS

2-8 High-speed Counter

Example
After initial setting, CTH0 is set to preset enable on the up edge of R1000. (high-speed
counter reset)
CTH0 is set to preset disable on the up edge of R1001. (high-speed counter reset )
CTH0 is set on the down edge R014. (R014 is a NC contact input)

CR2400,CR2401: R014 down edge preset


CR2008 CR2400 CR2401 CM1608 #0 CM1604
2 1 scan ON
SET RES BSET
#8
LDA.D STA.D CM1608 8bit ON: R014 NC contact input
CM1604˖preset value = 0
High-speed Counter

R1000 CR2408

RES Preset enabled when R1000 is ON

R1001 CR2408

SET Preset disabled when R1001 is ON

■ External enable input


External enable input relay Input polarity Disable enable
OFF N.O. ON OFF
CTH0 R008 CM1609 bit 9
ON N.C. OFF ON
OFF N.O. ON OFF
CTH1 R009 CM1609 bit 9
ON N.C. OFF ON

■ Internal enable relay


Internal enable relay Disable enable
CTH0 CR2410 ON OFF
CTH1 CR2411 ON OFF

■ Disable signal
Set via external enable input and internal enable relay.
Combination setting
Description
Bit 2 Bit 1 Bit 0
OFF OFF OFF
Normal enable (counting is perfomed all the time regardless of
OFF ON OFF
the disable/ enable state of external enable input, internal enable
ON OFF OFF
relay.)
ON ON OFF
CM1608 (CTH0) OFF OFF ON Counting is performed when internal enble relay is in enable state.
CM1609 (CTH1) OFF ON ON Counting is performed when external enble relay is in enable state.
Counting is performed when internal enble relay and external
ON OFF ON
enable relay are in enable state.
Counting is performed when internal enble relay or external
ON ON ON
enable relay are in enable state.

■ Current value reset setting when disable <=> enable


Bit 5 Bit 4 Operation
OFF OFF
Not reset
CM1608 (CTH0) OFF ON
CM1609 (CTH1) ON OFF Current value is reset when enable -> disable.
ON ON Current value is reset when disable -> enable.

2-110 - KV-5000/3000 Series User’s Manual-


CPU INTERNAL FUNCTIONS
2-8 High-speed Counter

Comparator Matching Output

When comparator value (setting value) matches the current value, output relay will be ON/OFF. It can be set
through control relay. The comparator matching output will not be affected by scan time.

Comparator Control content


Compa Output relay
matching output Operation when Device control
rator selection
disable/enable Device No. CTC is ON ON OFF 2
CR2104 CR2105 Output ON Disable Enable

High-speed Counter
CTC0 OFF: disable CR2106 Output OFF Disable Enable
CR2505
ON : enable CR2107 Output ON/OFF inverted Disable Enable
CTH0 OFF:R500
CR2108 CR2109 Output OFF Disable Enable
ON :R504
CTC1 OFF: disable CR2110 Output ON Disable Enable
ON: enable CR2111 Output ON/OFF inverted Disable Enable

Comparator Control cotent


Compa Output relay
matching output Device Operation when Device control
rator selection
disable/enable No. CTC is ON ON OFF
CR2204 CR2205 Output ON Disable Enable
CTC2 OFF: disable CR2206 Output OFF Disable Enable
CR2513
ON : enable CR2207 Output ON/OFF inverted Disable Enable
CTH1 OFF:R501
CR2208 CR2209 Output OFF Disable Enable
ON :R505
CTC3 OFF: disable CR2210 Output ON Disable Enable
ON: enable CR2211 Output ON/OFF inverted Disable Enable

Schematic diagram
When CR2505 is OFF When CR2505 is ON
CTCO:CR2104
CTC1:CR2108 I/O connector I/O connector
R500 R500
Pin 16 Pin 16
CTCO:CR2104
CTC1:CR2108

CTH0 CTH0
࡮comparator R504 ࡮comparator R504
matching output Pin 18 matching output Pin 18

When CR2513 is OFF When CR2513 is ON


CTC2:CR2204
CTC3:CR2208 I/O connector I/O connector
R501 R501
Pin 36 Pin 36
CTC2:CR2204
CTC3:CR2208

CTH1 CTH1
࡮comparator R505 ࡮comparator R505
matching output Pin 38 matching output Pin 38

Note
· When comparator matching output in enabled state (CTC0:CR2104 OFF/CTC1:CR2108 OFF), output of
pin 16, pin 18 or pin 36, pin 38 can not be controlled through SET instruction and RES instruction.
· Frequency that can be output from R500 is different from that from R504, R501 and R505.
"Output specification", Page 1-27

- KV-5000/3000 Series User’s Manual- 2-111


CPU INTERNAL FUNCTIONS

2-8 High-speed Counter

Reading the Change Direction of Current Value

(1) Reading the change direction of current value (CTH)


The change direction of current value (CTH) is indicated.
down up
Description
2 CR2412(CTH0) Indicates the change direction of CTH0.
counting
ON
counting
OFF
CR2413(CTH1) Indicates the change direction of CTH1. ON OFF
High-speed Counter

Note
· The change direction (CR2412, CR2413) is refreshed with every scan. After operation is
completed, change direction before completion is maintained .
· The max. refreshing time of change direction is "change direction detection time constant
+ 1 scan period". Value is refreshed to latest value when RFSCTH instruction is executed.
"RFSCTH Instruction", Page 2-118

(2) Setting the change direction detection time constant of current value (CTH)
The change direction detection time constant is set through MOV instruction or DW instruction.
Please refer to KV-5000/3000/1000 Series PLC Instruction Reference Manual, “MOV instructions"

Change direction detection


Setting value
time constant
0 (Default setting) Filter OFF
1 100µs
2 500µs
CM1594 (CTH0) 3 1ms
CM1595 (CTH1) 4 2.5ms
5 5ms
6 10ms
7 50ms

When set to 100µs.

Example
The change direction detection time MOV
constant of CTH0 is set to 100µs. #1 CM1594

#1
DW
CM1594

2-112 - KV-5000/3000 Series User’s Manual-


CPU INTERNAL FUNCTIONS
2-8 High-speed Counter

Capturing Current Value Based on Input Capture

Input capture refers to the function in which current value of high-speed counter is captured from
control memory when interrupt condition occurs. When the interruption condition is on external input,
this function is enabled (ON), which need not be set.
The captured value is stored in control memory CM1610 to CM1617.
Interrupt condition (external High-speed counter for Destination storage address 2
input) current value capturing Higher DM Lower DM

High-speed Counter
When INT R000 occurs CTH0 CM1611 CM1610
When INT R001 occurs CTH0 CM1613 CM1612
When INT R002 occurs CTH1 CM1615 CM1614
When INT R003 occurs CTH1 CM1617 CM1616

For details about interrup, see "3-5 Interrupt", Page 3-31.

Instructions for High-speed Counter

Instruction mnemonics Description about instruction See


High-speed Response frequency
CTH page 2-114
counter Line driver input: 1-phase 100 kHz, phase difference 50 KHz
High-speed Open collector input: 1-phase 60 kHz, phase difference 30 KHz
counter CTC 32-bit (0 to 4294967295 or -2147483648 to 2147483647) up/ page 2-114
comparator down counting operation.
High-speed
counter RFSCTH To refresh current value of high-speed counter to the latest value. page 2-118
refresh

- KV-5000/3000 Series User’s Manual- 2-113


CPU INTERNAL FUNCTIONS

2-8 High-speed Counter

CTH CTH(.D)
CTH.L
CTH 32-bit
High-speed counter
To perform 32-bit (unsigned 0 to
4294967295, signed -2147483648 to
2147483647) up/down counter operation
CTC CTH(.D)
CTC.L
CTC
High-speed counter
Comparator
with max. input frequency of 100 KHZ.

Ladder program Input mode


2 CR2002 HSP
S
High-speed Counter

Execute condition CTH n C T H n S


S
S
CTC n C T C n S

CTC n

Available devices
Index
Indirect Local Modification
Bit device Word device Constant
Operand specifying device
MR DM EM
R (DR) LR T C CTC CR FM ZF T C CTH CTC Z CM #/$ #TM * @ : #/: Z
B TM W
C n KV-5000/3000 - - - - - - - - - - - - - - ○ - - - -
T
H S KV-5000/3000 ○ - - - - - ○ - - - - - - - - - - - -
C n KV-5000/3000 - - - - - - - - - - - - - - ○ - - - -
T
C S KV-5000/3000 - - - - - - - - - - - - - - ○ - - - -

Operand Explanation
n Specifies counter No. with 0 or 1.
CTH
S Specifies counter input.
n Specifies comparator No. with 0 to 3.
CTC Specifies setting value of high-speed counter within the range of 0 to 4294967295 (unsigned)
S
and -2147483648 to +2147483647 (signed).

Operation Description

CTH(.D) When execute condition is ON, input of the device in S is calculated.


CTH.L When execution is OFF, counting value will be cleared.
Unsigned/signed counting is switched through control memory (CM).
"Linear counter", Page 2-99
It's necessary to reduce input time constant when external input (R010, R013) is
calculated.
" Input Time Constant Setting", Page 2-84

CTC(.D) It is ON when setting value in S matches the current value of high-speed counter
during operation of high-speed counter.
CTC.L n is specified within the range of 0 to 42497295 when suffix is ".D".
n is specified within the range of 2147483648 to +2147483647 when suffix is ".L".
For control relay (CR) and data memory (DM) used for high-speed counter function and counting and
reset modes, see settings of each setting item.

2-114 - KV-5000/3000 Series User’s Manual-


CPU INTERNAL FUNCTIONS
2-8 High-speed Counter

■ Reading/changing of current value and changing of setting value


(1) Reading current value
Current value is read through LDA instruction or MOV instruction.
Please refer to KV-5000/3000/1000 Series PLC Instruction Reference Manual, “LDA instructions"
In the case of unsigned value (0 to 4294967295), suffix is indictated by ".D".

Example
Current value of CTH0 is stored in
data memory "DM0/DM1".
CTH0
LDA.D
DM0
STA.D
2

High-speed Counter
MOV.D
CTH0 DM0

In the case of signed value (-2147483648 to +2147483647), suffix is indicated by ".L".

Example
Current value of CTH0 is stored nto
CTH0 DM0
data memory "DM0/DM1". LDA.L STA.L

MOV.L
CTH0 DM0

(2 )Changing current value (CTH)


Current value is changed through MOV instruction or DW instruction.
Please refer to KV-5000/3000/1000 Series PLC Instruction Reference Manual, “MOV instructions", "DW
instructions".

In the case of unsigned value (0 to 4294967295), suffix is indicated by ".D".

Example
Current value of CTH0 is changed
MOV.D
to 100000. #100000 CTH0

#100000
DW.D
CTH0

In the case of signed value (-2147483648 to +2147483647), ".L" is used in suffix.

Example
Current value of CTH0 is changed
MOV.L
to -100000. -100000 CTH0

-100000
DW.L
CTH0

- KV-5000/3000 Series User’s Manual- 2-115


CPU INTERNAL FUNCTIONS

2-8 High-speed Counter

Note
Precautions on CTH change during automatic reset.
·When value is "unsigned" or "signed" and CTC value is positive, even if CTH is changed to
above CTC, the CTH value will be "CTC value-1 ".
·When value is "signed" and CTC value is negativ, even if CTH is changed to below CTC, the
CTH value will be "CTC value +1".
"Automatic reset based on comparator matching", Page 2-106
2
(3) Changing setting value (CTC)
High-speed Counter

Setting value is changed through STA instruction, MOV instruction or DW instruction.


Please refer to KV-5000/3000/1000 Series PLC Instruction Reference Manual, “STA instructions” “MOV
instructions” “DW instructions”

In the case of unsigned value (0 to 4294967295), suffix is indicated by ".D".

Example
Value of CTC0 is change to 100000. #100000 CTC0
LDA.D STA.D

MOV.D
#100000 CTC0

#100000
DW.D
CTC0

In the case of signed value (-2147483648 to +2147483647), ".L" is used in suffix.

Example
Current value of CTC0 is changed
to -100000. -100000 %6%
.&#. 56#.


/18.
-100000 %6%

-100000
&9.
%6%

Note
Precautions on CTH change during automatic reset.
·When value is "unsigned" or "signed" and CTC value is positive, even if CTH is changed to
above CTC, the CTH value will be "CTC value-1 ".
·When value is "signed" and CTC value is negative, even if CTH is changed to below CTC, the
CTH value will be "CTC value +1".
"Automatic reset based on comparator matching", Page 2-106

2-116 - KV-5000/3000 Series User’s Manual-


CPU INTERNAL FUNCTIONS
2-8 High-speed Counter

MEMO

High-speed Counter

- KV-5000/3000 Series User’s Manual- 2-117


CPU INTERNAL FUNCTIONS

2-8 High-speed Counter

RFSCTH RFSCTH High-speed counter


Refresh
To update current value of high-speed
counter to the latest value.

Ladder program Input mode


Execute condition RFSCTH
n R F S C T H n

2 Available devices Index


Cons Indirect Local modific
High-speed Counter

Bit device Word device


tant specifying device ation
Operand
DM EM
R DR MR T C CTC CR FM ZF T C CTH CTC Z CM #/$ #TM * @ : #/: Z
LR
TM W
n - - - - - - - - - - - - - - ○ - - - -

Operand Description
n Specifies high-speed counter No..(0 or 1)

Operation Description

If the execution condition is ON, the current


High-speed Control relay after changing
value of high-speed counter CTH is updated counter Overflow Change direction
to the latest value.
CTH0 CR2403 CR2412
Meanwhile, CTH overflow and change CTH1 CR2407 CR2413
direction control relay are updated to the latest
state.

Operation flag

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 relay R30000 and
R30001.

CR2002 RFSCTH ;(mnemonics list)


#0 LD CR2002
Normal ON RFSCTH #0
LD<.D CTH0 #10000
CTH0 DR30000 OUT DR30000
<.D LD>=.D CTH0 #10000
#10000 Output 0 AND<.D CTH0 #20000
OUT DR30001
CTH0 CTH0 DR30001
>=.D <.D
#10000 #20000 Output 1

2-118 - KV-5000/3000 Series User’s Manual-


CPU INTERNAL FUNCTIONS
2-8 High-speed Counter

Device List for High-speed Counter

■ Control relay (CR) list for CTH0


Device Attribute
R: Read only Description ON OFF
No. Blank: R/W
CR2414
CR2100
R
R
Internal clock (50ns)
Internal clock(1.0µs)
-
-
-
-
2
CR2101 R Internal clock(10.0µs) - -

High-speed Counter
CR2102 R Internal clock(100.0µs) - -
CR2103 If CTC0 ON, then CTH0 is reset automatically. Disable Eable
CR2104 If CTC0 ON, then comparator matching output (R500/R504) is disabled Disable Eable
CR2105 If CTC0 ON, then comparator matching output (R500/R504) is OFF Disable Eable
CR2106 If CTC0 ON, then comparator matching output (R500/R504) is ON Disable Eable
If CTC0 ON, then ON/OFF of comparator matching output (R500/R504)
CR2107 Disable Eable
is inverted
CR2108 If CTC1 ON, then comparator matching output (R500/R504) is disabled Disable Eable
CR2109 If CTC1 ON, then comparator matching output (R500/R504) is OFF Disable Eable
CR2110 If CTC1 ON, then comparator matching output (R500/R504) is ON Disable Eable
If CTC1 ON, then ON/OFF of comparator matching output (R500/R504)
CR2111 Disable Eable
is inverted
CR2112 If CTC1 ON, CTH0 is reset automatically. Disable Eable

Attribute 1-phase 1-phase


Device
R: Read only Description w/o w/ 1x 2x 4x 2-pulse
No. Blank: R/W direction direction
CR2113 OFF ON OFF ON OFF ON
To set external input
CR2114 OFF OFF ON ON OFF OFF
mode
CR2115 OFF OFF OFF OFF ON ON

Device Attribute Rising Falling


R: Read only Description Enable Level
No. Blank: R/W edge edge
CR2400 OFF ON OFF ON
To set external preset input
CR2401 OFF OFF ON ON

Device Attribute
R: Read only Description ON OFF
No. Blank: R/W
CR2402 To select counting mode Ring Linear
CR2403 To detect overflow End Not end
CR2408 To disable preset processing Disable Enable
CR2410 To enable internal enable relay and counting input Disable Enable
Down
CR2412 R Change direction of current value Up counting
counting
CR2505 To switch pulse output destination. R504 R500

TIP The default state of CR2104 and CR2108 is ON. Otherwise, these devices are OFF.

Note
Control relay should be turned on using SET instruction, and turned off using RES instruction.

- KV-5000/3000 Series User’s Manual- 2-119


CPU INTERNAL FUNCTIONS

2-8 High-speed Counter

■ Control memory list for CTH0


Attribute
Device No. R: Read only Description
Blank: R/W
To set change direction detection time constant
Setting value #0 #1 #2 #3 #4 #5 #6 #7
CM1594
Change direction Filter
100µs 500µs 1ms 2.5ms 5ms 10ms 50ms
Detection time constant none
2 CM1596 Ring counter lower limit (low)
CM1597 Ring counter lower limit (high)
High-speed Counter

CM1600 Ring counter upper limit (low)


CM1601 Ring counter upper limit (high)
CM1604 Preset value (low)
CM1605 Preset value (high)

Attribute
Device No. R: Read only Description
Blank: R/W
To set combined condition of external enable input and internal enable relay

Bit 0 bit 2 Bit 1 Bit 0 Explanation


OFF OFF OFF
OFF ON OFF Normal enable (counting is performed all the time, whether
external enable input and internal enable relay are enabled/
ON OFF OFF disabled or not. )
ON ON OFF
Bit 1
OFF OFF ON Counting is performed when internal relay is in enabled state.
OFF ON ON Counting is performed when external enable input is in enabled state.
Counting is performed when internal enable relay and
ON OFF ON
external enable input are in enabled state.
bit 2 Counting is performed when internal enable relay or external
ON ON ON
enable input is in enabled state. nable state.

Bit 3 Reserved for system


To set reset mode based on current value of counter enable function

CM1608 Bit 4 Bit 5 Bit 4 Explanation


OFF OFF
Not reset
OFF ON

bit 5 ON OFF Current value is reset when enable -> disable


ON ON Current value is reset when disable -> enable

Bit 6 Reserved for system


ON : signed
Bit 7 To set counting value to "signed"/"unsigned"
OFF : unsigned
ON : N.C. contact
Bit 8 To set the polarity of external enable input
OFF : N.O. contact
ON : N.C. contact
Bit 9 To set the polarity of external enable input
OFF : N.O. contact
Bit 10

Reserved for system


Bit 15

2-120 - KV-5000/3000 Series User’s Manual-


CPU INTERNAL FUNCTIONS
2-8 High-speed Counter

■ Control relay (CR) list for CTH1


Device Attribute
R: Read only Description ON OFF
No. Blank: R/W
CR2415 R Internal clock (50ns) - -
CR2200 R Internal clock (1.0µs) - -
CR2201 R Internal clock (10.0µs) - -
CR2202 R Internal clock (100.0µs) - -
CR2203 If CTC2 ON, then CTH1 is reset automatically. Disable Enable 2
CR2204 If CTC2 ON, then comparator matching output (R501/R505) disabled. Disable Enable

High-speed Counter
CR2205 If CTC2 ON, then comparator matching output (R501/R505) is OFF Disable Enable
CR2206 If CTC0 ON, then comparator matching output (R501/R505) is ON Disable Enable
If CTC2 ON, then ON/OFF of comparator matching output (R501/
CR2207 Disable Enable
R505) is inverted
CR2208 If CTC3 ON, then comparator matching output (R501/R505) disabled Disable Enable
CR2209 If CTC3 ON, then comparator matching output (R501/R505) is OFF Disable Enable
CR2210 If CTC3 ON, then comparator matching output (R501/R505) is ON Disable Enable
If CTC3 ON, then ON/OFF of comparator matching output (R501/
CR2211 Disable Enable
R505) is inverted
CR2212 If CTC3 ON, then CTH1 is reset automatically. Disable Enable

Attribute 1--phase 1-phase


Device
R: Read only Description w/o w/ 1x 2x 4x 2-pulse
No. Blank: R/W direction direction
CR2213 OFF ON OFF ON OFF ON
To setup external input
CR2214 OFF OFF ON ON OFF OFF
mode
CR2215 OFF OFF OFF OFF ON ON

Device Attribute Rising Falling


R: Read only Description Enable Level
No. Blank: R/W edge edge
CR2404 OFF ON OFF ON
To set external preset input
CR2405 OFF OFF ON ON

Device Attribute
R: Read only Description ON OFF
No. Blank: R/W
CR2406 To select counting mode Ring Linear
CR2407 To detect overflow End Not end
CR2409 To disable preset processing Disable Enable
CR2411 To enable internal enable relay and counting input Disable Enable
down
CR2413 R Change direction of current value Up counting
counting
CR2513 To switch pulse output destination. R505 R501

TIP The default state of CR2104 and CR2108 is ON. Otherwise, these devices are OFF.

Note
Control relay should be turned on using SET instruction, and turned off using RES instruction.

- KV-5000/3000 Series User’s Manual- 2-121


CPU INTERNAL FUNCTIONS

2-8 High-speed Counter

■ Control memory list for CTH1


Attribute
Device No. R: Read only Content
Blank: R/W
To set the change direction detection time constant
Setting value #0 #1 #2 #3 #4 #5 #6 #7
CM1595 Change direction
Filter
Detection time 100µs 500µs 1ms 2.5ms 5ms 10ms 50ms
2 constant
none
High-speed Counter

CM1598 Ring counter lower limit (low)


CM1599 Ring counter lower limit (high)
CM1602 Ring counter upper limit (low)
CM1603 Ring counter upper limit (high)
CM1606 Preset value (low)
CM1607 Preset value (high)

Attribute
Device No. R: Read only Content
Blank: R/W
To set combined condition of external enable input and internal enable relay
Bit 2 Bit 1 Bit 0 Explanation
Bit 0
OFF OFF OFF
OFF ONOFF Normal enable (counting is performed all the time, whether
external enable input and internal enable relay are enabled/
ON OFF OFF disabled or not.)
ON ON OFF
Bit 1 OFF OFF ON Counting is performed when internal relay is in enabled state.
OFF ON ON Counting is performed when external enable input is in enabled state.
Counting is performed when internal enable relay and
ON OFF ON
external enable input are in enabled state.
Counting is performed when internal enable relay or external
Bit 2 ON ON ON
enable input is in enabled state.

Bit 3 Reserved for system


To set reset mode based on current value on counter enable function.
CM1609 Bit 4 Bit 5 Bit 4 Explanation
OFF OFF
Not reset.
OFF ON

Bit 5 ON OFF Current value is reset when enable -> disable


ON ON Current value is reset when disable -> enable

Bit 6 Reserved for system


ON : signed
bit 7 To set counting value to "signed"/"unsigned"
OFF : unsigned
ON : N.C.
Bit 8 To set the polarity of external enable input
OFF : N.O.
ON : N.C.
Bit 9 To set the polarity of external enable input
OFF : N.O.
Bit 10

Reserved for system


Bit 15

2-122 - KV-5000/3000 Series User’s Manual-


CPU INTERNAL FUNCTIONS
2-8 High-speed Counter

Direct Clock Pulse Output

When high-speed counter (CTH) and high-speed counter comparator (CTC) are used, it's possible to
output the clock pulse to direct output relay R500 (R504) or R501 (R505) without being influenced by
scan time.

2
■ Overview

High-speed Counter
For pulse output, the internal clock pulse is counted through high-speed counter (CTH). Whenever the
current value matches the setting value of high-speed counter comparator (CTH), the ON/OFF state of
output relay R500 (R504) and R501 (R505) will be changed to generate pulse.
Counting value

CTC

ON ON

 Relay No. of ouput pulse can be changed through CR2505 (CTH0)/CR2513 (CTH1).
Device No. Description ON
CR2505 Switches the pulse output destination of CTH0. Outputs pulse to R504 Outputs pulse to R500
CR2513 Switches the pulse output destination of CTH1. Outputs pulse to R505 Outputs pulse to R501

Note
· The output at beginning of direct clock pulse output begins always with OFF state.
· In the direct clock pulse output process, the output relay R500 (R504) and R501 (R505)
cannot be used for general program.
· Frequency that can be ouput by R500 and R504 is different from that of R501 and R505.
Please set the output destination address according to frequency.
"Output specification", Page 1-27

■ Frequency range that can be output


Pulse period (frequency) and pulse width can be set using the internal clock period for high-speed
counter (CTH) and high-speed counter comparator (CTC).

Clock pulse period (frequency) that can be set can be changed within the following range.
Output Internal clock Pulse period(frequency)range
CR2414 (50ns) 10µs (100kHz) to 214748.36475ms
CR2100 (1.0µs) 10µs (100kHz) to 4294967.295ms
R500 (R504)
CR2101 (10.0µs) 20µs (50kHz) to 42949672.95ms
CR2102 (100.0µs) 200µs (5kHz) to 429496729.5ms
CR2415 (50ns) 10µs (100kHz) to 214748.36475ms
CR2200 (1.0µs) 10µs (100kHz) to 4294967.295ms
R501 (R505)
CR2201 (10.0µs) 20µs (50kHz) to 42949672.95ms
CR2202 (100.0µs) 200µs (5kHz) to 429496729.5ms

- KV-5000/3000 Series User’s Manual- 2-123


CPU INTERNAL FUNCTIONS

2-8 High-speed Counter

■ Setting up comparator setting value (CTC)


Pulse period of output clock pulse and setting value of high-speed counter comparator can be set with
the following formula.
Pulse period (µs)=1000000 / frequency (Hz)

● Pulse with 1:1 ON/OFF ratio


2 ON

OFF
High-speed Counter

Pulse width

Pulse period

Setting value of CTC = pulse period (µs)/internal clock (µs) ÷ 2


● Pulse with variable pulse width
ON

OFF
Pulse width

Pulse period

Setting value of CTC for pulse width = pulse width (µs) / internal clock (µs)
Setting value of CTC for pulse period = pulse period (µs)/internal clock (µs)

● Setting range of CTC


Special auxiliary relay (internal clock) Period CTC Setting range
CR2414 CR2415 50ns 100 to 4294967295
CR2100 CR2200 1.0µs 5 to 4294967295
CR2101 CR2201 10.0µs 1 to 4294967295
CR2102 CR2202 100.0µs 1 to 4294967295

Note
· If CR2100 and CR2200 are set in operand of high-speed counter (CTH), please set the
CTC setting value to above 5. If the setting value is smaller than 5, the clock pulse cannot
be output correctly.
· If CR2414 and CR2415 are set in operand of high-speed counter (CTH), please CTC
setting value to above 100. If the setting value is smaller than 100, the clock pulse cannot
be output correctly.
· The pulse width will change due to the influence of connected load. Please observe
actual output waveform with oscillograph, and then set the pulse width.
· If you use CTC0 and CTC1 or CTC2 and CTC3 to generated clock pulse, please don't set
the same setting value for CTC0 and CTC1, or CTC2 and CTC3.
· The above mentioned pulse width is the pulse width that is ouput from inside of V-5000/
3000 PLC. In fact, it's output through output circuit. So, the pulse width will fluctuate due
to the influence of response relay and connected load. Please observe actual output
waveform with oscillograph, and then set the pulse width.

2-124 - KV-5000/3000 Series User’s Manual-


CPU INTERNAL FUNCTIONS
2-8 High-speed Counter

■ Control relay setting


● When CTH0 is used
Through setting the control relay (CR2103 to CR2112) at start of operation, and making changes while clock
pulse is generated, you can change ON/OFF state of output relay R500 (R504), as shown in table below.
Besides, you can freely set pulse period and pulse width, and enable/ disable state of comparator output.
When control relay is ON/ OFF, the output relay R501 (R505) operates as follows.
High-speed
2

High-speed Counter
counter control relay Operation when CTH0 (current value) = CTC (setting value)
comparator
CR2103 Current value of CTH0 is reset automatically ON : Auto reset OFF: not auto reset
CR2104 Controls R500(R504) ON : disabled OFF : enabled
Comparator matching output of R500
CR2105 ON : Auto reset OFF: Not auto reset
CTC0 (R504) is turned off
Comparator matching output of R500
CR2106 ON : Auto reset OFF: Not auto reset
(R504) is turned on
CR2107 R500 (R504) output ON/OFF is inverted ON : Auto reset OFF: Not auto reset
CR2108 Controls R500 (R504) ON : disabled OFF : enabled
Comparator matching output of R500
CR2109 ON : Auto reset OFF: Not auto reset
(R504) is turned off
CTC1 Comparator matching output of R500
CR2110 ON : Auto reset OFF: Not auto reset
(R504) is turned on
CR2111 R500 (R504) output ON/OFF is inverted ON : Auto reset OFF: Not auto reset
CR2112 Current value of CTH0 is reset ON : Auto reset OFF: Not auto reset

· CR2104 and CR2108 can be controlled by turning R500 (R504) OFF.


· If CR2105 and CR2109 are turned on/off, then operations such as stopping and outputting clock
pulse etc. can be realized.

Note
· Only one relay between CR2104 to CR2107 and CR2108 to CR2111 will be turned on.
· SET, RES or STA instruction can be used to set CR2103 to CR2112 ON/OFF.
· If pulse period can be changed, be sure to turn on CR2103 or CR2112 to let current value
of CTH0 reset automatically. The pulse period cannot be changed if CR2103 or CR2112
isn't turned on.
· Within the control relay range of CR2104 to CR2107 and CR2108 to CR2111, when
serveral relays are to be turned on, relays of smaller No. are turned on first.

- KV-5000/3000 Series User’s Manual- 2-125


CPU INTERNAL FUNCTIONS

2-8 High-speed Counter

● Operation of output R500(R504) based on control relay setting


Pulse with 1:1 ON/OFF ratio Pulse with variable pulse width

Relay No. Setting Relay No. Setting Relay No. Setting Relay No. Setting
CR2103 ON CR2112 OFF CR2103 ON CR2112 OFF
CR2104 OFF CR2108 ON CR2104 OFF CR2108 OFF
CR2109 OFF
2 CR2105
CR2106
OFF
OFF CR2110 OFF
CR2105
CR2106
OFF
ON
CR2109
CR2110
ON
OFF
CR2107 ON CR2111 OFF CR2107 OFF CR2111 OFF
High-speed Counter

Counting value Counting value

CTC0 CTC0
CTC1

ON ON ON ON ON ON

● When using CTH1


Through setting the control relay (CR2203 to CR2212) at start of operation, and making changes while clock
pulse is generated, you can change ON/OFF state of output relay R501 (R505), as shown in table below.
Besides, you can freely set pulse period and pulse width, and enable/ disable state of comparator output.
When control relay is ON/ OFF, the output relay R501 (R505) operates as follows.
High-speed
counter Control relay Operation when CTH0 (current value) = CTC (setting value)
comparator
Current value of CTH1 is reset
CR2203 ON : Auto reset OFF: not auto reset
automatically
CR2204 Controls R501 (R505) ON : disabled OFF : enabled
Comparator matching output of R501
CTC2 CR2205 ON : Auto reset OFF: Not auto reset
(R505) is turned off
Comparator matching output of R501
CR2206 ON : Auto reset OFF: Not auto reset
(R505) is turned on
CR2207 R501 (R505) output ON/OFF is inverted ON : Auto reset OFF: Not auto reset
CR2208 Controls R501 (R505) ON : disabled OFF : enabled
Comparator matching output of R501
CR2209 ON : Auto reset OFF: Not auto reset
(R505) is turned off
CTC3 Comparator matching output of R501
CR2210 ON : Auto reset OFF: Not auto reset
(R505) is turned on
CR2211 R501 (R505) output ON/OFF is inverted ON : Auto reset OFF: Not auto reset
CR2212 Current value of CTH1 is reset ON : Auto reset OFF: Not auto reset

· CR2204 and CR2208 can be controlled by turning R500 (R504) OFF.


· If CR2205 and CR2209 are turned on/off, then operations such as stopping and outputting clock
pulse etc. can be realized.

2-126 - KV-5000/3000 Series User’s Manual-


CPU INTERNAL FUNCTIONS
2-8 High-speed Counter

Note
· If pulse period can be changed, be sure to turn on CR2203 or CR2212 to let current
value of CTH1 reset automatically. The pulse period cannot be changed if CR2203 or
CR2212 isn't turned on.
· Only one relay between CR2204 to CR2207 and CR2208 to CR2211 will be turned on.
· SET, RES or STA instruction can be used to set CR2203 to CR2212 ON/OFF.
· Within the control relay range of CR2204 to CR2207 and CR2208 to CR2211, when
serveral relays are to be turned on, relays of smaller No. are turned on first. 2

High-speed Counter
● Operation of output R501(R505) based on control relay setting
Pulse with 1:1 ON/OFF ratio Pulse with variable pulse width

Relay No. Setting Relay No. Setting Relay No. Setting Relay No. Setting
CR2203 ON CR2212 OFF CR2203 ON CR2212 OFF
CR2204 OFF CR2208 ON CR2204 OFF CR2208 OFF
CR2205 OFF CR2209 OFF CR2205 OFF CR2209 ON
CR2206 OFF CR2210 OFF CR2206 ON CR2210 OFF
CR2207 ON CR2211 OFF CR2207 OFF CR2211 OFF

Counting value Counting value


CTC2 CTC2
CTC3

ON ON ON ON ON ON

■ Pulse with 1:1 ON/OFF ratio


As illustrated below, clock pulse with 1:1 ON/OFF ratio can be ouput from output R500 using high-
speed counter (CTH0) and high-speed counter comparator (CTC0).

● Control relay setting


Set CR2103 to CR2107 according to the table on the right.
Relay No. Setting
For the pulses with 1:1 ON/OFF ratio, inverted output (toggle circuit) can
CR2103 ON
be used to simplify procedure. CR2104 OFF
CR2105 OFF
CR2106 OFF
CR2107 ON

● Setting value for internal clock and CTC0


Determine internal clock and obtain setting value of CTC0 by calculating the current value.

Setting value of CTC0 = pulse period (µs)/internal clock (µs) / 2

- KV-5000/3000 Series User’s Manual- 2-127


CPU INTERNAL FUNCTIONS

2-8 High-speed Counter

In the above formula, pulse period = 1ms, internal


Control relay Internal clock CTC0 value
clock = 10µs, which are subsituted (CR2101) and
CR2414 50ns 10000
setting value of CTC0 is obtained. CR2100 1.0µs 500
The setting value of CTC0 is changed to "50". CR2101 10.0µs 50
The values calculated from other internal clocks are CR2102 100.0µs 5
listed as follow (for reference only).

2 ● Program example
·Pulse output of output R500 set through CR2104 to
High-speed Counter

CR2008 CR2103 CR2104 CR2105 CR2106 CR2107 CTH0 2107.


00001 SET RES RES RES SET RES
In this example, R500's comparator matching output
CR2002 %6*& (CR2104:OFF) is disabled when set; when CTH0 =
00002 CR2101 CTC0, output of R500 is inverted (CR2107: ON).
#50 · CR2103 is turned on, and resetting of CTH0 is
00003 CTC.D0 specified via CTC0.
With this operation, current value of CTH0 is cleared
repeatedly through setting value of CTC0.
Count value ·When operation is started, current value of CTH0 (RES
CTH0 part) is reset repeatedly.
CTC0 Pulse width of clock pulse can be correctly output from
1st pulsse through this operation.
· CTH0's enable input relay is always ON during
outputing clock pulse.
ON ON

Note
If enable input of high-speed counter is used for startting/stopping clock pulse, then
response may be delayed up to one scan period when clock pulse is started.

■ Tip
If clock pulse output is to be controlled through external input (enable/disable), it can be controlled
through ON/OFF of CR2105.
CR2105 ON/OFF can be set through SET, RES or KEEP instruction.
So clock pulse must start from "OFF", and finish with "OFF".
In the example of previous page, if a program in the figure below is added, then R500 will output clock
pulse only when R000 is ON.

●When using SET/RES instruction ●When using KEEP instruction

R000 CR2105 R000 KEEP


SET SET
CR2105
R000 CR2105 R000
RES RES

2-128 - KV-5000/3000 Series User’s Manual-


CPU INTERNAL FUNCTIONS
2-8 High-speed Counter

■ Output example of clock pulse with variable ON/OFF ratio


As illustrated below, high-speed counter (CTH1) and high-speed counter comparator (CTC2, CTC3)
can be used to output clock pulse of variable pulse width from output R501.

● Control relay setting


Set CR2203 to CR2212 according to the table
below.
Relay No.
CR2203
Setting
ON
Relay No.
CR2212
Setting
OFF
2
CR2204 OFF CR2208 OFF

High-speed Counter
CR2205 OFF CR2209 ON
CR2206 ON CR2210 OFF
CR2207 OFF CR2211 OFF

● Internal clock and setting value of CTC2 and CTC3


Determine internal clock, and calculate current setting value of CTC and CTC3.

Setting value of CTC3 = pulse width (µs) / internal clock (µs)

Setting value of CTC2 = pulse period (µs)/internal clock (µs)

In above-specified formula, pulse width=200µs, pulse period=500µs and internal clock=10µs (CR2201)
are substituted, and the setting value of CTC2 and CTC3 is calculated.
The setting value of CTC3 is "20", and that of CTC2 is "50".
The values calculated from other internal clocks are as follows (only for reference).
Control relay Internal clock CTC2 value CTC3 value
CR2415 50ns 10000 4000
CR2200 1.0µs 500 200
CR2201 10.0µs 50 20
CR2202 100.0µs 5 2

● Program example
CR2008 CR2103 CR2104 CR2105 CR2106 CR2107 ·CR2204 to 2207 and CR2208 to 2211 are used to set
00001 SET RES RES SET RES pulse output for output R501.
In this example, it should be guaranteed when setting
CR2108 CR2109 CR2110 CR2111 CR2112 CTH0
00002 RES SET RES RES RES RES that, for comparator matching output of R501,
(CR2204 :OFF) can turn on output of (CR2206: ON)
CR2002 CTH.D0 R501 through CTC2, and can turn off (CR2209:ON)
00003 CR2101 through CTC3.
#50 ·CR2203 is turned off, and reset of CTH1 is specified
00004 CTC.D0 through CTC2.
Pulse width of clock pulse can be correctly output
#20
00005 CTC.D1 from 1st pulse through the above operation.
·CTH1's enable input relay is always ON when clock
pulse is output.
Count value

CTC0
CTC1

ON ON ON ON

- KV-5000/3000 Series User’s Manual- 2-129


CPU INTERNAL FUNCTIONS

2-8 High-speed Counter

Note
· If enable input of high-speed counter is used for for starting/stopping clock pulse, the
response may be delay up to 1 scan period when clock pulse is started or stopped.
· For starting and stopping of clock pulse output, refer to the "Tip" below.

● Tip
2 When the output of clock pulse is controlled through external input (enable/disable), this can be done
through ON/OFF of CR2205.
High-speed Counter

SET, RES or KEEP instruction is used to turn CR2205 ON/OFF.


So clock pulse must start from "OFF", and finish with "OFF".
In the example on the previous page, if a program in the figure below is added, R501 will output clock
pulse only when R000 is "ON".

●When using SET/RES instruction ●When using KEEP instruction


R000 CR2205 R000 KEEP
SET SET
CR2205
R000 CR2205 R000
RES RES

· Through rewriting the setting value of high-speed counter comparator CTC2 via STA instruction,
clock pulse period (frequency) can be changed.

■ An example of stopping clock pulse through specified number of pulses


Clock pulse is stopped after 10000 clock pulses (output period 500µs (2kHz), pulse width 200µs) are
ouput from output R500.

● Setting of control relay, internal clock and CTC


Setting of CTC0 and CTC1 through control relay and internal clock is as follows.

Relay No. Setting Relay No. Setting


CR2103 ON CR2112 OFF
CR2104 OFF CR2108 OFF
CR2105 OFF CR2109 ON
CR2106 ON CR2110 OFF
CR2107 OFF CR2111 OFF

Setting value of internal clock and CTC0, CTC1 are as follows.


control relay Internal timer CTC0 value CTC1 value
CR2414 50ns 10000 40000
CR2100 1.0µs 500 200
CR2101 10.0µs 50 20
CR2102 100.0µs 5 2

2-130 - KV-5000/3000 Series User’s Manual-


CPU INTERNAL FUNCTIONS
2-8 High-speed Counter

● Program example
·Pulse output of output R500 is set through CR2104 to
CR2008 CR2103 CR2104 CR2105 CR2106 CR2107 2107 and CR2108 to 2111.
00001 EI SET RES SET SET RES
In this example, (CR2104 OFF) R500's comparator
CR2108 CR2109 CR2110 CR2111 CR2112 matching output is allowed to turn on (CR2106: ON)
00002 RES SET RES RES RES
R500 output through CTCO, and turn off (CR2109:
CR2203 CTH0 CTH1 ON) R500 output through CTC3.
00003 SET RES RES
·CR2103 is specified, and CTH0 reset is specified via
R000 R1000 R1000 CR2105 CTC0.
00004 DIFU RES Pulse width of clock pulse can be correctly output from

00005
CR2002 %6*&
CR2101
1st pulse via above operation.
·Interrupt is enabled through EI instruction.
2
When the current value of high-speed counter CTH1

High-speed Counter
#50
00006 CTC.D0 matches the setting value of high-speed counter
comparator CTC2 (10000 pulse output), clock pulse
#20
00007 CTC.D1 will be stopped through interrupt program (INT CTC2).
·CR2203 is turned on, and CTH1 reset is specified via
CR2002 %6*& CTC2.
00008 R500
Through the above operations, operation can be
#10000 performed repeatedly using the specified number of
00009 CTC.D2
pulses (10000).
END ·CTH1's enable input relay is always kept at ON state
00010
during counting of clock pulse.
INT ·CTH1's enable input relay is always ON when clock
00011 CTC2 pulse counting is performed.
CR2002 CR2105 ·Internal clock (CR2101) is specified on the clock input
00012 SET high-speed counter CTH0, and R500 is specified on
the clock input of high-speed counter CTH1.
RETI
00013 Through the above operations, CTH0 is used for clock
pulse output, and CTH1 is used for clock pulse
ENDH
00014 counting.
·Number of pulses of clock pulse is set the setting value
of high-speed counter comparator CTC2.
·Clock pulse output is started turning on input R000.
When clock pulse is turned on again after stopping,
please turn on input R000 again.

● Tip
ON/OFF of CR2103 to CR2111 can be set by LDA instruction and STA instruction in addition to SET
instruction/RES instruction. If the program shown in the example is rewritten through LDA instruction
and STA instruction, then number of rungs and steps can be reduced as shown in the figure below.

CR2008 CR2103 CR2104 CR2105 CR2106 CR2107 CR2008 $0268 CR2100 CTH0 CR2203 CR2813 CTH1
EI SET RES SET SET RES EI LDA STA RES SET SET RES

CR2108 CR2109 CR2110 CR2111 CTH0


RES SET RES RES RES

CR2203 CR2813 CTH1


SET SET RES

· About LDA $0268


When LDA $0268 is executed, internal register will be input as follows.

[0] [2] [6] [8]

Internal register 0 0 0 0 0 0 1 0 0 1 1 0 1 0 0 0

When STA CR2100 is executed,value of the internal register will be assigned to auxilary relay
CR2100 to CR2115.
ˆˆ˖ 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
ǂCR21ˆˆ

CR2103, CR2105, CR2106 and CR2109 will be ON.


- KV-5000/3000 Series User’s Manual- 2-131
CPU INTERNAL FUNCTIONS

2-8 High-speed Counter

MEMO

2
High-speed Counter

2-132 - KV-5000/3000 Series User’s Manual-


2-9 Frequency Counter

CPU INTERNAL FUNCTIONS


Frequency counter can be used to measure frequency or rotation speed.

Frequency Counter Function Overview

Through special instructions, frequency (Hz) or rotation speed (rpm) of external pulse input can be
measured simply.

External pulse input CTH0


FCNT command 2
A-phase R010

Frequency Counter
Frequency measurement
B-phase R012 measurement (Hz)

RCNT command
External pulse input CTH1
A-phase R011
Rotation speed(rpm)
B-phase R013

Note
Since high-speed counter is required to use frequency counter function, therefor, other
functions or instructions of high-speed counter with the same No. cannot be used
simultaneously.

For Terminal No. of input relays (R010 to R013), see "Wiring and Internal Circuit Diagram", Page 1-28。

Frequency Counter Instructions

There are 2 types of instructions for frequency counter.


Instruction mnemonics Description see
Frequency To measure the frequency of pulse input using high-speed Page
FCNT
measurement counter (CTH0/CTH1). 2-134
Rotation speed To measure the rotation speed of pulse input using high- Page
RCNT
measurement speed counter (CTH0/CTH1). 2-136

- KV-5000/3000 Series User’s Manual - 2-133


CPU INTERNAL FUNCTIONS

2-9 Frequency Counter

To detect the frequency of


FCNT FCNT Frequency
measurement
pulse input using high-
speed counter.

Read ladder program from memory card Input mode


Execute condition FCNT n
S1 S2 D F C N T n 5 5 &

2 Available devices Index


Frequency Counter

Cons Indirect Local modific


Bit device Word device
Operand tant specifying device ation
MR DM EM
R DR LR T C CTC CR FM ZF T C CTH CTC Z CM #/$ #TM * @ : #/: Z
B TM W
n - - - - - - - - - - - - - - ○ - - - -
S1 - - - - - - - - - - - - - - ○ - - - -
S2 ○ - ○ - - - ○ ○ ○ ○ ○ ○ ○ ○ ○ - ○ ○ ○
D ○ - ○ - - - ○ ○ ○ ○ - - - ○ - - ○ ○ ○

Operand Decription
n Specifies used high-speed counter No.(0, 1)*1
Specifies pulse input mode. *1
S1  0 = 1-phase w/o direction; 1 = 1-phase w/ direction; 2 = phase difference 1x; 3 = 2-pulse
"Counting Input Setting", Page 2-101
Speciies scan times within 0 to 65535. But, if the scan times is "0", it will be set to "100".
S2 When bit device is specified, continuous 16 bits will be occupied. If word device is specified, only 1 word
is occupied. *2
Specifies the leading device for storing detection result (Hz). When bit device is specified, continuous 32
D
bits will be occupied. If word device is specified, then 2 words will be occupied. *2
*1 The device cannot be specified in "$".
*2 When a bit device other than channel start is specified (R106, R1012, etc.), it will be dragged to
next channel during processing.

Description of Operation

Settings of S1 and S2 are read on the rising edge of the execution conditon, and each scan is
performed when the execution condition is ON. The value (detection result) stored in D / D+1 will
be refreshed whenever the scan times in S2 is perfomred. No. of the high-speed counter n is
specified.
If the execution condition is established, then time between pulses of external input is detected
continuously, and with END processing, frequency is calculated from the time between pulses.
Fruquency (Hz) =1/(time between pulses)
The mean value corresponding to scan times in S2 is taken as the measurement result of
frequency, and stored in D / D+1 .
The updating period is below "scan time X (scan times specified by S2 )".
If execution condition is OFF, then detection will be stopped.

2-134 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-9 Frequency Counter

Note
· 2 or above FCNT intructions using high-speed counter with the same No. cannot be
executed simultaneously.
· Other functions or instructions cannot be used simultaneously when the high-speed
counter with the No. n is used.
· After execution condition is ON, detection is started from the 1st pulse input, and
detection result is refreshed from the 2nd pulse input on.
· When this instruction is used, please use HSP instruction and control relay and set the 2
input time constant to 10 μs.

Frequency Counter
"Input Time Constant Setting", Page 2-84
· Please don't change the control relay (CR) and control memory (CM) related to high-
speed counter specified by n .
· Starting and stopping of detection is executed when scanning is finshed. (when no
instruciton is executed.)
· If there is no pulse input within 1s, the frequency is 0 (Hz).
· When S1 and S2 are changed, please temporarily change execution condition
from OFF -> ON.
· Cannot be used in interrupt program and initialization module.

Operation flag

CR2009 No change in status


CR2010 No change in status
CR2011 No change in status
ON in the following cases; OFF in other cases.
CR2012 • When range of indirect specifying and index modification is improper
If indirect specifying or index modification is not specified, then the status will be not changed.
* If CR2012 is ON, the instruction will be not executed. The error will bedisplayed in KV STUDIO or in
the access window. In addition, detailed error info will be stored in CM5100 to CM5176.
"Error Log (CM)", Page 3-20

Sample Program

Frequency (Hz) of encoder input R010 (A-phase) and R012 (B-phase) is detected, and the result is
stored in " DM0/DM1". (CTH0 is used)

CR2002 HSP ;(mnemonics list)


R010 LD CR2002
Always ON HSP R010
HSP R012
HSP LD R000
R012 FCNT #0 #2 #10 DM0

R000 FCNT 0
#2 #10 DM0

- KV-5000/3000 Series User’s Manual - 2-135


CPU INTERNAL FUNCTIONS

2-9 Frequency Counter

Rotation To detect the rotation speed


RCNT RCNT
speed of pulse input using high-
measurement speed counter.

Ladder program Input mode


Execute condition RCNT n
S1 S2 D R C N T n 5 5 &

2 Available devices Index


Frequency Counter

Cons Indirect Local modific


Bit device Word device
Operand tant specifying device ation
MR DM EM
R DR LR T C CTC CR FM ZF T C CTH CTC Z CM #/$ #TM * @ : #/: Z
B TM W
n - - - - - - - - - - - - - - ○ - - - -
S1 - - - - - - - - - - - - - - ○ - - - -
S2 ○ - ○ - - - ○ ○ ○ ○ - - - ○ ○ - ○ ○ ○
D ○ - ○ - - - ○ ○ ○ ○ - - - ○ - - ○ ○ ○

Operand Description
n Specifes used high-speed counter No..(0, 1).*1
Specifes pulse input mode. *1
S1  0 = s1-phase w/o direction; 1 = 1-phase w/ direction; 2 = phase difference 1x; 3 = 2-pulse
"Counting Input Setting", Page 2-101
Specifies the leading device for storing parameters. When bit device is specified, continuous 48 bits will
be occupied. If word device is specified, 3 words will bes occupied. *2
  S2 +0 … Detection method (0: to detect according pulse interval; 1: to detect according to time per revolution)
S2   S2 +1 … number of pulses per revolution.
· to detect according to pulse interval (1 to 65535)
· to detect according to time per revolution (1 to 32767)
  S2 +2 … Scan times (0 to 65535). If it is 0, the scan times will be set to 100.
Speciies the leading device for storing detection result (rpm). When bit device is specified, continuous 32
D
bits will be occupied. If word device is specified, 2 words will be occupied. *2
*1 The device cannot be specified in "$".
*2 When bit device other than channel starting (R106, R1012, etc.) is specified, it will be dragged to
next channel during processing.

Description of Operation

Settings of S1 and S2 are read on the rising edge of the execution conditon, and each scan is performed
when the execution condition is ON. The value (detection result) stored in D / D+1 will be refreshed
whenever the scan times in " S2 +2" is perfomred. No. of the high-speed counter n is specified.

● To detect according to pulse interval (when " S2 + 0 is 0)


If the execution condition is established, then time between pulses external input is detected
continuously, and with END processing, rotation speed specified in S2 +1 is calculated.
Rotation speed (rpm)=60/(time between pulses× pulses per revolution)
The mean value corresponding to scan times specified by S2 +2 is stored in " D / D +1" as
detection result of rotation speed.
The updating period is below "scan time X (scan times specified by S2 +2).
If execution condition is OFF, detection will be stopped.

2-136 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-9 Frequency Counter

● To detect rotation speed according to time per revolution (when S2 + 0 is 1)


If execution condition is ON, number of pulses of external input will be counted. Time equal to the
number of pulses per revolution specified by S2 + 1 (time required for 1 revolution) is detected
continuously, and with END processing, rotation speed is calculated accoriding to the time between
specified number of pulses.
Rotation speed (rpm)= 60 / (time per revolution)
The mean value corresponding to scan times specified by S2 +2 is stored in " D / D +1" as
detection result of rotation speed. 2
The updating period is below "scan time× (scan times specified by S2 +2).

Frequency Counter
If execution condition is OFF, detection will be stopped.

Note
· 2 or above RCNT intructions using high-speed counter with the same No. cannot be
executed simultaneously.
· Other functions or instructions cannot be used simultaneously when the high-speed
counter with the No. n is used.
· After execution is ON, detection result is refreshed from the 2nd pulse input on.
· When this instruction is used, please use HSP instruction and control relay, and set the
input time constant to 10µs. "2-12 Motor (positioning) Control", Page 2-157
· Please don't change control relay (CR) and control memory (CM) not related to high-
speed counter with the No. specified by n .
· Starting and stopping of detection is executed when scanning is finshed. (when no
instruciton is executed.)
· When detection is started according to pulse interval, it will change to 0 (rpm) when pulse
interval is larger than 1s.
· When detection is started according to time per revolution, it will change to 0 (rpm) when
time longer than 1.5s is required for 1 revolution.
· When S1 and S2 are changed, please temporarily change execution condition
from OFF -> ON.
· Cannot be used in interrupt program and initialization module.

Operation flag

CR2009 No change in status


CR2010 No change in status
CR2011 No change in status
ON in the following cases; OFF in other cases.
CR2012 • In the case of range beyond the specified range by S2
• When range of indirect specifying and index modication is not proper.
* If CR2012 is ON, the instruction will not be executed. The error will be displayed in KV STUDIO or
access window. In addition, the detailed error info will be stored in CM5100 to CM5176.
"Error Log (CM)", Page 3-20

- KV-5000/3000 Series User’s Manual - 2-137


CPU INTERNAL FUNCTIONS

2-9 Frequency Counter

Sample Program

Rotation speed (rpm) of encoder input R010 (A-phase) and R012 (B-phase) is detected, and the result
is stored in "DM0/DM1". (CTH0 is used)

CR2002 HSP ;(mnemonics list)


R010 LD CR2002

2 Always ON
HSP
HSP R010
HSP R012
LD R000
R012 MOV #1 DM100
Frequency Counter

MOV #2500 DM101


R000 MOV MOV #10 DM102
#1 DM100 RCNT #0 #2 DM100 DM0

MOV
#2500 DM101

MOV
#10 DM102

RCNT 0
#2 DM100 DM0

2-138 - KV-5000/3000 Series User’s Manual -


2-10 Cam Switch

CPU INTERNAL FUNCTIONS


Angle conversion is performed on the value from encoder, and cam operation is simulated.

Cam Switch Function Overview

Current value obtained from acquisition encoder input is compared with preset setting of multiple ranges.
The setting range in which the current value is located will be detected, and the output destination
device corresponding to this setting range is set to ON. 2
gEncoder Setup range Output destination device

Cam Switch
gCPU internal device OFF setting value ON setting value Range of ON
Compare (1)OFF setting value (1)ON setting value (1) (1) ON<=(current value) < (1) OFF
(2)OFF setting value (2)ON setting value (2) (2) ON<=(current value) < (2) OFF
current … … … … …
(31)OFF setting value (31)ON setting value (31) (31) ON<=(current value) < (31) OFF
(32)OFF setting value (32)ON setting value (32) (32) ON<=(current value) < (32) OFF

Various special instructions corresponding to different input modes are available.

Cam switch instructions


External input
External input
5-bit to 15-bit
Common input ABSENC instructions
Absolute encoder
External pulse input
(CTH0) A-phase R010ǂB-phase R012ǂZ-phase R014
(CTH1) A-phase R010ǂB-phase R013ǂZ-phase R015 High-speed
INCENC instructions Output
counter input
Incremental encoder

CPU internal
MCMP instructions
device

Note
When incremental encoder is used, since high-speed counter is required, other functions or
instructions using a high-speed counter with the same No. cannot be used simultaneously.

Cam Switch Instructions

There are the following 3 types of cam switch instructions.


Instruction mnemonics Description See
Multi-stage Page
MCMP Multi-stage comparator operation is performed.
comparator 2-140
Absolute Page
ABSENC Absolute encoder is used to perform cam operation.
Encoder 2-144
Increment Page
INCENC Incremental encoder is used to perform cam operation.
Encoder 2-148

- KV-5000/3000 Series User’s Manual - 2-139


CPU INTERNAL FUNCTIONS

2-10 Cam Switch

MCMP
MCMP Multi-stage
comparator
To perform multi-stage
comparator operation.

Ladder program Input mode


Execute condition MCMP
S1 S2 D S1 S2 D n
2 n
M C M P
Cam Switch

Available devices Index


Cons Indirect Local modifi
Bit device Word device
Operand tant specifying device cation
MR DM EM
R DR LR T C CTC CR FM ZF T C CTH CTC Z CM #/$ #TM * @ : #/: Z
B TM W
S1 ○ - ○ - - - - ○ - - - - - ○ - - ○ ○ ○
S2 ○ - ○ - - - ○ ○ ○ ○ ○ ○ ○ ○ ○ - ○ ○ ○
D ○ - ○ - - - ○ ○ - - - - - ○ - - ○ ○ ○
n ○ - ○ - - - ○ ○ ○ ○ ○ ○ ○ ○ ○ - ○ ○ ○

Operand Description
S1 Specifies the leading device of data block for comparing. *1
S2 Speciies the device for comparing.*2
D Specifies the leading device for storing comparison result. *3
n Specifies number of data for comparing or the device for storing number of data. (1 to 32)*4*5

*1 If bit device is specified, then n x 32 continuous bits starting from channel will be processed.
If word device is specified, n x 2 words will be processed.
*2 If bit device is specified, then continuous 16 bits will be processed.
If relays other than channel leading relay (R002, R106, R1012, etc.) are specified, then 16 bits
will be processed, straddling to the next channel.
*3 When bit device is specified, n bits will be occupied.
When word device is specified, the result is stored in lowest bit of each word device. The bits
other than the lowest bit is not changed.
*4 "$" cannot be used.
*5 When bit device is specified, continuous 16 bits will be occupied.
If word device is specified, 1 word will be occupied.

2-140 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-10 Cam Switch

Description of Operation

When execution condition is ON, n 32-bit data (2 unsigned 16-bti BIN data: OFF setting and ON
setting) starting from S1 are compared with the unsigned 16-bit BIN data stored in S2 , and the
result is stored in devices starting from D .
OFF setting value ON setting value Compare Result

S1 ˇ1
bit
31
30
bit bit
16 15
12
bit
0
S1 D OFF
2
n S1 ˇ3 40 30 S1 ˇ2 D ˇ1 ON

Cam Switch
bit bit
S1 ˇ5 30 80 S1 ˇ4 15 0 D ˇ2 OFF
S2 30
n ×
˄ǂǂ
2 words˅ S1 ˇ2˄ǂǂ
n ˉ2˅ˇ1 10 30 S1 ˇ2˄ǂǂ
n ˉ2˅ D ˇǂǂ
n ˉ2 ON
S1 ˇ2˄ǂǂ
n ˉ1˅ˇ1 30 30 S1 ˇ2˄ǂǂ
n ˉ1˅ D ˇǂǂ
n ˉ1 OFF

When OFF setting > ON setting


 If OFF setting > S2 >= ON setting, then D is ON.
When OFF setting < ON setting
If OFF setting > S2 or S2 >= ON setting, then D is ON.
When OFF setting = ON setting
   D is always OFF.

Note
· Even if the execution condition is OFF, output will not be changed.

Operation flag

CR2009 No change in status


CR2010 No change in status
CR2011 No change in status
ON in the following cases; OFF in other cases.
· When a value out of range is specified in n .
CR2012 · When a device other than channel leading device is specified in S1 .
· When range of indirect specifying and index modification is not proper.
· When a device other than the channel leading device is specified in D .
* If CR2012 is ON, the instruction will be not executed. When CR2012 is ON, the detailed error info will
be stored in CM5100 to CM5176.
"Error Log (CM)", Page 3-20

Sample Program

The value of data memory DM0 is compared with setting value, and output relay is ON/OFF according
to the following conditions.
If #100<=DM0<=#200, R30000 is ON.
If #300<=DM0<=#400, R30001 is ON.
If #500<=DM0<=#600, R30002 is ON.
If #700<=DM0<=#800, R30003 is ON.
If #900<=DM0<=#1000, R30004 is ON.
If #1100 <= DM0 <=#1200, R30005 is ON.
- KV-5000/3000 Series User’s Manual - 2-141
CPU INTERNAL FUNCTIONS

2-10 Cam Switch

CR2008 MOV ;(mnemonics list)


#100 DM10 LD CR2008
1 scan ON at operation start MOV #100 DM10
MOV #200 DM11
MOV MOV #300 DM12
#200 DM11 MOV #400 DM13
MOV #500 DM14
MOV MOV #600 DM15
#300 DM12 MOV #700 DM16
MOV #800 DM17

2 MOV
#400 DM13
MOV #900 DM18
MOV #1000 DM19
MOV #1100 DM20
MOV #1200 DM21
Cam Switch

LD R000
MOV
MCMP DM10 DM0 R30000 #6
#500 DM14

MOV
#600 DM15

MOV
#700 DM16

MOV
#800 DM17

MOV
#900 DM18

MOV
#1000 DM19

MOV
#1100 DM20

MOV
#1200 DM21

R000 MCMP
DM10 DM0 R30000

#6

2-142 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-10 Cam Switch

MEMO

Cam Switch

- KV-5000/3000 Series User’s Manual - 2-143


CPU INTERNAL FUNCTIONS

2-10 Cam Switch

ABSENC To use absolute


ABSENC Absolute
encoder
encoder to perform
cam switch operation.

Ladder program Input mode


Execute condition ABSENC
S1 S2 D1 S1 S2
2 D2
A B S E N C
D1 D2
Cam Switch

Available devices Index


Cons Indirect Local modific
Bit device Word device
Operand tant specifying device ation
MR DM EM
R DR LR T C CTC CR FM ZF T C CTH CTC Z CM #/$ #TM * @ : #/: Z
B TM W
S1 ○ - ○ - - - - ○ - - - - - ○ - - ○ ○ ○
S2 ○ - ○ - - - ○ ○ ○ ○ ○ ○ ○ ○ - - ○ ○ ○
D1 ○ - ○ - - - ○ ○ - - - - - ○ - - ○ ○ ○
D2 ○ - ○ - - - ○ ○ - - - - - ○ - - ○ ○ ○

Operand Decription
S1 : 0 to 3599). *1
Specifies the leading device of the data block for storing comparison angle setting value (unit 0.1°
S2 Specifies the device for storing absolute encoder value. *2
D1 Specifies the leading device for storing comparison result. *3
D2 Specifies the leading device for storing parameters. *4

*1 If bit device is specified, then " D2 +0" x 32 bits starting from channel will be processed.
If word device is specified, " D2 +0" x 2 words will be processed.
*2 When bit device is specified, continuous 16 bits will be used. If relays other than the channel leading relay
(R002, R106. R1012 etc.) are specified, then 16 bits will be processed, straddling to the next channel.
*3 When bit device is specified, then " D2 +0" bits will be occupied.
When word device is specified, the result is stored in the lowest bit of each word device. The bits other than
the lowest bit will not be changed.
*4 If bit device is specified, then continuous 128 bits starting from the start of channel will be occupied.
If word device is specified, 8 words will be occupied.

2-144 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-10 Cam Switch

Description of Operation

Parameter
Device Content
Number of
D2 +0 Sets number of comparison data (1 to 32).
comparison data
D2 +1 Resolution Sets the resolution of encoder (32 to 32768) . 2
Sets residual gray code (0 to 16384).

Cam Switch
Residual (Exa 32,64,128,256,512,1024,
Resolution 36 360 720
D2 +2 mple) 2048,4096,8192,16384,32768
gray code
Residual
0 14 76 152
gray code

Zero degree
D2 +3 Sets the value specifed to zero degree.(0 to resolution -1)
setting value
Stores the current angle after compensation.(0 to 3599)
Current angle ·When S2 -" D2 +2" >= " D2 +3".
D2 +4 (unit: 0.1  (3600÷" D2 +1") x ( S2 -" D2 +2"-" D2 +3")
degree) ·When S2 -" D2 +2"<" D2 +3").
 (3600/" D2 +1") x (" D2 +1"+ S2 -" D2 +2"-" D2 +3")

Device Content
D2 +5 D1 D2 +4
Bit 0: output response error
<Condition>
If within a scan period, the ON setting value is equal to the OFF setting value for 2 above changed
output destination devices, or there is any difference between ON setting values, and between OFF
setting values, an error will occur. No No change
Operation No error will occur in the following cases. change in status
D2 +5
error · When ON setting value is equal to OFF setting value for the output destination devices changed
simultaneously.
·When ON/OFF setting values of the output destination devices changed simultaneously are the same.
Bit 1: Input value out of range error No No
It will be On when input value of the encoder isn't within the setting range.   change change
Please reset by ladder program.

D2 +6
Workspace (User cannot use)
D2 +7

When execution is ON, " D2 +0" 32-bit data (2 unsigned 16-bit BIN data: OFF setting and ON setting)
starting from the leading device S1 will be compared with the current angle value in " D2 +4", and
the result will be stored in devices starting from D1 .

OFF setting value ON setting value Compare Result


bit bit bit bit
31 16 15 0
S1 ˇ1 30 12 S1 D2 ˇ4 D1 OFF
D2 ˇ0]
[ǂǂ S1 ˇ3 40 30 S1 ˇ2 D1 ˇ1 ON
bit bit
S1 ˇ5 30 80 S1 ˇ4 15 0 D1 ˇ2 OFF
30
D2 ˇ0]×
˄[ǂǂ
2 words˅ S1 ˇ2˄[ǂǂ
D2 ˇ0]ˉ2˅ˇ1 10 30 D2 ˇ0]ˉ2˅
S1 ˇ2˄[ǂǂ D1 ˇǂǂ
n ˉ2 ON
S1 ˇ2˄[ǂǂ
D2 ˇ0]ˉ1˅ˇ1 30 30 S1 ˇ2˄[ǂǂ
D2 ˇ0]ˉ1˅ D1 ˇǂǂ
n ˉ1 OFF

When OFF setting > ON setting


  If OFF setting > " D2 +4" >= ON setting, then D1 is ON.
When OFF setting < ON setting
  If OFF setting > " D2 +4" or " D2 +4" >= ON setting, then D1 is ON.
When OFF setting = ON setting
   D1 is always OFF.
- KV-5000/3000 Series User’s Manual - 2-145
CPU INTERNAL FUNCTIONS

2-10 Cam Switch

■ Output response error ( D2 +5 bit 0)


D2 5 bit0 OFF OFF OFF OFF ON(error) (In the case of no error)
A …When output destination device changed is 1 within a scan period.
Scan once B …When the ON setting value is equal to the OFF setting value for 2
above output destination devices changed within a scan period.
ON OFF
·OFF setting value of output destination device (1) = ON setting
Output destination(1) value of output destination device (2)
A C
C …When the ON setting value is equal to the OFF setting value for 2
Output destination(2) above output destination devices changed within a scan period.
·OFF setting value of output destination device (2) = ON setting
2 Output destination(3)
B

D
value of output destination device (3)
·OFF setting value of output destination device (3) = OFF setting
value of output destination device (4)
Cam Switch

Output destination(4)
C A (In the case of error)
Output destination(5) Within a scan period, when the ON setting value is different from
the OFF setting value ofr 2 above output destination devices. Or,
there is difference between ON setting values and between OFF
setting values.
e.g.) D …Within a scan period, the ON and OFF setting value of
2 above output destination devices are changed
OFF setting value of output destination device (4) ≠ ON setting
value of output destination device (5)

Note
· In the process of operation, change of setting value will immediately be reflected to the
output. If you don't want reflect it to output, please set the xecution condition OFF.
· Do not use CR2002 (normal ON) control relay in execution condition.
· Even if the execution condition is OFF, output will be not changed.
· Cannot be used in interrupt program and initialization module.

Operation flag

CR2009 No change in status


CR2010 No change in status
CR2011 No change in status
ON in the following cases; OFF in other case.
·When a value out of range is specified in encoder value, each parameter value and angle setting value.
CR2012 · When a bit device other than the channel leading device is specified in S1 ./ D2 .
· When range of indirect specifying and index modification range is improper .
· When timer and counter is set in D1 / D2 through indirect specifying.
* If CR2012 is ON, the instruction will be not executed. When CR2012 is ON, the detailed error info will
be stored in CM5100 to CM5176.
"Error Log (CM)", Page 3-20

Sample Program

Input value R000 to R007 from absolute encoder is stored in DM0, and is comparated with the setting
value. Output relay will be ON/OFF according to the following specification.
Resolution: 256/rev. Residual gray code: 0 Zero-point teaching value: 12

R000
Absolute
encoder R007
KV-5000/3000

2-146 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-10 Cam Switch

If 10.0° <= DM0 <= 20.0°, R30000 is ON.


If 30.0° <= DM0 <= 40.0°, R30001 is ON.
If 50.0° <= DM0 <= 60.0°, R30002 is ON.
If 70.0° <= DM0 <= 80.0°, R30003 is ON.
If 90.0° <= DM0 <= 100.0°, R30004 is ON.
If 110.0° <=DM0 <=1 20.0°, R30005 is ON.

CR2008 MOV
;(mnemonics list)
LD CR2008
MOV #6 DM110
2
#6 DM110
MOV #256 DM111

Cam Switch
1 scan ON at
operation start MOV #0 DM112
MOV MOV #12 DM113
#256 DM111 LD CR2002
LDA R0
MOV CON
#0 DM112 ANDA $FF
CON
STA DM0
MOV
LD CR2002
#12 DM113
MOV #100 DM10
MOV #200 DM11
MOV #300 DM12
CR2002 R0 $FF DM0
MOV #400 DM13
LDA ANDA STA MOV #500 DM14
Always ON
MOV #600 DM15
CR2002 MOV MOV #700 DM16
#100 DM10 MOV #800 DM17
Always ON MOV #900 DM18
MOV
MOV #1000 DM19
MOV #1100 DM20
#200 DM11
MOV #1200 DM21
LD MR000
MOV ABSENC DM10 DM0 R30000 DM110
#300 DM12

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 R30000

DM110

- KV-5000/3000 Series User’s Manual - 2-147


CPU INTERNAL FUNCTIONS

2-10 Cam Switch

INCENC To perform cam switch


INCENC Incremental
encoder
operation using
incremental encoder.

Ladder program Input mode


Execute condition INCENC
S1 S2 S3 I N C E N C S1 S2 S3
2 D1 D2 D1 D2
Cam Switch

Available devices Index


Cons Indirect Local modific
Bit device Word device tant specifying device ation
Operand
MR DM EM
R DR LR T C CTC CR FM ZF T C CTH CTC Z CM #/$ #TM * @ : #/: Z
B TM W
S1 ○ - ○ - - - - ○ - - - - - ○ - - ○ ○ ○
S2 - - - - - - - - - - - - - - ○ - - - -
S3 - - - - - - - - - - - - - - ○ - - - -
D1 ○ - ○ - - - ○ ○ - - - - - ○ - - ○ ○ ○
D2 ○ - ○ - - - ○ ○ - - - - - ○ - - ○ ○ ○

Operand Description
S1 Specifies leading device of the data block for storing comparison angle setting value (unit 0.1°: 0 to 3599). *1
S2 Specifies No. of used high-speed counter (CTH). (0,1)*2
Sets encoder counting input mode. (0 to 5)*2
0 - 1-phase w/o direction 1 - 1-phase w/ direction 2 - phase difference, 1x
S3
3 - phase difference, 2x 4 - phase difference, 4x 5 - 2-pulse
"Counting Input Setting", Page 2-101
D1 Specifies the leading device for storing comparison result. *3
D2 Specifies the leading device for storing parameters. *4

*1 If bit device is specified, then continuous " D2 +0" x 32 bits starting from channel will be
processed. If word device is specified, then " D2 +0" x 2 words will be processed.
*2 "$" cannot be used.
*3 When bit device is used, " D2 +0" bits will be occupied.
When word device is specified, the result is stored in the lowest bit of each word. Bits other than
the lowest bit will not be changed.
*4 If bit device is specified, then continuous 80 bits starting from the start of channel will be
occupied.
If word device is specified, then 5 words will be occupied.

2-148 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-10 Cam Switch

Description of Operation

Parameter
Device Content
Number of
D2 +0 Sets number of comparison data (1 to 32)
comparison data
D2 +1 Resolution Sets resolution of encoder (32 to 32768) 2
Zero degree

Cam Switch
D2 +2 Sets the value specified to zero degree. (0 to resolution -1)
setting value
Stores the current angle after compensation. (0 to 3599)
· " S2 ">=" D2 +2").
Current angle
D2 +3  (3600/" D2 +1")×( S2 -" D2 +2")
(unit: 0.1°C)
· " S2 "<" D2 +2".
 (3600/" D2 +1")×(" D2 +1"+ S2 -" D2 +2")

Device Content

D2 +4 D1 D2 +3
Bit 0: output response error
<Condition>
If within a scan period, the ON setting value is different from the OFF setting value for 2 above output
destination devices, or there is any difference between ON setting values, and between OFF setting
No No change
values, an error will occur.
change in status
No error will occur in the following cases.
D2 +4 Operation error · When ON setting value is equal to the OFF setting value for the 2 above output destination devices.
· When ON setting values or OFF setting values for 2 above destination devices changed simultaneously
are same.
Bit 1: Input value out of range error No No
When input value of encoder isn't within the setting range. change change
Please reset by ladder program.

When execution is ON, " D2 +0" 32-bit data (2 unsigned 16-bit BIN data: OFF setting and ON setting)
starting from the leading device S1 will be compared with the current angle value in " D2 +3", and
the result will be stored in devices starting from D1 .

OFF setting value ON setting value Compare Result


bit bit bit bit
31 16 15 0
S1 +1 30 12 S1 D2 +3 D1 OFF
D2 +0]
[ǂǂ S1 +3 40 30 S1 +2 D1 +1 ON
bit bit
S1 +5 30 80 S1 +4 15 0 D1 +2 OFF
30
D2 +0]×
([ǂǂ
2 words) S1 +2 ([ǂD2
ǂˇ0]-2) +1 10 30 S1 +2 ([ǂD2
ǂ +0]-2) D1 + ǂǂ
n -2 ON
S1 +2 ([ ǂǂˇ0]-1)
D2 +1 30 30 S1 +2 ([ ǂǂ
D2 +0]-1) D1 + ǂǂ
n -1 OFF

When OFF setting > ON setting


When OFF setting > " D2 +3" >= ON setting, then D1 is ON.
When OFF setting < ON setting
  If OFF setting > " D2 +3" or " D2 +3" >= ON setting, then D1 is ON.
When OFF setting=ON setting
   D1 is always OFF.

- KV-5000/3000 Series User’s Manual - 2-149


CPU INTERNAL FUNCTIONS

2-10 Cam Switch

■ Output response error ( D2 +4 bit 0)


D2 4 bit0 OFF OFF OFF OFF ON(error) (In the case of no error)
A …When output destination device changed is 1 within a scan period.
Scan once B …Within a scan period, when the ON setting value is equal to the
OFF setting value for 2 above output destination devices changed.
ON OFF
· OFF setting value of output destination device (1) = ON setting
Output destination(1) value of output destination device (2)
A C
C …When ON setting value is equal to OFF setting value within 1 scan
Output destination(2) period for 2 above output destination devices.
B ·OFF setting value of output destination device (2) = ON setting
2 Output destination(3)
D
value of output destination device (3)
·OFF setting value of output destination device (3) = OFF setting
Output destination(4) value of output destination device (4)
Cam Switch

C A (In the case of error)


Output destination(5) Within a scan period, when the ON setting value of 2 above output
destination devices changed is different from OFF setting value.
Or, there are many difference between ON setting value and OFF
setting value
Example) D …Within a scan period, the ON and OFF setting value of 2
above output destination devices are changed.
OFF setting value of output destination device (4) ≠ ON
setting value of output destination device (5)

Note
· In the process of execution, change of setting value will immediately be reflected to
output. If you don't want to reflect it output, please turn execution condition OFF.
· In the process of operation, sometimes an error will occur when high-speed counter reset
is performed ("RES instruction", "external input (Z-phase)") under output response error
condition (" D2 +4" bit 0).
· Do not use CR2002 (normal ON) control relay under execution condition.
· Even if the execution condition is OFF, output will be not changed. Setting value is held.
· Other instructions can not be used when functions specified by " S2 " are used.
· Meanwhile, NCENC instructions with same " S2 " cannot be used.
· When INCENC instruction is used, please use HSP instruction and control relay, and set
the input time constant to 10µs.
"Input Time Constant Setting", Page 2-84
· Since high-speed counter functions are used, don't' change control relay, control memory,
CTH and CTC related to high-speed counter using ladder program, etc.
· When power is OFF, value of high-speed counter will be maintained. Please use RES
instruction and CTH instruction to clear.
· Cannot be used in interrupt program and initialization module.
· Attention should be paid if writing is performed in RUN mode.
"Write in the RUN mode", Page 3-179

Operation flag

CR2009 No change in status


CR2010 No change in status
CR2011 No change in status
ON in the following cases; OFF in other cases.
·When a value out of range is specified in encoder value, value of each parameter and angle setting value
CR2012 · When a bit device other than channel leading device is specified in S1 / D2 .
· When range of indirect specifying and index modification range is improper
· When a bit device other than channel leading device is specified in D1 / D2 .
* If CR2012 is ON, the instruction will be not executed. When CR2012 is ON, the detailed error info is
stored in CM5100 to CM5176.
"Error Log (CM)", Page 3-20

2-150 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-10 Cam Switch

Sample Program

Input value from the incremental encoder is measured using the high-speed counter CTH 1, the
measured value is compared with the setting value. Then output relay is turned ON/OFF according to
the following specifiaction. Value of high-speed counter CTH1 can be cleared through turning ON the
input relay R001.
2
High speed counter •• CTH1 Resolution•••••••••••••••••••• 256/rev.

Cam Switch
M counting mode ••••• 2-pulse zero degree teaching •••••• 12

* HSP instruction should be used additonally.


" HSP", Page 3-46

If 10.0° <=CTH1<=20.0°, R30000 is ON.


If 30.0° <=CTH1<=40.0°, R30001 is ON.
If 50.0° <=CTH1<=60.0°, R30002 is ON.
If 70.0° <=CTH1<=80.0°, R30003 is ON.
If 90.0° <=CTH1<=100.0°, R30004 is ON.
If 110.0° <=CTH1<=120.0°, R30005 is ON.

- KV-5000/3000 Series User’s Manual - 2-151


CPU INTERNAL FUNCTIONS

2-10 Cam Switch

CR2008 MOV ;(mnemonics list)


#6 DM110 LD CR2008
1 scan ON at MOV #6 DM110
operation start MOV #256 DM111
MOV MOV #12 DM112
#256 DM111 LD CR2002
MOV #100 DM10
MOV MOV #200 DM11
#12 DM112 MOV #300 DM12
MOV #400 DM13
2 CR2002 MOV
MOV #500 DM14
MOV #600 DM15
#100 DM10 MOV #700 DM16
Cam Switch

Always ON MOV #800 DM17


MOV #900 DM18
MOV
MOV #1000 DM19
#200 DM11
MOV #1100 DM20
MOV #1200 DM21
MOV LD R000
#300 DM12 INCENC DM10 #1 #5 R30000 DM110
LD R001
RES CTH1
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

R000 INCENC
DM10 #1 #5

R30000 DM110

R001 CTH1
RES

2-152 - KV-5000/3000 Series User’s Manual -


2-11 Specifed Frequency Pulse Output

CPU INTERNAL FUNCTIONS


Pulse output can be performed according to the specified frequency.

Specified Frequency Pulse Output Overview

If instruction "PLSOUT" dedicated for specified frequency pulse output is used, it's only required to
specify high-speed counter/output frequency/duty cycle to simply output pulses with specified
frequency from the output relay of PLC. 2
Output pulse by R500 or R504
CTH0

Specifed Frequency Pulse Output


PLSOUT instruction

CTH0/CTH1
specified frequency
setting operation ratio Output pulse by R501 or R505
CTH1

About Output Relay Switching

The relay No. of output pulse can be changed through CR2505 (CTH0)/CR2513 (CTH1).
Device No. Content ON OFF
CR2505 Switches the pulse output destination of CTH0. Outputs pulse to R504 Outputs pulse to R500
CR2513 Switches the pulse output destination of CTH1. Outputs pulse to R505 Outputs pulse to R501

Note
Since the specified frequency pulse output function will use high-speed counter, therefore,
other functions or instructions using the high-speed counter with same No. cannot be used
simultaneously.

For No. of each I/O terminal, see "Wiring and Internal Circuit Diagram", Page 1-28.

Specified Frequency Pulse Output Instruction

Instruction Mnemonics Description See


Specified frequency Outputs pulses of specified frequency using high-speed Page
PLSOUT
pulse output counter (CTH0/CTH1). 2-154

- KV-5000/3000 Series User’s Manual - 2-153


CPU INTERNAL FUNCTIONS

2-11 Specifed Frequency Pulse Output

Description of Operation

PLSOUT PLSOUT
Specified frequency
pulse output
To output the pulse of specified
frequency using high-speed counter.

Ladder program Input mode


Execute condition S
PLSOUT n1 P L S O U T n1 S n2
n2
2 Available devices Index
Cons Indirect Local modifi
Specifed Frequency Pulse Output

Bit device Word device


tant specifying device cation
Operand
MR DM EM
R DR LR T C CTC CR FM ZF T C CTH CTC Z CM #/$ #TM * @ :#/:Z
B TM W
n1 - - - - - - - - - - - - - - ○ - - - -
S ○ - ○ - - - ○ ○ ○ ○ ○ ○ ○ ○ ○ - ○ ○ ○
n2 ○ - ○ - - - ○ ○ ○ ○ ○ ○ ○ ○ ○ - ○ ○ ○

Operand Description
n1 Specifies No. of used high-speed counter. (0, 1)*1
Specifies frequency (0 to 100000) (Hz) or stores the leading device of specified frequency.
S When bit device is specified, continuous 32 bits will be occupied. If word device is specified, 2 words will
be occupied. *1 *2
Specifies duty cycle (-499 to 499) of output pulse, or stores leading device for the duty cycle.
When bit device is specified, continuous 16 bits will be occupied. If word device is specified, 1 word will
be occupied. *1 *2

Setting value
(Duty cycle -50) *10
-499 … 0 … 499
n2
Duty ratio
TON / (TON + TOFF)
0.1% … 50.0% … 99.9%

ON ON ON

OFF OFF OFF


Output pulse
TON
TOFF

*1 Cannot be specified in "$".


*2 When bit device other than channel leading device (R106, R1012, etc.) is specified, it will staddle
next channel during processing.

Description of Operation

When execution condition is ON, pulse with specified frequency by S will be output through output
relay. No. of used high-speed counter ( n1 ) is specified. Specify the Duty cycle of output pulse is
specified by n2 .
If the execution condition is OFF, then pulse output is OFF.
When output relay is CTH0, it will be R500 or R504. When output relay is CTH1, it will be R501 or
R505. Output relay switching can be performed through CR2505 (CTH0)/CR2513 (CTH1).
"Specifed Frequency Pulse Output", Page 2-153

2-154 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-11 Specifed Frequency Pulse Output

Note
· 2 above PLSOUT instructions using a high-speed counter with the same No. cannot be used.
· Other functions or instructions using the high-speed counter of the No.specified by n

cannot be used simultaneously.


· Please don't change control relay (CR) and control memory (CM) for the high-speed
counter other than that specified by n .
· When R504 (CTH0) or R505 (CTH1) is used, output can be performed normally over 10000Hz.
2

Specifed Frequency Pulse Output


Operation flag

CR2009 No change in status


CR2010 No change in status
CR2011 No change in status
ON in the following cases; OFF in other cases.
• When a value out of the range is specified in the operand
CR2012
• When range of indirect specifying and index modification is improper
When range of s and n indirect specifying, index modification is improper
* If CR2012 is ON, the instruction will be not executed. The error is displayed in KV STUDIO or in
access window. In addition, detailed error info will be stored in CM5100 to CM5176.
"Error Log (CM)", Page 3-20

Sample Program

When R000 is turned on, pulses will be output to R501 according to the frequency (duty cycle 50%) set
by "DM1/DM0". (CTH1 is used)

R000 DM0 ;(mnemonics list)


PLSOUT 1 LD R000
+0 PLSOUT #1 DM0 +0

● Application example: synchronized control


In the case of encoder input A-phase R010/B-phase R012, frequency counter function and specified
frequency pulse output function are combined to perform adjustment and controling. (frequency counter uses
CTH0, specified frequency pulse output uses CTH1).

CR2002 HSP Set input time ;(mnemonics list)


R010 constant of R010 to LD CR2002
Always ON 10µs. HSP R010
HSP R012
HSP LD R000
R012 Set input time
FCNT #0 #2 #10 DM0
constant of R012 to PLSOUT #1 DM0 +0
10µs.
R000 FCNT 0
#2 #10 DM0
Start to detect
 Input setting: 2-phase, 1x
DM0
 Scan times: 10
PLSOUT 1
+0  Measurement result: "DM0/DM1"

- KV-5000/3000 Series User’s Manual - 2-155


CPU INTERNAL FUNCTIONS

2-11 Specifed Frequency Pulse Output

MEMO

2
Specifed Frequency Pulse Output

2-156 - KV-5000/3000 Series User’s Manual -


2-12 Description of Operation Motor (positioning) Control

CPU INTERNAL FUNCTIONS


KV-5000/3000 can input pulse to step motor or servo motor without being influenced by scan time, to
realize 2-axis positioning control.

Specification of Positioning Control

Item Specification

Control mode
Positioning (point to point) control, speed control 2
"Operation mode", Page 2-160

Description of Operation Motor (positioning) Control


No. of axes controlled 2 (X/Y)
Positioning points 32 (Common for 2 axes) *
Position instruction -2147483648 to 2147483647 (ABS/INC)
Speed instruction 50 to 100000 p/s
Acceleration/
0 to 4000 ms
deceleration time
Starting time 30µs
Open collector output (1-pulse /2-pulse switching)
Pulse output mode
"Output mode selection", Page 2-169
Dedicated instruction PLSX/PLSY (Pulse output), ORGX/ORGY (Origin return), JOGX/JOGY(JOG),
"Positioning
TCHX/TCHY(Teaching), HOMEX/HOMEY (Move to home position), CHGSPX/
Instruction List", Page
2-185
CHGSPY (operating speed change), RFSPSX/RFSPSY (Current value refresh)

* Parameters are stored in control memory (CM). Over 33 positioning points can be managed through
changing value by program.

Concept of Positioning Control

Through prestting target coordinates (number of pulses)/starting speed/operating speed/acceleration


and deceleration time, ladder timing chart positioning control can be performed, as shown below.
Frequency (Hz)
Target value/movement amount (number of output pulses)

Operating speed

Starting speed
(stopping speed)

Time (ms)
Acceleration time Deceleration time

- KV-5000/3000 Series User’s Manual - 2-157


CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

Procedure for Positioning Control

Procedure for positioning control is as follows.

"Parameter Setup", Page 2-158


(1) Initial parameter setup

2
(2) Generate ladder program
Description of Operation Motor (positioning) Control

"Creating ladder program", Page 2-179


"Positioning Instruction List", Page 2-185
"Reference Example of Positioning Control", Page 2-203
(3) Execute program

No
Change parameter
during executing? "Lilst of Devices/error Codes for Positioning", Page 2-208
"Change speed during operation", Page 2-183
Yes "Reference example for executing speed change during
operation", Page 2-203
Change parameter "Reference example for executing positioning control over 32
points", Page 2-207

Parameter Setup

Parameters are divided into 2 types: point parameters and system parameters.
Every parameter can be managed through control relay (CR) or control memory (CM), and the value
can be rewritten through ladder program, so that parameters can be changed during operation.

Point parameters
Point parameters are the basic parameter for ladder control, which is used to set movement target point
(position), operating/starting speed as well as acceleration/deceleration time.
"Point parameters", Page 2-159

System parameters
System parameters can be used to set sensor input, pulse output, comparator, origin return operation
and JOG operation.
"System parameters (I/O setting)", Page 2-165
"System parameters (comparator setting)", Page 2-170
"System parameters (origin returning)", Page 2-172
"System parameters (JOG)", Page 2-177

Parameters are set through "Edit CPU positioning parameters" of KV STUDIO.


Select "Tool(T)" ▼ "Edit CPU positioning parameters(I)" from the menu.

Other procedure Click .


Right-click in the ladder edit window, and select "Edit CPU positioning parameters" from the menu.
2-158 - KV-5000/3000 Series User’s Manual -
CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

Point parameters

(2) (3) (4) (5) (6) (7) (8)

(1)

Description of Operation Motor (positioning) Control


Function name Setting range Default See
(1) Point No. 0 to 31 Page 2-160
INC positioning
Incremental
ABS positioning
(2) Operation mode positioning Page 2-160
CW control
(INC)
CCW control
(3) Target value/movement -2147483648 to 2147483647 0 Page 2-161
(4) Starting speed 50 to 65535 200 Page 2-162
(5) Acceleration/deceleration time 0 to 4000 500 Page 2-162
(6) operating speed 50 to 100000 50000 Page 2-162
(7) Use of stop sensor Yes/None None page 2-163
(8) Specified pulse for stop 0 to 65535 0 Page 2-164

TIP Once set, the parameters will be stored in control memory (CM) (control memory) of CPU.
Point parameters are common to X-axis and Y-axis.

Point No. Storage position set


0 …… CM2060 to CM2067
1 …… CM2070 to CM2077
2 …… CM2080 to CM2087
3 …… CM2090 to CM2097
… …

If the checkbox is selected, then the storage position as shown on the right will be displayed.

"Lilst of Devices/error Codes for Positioning", Page 2-208

- KV-5000/3000 Series User’s Manual - 2-159


CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

■ Point No.
Used as operand of PLSX and PLSY instruction and can be specified according to device.

Execute condition #1
PLSX

When the above ladder program is executed, pulse will be generated according to the point parameter of
2 point No.1.
“PLSX, PLSY instruction", Page 2-186
Description of Operation Motor (positioning) Control

■ Operation mode
Through positioning control (INC positioning and ABS positioning), you can move an object by a target
value/movement from a certain position.
Through speed control (CW control and CCW control), you can move an object towards a specified
direction, until the stop sensor is ON.

● INC positioning
In this mode, relative coordinates are used for positioning control.
When an object moves from current postion to a specified position, the distance between the two
positons will be specified as movement. For example, in the following figure, when the object at A
moves to B, the movement should be set to "+100". Then, when it moves from B to C, the movement
should be set to "+200". When it returns to B from C, the movement should be set to "-200".
In the case of current position overflow, warning relay will be ON, but pulse output will not stop.
"Lilst of Devices/error Codes for Positioning", Page 2-208

A B C

+100 +200

-200

Coordinate
Current position 0 (origin) 100 200 300

● ABS positioning
In this mode, absolute coordinates are used for position control.
The distance from origin to the target positon is specified as target value. For example, in the following figure,
when the object at A moves to B, the target value should be set to "+100". Then, when it moves from B to C,
the target value should be set to "+300". When it returns to B from C , the target valueshould be set to
"+100".
When warning relay is ON, an error will occur and pulse output will stop if ABS positioning is performed.
"Lilst of Devices/error Codes for Positioning", Page 2-208

A B C

100 300

100
Coordinate
Current position 0 (origin) 100 200 300

2-160 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

● CW control
In CW control, pulses will be output continuously in CW direction according to specified speed,
independent of number of output pulses.
Speed
CW

CCW
Time 2

Description of Operation Motor (positioning) Control


● CCW control
In CCW control, pulses will be output continuously in CCW direction according to specified speed,
independent of number of output pulses.
CW
Time

CCW
Speed

TIP Parameter storage position: parameters are stored in bit 0 and bit 1 of CM2066+(point No. x
10), as shown below.

bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit1 bit0 Contents to be set


0 0 Locating INC
0 1 Locating ABS
1 0 Speed control CW
1 1 Speed control CCW

■ Target value/movement
The position to move to is called “target value" or "movement".
If ABS positioning is selected as operation mode, it is "target value"; if INC positioning is selected, then
it is "movement”. If CW/CCW control is selected, then it cannot be set.
Frequency (Hz)
Target value/movement (number of output pulses)

Operating speed

Starting speed
(Stop speed)

Time (ms)
Acceleration time Deceleration time

Setting range : -2147483648 to 2147483647


Parameter storage position: CM2061+(point No.x10)/CM2060+(point No.x10)

Higher 16-bit Lower 16-bit


- KV-5000/3000 Series User’s Manual - 2-161
CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

■ Starting speed
When performing positioning control, output pulse speed should be set to ensure smooth startup of motor
revolution.
Setting range : 50 to 65535 (PPS) (note: starting speed must be smaller than operating speed).
Parameter storage position: CM20621+(point No.x10)

2 ■ Acceleration/deceleration time
Acceleration time: time required from starting speed to operating speed. The lower the value is, the
Description of Operation Motor (positioning) Control

quicker the acceleration and the shorter the moving time will be.
Deceleration time: time required from operating speed to stopping speed. The lower the value is, the
quicker the deceleration and the shorter the moving time will be.
In KV-5000/3000, acceleration time and deceleration time are set to the same value.

Speed
Setting range : 0 to 4000 (ms)
If "0" is specified, then acceleration
Operating speed
and deceleration are shown on the
right.
Parameter storage position: CM2063+(point No. x10) 0 T

■ Operating speed
When performing positioning control, pulse speed that is output to motor should be specified during
operation.

Setting range : 50 to 100000 (PPS) (note: operating speed must be largeer than starting speed).
Parameter storing position: CM2065+ (point No.x10)/CM2064+ (point No.x10)

Higher 16-bit Lower 16-bit

2-162 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

Note
(1) The operation when "starting speed=operating speed" is shown below.
Speed

Operating (starting)
speed

0 Time 2
In this case, acceleration/deceleration time can be neglected.

Description of Operation Motor (positioning) Control


(2) The ladder control within short time (short distance) is shown below.
Speed Speed

Operating speed Operating speed


Acceleration Deceleration
Acceleration Deceleration
Starting speed Starting speed

0 Acceleration time Deceleration time 0 Acceleration time


Time Time

Acceleration/deceleration (slope) = (operating speed - starting speed) ÷ acceleration/


deceleration time.

In the case of ladder control, acceleration/deceleration (slope) is often controlled to some


extent.
Therefore, ladder control for a short time will be decelerated before reaching the operating
speed.

■ Stop sensor used or not


To whether to use stop sensor.
None…Stop sensor is not used.
Yes … Stopped after number of pulses specified for stop sensor is output.

Parameter storage position: parameters are stored bit 4 of CM2066+(point No.x10), as shown below.
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
bit 4 Contents to be set
0 Stop sensor not used
1 Stop sensor used

- KV-5000/3000 Series User’s Manual - 2-163


CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

■ Specified number of pulses for stop sensor


If “Stop sensor used or not” is set to ON, operation will stop after the specified number of pulses for stop
sensor is output.
Speed Stop sensor input ON
Deceleration

2
Description of Operation Motor (positioning) Control

Specified number of pulses

If the specified number of pulses is set to "0", then stop sensor input will be ON, and operation will stop
immediately.
Deceleration time will be neglected.
Speed Stop sensor input ON

Stop immediately

If the specified number of pulses is set to "65535" (max. value), then stop sensor input will be ON,
acceleration operation will start, and will stop after deceleration time ends.
Speed Stop sensor input ON
Deceleration time

Setting range : 0 to 65535


Parameter storing position: CM2067+(point No.x10)

2-164 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

System parameters (I/O setting)

(1)

(2)
(4)
(6)
(3)
(5)
2

Description of Operation Motor (positioning) Control


(8) (7)
(10) (9)
(11)

(12)

Function name Setting range Default


(1) Select axis X/Y axis X axis
Input setting "CM2000/2001/2018"(X axis)/"CM2030/2031/2048"(Y axis)
X axis CR3002 R000 to R003 CR3002
(2) Origin sensor
Y axis CR3102 R000 to R003 CR3102
X axis NO (normally open
(3) Origin sensor polarity NO/NC (contact)
Y axis contact)
X axis CR3002 R000 to R003 CR3003
(4) Stop sensor
Y axis CR3103 R000 to R003 CR3103
X axis NO (normally open
(5) Stop sensor polarity NO/NC (contact)
Y axis contact)
X axis R014 (fixed) R014
(6) Z-phase
Y axis R015 (fixed) R015
X axis NO (normally open
(7) Z-phase polarity NO/NC (contact)
Y axis contact)
X axis CR3000 R004 CR3000
(8) Limit switch CW
Y axis CR3100 R005 CR3100
X axis NO (normally open
(9) Limit switch polarity CW NO/NC (contact)
Y axis contact)
X axis CR3001 R006 CR3001
(10) Limit switch CCW
Y axis CR3101 R007 CR3101
X axis NO (normally open
(11) Limit switch polarity CCW NO/NC (contact)
Y axis contact)
Output setting [CM2000](X axis)/[CM2030](Y axis)
(12) Output mode 1-pulse/2-pulse 1-pulse

- KV-5000/3000 Series User’s Manual - 2-165


CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

■ Origin sensor
“Origin" refers to the position used as the reference point for positioning. "Origin sensor" refers to the
sensor installed at origin position of axis.

CR3002 (CR3102) ...........CR3002 (X axis) and CR3102 (Y axis) are set to origin sensors.
R000 to R003 ...................Input relay R000 to R003 are used as origin sensors.

2 N.O./N.C...........................Logic of origin sensor input is set.


Description of Operation Motor (positioning) Control

If R000 to R003 is set, then the preset input is used as origin sensor input for origin return.
If relays other than R000 to R003 are used as origin sensor input, then CR3002 (CR3102) should be
set in advance according to these parameters, and can be turned ON/OFF through ladder program.

Example
Input relay R30000 is used for origin sensor
R30000 CR3002
input of X-axis.

Parameter storing position: parameters are stored in CM2000 and CM2001.


CM2000 settings : "I/O detailed settings", Page 2-209
CM2001 settings : "Sensor enable details", Page 2-209

■ Stop sensor
During operation, the moving object will move up to the position of stop sensor. When stop sensor is
ON, the moving object will decelerate and stop immediately from this position; or continue to move a
certain distance (specified number of pulses for stop sensor), then decelerate and stop.
Howevert, if "Stop sensor used or not" is set to "None" in point parameters, the stop sensor can be
neglected.

CR3003 (CR3103)............CR3003 (X axis) and CR3103 (Y axis) are set to stop sensors.
R000 to R 003 ..................Input relay R000 to R003 are used as stop sensors.
N.O./N.C...........................Logic of stop sensor input is set.

If R000 to R003 is set, then the preset input is used as stop sensor input to stop moving.
If relays other than R000 to R003 are used as stop sensor input, CR3003 (CR3103) should be set in
advance according to these parameters, and can be turned ON/OFF through ladder program.

Example
Input relay R30001 is used for stop sensor
R30001 CR3003
input of X-axis.

Parameter storing position: parameters are stored in CM2000 and CM2001.


CM2000 settings : "I/O detailed settings", Page 2-209
CM2001 settings : "Sensor enable details", Page 2-209

2-166 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

■ Z-phase
Z-phase is mainly used to improve the position accuracy when origin return is finished. Generally, pulse
encoder's zero signal is used as "Z-phase".

R014 (R105).................... R014 (X axis) and R015 (Y axis) are fixed.


N.O/N.C. ......................... Logic of Z-phase input is set.

Parameter storage position: parameters are stored as follows.


2

Description of Operation Motor (positioning) Control


bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Axis Destivation storage address bit12 Contents to be set
X CM2001 0 N.O
Y CM2031 1 N.C

■ CW limit switch /CCW limit switch


For safety reasons, limit switches are installed on moving object and both ends of axis for moving
workpieces.

CR3000 (CR3100) ......... X axis: CR3000 (CW) CR3001 (CCW) are set as limit switch input; Y axis:
CR3100 (CW) CR3101 (CCW) are set as limit switch input.
R004(R005).................... X axis: Input relays R004(CW) R006(CCW) are set for limit switch input; Y
axis: input relays R005(CW) R007(CCW) are set for limit swtich input.
N.O/N.C. ........................ Logic of limit switch input is set.

The limit switch installed on the CW direction end is called CW limit switch.
Movement toward the CW direction

CCW direction CW direction

࡮CW (current coordinate increase direction)


Stop sensor

Limit switch CW

The limit switch installed on the CCW end is called CCW limit switch.
Movement toward the CCW direction

CCW direction CW direction

࡮CCW (current coordinate decrease direction)


Stop sensor

Limit switch CCW

If CR3000 (CW) and CR3001 (CCW) are set at X axis, and CR3100 (CW) and CR3101 (CCW) set at Y
axis, then you can turn ON/OFF CR3000 (CW) and CR3001 (CCW) or CR3100 (CW) and CR3101
(CCW) through input relays connected to the actual limit switch.
If R004 (CW) and R006 (CCW) are set at X axis, and R005 (CW) and R007 (CCW) set at Y axis, then
the preset input is set as limit switch.

- KV-5000/3000 Series User’s Manual - 2-167


CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

Parameter storage position: Parameters are stored as follows.


Limit switch CW polarity CR3000 (X axis), CR3100 (Y axis)
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Axis Destination storage address bit10 Contents to be set
X CM2001 0 N.O
Y CM2031 1 N.C

Limit switch CCW polarity CR3001 (X axis), CR3101 (Y axis)


2 Axis Destination storage address
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
bit11 Contents to be set
X CM2001 0 N.O
Description of Operation Motor (positioning) Control

Y CM2031 1 N.C
Use of limit switch CW R004 (X axis), R005 (Y axis)

bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Axis Destination storage address bit8 Contents to be set
X CM2018 0 Not used
Y CM2048 1 Used
Use of limit switch CCW R006 (X axis), R007 (Y axis)

bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Axis Destination storage address bit9 Contents to be set
X CM2018 0 Not used
Y CM2048 1 Used

Example
CW limit switch of X axis is connected to R30002 CR3000
input relay R30002, and CCW limit switch
connected to input relay R30003.
R30003 CR3001

If limit switch is ON, it indicates that a limit error (error code: 31, 32 and 33) has occured, and pulse
output will be stopped. Please find out the cause of error, and reset the error flag CR3007/CR3107 to
clear the error.

Note · For safety reasons, please use limit switches of N.C. type whenever possible. If
N.O.type limit switches are used, it's very dangerous when the switch does not
operation in case line-break occurs.
· After positioning equipment is installed, be sure to verify that limit switches can
operate normally.
· In the case of emergency stopping of motor, the near point detector of limit switch
must be wide enough to prevent object from crossing the limit switch.

2-168 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

■ Output mode selection


Select output mode. Output is performed from R500/R501 for X axis and from R502/R503 for Y axis.

1-pulse output ..................Output mode is set to 1-pulse output.


2-pulse output ..................Output mode is set to 2-pulse output.

Parameter storage position: parameters are stored as follows.


2
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Axis Destination storage address bit 0 Contents to be set

Description of Operation Motor (positioning) Control


X CM2000 0 1-pulse mode
Y CM2030 1 2-pulse mode

Connection example
1-axis connection
1-pulse output 2-pulse output

Motor drive
Motor drive

X Axis Pulse X Axis X Axis CW pulse X Axis


R500 R500
Rotation direction CCW pulse
R501 R501

2-axis connection
1-pulse output 2-pulse output
Motor drive

Motor drive
X1 axis Pulse X1 axis X1 axis CW pulse X1 axis
R500 R500
Rotation direction CCW pulse
R501 R501
Motor drive

Y1 axis Pulse Y1 axis Y1 axis CW pulse


Motor drive Y1 axis
R502 R502
Rotation direction CCW pulse
R503 R503

- KV-5000/3000 Series User’s Manual - 2-169


CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

System parameters (comparator setting)

In the process of positioning control, count the output pulse as "current value". Compare the current value
with the setting value of (3) or (5), if they match, execute the setting operation specified by (2) or (4).
In addition, interruption occurs if they match with the settings specified by (6).

2
(1)
Description of Operation Motor (positioning) Control

(2)
(3)

(4)
(5)

(6)

Function description Set range Default


(1) Select axis X/Y axis X axis
Comparator 0 setting
Not used
Stop sensor
(2) Function selection Not used
Soft limit switch CW
Soft limit switch CCW
(3) Setting value -2147483648 to 2147483647 0
Comparator 1 setting
Not used
Stop sensor
(4) Function selection Not used
Soft limit switch CW
Soft limit switch CCW
(5) Setting value -2147483648 to 2147483647 0
Comparator 2 setting
(6) Set val for interrupt -2147483648 to 2147483647 0

2-170 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

■ Function selection
Disable ............................... No operation is performed base on comparator No.
Stop sensor ........................ Stop sensor executes the same operation with input.
Limit switch CW................... CW limit switch executes the same operation with input.
Limit switch CCW ................ CCW limit switch executes the same operation with input.

Parameter storage position: parameters are stored as follows.


2
Comparator 0

Description of Operation Motor (positioning) Control


bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Axis Destination storage address bit5 bit4 Operation when current position comparator 0 matches
X CM2000 0 0 Not used
Y CM2030 0 1 Used as stop sensor
1 0 Used as limit switch of CW direction
1 1 Used as limit switch of CCW direction

Comparator 1
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Axis Destination storage address bit7 bit6 Operaton when current position comparator 0 matches
X CM2000 0 0 Not used
Y CM2030 0 1 Used as stop sensor
1 0 Used as limit switch of CW direction
1 1 Used as limit switch of CCW direction

* If comparator 0 and 1 are set with the same functions, comparator 1 is invalid.

■ Setting value
Set a value (comparator value) that can be compared with the output pulse number (current position
(current value)).

Setting range : -2147483648 to 2147483647


Parameter storage position:
Comparator 0=CM2003(High bit)/CM2002(Low bit)
X axis Comparator 1=CM2005(High bit)/CM2004(Low bit)
Comparator 2=CM2029(High bit)/CM2028(Low bit)
Comparator 0=CM2033(High bit)/CM2032(Low bit)
Y axis Comparator 1=CM2035(High bit)/CM2034(Low bit)
Comparator 2=CM2059(High bit)/CM2058(Low bit)

Note
KV-5000/3000 PLC can identify the interrupt value according to comparator 2 when CHGSPX and
CHGSPY are executed or pulse output is started throught PLSX or PLSY. (X axis: CM02029/
CM02028; Y axis: CM02059/CM02058. Operation will not be normal when setting value is written only
in control memory.
When using comparator 2 as interrupt condition, please write setting value to control
memory and then execute the CHGSPX,CHGSPY,PLSX,PLSYinstruction.
"Reference example for executing speed change during operation", Page 2-203

- KV-5000/3000 Series User’s Manual - 2-171


CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

System parameters (origin returning)

If power becomes off at positioning or moving axis manually, the actual position of object will be
different from that "memorized" by KV-5000/3000.
Actual origin point and internal current position (current value) can be matched via origin return.

2 (1)
Description of Operation Motor (positioning) Control

(2)
(3)
(4)
(5)
(6)
(7)
(8)

(9)

Function description Setting range Default


(1) Select axis X/Y axis X axis
Origin returning
(2) Starting speed 50 to 65535 200
(3) Accel/decelerate time 0 to 4000 500
(4) Operating speed 50 to 00000 50000
(5) Origin return direction CCW/CW CCW
Origin sensor up edge
Detailed posi of origin
(6) Medium point of the origin sensor Origin sensor up edge
return
Origin sensor and Z-phase
No output
(7) Clear deviation counter No output
Output
Auto-move to home No output
(8) No output
position Move
Home coordinate
(9) Setting value -2147483648 to 2147483647 0

2-172 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

■ Starting speed
Set start output pulse speed applied to origin return operation or home position operation.

Setting range : 50 to 65535 (note: starting speed must be less than operating speed).
Parameter storage position
X axis CM2006
: Y axis CM2036
2
■ Acceleration/deceleration time

Description of Operation Motor (positioning) Control


Acceleration time: the time required from starting speed to origin return operating speed. The lower the
value is, the quicker the accelerating movement, and the shorter the moving time will be.
Deceleration time: time required for operation from origin return operating speed to starting speed. The lower
the value is, the quicker the decelerating movement, and the shorter the moving time will be.
In KV-5000/3000, acceleration time and deceleration time are set as the same value.

Setting range : 0 to 4000


Parameter storage position
X axis CM2007
: Y axis CM2037

■ Operating speed
In the case of origin operation and home position operation, pulse speed that is output to motor shoulde be specified.
Setting range : 50 to 00000
Parameter storage position
X axis CM2009(High bit)/CM2008(Low bit)
: Y axis CM2039(High bit)/CM2038(Low bit)

Note
(1) The operation when "starting speed=operating speed" is shown in figure below.
Speed

Operating (starting)
speed

0 Time

In this case, acceleration/deceleration time can be neglected.


(2) The ladder control within short time (short-distance) is shown in figure below.
Speed Speed

Operating speed Operating speed


Acceleration Deceleration
Acceleration Deceleration
Starting speed Starting speed

0 Acceleration time Deceleration time 0 Acceleration time


Time Time

In figure below acceleration/deceleration (slope) = (operating speed - starting speed) /


acceleration/deceleration time.
In the case of ladder control, acceleration/deceleration (slope coefficient) is often controlled.
Thus, ladder control within short-time will be decelerated before reaching the operating speed.

- KV-5000/3000 Series User’s Manual - 2-173


CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

■ Origin return direction


Specify starting direction for origin return.

CW ......... Origin return is performed in CW direction


CCW ....... Origin return is performed in CCW direction
"CW limit switch /CCW limit switch", Page 2-167

2 Parameter storage position: parameters are stored as follows.


Description of Operation Motor (positioning) Control

bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Axis Destination storage address bit1 Contents to be set
X CM2000 0 CCW
Y CM2030 1 CW

■ Detailed position of origin return


Detection method for origin stop position is set.

Parameter storage position: parameters are stored as follows.


bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Axis Destination storage address bit1 bit0 Contents to be set
X CM2018 0 0 Up edge of the origin sensor
Y CM2048 0 1 Medium point of the origin sensor
1 0 Origin sensor and Z phase
1 1 Setup disable

TIP • Advantage of setting as "medium point of origin sensor"


If comparing "mediuml point of origin sensor" with "up edge of origin sensor", the finish position of
origin return varies little after a period of time even if exposure of origin sensor degrades.
• Advantage of setting as "Z-phase of origin sensor"
If comparing "Z-phase of origin sensor" with "up edge of origin sensor", the offset of Z-phase
of encoder is smaller despite of a certain offset of ON position of origin sensor. So, the
position of origin postion has little offset.

■ Deviation counter clear


At end of origin return, or in the case of error during pulse output process as well as during detection of
limit switch, deviation counter clear signal R506 (X axis) and R507 (Y axis) will be output automatically.
(without need of ladder program)
For the error information, see "Lilst of Devices/error Codes for Positioning", Page 2-208.

Parameter storage position: parameters are stored as follows.


bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Axis Destination storage address Bit 3 Contents to be set
X CM2018 0 No output
Y CM2048 1 Output

2-174 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

■ Auto-move home position


When the origin return is done, the axis will move to the home position automatically.

Parameter storage position: parameters are stored as follows.


bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Axis Destination storage address bit4 Contents to be set
X CM2018 0 Not move
Y CM2048 1 Move
2

Description of Operation Motor (positioning) Control


■ Home position coordinate
Home position is set.

Setting range : -2147483648 to 2147483647


Parameter storage position
X axis CM2027(High bit)/CM2026(Low bit)
:
Y axis CM2057(High bit)/CM2056(Low bit)

■ Origin return path


The moving path of object origin return may differ from the position of moving object during origin return
as well as setting parameters of KV STUDIO. In addition, origin return is possible as long as the error is
cleared, even if there is a CW or CCW limit switch ON.
If origin return is in CW direction, place the figures into ( ).

● When "detailed position of origin return" is set as "medium point of origin sensor"
"origin direction" CCW(CW)
Acceleration/deceleration Origin sensor Acceleration/deceleration (1) After completion of the operation at origin sensor's up edge, the
work pieces will move to origin sensor OFF at starting speed
(3) [operating speed] along the reverse direction of origin, and then stop. store the
(2)
Speed in CW (CCW) [starting speed] finish position at up edge of origin sensor as " (B) position".
direction (2) work piece moves to ON position of origin sensor at starting
Origin speed.store ON position of origin sensor to " (C) position".
CCW(CW) CW CCW (3) From "(C) position" to "(B) position", work piece will move via
Origin at the ring edge of
origin sensor incline control and stop.
Speed in CCW (CW)
(4) Work pieces moves towards and then stop at central position of
direction
[starting speed] origin sensor calculated by "(B) position" and "(C)position"
(1) (4)
[operating speed] through slope control. (finish of origin)

(C) Medium point of(B) Note: for origin postion at "up edge of origin sensor", "deviation
the origin sensor counter clear" isn't ON.

● When "origin detail position" is set as "origin sensor and Z-phase"


"Origin direction" CCW (CW)

Origin sensor

[operating speed]
Speed in CW (CCW) [starting speed] (1) The operation prior to work pieces stop is the same with "up edge
direction Operation at the ring of origin sensor"
edge of origin sensor (1) (2) After work piece moves to origin point at starting speed and origin
Origin
CCW(CW) CW(CCW) sensor is ON, once Z-phase is ON, the work piece will
immediately stop. (finish of origin)
Speed in CCW (CW)
direction (2)
[starting speed] * After Origin return ends, " deviation counter clear " will be ON for
[operating speed] 50ms.

Z phase

- KV-5000/3000 Series User’s Manual - 2-175


CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

● When "detail position of origin" is set as "medium point of origin sensor"


Origin return direction CCW (CW)
Home position: CW(CCW) side
(1) The work pieces accelerates to operating speed, and moves towards origin
return direction.
Acceleration time Origin sensor Acceleration time (2) When origin point sensor is ON when, workpiece speed reduced; stop at
[operating speed] starting speed. store ON position of origin sensor to " (A) position".
(3) (3) Work piece moves stop position to " (A) position", via slope control.
Speed in CW (CCW) (4) (4) After moving to " (A) position ", work piece will move to OFF position of origin
2 direction

CCW(CW)
Origin
[starting speed]
Home position
CW(CCW)
point sensor, stop.
(5) Work piece moves to origin point side, stops when origin point sensor is ON.
(finish of origin)
Description of Operation Motor (positioning) Control

Speed in CCW (CC) [starting speed] * acceleration/deceleration = (operating speed-starting speed) / acceleration/
direction (2) (5) (1) deceleration time
[operating speed] * During operation of (1) and (2), stop immediately when limit switch at
movement direction side is ON, and stops 300 ms. After that, "deviation counter
Acceleration time Acceleration time clear" will be ON. Then, move reversely. If limit switch at starting position side is
(A) ON, emergency stop occurs.
* After Origin return ends, " deviation counter clear " will be ON for 50ms.
Home position: CCW (CW) side (1) (limit switch ON, when stop position at origin postion direction is outside of origin sensor)
(1) The work pieces accelerates to operating speed, and moves towards origin
return direction.
(2) When limit switch is ON, work pieces stop immediately, and move after
accelerating to a certain operating speed.
Acceleration/deceleration Origin sensor Acceleration/deceleration
(3) When origin point sensor is ON when, work piece speed reduced; stop at
[operating speed] starting speed.
(3)
Speed in CW (CCW) (2) (6) (4) Work pieces accelerates to origin sensor.
direction [starting speed] (5) When origin point sensor is ON when, work piece speed reduced; stop at
(7)
Home position Origin starting speed. store ON position of origin sensor to " (A) position".
CCW CW CW(CCW) (6) Work piece moves stop position to " (A) position", via slope control.
(8) (7) After moving to " (A) position ", work piece will move to OFF position of origin
Speed in CCW (CW) [starting speed] point sensor, stop.
direction (5) (4)
(1) (8) Work piece moves to origin point side, stops when origin point sensor is ON.
[operating speed] (finish of origin)
Acceleration/deceleration During *(1) operation process, when limit switch at movement direction side is
Limit switch ON, stop immediately, and then stop 300 ms. After that, "deviation counter clear"
A)
will be ON. And start execution of (2).
* During (3) operation process, if limit switch at movement direction side is ON,
emergency stop occurs.
* After Origin return ends, " deviation counter clear " will be ON for 50ms.
Home position: CCW (CW) side (2) (limit switch ON, when stop position at origin postion direction is within the range of origin sensor)
(1) The work pieces accelerates to operating speed, and moves towards origin
return direction.
Acceleration/deceleration Origin sensor Acceleration/deceleration
(2) When limit switch is ON, work pieces stop immediately, and move after
[operating speed] accelerating to a certain operating speed.
Speed in CW (CCW) (2) (3) (3) When origin point sensor is ON when, work piece speed reduced; stop at
(4)
direction [starting speed] starting speed.
Home position Origin (4) Workpiece moves to origin sensor OFF position and stops.
CCW(CW) CW(CCW) (5) Work piece moves to origin point side, stops when origin point sensor is ON.
(finish of origin)
Speed in CCW (CW) [starting speed] During *(1) operation process, when limit switch at movement direction side is
direction (5) ON, stop immediately, and then stop 300 ms. After that, "deviation counter clear"
(1)
[operating speed] will be ON. And start execution of (2).
* During (3) operation process, if limit switch at movement direction side is ON,
Acceleration/deceleration
Limit switch emergency stop occurs.
* After Origin return ends, " deviation counter clear " will be ON for 50ms.
Home position: within the range of origin sensor
Origin sensor

[operating speed]
(1) Work pieces move at the starting speed to origin sensor OFF position along
Speed in CW (CCW) (1)
direction [starting speed] reverse direction of origin, and the stop.
(2) Work piece moves to origin point side, stops when origin point sensor is ON.
Origin (finish of origin)
CCW(CW) CW(CCW)
Home position
Speed in CCW (CW) [starting speed] * After Origin return ends, "deviation counter clear" will be ON for 50ms.
direction (2)
[operating speed]

Note
"Deviation counter clear" is set as "output ON" using system parameter.
"Deviation counter clear", Page 2-174

2-176 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

System parameters (JOG)

(1)

(2)
(3) 2
(4)

Description of Operation Motor (positioning) Control


(5)
(6)

Function description Set range Default


(1) Select axis X/Y axis X axis
JOG
(2) Starting speed 50 to 65535 200
(3) Accel/decelerate time 0 to 4000 500
(4) Operating speed 50 to 100000 50000
Use CM initial value for change of set value
(5) Change current value -2147483648 to 2147483647 0
(6) Change operating speed 50 to100000 0

■ Starting speed
To set output pulse speed when JOG operation is ON.

Setting range : 50 to 65535 (note: starting speed must be less than operating speed).
Parameter storage position
X axis CM2010
: Y axis CM2040

■ Acceleration/deceleration time
Acceleration time: time required from starting speed to JOG operating speed. The lower the value is,
the quicker the accelerating movement, and the shorter the moving time will be.
Deceleration time: time required from JOG operating speed to starting speed. The lower the value is,
the quicker the decelerating movement, and the shorter the moving time will be.

In KV-5000/3000, acceleration time and deceleration time are set to the same value.

Setting range : 0 to 4000


Parameter storage position:
X axis CM2011
Y axis CM2041

- KV-5000/3000 Series User’s Manual - 2-177


CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

■ Operating speed
To set pulse speed that is output to motor during JOG operation.

Note
(1) The operation when "starting speed=operating speed" is shown in figure below.
Speed

2 Operating (starting)
speed
Description of Operation Motor (positioning) Control

0 Time

In this case, acceleration/deceleration time can be neglected.

(2) JOB operation within short time (short distance) is shown in figure below.
Speed Speed

operating speed operating speed


Acceleration Deceleration
Acceleration Deceleration
starting speed starting speed

0 Acceleration/deceleration Deceleration time 0 Acceleration/deceleration


Time Time
JOG operation ON JOG operation OFF JOG operation ON JOG operation OFF

In figure below acceleration/deceleration (slope) = (operating speed - starting speed)/


(acceleration/deceleration time).

During operation of JOG, acceleration/deceleration (slope) is often controlled.


Thus, short-time JOG operation will be decelerated before reaching the operating speed.

Setting range : 50 to 00000


Parameter storage position:
X axis CM2013(High bit)/CM2012(Low bit)
Y axis CM2043(High bit)/CM2042(Low bit)

■ Change current value (default)


In the process of positioning control, count the output pulse as "current value".
If current value change request relay is ON (level detection), the current position (current value) is
changed as the value stored by control memory (only when pulse output is stopped).

Control memory can be set to stored default value by changing the current value.

Parameter storage position: parameters are stored as follows.


Corresponding current value change Control memory No. for storing setting
axis
request relay value
X CR3011 CM2015(High bit)/CM2014(Low bit)
Y CR3111 CM2045(High bit)/CM2044(Low bit)

2-178 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

■ Change operating speed (default)


In the positioning control process, operation is performed at specified operating speed.
In the positioning control process, if operating speed change request relay is ON (level detection), the
operating speed will be changed to the value stored in control memory.

Control memory can be set to stored default value by changing the operating speed.

Parameter storage position: parameters are stored as follows.


2

Description of Operation Motor (positioning) Control


Corresponding operating speed Control memory No. for storing setting
Axis
change request relay value
X CR3012 CM2017(High bit)/CM2016(Low bit)
Y CR3112 CM2047(High bitLow bit)/CM2046(Low bit)

Creating ladder program

To achieve positioning control, use special positioning control instruction, control relay (CR) and control
memory (CM) to edit ladder program.
"Positioning Instruction List", Page 2-185
"Control relay for positioning control", Page 2-180
"CM for positioning control", Page 2-182
"Reference Example of Positioning Control", Page 2-203
In addition, the operating speed can also be changed during positioning control process.
"Change speed during operation", Page 2-183
When over 33 positioning points are managed, the point parameters managed by control memory (CM)
are changed through ladder program.
"Reference example for executing positioning control over 32 points", Page 2-207.

- KV-5000/3000 Series User’s Manual - 2-179


CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

■ Timing chart of positioning operation


(1) (2) (3) (4)

Execute PLSX0 instruction

Execute PLSX1 instruction

Execute ORGX instruction


2 Execute JOG instruction
Emergency stop
Description of Operation Motor (positioning) Control

during pulse output CR3009


M code (operation in CM2019 0 1 1000 1001
progress No.)
Positioning complete CR3006

Origin return CR3004


Origin return complete CR3005

(1) Start pulse output by performing PLSX0 instruction. Pulse output relay CR3009 is ON, positioning
complete relay CR3006 and origin return complete relay CR3005 is OFF.
  Meanwhile, the operating point No. "0" is written into M code CM2019.
(2) Start pulse output by performing PLSX1 instruction. Pulse output relay CR3009 is ON, positioning
complete relay CR3006 and origin return complete relay CR3005 is OFF.
  Meanwhile, the operating point No. "1" is written into M code CM2019.
(3) Start origin through execution of ORGX instruction. Pulse output relay CR3009 and origin return relay
CR3004 ON, origin return complete relay CR3005 and positioning complete relay CR3006 OFF.
  Meanwhile, write origin code "1000" into M code CM2019.
(4) Start JOG operation through execution of JOG instruction. Pulse output relay CR3009 ON, origin
return complete relay CR3005 and positioning complete relay CR3006 OFF.
  Meanwhile, write JOG operation code "1001" into M code CM2019.

■ Control relay for positioning control


To describe the control relay related to positioning control program.
Refer to the list of control relay for positioning control "Lilst of Devices/error Codes for Positioning", Page 2-
208

● Origin return in progress "X axis: CR3004, Y axis: CR3104"


This control relay will be ON during origin return operation; it will OFF when origin return operation is
finished.

● Origin return complete "X axis: CR3005, Y axis: CR3105"


Set this control relay at finish of origin return, and reset at next pulse output.
"Timing chart of positioning operation", Page 2-180

2-180 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

● Error/error clear "X axis: CR3007, Y axis: CR3107"


When the control relay is error, OFF. The error code is stored in CM2024 (X axis) and CM2054 (Y axis).
Reset forcedly this control relay through ladder program to clear the error state (error clear).
The operation will stop in the case of error during the pulse output process.
Pulse output will stop in the case of error.
During the deviation counter output process (50ms) as well as origin return operation, error clear instruction
(ON two times at END line) when detecting through limit switch in reverse stop process (300ms).
Error can be cleared through reset of CR3007 and CR3107 until error (CR3007 and CR3107) is off.
2

Description of Operation Motor (positioning) Control


example) Error clear instruction CR3007 MR000

MR000

MR000 CR3007
RES

● Pulse output in process/emergency stop "X axis: CR3009, Y axis:CR3109"


The control relay is ON during pulse output.
Send emergency stop instruction and enter error status by forced reset of control relay through ladder program.

● Positioning complete "X axis: CR3006, Y axis: CR3106"


The control relay is set at completion of positioning and origin return, and reset at next pulse output.
and reset at next pulse output.

Positioning complete relay will not be set if no pulse output is conducted, even if executing PLSX and PLSY
instruction.
   (Example) when operation mode is incremental positioning, and movement is "0".
Mode is absolute positioning, and target value is the same with current position.

● Current value change request "X axis: CR3011, Y axis: CR3111"


The current position (current value) will be changed when the relay is on. (only when the pulse output stops)
Store the change value into control memory.
"Change current value (default)", Page 2-178

Operation Relay No. CM for storing the change value


X axis current value change request CR3011 CM2015(High bit)/CM2014(Low bit)
Y axis current value change request CR3111 CM2045(High bit)/CM2044(Low bit)

● Operation speed change request "X axis: CR3012, Y axis: CR3112"


In the positioning control/speed control process, the operating speed will be changed when the relay is ON.
store the change value into CM.
"Change operating speed (default)", Page 2-179

Operation Relay No. CM for storing the change value


X axis operating speed change request CR3012 CM2017(High bit)/CM2016(Low bit)
Y axis operating speed change request CR3112 CM2047(High bit)/CM2046(Low bit)

- KV-5000/3000 Series User’s Manual - 2-181


CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

● Comparator 2 "X axis: CR3013, Y axis: CR3113"


Used as interrupt condition.
Used when the speed is changed during operation.
"3-5 Interrupt", Page 3-31
"Change speed during operation", Page 2-183

Note
This control relay doesn't perform ON/OFF operation.
2
Description of Operation Motor (positioning) Control

● Warning/warning clear "X axis CR3008, Y axis: CR3108"


The control relay is ON when overflow occurs at current position.
Warning status can be cleared by forced reset of control relay through ladder program. Pulse output won't
stop even warning occurs. The operation will stop in the case of error during the pulse output process.
Current position overflow
Axis Current position Range
X CM2021(High bit)/CM2020(Low bit) -2147483648 to 2147483647
Y CM2051(High bit)/CM2050(Low bit) -2147483648 to 2147483647

● Drive operation start "X axis: CR3010, Y axis: CR3110"


Operation of the No. stored in CM2025 (X axis) and CM2055 (Y axis) is started on the up edge of the
control relay.
The control relay is ON during pulse output.

TIP When positioning control is performed using the PLSX and PLSY instructions, it is not
necessary to operate this relay.

■ CM for positioning control


To describe control memory (CM) related to positioning control procedures.
Refer to the list of control memory for positioning control"Control memory list", Page 2-209.

● Operation point No. (M code) " X axis: CM2019, Y axis.CM2049"


This control memory (CM) is used to store point No. of startup operation when executing PLSX/PLSY,
JOGX/JOGY, and ORGX/ORGY instructions. "1001" is stored when executing JOG instruction; "1000"
is stored when executing ORG instruction; "1002" is stored in the process of moving to home position.

● Current position (current value) "X axis: CM2020/CM2021, Y axis: CM2050/CM2051"


This control memory (CM) is used to store current position (PLS).
For how to changing the current position, see "Change current value (default)", Page 2-178.

● Current speed "X axis: CM2022/CM2023, Y axis: CM2052/CM2053"


This control memory is used to store the current speed (Hz).
For how to change speed during operation, see "Change speed during operation", Page 2-183.

2-182 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

● Error code "X axis: CM2024, Y axis: CM2054"


This control memory is used to store error code.
"Lilst of Devices/error Codes for Positioning", Page 2-208

■ Change speed during operation


There are three methods for changing speed during operation.
· Use operating speed change request relay CR3012 (X axis) and CR3112 (Y-axis) 2
· Use CHGSPX and CHGSPY instruction

Description of Operation Motor (positioning) Control


· Use comparator 2 interrupt relay CR3013 (X axis) and CR3113 (Y-axis)

Note
· The speed cannot be changed during operation if starting speed is equal to operating speed.
(except for acceleration/deceleration time=0.).
· It cannot be changed before reaching starting speed. If less than starting speed, the
speed will change to starting speed.

● Use CHGSPX and CHGSPY instruction


In the process of pulse output, the operating speed can be changed to a that specified by S when
the executing condition is on.
S Specified value is stored as setting value of operating speed (CM2017/CM2016).
Execute condition Identify execution Execute CHGSPX
ON condition processing

Output Input Output Input Execute condition S


Master program
processing processing processing processing CHGSPX

Speed

Speed change Time

“CHGSPX, CHGSPY instruction", Page 2-196

● Use comparator 2 interrupt relay CR3013 (X axis) and CR3113 (Y axis)


Comparator 2 compares the current position with setting value of "system parameter" (comparator
setting), and interrupt will occur when two values match.
Interrupt relay Position for storing comparator 2 setting value
X axis CR3013 CM2029(High bit)/CM2028(Low bit)
Y axis CR3113 CM2059(High bit)/CM2058(Low bit)

- KV-5000/3000 Series User’s Manual - 2-183


CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

Use INT instruction if comparator 2 is employed. Actually, this control relay will not be ON/OFF. It is only
used as a symbol in ladder program programming.

Example
(X axis) INT (Y axis) INT
CR3013 CR3113

2 "System parameters (comparator setting)", Page 2-170


"INT Instruction", Page 3-50
Description of Operation Motor (positioning) Control

Change immediately to the operating speed set by " S " when the interrupt condition based on
comparator 2 occurs.

Genelate interrupt X axis current value [CM2021/CM2020] = comparator 2 setting value [CM2029/CM2028]
by comparator 2 Y axis current value [CM2025/CM2050] = comparator 2 setting value [CM2059/CM2058]

Output Input Master program Output Input


processing processing processing processing

Input
Interrupt program CR2008
processing
EI

END

Speed INT
CR3013
S
CR2002 S
CHGSPX

RETI

Speed change Time ENDH

Note
KV-5000/3000 PLC can identify the interrup value according to comparator 2 when
CHGSPX and CHGSPY instructions are performed or pulse output is started through PLSX
and PLSY (X axis: CM02029/CM02028, Y axis: CM02059/CM02058). It cannot operate
correctly only when setting value is writen to control memory.
When using comparator 2 as interrupt condition, please write setting value to control
memory and then execute the CHGSPX, CHGSPY, PLSX, and PLSY instructions.
"Reference example for executing speed change during operation", Page 2-203

2-184 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

● Use operating speed change request relay CR3012 (X axis) and CR3112 (Y-axis)
In the process of pulse output, the operating speed can be changed to setting value (CM2017/
CM2016) when the operating speed change request relay is ON.
Execute condition Identify execution Operating speed
ON condition change request relay ON

Output Input Master routine Output Input Execute condition CR3012

Speed
processing processing processing processing SET
2

Description of Operation Motor (positioning) Control


CM2017
CM2016

Speed change Time

"Reference example for executing speed change during operation", Page 2-203

Positioning Instruction List

The instructions for positioning control are described below.


For more details of instructions, please refer to the reference pages.
Instruction mnemonics Description Page
Trapezoidal control X-axis PLSX Start trapezoidal control of X-axis 2-186
Trapezoidal control Y-axis PLSY Start trapezoidal control of Y-axis 2-186
Jog operation X-axis JOGX Execute JOG operation of X axis. 2-188
Jog operation Y-axis JOGY Execute JOG operation of Y axis. 2-188
Origin return X-axis ORGX Start origin return of X-axis. 2-190
Origin return Y-axis ORGY Start origin return of Y-axis. 2-190
Teaching X-axis TCHX Capture current position of X-axis. 2-192
Teaching Y-axis TCHY Capture current position of Y-axis. 2-192
Moving to home position
HOMEX Start moving to home position of X-axis. 2-194
instruction X axis
Moving to home position
HOMEY Start moving to home position of Y-axis. 2-194
instruction Y axis
Speed change instruction X-axis CHGSPX Change the operating speed of X-axis. 2-196
Speed change instruction Y-axis CHGSPY Change the operating speed of Y-axis. 2-196
Refresh current value X-axis RFSPSX Update the current value and current speed of X axis. 2-198
Refresh current value Y-axis RFSPSY Update the current value and current speed of Y axis. 2-198

- KV-5000/3000 Series User’s Manual - 2-185


CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

PLSX PLSX Trapezoidal control X-axis Start trapezoidal control of X axis.

PLSY PLSY Trapezoidal control Y-axis Start trapezoidal control of Y-axis.

Ladder program Input mode


Execute condition n

2 PLSX P L S X n

Execute condition n
Description of Operation Motor (positioning) Control

PLSY P L S Y n

Available devices Index


Cons Indirect Local modific
Bit device Word device
Operand tant specifying device ation
MR DM EM
R DR LR T C CTC CR FM ZF T C CTH CTC Z CM #/$ #TM * @ : #/: Z
B TM W
n ○ - ○ - - - ○ ○ ○ ○ ○ ○ ○ ○ *1 - ○ ○ ○

Operand Explanation
n Specify point No.(0 to 31)*1 *2 *3
*1 Can’t use "$".
*2 When the bit device is specified, continuous 16 bits will be occupied. If word device is specified, only 1
word is occupied.
*3 When specifying the device, lower 5 bits only used.

Description of Operation

Output the pulse through setting details of point No. set by n at the up edge of executing condition, and then stops.
Frequency (Hz)
Target value/movement (number of output pulses)

Operating speed

Starting speed
(Stopping speed)

Time (ms)

Acceleration time Deceleration time

Deviation counter
Operation in clear
Target value/ Pulse Positioning progress Error Error
Axis output in complete Output
movement progress relay point No. Code Flag
(M-code) Setting destination
Flag address
X CM2060 CM2018
+ CR3009 CR3006 CM2019 CM2024 CR3007 R506
axis Bit 3
(Point No.×10)

Y CM2061 CM2048
CR3109 CR3106 CM2049 CM2054 CR3107 R507
axis + Bit 3
(Point No.×10)

2-186 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

Store the point No. into "Operation in progress No. (M code) when "Pulse output in progress flag" is ON in the
process of trapezoidal control.
When moving to "target value/movement" position, "Pulse output in progress flag" is OFF and "positioning
complete relay" is ON, and stops.
"Positioning complete relay" is OFF during the next pulse output.
Scan

2
ON

Execute condition
OFF

PLSX,PLSY Execution Execution

Description of Operation Motor (positioning) Control


ON
CR3009, CR3109
(Flag for pulse output in OFF
progress)
ON
CR3006, CR3106
(Positioning complete) OFF

Abnormal stop and emergency stop of trapezoidal control


· Movement will stop when an error occurs (abnormal stop).
· Emergency stop is possible when "Pulse output in progress flag" is OFF using RES instruction.
· During abnormal stop and emergency stop, error No. will be stored in "error code", "error flag" will be ON.
"Pulse output in progress flag" is OFF, "Positioning complete relay" is not ON. "Deviation counter
clear" is output.
"Lilst of Devices/error Codes for Positioning", Page 2-208

Note
· If "Pulse output in progress flag" is ON, PLSX and PLSY instructions cannot be executed.
· If "error flag" is ON, PLSX and PLSY instructions cannot be executed.
· "Pulse output in progress flag" is OFF, during the first END processing after pulse output.
· During emergency stop, pulse output stop, current position message may lose.
Besides, when pulse output stops, final pulse duty cycle cannot be guaranteed.
· When the number of output pulse changes to parameter "0", "Pulse output in progress
flag" is not ON, and "positioning complete relay" is ON. In this case, no warning will occur.

Operation flag

CR2009 No change in status


CR2010 No change in status
CR2011 No change in status
It is ON when range of indirect specifying or index modification is improper, otherwise OFF.
CR2012
When indirect specifying or index modification is unspecified, it is not changed.
* If CR2012 is ON, the instruction will be not executed. When
CR2012 is ON, the detailed error info is stored in CM5100 to CM5176.
"Error Log (CM)", Page 3-20

Sample Program

Pulse is output for the setting contents point No. 0 on the up edge when input relay R000 is ON.
R000 #0 ;(mnemonics list)
↑ PLSX LDP R000
PLSX #0

- KV-5000/3000 Series User’s Manual - 2-187


CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

JOGX
JOGX CW
CCW
HIGH
Jog operation X-axis
Execute JOG operation of X-
axis.

JOGY
JOGY CW
CCW
HIGH
Jog operation Y-axis
Execute JOG operation of Y-
axis.

2 Ladder program Input mode


CW signal JOGX
Description of Operation Motor (positioning) Control

CW J O G X

CCW signal
CCW

HIGH signal
HIGH

CW signal JOGY
CW J O G Y

CCW signal
CCW

HIGH signal
HIGH

Available devices Index


Cons Indirect Local modific
Bit device Word device tant specifying device ation
Operand
MR DM EM
R DR LR T C CTC CR FM ZF T C CTH CTC Z CM #/$ #TM * @ : #/: Z
B TM W
- - - - - - - - - - - - - - - - - - - -

Description of Operation

When CW or CCW signal is ON, pulse will be output at starting speed.


When HIGH signal is ON, pulse will be output by rotation speed.
Stop after pulse I/O is finished.
Frequency (Hz)
CW/CCW signal HIGH signal HIGH signal CW/CCW signal
ON ON OFF OFF

Operating
speed

Starting speed
Stopping speed

Time (ms)

Pulse output in Operation in progress


Axis progress flag point No. (M code) Error code Error flag

X axis CR3009 CM2019 CM2024 CR3007


Y axis CR3109 CM2049 CM2054 CR3107

2-188 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

In the process of JOG operation, "Pulse output in progress flag" is ON and store "1001" into "M code"
When the operation is finished, "Pulse output in progress flag" will be OFF.

Scan
ON
Execution conditon
OFF
CW(Signal)
ON
Execution conditon

2
OFF
CCW(Signal)

JOGX, JOGY Execution Execution

Description of Operation Motor (positioning) Control


CR3009, CR3109 ON
(Flag for pulse
OFF
output in progress)

Abnormal stop and emergency stop of JOG operation.


· Movement will stop when an error occurs (abnormal stop).
· Emergency stop is possible when "Pulse output in progress flag" is OFF using RES instruction.
· During abnormal stop and emergency stop, error No. will be stored in "error code", "error mark" is ON.
"Pulse output in progress flag" is OFF, ""Deviation counter clear" is output.
"Lilst of Devices/error Codes for Positioning", Page 2-208

Note
· If "Pulse output in progress flag" is ON, JOGX and JOGY instructions cannot be executed.
· If "error flag" is ON, JOGX and JOGY instructions cannot be executed.
· When a limit error accurs (error code: 31 or 32), JOG instrunction can also be executed in
the direction opposite to the moving direction when the limit error occurs even if the limit
switch is ON, simply by turning OFF the "error flag".
· "Pulse output in progress flag" is OFF, during the first END processing after pulse output.
· During emergency stop, pulse output stop, current position inforamtion may be lost.
Besides, when pulse output stops, final pulse duty cycle cannot be guaranteed.
· "Origin return relay" and " positioning complete relay " are OFF during the pulse output.

Operation flag

CR2009 No change in status


CR2010 No change in status
CR2011 No change in status
CR2012 No change in status

Sample Program

Execute CW-JDG operation when input R000 ON; execute CCW-JOG operation when input R001 ON.
JOG operation will be executed at high speed when input R002 ON.

R000 JOGX ;(mnemonics list)


CW LD R000
LD R001
R001 LD R002
CCW
JOGX
R002
HIGH

- KV-5000/3000 Series User’s Manual - 2-189


CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

ORGX ORGX Origin return X-axis Start origin return on the X-axis.

ORGY ORGY Origin return Y-axis Start origin return on the Y-axis.

Ladder program Input mode


Execute condition

2 ORGX O R G X

Execute condition
Description of Operation Motor (positioning) Control

ORGY O R G Y

Available devices Index


Bit device Word device Cons Indirect Local modific
tant specifying device ation
Operand
MR DM EM
R DR LR T C CTC CR FM ZF T C CTH CTC Z CM #/$ #TM * @ : #/: Z
B TM W
- - - - - - - - - - - - - - - - - - - -

Description of Operation

When the execution condition is ON, origin return operation starts, and then stops after pulse output is finished.
Origin Origin Operation in
Pulse output return in return Positioning progress
Axis in progress complete Error code Error flag
Flag progress complete relay point No.
Flag relay (M-code)
X axis CR3009 CR3004 CR3005 CR3006 CM2019 CM2024 CR3007
Y axis CR3109 CR3104 CR3105 CR3106 CM2049 CM2054 CR3107

In the process of origin return, "Pulse output in progress flag" is ON and store "1000" in "M code".
When moving to origin (0) position, "Pulse output in progress flag" is OFF. When "origin return complete
relay" and "positioning complete relay" ON, it stops.
"Origin return complete relay" and " positioning complete relay " are OFF during the next pulse output.
Scan
ON

Execute condition
OFF

ORGX, ORGY Execution Execution


ON
CR3009, CR3109
(Flag for pulse output in OFF
progress)
ON
CR3005, CR3105
(Origin return complete) OFF

CR3006, CR3106
(Locating complete)

2-190 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

Abnormal stop and emergency stop of origin.


· Movement will stop when an error occurs (abnormal stop).
· If the following conditions occur during operation, operation will stop abnormally due to the error of
limit sensor.
When the limit sensor at reverse direction of origin return is detected.
When CW and CCW limit sensors are detected during origin return (including simultaneous or
sequential detection).
· Emergency stop is possible when "Pulse output in progress flag" is OFF using RES instruction.
2

Description of Operation Motor (positioning) Control


· During abnormal stop, emergency stop, error No. will be stored in "error code", "error mark" is ON.
· "Pulse output in progress flag" is OFF," "Pulse output in progress flag" is OFF. "origin return complete
relay" and "positioning complete relay" will be no ON.

"Lilst of Devices/error Codes for Positioning", Page 2-208

Note
· If "pulse output in progress flag" is ON, ORGX and ORGY instructions cannot be
executed.
· If "error flag" is ON, ORGX and ORGY instructions cannot be executed.
· "Pulse output in progress flag" is OFF, during the first END processing after pulse output.
· During emergency stop, pulse output stop, current position message may lose.
Besides, when pulse output stops, final pulse duty cycle cannot be guaranteed.

Operation flag

CR2009 No change in status


CR2010 No change in status
CR2011 No change in status
CR2012 No change in status

Sample Program

R000 ;(mnemonics list)


↑ ORGX LDP R000
ORGX
LDP R000
R000
ORGY
↑ ORGY

- KV-5000/3000 Series User’s Manual - 2-191


CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

TCHX TCHX Teaching X-axis Capture current position of X-axis.

TCHY TCHY Teaching Y-axis Capture current position of Y-axis.

Ladder program Input mode


Execution conditon

2 TCHX T C H X

Execution conditon
Description of Operation Motor (positioning) Control

TCHY T C H Y

Available devices Index


Cons Indirect Local modific
Bit device Word device tant specifying device ation
Operand
MR DM EM
R DR LR T C CTC CR FM ZF T C CTH CTC Z CM #/$ #TM * @ : #/: Z
B TM W
- - - - - - - - - - - - - - - - - - - -

Description of Operation

When the execution condition is ON, "target value/movement" stored in "specifiedpoint No." (point No.)
will be stored in "current position" value.
Axis Specified pointNo. Target value/movement Current position
X axis CM2025 CM2060+(Point No. x10 ) CM2021, CM2020
Y axis CM2055 CM2061+(Point No. x10) CM2051, CM2050
(1) Use LDA, STA or DW instruction to store point No. in "specified point No." device.
(2) If execution condition of TCHX and TCHY instruction is ON, the "target value/movement" of
specified point No. in (1) will be stored in the "current position" value.
storage position differs for various point Nos. (when point No. is "0, it is CM2060/CM2061; when
point No. is "1", it is CM2070/CM2071)
"Lilst of Devices/error Codes for Positioning", Page 2-208

Example
· TCHX Instruction
When storing current value of X axis as target value of point No. 0:
(1) "0" is stored in CM2025.
(2) TCHX instruction is executed.
(3) Content of CM2020 and CM2021(current value of X axis) is transmited to CM2060
and CM2061 (target value/movement of point No. 0).
R000 #0
↑ DW TCHX
CM2025

· TCHY Instruction
When storing current value of Y axis as target value of point No. 10:
(1) "10" is stored in CM2055.
(2) TCHY instruction is executed.
(3) The details of CM2050 and CM2051 (current value of Y axis) are transmitted to
CM2160 and CM2161 (target value/movement of point N0. 10).

R000 #10
↑ DW TCHY
CM2055

2-192 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

Note
· If the point No. stored in CM2025 (X axis) and CM2055 (Y axis) is not in the range of 0 to
31, it can be neglected, and no error code will occur.
· When the "error flag" is ON, JOGX and JOGY instructions cannot be executed.
· When the "Pulse output in progress flag" is ON, JOGX and JOGY instructions cannot be
executed.

2
Operation flag

Description of Operation Motor (positioning) Control


CR2009 No change in status
CR2010 No change in status
CR2011 No change in status
CR2012 No change in status

Sample Program

Set the current position moving under JOG operation to target value of point No.0

R000 JOGX ;(mnemonics list)


CW
LD R000
LD R001
R001 LD R002
CCW JOGX
R002 LD R003
HIGH LDA #0
CON
R003 #0 CM2025 STA CM2025
LDA STA TCHX CON
TCHX

- KV-5000/3000 Series User’s Manual - 2-193


CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

HOMEX HOMEX
Moving to home position
of X-axis
Start moving to home position of
X-axis.

HOMEY HOMEY
Moving to home position
of Y-axis
Start moving to home position of
Y-axis.

Ladder program Input mode


Execute condition
2 HOMEX H O M E X
Description of Operation Motor (positioning) Control

Execute condition
HOMEY H O M E Y

Available devices
Index
Cons Indirect Local Change
Bit device Word device
Operand tant specifying device
MR DM EM
R DR LR T C CTC CR FM ZF T C CTH CTC Z CM #/$ #TM * @ : #/: Z
B TM W
- - - - - - - - - - - - - - - - - - - -

Description of Operation

When the execution condition is ON, the operation of moving to home starts, and then stops after
completion of pulse output.

Home position Pulse output in Positioning Operation in


Axis progress progress point Error code Error flag
coordinate flag complete relay No. (M code)
X CM2026
CR3009 CR3006 CM2019 CM2024 CR3007
axis CM2027

Y CM2056
CR3109 CR3106 CM2049 CM2054 CR3107
axis CM2057

In the process of moving to home, "Pulse output in progress flag" is ON, and store "1000" into "M code".
When moving to "Home position coordinate" position, "Pulse output in progress flag" is OFF, and
"positioning complete relay" is ON, and then stops.
"positioning complete relay" is OFF during the next pulse output.
Scan
ON

Execute condition
OFF

HOMEXˈHOMEY Execution Execution


ON
CR3009, CR3109
(Flag for pulse output in OFF
progress)
ON
CR3006, CR3106
(Positioning complete) OFF

Abnormal stop and emergency stop when moving to home.


· Movement will stop when an error occurs (abnormal stop).
· Emergency stop is possible when "Pulse output in progress flag" is OFF using RES instruction.
· During abnormal stop and emergency stop, error No. will be stored in "error code", "error flag" is ON,
deviation counter clear output.
In addition, "Pulse output in progress flag" is OFF, and "positioning complete relay" is not ON.
"Lilst of Devices/error Codes for Positioning", Page 2-208
2-194 - KV-5000/3000 Series User’s Manual -
CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

Note
· If "Pulse output in progress flag" is ON, HOMEX and HOMEY instructions cannot be
executed.
· If "error flag" is ON, HOMEX and HOMEY instructions cannot be executed.
· "Pulse output in progress flag" is OFF, during the first END processing after pulse output.
· During emergency stop and pulse output stop, current position information may be lost.
Besides, when pulse output stops, final pulse duty cycle cannot be guaranteed.
2

Description of Operation Motor (positioning) Control


TIP Starting speed, acceleration/deceleration time, operating speed is same as origin return.

Operation flag

CR2009 No change in status


CR2010 No change in status
CR2011 No change in status
CR2012 No change in status

Sample Program

On the up edge when input relay R000 is ON, operation of moving to home position is performed.

R000 ;(mnemonics list)


↑ HOMEX LDP R000
HOMEX

- KV-5000/3000 Series User’s Manual - 2-195


CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

CHGSPX CHGSPX Cchange speed X-axis Change speed of X-axis.

CHGSPY CHGSPY Change speed Y-axis Change speed of Y-axis.

Ladder program Input mode


Execute condition S
2 CHGSPX C H G S P X S

Execute condition S
Description of Operation Motor (positioning) Control

CHGSPY C H G S P Y S

Available devices
Index
Bit device Word device Cons Indirect Local Change
tant specifying device
Operand
MR DM EM
R DR LR T C CTC CR FM ZF T C CTH CTC Z CM #/$ #TM * @ : #/: Z
B TM W
S ○ - ○ - - - ○ ○ ○ ○ ○ ○ ○ ○ ○ - ○ ○ ○

Operand Description
S Specify changing speed value (50 to 100000). Unsigned 32-bit BIN data. *1
*1 When the bit device is specified, continuous 32 bits will be occupied.
If the bit device is specified, continuous 2 bits will be occupied.
If relays other than channel leading relay (R002, R106, R1012, etc.) are specified, it will straddle
the next channel for 32 bits processing.

Description of Operation

Axis Operating speed change setting value


X axis CM2017(High bit),CM2016(Low bit)
Y axis CM2047 (High bit),CM2046(Low bit)

In the process of pulse output, when the execution condition is ON, the speed will be changed to S
.
S The specified value is stored in "operating speed change setting value" device.

Execute Identity execution Execute CHGSPX


condition ON condition processing

Output Input Output Input


Master routine
processing processing processing processing
Execute condition S
Speed CHGSPX

Speed change Time

Note
It cannot be changed before reaching starting speed. If lower than starting speed, the speed
will change to starting speed.

2-196 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

The instructions and interruptions based on comparator 2 are used simultaneously


After interruption condition based on comparator 2 occurs, the speed will be immediately changed to
S .

Generate interrupt
by comparator 2

Output Input
processing processing Master program
Output Input
processing processing
CR2008 2
EI

Description of Operation Motor (positioning) Control


END

Input
processing Interrupt program INT
CR3013
Speed
CR2002 S
S CHGSPX

RETI

ENDH

Speed change Time


For comparator 2, see "System parameters (comparator setting)", Page 2-170.

TIP Use operating speed change request relay CR3012 (X axis) and CR3112 (Y-axis)
Execute condition Identity execution Operating speed change
ON condition request relay ON

Output Input Master program Output Input


processing processing processing processing
Execute condition CR3012
Speed SET

CM2017
CM2016

Speed change Time


For the operating speed change request relay, see "Lilst of Devices/error Codes for Positioning", Page 2-208.

Operation flag

CR2009 No change in status


CR2010 No change in status
CR2011 No change in status
It is ON when range of indirect specifying or index modification is improper, otherwise OFF.
CR2012
When indirect specifying or index modification is unspecified, it is not changed.

Sample Program

On the up edge when input relay R000 is ON, the operating speed of X axis is changed to 3000Hz.
R000 #3000 ;(mnemonics list)
↑ CHGSPX LDP R000
CHGSPX #3000

- KV-5000/3000 Series User’s Manual - 2-197


CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

RFSPSX RFSPSX
Refresh current value X-axis
Refresh current value and speed
of X-axis to the lastest value.

RFSPSY RFSPSY
Refresh Y-axis current value
Refresh current value and speed
of Y-axis to the lasted value.

Ladder program Input mode


Execute condition RFSPSX
2 n R F S P S X
Description of Operation Motor (positioning) Control

Execute condition RFSPSY


n R F S P S Y

Available devices Index


Cons Indirect Local modific
Bit device Word device tant specifying device ation
Operand
MR DM EM
R DR LR T C CTC CR FM ZF T C CTH CTC Z CM #/$ #TM * @ : #/: Z
B TM W
- - - - - - - - - - - - - - - - - - - -

Operand Decription
- -

Description of Operation

RFSPSX When execution condition is ON, update the current position (CM2020, CM2021) and
current speed (CM2022, CM2023)of X axis to latest value.
RFSPSX When execution condition is ON, update the current position (CM2020, CM2021) and
current speed (CM2022, CM2023)of X axis to latest value.

Operation flag

CR2009 No change in status


CR2010 No change in status
CR2011 No change in status
CR2012 No change in status

Sample Program

The latest current coordinate using X axis and Y stops operation.

CR2002 RFSPSX ;(mnemonics list)


LD CR2002
Always ON RFSPSX
RFSPSY
RFSPSY LD>=.L CM2020 +10000
AND<=.D CM2050 #20000
OUT CR3003
OUT CR3103
C˩2020 C˩2050 CR3003
˚= .˨ <= .D
+10000 #20000 X axis stop
X axis current ˵ axis current sensor input
position position CR3103

˵axis stop
sensor input

2-198 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

Reference example of Positioning Control

■ Reference example of positioning control


● Setup example
Wiring of CPU input Wiring to expansion input unit 2
Input common point COM

Description of Operation Motor (positioning) Control


R000 Origin sensor R30000 Start origin return input
R001 R30001 JOG instruction CW
R002 R30002 JOG instruction CCW
R003 R30003 JOG high-speed instruction
R004 Limit switch CW R30004
R005 R30005
R006 Limit switch CCW R30006
R007 R30007
Stepper motor drive
R008 (2-pulse mode)
R30008
R009 R30009
Twisted wire R30010 Point 0 moving instruction
+
CW
-
+ R30011 Point 1 moving instruction
Wiring of CPU output -
CCW
R30012 Point 2 moving instruction
S+5V
R30013 Point 3 moving instruction
R500
R30014 Point 4 moving instruction
R501 FG
Stepper motor
R30015
R502
R503

- KV-5000/3000 Series User’s Manual - 2-199


CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

1 Click button on the KV STUDIO tool bar to open "Edit CPU Positioning Parameters".
Select button on the "Edit CPU Positioning Parameters" tool bar.

2 Through "I/O Setup" option, set up stop sensor, limit switch


input connection destination address and polarity. In addition,
through output setup, select output mode.
"System parameters (I/O setting)", Page 2-165
2
Description of Operation Motor (positioning) Control

3 Through "Comparator Setup" option, set up the value to be


compared with current value.
"System parameters (comparator setting)", Page 2-170

4 Through "Origin return/JOG)" option, set up origin return


speed, start direction and output mode. In addition, through
home position setup, specify setting.
"System parameters (origin returning)", Page 2-172

5 Through "JOG" option, set up JOG operation speed.


"System parameters (JOG)", Page 2-177

6 Set up point parameter target coordinate,


operating and acceleration/deceleration time.
"Point parameters", Page 2-159

2-200 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

● Program example

;(mnemonics list)
࡮Origin return part LDP R30000
ORGX
LD R30001
R30000 LD R30002
ORGX LD R30003
JOGX
LDP R30010
࡮JOG operation part PLSX #0
LDP R30011
2
PLSX #1

Description of Operation Motor (positioning) Control


R30001 JOGX LDP R30012
CW PLSX #2
LDP R30013
PLSX #3
R30002 LDP R30014
CCW PLSX #4

R30003
HIGH

࡮Positioning instruction part

R30010 #0
PLSX

R30011 #1
PLSX

R30012 #2
PLSX

R30013 #3
PLSX

R30014 #4
PLSX

END

ENDH

- KV-5000/3000 Series User’s Manual - 2-201


CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

■ Reference example for continuous execution of position control


Positioning control is started on the up edge of R30000 relay.
Point No.1 -> 1s stop -> poin No.2 -> 1s stop -> point No.3 -> 1s stop -> point No.0

R30000 #1 ;(mnemonics list)


PLSX Move to point 1 LDP R30000
Positioning start PLSX #1
LD CR3006
2 CR3006 CM2019 #100 R2000 #2
AND= CM2019 #1
ONDL #100 R2000
=#1 ONDL PLSX Move to point 2 CON
Description of Operation Motor (positioning) Control

R2000 AND R2000


X axis positioning X axis operation in
PLSX #2
complete relay progress point No.( M code)
LD CR3006
CR3006 CM2019 #100 R2001 #3 AND= CM2019 #2
= ONDL PLSX Move to point 3 ONDL #100 R2001
#2 CON
X axis positioning X axis operation in R2001 AND R2001
complete relay progress point No.( M code) PLSX #3
CR3006 CM2019 #100 R2003 #0 LD CR3006
= ONDL PLSX Move to point 0 AND= CM2019 #3
#3 ONDL #100 R2003
X axis positioning X axis operation in R2003 CON
complete relay progress point No.( M code) AND R2003
END PLSX #0

ENDH

2-202 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

■ Reference example for starting positioning control at high speed


By executing PLSX instruction in interrupt program, start high speed pulse output without being
influenced by scan time.
Start pulse output on the up edge of input R000
CR2002 ;(mnemonics list)
EI LD CR2002
EI
Always ON

HSP
HSP R000
END
INT R000
2
R000 LD CR2002

Description of Operation Motor (positioning) Control


PLSX #0
RETI
ENDH
END

INT
R000

CR2002 #0
PLSX
Always ON

RETI

ENDH

■ Reference example for executing speed change during operation


● Use comparator 2 interrupt relay CR3013 (X axis) and CR3113 (Y-axis)
Set to allow interrupt processing.
On the up edge of R30000, clear multi-stage control state DM5000, set comparator 2 (interrupt
position) to "500000", use PLSX instruction to start pulse output.
When current position = comparator 2, start interrupt processing, increase multi-stage control state DM5000.

<Interrupt processing>
When (the first multi-stage processing) multi-stage control state DM5000=0, write next interrupt position
"100000" in comparator 2, change speed to 15000 (Hz).
When (the second multi-stage processing) multi-stage control state DM5000=0, write next interrupt
position "150000" in comparator 2, change speed to 25000 (Hz).
When (the third multi-stage processing) multi-stage control state DM5000=2, change speed to 20000
(Hz).

Note
· KV-5000/3000 PLC can identify interrupt value according to comparator 2 when
CHGSPX and CHGSPY are executed or pulse output is started through PLSX and PLSY
(X axis : CM02029/CM02028, Y axis : CM02059/CM02058). It cannot operate correctly
and setting value is writen to control memory only.
When using comparator 2 as interrupt condition, please write setting value to control
memory and then execute the CHGSPX, CHGSPY, PLSX, PLSY instructions.
· Actually, CR3013 and CR3113 will not be turned. They are only used as a symbol for
ladder program.

- KV-5000/3000 Series User’s Manual - 2-203


CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

CR2008 ;(mnemonics list)


EI LD CR2008
EI
1 scan ON at
operation start LDP R30000
MOV.D #0 DM5000
R30000 MOV.D MOV.D #50000 CM2028
PLSX #0
#0 DM5000 END
Positioning start Multi-stage control status INT CR3013
LD= DM5000 #0
2 MOV.D MOV.D #100000 CM2028
CHGSPX #15000
#50000 CM2028 LD= DM5000 #1
Description of Operation Motor (positioning) Control

X axis comparator 2 MOV.D #150000 CM2028


CHGSPX #25000
LD= DM5000 #2
#0 CHGSPX #20000
PLSX LD CR2002
INC DM5000
RETI
ENDH
END

INT
CR3013
X axis comparator 2 matching relay

DM5000 MOV.D
= #100000 CM2028
#0
Multi-stage control status X axis comparator 2

#15000
CHGSPX

DM5000 MOV.D
= #150000 CM2028
#1
Multi-stage control status X axis comparator 2

#25000
CHGSPX

DM5000 #20000
= CHGSPX
#2
Multi-stage control status

CR2002 DM5000
INC
Always ON Multi-stage control status

RETI

ENDH

2-204 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

Speed
25000
20000
15000

Starting speed

2
50000 100000 150000 Distance

Description of Operation Motor (positioning) Control


TIP For details about time for changing speed, see "Change speed during operation", Page 2-183.

● Use operating speed change request relay CR3012 (X axis) and CR3112 (Y axis)
Select speed control through parameter setup, and set
starting speed, acceleration time and operating speed
from point No.0.
Acceleration determined by this setting is also applicable
to acceleration when speed change request is sent out.
Set to speed control when stop sensor is used.
Set specified number of pulses for stop sensor.
65535 means deceleration stopping.
For specified number of pulses for stop sensor
65535, see "Specified number of pulses for stop
sensor", Page 2-164

Set up CR3003 by setting up stop sensor.

- KV-5000/3000 Series User’s Manual - 2-205


CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

On the up edge of relay R30000, speed change request relay is ON. Write setpoint "3000" in CM2016
and CM2017 (speed change setting), through PLSX instruction, start pulse output.
On the up edge of relay R30001, write setpoint "5000" in CM2016 and CM2017 (speed change setting).
On the up edge of relay R30002, write setpoint "6000" in CM2016 and CM2017 (speed change setting).
On the up edge of relay R30003, write setpoint "7000" in CM2016 and CM2017 (speed change setting).
On the up edge of relay R30004, speed change request relay is OFF. Stop sensor input CR3003 is ON,
decelerate to stop.
2 ;(mnemonics list)
R30000 MOV.D LDP R30000
Description of Operation Motor (positioning) Control

#3000 CM2016 MOV.D #3000 CM2016


SET CR3012
X axis operation PLSX #0
speed change setting LDP R30001
MOV.D #5000 CM2016
CR3012 LDP R30002
SET MOV.D #6000 CM2016
LDP R30003
X axis operation MOV.D #7000 CM2016
speed change request LDP R30004
RES CR3012
#0 OUT CR3003
PLSX

R30001 MOV.D
#5000 CM2016
X axis operation
speed change setting

R30002 MOV.D
#6000 CM2016
X axis operation
speed change setting

R30003 MOV.D
#7000 CM2016
X axis operation
speed change setting

R30004 CR3012
RES
X axis operation
speed change request

CR3003

X axis stop sensor input

END

ENDH

2-206 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

R30000 R30001 R30002 R30003 R30004


Speed
7000
6000
5000

3000
2

Description of Operation Motor (positioning) Control


Time

TIP For details about time for changing speed, see "Change speed during operation", Page 2-183.

■ Reference example for executing positioning control over 32 points


Since target value/movement of each point is stored in CM, therefore, multipoint positioning may be
carried out by rewriting control memory (CM) content in ladder diagram circuit.
For example, target value of point No.0 may be changed by rewriting target value/movement (CM2060/
CM2061) content.

Example

R000 #10000 #0
DW.D PLSX
CM2060

R001 #200000 #0
DW.D PLSX
CM2060

R002 #600000 #0
DW.D PLSX
CM2060
"Point parameters", Page 2-159

- KV-5000/3000 Series User’s Manual - 2-207


CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

Lilst of Devices/error Codes for Positioning

■ Control relays list


Attribute
X axis Y axis Content
2 Set whether to use through
R: Read only
Blank: R/W

CR3000 CR3100 CW limit switch


Description of Operation Motor (positioning) Control

parameter
Set whether to use through
CR3001 CR3101 CCW limit switch
parameter
Set whether to use through
CR3002 CR3102 Origin sensor input
parameter
Set whether to use through
CR3003 CR3103 Stop sensor input
parameter
CR3004 CR3104 Origin return in progress
ON when origin return is finished; R
CR3005 CR3105 Origin return complete
OFF at next pulse output
ON when origin return or
CR3006 CR3106 Positioning complete relay positioning is finished; OFF at
next pulse output
CR3007 CR3107 Error/error clear
CR3008 CR3108 Warning/clear warning Current position overflow
Pulse output in progress/
CR3009 CR3109 Emergency stop by forced reset
emergency stop
Pulse output is started. Used for
CR3010 CR3110 Drive operation start
CM2025 and CM2055
Used for changing current value
CR3011 CR3111 Current value change request
(used when pulse is stopped)
Operating speed change Used for changing speed (in the
CR3012 CR3112
request case of speed control)
Only used as a symbol for ladder
Interrupt when comparator 2
CR3013 CR3113 programing, thus will not be ON/
(interrupt specificl) matches
OFF

2-208 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

■ Control memory list


● System parameter
Number Attribute
X axis Y axis Content R: Read only
of words Blank: R/W

Assignment of origin/stop sensor


operation setting when sensor detection
CM2000 CM2030 I/O setting *1
and comparator are consistent 1 2
Set up output mode (single pulse/

Description of Operation Motor (positioning) Control


double-pulse)
Enable specifying for origin sensor/
Sensor stop sensor/limit switch
CM2001 CM2031 1
enable*2 Polarity specifying for origin sensor/
stop sensor/limit switch
CM2002 CM2032 Current value
2
CM2003 CM2033 Comparator 0 Use comparator soft limit switch and
CM2004 CM2034 Current value stop sensor function setting
2
CM2005 CM2035 Comparator 1
CM2006 CM2036 Set up starting speed 1
CM2007 CM2037 Set up acceleration/deceleration time 1
Origin return
CM2008 CM2038
Set up operating speed 2
CM2009 CM2039
CM2010 CM2040 Set up starting speed 1
CM2011 CM2041 Set up acceleration/deceleration time 1
Operation JOG
CM2012 CM2042
Set up operating speed 2
CM2013 CM2043
CM2014 CM2044 Current value change setting value
2
CM2015 CM2045 X axis : changed through CR3011; Y axis: changed through CR311
CM2016 CM2046 Operating speed change setting value
2
CM2017 CM2047 X axis: changed through CR3012; Y axis: changed through CR3112
I/O and origin Origin return detailed setting
CM2018 CM2048 return detailed 1
I/O detailed setting
setting*1
CM2026 CM2056
Home position coordinate 2
CM2027 CM2057
CM2028 CM2058 Current value Used to use setting of comparator
2
CM2029 CM2059 comparator 2 interrupt
*1 I/O detailed setting
In CM2000/CM2018 (X axis) and CM2030/CM2048 (Y axis), store relationship of between R000-
R007 origin sensor, stop sensor, limit switch.
In addition, also store pulse output mode, operation mode when comparator is matched,
detection method of origin return starting direction and stop position, deviation counter clear,
automatic movement relationship of home position.
For KV STUDIO, when setting up parameters, it is unnecessary to pay attention to these
information in ladder diagram.
*2 Sensor enable details
CM2001 (X axis), CM2031 (Y axis) store origin sensor, stop sensor, limit switch input polarity and enable setting.
When using KV STUDIO to set up parameters, it is unnecessary to pay attention to these information in ladder diagram.

- KV-5000/3000 Series User’s Manual - 2-209


CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

bit
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

CM2000 (X axis)ǂCM2030 (Y axis)


bit0 Output format selection
0 1-pulse output
1 2-pulse output

bit1 Origin Return direction


2 0 CCW
1 CW
Description of Operation Motor (positioning) Control

bit5 bit4 Operation at current position comparator 0 matching


0 0 Not used
0 1 Use as stop sensor
1 0 Used as limit switch of CW direction
1 1 Used as limit switch of CCW direction

bit7 bit6 Operation at current position comparator 1 matching


0 0 Not used
0 1 Use as stop sensor
1 0 Used as limit switch of CW direction
1 1 Used as limit switch of CCW direction

bit9 bit8 Input setting of R000


0 0 Not used as stop/origin sensor
0 1 Use as stop sensor input
1 0 Use as origin sensor input
1 1 Setting disabled
bit11 bit10 Input setting of R001
0 0 Not used as stop/origin sensor
0 1 Use as stop sensor input
1 0 Use as origin sensor input
1 1 Setting disabled
bit13 bit12 Input setting of R002
0 0 Not used as stop/origin sensor
0 1 Use as stop sensor input
1 0 Use as origin sensor input
1 1 Setting disabled
bit15 bit14 Input setting of R003
0 0 Not used as stop/origin sensor
0 1 Use as stop sensor input
1 0 Use as origin sensor input
1 1 Setting disabled

2-210 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

bit
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

CM2018 X axis) CM2048 Y axis)


bit1 bit0 How to Detect Origin Stop Position
0 0 Ring edge of the origin sensor
0 1 Medium point of the origin sensor
1 0 Origin sensor and Z phase
1 1 Setting disabled 2
bit3 Clearing deviation counter

Description of Operation Motor (positioning) Control


0 No output
1 Output

bit4 Moving to initial position automatically


0 Not move
1 Move

bit8 Limit switch CW


0 Not used
1 Use

bit9 Limit switch CCW


0 Not used
1 Use

- KV-5000/3000 Series User’s Manual - 2-211


CPU INTERNAL FUNCTIONS

2-12 Description of Operation Motor (positioning) Control

bit
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

CM2001(X axis)ǂCM2031(Y axis)


bit1 Stop sensor enable
0 Disable
1 Enable

bit2 Limit switch of CW direction enable*1


2 0 Disable
1 Enable
Description of Operation Motor (positioning) Control

bit3 Limit switch of CCW direction enable*1


0 Disable
1 Enable

bit8 Origin sensor polarity


0 N.O. (normally open: A contact)
1 N.C. (normally closed: B contact)

bit9 Stop sensor polarity


0 N.O. (normally open: A contact)
1 N.C. (normally closed: B contact)

bit10 Limit switch polarity of CW direction


0 N.O. (normally open: A contact)
1 N.C. (normally closed: B contact)

bit11 Limit switch polarity of CCW direction


0 N.O. (normally open: A contact)
1 N.C. (normally closed: B contact)

bit12 Z phase polarity


0 N.O. (normally open: A contact)
1 N.C. (normally closed: B contact)

*1 CW limit switch enabled/CCW limit switch enabled


If it is not set to "1" (enabled), limit switch input will not be accepted.
This setting has higher priority than any other setting related to limit switch, even if it is not assigned to
limit switch through setting current position comparator, it is necessary to set this bit to "1" (enabled).
When setting parameters in KV STUDIO, automatically change to "enabled".

● State
Number Attribute
X axis Y axis Content R: Read only
of words Blank: R/W

CM2019 CM2049 Current operation point No.(M code) 1


CM2020 CM2050 Current position
2
CM2021 CM2051 *Can be changed through current value change request
R
CM2022 CM2052
Current speed 2
CM2023 CM2053
CM2024 CM2054 Error code 1
Specified point No.
CM2025 CM2055 Specified point No. (for TCHX/TCHY instruction: X axis: 1
CR3010, Y axis: CR3110)

2-212 - KV-5000/3000 Series User’s Manual -


CPU INTERNAL FUNCTIONS
2-12 Description of Operation Motor (positioning) Control

● Point parameter
Serial Common to X/Y Number Attribute
Content R: Read only
No. axis of words Blank: R/W

CM2060
Target value/movement 2
CM2061
CM2062 Starting speed 1

0
CM2063
CM2064
Acceleration/deceleration time 1
2
Operating speed 2
CM2065

Description of Operation Motor (positioning) Control


CM2066 Operation mode setting (ON/OFF by stop sensor) 1
CM2067 Specified number of pulses for stop sensor 1
1 CM2070 to 2077
: : Same as point parameter 0
31 CM2370 to 2377

● Error code
Error code
(X axis: CM2024,Y Opera Content
axis:CM2054) tion
10 Stop Startting speed value smaller than setting range.
11 Stop Operating speed value smaller than setting range.
12 Stop Operating speed value larger than setting range.
13 Stop Start speed value larger than operating value.
14 Stop Acceleration/deceleration time larger than setting range.
Warning relay CR3008 (X axis)CR3108 (Y axis) starts from
20 Stop
ON state to perform positioning control by ABS positioning.
Through the effect of drive operation start relay CR3010 (X
Error
21 Stop axis) CR3110 ( Y axis), the value of CM2025 (X axis)
CM2055 (Y axis) to be moved is out of range.
30 Stops when there is emergency stop input.
31 Stop Limit error: stops when there is CW limit switch input.
32 Stop Limit error: stops when there is CCW limit switch input.
Moves towards the CW (CCW) direction, and detects CCW
33 Stop
(CW) limit switch.
90 Stop System error

- KV-5000/3000 Series User’s Manual - 2-213


2-13 Clock Function
CPU INTERNAL FUNCTIONS

KV-5000/3000 can continue to count time of "year, month, day, hour, minute, second, week " through
built-in clock IC backed up by battery when power is OFF.
It can be used for error /power ON/OFF log and logging/tracing function etc.
Clock accuracy under normal temperature (+25°C) is ± 60s/month.

■ Read clock data

2 Clock data are stored in control memory CM700 to CM706.


Time data format is as follows.
Clock Function

bit bit
15 0

CM700 year 0 to 99 Year indicates the last 2 digits of solar calendar year 2000.
CM701 month 1 to 12
CM702 day 1 to 31
CM703 hour 0 to 23 Data are all expressed as 16-bit BIN format
CM704 minute 0 to 59
CM705 second 0 to 59
CM706 week 0 to 6 Week is 0: (Sunday), 1: (Monday), 2: (Tuesday), 3: (Wednesday),
4: (Thursday), 5: (Friday),6: (Saturday)

· The data may be read directly from ladder program. (Read-only)

■ Write clock data (time setting)


● To set up in access window
Clock data can be displayed and time can be set in access window.
"Date", Page 2-20

● To set up through the ladder program


Time can be set up through WTIME instruction. In addition, 0s correction can be performed also
through AJST instruction.
Please refer to KV-5000/3000/1000 Series PLC Instruction Reference Manual, “Time processing instructions".

● Set up through KV STUDIO


In the process of monitoring via KV STUDIO, open "Commissioning" -> "Set calendar clock" from the
menu.

KV STUDIO User's Manual "Set calendar clock".

2-214 - KV-5000/3000 Series User’s Manual -


3

LADDER PROGRAMMING
LADDER PROGRAMMING
In this chapter, the specifyings or setups for ladder programming will be
introduced. If module, macro, local device are used, programming efficiency
may be improved.

3-1 What is meant by sequence control •••••••••••••••••••• 3-2


3-2 Programming Language •••••••••••••••••••••••••••••••••• 3-5
3-3 Item ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-9
3-4 Configuration and Operation of Program•••••••••••• 3-15
3-5 Interrupt •••••••••••••••••••••••••••••••••••••••••••••••••••• 3-31
3-6 Device and Constant •••••••••••••••••••••••••••••••••••• 3-52
3-7 Data Processing•••••••••••••••••••••••••••••••••••••••••• 3-86
3-8 Module ••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-94
3-9 Macro••••••••••••••••••••••••••••••••••••••••••••••••••••••3-109
3-10 Local Device •••••••••••••••••••••••••••••••••••••••••••••3-131
3-11 File Register••••••••••••••••••••••••••••••••••••••••••••••3-137
3-12 Programming Skills •••••••••••••••••••••••••••••••••••••3-148

- KV-5000/3000 Series User’s Manual- 3-1


3-1 What Is Sequence Control
In vehicle assembly line as shown in the figure below, equipment actions, sequences and conditions
LADDER PROGRAMMING

are stored in a control unit which are executed to perform required control actions sequentially until a
car is assemblied. This is called sequence control.
For this, such PLCs as the KV-5000/3000 series PLC etc (Programable Logic Controller) for sequence
control.

<bodywork assembly line of vehicle factory>

3
What Is Sequence Control

·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, besides sequence control, feedback control is also available.
Feedback control is the process to keep the current value at expected level by cyclic
sampling.
(example) temperature control, pressure control, speed control

3-2 - KV-5000/3000 Series User’s Manual-


3-1 What Is Sequence Control

■ Example of sequence control

LADDER PROGRAMMING
Let's take fully automatic washing machine as an example.
To start the specified washing sequence, press the Start button. The washing process goes like this:

ON
(1) Put in the clothes to be washed, and press the Start button.
Start

Water
supply I
(2) Press the Start button, and turn on the tap.
3

What Is Sequence Control


When the cover
is opened (3) When the specified water level is detected, the water supply
Wash motor is turned off.

When the cover


is closed
Click

(4) When the specified time has elapsed, the washing motor is stopped,
Pause Water and the water drain valve is opened.
drain I

When the cover


is closed
(5) When completion of water drainage (water level "0") is detected,
When the cover Water the water drain valve is closed, and the spin dry motor is started up.
is opened drain I

(6) When it is detected that the specified time has elapsed,


Water the motor for draining water is stopped, and the water supply valve is opened.
supply II

When the cover


is opened (7) When the specified water supply amount (water level)
Spin is detected, the water supply valve is closed, and the motor for washing is started up.

When the cover


is closed
Click

(8) When it is detected that the specified time has elapsed,


Water the washing motor is stopped, and the water drain valve is opened.
Pause drain II

When the cover


is closed

(9) When completion of water drainage (water level "0") is detected,


Water the water drain valve is closed, and the spin dry motor is started up.
When the cover
drain II
is opened

End
(10) When it is detected that the specified time has elapsed,
the spin dry motor is stopped indicating the washing process is completed.
And the buzzer sounds.
End

- KV-5000/3000 Series User’s Manual- 3-3


3-1 What Is Sequence Control
LADDER PROGRAMMING

Sequence Control Type

The basic sequence control is mainly divided into " sequence control ", " condition control " and " time
limit control ". A target control circuit can be designed by combining these control types.

● Sequence Control
Sequence control is that the next action is triggered by an external signal from detector after the

3 previous action is completed.


"the sequence control of fully automatic washing machine "
What Is Sequence Control

(2) water intake > "- water intake is finished> " (3) wash (start wash motor) "
"(4) drainage I"-> drainage is finished -> " (5) dehydration I (start dehydration motor) "

Typical sequence control ladder instruction: STG, JMP etc.

● Condition control
Condtion control means that required actions are initiated only when pre-defined conditions are met.
"condition control of fully automatic washing machine "
"(3) wash" -> if cover is opened -> "pause" -> if cover is closed -> "(3) wash"
"(5) dehydration I"-> if cover is open is close-> "pause" -> if cover is closed -> "(5) dehydration I"

Typical condition control ladder diagram instruction: STP, STE, CJ, NCJ, LABEL etc.

● Time Limit Control


Time limit control means that after the specified time is elapsed, the next specified action starts.
"time limit control of fully automatic washing machine"
"(3) wash "-> detect specified duration -> "(4) drainage I"
"(5) dehydration I" -> detect specified duration -> "(6) water intake II"

Typical time limit control ladder diagram instruction: TMR, LDWK etc.

3-4 - KV-5000/3000 Series User’s Manual-


3-2 Programming Language
In KV STUDIO, the "Extended Ladder" and "KV Script " can be used for programming.

LADDER PROGRAMMING
To enable the programs on KV-5000/3000 PLC, the "mnemonics" will be used as operating language.

Extended Ladder

Expanded Ladder is a unique language developed by Keyence Company on the basis of normal
ladders (the relay symbol-based programming language), it has the following features:
· Output instruction and input instruction may be mixed for programming
· Provide output coil branch
· A wide range of instructions can be connected
3

Programming Language
R000 DM0 DM1 #123 DM10
LDA MUL ADD STA

R500 R001 R501


( SET )

Since a set of correlated processings can be programmed in one line, the process is then simplified,
thereby improving design and maintenance efficiency. Since many instructions are programmed on one
line, number of lines of all ladder diagram programs may be reduced.

Note
To use the Extended Ladder, please select "Edit (e)" -> "Edit Mode (b)" -> "Extended Ladder
Mode" from the menu bar of KV STUDIO.

■ Features of extended Ladder


Expanded Ladder is a unique language developed by Keyence Company on the basis of normal
ladders. In converntional ladders, output instructions could only be placed on right end of ladder
diagram program. But in expanded ladder, it may be placed in any position except left end.
Multiple output instructions on a single rung.
<Conventional ladder program> <Expanded ladder>

Multiple rungs are used for multiple


output instructions.
Only 1 rung is used.

Mixed I/O circuit


<Conventional ladder> <Expanded ladder>

Only intput Only output Only input Both input circuits Only output
circuits can circuits can circuits can and output circuits circuits can
be written be written be written can be written be written

- KV-5000/3000 Series User’s Manual- 3-5


3-2 Programming Language
LADDER PROGRAMMING

Ladder folding
<Conventional ladder> <Expanded ladder>

The instructions taht can be written on a single rung.


Multiple instructions can be written.

3 Output coil branching


<Conventional ladder> <Expanded ladder>
Programming Language

Branches are possible only from input contacts. Branches from output coils are also possible.

Note MOV
Block instructions are ( etc) always written on right side of ladder
program.

■ Benefits of Expanded Ladder Diagram


● Less rungs to be used
Output and input instructions may be mixed for programming, allowing less rungs to be used and
thereby more readable.

Example

<Conventional ladder>
R000
T1

T1 R001 R500

T1 R002 With conventional ladder,


T2 it is difficult to tell at a glance
what the operation conditions
T2 R003 R501 are and what the ladder would execute.
Expanded ladders, however,
are much easier to understand.

<Expanded ladder >

R000 T1 R001 R500


T1

R002 T2 R003 R501


T2

3-6 - KV-5000/3000 Series User’s Manual-


3-2 Programming Language

● More Readable Processing Sequence

LADDER PROGRAMMING
Ladder symbols are arranged according to processing sequence making the program more readible.
At the same time, also easy for maintenance.

(Example) Suppose the following elements are programmed:


 Start switch (R000) is on.
        ↓
 (1) Indicator lamp LED A (R500) lights for 3 s
 (2) Indicator lamp LED B (R501) lights for 2 s
 (3) Indicator lamp LED A (R500) and LED B (R501) light simultaneously for 5 s
3

Programming Language
 Repeat (1) - (3).

KV Script

Although suitable for sequence control programming, processing complicated operation and character
strings etc. programs remains a toufh challenge for ladder programs in that, its programming becomes
complicated, commissioning and maintenance also become difficult.
The programming language KV Script provides a solution to this in that it can be used as an efficient
programming tool to tackle with programming tasks.

Can compatited with ladder diagram at the same


time and also can add comment to each script.
KV script

Easy to understand procedure of program because Even though not aware of internal register,
can programming to control sentence. we can describe calculation process as
mathematic formula.

Script programs are converted into ladder programs before they are executed.
Script program can be monitored if they are converted into ladder programs.

KV-5000/3000/1000 Series Script Programming Manual

- KV-5000/3000 Series User’s Manual- 3-7


3-2 Programming Language
LADDER PROGRAMMING

Mnemonics

Mnemonics enable written programs to run on KV-5000/3000 PLC.


Extended ladder programs are converted into mnemonics for easy understanding.
The programs written with Extended Ladder are converted into mnemonics before they are transferred
to KV-5000/3000 PLC.
Mnemonic language table can be edited with KV STUD IO. For normal ladder programming, however,
this is not required.
3 LD R000
OUT R500
Programming Language

LD R002
OUT R501
LD R003
OUT R502

·To edit the Mnemonic Language Table, select "Edit (E)" -> "Edit list (l)" (edit Mnemonic
Language Table) from the menu.
Other procedure · Ctrl + D

·In this manual, the mnemonics table for CPU built-in functions or sample programs is
provided, which, if used, will simplify sample programs entering.
"How to Use Mnemonics List", Page 15

·when expanded ladder diagram is used for programming, programming man-hour may be
reduced by input instructions using mnemonic symbol.
"Input mnemonics", Page 3-152

3-8 - KV-5000/3000 Series User’s Manual-


3-3 Project

LADDER PROGRAMMING
Project Configuration

■ What is project?
Project is used by KV-5000/3000 PLC for management of program and unit setup information.
When KV STUDIO is used to create a new project, a folder with the same name will be generated automatically.
The information in a project is as follows:

Project
3

Project
Program
Unit Setting info

Global device comment ࡕࠫࡘ࡯


ࡕࠫࡘ࡯
ࡕࠫࡘ࡯
Module


Global label ࡞

CPU System setting

Initial value setting info ࡑࠢ


ࡑࠢ
Macro
Logging/trace setting info

Device default value setting

File register setting

Note
The information management capacity of one project varies depending on the
information required by KV-5000/3000 PLC.

● Program

A program consists of modules and macros etc.


Execute this program repeatedly to realize various controls.
"3-4 Configuration and Operation of Program", Page3-15
"3-8 Module", Page 3-94
"3-9 Macro", Page 3-109

● Unit Setting info


For the management of unit configuration and setup. Please use KV STUDIO for easy setup.
Expansion Unit User's Manual
KV STUDIO User's Manual, "Chapter 3 Unit Editor"

- KV-5000/3000 Series User’s Manual- 3-9


3-3 Project

● Global device comment


LADDER PROGRAMMING

This facilitates device management by providing additional device information.


"Device Comments", Page 3-164

● Global label
Label can be used as a replacement to device names to facilitate programming.
"Label", Page 3-162

● CPU System setting


3 The setup items for KV-5000/3000 are as follows.
Sort
Project

project Description Reference page


ing
"Module Execution
Execute sequence of modules The module scanning sequence.
Sequence", Page 3-102
"Scan Time",
Program setup

The priority setup for module fixed Page 3-22


Fixed period execute and user interrupt
operation cycle and interrupt. "Interrupt Priority",
Page 3-37
Set up a specific scanning time and END "Scan Time",
Scantime related
processing time. Page 3-22
"Project Protection
Protection setting Project read/write protection
Setting", Page 3-13
Local device assignment and setup of individul "Local Device
Entire assignment setting of local devices
modules/macros. Assignment", Page 3-133
The logging/tracing for the upper limit, "Detailed tracing setting",
CPU unit buffer capacity
System setup

buffer capacity. Page 2-60


Whether the device status/value is retained "Power OFF Hold Setting
Set power failure holding
when the power is OFF. (latch)", Page 3-57
Set up running/stop state etc when error "Operation during error",
Action when error occurs
occurs. Page 3-19
Set up the upper limit of the digital trimmer and "Digital Trimmer",
Upper Imt of dig trimmer
Enable/Disable. Page 2-17

● CPU positioning parameter


For CPU positioning parameter setup.
"2-12 Description of Operation Motor (positioning) Control", Page 2-157

● Logging/trace setting info


This is used to set up the logging/tracing feature whereby device data are stored into the Memory Card.
"2-3 Logging/Tracing", Page 2-52

● Device default value


This is used for device dafault value setup which is used to perform an automatic initialization on the
specified device.
"Device default value", Page 3-169

● File register setting


For the setup of register global replacement whereby upto 1,000 To programs in the file register can be
replaced at one time.
"File Register Unified Set up", Page 3-138

3-10 - KV-5000/3000 Series User’s Manual-


3-3 Project

LADDER PROGRAMMING
Program Capacity

The max. program capacity of KV-5000/3000 PLC is as follows :


· Program Capacity .... KV-5000: 5500k bytes (approx. 260k steps)
KV-3000: 2250k (approx 160k steps)
· Object Size .............. 3872k byte
· Internal Work Occupation (Bit: 131072 , Word: 12288)

Program capacity statistics are automatically calculated by KV STUDIO and displayed in the
3
"Conversion Result" dialog box. Hence no calculation and management efforts are required.

Project
Note
The max. capacities for Program Capacity, Object Size, and Internal Work Occupation must
be exceeded. Otherwise, no transmission and operation is possible.

<Program Capacity>
The bite size for each instruction is fixed. This size varies depending on operand type,
instruction suffix, and indexing availability. In program capacity calculation, in addition to the
total number of bytes used by all the instructions, the number of bytes used by comments,
device comments/labels sould also be added. One device comment use 40 bytes. And the
size for a rung momment and label varies depending on the number of words.
In the residual program size in the 260k steps/160k steps programming with KV-5000/3000,
up to 96,000/30000 device comments can be managed. If the whole is used for labels, up to
137,000/44,000 labels can be managed.

For details on instructions, refer to the "KV-5000/3000/1000 Instruction Reference Manual, "2-14
Access WindowInstructions."

- KV-5000/3000 Series User’s Manual- 3-11


3-3 Project

<Object Size>
LADDER PROGRAMMING

Object Size is the total run data size, which is determined by instruction size. Object size
varies dependin on operand type and availability of instruction suffixs and indexing. The size
of comment rungs and labels are not considered in the object size calculation.
For instruction size, please refer to the "Appendix-2 List of Instruction Size in the "KV5000/3000/
1000 Instruction Reference Manual,"2 Access Window Instructions."

<Total Step>
Total step is the total number of instructions used in a project.

3 After converted by KV STUDIO, it is displayed on the left of the ladder.


Project

000610

000610

000610
The number of steps used in the modules/macros under each rang No. is indicated.

000633

000638

000643

<Internal Work Occupation>


Refers to total internal data used, for example, in each command operand, the previous state
of designated device etc.

3-12 - KV-5000/3000 Series User’s Manual-


3-3 Project

LADDER PROGRAMMING
Project Protection Setting

■ Project Protection
A code is set up for KV-5000/3000 read/write protection.
The setup steps are as followings.

1 Select "Workspace".

2 Right-click, and select "Project Properties (F)" from the pop-up menu. 3
Or procedure select "File (F)" (document) -> "Project Properties (F)" from the menu,

Project
The "Project Properties (F)" dialog box is displayed.

2
3

No. project Description


1 Project Name The project name is displayed.
2 Project ID Display the identification number of project Transfer in RUN mode.
3 Save to Display the directory of project folder.
4 Set Password The "Set Password" dialog box is displayed.
5 Comment Project comments are entered here.
6 Author The author name is entered here.
7 AW display cmnts The KV-5000/3000 PLC access window comments are
entered here. (up to 12 half-widht alphanumeric characters)

- KV-5000/3000 Series User’s Manual- 3-13


3-3 Project

3 Press the "Set Password" button.


LADDER PROGRAMMING

The "Set Password" dialog box is displayed.

Password setting
(within 6 1-byte alphanumeric characters)

3 4 Enter password, and click "OK" button.


Project

When KV-5000/3000 reads the project for which the password is setup, the "Cancel Password" dialog
box is displayed.
If the password is not entered, the project can not be read from KV-5000/3000.

■ Project write/read protection


This is used to place wirte/read restrictions on KV-5000/3000.
To select Project Write/Read Protection, click CPU System Setting -> Add write/read-protection for programs in CPU.

This protection is effected after you select the option and transfer the same to KV-5000/3000.

Note
If the read/write protection is appied before the project is transferred to KV-5000/
3000,monitoring may not be performed.
This should be done after the commissioning is completed.

3-14 - KV-5000/3000 Series User’s Manual-


3-4 Program Structure and Operation

LADDER PROGRAMMING
CPU Unit Operation

The following sequence is performed by KV-5000/3000 repeatedly:


CPU built-in
Control processing Pepherical processing Ethernet/FL-net
processing (only KV-5000)
Auto refresh

Communication processing

Execute program
Access window processing
Direct access switch processing
Built-in positioning function
Ethernet function
or
3
Scan once Frequency counter FL-net function

Program Structure and Operation


Memory card access
Logging/trace function
etc.

Synchronization
END processing Synchronization

High-speed processing is achieved through parallel execution of control processing, peripheral


processing, and CPU built-in Ethernet/FL-net processing (only for KV-5000).
Except the above-mentioned 3 types of processing, external input/high-speed counter
comparator/fixed-period module execution-based interrupt processing is also available.
"3-5 Interrupt", Page 3-31

■ Control Processing
This involves such main processes as ladder program execution. One control processing is counted as
one scan. The duration of one scan is the so-called scan time.

● Auto Refreshing
Update the state or value of device distributed to CPU built-in function or expansion unit. Firstly transfer
output device state or value to the units, then transfer state or value of the units to input device.

● Program execution
In this process, the device status or values assigned to CPU built-in or external units are updated. In
this process, the first step is to transfer device status or values to the units, and the second step is to
transfer unit status or values to input devices.
● END Processing
In this process, the device values required for external processing or CPU built-in Ethernet/FL-net processing are
fetched into the Control Processing. Also, the system error checking is performed in this process.
Generally speaking, END processing time will also be determined automatically according to
different program execution time.If the data traffic is heavy, however, END processing time
needs to be set up..
"END Processing Time" Page 3-25

■ External Processing
In this process, other communication or management data than the program data is processed here. In
addition, memory card or clock related instructions are executed also in this process. The scanning
time is minimum affected by processing tasks through parallel processing.

- KV-5000/3000 Series User’s Manual- 3-15


3-4 Program Structure and Operation

About Direct Processing


LADDER PROGRAMMING

As described above, every scanning implies one automatic processing, whereby the device values or
status assigned to CPU built-in or extended units are updated. Information updating (direct processing)
can be performed in the following ways in the program execution.

Note
For Expansion Unit, the following direct processing may be executed only when the
corresponding expansion unit is connected.

3
■ Extended I/O Unit
Program Structure and Operation

● Direct I/O Relay (DR)


When an I/O relay is assigned as the operand, if "DR" rather than "R" is used for programming, the input/
output is then updated during instruction execution. For the instructions that may be used by "DR", see
KV-5000/3000/1000 Instruction Reference Manual.
Example
DR30000 DR500

For the XYM Marking, "OX" and "DR" are used.


"About XYM Marking", Page 3-54

● RFSX/RFSY Instruction
This is used for update of all the relays which are assigned as operands.
Example
CR2002 MOV
DM0 R30000
Always ON
Result of calculation

RFSY
R30000 #16

see the "RFSX/RFSY Instruction " in the KV-5000/3000/1000 PLC Instruction Reference Manual,.

■ Special Extended Unit


With the buffer memory in each unit, unit information reading and writing can be performed any time
during program execution. So does the built-in Ethernet/FL-net unit.

● Unit-specific Instruction
With the unit-specific instructions, data exchanging with extended units can be performed without
knowing the buffer memory address.
"Unit-specific Instruction " in the Expansion Unit User's Manual

3-16 - KV-5000/3000 Series User’s Manual-


3-4 Program Structure and Operation

● Buffer Memory Access Instruction (UREAD/UWRIT/UFILL)

LADDER PROGRAMMING
The buffer memory read (UREAD)/write (UWRIT) instructions can be used for direct data read/write
from the buffer memory.
see the "RFSX/RFSY Instruction" in the KV-5000/3000/1000 PLC instruction Reference Manual
The List of Buffer Memories in the Expansion Unit User's Manual

■ CPU Internal Features


Like Extened I/O, the CPU built-in I/O can be used directly.
In addition, there are also specific instructions that can be used to update the High-speed Counter,
Positioning CurrentCoordinate, and Free Run Counter current values.
3

Program Structure and Operation


High -speed Counter Current Value Update....... "RFSCTH", Page 2-118
Current Positioning Coordinate Update ............ RFSPSX/RFSPSY, Page 2-198
Free Run Counter Current Value Update ........... The "RFSFRC Instruction" in the KV-5000/3000/1000 Series
Instruction Reference Manual

Power ON/OFF Operation

The following items are checked when the power is turned to ON. If everything is OK, the operation continues.
· Hardware checking and initialization
· Backup battery voltage checking
· Memory and device checking and initialization   "Power OFF Hold Setting (latch)", Page 3-57
· Expansion bus checking and initialization
· Auto-load processing "Auto Load Function", Page 2-50

· Ladder program checking and execution preparation

■ Power ON/OFF Log


Up to 20 power on/OFF logs can be retained. These logs are stored in the Control Memory (CM). The
newer the log, the smaller the log number. When more logs need to be stored, the oldest log is the first
to be deleted. In addition, this can be confirmed with the "Error Monitor" option.

- KV-5000/3000 Series User’s Manual- 3-17


3-4 Program Structure and Operation

● Power ON Log
LADDER PROGRAMMING

Control Memory Description


Year and month (decimal numbers, the left 2 digits represent
CM1900 month, the third represents year.
   example: 706 -> June, 2007)
CM1901 Power-on log, 1 (new) day
CM1902 hour(0 to 23)
CM1903 minute
CM1904 second
3 : :
: :
Program Structure and Operation

Year month (decimal numbers, the left 2 digits represent


CM1995 month, the third represents year.
   example: 706->June, 2007)
CM1996 Power-off log, 20 (old) day
CM1997,, hour(0 to 23)
CM1998 minute
CM1999 second

● Power OFF log

control memory Explanation


Year and month (decimal numbers, the left 2 digits represent
CM5000 month, the third represents year.
   example: 706 -> June, 2007)
CM5001 Power-off log, 1 (new) day
CM5002 hour(0 to 23)
CM5003 minute
CM5004 second
: :
: :
Year and month (decimal numbers, the left 2 digits represent
CM5095 month, the third represents year.
   example: 706 -> June, 2007)
CM5096 Power-off log, 20 (old) day
CM5097 hour(0 to 23)
CM5098 minute
CM5099 second

3-18 - KV-5000/3000 Series User’s Manual-


3-4 Program Structure and Operation

Error Handling

LADDER PROGRAMMING
Error may be divided into error which implies a serious error and alarm which implies a slight error.
For more information, please see "A" in the "PLC Error List" on Page 2.
For error details of the expansion unit, see the user manuals of individual expansion units.

■ Error-handling Setup
From the KV STUDIO work space, Open "CPU System Settings" , and set up Error/Alarm in the Action
when error occur."
3

Program Structure and Operation


■ Error Log
Up to 20 error logs can be saved. Logs are saved in the Control Memory (CM). The newer the log, the
smaller the log number. In case 20 logs are exceeded, the oldest log is the first to be deleted. In
addition, the "Error monitor window" can be used for confirmation.

- KV-5000/3000 Series User’s Manual- 3-19


3-4 Program Structure and Operation

● Error Log (CM)


LADDER PROGRAMMING

An Error will be logged in the control memory.


Control Memory Description
Year and month (decimal numbers, the left 2 digits represent
CM1800 month, the third represents year.
   example: 706 -> June, 2007)
CM1801 Error log, 1 (new) day
CM1802 hour(0 to 23)
CM1803 minute

3 CM1804
:
error No.
:
: :
Program Structure and Operation

Year and month (decimal numbers, the left 2 digits represent


CM3915 month, the third represents year.
   example: 706 -> June, 2007)
CM1896 Error log 20 (old) day
CM1897, hour(0 to 23)
CM1898 minute
CM1899 error No.

You can also view and clear errors from the access window of the CPU unit.
"Error Clearing", Page 2-15

● Latest Error Description (CM)


Latest error details are logged in the Control Memory.
Control Memory Description
Year and month (decimal numbers, the left 2 digits represent
CM5100 month, the third represents year.
   example: 706 -> June, 2007)
CM5101 day
CM5102 hour
CM5103 minute
CM5104 Latest serious error detail second
CM5105 information 1 unit Error No.
CM5106 Counts of Extended Information codes
CM5107 Extended Information 1*
CM5108 Extended Information 2*
: :
: :
CM5126 Extended Information 20*
Year and month (decimal numbers, the left 2 digits represent
CM5150 month, the third represents year.
   example: 706 -> June, 2007)
CM5151 day
CM5152 HH
CM5153 minute
CM5154 Latest general error detail second
CM5155 information 1 unit Error No.
CM5156 Counts of Extended Information codes
CM5157 Extended Information 1*
CM51858 Extended Information 2*
: :
: :
CM5176 Extended Information 20*
3-20 - KV-5000/3000 Series User’s Manual-
3-4 Program Structure and Operation

According to different error No.expand information as follows.

LADDER PROGRAMMING
· When No.128 (calculation error)
Extended information n Description
Error description
0 (not used)
1 Incorrect indirect specifying
2 The indirect specifying destination is T/C
3 Incorrect simple indirect specifying
4 Beyond operand range
5 Single-precision floating-point number overflow 3
6 Incorrect device specifying

Program Structure and Operation


7 The function of ROOT instruction is negative
8 The bit for the ENCO instruction ON is unavailalbe
9 Single-precision floating-point number format abnormal
10 Incorrect argument for triangle function
Extended Information 1
11 Unconvertible data
12 Incorrect table specifying
13 Incorrect argument for the time comparison instruction
14 Incorrect cam switch operand
15 Incorrect argument for the frequency counter instruction
16 divided by 0
17 Incorrect To program ID
18 Direct Processing error
19 Unit that cannot be processed directly
20 Jump destination subroutine does not exist
21 Instruction cannot be executed in RUN or writing
22 Expansion unit-specific instruction destination error (unit No.)
Extended Information 2 00H fixed
Extended Information 3 The high bit of the erroneous step number
Extended Information 4 The low bit of the erroneous step number
Extended Information 5 to 20 The module name is saved as SJIS.(other part is 00H)

· No.50,53,55,56,58,59(unit ID related error)


Extended Information n Description
Extended Information 1 Unit No.(according to specific errors. If unit No.cannot be determined, do not save.)
Extended Information 2
00H fixed
to 20

· No.54 (unit counting related errors)


Extended Information n Description
Extended Information 1 Number of units
Extended Information 2 Number of actual units
Extended Information 3
00H fixed
to 20

- KV-5000/3000 Series User’s Manual- 3-21


3-4 Program Structure and Operation

· No.129 (unit error)


LADDER PROGRAMMING

Extended
Description
information n
Extended
Unit No.
Information 1
Extended
Error No. of each unit
Information 2
Extended
00H fixed
Information 3 to 20
3 · Others
Program Structure and Operation

Extended
Description
information n
Extended
00H fixed
Information 1 to 20

Scanning Time

The time required to execute a processing period (automatic update -> program execution -> end
processing) is called scanning time. scanning time varies depending on the program size and
instruction type.
Scan time Scan time Scan time

Auto update END Auto update END Auto update END


Execute program process Execute program process Execute program process

Note
In addition, when scanning time exceeds 300ms, "scan timeout may occur (CPU error No.30)"
will occur, it cannot continue to run. (Changed to the PROG mode)

· To verify the actual scanning time, please select When execute monitoring process via KV
STUDIO, confirm measured value of scanning time in the menu "Monitor" -> "Scan time
monitor".

• The actual scanning time can be verified via CM720 (10µs ).


"A" in the Appendix-2 CR/CM List, Page 7.

3-22 - KV-5000/3000 Series User’s Manual-


3-4 Program Structure and Operation

Fixed Scan Time (FST) Operation

LADDER PROGRAMMING
Scan time varies depending on the executing state or processing content, interrupt processing of every module
during execution of common program.
The scan time can be fixed if required.

● When the scan time is variable (normal)


0.9ms 1.1ms 1.0ms

Auto update
Execute program
END Auto update
process Execute program
END
process
Auto update
Execute program
END
process
3

Program Structure and Operation


Scan time varies depending on the instruction execution state.

● When scan time is fixed


(Example) When the scan time is set to "1.2ms"

1.2ms 1.2ms

Auto update Auto update


Execute program END process Execute program END process

In this mode, only the specified time elapsed could the next period start, even if all the processing
activities are completed in the period before the specified time elapsed.

Note
· When the scan time is longer than specified time, the scan time will be extended.
Please always measure the program execution time before you specified the scan time.
· In case an interrupt occurs during the rest time prior to the next period, this interrupt
processing will be prioritized. (only when interrupt is enabled)
Even if the specified scan time elapsed during execution of the interrupt program, the next
scan period will not be started until the interrupt program is completed.

- KV-5000/3000 Series User’s Manual- 3-23


3-4 Program Structure and Operation

■ Fixed Scan Time Operation Setting


LADDER PROGRAMMING

From the work space, open the CPU System Settings, and select "System Settings" -> "Scantime
related".

3
Program Structure and Operation

And the setting range is "0.1ms to 199.9ms".

Note
Please set a value larger than the actual scan time.

· The measured value of scan time can be confirmed via CM720 (10µs).
"A" in the Appendix-2 CR/CM List, Page 7.
• When the specified scanning time is exceeded, CR2304 is in the ON state only during one-
time scanning.

3-24 - KV-5000/3000 Series User’s Manual-


3-4 Program Structure and Operation

Enable END proceeding time

LADDER PROGRAMMING
Scan time varies depending on the executing state or processing content, interrupt processing of every module
during execution of common program.
After the END processing time is set up, a specific END processing time will be included in each time of
scan. And this setting is also required when the communication data traffic is heavy and the scan time
is too long such that Fixed scan time operation cannot be performed.

● Enable END proceeding time setting


3
Example) When this time is set to "1.2ms"

Program Structure and Operation


2ms 2ms

Auto update Auto update


Execute program END process Execute program END process

■ Enable END proceeding time


From the work space, open the CPU System Settings, and select "System Settings" -> "Scantime
related".

And the setting range is "0ms to 655.3ms".

END processing time measured value can be confirmed via CM723 (10µs unit)
"A" in the Appendix-2 CR/CM List, Page 7.

- KV-5000/3000 Series User’s Manual- 3-25


3-4 Program Structure and Operation
LADDER PROGRAMMING

Program Configuration

In one-time scanning, the program will be executed according to the pre-defined sequence. The master
program in each module will be executed step by step.

Module 1

Auto refresh
3 Module 2
Program Structure and Operation

Scan once
Execute program

END process

Module n

"3-8 Module", Page 3-94

In the module, master routine, sub-routine, and interrupt routine can be written respectively.

Master routine

Module
Subroutine

Interrupt program

Although macros may be called from the module, macros consists of master routines and sub-
routines. Interrupt routine cannot be prepared.
"3-9 Macro", Page 3-109

3-26 - KV-5000/3000 Series User’s Manual-


3-4 Program Structure and Operation

■ Master Routine

LADDER PROGRAMMING
The portion from the module or macro start to the END instruction is called Master Routine.
If there is no sub-routine or interrupt routine, the ENDH instruction should then be written behind END
instruction.

Master routine 3
Module/macro

Program Structure and Operation


END
ENDH

Note
If there is no END/ENDH instruction in the program, an error may occur during conversion.

The END/ ENDH instruction will be inserted automatically when creating a new unit and macro, therefore
please do not delete.

■ Subroutine
Sub-routine is a routine to be executed via the CALL subroutine call/ECALL inter-module subroutine call
instruction. If the execution condition of the CALL instruction is ON, the subroutine is then executed.
If the same processing needs to be repeatedly performed in the routine, or if you want to execute routine only
when the pre-defined condition is met, the routine can then be written into a subroutine and executed if required.
Up to 200 subprograms can be written between END - ENDH instructions (000 to 199).
Subroutine is started by the SBN instruction, and ended by the RET instruction.
In the same module or macro, several subroutines should not share the same No. Several CALL
instructions for the same subroutine No. may be To programed in the master routine.

"RFSX/RFSY Instruction" in the KV-5000/3000/1000 PLC instruction Reference Manual.

CALL #0
Master routine
CALL #1

END
Module/macro
SBN #0

RET
Subroutine
SBN #1

RET
ENDH

- KV-5000/3000 Series User’s Manual- 3-27


3-4 Program Structure and Operation
LADDER PROGRAMMING

Note
· If the SBN instruction corresponding to CALL instruction does not exist, an error will occur
during conversion.
· If the SBN instruction corresponding ECALL instruction does not exist, an error will occur
during conversion.
· The INT/RETI/STG/JMP/ENDS instructions cannot be used in a subroutine.
· Attention should be made when using differential execution instruction, timer instruction,
and macro instruction in subroutine.
"Precautions for Differential Execution Type Instruction" in the "KV-5000/3000/1000 Series
3 instruction Reference Manual
"Precautions when using timer instructions", Page 3-63
Program Structure and Operation

"Macro instruction", Page 3-123

· Up to 16 levels of nesting can be made during subroutine nesting through the CALL/ECALL
instruction.
• Although a subroutine could call itself (recursion call), "CALL nesting (CPU self error
No.10)" may occur if more than 16 layers are nested.

R001 #0
CALL
Master routine
END Other sub-routine programs (A)
that are called in a sub-routine program (B) must be
programmed in upper rungs than (B).
SBN
#1
Subroutine (A)
RET

SBN Call
#0

R000 #1
Subroutine (B) CALL

RET

ENDH

· To execute a subroutine in another module, please use the ECALL instruction.


KV-5000/3000/1000 Series Instruction Reference Manual
· To assign and call processing destination device or value, please use the macro.
"Difference Between Macro and Subroutine", Page 3-127

■ Interrupt Routine
Once the interrupt condition is met, the master routine processing is terminated and the interrupt routine is executed.
After the interrupt processing is completed, the master routine processing continues from where it was broken.
There are three interrupt conditions: external input (R000 to R009), high-speed counter comparator
(CTC0 to CTC3), CPU positioning function comparator 2 matching relay (CR3013, CR3113).

3-28 - KV-5000/3000 Series User’s Manual-


3-4 Program Structure and Operation

To execute interrupt processing periodically, please use the fixed period module.

LADDER PROGRAMMING
"Fixed Period Module", Page 3-99.

Interrupt factor occur

Output Input Output Input


Master routine
process process process process

Program Structure and Operation


Input
process Interrupt program

The interrupt routine is written between the END - ENDH instructions.


Within one project, one interrupt condition can be written for one interrupt routine.
Interrupt routine is programmable in any module.
The interrupt rounte is started by INT instruction, ended by RETI instruction.

Master routine

END
Module
INT R000

RETI
Interrupt program
INT CTC0

RETI
ENDH

Note
· Interrupt routines cannot be written in a macro.
· In order to execute interrupt routine, always use the EI instruction to set the interrupt
routine execution to "enable". (when operation starts, interrupt is in the "disable" mode.)
· If ithe nterrupt condition is an input relay, the HSP instruction or CR2305/CM1620 can be
used to set up a small input time constant to increase the response speed.
· Internal registers, operators (CR2009 to CR2012), TM0 to TM3, Z11 to Z12, R000 to
R015 will be eliminated automatically when interrupt routine starts, and restored when the
interrupt routine is completed.
· Some instructions cannot be used in the interrupt program.
Prohibited Instructions in the Interrupt Routine", Page 3-38
· For direct output(R500 to R507), please use the SET/RES instruction.

- KV-5000/3000 Series User’s Manual- 3-29


3-4 Program Structure and Operation

·There is no programming sequence restriction on subroutine and interrupt routine.


LADDER PROGRAMMING

Master routine

END
Module
SBN #1 RET Subroutine

3 INT R000 RETI Interrupt program


SBN #0 RET Subroutine
Program Structure and Operation

INT R001 RETI Interrupt program


ENDH

·Interrupt routine can be executed irrespective the module execution.


·Interrupt routine can be executed irrespective the module execution. If one standby module
is managed as the interrupt routine, the consistency of the project management will be
improved.

"3-5 Interrupt", Page 3-31

3-30 - KV-5000/3000 Series User’s Manual-


3-5 Interrupt

LADDER PROGRAMMING
Overview

Ordinary PLCs execute ladder sequential control by repeatedly executing Input Processing -> Program
Execution -> Output Processing. Therefore, signals shorter than scanning time cannot be input.
If the interrupt processing function is used, an interrupt can be performed irrespective the scanning time.
Once the interrupt condition is met, the master routine processing is terminated and the interrupt routine is executed.
After the interrupt processing is completed, the master routine processing continues from where it was broken.

Interrupt
Input processing

Input processing Direct input function


Scan time

Occur for interrupt


condition (R000 to R015)

Operation
Execute program
interrupt program

Return the next


command of interrupt
Direct output function

˄R500 to R507˅
Output processing

■ Type of Interrupt Condition


There are the following 4 kinds of interrupt condition:
· "External Input Interrupt", Page 3-34
· "High-Speed Counter Comparer Based Interrupt", Page 3-35
· "CPU Positioning Parameter Comparator 2 Interrupt", Page 3-35
· "Fixed Period Module", Page 3-99

■ About Device Processing


When an interrupt occurs, the device is processed as follows.
For the error information, see the "I/O Processing During Interrupt", Page 3-38.

Interrupt factor occur


(1)

Output Input Output Input


Main routine Program
processing processing processing processing

Input Interrupt program


(2) processing (output process)

(3)

- KV-5000/3000 Series User’s Manual - 3-31


3-5 Interrupt

(1) Processing at the interrupt start/end


LADDER PROGRAMMING

When an interrupt starts, the internal registers, R000 to R015, operation flags, TM0 to TM3, Z11 to Z12
index registers are stored in the system. When the interrupt routine ends, these values are restored.
During interrupt processing, the master routine will not be affected even if the about values are
changed. These changes are only effected in the interrupt routine.
The current value of high-speed counter (CTH) is changed to the value that is obtained through
interrupt processing after the interrupt routine is finished.
The values of other devices changed in interrupt process are mapped in the master routine after
interrupt routine is finished.
3 Note
· When fixed period module is the reason for interrupt, no saving/resetting is performed for
Interrupt

R000~R015
· To perform saving/resetting, the index registers Z1 to Z10 can be set up from the "Fixed
period execution and user interrupt" settings in the CPU System Settings.

(2) Input processing during execution of interrupt routine


In interrupt routine, the Device values are as follows:
· Current value of input relays R000 to R015, and high-speed counter (CTH): the value when interrupt
condition occurs.
· Other devices: the value when master routine is interrupted.

Note
When fixed period module is the reason for interrupt, R000 to R015 will also be
automatically updated. "Input processing", Page 3-38

(3)Execute output process of interrupt routine


Upon execution of the SET/RES interrupt instruction, the output relays R500 to R507 will output
immediately.
If a non SET/RES instruction is executed by other output relays or output relays R500 to R507, output
processing will be performed after the interrupt routine is completed.

Note
When fixed period module is the reason for interrupt and it is not assigned through DR,
direct output cannot be performed based on the SET/RES instruction.

"Output Processing", Page 3-39

To update the value of the non-auto update device to the latest status, perform the following:
·To program I/O relays through "DR".
·To program "RFSX/RFSY" instruction
·To program "RFSCTH" instruction
"About Direct Processing", Page 3-16

■ Processing Time
When all of the following conditions are met, the setting time prior to interrupt is within 65µs.
· When selecting the "Enable interrupt in instruction execution" checkbox in "Fixed period execute and
user interrupt" setting of CPU System Settings"
3-32 - KV-5000/3000 Series User’s Manual -
3-5 Interrupt

· No other interrupt routines with a priority higher than this interrupt are used

LADDER PROGRAMMING
· KL-N20V, KV-CL20, KV-DN20, KV-H20, KV-H20S, KV-H40S are not used (when used, maximum is 115µs)
· The FASC instruction (when used, maximum 102µs) is not To programed in the program
· RFASC instruction (when used, maximum 67µs) is not To programed in the program
In addition, the start/end processing (update/save/reset of the devices) time of interrupt routine is about
5µs respectively.

Execution Of interrupt routine


3
To perform interrupt routine, write the program in the following way.

Interrupt
Example for Interrupt program
CR2008
EI

HSP
R000
Main program
Can’t execute interrupt program when E1
instruction doesn’t execute.
END Set by setting the input time constant to
the HSP instruction (10μs) or the value
INT to CM01620 to set CR2305 ON.
R000

Interrupt program
ǂWrite interrupt program
RETI
ǂbetween “END” and “ENDH”

ENDH

"HSP", Page 3-46

■ Interrupt Enable (EI) Instruction


When the program starts, interrupt is disabled.
To execute interrupt routine, it is necessary to execute the interrupt enable (EI) instruction.
Please wirte the EI instruction in master routine.
·To disable interrupt, use the interrupt disable (DI/DIC) instruction.
· When interrupt disabled, the processing will not be interrupted even if interrupt occurs.
· The interrupt routine is started only ti is enabled.
"EI", Page 3-47
"DI", Page 3-47 ,"DIC", Page 3-48

■ INT/RETI Instruction
Between END/ENDH instructions, set the interrupt reason to operand, and To program the INT
instruction.
Behind the INT instruction, write the interrupt processing contents into the program, then To program the
RETI instruction.

Note
Only one INT instruction can be To programed for one interrupt reason.
· Some instructions cannot be used in the interrupt routine .
"Unavailable Instructions for Interrupt Routine", Page 3-37。
- KV-5000/3000 Series User’s Manual - 3-33
3-5 Interrupt

· In order to shorten the input time constant, it is necessry to set up input/output time
LADDER PROGRAMMING

constant through HSP instruction (10µs) or data memory CM1620, and start CR2305. For
input time constant, please refer to KV5000/3000/1000 Series PLC Instruction
Reference Manual
CR2008
EI
CR2008 #0 CR2305
EI DW SET or
CM1620 CR2002 HSP
R000

3 " INT"/RETIInstruction, Page 3-50


Interrupt

External Input Interrupt

Input relay is used as the interrupt condition. Execute interrupt through the input relays R000-R009.
Depending on the control relay, interrupting can be done either in the up edge or down edge.

■ External Input Interrupt Setting


Depending on the control relay, interrupting can be done either in the up edge or down edge. Interrupt
condition can changed in the follwing way:
Operation condition
Interrupt condition
INT instruction Control relay Up/down
Input relay Up edge Down edge
edge
CR2600 OFF ON OFF ON
INT R000 R000
CR2601 OFF OFF ON ON
CR2602 OFF ON OFF ON
INT R001 R001
CR2603 OFF OFF ON ON
CR2604 OFF ON OFF ON
INT R002 R002
CR2605 OFF OFF ON ON
CR2606 OFF ON OFF ON
INT R003 R003
CR2607 OFF OFF ON ON
CR2608 OFF ON OFF ON
INT R004 R004
CR2609 OFF OFF ON ON
CR2610 OFF ON OFF ON
INT R005 R005
CR2611 OFF OFF ON ON
CR2612 OFF ON OFF ON
INT R006 R006
CR2613 OFF OFF ON ON
CR2614 OFF ON OFF ON
INT R007 R002
CR2615 OFF OFF ON ON
CR2700 OFF ON OFF ON
INT R008 R008
CR2701 OFF OFF ON ON
CR2702 OFF ON OFF ON
INT R009 R009
CR2703 OFF OFF ON ON

Note
To specify the ON/OFF state of special auxiliary relays, use the SET/RES instruction.

3-34 - KV-5000/3000 Series User’s Manual -


3-5 Interrupt

■ Input Capturing

LADDER PROGRAMMING
In external input interrupt, INT R000 to INT R003 have the input capture capability, which is used for
capturing the current value of high-speed counter when interrupt occurs from the control memory. Even if this
function is not set up, the current value of high-speed counter will be transmited to CM1610 to CM1617
automatically when interrupt occurs.
For detail, please refer to "Input Capture", Page 3-41.

High-Speed Counter Comparer Based Interrupt


3
high-speed counter comparator is used as the interrupt condition. Interrupt processing is performed when the

Interrupt
current value of high-speed counter CTH is the same as the setting value for high-speed counter comparator
CTC.

INT Interrupt condition


Hi-speed counter Operation condition
instruction comparator
When the setting value for high-speed counter comparator CTC0 is
INT CTC0 CTC0
the same as the current value
When the setting value for high-speed counter comparator CTC1 is
INT CTC1 CTC1
the same as the current value
When the setting value for high-speed counter comparator CTC2 is
INT CTC2 CTC2
the same as the current value
When the setting value for high-speed counter comparator CTC3 is
INT CTC3 CTC3
the same as the current value
INT
* if exists CTCn , CTCn contact is not ON.(n: 0 to 3)

CPU Positioning Parameter Comparator 2 Interrupt

The CPU Positioning Parameter Comparator 2 is used as interrupt condition. In positioning/speed


control process, when number of output pulses (current value) is the same as the comparator 2 setting
value, interrupt processing is performed. Multi-section control can be enabled by changing the running
speed.
For detail, please refer to "Change speed during operation", Page 2-183.

INT Interrupt
condition Operation condition
instruction Comparator 2
When the setting value of the X-axis comparator 2 is the same as the
INT CR3013 (CR3013)
current value
When the setting value of the Y-axis comparator 2 is the same as the
INT CR3113 (CR3113)
current value

CR3013/CR3113 are not Physical ON or OFF, and only used for ladder lablels for KV
STUDIO.

- KV-5000/3000 Series User’s Manual - 3-35


3-5 Interrupt
LADDER PROGRAMMING

Interrupt Priority

This setting is required when multiple interrupt conditions exist.


From the KV STUDIO work space, select "CPU System Settings" , then select "Setup program " and
"Fiexed period execution and user interrupt" settings.

3
Interrupt

Priority can be set as per "High/Middle/Low". Interrupts with a higher priority are considered and those
with a lower priority are not be considered.
In addition, after the "Enable interrupt in instruction execution" check box is selected, interrupt response
time fluctuation can be suppressed by interrupting instructions with a long processing time halfway.
Suppose the priority of Interrupt Routine A is set up as "Middle", only interrupt routines with a prioirty of
"High" can interrupt this interrupt routine, whereas those with a prioirty of "Low" or "Middle" cannot.
In addition, while interrupt routines with a "Low" priority can interrupt other interrupt routines except
those with a "High" or "Middle" priority.

3-36 - KV-5000/3000 Series User’s Manual -


3-5 Interrupt

LADDER PROGRAMMING
Unavailable Instructions for Interrupt Routine

Instruction type Instruction


Common @XXXX instruction Differential execution type
LDP/LDF Load pulse / load pulse fall
ANP/ANF AND pulse / AND pulse fall
ORP/ORF OR pulse / OR pulse fall
Contact Instructions
LDPB/LDFB Pulse bar/Pulse fall bar
ANPB/ANFB AND pulse bar /AND pulse fall bar
ORPB/ORFB OR pulse bar /OR pulse fall bar 3
DIFU/DIFD Differential up / Differential down

Interrupt
Basic Instructions

ONDL/OFDL ON delay/OFF delay


Output instructions SHOT One shot
FLIK Flicker
ALT Alternate
TMR/TMH/TMS Timer/High-speed timer / 1ms high-speed timer
C Counter
Timer/counter OUTC Out counter
instructions ITVL Interval timer
UDC Up/down counter
UDT Up/down timer
Connection/end
MEP/MEF MEP/MEF
Instruction
Applied Instructions

Shift Instruction SFR Shift


STG/JMP/ENDS Stage/Jump/End stage
Control block
W-ON/W-OFF Wait ON/Wait OFF
processing instructions
W-UE/W-DE Wait up edge/wait down edge

File register instructions FRSTM/FRLDM File register all saving/Batch read file register

Data processing
HKEY Hex key input
instructions
Cam switch
ABSENC/INCENC Abstract encoder / incremental encoder
instructions
Extended Instructions

Frequency counter
FCNT/RCNT Measure frequency / Measure speed
instructions
PID instructions PID PID Control
MWRIT/MREAD/ Memory Card write/Memory Card read/Get Memory
Memory card MFREE/MMKDIR Card free space/Memory card folder is made
instructions Memory card folder is deleted/Deletion of memory card
MRMDIR/MDEL
files
Access window
AWNUM/AWMSG Display user message 1/Display user message 2
instructions

- KV-5000/3000 Series User’s Manual - 3-37


3-5 Interrupt
LADDER PROGRAMMING

I/O Processing During Interrupt

■ Input processing
The input relay (R000 to R015) status is captured when the interrupt routine is initiated. For other
cases, the stauts captured during scanning input processing (I/O update) will be retained, even when
interrupt routine is executed.
The initially captured input relay (R000 to R015) status is valid only in interrupt routine process. After
interrupt processing is finished, the status captured in scanning input processing (auto updating) will be
3 used in the master routine.
Interrupt

Example
Interrupt factor occur

ON

R000
OFF
ON

R001
OFF
ON

R30000
OFF

R001:OFF R001:ON
R30000:OFF R30000:ON

Output Input Output Input


Mail routine Program
process process process process

Input
Interrupt program
process

R001:ON
R30000:OFF

R001 R001 R001 R001

OFF ON OFF ON

R30000 R30000 R30000 R30000

OFF OFF OFF ON

When the above interrupt routine is executed:


(1) input processing of master routine ->R001:OFF R30000:OFF
(2) input processing of interrupt routine ->R001:ON R30000:OFF
Since input relay R001 is direct input, the interrupt routine execution status cannot be captured.
Input relay R30000 can be processed through the master routine input processing even if it is in the
interrupt routine process.
Direct input is effective only in the interrupt routine.
In master routine, R001 is always in the OFF state, no matter this is executed before or after the routine.
R001 will be ON only in the interrupt routine.

Note
When fixed period module is the interrupt reason, R000 to R015 related input
processing cannot be executed.

3-38 - KV-5000/3000 Series User’s Manual -


3-5 Interrupt

Ladder program example

LADDER PROGRAMMING
;(mnemonics list)
CR2002 LD CR2002
EI Enable interrupt when power is ON.
EI
CR2002 HSP LD CR2002
R000 The input time constant of input relays R000 HSP R000
and R005 is set to 10 μs. HSP R005
HSP LD R1000
R005
OUT R500
R1000 R500 END
Output relay R500 is turned ON by internal INT R000
auxiliary relay R1000 from interrupt processing. LD R1000
END
SET R1000

INT
R000
Execute interrupt program when input
relay R000 is ON.
RETI
ENDH 3
When R005 turns ON during interrupt

Interrupt
R005 R1000
SET processing, relay R1000 is turned ON.
RETI
* Input information obtained by direct input
ENDH is valid only during the interrupt program,
and must be made to via the internal auxiliary relays.

■ Output Processing
An interrupt routine has no output processing. After interrupt routine is finished, the output processing
of master routine (auto updating) is used for output.
However, output (direct output) can be enabled immediately after the routine is executed only after
output relays (R500 to R507) are programmed in the SET and RES instructions.

Example R501:Output
R30500:Output

Output Input Output Input


Mail routine Program
process process process process

Input
(1) (2) (3) (4)
process

R500:Output R502:Output

CR2002 R500
(1) SET

CR2002 R501
(2)

CR2002 R502
(3) SET

CR2002 R30500
(4) SET

When the above interrupt routine is executed:


· Rung (1), when the output relay R500 is a direct output relay, output can be enabled directly.
· Rung (2), when the output relay R501 is a direct output relay and the OUT instruction is used for
programming, the master routine output processing is used for output.

- KV-5000/3000 Series User’s Manual - 3-39


3-5 Interrupt

· Rung (3), when the output relay R500 is a direct output relay, output can be enabled directly.
LADDER PROGRAMMING

· Rung (4), since output relay R30500 is energized via internal processor hense not a direct output
relay, the output processing of master routine is then used for output.

Note
· In interrupt routine, direct output is possible only when the SET/RES instruction is
used. However, please use SET/RES instruction to directly specify the device
output source.
· Even if in an interrupt process, direct ouput cannot be enabled in the following

3 cases. In these cases, output is enabled through output processing in scanning.


· (1) when instructions other than SET/RES instruction are used to specify an
Interrupt

output source.
· (2) other relays than R500 to R507 are used as well as indirect specifying or
index modification are used to specify the SET/RES instruction device.
· (3) a macro is called during interrupt process or the SET/RES instruction is
executed in subroutine.
· When fixed period module is the interrupt reason, the SET/RES instruction-based
R500 to R507 output processing cannot be performed.

Ladder program example


CR2002
EI Interrupt is enabled at power ON. ;(mnemonics list)
CR2002
LD CR2002
HSP
R000 The input time constant of input relays R000 EI
LD CR2002
HSP and R001 is set to 10 μs. HSP R000
R001 HSP R001
END
END
INT R000
LD CR2002
INT SET R500
R000 The interrupt program is executed when
RETI
CR2002 R500
input relay R000 is turned ON. INT R001
SET Direct output relay R500 is turned ON. LD CR2002
SET R501
RETI RETI
ENDH
INT
R001 The interrupt program is executed when
CR2002 R501
input relay R001 is turned ON.
SET Direct output relay R501 is turned ON.
RETI

ENDH

To update the status of non-auto updated devices, please do the following:


·Program the I/O relay through "DR".
·Program the "RFSX/RFSY" instruction.
·Program the "RFSCTH" instruction.
"About Direct Processing", Page 3-16

3-40 - KV-5000/3000 Series User’s Manual -


3-5 Interrupt

LADDER PROGRAMMING
Input Capture

With the input capture feature, current value of high-speed counter in data memory can be captured
when an interrupt condition takes place. This feature is initiated when the interrupt condition is an
external input (only R000 to R003 can be used). No settings are required for this.
The captured value is stored in the control memories CM1610 to CM1617.
Interrupt condition Capture current value Destination storage address
(external input) of high-speed counter High bit Low bit
When INT R000 occur CTH0 CM1611 CM1610 3
When INT R001 occur CTH0 CM1613 CM1612

Interrupt
When INT R002 occur CTH1 CM1615 CM1614
When INT R003 occur CTH1 CM1617 CM1616

Note
The timing for input capture execution is connected to specified interrupt polarity (up
edge/down edge) through CR2600 to CR2607.

■ The difference of current value of high-speed counter between input capture


and interrupt routine execution
· Input capture
... The instant value when the interrupt condition occurs.
· Current value of high-speed counter in interrupt routine process
... In interrupt routine process, the LDA and MOV instructions are used to acquire current value of
high-speed counter through input processing of interrupt routine.
In the following conditions, the captured values are different.

Interrupt factor occur


˄External input˅ Execute E1 command
Time
difference

Scan Interrupt disable in progress Interrupt enable in progress

High-speed counter
CTH0 current value࡮࡮࡮10 11 12 ࡮࡮࡮࡮ 99 100 101 ࡮࡮࡮࡮࡮࡮࡮࡮ 999 1000 1001

Input capture function Interrupt program


Input CTH0
LDA STA
process

(1) (2)
100 1000

(1) Since the instantaneous value in interrupt condition occurrence is collected by Input Capture, the
current value of high-speed counter CTH0 is then #100.
(2) Since the value collected through interrupt routine is the value captured in input processing of
interrupt routine, the current value of high-speed counter CTH0 is then #1000.
As mentioned above, if time elapsed exists in the process from interrupt condition occurrence to
interrupt routine execution, then the captured current value of high-speed counter will also be different.

Current value of high-speed counter (CTH) is the value obtained through input processing of
interrupt routine after interrupt routine is finished.
- KV-5000/3000 Series User’s Manual - 3-41
3-5 Interrupt
LADDER PROGRAMMING

Sample Program

■ The application of interrupt routine in a signal converter


In this example, the interrupt function is used to convert mini pulse into fixed width pulse before output.
· The mini pulses input through input relay R000 are converted to pulses with an ON width of 1s from
output relay R500 onwards.
· The output relay R500 is ON within 1 s after the up edge input relay R000 is ON.

3 Scan
ON

Input relay R000


Interrupt

OFF

ON

Output relay R500 ON ON ON


OFF
1V 1V 1V

CR2008
EI Enable interrupt when ;(mnemonics list)
LD CR2008
power is ON
EI
CR2002 HSP LD CR2002
R000 Constants is set to 10μs when HSP R000
input relay R000 is ON LD R500
R500 #10 T0 R500 TMR @0 #10
T0 RES CON
To set output relay R500 to AND TO
ON only for 1s RES R500
END END
INT R000
LD CR2002
INT SET R500
R000 Output relay R500 is set to RETI
ENDH
ON when input relay R000
CR2002 R500 is ON.
SET

RETI

ENDH

3-42 - KV-5000/3000 Series User’s Manual -


3-5 Interrupt

■ Example: the application of interrupt in high-speed counters

LADDER PROGRAMMING
The input value of high-speed counter and ON/OFF of input relay is
used to control ON/OFF of output relay R500.

· When the Input value of high-speed counter is changed to #10000,


output relay R500 turns to ON.
· If input relay R000 ON, then output relay R500 OFF.

3
Scan

Interrupt
ON

Input relayR010
OFF

ON

Input relayR000
OFF

ON

Output relayR500 ON
OFF

Interruption is enabled when ;(mnemonics list)


CR2008 CR2103 CTH0
powering ON and set LD CR2008
EI SET RES
EI
high-speed counter CTH0 to CON
CR2002 HSP "Auto-reset" and reset it. SET R1000
R010 CON
RES CTH0
Constants is set to 10μs when LD CR2002
CR2002 CTH.D0
HSP R001
R010
input relay R010 is ON LD CR2002
CTH.D #0 R010
#10000 CTC.D #0 #10000
CTC.D0 High-speed counter of input LD R000
RES R500
relay R010 is set to CTH0 and END
R000 R500 INT CTC0
setting value is set to #1000
RES LD CR2002
SET R500
END Output relay R500 is set to RETI
ENDH
ON when input relay R000 is
OFF
INT
CTC0

CR2002 R500
When high-speed CTC0 is
SET
#10000, interrupt program is
RETI executed and outpit relay
R500 is set to ON.

ENDH

- KV-5000/3000 Series User’s Manual - 3-43


3-5 Interrupt

■ Example: the application in measuring high-speed pulse ON width


LADDER PROGRAMMING

Measure the pulse width of input relay.


ON

Input relay R000


OFF

Pulse width

· Use the control relay CR2100 to measure pulse width with


1µs as the unit.
· Save the input capture value "CM1610/CM1611" when input relay R000 is ON into data memory "DM10/
3 DM11".
Subtract the value of "DM10/DM11" from input capture value when R000 is in OFF. This value is the pulse
Interrupt

width.
· The measured value is stored in data memory "DM0/DM1" (unit µs).
;(mnemonics list)
CR2008 Interrupt is enabled at power
LD CR2008
EI ON.
EI
LD CR2002
CR2002 HSP The input time constant of HSP R000
R000 input relay R00000 is set to 10 LD CR2002
μs. CTH.D #0 CR2100
END
CR2002 CTH.D 0 The 1μs internal clock is counted INT R000
CR2100 by high-speed counter CTH0. LDB CR2601
LDA.D CM1610
END CON
Interrupts are executed by input STA.D DM10
relay R000. CON
First of all, the interrupt polarity is LDB CR2601
INT changed to the down edge by LDA.D CM1610
R000 executing the interrupt at the up CON
edge of R000, storing the current SUB.D DM10
value [CM1610/CM1611] of CTH0 at CON
CR2601 CM1610 DM10 KEEP that time to [DM10·DM11], and
LDA.D STA.D SET STA.D DM0
turning CR2601 ON. CON
CR2601 Next, the pulse width of R000 is KEEP CR2601
CR2601 CM1610 DM10 DM0 calculated by executing the interrupt RETI
LDA.D SUB.D STA.D RES at the down edge of R000, and ENDH
decrementing [DM10/DM11] at the
up edge from the current value
RETI [CM1610/CM1611] of CTH0 at that
time. The result is stored to
[DM0/DM1].
ENDH Finally, CR2601 is turned OFF to
change the interrupt polarity to the
up edge.

3-44 - KV-5000/3000 Series User’s Manual -


3-5 Interrupt

■ Example: the application in determining elapsed time between two points

LADDER PROGRAMMING
Determine elapsed time between two input relays.
Sensor 1 ON

Input relay R002


OFF Sensor 1
Sensor 2 ON

Input relay R003 Sensor 2


OFF
Lapse Time μs˅

· Determine elapsed time between input relay R002 and input relay R003.
· Save the determined value in data memory "DM0/DM1", taking 1µs as unit. 3
Interrupt enable at power

Interrupt
CR2008 CR2604 CR2605 CR2606 CR2607 ON and the interrupt polarity
EI RES RES RES RES ;(mnemonics list)
of input relays R002 and LD CR2002
R003 are set to the up edge. EI
CR2002 HSP CON
R002 The input time constant of RES CR2604
R002 is set to 10μs. CON
HSP RES CR2605
The input time constant of CON
R003
R003 is set to 10μs. RES CR2606
CON
CR2002 CTH.D1 The 1μs internal clock is RES CR2607
CR2200 counted by high-speed LD CR2002
counter CTH1. HSP R000
HSP R003
END LD CR2002
CTH.D #1 CR2200
END
INT When INT002 is executed, INT R002
R002 the current value of CTH1 is RETI
automatically stored (by INT R003
LD CR2002
RETI input capture) to LDA.D CM1616
[CM1614/CM1615]. CON
SUB.D DM1614
INT CON
R003 When INT003 is executed, STA.D DM0
the current value of CTH1 is RETI
automatically stored (by ENDH
CR2002 CM1616 CM1614 DM0
LDA.D SUB.D STA.D input capture) to
[CM01616/CM01617].
RETI The pass time between two
points is calculated by
subtracting the input capture
ENDH value of INT002 from the
input capture of INT003.
The result is stored to
[DM0/DM1].

Interrupt Processing Instructions

Instruction mnemonics Instruction description Page


Reduce time constant of input relay, improve input response
High-speed HSP 3-46
characteristic.
Interrupt disable DI Disable execution of interrupt routines. 3-47
Interrupt disable EI Enable execution of interrupt routines. 3-47
Interrupt disable
DIC Set up interrupt disable range. 3-48
range
Interrupt INT interrupt routine before executing RETI instruction. 3-50
Interrupt return RETI Indicates the end of the interrupt routine. 3-50

- KV-5000/3000 Series User’s Manual - 3-45


3-5 Interrupt
LADDER PROGRAMMING

HSP HSP high-speed


HSP
Input time constant of input relay,
improve input response characteristic.

Ladder program Input mode


Execute condition HSP
D H S P D

Available Devices
Index
Cons Indirect Local Change
3 Operand
Bit device Word Devices tant specifying device
MR DM EM
R DR LR T C CTC CR FM ZF T C CTH CTC Z CM #/$ #TM * @ : #/: Z
Interrupt

B TM W
D ○ - - - - - - - - - - - - - - - - - -

Operand Explanation
D Designate relay device No.That reduces input time constant.*1

*1 Available relay are R000 to R015.

Description of Operation

When the execution condition is ON, specify the input time constant of the device in D to 10μs.
When the INT and CTH instructions are used, setting is required.

Note
When input time constant of control relay CR2305 is the same as input time constant of
HSP instruction, the HSP instruction will prevail.

· For CPU unit input time constant change, please refer to "2-7 I/O", Page 2-83.
· Input time constant of expansion input unit can be set using KV STUDIO unit editor. For change,
Please refer to KV STUDIO User's Manual, "Chapter 3 Unit Editor ".

Operation Flag

No change for operation flags.

Example

Set the input time constant of input relay R000 to 10µs.

CR2002 HSP ;(mnemonics list)


R000 LD CR2002
HSP R000

3-46 - KV-5000/3000 Series User’s Manual -


3-5 Interrupt

LADDER PROGRAMMING
DI DI
Interrupt
disable
Disable interrupt routine and fixed
period module execution.

EI EI
Interrupt
enable
Enable interrupt routine and fixed period
module execution.

Ladder program Input mode


Execute condition
EI E I

Execute condition
DI D I
3

Interrupt
Available Devices Index
Cons Indirect Local Modific
Bit device Word Devices tant specifying device ation
Operand
MR DM EM
R DR LR T C CTC CR FM ZF T C CTH CTC Z CM #/$ #TM * @ : #/: Z
B TM W
- - - - - - - - - - - - - - - - - - - -

Description of Operation

DI When execution condition is ON, interrupt routine and fixed period module are disabled.
This instruction is used for temporary interrupt disable .
EI When execution condition is ON, interrupt routine and fixed period module are not disabled.
the interrupt routine that are disabled via DI instruction will be enabled.
· Once EI instruction is executed, interrupt routine execution can be enabled before executing DI
instruction.
· When the program starts, interrupt is disabled.
· If interrupt is initiated in execution of DI instruction (interrupt disable), up to 16 subprograms can be nested.
While EI instruction is executed, the stored interrupt routine is executed.
To be initiated, the interrupt routine should be in enable (EI) state. In order to execute further interrupt
routines during the execution of an interrupt routine, the priority of these interrupts should be higher
than the interrupt routine in execution. To specify priority, select "CPU system setting" -> "Fixed period
execution and user interrupt" settings. Up to three levels of interrupting can be specified.

Operation Flag

No change for operation flags.

Example

When input relay R000 is ON, the interrupt routine is enabled.


When R000 is OFF, the interrupt routine is enabled.

R000 ;(mnemonics list)


DI LD R000
DI
LD R000
R000 EI
EI

- KV-5000/3000 Series User’s Manual - 3-47


3-5 Interrupt
LADDER PROGRAMMING

DIC DIC
Interrupt disable
range
Set up interrupt disable range.

Ladder program Input mode


Execute condition D
DIC D I C D

Interrupt disable range

3 EI

Available Devices
Interrupt

Index
Bit device Word Devices Cons Indirect Local Change
tant specifying device
Operand
MR DM EM
R DR LR T C CTC CR FM ZF T C CTH CTC Z CM #/$ #TM * @ : #/: Z
B TM W
D ○ - ○ ○ ○ - ○ ○ - - - - - ○ - - ○ ○ ○

Operand Explanation
D Specifythe bit device that outputs interrupt disable/enable state.*1
*1 If the word device is specified with the lowest bit, then other bits keep unchanged.

Description of Operation

DIC This is used in combination with the EI instruction.


If execution condition is ON, the interrupt processing between DIC and EI instructions is disnabled.
The enable/disnable status is stored in D before DIC instruction is executed.
If the interrupt status is "Enabled" before DIC instruction is executed, then D is set; if
"Disnabled", then reset.

Disable interrupt status Enable interrupt status

CR2002 D CR2002 D
DIC DIC

Normally disable Normally disable

D D
EI EI

OFF ON
Disable interrupt status Enable interrupt status

Interrupt factor occur

Output Input Output Input


Interrupt disable range
process process process process

Input
Interrupt program
process

3-48 - KV-5000/3000 Series User’s Manual -


3-5 Interrupt

Operation Flag

LADDER PROGRAMMING
CR2009 No change in status
CR2010 No change in status
CR2011 No change in status
It is ON when indirect specifying or index modification range is incorrect. Otherwise, OFF.
CR2012
If indirect specifying and index modification are not specified for operand, it is not changed.
* If CR2012 is ON, the instruction will be not executed.
If CR2012 is ON, the detail information of error is stored in CM5100 to CM5176.
"Error Log (CM)", Page 3-20 3

Interrupt
Example

Interrupt is disnabled in operation processing. After DIC instruction execution, the interrupt processing
state is returned to the state before DIC instruction is executed.

CR2002 ;(mnemonics list)


DI Disable interrupt process LD CR2002
DI
LD CR2002
CR2002 DM0 DM10 DM100 LDA DM0
DM0+DM10→DM100
LDA ADD STA CON
ADD DM10
R1000 CON
EI Enable interrupt process STA DM100
LD R1000
EI

- KV-5000/3000 Series User’s Manual - 3-49


3-5 Interrupt
LADDER PROGRAMMING

INT INT
Interrupt
Execute the interrupt routine in front of RETI
at up edge or down edge of operand.

RETI RETI Interrupt


return
Indicates the end of the interrupt routine.

Ladder program Input mode


INT
S I N T S
(I S )

3 Interrupt program

RETI
Interrupt

R E T I
(I R E T )

Available Devices
Index
Cons Indirect Local Change
Bit device Word Devices
Operand tant specifying device
MR DM EM
R DR LR T C CTC CR FM ZF T C CTH CTC Z CM #/$ #TM * @ : #/: Z
B TM W
S ○ - - - - ○ ○ - - - - - - - - - - - -

Operand Explanation
S Specify the bit device.*1
*1 Only R000 to R009,CTC0 to CTC3,CR3013,CR3113 can be specified.

Description of Operation

INT Specify the start of interrupt routine.


RETI Specify the end of interrupt routine.

Note
Internal register, index register, operation flag, R000 to R015, TM0 to TM3 are stored
automatically when interrupt routine starts. Each stored value is returned when interrupt
routine is finished. In default settings state, only Z11, Z12 index registers execute save/reset
processing. Z0 to Z10 index registers can be set to execute save/reset processing in "CPU
system settings" -> "Fixed period execution and user interrupt" settings.

Operation Flag

CR2009 No change in status


CR2010 No change in status
CR2011 No change in status
CR2012 No change in status

3-50 - KV-5000/3000 Series User’s Manual -


3-5 Interrupt

LADDER PROGRAMMING
Instruction Execution Timing

The instruction is executed at the up or down edge of operand.

Scan

Interrupt factor occur Interrupt factor occur


Interrupt condition

INT, RETI → ← Execution → ← Execution

Interrupt
Example

CR2002 ;(mnemonics list)


EI LD CR2002
EI
END END
INT R000
LD CR2002
INT
R000 SET R500
RETI
CR2002 R500 ENDH
SET
RETI

ENDH

- KV-5000/3000 Series User’s Manual - 3-51


3-6 Device and Constant
The so-called device refers to such KV-5000/3000 PLC elements such as relays, timers/counters, data
LADDER PROGRAMMING

memories used in the program. During programming, devices are programmed behind the instruction,
which are used to assign data used in instructions and store instruction execution results.

Device List

■ Bit device
When Indirect
3 Device name Range *1
Number of
Main Functions
operation
starts
Local Index
device( modification
specifying(*)*9

points
@)*1
Device and Constant

(Power ON, (:Z/:#) Lookup Store


PROG->RUN)
To acquie ON/OFF
R000 to R015
Input relay*11 info from peripheral - ○ ○ ○ ×
R1000 to R99915) I/O
equipment
Internal
To output ON/OFF
R500 to R507 auxiliary
Output relay*1 info from peripheral Clear/hold*4 ○ ○ ○ ×
R1000 to R99915) relay total
equipment
15936 points
Internal R508 to R915*2 Used in CPU and
Clear/hold*4 ○ ○ ○ ×
auxiliary relay R1000 to R99915) expansion unit
Link relay B00 to B3FFF*10 16384 points Clear/hold*4 × ○ ○ ×
Internal
MR000 to MR99915 16000 points Used only in CPU Clear ○ ○ ○ ×
auxiliary relay
Latch relay LR000 to LR99915 16000 points Hold ○ ○ ○ ×
Contact device for
1ms, 10ms, 100ms
Timer (contact) T0 to T3999 4000 points down counter, Clear ○ ○ ○ ×
10ms up/down
counter
Contact device for
Counter
C0 to C3999 4000 points up counter, up/ Clear/hold*8 ○ ○ ○ ×
(contact)
down counter
High-speed
Used for high-
counter
CTC0 to CTC3 4 points speed counter Clear/hold*8 × × × ×
Comparator
(Contact)
Used to control PLC
Control relay CR000 to CR3915 640 points function or acquire Hold × × × ×
equipment state

Some input, output and internal auxiliary relays can be used for interrupt and high-speed counter.
"Input/output/internal auxiliary relay", Page 3-55

3-52 - KV-5000/3000 Series User’s Manual-


3-6 Device and Constant

■ Word Devices

LADDER PROGRAMMING
When Indirect
Index
operation Local specifying(*)*9
Number of modific
Device name Range *1 Main Functions starts device(
points *1 ation
(Power ON, @) Lookup Store
(:Z/:#)
PROG ->RUN)
Data Memory DM0 to DM65534 65535 points Clear/hold*4 ○ ○ ○ ○
Extended data *4
EM0 to EM65534 65535 points Clear/hold ○ ○ ○ ○
Memory
Usedfor storing

File register
Consecutive number mode:
ZF0 to ZF131071
131072 points numerical data (16-
bit) Hold
×
○ ○ ○
3
Current bank: (32768×4

Device and Constant


○ *12
FM0 to FM32767 srore) piont
Link register W0 to W3FFF*10 16384 points Clear/hold*4 × ○ ○ ○
Temporary Data Usedfor storing
TM0 to TM511 512 points Clear ○ ○ ○ ○
Memory numerical data (16-bit)
Current value/setting
Current value:
Timer value of 1ms, 10ms,
Clear*6
(Current value/ T0 to T3999 4000 points 100ms down counter, ○ ○ ○ ×
Setting value:
setting value) 10ms up/down
hold
counter (32-bit)
Current value/
Counter
setting value (32-
(Current value/ C0 to C3999 4000 points Clear/hold*8 ○ ○ ○ ×
bit) of up counter/
setting value)
up/down counter
High-speed
High-speed counter
counter CTH0 to CTH1 2 points Clear/hold*8 × × × ×
current value (32-bit)
(current value)
High-speed
counter High-speed counter
CTC0 to CTC3 4 points Clear/hold*4 × × × ×
Comparator setting value (32-bit)
(setting value)
Used for index
Index register Z1 to Z12*7 12 points Clear × × × ×
modification (32-bit)
Used to control PLC
Control
CM0 to CM5999 6000 points function or acquire Hold × × × ×
memory
equipment state (16-bit)
*1 When used as local device, the applicable range of global device is limited by the number of local
devices reserved.
"Local Device List", Page 3-132
*2 R100 to R415/R508 to R915 are reserved for the system, and cannot be used.
*3 R1000 to R99915 can be set to expansion I/O relay with Unit Editor (Unit Monitor).
*4 "Power-off hold function" in CPU system setting enables to set "clear/hold".
*5 "A-2 CR/CMlist", Page A-7
*6 Up/down counters (UDT) hold the current value.
*7 Z11/Z12 is reserved for the system, and cannot be used.
*8 "Power-off hold function" in CPU system setting enables to set "clear/hold". (only for contacts, current value)
*9 "store" is the device that can be described as "*(device)". "Lookup" is the device that can bespecified indirectly.
"Indirect Specifying", Page 3-75
*10 Device No. is specified with HEX number.
*11 "DR" is the lable for direct processing. When the label is "DR", local devices cannot use indirect specifying.
"About Direct Processing", Page 3-16
*12 Local device cannot perform bank switching.

- KV-5000/3000 Series User’s Manual- 3-53


3-6 Device and Constant

● Index Modification Programming (through index register and index constant modification)
LADDER PROGRAMMING

Addressing with the index register.


Entered behind the (R(DR)/MR/LR/B/T/C/DM/EM/FM/ZF/W/TM/*DM/*W/*EM/*FM/*ZF/*TM) devices:
Z□(□ : 1 to10 ).

Example
D00: Z01 (if Z1 value is 100,then DM100)
D1000: Z01 (if Z1 value is 100,then R1604)

3 Addressing with the index constant


Entered behind the (R(DR)/MR/LR/B/T/C/DM/EM/FM/ZF/W/TM/*DM/*W/*EM/*FM/*ZF/*TM) devices: Z
□(□ : -131072 to +131072 ).
Device and Constant

Example
DM0:#1 (means DM1)
R1000:#1 (means R1001)

● Indirect specifying programming(*)


Input "*" before device (DM/W/EM/FM /ZF /TM).This can beused together with indirect specifying instruction.

Example
*DM0 *TM100
"Indirect Specifying", Page 3-75

● Local device programming


Input "@" before the device (R/MR/LR/T/C/DM/EM/FM/TM).
These devices are effective only in modules and macros. This is for indirect specifying or index modification.

Example
@DM0 @R10000

"3-10 Local Device", Page 3-131

● About XYM Marking


The follwoing XYM marks can be used to specify the devices (R ( DR )/MR/LR/DM/EM/FM).
KEYENCE
Device name XYM mark XYM marking -based device No.
mark
X(DX) 0000 to 999F
Relay R(DR)
Y(DY) 0000 to 999F
Internal auxiliary relay MR M 00000 to15999
Latch relay LR L 00000 to15999
Data Memory DM D 00000 to 65534
extended data memory EM E 00000 to 65534
File register FM F 00000 to 32767
When set to XYM mark, select "Tool" -> "Options" from KV STUDIO menu, select "use XYM mark"
check box in "display mode settings".

3-54 - KV-5000/3000 Series User’s Manual-


3-6 Device and Constant

● Input/output/internal auxiliary relay

LADDER PROGRAMMING
Common High speed
Device No.
use Interrupt*1 High-speed counter*1 Positioning*1
Interrupt input
R000 -
INT R000
Interrupt input
R001 -
INT R001
Stop/Origin sensor input
Interrupt input
R001 -
INT R002

R001
Interrupt input
INT R003
- 3
Interrupt input

Device and Constant


R004 - X axis limit switch CW
INT R004
Interrupt input
R005 - Y axis limit switch CW
INT R005
Input relay
Interrupt input
R006 (direct input - X axis limit switch CCW
INT R006
area)
Interrupt input
R007 - Y axis limit switch CCW
INT R007
Interrupt input High-speed counter 0
R008 -
INT R008 Enable input
Interrupt input High-speed counter 1
R009 -
INT R009 Enable input
R010 - High-speed counter 0 A phase -
R011 - High-speed counter 1 A phase -
R012 - High-speed counter 0 B phase -
R013 - High-speed counter 1 B phase -
R014 - High-speed counter 0 Z phase X axis, Z phase
R015 - High-speed counter 1 Z phase Y axis, Z phase
R00000 to R415 Reserved for system
High-speed counter 0
R500 - X axis CW
comparator matching output
High-speed counter 1
R501 - X axis CCW
comparator matching output
R502 - - Y axis CW
Output relay
R503 - - Y axis CCW
(direct
(High-speed counter 0
R504 output area) - -
comparator matching output)
(High-speed counter 1
R505 - -
comparator matching output)
R506 - - Clear X axis deviation counter
R507 - - Clear Y axis deviation counter
R508 to R915 Reserved for system
R1000 to R59915 I/O relay/internal auxiliary relay
MR000 to MR99915 Internal auxiliary relay
LR000 to LR99915 Latch relay

- KV-5000/3000 Series User’s Manual- 3-55


3-6 Device and Constant

■ Macro argument device


LADDER PROGRAMMING

Macro argument devices that can beused only in the macro is as follows.
Indirect Local
Sym Index
Attribute Range Description specifyi device(
bol modify(:)
ng(*) @)
The device is used as an
Device P P0 to P9 × × ○
argument for processing
The device value or constant is

3 Value V V0 to V9 used as an argument for


processing
× × ×

Leadi The leading replay assigned to


Device and Constant

UR UR0 to UR9 × × ○
ng R in expansion unit as argument
Process the initial data memory
Leadi
assignd in expansion unit is
ng UM UM0 to UM9 × × ○
Unit used as an argument for
DM
processing
the code number of expansion
No. UV UV0 to UV9 unit as argument is used as an × × ×
argument for processing

"Setting Argument", Page 3-117

■ Constant
Constant Range Main Functions
#0 to #65535/non-signed 16 bit
Used for specifying DEC number.
-32768 to +32767(signed 16 bit)
DEC(#) It will display "K" when
#0 to #4294967295/non-signed 32 bit
set it XYM display mode.
-2147483648 to +2147483647 signed 32 bit
-3.4E38<=N<=-1.4E-45
Single-precision
N=0 Used for specifying floating-point
floating-point
+1.4E-45<=N<=+3.4E38 constant.
number
"Significant bits is 7 bit"
Used for specifying HEX
$0000 to $FFFF(16 bit) constants.
HEX($)
$00000000 to $FFFFFFFF(32 bit) "H" is displayed when
XYM is selected.
Fixed string ("") (Example) "model number ABC", "month/08:30:15" Used for specifying fixed string.

■ Internal register
When operated
Number of
Device name Range Main Functions (Power ON,
points
PROG->RUN)
For temporary data storage
Internal register - 1 point Clear
(16 bit, 32 bit)

3-56 - KV-5000/3000 Series User’s Manual-


3-6 Device and Constant

LADDER PROGRAMMING
Set Power Failure Holding (latching)

Power-off Hold means that the device values are retained when the power is cut off.
To select option, open the "CPU system settings" from KV STUDIO workspace, and select "System
settings" -> "Set Power Failure Holding".

Select type of device.


3

Device and Constant


Select save/clear within
each device range.

Bit Device

I/O Relay R

Overview Input relay is the device that collects ON/OFF information from peripherals into PLC.
Output relay is the device that sends ON/OFF instructions or arithmetic operation results
from PLC to peripherals.

Denotation Device number composition is as follows.


Example)
Channel No. Contact No.
(000 to 999) (00 to 15)

R00012
Device nameDevice No. (00000 to 99915)

·The letter R can be omitted in programming. (for constant operands, however, R cannot be
omitted in programming.)
·Zero suppression in programming.
(Example)R12
·Can be used as word device.
"The word unit processing for bit device", Page 3-80
·Can be used as direct I/O relay by adding "D" in the device name.
(Example) DR500,,, R500 will act as a direct output relay
"Direct I/O Relay (DR)", Page 3-16
·When XYM Marking is selected, input devices are designated as "X" and output relays as "Y".
"About XYM Marking", Page 3-54

- KV-5000/3000 Series User’s Manual- 3-57


3-6 Device and Constant

Range ·R000 to R015 (input only)


LADDER PROGRAMMING

·R500 to R507 (output only)


·R1000 to R99915 (for extended I/O units)

Application Input relay


·Used for peripherals connection, including buttons and switches (for example, selector
switches, limit switches, photoelectric switches, digital switches) etc.
·Input relays can beused as high speed input for interrupts, high-speed counters, positioning
function etc.(only for R000 to R015)
3 Output relay
·Used for peripherals connection, including solenoid valves, solenoid switches, displays
Device and Constant

(signal lamps, digital displays) etc.


output relay can beused as high speed output of high-speed counters and positioning
function. (only for R500 to R503)

Description ·for input relays, 1 bit is assigned to each input point.


·for output relays, 1 bit is assigned to each input point.
·Can be specified for any N.O. (normal open) or N.C. (normal close).
R100 to R415 are reserved for the system, please do not use.
R508 to R915 are reserved for the system, please do not use.

Default setting Under default state, output relays will clear the states turning to OFF when power is ON
and PROG-> RUN. You can change this to "Hold" in the "set power failure setting" tab
from the "CPU system settings".

Relay (R) unit device labeling


In KV STUDIO , besides normal labeling, a unit number can be used for relay relay labeling. To
use the unit device labeling, select "View ( V )" -> "Display unit device (Y)" from the menu.
Unit No. Unit relay No.
Can input after
R05_00010 eliminating zero.
(example) R5_10
Channel No. Contact number

Unit No. Starting from CPU, labeling can be performed in the order of 01, 02,
03, 04…and the like.
Unit relay No. Starting from 00000, the occupied points are specified as relay number.

Unit No. 00 * 01 02 03 04 05
KV-
KV-U7 KV-B16XA KV-C32XA KV-B16TA KV-C32TA KV-H20S
5000/3000
16-input 32-input 16-output 32-output 12CH occupied
CPU
Unit relay No. R000 to R015˄input˅
00000 to 00015 00000 to 00115 00000 to 00015 00000 to 00115 00000 to 00915
R500 to R507˄output˅

(Example) KV-B16XA 5th-point ............... 01_00004


KV-C32TA i17th-point .............. 04_00100
KV-H20S of 603....................... 05_00603
* KV-5000 / 3000 's internal input/output devices cannot use the unit device labeling.
For the KV-5000 CPU built-in Ethernet/FL-net devices, the unit devices with "00_" as the leading numbers
are used for labeling.
3-58 - KV-5000/3000 Series User’s Manual-
3-6 Device and Constant

Link Relay B

LADDER PROGRAMMING
Oerview Used as the relay that executes cyclic transfer when connecting with FL-net. Device numbers
are specified with hexadecimal symbols, which is different from other relays.

Denotation The device No. is structured as follows:


(Example)
Channel No. (000 to 3FF) Contact No.(0 to F)

B3A6F 3
Device name Device No.(0000 to 3FFF)

Device and Constant


Zero suppression can be used in programming.
(Example) B7A
Can be used as word device.
"The word unit processing for bit device", Page 3-80

Note
· Please use hexadecimal number (0 - F) for specifying.
· Local devices (@) cannot be used.

Range B0000 to B3FFF

Application Used as the relay that executes cyclic transfer when connecting FL-net.

Denotation These relays cannot be assigned as the unit device of expansion unit.

Default setting In default state, link relay will elimination state when power is ON, PROG-> RUN,
become OFF.Set to hold state in " Power-off hold settings " of CPU system setting.

Internal auxiliary relay R/B/MR/LR

■R

Overview R that is not assigned to actual I/O relays and expansion unit relays can beused as internal
auxiliary relay.

Denotation The device No. is structured as follows:


(Example)
Channel No. Contact No.
(000 to 999) (00 to 15)

R00012
Device nameDevice No. (00000 to 99915)

- KV-5000/3000 Series User’s Manual- 3-59


3-6 Device and Constant

·The letter R can beomitted in programming.


LADDER PROGRAMMING

Zero suppression can be used in programming.


(Example) R12
·Can be used as word device.
"The word unit processing for bit device", Page 3-80

Range Except the numbers assigned to expansion input unit

Default setting Under default state, output relays will clear the states turning to OFF when power is ON
3 and PROG-> RUN. You can change this to "Hold" in the " set power failure setting " tab
from the "CPU system settings"..
Device and Constant

■B
Overview When FL-net is not connected, the B that is not assigned to link relays can beused as internal
auxiliary relay.

Denotation The device No. is structured as follows:


(Example)
Channel No. (000 to 3FF)Contact No. (0 to F)

B1EE7
Device name Device No. (0000 to 3FFF)

Zero suppression can be used in programming.


(Example)B7A
·Can be used as word device.
"The word unit processing for bit device", Page 3-80

Note
· Please use hexadecimal number (0 - F) for specifying.
· Local devices (@) cannot be used.

Range B0000 to B3FFF

Description These relays cannot be assigned as the unit device of expansion unit.

Default setting Under default state, output relays will clear the states turning to OFF when power is ON
and PROG-> RUN. You can change this to "Hold" in the "set power failure setting" tab
from the "CPU system settings".

3-60 - KV-5000/3000 Series User’s Manual-


3-6 Device and Constant

■ MR

LADDER PROGRAMMING
Overvi A device that can be used only in CPU

Denotation The device No. is structured as follows:


(Example)
Channel No. (000 to 999) Contact No. (00 to 15)

MR02809
Device name Device No. (00000 to 99915)
3

Device and Constant


Description These relays cannot be assigned as the unit device of expansion unit.

Default setting W hen power is ON, or PROG→RUN, the states will be cleared, and output becomes OFF.

·The letter R in MR can be omitted.


·Zero suppression can be used in programming.
(Example) M2809
·“M” is displayed when XYM Marking is selected.
"About XYM Marking", Page 3-54
■ LR(Latch Relay)
Overvi This device can only be used for the Hold state in CPU.

Denotation The device No. is structured as follows:


(Example)
Channel No.(000 to 999) Contact number(00 to 15)

LR02308
Device name Device No. (00000 to 99915)

Range LR000 to LR99915

Description These relays cannot be assigned as the unit device of expansion unit.

Default setting Hold.

·The letter R in MR can be omitted in programming.


·Zero suppression can be used in programming.
(Example)L2308
·“M” is displayed when XYM Marking is selected.
"About XYM Marking", Page 3-54

- KV-5000/3000 Series User’s Manual- 3-61


3-6 Device and Constant

Timer (Contact) T
LADDER PROGRAMMING

Overvi Timer includes contact (1-bit), setting value (32-bit) and current value (32-bit).Timer is a kind
of device. And when the current value of down counter is "0" (time is up) or current value of
up/down counter is the same as the setting value or or "0", the contact becomes "ON".

Denotation The device No. is structured as follows:


(Example)

3 Device No. (0000 to 3999)

T0501
Device and Constant

Device name

Contacts, current values and setting values depend on the instruction operand used.

Range T0000 to T3999

Description Timer is classified into 4 categories: 1ms timer, 10ms timer, 100ms timer and up/down timer.

Default When power is ON, or PROG->RUN, the state will be cleared, and the output becomes OFF.
Current value is the same as setting valuewhen power on as well as PROG -> RUN.
(only up/down counter may keep current value.)
setting value is held.

Zero suppression can be used in programming.


(Example)T501

■ How to program a timer action


This is done by specifying the timer code and setting value (From Time to To Time) used in timer instruction operand.
(Example)
Device No. ˄0000 to 3999˅ Setting value 0 to 4294967295

TMR 0501 #1000


UDT 0502 #1000
Timer command

·Alternatively, a device can be used for value specifying.


For details on instructions, refer to the "2-6 Memory Card Instructions" in the "KV-5000/3000/1000
Series Instruction Reference Manual
·Timer and counter can use the device with same numbering..

3-62 - KV-5000/3000 Series User’s Manual-


3-6 Device and Constant

"Operation difference beween individual timers"

LADDER PROGRAMMING
Timer type (instruction) Device No. Setup value Time before ON
100ms down counter(TMR) n x 100ms
10ms down counter(TMH) n x 10ms
0 to 3999 0 to 4294967295
1ms down counter(TMS) n x 1ms
10ms up/down counter(UDT) n x 10ms

■ Timer error
Timer error is shown below:
· TMR(100ms timer): ±(100ms + 1 scan time) 3
· TMH(10ms timer): ±(10ms + 1 scan time)

Device and Constant


· TMS(1ms timer): ±(1ms + 1 scan time)
· UDT(Up/down counter): ±(10ms + 1 scan time)
■ Precautions when using a timer instruction
When a timer instruction is used between sub-routine instructions (SBN - RET), between step
instructions (STP - STE), or between condition branch instructions (CJ/NCJ - LABEL), if the instruction
conditions are not enforced, the current value of timer will then not be updated.
If time counting continues and instruction execution is restarted, the elapsed time will be reflected in
current value of timer. If the set time has elapsed, timer contact will be ON quickly when the execution is
started again. If the wait time is too long (i.e. not executed immediately), however, the timer contact may
not be ON sometimes even if the set time has elapsed. For this, please use this when the processing is
not stopped.

(Example) program a 20s timer instruction between SBN-RET instructions

8 second 20 second
Execution
SBN to RET instruction
Stop

ON
Execute condition
OFF

Timer
Current value Second 20 ࡮18࡮16࡮14࡮ 12 0
˄Setting value:
20 seconds˅
ON
Contact
OFF

Not update for timer current value. Timer contact ON when restart

·The ONDL/OFDL/SHOT/FLIK instruction will act just like the above-mentioned, which should
be paid attention to.
·If a timer instruction is used in the module/macro and the execution in module/macro is stoped,
the timer instruction is then reset through OFF , and the above-mentioned will not occur.
"Operation of standby module", Page 3-98
"Macro Type", Page 3-112

- KV-5000/3000 Series User’s Manual- 3-63


3-6 Device and Constant

■ Set value/current value processing


LADDER PROGRAMMING

The setting value/current value reading or changing instructions are listes as follows:
Reading Changing
Current value MOV, LDA instruction MOV, DW instruction
Set value (Can't read) STA Instruction*

* Set values changed with the STA instruction will be cleared when power is ON or RUN→PROG, and
returned to original value.
If the timer value is specified with a device, then the value is updated by the specifying device each time
3 scanning is performed.
Device and Constant

Note
If the current value exceeds setting value, the current value is then changed to the setting value.

Counter (Contact) C

Overview Counter contains contact (1-bit), setting value (32-bit), current value (32-bit).
Counter is a kind of device whereby the contact is ON when the current value is the same as
the setting value (counting is finished).

Denotation The device No. is structured as follows:


(Example)
Device No. ˄0000 to 3999˅

C0551
Device name

Contacts, current values and setting values depend on the instruction operand used.

Range C0000 to C3999

Description Three kinds of counter are available: counter, output counter, up/down counter.

Default setting Under the default state, contact states, current values, setting values are kept.
Under default state, output relays will clear the states turning to OFF when power is ON
and PROG-> RUN. You can change this to "Hold" in the " set power failure setting " tab
from the "CPU system settings".

·Zero suppression can be used in programming.


(Example)C551
·Timer and counter can use the device with same numbering..

3-64 - KV-5000/3000 Series User’s Manual-


3-6 Device and Constant

■ How to program a counter action

LADDER PROGRAMMING
Program counter action by designating counter No.setting value, count input relay used in counter instruction operand.

Device No. (0000 to 3999) Setting value (0 to 4294967295)

C 0551 #01000 R03000


Count input relay
OUTC 0552 #01000

UDC 0553 #01000


Counter command
3

Device and Constant


·Alternatively, a device can be used for value specifying.

"Action differences between various counters"


Counter type Counter No.
setting value Reset mode
(instruction) assignment
Counter (C) Execution condition OFF
Output counter(OUTC) 0 to 3999 0 to 4294967295 RES instruction
Up/down counter(UDC) Reset input ON

For details on instructions,"KV-5000/3000/1000 series Instruction Reference Manual "2-6 Memory Card
Instructions"

■ Counter max counting speed


Counting is performed only when both the counter input ON time and OFF time are longer than
scanning time.
Calculation formula is shown below. To use a speed higher than the following mentioned, a high-speed
counter or interrupt function can be used.
Operation ratio (%) 1
Max. count speed ˙ × (unit: times/sec)
100 Scan time (sec)

* The ratio between the signal ON and OFF times


is called the "duty ratio."
T1 T2
T1
when T1̰T2ǂoperation ratio˙ ×100 (unit: %)
T1ˇT2

T2
when T1>T2ǂoperation ratio˙ ×100 (unit: %)
T1ˇT2

- KV-5000/3000 Series User’s Manual- 3-65


3-6 Device and Constant

■ How to process set counter value/current value


LADDER PROGRAMMING

The setting value/current value reading or changing instructions are listes as follows:
Read Change
Current value MOV, LDA instruction MOV, DW instruction
Setting value (Can't read) STA Instruction*

* If the counter value is specified with a device, then the value is updated by the specifying device each time
scanning is performed.

3 Note
If the current value exceeds setting value, the current value is then changed to the setting
Device and Constant

value.

High-speed counter comparator (contact) CTC

Overview High speed counter comparator is a device whereby it turns ON when the current value of
high-speed counter is the same as the setting value.

Note
When CTC is used as interrupt element, CTC (contact) is not ON.

Range CTC0 to CTC3

Description CTC can also be taken as an interrupt condition for interrupt routine execution.

Default setting Under the default state, contact states and setting value are kept.
You can also choose to clear the value when power is ON or PROG->RUN by selecting
the "Clear" option from the "set power failure setting" tab in the "CPU system settings"
window.

Control relay(contact) CR

Overview Control relay is special internal auxiliary relay that is used to control PLC function and
capture PLC state.

Range CR0000 to CR3915

Description "A-2 CR/CMlist", Page A-7

3-66 - KV-5000/3000 Series User’s Manual-


3-6 Device and Constant

LADDER PROGRAMMING
Word Device

Data memory/extended data memory DM/EM

Overview A data memory and extended data memory is used to save reference data or 16-bit per point
devices in function operations.

Denotation The device No. is structured as follows:


(Example)
Device Device
3
name No.

Device and Constant


DM06143
·The letter M in DM/EM can be omitted.
Zero suppression can be used in programming.
(Example)DM6143
·Can be used as a device.
(Example) DM1100 .....the lowest bit of DM1100 is processed.
·Can be used as a bit device by specifying the bit position.
(Example) DM1200.12 The 13th bit of DM1200 is processed.
"The bit device processing for a word device", Page 3-81
·"D" is displayed when the XYM Marking is selected.
"About XYM Marking", Page 3-54

Range DM00000 to DM65534


EM00000 to EM65534

Description ·Only Data Memory (DM) can be assigned as the unit device of expansion unit.
The bit width of 1 device point is 16 bit. When used as unsigned decimal number, 0 to 65535 can be
processed; when used as signed decimal number, - 32768 to ++32767 can be processed; when used
as hexadecimal number, $0 to $FFFF can be processed.
DM1
bit bit bit bit
15 8 7 0

16-bit

·2 devices can also be used to process 32-bit data. For 32-bit data, the low 16 bits will be
stored in the data memory of the specified device No. and the high 16 bits will be stored in
the data memory of the next device No.. If used as unsigned decimal, the value will be 0 to
4294967295; if used as signed decimal, the value will be -2147483648 to +2147483647; if
used as hexadecimal, the value will be $0 - $FFFF.
DM1 DM0
bit bit bit bit bit bit bit bit
31 24 23 16 15 8 7 0

High 16-bit Low 16-bit

32-bit

- KV-5000/3000 Series User’s Manual- 3-67


3-6 Device and Constant

·If the data memory is used to specify a 32-bit operand, then only the device No. which stores
LADDER PROGRAMMING

the low 16-bit can be specified.

Default setting Under default status, the value is held.


You can also choose to clear the value when power is ON or PROG->RUN by selecting
the "Clear" option from the "Power-off hold settings" tab in the "CPU system settings"
window.

·Data memory (DM) unit device labeling


3 In "KV STUDIO", besides ordinary labeling, unit code numbers can also be used for labeling.
To select unit device labeling, select "View (V)" (view) -> "Display devices for unit (Y)" from
Device and Constant

the menu.

Unit No. Device No. Can input after


eliminating zero.
DM05_0010 (example) DM5_10

Unit No.: From CPU, according to the unit connection sequence, assign 00, 01,
02, 03, 04…and the like.
Unit DM No.: Specifying for the occupied data memories starts from 0000.

(Example)

*
Unit No. 00 01 02 03 04 05

KV-
KV-U7 KV-AD40 KV-DA40 KV-H20S KV-H20S KV-H20S
5000/3000
22 words 18 words 320 words 320 words 320 words
CPU

Unit DM No.:
0000 to 0021 0000 to 0017 0000 to 0319 0000 to 0319 0000 to 0319

KV-C32TA input 17th-point............................... DM01_0004


KV-H20S of 53 ................................................. DM03_0052
KV-H20S of 1..................................................... DM05_0000
* KV-5000 / 3000 's built-in input/output devices cannot use the unit device labeling.
For the KV-5000 CPU built-in Ethernet/FL-net devices, the unit devices with "00_" as the leading numbers
are used for labeling.

File Register ZF/FM

Overview File register can beclassified into ZF whereby all areas are processed sequentlyand FM
whereby the area is divided into four memory banks which are switched over in processing.

Denotation The device No. is structured as follows:


(Example)
Device name Device No.

ZF0372

3-68 - KV-5000/3000 Series User’s Manual-


3-6 Device and Constant

·Zero suppression can be used in programming.

LADDER PROGRAMMING
(Example) ZF372
·Can be used a bit device.
(Example) FM1100 ......the lowest bit of FM1100 is processed.
·Can be used as a bit device by specifying the bit position.
(Example) DM1200.12 the 13th bit of ZF1200 is processed.
"The bit device processing for a word device", Page 3-81
·“FM" is displayed as ”F" when the XYM Marking option is selected.
"About XYM Marking", Page 3-54

Note
· ZF local devices (@zfxxx) cannot be used.
3

Device and Constant


· FM local devices (@FM0 - @FM32767) cannot perform memory bank switching.
· FM local devices use the work area (@FM0 - @FM32767).

Range ZF000000 to ZF131071


FM00000 to FM32767

Description These relays cannot be assigned as the unit device of expansion unit.
·The device category and range varies depending on consecutive numbering and memory
bank switching modes, .
·A device's bit width is 16 bit. If unsigned decimal is used, the value will be 0- 4294967295; if
signed decimal, it will be +32767- +2147483647; if hexadecimal, it will be $0- $FFFF.
ZF2510
bit bit bit bit
15 8 7 0

16-bits
·2 devices can also be used to process 32-bit data. For 32-bit data, the low 16 bits will be
stored in the data memory of the specified device No. and the high 16 bits will be stored in
the data memory of the next device No.. If used as unsigned decimal, the value will be 0 to
4294967295; if used as signed decimal, the value will be -2147483648 to +2147483647; if
used as hexadecimal, the value will be $0 - $FFFF.

● ZF: used in the consecutive numbering mode


The whole file register area is used as a single device range.
File register area

ZF0࡮࡮࡮࡮࡮࡮࡮ ࡮࡮࡮࡮࡮࡮࡮ZF131071

- KV-5000/3000 Series User’s Manual- 3-69


3-6 Device and Constant

● FM: used in the memory bank switching mode


LADDER PROGRAMMING

The file register is divided into four areas which are switched over in use.

File register area

ZF0࡮࡮࡮࡮࡮࡮࡮࡮ ࡮࡮࡮࡮࡮࡮࡮࡮
ZF32767, ZF32768 ࡮࡮࡮࡮࡮࡮࡮࡮
ZF65535, ZF65536 ࡮࡮࡮࡮࡮࡮࡮࡮
ZF98303, ZF98304 ZF131071

Storage unit 1 Storage unit 2 Storage unit 3 Storage unit 4


FM0࡮࡮࡮ ࡮࡮࡮FM32767 FM0࡮࡮ ࡮࡮࡮FM32767 FM0࡮࡮ ࡮࡮࡮FM32767 FM0࡮࡮
࡮࡮࡮࡮࡮࡮࡮FM32767

Through switching memory banks, four different device ranges are available for a single device.
Since it can bemixed with ZF devices in use, attention should be made in data processing.
3 For more inforamtion about memory bank switching, please refer to "3-11 File Register", Page 3-
137.
Device and Constant

Default setting Under default status, the value is held.


You can also select the "Clear" option by clicking "CPU system settings" and " Power-off
hold settings ".

Link Register W

Overview It is used as the cyclic transfer register for FL-net. Hex symbols are used for device labeling
which is different from other word devices.

Denotation The device No. is structured as follows:


(Example)
Device name Device No. (0 to 3FFF)

W3A6F

·Zero suppression can be used in programming.


(Example) W7A
·Can be used as a bit device by specifying the bit position.
(Example) DM1200.12 the 13th bit of ZF1200 is processed.
"The bit device processing for a word device", Page 3-81

Note
· Please use hexadecimal number (0 - F) for specifying.
· Local device (@) cannot be used.

Range W0000 to W3FFF

Application Used as a cyclic transfer register for FL-net.

Description These relays cannot be assigned as the unit device of expansion unit.
·A device's bit width is 16 bit. If unsigned decimal system is used, the value will be 0-
4294967295; if signed decimal, +32767- +2147483647; if hexadecimal, $0- $FFFF.
W123E
bit bit bit bit
15 8 7 0

16-bit
3-70 - KV-5000/3000 Series User’s Manual-
3-6 Device and Constant

·2 devices can also be used to process 32-bit data. For 32-bit data, the low 16 bits will be

LADDER PROGRAMMING
stored in the data memory of the specified device No. and the high 16 bits will be stored in
the data memory of the next device No.. If used as unsigned decimal, the value will be 0 to
4294967295; if used as signed decimal, the value will be -2147483648 to +2147483647; if
used as hexadecimal, the value will be $0 - $FFFF.
W2BE1 W2BE0
bit bit bit bit bit bit bit bit
31 24 23 16 15 8 7 0

High 16-bit Low 16-bit


3

Device and Constant


32-bit

Default setting Under default status, the value is held.


To clear data, select "Clear" from the "power off holding setting" in the "CPU system
settings".

Temporary Data Demory TM

Overview Temporary data memory is 16-bit word device that may perform the same processing as data
memory. When an arithmetic operation instruction is used, the device area can also be used
for temporary store of arithmetic operation data or arithmetic operation result data.

Denotation The device No. is structured as follows:


(Example)
Unit No. Device No.

TM010

Range TM000 to TM003(Used for arithmetic operation instruction)


TM004 to TM511(For simple indirect specifying)
TM No. Application
TM000
Used for arithmetic operation (DIV, MUL, ROOT instruction)
TM001
TM002
Used for arithmetic operation (DIV instruction)
TM003
TM004 to TM511 Simple indirect specifying/common use

For more information about DIV and MUL instructions, please refer to theKV-5000/3000/1000
Instruction Reference Manual.
For more information about simple Indirect specifying, please see "Indirect Specifying", Page 3-75.
Default setting When power ON or PROG->RUN, the value is cleared and set to 0.

·TM000 - TM003 are used in DIV and MUL arithmetic operation instructions. It is advisable
not to use them for any other purpose.
·Zero suppression can be used in programming.
(Example) TM10
·TM is saved in internal ultra high-speed buffer memory of KV-VELOCE Ⅱ (ladder special
execution engine) for high-speed access.

- KV-5000/3000 Series User’s Manual- 3-71


3-6 Device and Constant

Timer (current value/setting value) T


LADDER PROGRAMMING

When the timer setting value (32-bit) is set up and current value (32-bit) is read, the timer is used as a
word device.

"Timer (Contact) T", Page 3-62

Counter (current value/setting value) C

3 When the counter setting value (32-bit) is set up and current value (32-bit) is read, the counter is used
as a word device.
Device and Constant

"Counter (Contact) C", Page 3-64

high-speed counter (current value) CTH

Overview High speed counter is a 32-bit counter used to collect short interval signals that cannot be
collected by common counter instructions.

Range CTH0 to CTH1

Description ·0 to 4294967295 or -2147483648to+2147483647 are processed


·Besides external input couningt, internal clock counting is also available.
·The maximum response frequency is 50% duty ratio, single-phase, 100kHz, and 50khz phase
difference .

Default setting Under default status, the value is held.


You can also choose to clear the value when power is ON or PROG->RUN by selecting the
"Clear" option from the "set power failure setting" tab in the "CPU system settings" window.

"2-8 High-speed Counter", Page 2-87

High-speed counter comparator (setting value)CTC

Overvi A device that stores high-speed counter setting values (32-bit).

Range CTC0 to CTC3

Description ·It should be set between 0 to 4294967295 or -2147483648 to +2147483647


·Two setting values (CTC) can be set per high-speed counter (CTH).
CTC0, CTC1 .............. For CTH0
CTC2, CTC3 .............. For CTH1

Default setting Under default state, the contact state and setting value is held.
Under default state, output relays will clear the states turning to OFF when power is ON
and PROG-> RUN. You can change this to "Hold" in the " set power failure setting " tab
from the "CPU system settings".

3-72 - KV-5000/3000 Series User’s Manual-


3-6 Device and Constant

Index Register Z

LADDER PROGRAMMING
Overview A 32-bit word device that is used to specify the value attached to target device for index
modification. Like data memory, it is used to store data and operation results.

Range Z01 to Z12

Zero suppression can be used in programming.


(Example) Z3
3
Note
· Z11, Z12 is reserved for the system, please do not use.

Device and Constant


· Bit specifying cannot be performed for word devices.
· Local devices are not available. The ZPUSH and ZPOP functions should be used.
KV-5000/3000/1000 Series Instruction Reference Manual, "ZPUSH Instruction"
KV-5000/3000/1000 Series Instruction Reference Manual, "ZPOP Instruction"

Default setting When power is ON, or PROG -> RUN, index register is reset.

"Index Modification", Page 3-74

Control Memory CM

Overview Control memory is a special word device that is used to control PLC and capture PLC state.

Range CM0000 to CM5999

Description "A-2 CR/CMlist", Page A-7

Index Modification

"Index modification" refers to the method for addressing a device by adding the value and constant of
index register (Z) to a corresponding device.
The range for adding value is of signed 32-bit.
The devices that can use Index modification include R (DR), B, MR, LR, T, C, DM, W, EM, ZF, FM, and
TM, and this is availabe to the whole device range.
Index modification can beused together with indirect specifying (*) and local device (@).

Note
· For the bit position specifying of the CTH, CTC, CR, CM, and Z labels (label
arrangement) and word devices, index modification is not available.
"Label", Page 3-162
"The bit device processing for a word device", Page 3-81
· If addressing can beperformed on the devices out of range that is capable of index
modification according to argument, control relay CR2012 becomes ON and this function
is not executed. But the operation continues.

- KV-5000/3000 Series User’s Manual- 3-73


3-6 Device and Constant

■ Modifying with the index register


LADDER PROGRAMMING

This is used to modify the devices specified with an instruction operand in operation.
Programming method to modify device through pointer register is as follows:.
"Device No."Z (1 to 10)
(Example) DM01000:Z01 .......... DM0990 is referenced when the value of Z1 is -10
   R000 : Z5 ................. If the value of Z5 is a positive one, R100 should then be specified.

Note
3 Z11, Z12 are reserved for system, thus can't be used.
Device and Constant

Example The current value in DM10000 will be stored as trigger signal in up edge of R001. Recording is
started in the up edge of R000 , and data storing is started from DM0.

R000 MOV.L
Index register Z01 is set to "0" at the
+0 Z1
up edge of R000.
Recording start
button

R001 MOV The value of DM10000 is written to the


DM10000 DM0:Z1 target device index modified at
Trigger signal
Current value Save destination start
the up edge of R001.

Z1
Index register Z01 is
INC.L
incremented by "1".

Current value Save to

DM10000 1234 DM0 2152


DM1 2348

DM99 1234

Note
Since the value for index modification is processed as a signed 32-bit value, ".L" should be
suffixed to the instruction for index register operation.

If more than ten index registers (Z) are used in one project, the index register instruction
(ZPUSH/ZPOP) can be used to clean up or restore index registers of each module or macro
in batch.
For more information, please refer to "3-8 Memory Card Instructions" in the KV-5000/3000/1000
Series Instruction Reference Manual

3-74 - KV-5000/3000 Series User’s Manual-


3-6 Device and Constant

■ Modifying with the index constant

LADDER PROGRAMMING
When a constant is used for in index modification, programming should done as follows:

(Example)DM1000 : #-10 ... The DM1000-10 word becomes DM990.


   R000: #16........... R0000+16 bit (1 channel), becomes R100.

The leading number can be easily identified if constant-based index modification is used in
the macro in which unit devices are used. In addition, in macro programming, this, as the
argument device, is effective even if UR/UM is used.
 (Example)
3

Device and Constant


   UR0:#2
   UM1:#32
"Application Example", Page 3-118

Indirect Specifying

■ Indirect specifying(*)
Indirect specifying (*) is used to modify the devices specified as an instruction operand in program
execution process. Although index modification is also applicable to lookup devices, device types may
also be modified if indirect specifying (*) is used, .

● Indirect specifying definition


All the devices are managed by internal memory in KV-5000/3000 PLC, which have their own address.
Since 32-bit data is used for address management, 2 words must be used for an address storage.
In Indirect Specifying (*), the specified device is modified by changing its address through a special
instruction.
Indirect specifying can be used in combination with index modification (: Z /: #) and Local Device (@).

Note
· Indirect specifying (*) cannot be used together with simple indirect specifying (#TM).
· If addressing can beperformed on the devices out of range that are capable of index
modification according to argument, control relay CR2012 becomes ON and this function
is not executed. But the operation continues.

● Indirect specifying programming


If indirect specifying is programmed as "*(device)" and instruction operand, the device value or device
corresponding to current device storage address will be referenced.

- KV-5000/3000 Series User’s Manual- 3-75


3-6 Device and Constant

(Example)
LADDER PROGRAMMING

<When programmed as *TM10>

Device Value
TM10࡮TM11 DM0 25
Indicates value of *TM10ˈreference
DM1 1234
DM1’s address 1234 or DM1.
DM2 0
DM3 96

3 Note
· The devices that can be programmed (for address storage) to "*(device)" include DM/EM/
Device and Constant

FM/TM/W/ZF.
· The devices applicable for indirect specifying include R/MR/LR/B/T/C/DM/EM/FM/TM/W/ZF.

·If the indirect specifying device is a timer (T) or counter (C), the contact, current value and
setting value then depend on the instruction operand.
·When a local device is used, the programming format is "*@ (device) ".

● How to use the indirect specifying


Perform indirect specifying as per the steps below.

1 Use the address setting instruction (ADRSET) to write the address of lookup device.
(Example)

ADRSET
Save address of DM0 to
DM0 TM10
TM10/TM11.

Note
The device that can store address include TM, DM, EM, FM, W, and ZF.

For details on instructions, please refer to "ADRSET Instructions" in the "KV-5000/3000/1000 Series Instruction
Reference Manual.

2 Add the prefix "*" before the device that stores the current address, and indirectly specify the
device according to each instruction operand.
(Example)

MOV
The value of DM10000 is
DM10000 *TM10
stored to DM0.

DM0

Note
Before adding prefix "*" to the device that stores the address, please always use the
ADRSET instruction to store address of the indirectly specified device.

3-76 - KV-5000/3000 Series User’s Manual-


3-6 Device and Constant

3 To change the device to be searched, use the special indirect addressing instruction (ADRINC/

LADDER PROGRAMMING
ADRDEC/ADRADD/ADRSUB) to change the currently stored address.
(Example)

The address of DM00000


ADRINC
TM10 currently stored to TM10/TM11
is incremented by 1.

MOV
The value of DM10000 is
DM10000 *TM10
stored to DM1.

DM1 3

Device and Constant


Note
When modifying the reference address, please do not use ordinary arithmetic operation
instructions (for example, ADD/INC/SUB/DEC,etc).Otherwise, the ladder program cannot
run correctly.

For details on instructions, please refer to "3-9 Memory Card Instructions" in the KV-5000/3000/1000 Series
Instruction Reference Manual

● Example: how to use the indirect specifying


To save the current value of DM10000 with the up edge of R001 as the trigger signal.
Recording is started in the up edge of R000, and data is stored from DM0.

R000 ADRSET The address of DM0 is written to


DM0 TM10
TM10/TM11 at the up edge of R000.
Recording start Save destination start Address store destination
button

R001 MOV The value of DM10000 is written to the


DM10000 *TM10 target device indirectly specified by the
Trigger up edge of R001.
signal Current Address store destination
value
ADRINC The address currently stored to
TM10
TM10/TM11 is incremented by 1.
Address store destination

Current value Save to

DM10000 1234 DM0 2152


DM1 2348

DM99 1234

- KV-5000/3000 Series User’s Manual- 3-77


3-6 Device and Constant

● Example: when used together with the index modification


LADDER PROGRAMMING

To save the current value of DM10000 with the up edge of R001 as the trigger signal.
At the up edge of R000, if R002 is ON, data is stored from DM0; if it is OFF, stored from EM0.

(1) (2)
R000 +0 R002 ADRSET
< DW.S > DM0 TM10
Measurement Z1 Save destination selection Save destination 1 start Address store destination
start button
(3)
R002 ADRSET
EM0 TM10
3 Save destination selection Save destination 2 start Address store destination

(4)
Device and Constant

R001 MOV
DM10000 *TM10:Z1
Trigger
signal Measured value Address store destination
(5)
Z1
< INC.L >

To start,
(1) Write 0 in the pointer register Z1.
(2) If R002 is ON, write the DM0 address in TM10/TM11.
(3) If R002 is OFF, write the EM0 address in TM10/TM11.
To trigger,
(4) Use the Z1 index specification to modify the device (adding the value of Z1) whose address is stored
in TM10/TM11, and write the value of DM10000 in the modified device.
 (Example)
   *TM10->EM0 *TM10:Z1->EM23
   Z1= 23
(5)Add Z1 by 1.

■ Simple indirect specifying #TM


The indirect specifying of temporary data memory (TM) is used for this.

Note
· Simple indirect specifying cannot be used together with the index modification, indirect
specifying (*), and local device (@) .
· The simple indirect specifying feature is support for the reuse of exsiting programs. To
program a new program, it is recommended that the index modification or indirect
specifying be used.

3-78 - KV-5000/3000 Series User’s Manual-


3-6 Device and Constant

● How to use the simple indirect specifying

LADDER PROGRAMMING
This is done by programming #TMnnn in instruction operand to modify the value stored in TMnnn.
The relationship between the value stored in TMnnn and #TMnnn is shown in the table below.

Value Stored to TMnnn Reference destination of simple indirect specification


0 DM0
1 DM1
2 DM2
Indirectly specified DMs 3
9997 DM9997

Device and Constant


9998 DM9998
9999 DM9999

10000 R000
10001 R001
10002 R002
Indirectly specified relays (R)

17913 R7913
17914 R7914
17915 R7915

The usable range of temporary data memory is TM0 to TM511. Since TM0 to TM3 can also be used for
arithmetic operation, however, duplication should be prevented.

Note
· Simple indirect specifying is only applicable to DM/R, DM10000 to DM65534,and R8000
to R99915.
· If the value in temporary data memory (TM) is larger than 17915, the control relay
CR2012 (operation flag) is ON when performing simple indirect specifying, and this
instruction is not executed. But the operation continues.

- KV-5000/3000 Series User’s Manual- 3-79


3-6 Device and Constant
LADDER PROGRAMMING

The word unit processing for bit device

Generally speaking (namely sequence instruction), a bit device can beprocessed as a 1-bit device.

R006 R30500
1 bit between R006 and R30500 as
processed object when under the
condition of command above .

R R R R R R R R R R R R R R R R

3 0
1
5
0
1
4
0
1
3
0
1
2
0
1
1
0
1
0
0
0
9
0
0
8
0
0
7
0
0
6
0
0
5
0
0
4
0
0
3
0
0
2
0
0
1
0
0
0

Input relay
Device and Constant

Process object

Output relay
R R R R R R R R R R R R R R R R
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
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 an arithmetic operation instruction, bit devices can begrouped into 16-bit or 32-bit for processing.
If a bit device is designated to a instruction operand based on bit unit for processing, the word unit is
used for processing starting from the specified bit device.

Example

MOV
R30000 DM0

R30015 R30000

1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0

bit DM0 bit


15 0

1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0

MOV.D
R30000 DM0

R30115 R30100 R30015 R30000

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

bit DM1 bit bit DM0 bit


15 0 15 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

3-80 - KV-5000/3000 Series User’s Manual-


3-6 Device and Constant

If the bit device assigned to an operand is not in the leading channel position, straddle word unit

LADDER PROGRAMMING
processing is then performed for the bit device.

MOV
R30003 DM30505

R30102 R30003
301ch 300ch

1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0

R30604 R30505 3
306ch 305ch

Device and Constant


1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0

Note
When the straddle word unit processing is used, the processing speed will decrease.

The bit device processing for a word device

Generally, a word device is processed as a 16-bit or 32-bit device.


To process a word device as any bit device, use the "bit contact instruction" and "bit output instruction".
For the operands of the following instructions, the bit position of word device can be specified.
Destination instructions: LD, LDB, AND, ANB, OR, ORB, LDP, ANP, ORP, LDF, ANF, ORF, LDPB,
ANPB, ORPB, LDFB, ANFB, ORFB, OUT, OUB, SET, RST, KEEP, DIFU,
PIFD
Example
Process 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

When a word device is specified with other instructions than the above-mentioned, only the lowest bit of
the specified word device is processed as a bit device.

- KV-5000/3000 Series User’s Manual- 3-81


3-6 Device and Constant

Example
LADDER PROGRAMMING

When the value of DM1000 is #46563($B5E3)

DM1000 EM1001

DM1000˙#46563($B5E3)

1 0 1 1 0 1 0 1 1 1 1 0 0 0 1 1

3
Device and Constant

Lowest bit
1Contact ON
0Contact OFF

In the above-mentioned example, when the contact is ON, the lowest valid bit of EM1001 becomes "1".
EM1001=#14($E)

0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0

EM1001=#15($F)

0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1

Other bits are not changed.

Constant

The constant value and range varies depending on the instruction and suffix used.

#Decimal constant

Overview A decimal constant is a decimal that is represented by a bit width of 16-bit and 32-bit.

Denotation ·Unsigned (when suffix is "U" or "D")


A decimal constant is represented by the prefix "#" which is followed by decimal numbers.
(Example)
Indicates signal
of Decimal Value

#06143
·Signed (when the suffix is "S" or "L")
A decimal constant is represented by a sign which is followed by decimal numbers.

Range ·Unsigned 16-bit: #0 to #65535


·Unsigned 32-bit: #0 to #4294967295
·Signed 16-bit: -32768 to +32767
·Signed 32-bit: -2147483648 to +2147483647

3-82 - KV-5000/3000 Series User’s Manual-


3-6 Device and Constant

·Zero suppression can be used in programming.

LADDER PROGRAMMING
·A signed decimal constant can also use the prefix "#". If a decimal constant has the symbol
"#", the "+" sign then has to be omitted.
·In the XYM Marking mode, "K" can be attached.
"About XYM Marking", Page 3-54

$Hex constant

Overview A hex constant is a hex symbol which is represented by a bit width of 16-bit or 32-bit. 3

Device and Constant


Denotation A hex constant is prefixed by "$" which is followed by hex symbols.
(Example)
Indicates
signal of Hex Value

$1AF7
Range ·16 bits : $0000 to $FFFF
·32 bits : $00000000 to $FFFFFFFF

Note
During programming, if the hex constant has no prefix "$" and contains A to F, an error mayl
occur; if it does not contain A to F, it will be considered as a decimal number.

·Zero suppression can be used in programming.


·In XYM Maring mode, "K" is attached.
"About XYM Marking", Page 3-54

Floating-point constant

Overview This refers to a floating-point instruction operand.

Denotation A floating-point constant is represented by a sign which is followed by decimal numbers.


·Above 8-bit is represented in the exponent form.

Range -3.4E38<= N<=-1.4E-45


      N=0
+1.4E-45<= N<=+3.4E38 (valid bits:7)

The prefix "#" symbol can be used. If so, the "+" sign has to be omitted.

- KV-5000/3000 Series User’s Manual- 3-83


3-6 Device and Constant

Fixed character string


LADDER PROGRAMMING

Overview This refers to a character string instruction and timing contact instruction operand.

Denotation " " represents a character string.


(Example)
String

SMOV “operation result” DM00000


3 Instruction 1st operand 2nd operand
Device and Constant

Note
If there is no the " ", it will be treated as a label in processing.

When (") is used as a character in processing, please enter ("").

Range Up to 31 characters (half-width)

Internal register

Internal register is a device that is used to store the arithmetic operation results of an application
instruction, arithmetic operation instruction, and extended instruction. As well as store temporary data
during an arithmetic operation.
The data stored in an internal register remain unchanged before the following new data is stored.
When power is ON or PROG->RUN, internal register is reset.

An Internal register consists of 16 high bits and 16 low bits.


31 24 23 16 15 8 7 0

High 16-bit Low 16-bit

16-bit internal register

32-bit internal register

Internal register of low bit 16-bit is called 16-bit internal register. An internal register which contains 16
low bits is called 16-bit internal register. An internal register which contains both high and low 32 bits is
called 32-bit internal register.
This is identified to the instruction and suffix used.
"Suffix", Page 3-93

3-84 - KV-5000/3000 Series User’s Manual-


3-6 Device and Constant

● Internal register and arithmetic operation instruction

LADDER PROGRAMMING
(expansion) data memory
DM/EM (internal auxiliary) relay
File register Handling of control relays
FM/ZF Current value of timer/counter in word units
Temporary data memory Constant
TM R00000 to R99915
#$ TǃCǃCTH MR00000 to MR99915
Control memory
CM LR00000 to LR99915
Index register CR0000 to CR3915
Z

3
LDA command

Device and Constant


Use operation instruction in internal register
Execute value read by LDA instruction
Internal register
Use STA instruction write result
to target device.
STA command

Data memory
DM/EM/FM (internal auxiliary) relay
File register Handling of control relays
FM/ZF Setting value of timer/counter in word units
Temporary data memory
TM R00000 to R99915
Control memory TǃCǃCTC MR00000 to MR99915
CM LR00000 to LR99915
Index register CR0000 to CR3915
Z

Example
Read DM0 to the internal register, which is multiplied by 2 plus the value of DM1, then
stored in DM2.
CR2002 DM0 #2 DM1 DM2
LDA MUL ADD STA
#1000 #100 #2100

- KV-5000/3000 Series User’s Manual- 3-85


3-7 Data Processing
Five types of data may be processed in a ladder program: BIN, DEC (unsigned/signed), HEX, BCD,
LADDER PROGRAMMING

and Single-precision floating-point number.


And text string and ASCIl/Shift-JIS can also be processed.

BIN Data

In KV-5000/3000 PLC, only BIN processing is available within a device and internal register.
1 BIN bit is processed with "bit" as the unit.A bit has two states: "0 (OFF) " and "1 (on).

3 ■ 16-Bit BIN data


Data Processing

Normally, a 16-bit data is processed with "word" as the unit. A unsigned DEC can be represented as 0
to 65535.
(Example)

MSB

bit bit bit bit


15 8 7 0

0 0 1 0 0 1 1 1 0 0 0 1 0 0 0 0


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 Weighting of each bit
3276816384 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

■ 32-Bit BIN data


32-bit data (two words) can represent a unsigned DEC number ranging 0 to 4294967295.

MSB

bit bit bit bit bit bit bit bit


31 24 23 16 15 8 7 0

Upper 16 bits Lower 16 bits

When a 32-bit device is processed in the DM/EM/FM/TM 16-bit word devices, two consecutive words
should be used. Low 16-bit data is processed in the low byte device and high 16-bit data is processed
in the high byte device.

3-86 - KV-5000/3000 Series User’s Manual-


3-7 Data Processing

LADDER PROGRAMMING
Representation

■ BIN (Binary)
Only "0" and "1" are used to represent KV-5000/3000 internal BIN data. Each digit postion carries when
larger than 1.

MSB

bit
15
bit
8
bit
7
bit
0
3

Data Processing


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 Weighting of each bit
32768163848192 4096 2048 1024 512 256 128 64 32 16 8 4 2 1 Decimal number value

(Example) 0110110100110001

A BIN number cannot be used as the instruction operand.

■ #DEC
A DEC is used to represent the internal BIN data of KV-5000/3000 .

● Unsigned
For 16-bit data, the processing range is 0 to 65535; for 32-bit data,
the processing range is 0 to 4294967295.

● Signed
Positive/negative is determined by the highest bit. (0: possitive; 1:negative)
For 16-bit data, the processing range is -32768 to 65535; for 32-bit data, -2147483648 to
+2147483647.

Input as instruction operand."#" or symbol is indicated at the beginning of a value.


(example) #1000, +12, -25489

■ HEX
A HEX is used to represent the internal BIN data of KV-5000/3000 .
Each HEX digit represents four BIN digits. One digit is in the range of DEC 0 to 15. So digits larger than
9 uses A, B, C, D, E, F. When larger than F, carrying is performed.
For 16-bit data, the processing range is -32768 to +32767; for 32-bit data,
the processing range for $000000 is 00 to $FFFFFFFF.

Values with "$" as the leading symbol can be used as instruction operand.
(example) $00FF

- KV-5000/3000 Series User’s Manual- 3-87


3-7 Data Processing

■ BCD (Binary Coded Decimal)


LADDER PROGRAMMING

Like HEX, BCD also takes 4 BIN digits as a unit for processing. And like DEC, carrying is performed
when larger than 9. Hence sympols A to F are not used.
For 16-bit data, processing range is 9999 to 65535; for 32-bit data,
the range is 99999999 to 4294967295.

Example

bit bit bit bit


3 15 8 7
0 0 0 0 1 0 0 1 1 0 0 0 0 1 1 1
0
Data Processing

When 16-bit data is currently stored as shown above,


conventionally this becomes the value $0987 (#2439 in decimal annotation),
however in binary coded decimal, this becomes "0987" annotated in decimal.

0 0 0 0 1 0 0 1 1 0 0 0 0 1 1 1
thousand bit hundred bit ten bit one bit

0 9 8 7

Binary Code Decimal (BCD) is well suited for external data processing (digital switch etc).
For arithmetic operations in KV-5000/3000 PLC, however, they have to be procesed in the BIN formy
data. When reading from external equipment, please use the TBIN instruction to convert them into BIN
data; and when outputing to external equipment (digital display etc), please use the TBCD instruction to
convert BIN data into BCD.

To use BCD as an operand, please add the prefix "$" to the value forming a HEX number.

■ Single-precision floating-point number FLOAT


A FLOAT is DEC number that is processed in the form of 32-bit BIN.
The processing range is (N):
-3.4×1038<=N<=-1.4×10-45
N=0
+1.4×10-45<=N<=+3.4×1038

·Can be used as an instruction operand.


Can only use the ordinary DEC point form (example:-1.2345), and cannot use "E".
(example) -2.743×1012 -> -2.743E12
+8.9025×10-4 -> +8.9025E-4
·The precision of a Float is 32-bit, with 7 significant digitss.
·The 32-bit data for storage of FLOAT follows the IEEE standard.

3-88 - KV-5000/3000 Series User’s Manual-


3-7 Data Processing

LADDER PROGRAMMING
Relationship Between Different Numbering Systems

The relationship between BIN, DEC, HEX, and BCD is as follows.

■ 16-bit data
DEC HEX
BIN BCD BIN
Unsigned Signed HEX
0 +0 0 0000 0000 0000 0000 0000 0000 0000 0000 0000
1
2
+1
+2
1
2
0000
0000
0000
0000
0000
0000
0001
0010
0001
0002
0000
0000
0000
0000
0000
0000
0001
0010
3

Data Processing
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

- KV-5000/3000 Series User’s Manual- 3-89


3-7 Data Processing

■ 32-bit data
LADDER PROGRAMMING

DEC
HEX BIN
Unsigned Signed
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

3 7
8
+7
+8
7
8
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0111
1000
9 +9 9 0000 0000 0000 0000 0000 0000 0000 1001
Data Processing

10 +10 A 0000 0000 0000 0000 0000 0000 0000 1010


11 +11 B 0000 0000 0000 0000 0000 0000 0000 1011
12 +12 C 0000 0000 0000 0000 0000 0000 0000 1100
13 +13 D 0000 0000 0000 0000 0000 0000 0000 1101
14 +14 E 0000 0000 0000 0000 0000 0000 0000 1110
15 +15 F 0000 0000 0000 0000 0000 0000 0000 1111
16 +16 10 0000 0000 0000 0000 0000 0000 0001 0000

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

BCD BIN
00000000 0000 0000 0000 0000 0000 0000 0000 0000
00000001 0000 0000 0000 0000 0000 0000 0000 0001
00000002 0000 0000 0000 0000 0000 0000 0000 0010
00000003 0000 0000 0000 0000 0000 0000 0000 0011
00000004 0000 0000 0000 0000 0000 0000 0000 0100
00000005 0000 0000 0000 0000 0000 0000 0000 0101
00000006 0000 0000 0000 0000 0000 0000 0000 0110
00000007 0000 0000 0000 0000 0000 0000 0000 0111
00000008 0000 0000 0000 0000 0000 0000 0000 1000
00000009 0000 0000 0000 0000 0000 0000 0000 1001
00000010 0000 0000 0000 0000 0000 0000 0001 0000
00000011 0000 0000 0000 0000 0000 0000 0001 0001
00000012 0000 0000 0000 0000 0000 0000 0001 0010
00000013 0000 0000 0000 0000 0000 0000 0001 0011
00000014 0000 0000 0000 0000 0000 0000 0001 0100
00000015 0000 0000 0000 0000 0000 0000 0001 0101
00000016 0000 0000 0000 0000 0000 0000 0001 0110

00000099 0000 0000 0000 0000 0000 0000 1001 1001


00000100 0000 0000 0000 0000 0000 0001 0000 0000

00000999 0000 0000 0000 0000 0000 1001 1001 1001


00001000 1000 0000 0000 0000 0001 0000 0000 0000

99999998 1001 1001 1001 1001 1001 1001 1001 1000


99999999 1001 1001 1001 1001 1001 1001 1001 1001

3-90 - KV-5000/3000 Series User’s Manual-


3-7 Data Processing

■ When the maximum or minimum value is execeeded

LADDER PROGRAMMING
When the arithmetic operation result exceeds maximum value or minimum value, dpending on data
type, data change is shown below respectively.

● When data of 16-bit


Changes of number when 65535 or more Changes of number when exceed Max. or Min.

Unsigned Decimal Hex Signed Decimal Hex


3 0003 3 0003

0
1
2 0002
0001
0000 0
1
2 0002
0001
0000
3
65535 FFFF -1 FFFF

Data Processing
65534 FFFE -2 FFFE
65533 FFFD -3 FFFD
65532 FFFC -4 FFFC
… … … …
32771 8003 -32765 8003
32770 8002 -32766 8002
32769 8001 -32767 8001
32768 8000 -32768 8000
32767 7FFF 32767 7FFF
32766 7FFE 32766 7FFE
32765 7FFD 32765 7FFD
32764 7FFC 32764 7FFC

● When data of 32-bit


Changes of number when 4294967295 or more Changes of number when exceed Max. or Min.

Unsigned Decimal Hex Signed Decimal Hex


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
4294967292 FFFFFFFC -4 FFFFFFFC
… … … …
2147483651 80000003 -2147483645 80000003
2147483650 80000002 -2147483646 80000002
2147483649 80000001 -2147483647 80000001
2147483648 80000000 -2147483648 80000000
2147483647 7FFFFFFF 2147483647 7FFFFFFF
2147483646 7FFFFFFE 2147483646 7FFFFFFE
2147483645 7FFFFFFD 2147483645 7FFFFFFD
2147483644 7FFFFFFC 2147483644 7FFFFFFC
2147483643 7FFFFFFB 2147483643 7FFFFFFB

·Single-precision floating-point number data


Overflow: when the absolute value is larger than 3.4x1038, it becomes "∞ (infinity)".
Underflow: when the absolute value is smaller than 1.4x10 -45, it becomes "0".

0 1.4×10-45 3.4×1038
(1.4E-45) (3.4E38)

0 ∞(display as "----")

- KV-5000/3000 Series User’s Manual- 3-91


3-7 Data Processing
LADDER PROGRAMMING

Character Code

In order to process text strings in ladder program, the code number assigned to them are called character code.
In KV- STUDIO , the following character codes can be processed.

■ ASCII code
8 bits are used to represent 1 half-width character.
(example) A···$41  1···$31
3
"ASCII Code Table", Page A-19
Data Processing

■ Shift JIS code


16 bits are used to represent 1 full-width character.

Can be used as character processing instruction and calendar contact instruction operand.
Use the """ to bracket the text string.
(example):"model ABC" ± "month/08:30:15"

3-92 - KV-5000/3000 Series User’s Manual-


3-7 Data Processing

LADDER PROGRAMMING
Suffix

A suffix is a symbol attached to the end of an instruction, which is classified into the following 5
categories:

□.U   □.S   □.D   □.L   □.F

*□ represents the instruction.


3
Example
ADD(.U) MOV.(U)

Data Processing
ADD.S MOV.S
ADD.D MOV.D
ADD.L MOV.L
ADD.F MOV.F

□.U Processed as unsigned 16-bit BIN data.(0 to 65535)


□.S Processed as unsigned 16-bit BIN data.(-32768 to +32767)
□.D Processed as unsigned 32-bit BIN data.(0 to 4294967295)
□.L Processed as unsigned 32-bit BIN data.(-2147483648 to +2147483647)
□.F Processed as Single-precision floating-point number. -3.4E+38<= N <=-1.4E-45
N=0
+1.4E-45<= N<= +3.4E+38
"Significant digits:7"
□.U Omitted in KV STUDIO. In addition, instructions without a suffix are processed as unsigned 16-bit
BIN data.
Depending on the suffix, DECs are used by the corresponding instruction for BIN data processing.
Therefore, if suffix is different, the instruction execution result may also be different, even if BIN data is
the same.

- KV-5000/3000 Series User’s Manual- 3-93


3-8 Module
LADDER PROGRAMMING

Overview

Normally, a ladder program involves multiple processes such as initialization, automatic operation,
manual operation, and error handling. In an ordinary ladder program, these are processed in a
consective fashion. With KV STUDIO, however, each process and feature can be programmed
separately, thereby facilitating separate management over each of them.

<Heretofore> <On KV STUDIO>


Project Project
3
˷Abnormal process˹
Module

˷Auto operation˹
˷Manual operation˹

˷Auto operation˹

˷Manual operation˹ ˷Initialization process˹

Module

All processes are arranged The ladder program is divided up


in order in a single by function or process, and each of these
ladder program like a is managed independently as a module.
long scroll.

■ Module Management
In KV STUDIO, the "workspace" is used for module management .
Easy program calling can be achieved by registering a frequently used module into the "Module
Library".

Display/hide switch icon

Workspace

Register and call

Module library

3-94 - KV-5000/3000 Series User’s Manual-


3-8 Module

"Workspace" and "Module Library" can be selected from the "View(V)" option in the menu bar.

LADDER PROGRAMMING
Alternatively, you can also the Hide/Show icon in the tool bar to display them.
The display position can be changed.

·You can copy a module between applications by opening up multiple KV STUIDO windows.
·Modules of other projects can also be imported.

■ Module features
● Know the whole program at a glance
Since the tree structure is adopted for each module in the "Workspace" , even a non-programmer can
3

Module
understand them at a glance.

Display
module list.

● Easy to reuse

Project used before New a project


Reuse
Module A Module A

Module B Reuse Module C


Copy and cha
Module C Module C’
Reuse and change
Module D Module D’

Module E Module G

● Improve efficiency in programming, modifying, and commissioning


Through module decomposition, the programming and commissioning efforts can be reduced. In
addition, since the local device concept is adopted, device assignment is not required for each module,
thereby ideally suitable for large team development work.

"3-10 Local Device", Page 3-131

- KV-5000/3000 Series User’s Manual- 3-95


3-8 Module
LADDER PROGRAMMING

Module Type

Module can be classified into "Every Scan Execution Type Module", "Initialization Module", "Standby
Module", and "Fixed Period Module".
You can manage and even change all types of module In the KV STUDIO "Workspace".

Every-Scan Execution Type Module

3 Every Scan Execution Type Module is executed right from the first time scanning (power on, or PROG -
> RUN).
Module

You can use the module instructions (MDSTOP Module Stop/MDSTRT Module Start) to control the
module in operation.
The operations when using the module instructions are the same as the Standby Module.
"Standby Module Operation", Page 3-98

·If a module instruction is used but the execution state is not controlled, the module will be executed for each
scanning.
·When KV STUDIO is used to create a new project, an Each Scan Execution Type Module
with the same name as the project name will be created automatically.

Initialize Module

Initialize Module is carried out for a module only in first time scanning in running. Initialize Module is
used to initialize equipment or restore the default settings of KV-5000/3000. In a project, even if
Initialize Module is not programmed, KV-5000/3000 can still run.
So please program Initialize Module when required.

˘Default˚ ˘KV STUDIO˚


Initialization Initialization
process module
CR2008 process 1

CR2008
࡮࡮࡮

Initialization
END
CR2008 process 2
ENDH

CR2008: only scan once ON when start operation

When a module is registered as Initialize Module, since it is unnecessary to execute the initialization
routine in the next time scanning, the scanning time for this module can then be reduced.

3-96 - KV-5000/3000 Series User’s Manual-


3-8 Module

LADDER PROGRAMMING
Note
· Some instructions cannot be used Initialize Module.
"Unusable Instruction List", Page A-23
· For Initialize Module, the module instructions (MDSTRT/MDSTOP) cannot be used for
execution state control.
· KV-5000/3000 cannot run if only Initialize Module is provided. At least one or above Every
Scan Execution Type Module or Standby Module should also be provided.

Standby Module 3

Module
Standby Module is stopped when the operation starts. The module execution instructions (MDSTRT/
MDSTOP) can be used to control its execution state during operation.
"Module instructions", Page 3-106

<Example: Standby Module calling>


In this example, the Standby Module execution state (Automation operation, automatic operation) is
controlled by Each Scan Execution Type Module (Master).

Main
Execution
・・

start
R000
MDSTRT
Auto
operation
Execution
stop R000 MDSTOP
Auto
operation
・・・

END
ENDH

Note
KV-5000/3000 cannot run if only Initialization Module is provided. At least one or above Every
Scan Execution Type Module or Standby Module should also be provided.

The execution state control is the same as Every Scan Execution Type Module.

- KV-5000/3000 Series User’s Manual- 3-97


3-8 Module

■ Standby Module Operation


LADDER PROGRAMMING

The operation of Standby Module is shown in the figure below.

Scan once Scan once Scan once Scan once Scan once Scan once

Execution in OFF OFF OFF


ON ON ON
progress ON
bit_ module B
Module A
3 (every scan)
Execution Execution Execution Execution Execution Execution
Module

Module B Module B
execution start execution stop

Module B Stop Stop Execution Execution Execution under


Stop
(standby) OFF condition

Start execution Execute under OFF


from next scan. condition in next scan.

● Start Standby Module


In the scanning whereby the MDSTRT instruction is called, Standby Module is not executed. Standby
Module is executed from the next time scanning.

The initial state of the differential execution instruction when Standby Module is started is ON in
the up edge, and OFF in the down edge. For example, if the state before the first time scanning is
ON, the up edge differential execution condition is not detected.

● Stop Standby Module


If the MDSTOP instruction is called during routine execution, Standby Module will still be executed
within the scanning period whereby the MDSTOP instruction is called.
In the subsequent scanning period, Standby Module will be executed when all execution conditions are OFF.*
Then, Standby Module is stopped in the next scanning period (the next scanning period following the
calling scanning period).

* However, the following instructions are exceptional.

Instruction State
OUB Instruction OFF
OFDL Instruction
Reset.
SHOT Instruction
C Instruction State hold.
CJ/NCJ/GOTO Instruction Not jumped.

·The operations of a ladder program in the module are the same as those when the program
is stopped or the execution condition of MC instruction is OFF only for one scanning period.
For details on instructions, please refer to "5-9 Memory Card Instructions" in the KV5000/3000/1
series Instruction Reference Manual

3-98 - KV-5000/3000 Series User’s Manual-


3-8 Module

Fixed-Period Module

LADDER PROGRAMMING
Routines in Fixed-Period Module can be separated from ordinary scanning and executeed according to
pre-defined period. Each project can only use one Fixed-Period Module.

■ Fixed-Period Module Execution


To execute Fixed-Period Module, in addition to writing the Fixed-Period Module, the following also needs to be done .

● Interrupt enable (EI) instruction


Like the interrupt routine, Enable/Disable of the fixed period execution is done through the EI/DI instruction. 3
The EI instruction is written in each scanned module and executed.

Module
Example

CR2002
EI
Always ON

"EI/DI Instruction", Page 3-47

● CPU System settings


Open the "CPU system settings" window from the KV STUDIO workspace, and set up the execution period
and priority in the "Fixed-period execution and user interrupt" settings option of the "Program settings".

"Fixed-Period Module settings "


The period range is 0.2ms to 6000.0ms (0.1ms scaling unit).
If you want to execute Fixed-Period Module right from the program is started, select the "Execute right
from the start" check box. If you want to start/stop it during operation, use the module instruction
(MDSTRT/MDSTOP).
"interrupt priority settings"
When set priority of Fixed Period Module to "medium", only interrupt program set to "high" could realize
multiple interrupt in execution process of Fixed-Period Module program.Interrupt program set to
"Middle" "low" cannot realize interrupt in execution process of Fixed-Period Module program.
In addition, in execution process of interrupt program set to "low", interrupt and execute Fixed-Period
Module, in execution process of interrupt program set to "high""medium", execution of Fixed-Period
Module could only be in waiting state.

- KV-5000/3000 Series User’s Manual- 3-99


3-8 Module

■ Fixed-Period Module Operation


LADDER PROGRAMMING

● When the "Execute right from the start" check box is selected (default)
If EI instruction is executed, begin to execute Fixed-Period Module.

Start operation

Scan time Scan time

Except fixed 1st scan 2nd scan


cycle module

3 Execute E1 command
Fixed cycle module
Module

Execution cycle Execution cycle Execution cycle

● When the "Execute right from the start" check box is in selected state
In EI instruction execution state, the module instruction is used to control execution state of Fixed Period
Module.

Scan Scan time Scan time

Except fixed cycle module

Execute MDSTRT Execute MDSTOP


instruction instruction OFF
Fixed cycle module process

Execution cycle Execution cycle Execution cycle Execution cycle


Not execute Not execute

For OFF processing, please see "Stop Standby Module", Page 3-98.

Note
Execution period is irrelevant with execution state of Fixed-Period Module, counting is started
when starting to run. After setting Fixed-Period Module to the execution state, the first
constant period is executed immediately after execution of EI instruction when EI instruction is
executed during running. Therefore, the first and second period might be incorrect.

·When all of the following conditions are met, the period fluctuation is within 70µs.
When selecting the "Enable interrupt during instruction execution" checkbox in "Fixed
period execution and user interrupt" setting of "CPU system setting"
User interrupts with a priority higher than Fixed Period Module are not used
KL-N20V, KV-CL20, KV-DN20, KV-H20, KV-H20S, KV-H40S (when used, up to 120µs) are not used
FASC instruction (when used, up to 107µs) is not programmed in the program
RFASC instruction (when used, up to 107µs) is not programmed in the program
·When fixed-period execution timing occurs in interrupt disable state (when executing DI
instruction) within the same execution period, Fixed-Period Module is executed in the
interrupt enable state (executing EI instruction), .

Fixed-Period Module is separated with the ordinary scanning in interrupt processing. For details, please
refer to "3-5 Interrupt", Page 3-31.

3-100 - KV-5000/3000 Series User’s Manual-


3-8 Module

■ Device processing in the start/end

LADDER PROGRAMMING
Device processing at start/end is the same as ordinary interrupt processing, at start/end of Fixed-Period
Module execution, the following projects are saved/reset automatically.
·Internal register
·Calculation flag (CR2009 to CR2012)
·Index register(Z11 to Z12)
·TM0 to TM3
Relay To programed in just executed STG instruction operand

Note
CPU built-in input (R000 to R015) cannot save/reset.
3

Module
Index register Z01 to Z10 can be set to execute save/reset processing in "CPU system
setting" -> "fixed period execution and user interrupt" settings.

■ About auto refresh


The execution of Fixed Period Module is different from ordinary interrupt processing in that the
following updates cannot be performed :
(1) direct input processing of CPU built-in input (R000 to R015)
(2) To programing direct output processing of CPU built-in output (R500 to R507)through SET/RES
instruction
(3) update processing of high-speed counter current value (CTH0/CTH1)

If the above-mentioned items need to be updated in Fixed-Period Module before END processing,
please do the following setups:
(1) through "DR" To program instruction Or To program "RFSX" instruction.
(2) through "DR" To program instructionOr To program "RFSX" instruction.
(3) To program "RFSCTH" instruction.
"About Direct Processing", Page 3-16

Note
In Fixed-Period Module, direct output cannot be enabled even if SET/RES instruction is
used to execute output to CPU built-in output (R500 to R507) .

- KV-5000/3000 Series User’s Manual- 3-101


3-8 Module
LADDER PROGRAMMING

Module Execution Sequence

The execution sequence within a scanning period can be set up for the modules registered in a project.
Generally, this sequence is the module arrangement sequente. However, if execution sequence of
ladder program in a scanning period has an adverse effect on the run of KV-1000 PLC, please change
execution sequence.
Open "CPU system setting" from work space, select "program settings" -> "Execute sequence of
modules" setting.
3 Sequence Module name Module type
Module

1 Analog process Fixed cycle


2 Locating initialization Initialization Order replaceable range

3 High-speed counter initialization Initialization

4 Locating Every scan


5 Update record information Standby
6 High-speed counter Every scan Order replaceable range

7 Communication process Standby


8 Main operation process Every scan

The following settings rules apply to module execution sequence within a scanning period.

· Although sequence can be changed in the initialization module, this cannot be done for other types of
module.
· Although execution sequence of Every-Scan Execution Type Module and Standby Module can be
changed, it should not be moved before initialization module.
· Sequence change cannot be made to Fixed-Period Module.(always displayed in the leading
address.)

3-102 - KV-5000/3000 Series User’s Manual-


3-8 Module

LADDER PROGRAMMING
Example: Module Configuration

This example shows how to configure a module.


In order to further simply description, initialize module/Fixed-Period Module is omitted.

Legend

Execute-type module Backup module


in every scan

3
● Functional Configure

Module
Module programming and classification are done according to processing content, connected device,
as well as expansion unit.
By disnabling unnecessary modules, commissioning can be easier and scanning time can also be
shortened.

For module control*

Function A Function B Function C Function D Function E

Module executed from


start of operation

Modules to stop at
start of operation

* Through "module control " module, execution state of each function can be controlled.Please as required
create module control module.
- KV-5000/3000 Series User’s Manual- 3-103
3-8 Module

● Process Configuration
LADDER PROGRAMMING

Module programming is done based on process or task.


In this example, Every Scan Execution Type Module is used to program the module to be executed
when run starts, and all the other modules are programmed using Standby Module.

Process 1

3 Process 2
Module

?
Abnormal
Process 3
monitor*

* Please program this


Process 4 as required.

Process 5

Since module execution sequence is the execution sequence within a scanning period, then it is
unnecessary for a programmer to consider the module execution sequence during programming.

● No need to consider module in programming


When programming a new project, since an Every Scan Execution Type Module with the same project name
will be generated automatically, therefore it is unnecessary to consider module issues during programming.

3-104 - KV-5000/3000 Series User’s Manual-


3-8 Module

LADDER PROGRAMMING
Module Device

Module device is the device that is used to capture the module operating state.
Referencing from other module or macro is needed only when the bit is ON.

Note
Device comments cannot be attached to a module device.

Module devices are specified to KV-5000/3000 workspace by KV STUDIO automatically.


3
● Bit only connects a scanning period "@CR2008" when module execution starts

Module
Bit only connects a scanning period "@CR2008" when module execution starts
It is disconnected after the second scanning period (OFF).
The bit can be refered only in self module. Every macro executed in self module can not be referred.
In KV STUDIO, this device is represented by "@CR2008".

● Bit only cuts off a scanning period "@CR2007" when module execution starts
Bit only cut off a scanning period "@CR2007" when module execution starts
Connected after the second scanning period.
The bit can be refered only in self module.Every macro executed in self module can not be refered.
In KV STUDIO, this device is represented by "@CR2007".

● Execution ON Bit
ON Bit refers to the bit to connect ON in a module execution process.
Since this bit is in self module and can be refered from other module/macro, then enable this bit (for
example) if you want to control module execution.
In KV STUDIO, this device is represented by "_ (module name)".

Example
_automatic _main
execution

- KV-5000/3000 Series User’s Manual- 3-105


3-8 Module

Module instructions
LADDER PROGRAMMING

MDSTRT MDSTRT Module execution


start
Start execute specified
module.

MDSTOP MDSTOP Module execution


stop
Stop execute specified
module.

Ladder program Input mode


Execute condition MDSTRT
S M D S T R T S

3 Execute condition MDSTOP


S M D S T O P S
Module

Available Devices
Index
Cons Indirect Local Change
Bit device Word Devices tant specifying device
Operand
MR DM EM
R DR LR T C CTC CR FM ZF T C CTH CTC Z CM #/$ #TM * @ : #/: Z
B TM W
S ∗1
- - - - - - - - - - - - - - - - - -

Operand Explanation
S Specify the module name.*1

*1 """","#" and "$" cannot be used. Please enter the module name specified in "KV STUDIO" Directly.
For half-width English letters, 24 characters can be specified, for full-width, 12 characters can be
specified.

Description of Operation

MDSTRT When line condition is ON, start the module specified in S .


Operate specified module from start of next scanning period.
Do not operate already started module.
MDSTOP when execute condition is ON,the module specified in S .
specified module stops after OFF processing in the next scanning period.
Do not operate already stopped module.
This instruction may also stop its own module.

Please see "Standby Module Operation", Page 3-98.

Note
· The initial state of the differential execution instruction when Standby Module is started is ON
in the up edge, and OFF in the down edge. When beginning to execute, do not test the
differential signal immediately.
· If the MDSTRT and MDSTOP instructions need to executed for many times in the same module
and scanning period, this is then done according to the finally executed module instruction.
· Please do not stop all modules. If all modules are stopped, all programs will not be executed.
Please use the following method to restore.(if program is not stopped, it cannot return.)
◆ Please power off KV-5000 /3000 PLC once, then connect power supply again.
◆ Please switch KV-5000/3000 PLC "RUN-PROG selector switch" to "PROG"
mode, then switch to "RUN" mode.
◆ In KV STUDIO, turn program RUN mode OFF, then on.

3-106 - KV-5000/3000 Series User’s Manual-


3-8 Module

· In OFF processing, the processing with the same execution condition as "MC instruction "

LADDER PROGRAMMING
is scanned only once. For more information, please refer to "MC instruction ".
· Execution of initialization module cannot be stopped or started.

Operation flag

CR2009 No change in status


CR2010 No change in status
CR2011
CR2012
No change in status
No change in status
3

Module
Sample Program

If the up edge of input relay R000 is detected, the selected mode (R001 to R003) is executed ; if input relay
R009 is ON, all the modules are stopped. Do not execute other modules when a module is executed.

R000 Module 1 Module 2 Module 3 R001 MDSTRT


↑ Module 1 Execute “module 1” when R001 is ON

Execute module in progress ON bit*1 R002 MDSTRT


Module 2 Execute “module 2” when R001 is ON.

R003 MDSTRT
Module 3 Execute “module 3” when R001 is ON.

R009 MDSTOP
Module 1

When R009 is ON
MDSTOP
Module 1 to 3 stop
Module 2

MDSTOP
Module 3

;(mnemonics list)
LDP R000
ANB _ Module 1
ANB _ Module 2
ANB _ Module 3
MPS
AND R001
MDSTRT Module 1
MRD
AND R002
MDSTRT Module 2
MPP
AND R003
MDSTRT Module 3
LD R009
MDSTOP Module 1
MDSTOP Module 2
MDSTOP Module 3

*1 For detailed information of module execution on, please refer to "modular System Device", Page 3-105.

- KV-5000/3000 Series User’s Manual- 3-107


3-8 Module

MEMO
LADDER PROGRAMMING

3
Module

3-108 - KV-5000/3000 Series User’s Manual-


3-9 Macro

LADDER PROGRAMMING
Overview

A macro is a ladder program section that is used again and again in a project. Programming workload can be
reduced writing a frequently used ladder routine as a macro, just like a ladder instruction. To change a
program section, you just need to modify macro data, thereby significantly reducing programming workload.

<Before import macro> <After import macro>

Project 1 Project 1

[Module A] [Module A] 3

Macro
Macro C

[Module B]
Macro call
[Module B] instruction

Macro C

Macro C

Same process
is registered as [Macro C]
a macro.

■ Macro Management
In KV STUDIO, the "Workspace" is used to manage each project.
In addition, for facilitating the next time use, you can register a frequently used macro in the "program
library (user))" in advance.

Workspace

- KV-5000/3000 Series User’s Manual- 3-109


3-9 Macro

■ A macro can be used in the following cases:


LADDER PROGRAMMING

● Used as original instruction


If a frequently used program segment is registered as a macro, manual entry workload can be reduced.
The number of rungs in ladder program can be reduced, making program structure more clear.
Any name can be designated to a registered macro.

● An argument can be used

3 If an argument is used, operands (device and value) in the macro can be specified in macro calling,
thereby creating a more universal macro.
Macro

"Argument Setting", Page 3-117

● Two types of macro can be created


There are two types of macro: subroutine macro and self-hold macro .
subroutine macro, is same as subroutine, is executed only when execution condition is ON.
self-hold macro , once begin to execute, until macro executes stop instruction(MEND macro ends),
continuous action will be performed without considering execution condition state.
It is very convenient use macro, for example, for the processing that requires time to complete after
expansion unit and external equipment request processing (processing crossing scanning period).

"Macro Type", Page 3-112

● A local device can be used


In other module or macro, even if local devices of the same No. Are used, they will be processed as
different devices,
Therefore, distribution of devices that are used only in module and macro may be managed simply.

"3-10 Local Device", Page 3-131

● Reuse a macro
For frequently used macro, click "macro" mark number on work space, log on "program library" -> "user"
in advance, realize program reuse simply.

● A System macro can be used


Use system macro that could realize expansion unit control simply.
Click "macro" mark number on work space, drag to ladder edit window from "program library" ->
"system".

● Password protection
In order not to change macro content easily, set password.
If password is set, people who do not know the password cannot display or edit macro program.
Password is set in "Module/macro properties" (module/macro attribute) dialog box.

3-110 - KV-5000/3000 Series User’s Manual-


3-9 Macro

● An entity can be created in each time macro calling

LADDER PROGRAMMING
When call macro module, create ladder program (Entities). If the same macro needs to be executed for
many times within the same scanning period, or several macros need to be executed crossing
scanning period, by using together with local device, conflict between devices and execution state of
corresponding macro may not be considered.

"Difference Between Macro and Subroutine", Page 3-126

The procedure to use a macro


3

Macro
To use a macro, the following steps should be followed:

(1) New macros


"Modules/macros(M)" -> "New macro(M)"
Select macro type "Macro Type", Page 3-112

(2) Programming
Write ladder program in created macro.

(3) Setup arguments


"Module/macro (m)" -> "Macro argument setting (z)"
Log on independent variable. "Argument Setting", Page 3-117

(4) Programming for macro call instruction


Through special instructioncall out fabricated macro. "Μαχρο ινστρυχτιον", Page 3-122
If necessary may use system device. "Macro System Device", Page 3-119

- KV-5000/3000 Series User’s Manual- 3-111


3-9 Macro
LADDER PROGRAMMING

Macro Type

There are two types of macro: subroutine macro and self-hold macro .

Sub-routine macro

● OVERVIEW

3 subroutine macro, is the same as subroutine, executes program in macro only when execution condition is ON,
according to each macro call instruction(M CALL). After execution is finished, proceed to next step of macro call
instruction.Execution when condition is OFF, do not execute program in macro, proceed to next step.
Macro

● How to use
subroutine macro, starts according to MCALL instructionfrom module.

R30013 MCALL Macro A

Start by MCALL instruction

● Description of Operation
Description of subroutine macro action is shown in the figure below.
An example of calling macro A twice in a module is shown in the figure below.
To discriminate the macro created, plus " # (management no.) " after macro name for management.
In KV STUDIO, the macro is only displayed during Monitor and Simulator.
Module 1 Individual entities (macro A#1, macro A#2) are
created individually by the MCALL instruction.
When the execution condition of the
MCALL instruction is ON, module 1 is executed,
and the respective macro is executed.
ON
MCALL Macro A

Macro A#1

OFF
MCALL Macro A

×
Macro A#2

3-112 - KV-5000/3000 Series User’s Manual-


3-9 Macro

● The action following the execution stop

LADDER PROGRAMMING
Subroutine macro will be executed only in a scanning period when execution condition is OFF, all
execution conditions are OFF.*
It will be stopped in the next scanning period.

<Illustration of how sub-routine type macros function>

Scan once Scan once Scan once Scan once Scan once

Macro
Execute condition
OFF ON ON OFF OFF
of calling macro A

Execution under
Macro A Stop Execution Execution OFF condition Stop

* But, the following instructions are exceptional.


Instruction State
OUB Instruction OFF
OFDL Instruction
Reset.
SHOT Instruction
C Instruction State hold.
CJ/NCJ/GOTO Instruction Not jumped.

When macro execution stops, MC instructionexecution condition is OFF, processing will only
execute a scanning period.
For details on instructions, "KV5000/3000/1000 series Instruction Reference Manual "MC/MCR"

Self-hold macro

● Overiew
self-hold macro , is the same as subroutine macro, when execution condition is on, execute the program
in macro according to each macro call instruction ( MSTRT).Once macro starts, until after next scanning
period, macro in macro executes stop instruction (MEND), in this period, irrelevant with execution
condition of macro call instruction, continue to act.

● how to use
self-hold macro , starts according to MSTRT instructionfrom module..

R30013 MSTRT Macro A

Start by MSTRT instruction

- KV-5000/3000 Series User’s Manual- 3-113


3-9 Macro

● Description of Operation
LADDER PROGRAMMING

The Description of Operation of self-hold macro is shown in the figure below.


An example of calling macro A twice in a module is shown in the figure below.

1 When the execution condition is ON, start Macro A.

Module 1

ON

3 MSTRT Macro A
Macro

Macro A#1

MEND

ON
MSTRT Macro A

Macro A#2

MEND

To discriminate the macro created, plus " # (management no.) " after macro name for management.
In KV STUDIO, the macro is only displayed during Monitor and Simulator.

2 Once started, the execution continues irrespective the execution condition state of MSTRT instruction.

Module 1

ON
MSTRT Macro A

Macro A#1

Program operation MEND


is continued even if
execution condition
turns OFF.

OFF
MSTRT Macro A

Macro A#2

MEND

3-114 - KV-5000/3000 Series User’s Manual-


3-9 Macro

3 If the execution condition of a MEND instruction in macro is ON, all the execution conditions will

LADDER PROGRAMMING
be OFF in the next scanning period, and only one scanning period is executed in the macro.*
It will be stopped in the next scanning period.

Module 1
When the execution condition of the MEND instruction
turns ON, the macro is executed for one scan only
with all execution conditions OFF at the next scan.

OFF
MSTRT Macro A
3

Macro
Macro A#1

ON MEND

OFF
MSTRT Macro A

Macro A#2

ON MEND

Note
· In a self-hold macro , the MEND instruction must be included.
· To stop a macro, the macro execution condition must be OFF. If macro execution
condition is ON, macro will not stop, even if MEND instructionexecution condition is on.

* But, the following instructions are exceptional.

Instruction State
OUB Instruction OFF
OFDL Instruction
Reset.
SHOT Instruction
C Instruction State hold.
CJ/NCJ/GOTO Instruction Not jumped.

When macro execution stops, MC instructionexecution condition is OFF, processing will only
execute a scanning period.
For details on instructions, see "KV5000/3000/1000 seriesInstruction Reference Manual "MC/MCR"

- KV-5000/3000 Series User’s Manual- 3-115


3-9 Macro

● The action taken when execution is stopped


LADDER PROGRAMMING

self-hold macro , only in next scanning period when macro stop instruction(MEND) is executed, execute a
scanning period taking all conditions as OFF. It will be stopped in the next scanning period.

[Operation message of self-hold type macro]

Scan once Scan once Scan once Scan once Scan once Scan once

3 Execute condition
of calling macro A
OFF ON *1 *1 OFF*2 OFF*3
Macro

Execute condition - OFF OFF ON *1 -


of calling macro A

Execution under
Macro A Stop Execution Execution Execution Stop
OFF condition

*1: Operation is not affected in either of the ON/OFF states.


*2: Be sure to set to OFF. Program execution is continued with the MEND instruction
ignored until the state changes to OFF.
*3: Execution of the macro is started if the state is ON.

3-116 - KV-5000/3000 Series User’s Manual-


3-9 Macro

LADDER PROGRAMMING
Argument Setting

■ What is argument
The so-called independent variable is device and value transferred with respect to macro Entities when
macro is called.Independent variable is designated as macro call instructionoperand.In the macro, use
transferred device or value to execute ladder program.If macro is being executed, independent variable
is refreshed once per scanning period.

Module 1 3

Macro
MCALL Macro A Call
R001 #50
Argument 1 Argument 2
Macro A

Argument 1 MOV
Argument 2 DM0
When the macro is called, the
specified devices and values
are used to execute the macro
in the ladder program within the R001 MOV
macro. #50 DM0

■ Argument device list


The so-called independent variable device is the device used as which instructionoperand in macro to
designate transferred device and value.Independent variable device may be used only in the macro.
Select "module/macro (m)" -> "macro independent variable settings (z)"from KV STUDIO menu, set up
in the displayed dialog box.There are four types of independent variable device.Including: P, V, UR,
UM.Specification of the devices is as follows.
Indirect
Local Index
Type Sign Range Description specifyi
device(@) Change (:)
ng(*)
Device P P0 to P9 Process the device as independent
× × ○
variable.
*2
value V V0 to V9 Process the value of device or
× × ×
constant as independent variable.
Unit device UR UR0 to UR9 Process the initial relay distributed in
* × × ○
(R) expansion unit as independent variable.
Unit UM UM0 to Process the initial data memory
device UM9 (DM) distributed in expansion unit × × ○
(DM)* as independent variable.
Unit No.*1 UV UV0 to UV9 Accept expansion unit No.. × × ×

*1 In macro call instruction, only designate source unit No..


The number of units in a macro that may be designated as independent variable is up to 5 .
*2 After DR is designated, before calling out macro, execute direct processing, accept the result as
independent variable.

- KV-5000/3000 Series User’s Manual- 3-117


3-9 Macro

● Use example
LADDER PROGRAMMING

Example of independent variable device is shown in the figure below.


Module 1 begins to execute macro call instructionof macro 1, here is an example.

"Independent variable device use example"


  Argument 1:URO/UMO<-#1
  argumens2 : PO<-MR000
  Argument3 :VO<-#1000

3   Argument4 :V1<-DM0
  (Unit No 1)…KV-AD40 R30000 to R30115
Macro

DM10000 to DM10021

Module 1
@CR2008 ࡑࠢࡠੑҸ
ࡑࠢࡠ
MCALL Macro 1 Macro ੑҸ
instructions
#1 MR000 #1000
Argument 1 Argument 2 Argument 3

DM0
Argument 4

UMO: DM10000
URO: R30000
Call P0: MR000
V0: #1000
Macro 1 V1: #1234

UR0 74 @R000


SET

R30000 R30001
UR0:#02 P0
SET

R30002 MR000
P0 MOV
#0 UM0:#4

MR000 DM10004
MOV
V1 UM0:#3

DM0ⱘؐ = #1234 DM10003


MOV
V0 @DM0

#1000

Note
When character string is used as independent variable, please use independent variable
device (P) to designate initial device of saved character string. Character string directly
designated by independent variable device (V) cannot be used.

3-118 - KV-5000/3000 Series User’s Manual-


3-9 Macro

LADDER PROGRAMMING
Macro System Device

Macro system device is the device that is used to capture module operating state.
Only the ON bit needs to be looked up from other modules or macros.

Note
Module system device does not allowe additional device notes.

Macro system device is internal workspace distributed to KV-5000/3000 by KVSTUDIO 3


automatically.

Macro
● Bit only connects a scanning period when module execution starts "@CR2008"
Bit only connects a scanning period "@CR2008" when module execution starts
Disconnected after the second scanning period (OFF).
The bit can be referred only in self macro.Module in calling macro cannot be referred.
In KV STUDIO, this device is expressed by "@CR2008 ".

● Bit only cuts off a scanning period when module execution starts "@CR2007"
Bit only connects a scanning period "@CR2008" when module execution starts
Connected after the second scanning period.
The bit can be referred only in self macro.Module in calling macro cannot be referred.
In KV STUDIO, this device is expressed by "@CR2008".

● Execution ON Bit "ID No."


Executing ON Bit refers to the bit connected (on) in execution process of corresponding macro.
Since reference may be made from each module, therefore it is valid when controlling macro execution,
for example, make reference before calling out macro etc.
In KV STUDIO, this device is programmed to "_ (macro name) _ (identification number)".

Example
_Batch send_2 Parameter
arithmetic
operation _1

In order to use Execution ON Bit, each call macro needs identification number.
"Execution ON Bit", Page 3-120

- KV-5000/3000 Series User’s Manual- 3-119


3-9 Macro
LADDER PROGRAMMING

Execution ON Bit

■ Overview
Executing ON Bit refers to the bit which puts the connection to ON in execution. Since this can be
referred from a module, then it is useful in controlling macro execution, for example, making reference
before macro calling.
To use the Execution ON Bit , each macro to be called needs an identification number.
In KV STUDIO, this device is programmed to "_ (macro name) _ (identification ID No.) ".
3
■ Execution ON Bit Setting
Macro

If "ID No." is selected in "Instruction/macro/pack pallet", use executing on bit.


how to use.

1 From the macro template, select "ID No.(in exectution)".

Note
If "ID No. (in exectution)" is not selected in macro template, macro executing on bit may not be used.

2 Enter the macro id.

No. will be defaulted as "1" when applying


detection for "Identify No. (bit in execution)".

If the same macro is used for many times in the same project, it may be used after changing No..

Note
If the same No. Is designated in the same macro, conversion error will occur.

3-120 - KV-5000/3000 Series User’s Manual-


3-9 Macro

● Example

LADDER PROGRAMMING
Macro 5 is not executed even if R000 turns ON
while macro 4_1 and macro 4_2 are running.

CR2008 MSTRT Macro 4_1

@EM0 #100
Macro 4_1

MSTRT Macro 4_2

@EM100 #1000 3
Macro 4_2 Macro 4_2

Macro
Execute in progress ON bit
R000 _Macro 4_1 _Macro 4_2 MCALL Macro 5
#1 #2 @FM0
Macro 4_1
Execute in progress ON bit
#0

Note
If macro executing ON is not used for programming (macro is not designated by macro call
instructionin the project), conversion error will occur.

In the same macro, macro call instructionwith identification number when without
identification number may be used together.

Can’t use ON bit during execution.

R000 _Macro 4_1 MCALL Macro 4

@EM0 #100

R001 MCALL Macro 4_1

@EM10 #1000

Can use ON bit during execution.

- KV-5000/3000 Series User’s Manual- 3-121


3-9 Macro

Macro instruction
LADDER PROGRAMMING

MCALL MCALL
Macro call
Executes the sub-routine macro
specified.(programming in the module)

MSTRT MSTRT
Macro start Execute designated self-hold macro
.(programming in the module)
Stops execution of the self-hold type
MEND MEND
Macro end macro.(programming in self-hold
macro )

3 Ladder program Input mode


Execute condition MCALL *1

ǒ Ǔ
Macro

Based on macro that shall execute*1 M C A L L S Argument 1 Argument 2 …

Execute condition MSTRT *1


Based on macro that shall execute*1 M S T R T S ǒ Argument 1 Argument 2 Ǔ

Execute condition MEND


M E N D

Available Devices
Index
Bit device Word Devices Const Indirect Local Change
ant specifying device
Operand
MR DM EM
R DR LR T C CTC CR FM ZF T C CTH CTC Z CM #/$ #TM * @ : #/: Z
B TM W
S - - - - - - - - - - - - - - ○ *2 - - - -

Operand Explanation
S Specify macro name.*3
*1 Number (0 to 10) and attribute behind the second operand might be different due to different
independent variables set in the macro currently to be executed.
Device that may be used in attributes is shown below.
Available Devices ≤♦ ≤♥ : Ονλψ συππορτ Κς−5000/3000
Indirect Index
Const Local Change
Bit device Word device∗1 ant specifyin device
Attribute g
MR DM EM
R DR LR T C CTC CR FM ZF T C CTH CTC Z CM #/$ #TM * @ : #/: Z
$B TM W
Device ○ - ○ ○ *4 ○ *4 ○ ○ ○ ○ *4 ○ *4 - - - ○ - - ○ ○ ○
Value ○ - ○ - - - ○ ○ ○ ○ ○ ○ ○ ○ ○ - ○ ○ ○
Unit - - - - - - - - - - - - - - ○ *5 - - - -

*2 don't used"""", "#"and"$".Please Input Set Module Name in "KV STUDIO" Directly.
For half-angle English number, 6 characters may be designated, for all angle, 12 characters may
be designated.
*3 When identification number is used, format is "(macro name) _ identification number". Example in
batches _2
For point parameter, please see "Execution ON Bit", Page 3-120 .
*4  According to instructionused in the macro, timer/counter processing will be different. 
(For exaple) Process current value when MOV instruction. For detail, please refer to instructions
description.
*5 Designate expansion unit No..When macro template is used, select and designate source
expansion unit from list.

3-122 - KV-5000/3000 Series User’s Manual-


3-9 Macro

LADDER PROGRAMMING
Description of Operation

MCALL When execute condition is ON, S When execution condition is on, this instructionwill
be executed in each scanning period.
Designated macro begin to be executed when execution condition is OFF -> on.
When execute condition is ON -> OFF, then OFF processing is performed.

MSTRT When execute condition in ON. S When execution condition is on, this instructionwill
be executed in each scanning period. 3
Designated macro begin to be executed when execution condition is OFF -> on.

Macro
Once begin to execute, even if execution condition is OFF, continue to execute macro.
MEND when execution condition is on, the self-hold macro that uses MEMO instructionfor
programming will perform OFF processing in the next scanning, stop execution in the
next scanning.

Scan
ON

Execute condition
OFF

MSTRT Execution OFF process


ON

Execute condition of MEND instruction


OFF

MEND Execution

Note
· For MCALL/MSTRT instruction, after add/delete/call out sequence change is executed, it
cannot be written in the RUN.
· In order to stop execution of self-hold macro , please use MEND instructionin the macro.
If MSTRT instructionexecution condition is always on, MEND instructionmay be omitted.
· MEND instructioncannot be programmed in module and in subroutine macro.
· MEND instructioncannot stop other macro.
· The previous state of differential execution instructionin macro is initialized when each
macro begins to be executed.(up differential: on, down differential: OFF)
· If MCALL/MSTRT instructionattribute of an operand is a value, and T/C/CTH/CTC is
designated in this operand, the following value will be transferred into macro.
T/C : 32-bit counter (current value)
CTH : 32-bit counter (current value)
CTC : Set value(32-bit counter)
· When program MCALL/MSTRT instruction between MC to MCR instructions, if in macro
execution process, MC instructionexecution condition is OFF, execute OFF processing in this
scanning, in the next scanning, stop execution.
· If MCALL/MSTRT instructionis programmed in subroutine (between SBN - RET instructions),
condition transfer (between CJ/NCJ to LABEL instructions), step (between STP to STE instructions)
or interrupt (between INT to RETI instructions), when the instructionbetween instructions in macro
execution process is not executed, macro execution will be suspended.When instructionbetween
instructions are executed again, start macro execution again.Now, the previous state of differential
execution type instructionin the macro is not initialized. ( (When programming in initialization
module, execute scanning only onces when running starts.)
- KV-5000/3000 Series User’s Manual- 3-123
3-9 Macro

· If MCALL/MSTRT instruction programs a control section (between STG - JMP


LADDER PROGRAMMING

instructions), STG instructionrelay is OFF during macro execution, then subroutine macro
is executed in this scanning period when all execution conditions are OFF, stops execution
in the next scanning period.Execution of self-hold macro is suspended.
· If a macro is being executed, the module programmed by MCALL/MSTRT
instructionstops, during OFF processing is executed in the module, OFF processing is also
executed in the macro simultaneously, execution stops in the next scanning period.
· For OFF processing, one scanning of "MC instruction" execution condition is in the same state as OFF.
· In the macro, MCALL instructionand MSTRT instructioncannot be used.
3 · In the macro, use subroutine, but interrupt program cannot be used.
· In the project, when execute the same macro for many times, if global device is used in
Macro

OUT/OUB instructionin the macro, it will become dual coil.

Operation flag

CR2009 Operation marking state depends on processing result in the executed macro.
CR2010 Operation marking state depends on processing result in the executed macro.
CR2011 Operation marking state depends on processing result in the executed macro.
It is ON when indirect specifying or index modification range is improper.OFF other than this.
CR2012
When indirect specifying, index modification unspecified in operand, it is not changed.

* If independent variable is inappropriate, macro will not be executed.


When CR2012 is on, detailed information of CM5100 to CM5176 error will be stored.
"Error Log (CM)", Page 3-20

Note
Use of MEND instructioncannot change operation marking state.

Instruction execution timing

MCALL When execution condition is on, this instructionwill be executed in each scanning
period.

Scan
ON

Execute condition
OFF

MCALL Execution Execution

MCALL When execution condition is on, this instructionwill be executed in each scanning
period.
MCALL When execution condition is on, this instructionwill be executed in each scanning
period.

3-124 - KV-5000/3000 Series User’s Manual-


3-9 Macro

LADDER PROGRAMMING
Example

Take EM0 as independent variable 1, #10 as independent variable 2, when input relay R000 on,
execute subroutine macro (macro A).

R000 MCALL Macro A ;(mnemonics list)


EM0 #10 LD R000
MCALL macroA EM0 #10

At up edge of input relay R001, take #1 as independent variable 1 (unit No.) , take #10 as independent
variable 2, execute self-hold macro (macro B).
3

Macro
R001 MSTRT Macro B ;(mnemonics list)
↑ ʿˍ #10 LDP R001
MSTRT macroB #1 #10

When input relay R002 is on, stop execution of self-hold macro (macro B).
࡮࡮࡮࡮

Macro B
;(mnemonics list)
LD R002
MEND
R002 MEND
࡮࡮࡮࡮

- KV-5000/3000 Series User’s Manual- 3-125


3-9 Macro
LADDER PROGRAMMING

Difference Between Macro and Subroutine

The same as subroutine, macro is also operated by call instruction. Macro and subroutine action will be
compared and described below.
For the error information, see "Subroutine", Page 3-27 .

● Creation of entities
<Macro>
3 Once a macro call instruction(MCALL, MSTRT) is programmed in the module, the same quantity of
Entities will be created.
Macro

Module 1 Macro A#1


Call
MCALL Macro A

Macro A#2
Call
MCALL Macro A

Call Macro A#3


MCALL Macro A

Module 2
Macro A#4
Call
MCALL Macro A

Macro A in register project


Each entity is created at each call.

·Macros that are registered in the project but not be called for even once (unused macros) will
not be transmitted to KV-5000/3000PLC. When check out project or check out according to
PLC program, unused macros will not be checked.
To discriminate the macro created, plus "# (ID no.) " after macro name for management. In KV
STUDIO, the macro is only displayed during Monitor and Simulator.

3-126 - KV-5000/3000 Series User’s Manual-


3-9 Macro

<Subroutine>

LADDER PROGRAMMING
In module/macro, subroutine is created between END instructionand ENDH instruction, is executed by
subroutine call instruction(CALL) programmed in module/macro main program.Not every call
instructioncreates Entities.

Module 1 Module 2
If use ECALL
#0 instruction, then
CALL subroutine of
other module can
#0
CALL
be executed.
3
#0

Macro
CALL

END END

SBN SBN
#0
Call
× #0

RET RET

ENDH ENDH

● Callable position
<Macro>
In module, if macro call instructionmay be programmed in any position of main program, subroutine or
interrupt program.Macro call instructioncannot be programmed in the macro.

<Subroutine>
Subroutine call instructionis valid only in the module/macro where subroutine is created.When execute
subroutine in other modules, use inter-module subroutine call instruction.

● Name
<Macro>
Macro may be named freely.
"Unusable Character String List", Page A-36

<Subroutine>
Subroutine uses No. For management.

- KV-5000/3000 Series User’s Manual- 3-127


3-9 Macro

● Argument
LADDER PROGRAMMING

<Macro>
//Settable

<Subroutine>
//Unsettable

● Action taken when the execution condition is OFF


3 <Macro>
Only when all programmed execution conditions are OFF, macro executes a scanning period. For
Macro

example, device that is programmed using OUT instruction could be OFF automatically.
"Macro Type", Page 3-112

<Subroutine>
Program in the subroutine cannot execute. Programmed devices will keep the state of final execution.

● Default differential execution instruction


<Macro>
Initial state of differential execution instruction, is on when up edge is detected, is OFF when down
edge is detected. When begin to execute, do not test difference signal immediately.

<Subroutine>
It is the same as macro only when it executes for the first time. From the second execution, it is
changed into the state of previous execution.

● Action taken when calling between MC (master control) to MCR (master control reset)
instructions
·When the MC instruction condition is ON
Operation is per normal for both macros and sub-routines.

·When the MC instruction condition is OFF


<Macro>
"Operation when the execution is OFF" above is executed and then stopped. (Self-hold type macros
also stop.)

<Subroutine>
Not execution.

3-128 - KV-5000/3000 Series User’s Manual-


3-9 Macro

● Applications

LADDER PROGRAMMING
In order to keep state and value of the device used at each call place

<Macro>···○
Because Entities will be created according to each call instructionrespectively, therefore if it is used
together with local device, device conflict may not be considered, keep the state of previous execution.

<Subroutine>···△
Since execute the same program, therefore always use indirect designation etc, create push protection
and pop to restore program.
3

Macro
When you want to execute to the end of a series of action at one time

<Macro>·· ·○
self-hold macro , once begin to execute, until macro executes stop instruction(MEND), in this period act
continuously without considering execution condition state.
In addition, when execute such processing simultaneously for many times, it is unnecessary to consider
device conflict and each action state.

<Subroutine>···△
Program that is required to prevent execution of condition OFF before action is finished.
In addition, when execute such processing simultaneously for many times, it is unnecessary to consider
device conflict and each action state.

If you want to reduce program step


<Macro>·· ·△
Since Entities is created as per each call instruction, therefore number of program step could not be
reduced.

<Subroutine>···○
Since Entities will not be created for whichever times of calling, therefore the more the call times is, the
more remarkable the number of steps is reduced.

- KV-5000/3000 Series User’s Manual- 3-129


3-9 Macro

MEMO
LADDER PROGRAMMING

3
Macro

3-130 - KV-5000/3000 Series User’s Manual-


3-10 Local Device
Up to now, PLC processing devices are universal in the whole project. Therefore, it is necessary for the

LADDER PROGRAMMING
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.
Therefore, even if a local device with the same number is used in other module or macro, it can also be
processed, thus facilitating the management and assignment of the devices which can only be used a
modul or macro.
In contrasting, devices that can be processed universally in the whole project are called "global device".

˘Default˚ < in KV STUDIO>


Project Project
3
Module A

Local Device
Program Local device
(Global) device

Module B

Global device
Program
Program Local device

Macro C

Program Local device

Local Device Programming

When programming, a local device can be designated by adding a prefix "@" onto device name.

Example
<Global device> <Local device>
EM0 @EM0
MR0 @MR0

Note
Programed as "@+ (Device No.)" only when Device No. is specified as the operand of timer/
counter command.
Mnemonic symbol input example: TMR @0 #100

- KV-5000/3000 Series User’s Manual- 3-131


3-10 Local Device
LADDER PROGRAMMING

Local Device List

What shown in the table below is default value of quantity and range of local device and global device that
can be used when creating projects.The number of appointed local device can be changed in "CPU
system setting" -> "Entire assignment setting of local devices" on "work space".
Local device Global device Total
Device name*1 *2
Reserved quantity in the whole project Counts/range number
16000 point (1000 channel) 16000 point
3 Relay (R) *3 None.
R00000 to R99915 (1000 channel)
Internal auxiliary 8000 point (500 channel) 16000 point
Local Device

8000 points (500 channel)


relay(MR)*3 MR000 to MR99915 (1000 channel)
8000 point (500 channel) 16000 point
Latch relay(LR)*3 8000 points (500 channel)
LR000 to LR99915 (1000 channel)
2500 point
Timer (T)*4 1500 point 4000 point
T0 to T2499
2500 point
Counter (C) *4 1500 point 4000 point
C0 to C3999
40535 point
Data memory (DM) 25000 point 65535 point
DM0 to DM65534
20535 point
Expansion data memory(EM) 45000 point 65535 point
DM0 to DM65534
512 point
Temporary data memory (TM) None. 512 point
TM0 to TM511

*1 Link relay (B), link register (W), file register (ZF), high-speed counter (CTH), high-speed counter comparator
(CTC), control relay (CR), control memory (CM) and index register (Z) cannot be used as local device.
When @FMxxx is used, consume work area as local device.
*2 When making new project, unifiedly ensure the area of device that can be used as local
device.(for calculation, assume to use 10 modules, call macro for 50 times.))
Reserved quantity of the devices is changed according to requirement.
*3 Use channel (ch) unit to set up use quantity.
*4 Programed as " @+ (Device No.) " only when Device No. is specified as the operand of timer/ counter command.
Mnemonic symbol input example: TMR @0 #100

Note
· If relay (R) and temporary data memory (TM) are used as local device, always set up the
quantity of relay and data memory.
· The following device must be processed as global device:
· KV-5000/3000 PLC I/O Relay List
· Expansion unit device
· Device for reference of touch panel etc external connection equipment
· Common device in the whole project
· Device that requires data transmission between modules
· Local Device shall be numbered from 0 using consecutive numbers as possible.
· Since R, DM is distributed in expansion unit, as global device, use area is required.When
use local device, please use MR or EM with priority.
· If local device or global device is used out of the specified range, conversion error might occur.
· When use various commands that designate first element as operand as well as index modification
or indirect designation, please do not exceed usable scope of local device or global device.

3-132 - KV-5000/3000 Series User’s Manual-


3-10 Local Device

LADDER PROGRAMMING
Local Device Assignment

For conversion, local device can be distributed to reserved area of each device type automatically

Device area
Start

Project 1

Module A
Global device of project 1
Program Local device 3

Local Device
Convert
Global device

Module B

Program Local device Local device of module A


Convert

Local device of module B


Macro C

Preset area of
Program Local device Convert
Local device of macro C local device

Not used

Last

Note
For macro, local device will be distributed according to call times in the project.

Local device is the just like global device, can use device notes.

- KV-5000/3000 Series User’s Manual- 3-133


3-10 Local Device

■ Batch assignment setting


LADDER PROGRAMMING

Although the number of local device used in a project can be pre-defined, the type of each device can
be changed. These changes can be kept in KV STUDIO for later project creation use.
Open "CPU system setting" on "Work space", select "Entire assignment setting of local devices".

3
Local Device

■ Set module/macro type device


Reserved quantity of local device used in module/macro can be set as per device type. Default setting
is "automatic", the number of local device used in module/macro will be set automatically, generally it is
unnecessary to pay attention.
Open "CPU system setting" on "work space", select "Entire local assignment: set module/macro type
device".

3-134 - KV-5000/3000 Series User’s Manual-


3-10 Local Device

LADDER PROGRAMMING
Typical Local Device entry and Conversion Error

● When entering a ladder


The following is a typical example of error information that might occur when input ladder.
If currently used is the device type that cannot used as local device,
B, W, FM, ZF, CTH, CTC, CR, CM and Z cannot be used as local devices.
"Local Device List", Page 3-132

● When converting a ladder


3

Local Device
The following is a typical example of error information that might occur when convert ladder.
If the device zone reserved for local device is currently used for global device
Tick off "Global device range" in "Entire assignment settings of local devices " dialog box.
Start Last
Assign all Global device Local device preset

Specify by global device

"Batch assignment setting", Page 3-134


Since the area of local device might be used when Unit Editor is used to set unit device, please confirm.
Start Last
Assign all Global device Local device preset

Unit device assignment

KV STUDIO User's Manual, “Chapter 3 Unit Editor"

If currently used local device is out of range


Error might occur only when automatic setting is not used, manual setting is used.
Please check"Entire local assignment: set module/macro type device" dialog box.

Example
@DM0 @DM1999
Assign by
module/macro
Setup range @DM3000

"Setup module/macro device", Page 3-134

- KV-5000/3000 Series User’s Manual- 3-135


3-10 Local Device

When the number of reserved devices is insufficient


LADDER PROGRAMMING

Check out the device with "Num" etc displayed in red in "Setup local device assignment" of "Entire
assignment settings of local devices" dialog box. So as to increase reserved quantity of this device,
reduce set quantity of local device for each module/macro, let "available quantity" (local device
reserved quantity) is larger than as far as possible.

Start Last
Insufficient for
Assign all Global device Local device preset preset quantity

Number of used local devices


3 Module 1
Module 2
Module 3
Module 4
Local Device

"Batch assignment setting", Page 3-134

3-136 - KV-5000/3000 Series User’s Manual-


3-11 File Register

LADDER PROGRAMMING
Overview

File register may be divided into "ZF" that processes all areas in consecutive number mode, and "FM"
that divide the area into four memory banks (0 to 3) to process in memory bank switching mode.

Database switch mode Continuous No. mode


FM0 ZF0
to Storage unit 0 to
FM32767 ZF32767
FM0 ZF32768 3
to Storage unit 1 to

File Register
FM32767 ZF65535
FM0 ZF65536
to Storage unit 2 to
FM32767 ZF98303
FM0 ZF98304
to Storage unit 3 to

FM32767 ZF131071

For example, FM0 and ZF32768 of memory bank 1 refer to the same data store part.
For detailed condition of device No. And data treatment method etc, please refer to "3-6 Device and Constant",
"File Register ZF/FM", Page 3-68.

Bank Switchover

To switch to another memory bank, use the "FRSET instruction".


Currently designated memory bank is called current memory bank.

Example
R000 CM710 FRSET When current database is not 1 ;(mnemonics list)
<> #1 LDP R000
ʿ1 MPS
File register current database Switch the current database to 1 AND<> CM710 #1
FRSET #1
MPP
MOV
Copy value in FM0 (˙ZF32768) to DM0 MOV FM0 DM0
FM0 DM0 LDP R001
MPS
AND<> CM710 #0
When current database is not 0 FRSET #0
R001 CM710 FRSET MPP
<> #0 MOV FM0 DM0
ʿ0 Switch the current database to 0
File register current database

MOV
Copy value in FM0 (˙ZF0) to DM0
FM0 DM0

"FRSET", Page 3-141

·No. Of current memory bank may be confirmed by CM710.


·Can use KV mode (upper link) "BE" instruction, to switch memory bank.
KV-L20V User's Manual KV-LE20V User's Manual

- KV-5000/3000 Series User’s Manual- 3-137


3-11 File Register
LADDER PROGRAMMING

Defaults

When preset the value of file register (consecutive number mode), open "device default setting" dialog
box on KV STUDIO work space to set.

3
File Register

After transmit the project set in this dialog box to CPU unit, when switch PROG -> RUN mode, read set
initial value automatically.
KV STUDIO User's Manual "Device Default Value Settings"

File Register Setting

Use special instruction, take the memory card that is inserted into CPU unit as object, save/load the
data of file register (file register setpoint).
FRSTM instruction: save file register of designated memory bank into memory card
FRLDM instruction: read the file saved in memory card to the file register of designated memory bank
"FRSET", Page 3-143, "FRLDM", Page 3-145

FM0 FRLDM instruction


Storage unit 0
̚

FM32767
FRSTM instruction
FM0
̚

Storage unit 1
FM32767 Memory card

FM0
̚

Storage unit 2
FM32767 Max. 1000 files
FM0
̚

Storage unit 3
FM32767

Save setpoint of file register up to 1000 files in memory card ahead of time, read when required for
program switching purpose, it is unnecessary to note the number of device.

3-138 - KV-5000/3000 Series User’s Manual-


3-11 File Register

■ File register set value management

LADDER PROGRAMMING
Files saved in memory card (file register setpoint) may be edited through KV STUDIO. Open "File
Register Settings" dialog box on work space to carry out edit, new, CSV file import etc. File register
setpoint should be managed according to different projects respectively.    
  KV STUDIO User's Manual "File Register Settings"

File Register
■ File register set value transfer
The method to write setpoint of file register created/edited by KV STUDIO into memory card, or read file
register setpoint file in memory card is as follows.

PC CPU unit

KVS project PLC transference, read

Ladder
File register Memory card
program

Import/export

Memory card

- KV-5000/3000 Series User’s Manual- 3-139


3-11 File Register

● PLC transfer/read
LADDER PROGRAMMING

Communication of PLC during transmission/reading is the same as other project information. During transmission,
other project information is saved in CPU unit body, only file register setpoint is saved in memory card.

3
File Register

KV STUDIO User's Manual “monitor"

● Import/export
Connect memory card to individual computer, execute import/export operation.

KV STUDIO User's Manual “file register setting"

File Register Instructions

Instruction mnemonics Instruction description Page


File register memory Switch current memory bank no. of File Register to
FRSET 3-141
switching determined no..
Save File Register inside the specified memory bank
File register saving FRSET 3-143
to memory card in binary format.
Read the data saved in memory card to file register of
File register read FRLDM 3-145
designated memory bank unifiedly.

3-140 - KV-5000/3000 Series User’s Manual-


3-11 File Register

LADDER PROGRAMMING
FRSET FRSET
File register
Switch current memory bank
no. of File Register to
bank switching
@FRSET FRSET determined no..

Ladder program Execute condition


Input mode FRSET
n F R S E T n

Input mode FRSET


3
n @ F R S E T n

File Register
Available Devices
Index
Cons Indirect Local Change
Bit device Word Devices
Operand tant specifying device
MR DM EM
R DR LR T C CTC CR FM ZF T C CTH CTC Z CM #/$ #TM * @ : #/: Z
B TM W
n ○ - ○ - - - ○ ○ ○ ○ ○ ○ ○ ○ ○ - ○ ○ ○

Operand Explanation
n Designate switched current memory bank No.or initial device to save No.., (0 to 3)*1

*1 When the bit device is specified, continuous 16/ 32 bit is processed.


If relays other than channel start relay (R002, R106, R1012 etc.) are specified, it jumps to the
next channel for 16/32 bit processing. "Bit Device", Page 3-57

Description of Operation

FRSET Whenexecution condition is on, switch current memory bank No. Of file register to
through n Designated No..
FRSET Only 1 scan period is ON at the up edge of execution condition

Operation flag
CR2009 No change in status
CR2010 No change in status
CR2011 No change in status
·( n >02) is ON.
CR2012 · It is ON, when indirect specifying, Pointer Modification range is improper
Those other than the above-mentioned are OFF

* If CR2012 is ON, the instruction will be not executed.


When CR2012 is on, detailed information of CM5100 - CM5176 error will be stored.
"Error Log (CM)", Page 3-20

- KV-5000/3000 Series User’s Manual- 3-141


3-11 File Register
LADDER PROGRAMMING

Example

At up edge of input relay R000, switch current memory bank of file register to memory bank 1.
R000 FRSET ;(mnemonics list)
#1 LDP R000
FRSET #1

3
File Register

3-142 - KV-5000/3000 Series User’s Manual-


3-11 File Register

LADDER PROGRAMMING
Save File Register inside the
FRSET FRSTM File register
saving
specified memory bank to
memory card in binary format.

Ladder program Input mode


Execute condition FRSTM
n S D F R S T M n S D

Available Devices

Bit device Word Devices


Cons Indirect
Index
Local Change
tant specifying device
3
Operand
MR DM EM

File Register
R DR LR T C CTC CR FM ZF T C CTH CTC Z CM #/$ #TM * @ : #/: Z
B TM W
n ○ - ○ - - - ○ ○ ○ ○ ○ ○ ○ ○ ○ - ○ ○ ○
S ○ - ○ - - - ○ ○ ○ ○ ○ ○ ○ ○ ○ - ○ ○ ○
D ○ - ○ - - - ○ ○ - - - - - ○ - - ○ ○ ○

Operand Explanation
n Designate memory bank No. Or initial device to save No. (0 to 3). *1

S Designate file No. To save data or initial device to save file No(0 to 999)。. *1
D Designate first address of notice bit device.*2
*1 When the bit device is specified, continuous 16/ 32 bit is processed.
If relays other than channel start relay (R002, R106, R1012 etc.) are specified, it jumps to the
next channel for 16/32 bit processing. "Bit Device", Page 3-57
*2 If bit device is designated, continuous 2 bits will be occupied. When word device is designated,
lowest bit in continuous 2 words is used as notice bit device respectively.
Bits other than the lowest is not changed.

Description of Operation

Only 1 scan period is ON at the up edge of execution condition n test up edge of execution
condition, all file registers of memory bank No. N will be saved in memory card unifiedly in
binary format (always save to file).
File No. Is designated by value S .
File name is \FR\FR (file No. 3 digits).FRB.

Example
in S When 10 is saved, file name is \FR\FR010.FRB.

D Write end notice, D Error notice for abnormal end of write in +1.
· D It is OFF during instruction execution, ON after writting processing of memory
card. It is ON, during instruction normal end or abort.
· D +1 normal end of instruction OFF; abnormal end on.
When "FR" folder does not exist, make a new "FR" folder.

Note
· When memory card instruction execution relay (CR3214) is ON, fail to execute the
instruction. Please use CR3214, perform exclusive control.

- KV-5000/3000 Series User’s Manual- 3-143


3-11 File Register

operation flag
LADDER PROGRAMMING

CR2009 No change in status


CR2010 No change in status
CR2011 No change in status
· N When the value saved in N is larger than "3", on state
· S When the value saved in N is larger than "999", on state
CR2012
· It is ON when indirect specifying or index modification range is improper.
State other than above.
3 * If CR2012 is ON, the instruction will be not executed.
When CR2012 is on, detailed information of CM5100 - CM5176 error will be stored.
File Register

"Error Log (CM)", Page 3-20

Example

At up edge of input relay R000, save file register of memory bank 0 to memory card as per file No. 10.
R000 FRSTM ;(mnemonics list)
#0 #10 MR000 MPS R000
FRSTM #0 #10 MR000

3-144 - KV-5000/3000 Series User’s Manual-


3-11 File Register

LADDER PROGRAMMING
Read the data saved in memory
FRLDM FRLDM
File registerread card to file register of designated
memory bank unifiedly.

Ladder program Input mode


Execute condition FRLDM
n S D F R L D M S D

Available Devices
Index

Operand
Bit device Word Devices
Cons Indirect Local Change
tant specifying device 3
MR DM EM

File Register
R DR LR T C CTC CR FM ZF T C CTH CTC Z CM #/$ #TM * @ : #/: Z
B TM W
n ○ - ○ - - - ○ ○ ○ ○ ○ ○ ○ ○ ○ - ○ ○ ○
S ○ - ○ - - - ○ ○ ○ ○ ○ ○ ○ ○ ○ - ○ ○ ○
D ○ - ○ - - - ○ ○ - - - - - ○ - - ○ ○ ○

Operand Explanation
n Designate memory bank No. Or initial device to save No. (0 to 3). *1

S Designate file No. To read data or initial device to save file No(0 to 999). *1
D Designate first address of notice bit device.*2
*1 When the bit device is specified, continuous 16/ 32 bit is processed.
If relays other than channel start relay (R002, R106, R1012 etc.) are specified, it jumps to the
next channel for 16/32 bit processing. "Bit Device", Page 3-57
*2 If bit device is designated, continuous 2 bits will be occupied. When word device is designated,
lowest bit in continuous 2 words is used as notice bit device respectively.
Bits other than the lowest is not changed.

Description of Operation

FRLDM Up edge of execute condition, read data, file No. Saved in memory card (through FRSTM
instruction or KV STUDIO " File Register Settings") to memory bank No. Unifiedly n

File register. (always save to file).


File No. Is designated by value S .
File name is \FR\FR (file No. 3 digits).FRB.

Example
in S When 10 is saved, read \FR\FR010.FRB.

D Write end notice, Error notice for abnormal end of write in D +1


· D It is OFF during instruction execution, ON after writting processing of memory
card. It is ON, during instruction normal end or abort.
· D +1 normal end of instruction OFF; abnormal end on.
When "FR" folder does not exist, make a new "FR" folder.

Note
· When memory card instruction execution relay (CR3214) is ON, fail to execute the
instruction. Please use CR3214, perform exclusive control.

- KV-5000/3000 Series User’s Manual- 3-145


3-11 File Register

Operation flag
LADDER PROGRAMMING

CR2009 No change in status


CR2010 No change in status
CR2011 No change in status
· When the value saved in N is larger than "3", on state
· When the value saved in S is larger than "999", on state
CR2012
· It is ON when indirect specifying or index modification range is improper
OFF other than this.
3 * If CR2012 is ON, the instruction will be not executed.
When CR2012 is on, detailed information of CM5100 - CM5176 error will be stored.
File Register

"Error Log (CM)", Page 3-20

Example

At up edge of input relay R000, save file register of memory bank 0 to memory card as per file No. 10.
R000 FRLDM ;(mnemonics list)
#0 #10 MR000 LDP R000
FRLDM #0 #10 MR000

3-146 - KV-5000/3000 Series User’s Manual-


3-11 File Register

MEMO

LADDER PROGRAMMING
3

File Register

- KV-5000/3000 Series User’s Manual- 3-147


3-12 Programming Skills
From Installation to Operation
LADDER PROGRAMMING

The procedure from KV-5000/3000 PLC installation to operation is shown in the figure below.

Through programming action flow, specifying, time sequence diagram,


circuit diagram etc, conceive processing action content.

Operation flow Circuit diagram


Toggle switch PB1: ON Indicator (PL) lit PB1 is switch of N.O. contact
Toggle switch PB2˖OFF PB2 is switch of N.O. contact

3 Toggle switch PB1˖OFF


Toggle switch PB2˖OFF
Even set PB1 OFF,Indicator
(PL) also keep lit status
PB1 PB2

Operation content
Programming Skills

Toggle switch PB1˖OFF When set PB2 as ON status


analysis Toggle switch PB2˖ON Indicator (PL) OFF

Time chart RL
ON
PB1 contact
OFF
ON
PB2 contact
OFF
ON PL
PL
OFF

◇Unit Configuration
When there are many I/O equipments for control, or expansion
function is used,
Consider to use expansion unit.
   Please refer to User's Manual for Kv-5000/3000 Series Plc and
Program analysis Expansion Unit

◇Module Configuration
According to each processing process, function, program, conceive
module.
"Example: Module Configuration", Page 3-103

◇Composition of sequence program


After rough frame is obtained for control content of each module and
instruction used, conceive the whole program.
   KV-5000/3000/1000 Instruction Reference Manual

Use KV STUDIO to program

◇New a project
   KV STUDIO User's Manual "New Making of Projects"
Programming
◇Set up unit
In Unit Editor, set the unit device assigned to every expansion unit.
   KV STUDIO User's Manual "Chapter 3 UNIT EDITOR"

◇ Making module/program
"3-8 Module", Page3-94
"Programming Tips", Page 3-152
"Prepare Clear, Legible Program", Page 3-164
"Programming Key Points", Page 3-169
"3-9 Macro", Page3-109
   KV-5000/3000/1000 Instruction Reference Manual

3-148 - KV-5000/3000 Series User’s Manual-


3-12 Programming Skills

LADDER PROGRAMMING
When transmit to PLC for monitoring, change mode in Simulator,
convert module/program.If conversion error occurs, eliminate error
according to the prompt in output window.
"Conversion", Page 3-178
Program conversion " Input/conversion Error of Local Device", Page 3-135
KV STUIDO User's Manual "A-1 Error Message Lists"
"Programming Key Points", Page 3-169

3
Change or add program.

Programming Skills
Program change and add

"Prepare Clear, Legible Program", Page 3-164


"Online edit", Page 3-181
"Write in the RUN mode", Page 3-179

Fully utilize Monitor, Simulator and convenient functions for debugging.


 Monitoring "Monitoring", Page 3-180
 Simulator "Simulator", Page 3-182

Monitor and simulate


Register the module of high rate of utilization in module library.
"Module Management", Page 3-94
Register the macro of high rate of utilization in macro library.
"Macro Management", Page 3-109

Complete

■ When designed by multiple persons


(1) The leader designs the high-level project structure.
The project leader decides high-level composition of the project and prepares the project data
shared by several persons (global settings).

Example
Global settings example
·Unit configuration and setting
·assignment of module configuration
·CPU System setting
Module execution sequence, local entire assignment, CPU unit buffer memory capacity,
action settings when error occurs etc
·Definition of common macro
·To program/tracing function assignment
·Global device/label assignment

- KV-5000/3000 Series User’s Manual- 3-149


3-12 Programming Skills

(2) leader transmits project to PLC body.


LADDER PROGRAMMING

(3) Each member reads project from PLC body.


(4) Each member executes distributed notes transmission range set up of global device.

Select "Monitor/simulator (n)" -> "Setup communication (t)" -> "Setup transfer range of global
device comment (T)" from KV STUDIO menu.

3
Programming Skills

(5) Each member programs the program within its own module.
By using local device or local mark number actively, avoid conflict with other device during work.
"3-10 Local Device", Page 3-131
"Label", Page 3-162

(6) Each member transmits assumed module to PLC, execute debug.


Since transmission to PLC body can be performed as per module unit, therefore other module will
not be covered wrongly.

Click "program", only select transmitted module.

3-150 - KV-5000/3000 Series User’s Manual-


3-12 Programming Skills

LADDER PROGRAMMING
Note
·When only transmit program, when module execution sequence settings does not exist in
PLC body, or when module designated by ECALL instruction called out in the module does
not exist in PLC body, PLC body error will occur "15 conversion error". Please confirm
inconsistent projects in the following "PLC check/synchronous" dialog box, eliminate the
cause of conversion error.
·Restriction matters when several persons execute debug are as follows.
·Real time chart monitor cannot realize communication above two persons
simultaneously.
·Interrupt function cannot realize use by more than two persons simultaneously. 3
·To Logging/Trace function can be used by several persons after ID is distributed, but

Programming Skills
but settings information cannot be written as per each ID.

From next start, begin to execute projects saved in individual computer from each member.

If one person changes global settings (unit set up information, module execution sequence settings,
Setup local device assignment, PLC unit buffer capacity settings, action when error occurs) and
executes transmission, the change will be notified to other persons under monitoring through KV
STUDIO, difference point can be confirmed in "Verify with PLC/Syncronize" dialog box.

Display in red where


changed.

- KV-5000/3000 Series User’s Manual- 3-151


3-12 Programming Skills
LADDER PROGRAMMING

Programming Tips

This section will explain some convenient functions required for programming, so as to reduce entry
and modification workload.

Mnemonics entry

For mnemonic symbol entry, since instruction can be entry without mouse, therefore, compared with
3 using of "Instruction/macro palette (instruction/macro template) ", programming is more quick.
Programming Skills

■ Mode entry
Use keyboard to entry the first character of instruction.
(example) entry MOV instruction

Press “M” on the keyboard when


cursor point to input cell.

Continue entry in the [Mnemonic direct


entry] dialog box that is displayed.

ǂǂ Pressing the Enter key displays the


ladder symbol on the
"ladder edit window."

After "reduced display of direct entry box" check box in "Setup edit/key" of "Tool" -> "Options"
is selected for "Zoom out direct entry by Enter key" dialog box, display will be reduced.

For details on each instruction, KV-5000/3000/1000 Series PLC Instruction Reference Manual.

3-152 - KV-5000/3000 Series User’s Manual-


3-12 Programming Skills

·entry designated source device and value in instruction and operand, abbreviate the entry.

LADDER PROGRAMMING
(example) A 0 -> LD R000
"A-6 Shorted input list of mnemonic symbol", Page A-24

·Press 'UE or F2 key, edit entry cell in "Mnemonic direct entry (Mnemonic direct entry)"
dialog box. In "Setup edit/key" of ("Tool" -> "options", after select "start up direct entry by
Enter key " check box, Enter key will be distributed to "Mnemonic direct entry" dialog box.)

■ Entry mnemonics
When entry mnemonic symbol, several functions are helpful for entry mnemonic symbol.
3

Programming Skills
● Display instruction list
After entry the first character of instruction, "candidate instruction" dialog box initiated by the first entry
character will be displayed, instruction can be selected.

[Instruction candidate] dialog box displayed by entering the first


character of an instruction

● Display simple description of instruction operand


Simple description of currently entry operand as well as which operand can be displayed.
1st operand input in progress

2nd operand input in progress

● Simple search for unused device


In midway of entryting device category or No., , unused device will be displayed next to entry of "?" in
list mode.

- KV-5000/3000 Series User’s Manual- 3-153


3-12 Programming Skills

Shortcut keys
LADDER PROGRAMMING

Use shortcut key, mouse can not be used, only use keyboard for operation.Use shortcut key to reduce
keyboard clicking times, quicken entry speed.
Typical shortcut key is described as follows.
"A-7 List of Shortcut Keys", Page A-26

■ Enter/Edit

3 Esc F2

Display "Mnemonic direct entry" dialog box, use mnemonic symbol to entry or edit.
Programming Skills

"Mnemonics entry", Page 3-152

● Enter

<If an empty cell is selected in edit mode>


Then it will display “Insturuction/macro/pack palette".

<If a cell with existing entry is selected in edit mode>


Display "Operand edit (operand edit) " dialog box.

The target device, and comments and constants


of that device can be changed by each operand.

<In monitor mode or simulation mode>


"Search/replace" dialog box appears.

● Ctrl +M
If a cell with existing entry is selected in "Operand edit (operand edit)" dialog box, notes can be edited.

3-154 - KV-5000/3000 Series User’s Manual-


3-12 Programming Skills

● Ctrl + X / C / V

LADDER PROGRAMMING
Shortcut key for Windows application program standard edit:
Ctrl +    X ........... Cut
Ctrl +    C ........... Copy
Ctrl +    V ........... Paste

● Ctrl + Shi f t + V
Set the number of paste, paste can be performed for many times.
In addition, included device can also be adjusted. 3
KV STUDIO User's Manual "5-1 Functions concerning Edit - Multipaste"

Programming Skills
● Ctrl + Z / Y
Shortcut key for Windows application program standard edit:
Ctrl + Z ............... Undo
Ctrl + Y ............... Redo

● Tab / Shi f t + Tab

Move the cursor according to ladder symbol unit.

● Ctrl + /
Move cursor according to ladder circuit block program section.

● Ctrl +
Select the whole line containing the selected cell.

- KV-5000/3000 Series User’s Manual- 3-155


3-12 Programming Skills

■ Insert
LADDER PROGRAMMING

● Insert

Insert horizontal connecting wire in the selected cell.

● Shi f t + Enter or Shi f t + Insert


Insert row.

● + Delete
3 Shi f t

Delete row.
Programming Skills

● Ctrl + Enter
Insert row comments.
"Rung comments", Page 3-166

■ Connection line edit


● Alt + Enter or Ctrl + Tab

Draw a connecting wire from the selected cell to line end.

● Alt + / / /
When there is no connecting wire, draw a connecting wire according to arrow direction.
When there is connecting wire, delete connecting wire according to arrow direction.

■ Retrieve/displace
● Ctrl + F
Displays the "Search" tab of the "Search/replace"dialog box is displayed.
"Search/replace", Page 3-158

● Ctrl + H
Displays the "Replace" tab of the "Search/replace" dialog box is displayed.

● Space

Display cross reference


"Cross reference", Page 3-158

3-156 - KV-5000/3000 Series User’s Manual-


3-12 Programming Skills

■ Display

LADDER PROGRAMMING
● Ctrl + F7

Display "Device comment edit" window.


"Device Comments", Page 3-164

● Ctrl + E
Display "Device use list" window.
Unused device can be confirmed simply.
KV STUDIO User's Manual "6-2 About View Functions - Displaying Use Status"
3

Programming Skills
Page
● Ctrl + Page
Up / Ctrl + Down

Zoom in / zoom out "ladder edit" window.


* When "Display"-> "Automatic multiplying factor" check box is selected, do not act.

● Ctrl + Space
Switch notes display/hide in ladder editor.

- KV-5000/3000 Series User’s Manual- 3-157


3-12 Programming Skills

Search/replace
LADDER PROGRAMMING

Search the instruction and operand that fit with the designated condition, express them.In addition,
display consistent projects in output window in list mode.
When search device, please use cross reference function that can be displayed in list mode by simply
pressing blank.
"Cross reference", Page 3-158

1 Select the "Label edit" window.

3 2 Right click the mouse, and select "Search (S)" from the popup menu.
Other procedure · Select "Edit (E)" -> "Search (S)" from the menu.
Programming Skills

· Ctrl + F

"Search/replace" dialog box appears.

As object, select from "device", "label", "constant", "module/macro", "device comment", "label
comments", "reserve/disable".

Cross reference

Edit (E) -> cross-looked up making (X)

Display search result list of designated device in output window.

1 Select the device to prepare cross reference (ladder symbol).

2 Select "Edit (E)" -> "cross reference (X)" from the menu.
Display search result list in output window.
Other · key
· Select "cross reference (L)" in the menu displayed after right click

3-158 - KV-5000/3000 Series User’s Manual-


3-12 Programming Skills

3 Double click the content to be checked in search result list.

LADDER PROGRAMMING
After double click device displayed in the list, move cursor to corresponding device symbol) on the
ladder.
Other procedure · F3

· Shift + F3

Programming Skills
4 Click key, move cursor to the next search object.

5 To move the cursor focus to the previous search details, press the + keys.

- KV-5000/3000 Series User’s Manual- 3-159


3-12 Programming Skills

Window menu
LADDER PROGRAMMING

Running window menu flexibly is helpful to increase programming efficiency.


Now describe "Tile" and "split" in window menu.

■ Tile windows
This function is used to open several module or macro simultaneously for preparing or debugging
program.
3 Select "Window (W)” -> "Tile (T)" from the menu.
Currently opening module or macro is displayed in parallel.
Programming Skills

Copy/cut and paste a part of ladder program between modules/macros .

■ Split
If program is too long, simultaneous display of all programs is impossible.
Use split display function to split display the program in 2 parts, so as to display desired parts
simultaneously.

3-160 - KV-5000/3000 Series User’s Manual-


3-12 Programming Skills

1 Select "Window(W)" > "Split(P)" from the menu.

LADDER PROGRAMMING
The boundary
line is displayed.
Determine the
dividing position
by the mouse.

Programming Skills
2 Through click mouse, determine split position.

<Split screen>

After the dividing


position is determined,
the height can be
changed as desired.

When determine split position, default display of upper, lower frames is start part of the program.
Through right scroll bar in each split window, desired program position can be displayed in upper, lower frames.

Other procedure If mouse cursor is moved to the position in the figure below, it will change to " ", split starts once is dragged.

Drag on split position.

·Between upper, lowr frames, copy/cut and paste a part of ladder program.
·Display size can also be set respectively.

- KV-5000/3000 Series User’s Manual- 3-161


3-12 Programming Skills

Label
LADDER PROGRAMMING

After managing device of each mark number with any corresponding additional condition, program
through mark number, when device name is not used.If it is local mark number, KV STUDIO will
distribute it to internal work area automatically, it is unnecessary to note device during programming.

When increase local mark number, also execute writing operation in RUN .

■ entry mode
3 Set mark number in "Label edit " window.
Programming Skills

1 Double click "Label " in "Work area" .


Other procedure Select "View(V)" -> "Label edit window(L)" from the menu.

Display "Label edit" window.


   

No. Item Description Set range


1 Label name entry the mark number name to be set. * Half-angle 32/all angle16
character string
2 Data format Set up data format.
Note According to different devices used, some data ―
formats cannot be used.
3 Device/constant entry is distributed to marked device or constant.It is
unnecessary for local mark number.

·Devices that can be set to labels: R/MR/LR/B/
DM/EM/FM/ZF/W/TM/T/C.
4 Label comments Display device comments.Can't entry device comments. Half-angle 32/all angle16
character string
* "A-8 Unusable Character String List", Page A-36

Device that is registered in "Label edit (mark number edit) " window could use mark number to prepare ladder program.
(Example)
Auto operation
Start auto operation in progress R000 R500

MOV MOV
Auto operation
#1000 speed #1000 DM0

■ How to Display
After set mark number, select "Display(v)" -> "Display lable (g)" from the menu, switch display/hide of
global mark number.
Other $CEM
Ctrl + space

3-162 - KV-5000/3000 Series User’s Manual-


3-12 Programming Skills

■ Local label assignment

LADDER PROGRAMMING
Local mark number automatic distributed to local work area. Confirm used number of local work area or
change distributed number in "work area settings".
Click "Setup work area" button of "CPU system setting" -> "local entire assignment settings" on KV
STUDIO work space, to display "Setup work area".

Programming Skills
2

No. Item Description


Number of work
Set number of work area for script processing character string function.
1 area for script text
Display local work used for words of local work area.
string
Usable number Display available number of local work area in the project.
Number used Display total used number of local work for each module/macro.
2
Display residual available number in local work.
Number remaining
"Residual number"="available number" - "used number"
Display assignment
Display local work assignment condition of each module/macro.
3 condition of different
After remove automatic check box, set the number of local work to be used.
module macros

Under default state set to "automatic", it will be distributed automatically according to the setting of local
mark number or To program content of KV script, generally it is unnecessary to note the number.

·During monitoring, local label assignment object can be displayed. Bit is displayed in "VB"
while word is displayed in "VM".
"Display through the assignment destination of local devices/local labels", Page 3-185

· When KV script is used to execute character string processing program, if "Operation error"
occurs, please set larger number of work area for script character string.

- KV-5000/3000 Series User’s Manual- 3-163


3-12 Programming Skills
LADDER PROGRAMMING

Prepare Clear, Legible Program

Device Comments

Set notes for each device.


Since set notes are displayed below the devices when ladder is displayed in KV STUDIO, and on V-
5000/3000 PLC access window, therefore content of the function and contact distributed on the devices
are clear at a glance.
3 In addition, when other person browses the program, if a device contains notes, the time required to
understand program could be shortened. Device notes function can be used for both global device and
Programming Skills

local device.

<Device comments display status>


R30100 R30102 @R000 @R001 MOV
#0 DM8

R4000

The content of ladder program cannot


R30100 R30102 R4000 @R000 @R001 R4013 be comprehended MOVquickly as the
means and functions#1 ofDM8
each device
are difficult to grasp.

R4000 R1011 @R001 R30102 @R000

#R000 R1013 R1114 MOV


#4 DM8

<Device comments display status>


R30100 R30102 @R000 @R001 MOV
#0 DM8
Auto/manual SW Emergency Setup in Setup point Display screen No.
stop SW progress in progress
R4000

Auto-start in progress
The meanings and functions of each
R30100 R30102 R4000 @R000 @R001 R4013 device can be known
MOV at a glance which
#1 comprehending
is helpful for quickly DM8
Auto/manual SW Emergency Auto-start Setup in Setup point Point abnormal the content of ladder programs.
㸼⼎⬏䴶⬾ো
stop SW in progress progress in progress standby
R4000 R1011 @R001 R30102 @R000

Auto-start Setup SW Setup point Emergency Setup in progress


in progress in progress stop SW
#R000 R1013 R1114 MOV
#4 DM8
Setup in progress Setting completed Setup in progress change screen Display screen No.

Note
Device notes cannot be set in index register Z.

3-164 - KV-5000/3000 Series User’s Manual-


3-12 Programming Skills

■ Entry mode

LADDER PROGRAMMING
There are two entry methods of device notes as follows.
· Entry in "Operand edit" dialog box.( Ctrl + M )
· Entry in "Device comment edit" window.

When programming in "Device comment edit" window display state, it is very convenient to
confirm device notes and inp. 3 frames can be displayed simultaneously.

Programming Skills
■ How to Display
After set mark number, switch display/hide of device notes on ladder editor through "View (V)" ->
"Display comments (F)" in the menu.
Other procedure Ctrl + Space

- KV-5000/3000 Series User’s Manual- 3-165


3-12 Programming Skills

Rung comments
LADDER PROGRAMMING

Can program comment on every line in "Ladder edit" window.


Through rung comments, during programming, content of circuit program sections can be clear at a
glance.
At the same time, only display list of rung comments, move to the line of related rung comments.

Row comment

3
Programming Skills

Description
of circuit

Row comment

Description
of circuit

■ Entry mode
entry rung comments in the following steps.

1 In "Ladder edit" window, move the cursor to the line to entry rung comments.

2 Right click the mouse, select "Insert rung cmnt (H)" from popup menu.
Other procedure ·Select "Edit(E)" -> "Insert(W)" -> "Rung cmnt(H)" from the menu.

· Ctrl + Enter

Display is shown below rung comments editor.entryting Comments.

3 Esc , Click Ctrl + Enter button


entry comments end.
3-166 - KV-5000/3000 Series User’s Manual-
3-12 Programming Skills

■ Search method of rung comments

LADDER PROGRAMMING
Display rung comments list in "Ladder edit" window, move from list to the selected line.
Retrieve rung comments in the following steps.
Other procedure Ctrl + L

1 Select " Label edit" window.

2 Right click the mouse, select "Search (S)" from popup menu.
Other procedure Select "Edit(E)" -> "Search rung cmnt(M)" from the menu.
3

Programming Skills
"Retrieve/replace" dialog box appears.

No. Item Description Set range


1 Search range Select object range of search rung comments. Default: Module/macro / Entire
project
2 List display In Output window , display rung comments in all
-
search objects.
3 Only disp If there are continuously multi-rung comments, Check box Selected/
leading rung of select to display all lines, or only display the first Unselected
cmnts line. (default: unselected)

3 Click the "Display list" button.


In "Output window", display rung comments list.

- KV-5000/3000 Series User’s Manual- 3-167


3-12 Programming Skills

4 Double click and jump to rung comments.


LADDER PROGRAMMING

In "Ladder edit" window, move the cursor to the line to entry rung comments.

3 Double Click
Programming Skills

KV script

When To program operation or character string processing etc through ladder program, To program
redundant part by KV script.

Ladder program

Programming to multi-rows in ladder diagram so


procedure of program is hard to understand.
Simple calculation such as addition/subtraction and
multiplication/division must use specified command so
that it is difficult to understand comment in circuit block
unit.

Can compatited with ladder diagram at the same


time and also can add comment to each script.

Ladder program

Easy to understand procedure of program because Even though not aware of internal register,
can programming to control sentence. we can describe calculation process as
mathematic formula.

KV-5000/3000/1000 Series Script Programming Manual

3-168 - KV-5000/3000 Series User’s Manual-


3-12 Programming Skills

Program structuring

LADDER PROGRAMMING
In order to simplify program test or facilitate reuse, each function and each project program should be
modular, managed by popular intelligible name. In addition, frequently used circuit program sections
are converted into macros (original instruction), just like instruction, nominated by concise, memory
convenient name for entry.
"3-8 Module", Page 3-94
"3-9 Macro", Page 3-109

Device default 3

Programming Skills
After ladder program is completely To programed, redundant program of device initialization is managed
unifiedly through device initial value set up. When start to run, log on value will be written automatically.
Select "Device initial value" on work space.

Programming Key Points

Content in ladder program that should be understood in advance and precautions are described below.

■ Extended ladder mode


When ordinary ladder mark is used, one OUT, TMR instruction etc output instructions can be configured in
one line of ladder. After expanded ladder is used, several output instructions can be configured in 1 line,
therefore number of lines in the program can be reduced, so processing sequence is more definite.
" Extended Ladder", Page 3-5

In KV STUDIO, two modes can be switched, namely expanded ladder entry mode (expanded ladder
mode) and common ladder entry mode (common ladder mode).
Switch mode as per the following steps.

1 Select "Edit(E)" -> "Expanded ladder mode(G)" from the menu.


Other procedure Click the icon.

- KV-5000/3000 Series User’s Manual- 3-169


3-12 Programming Skills

·When expanded ladder mode is used, a "√" will be displayed before "Expanded ladder
LADDER PROGRAMMING

mode (G)" in the menu, as well as icon with frame.


·When select expanded ladder mode, I/O instruction, it is unnecessary to move cursor to right
end automatically, just proceed to entry instruction.If it is not in expanded ladder mode, once
I/O instruction is issued, cursor will move automatically to the right end.
·The default mode is the expanded ladder mode OFF.

■ Execution sequence of ladder program

3 Ladder program, as shown in the figure below, is executed according to the sequence of "from left to
right", "from top to botton".
Programming Skills

(1 (2 (4
R000 R001 R500

(3
R002

(5 (6
R003 MOV
#1000 DM0

·Program is executed according to the sequence of mnemonic symbol list.

LD R000•••••••••••••••••••••••••••• (1)
ANB R001•••••••••••••••••••••••••••• (2)
OR R002•••••••••••••••••••••••••••• (3)
OUT R500•••••••••••••••••••••••••••• (4)
LD R003•••••••••••••••••••••••••••• (5)
MOV #1000 DM0•••••••••••••••••••• (6)

·Module execution sequence is set via "Execute sequence of modules" of KV STUDIO "CPU
system setting".
" Module Execution Sequence", Page 3-102

3-170 - KV-5000/3000 Series User’s Manual-


3-12 Programming Skills

■ Inconvertible ladder program

LADDER PROGRAMMING
Typical mode of conversion error is explained as follows.

● Rail or output line is not connected

Set all contacts and coils to be on the path from the R500
power rail to the output line and prevent
disconnections on the path.

Programming Skills
TIP The ladder in the figure on the right A B
results in a conversion error as there is
a disconnection. C

R500

● An instruction that cannot be programmed directly by rail is used

Output coils, timer/counter instructions, etc. cannot R500 Internal auxiliary relays R500
be programmed directly from the power rail.
When an execution condition is not required,
insert an NC contact or a control relay
CR2002 (always ON contact) from an unused ʿ10 CR2002 ʿ10
internal auxiliary relay as a dummy. T0 T0

(wrong) (right)

● An instruction that cannot be programmed directly by output line is used

A B D R500 E

- KV-5000/3000 Series User’s Manual- 3-171


3-12 Programming Skills

● Ladder program contains short circuit


LADDER PROGRAMMING

R500

A B C
3
Programming Skills

● Output coils are connected in parallel

● A group of networks that contains an output coil


cannot be connected in parallel. A B C R500

D R501

Note, however a parallel connection is possible A B C R500


if the group of parallel connection networks
is each connected to the output line as shown
in the figure on the right.
D R501

● The END/ENDH instruction is not programmed


Each module/macro needs "END" or "ENDH" instruction.

If create new module or macro in KV STUDIO, "END" or "ENDH" instruction will be inserted
automatically

3-172 - KV-5000/3000 Series User’s Manual-


3-12 Programming Skills

■ Ladder program that should be re-written

LADDER PROGRAMMING
● A network such as that shown in the figure A B R500 C E B R500
on the right cannot be programmed.
Rewrite the network.
A
E
C D A E D

C 3

Programming Skills
● In the figure on the right, R500 cannot be A R1000 A R1000 R500
output.
Rewriting enables output for only one scan.

R1000 R500 A R1000

● When two of the same coils are used as shown A B R500 A B R500
in the figure on the right, the program towards
the back is given priority, and the front in the
front is ignored.

C E R500 C E

● A network such as that shown in the figure on A B C R500 B C A R500


the right cannot be programmed.
Rewrite the network.
D E D E

F F E

● A network such as that shown in the figure on A B R500 C D B R500


the right cannot be programmed.
Rewrite the network.
C D A

E R501 C E R501

- KV-5000/3000 Series User’s Manual- 3-173


3-12 Programming Skills

■ Duplicate coil
LADDER PROGRAMMING

If in a project, the same device uses OUT/OUB instruction for more than twice, within one scanning,
the finally executed instruction has priority, other instructions are omitted.
If OUT/OUB instructions are in their separated lines or different modules or macros, take the following
method for processing.

(for example), as shown in the figure below, when R500 output instruction is used twice

3 R000 R001 R500 R000 R001 R1000


Programming Skills

R002 R501 R002 R501


࡮࡮࡮

࡮࡮࡮
R003 R500 R003 R1001

࡮࡮࡮
R1000 R500
Each are output once by different
devices,and grouped separately to be
output to R500 by an OR. R1001

Although conversion error will not occur to Duplicate coil, but since action is miscellaneous, therefore
please do not use.
Check whether Duplicate coil exists, please select "Convert (A)" (conversion) -> "Duplicate coil check
(D)" from KV STUDIO menu.

Note
When the same macro is called for twice and above, if OUT/OUB instruction that uses
global device is used in macro memory, it turns into Duplicate coil.

3-174 - KV-5000/3000 Series User’s Manual-


3-12 Programming Skills

● The method to avoid duplicate coil between the same macros

LADDER PROGRAMMING
For OUT/OUB instruction that uses global device in the macro, when its macro is called for twice and
above, dual coil can be avoided by the following measures.

(1) Set the operand of the OUT/OUB instruction in the macro to argument P.

R000 R500 R000 P1

(2) for independent variable added in (1) designated by macro call instruction, different internal auxiliary 3
relays will be designated for each call.

Programming Skills
MCALL Macro A MCALL Macro A
DM0 DM0 R1000
࡮࡮࡮

࡮࡮࡮
P1

MCALL Macro A MCALL Macro A


DM100 DM100 R1001

P1

(3) ladder program output by logic or is added out of the macro.

R1000 R500

R1001

■ Interlock
In the program, when one party acts, the other party cannot act, so as to prevent simultaneous action of
both, such exclusive processing composition mode is called interlock.
Although lock function is very necessary in actual application, but since it is very complicated to explain,
unnecessary details will not be given inKV-5000/3000 Series PLC instruction Reference Manual etc
example programs.

(example) circuit block in which R500 and R501 cannot be on simultaneously

R000 R501 R001 R500

R000 and R001 ON -> R501 does not turn ON


even if R002 turns ON with R500 in an ON state
R500 R002 R501 as the NC contact of R500 is inserted.

If executing ON bit is used in module or macro execution, simply prepare entry/output lock circuit.
"Execution ON Bit", Page 3-120
"Macro System Device", Page 3-119

- KV-5000/3000 Series User’s Manual- 3-175


3-12 Programming Skills

■ Reduce scanning time


LADDER PROGRAMMING

If scanning time is long, refresh cycle of entry/output and value will be increased, reaction of machine
and device will be decreased. In addition, if scanning time exceeds 300ms, "Scanning time overtime
(CPU error No. 30)" will occur, running cannot be proceeded.
By means of the following projects, scanning time can be shortened.

● Stop a unnecessary module


When keep module that is unnecessary to act in execution state, please use module instruction
3 (MDSTRT/MDSTOP), execute the module only when required.
"Module instructions", Page 3-106
Programming Skills

● Unnecessary ladder circuit block can be skipped


For ladder circuit block the is unnecessary to act, please include in condition branch (CJ/NCJ - LABEL
instruction), step instruction (STP - STE instruction) etc, ensure execute only when required.

● Reduce cycle (FOR - NEXT instruction) content


In cyclically executed ladder circuit block between for - NEXT instructions, if there is surplus part,
processing time of corresponding cycle times will be added in scanning time.Therefore for processing
that is unnecessary to be executed cyclically, please To program out of FOR - NEXT instruction.

When / CJ/GOTO instruction is used, preparation of circular processing program is also the same.

● Assign a device with an even number to 32-bit processing operand


For operands with postfix.D/.L/.F etc (instruction for processing 32-bit data), when designate DM/W/
EM/FM/ZF/TM etc 16-bit word devices, please use device of even No..Otherwise, if two words with odd
No. Are used for designation, processing speed will slow down.

If it is DM/EM/FM/TM, local device should also use even No..During conversion, local device
of even No. Should always be distributed to global device of even No., local device of odd
No. Should always be distributed to global device of odd NoTherefore, device areas more
than distributed to each module or macro might be consumed.

● Select category of the device to be used.


For designated operands, when DM device is not designated, whereas R/MR/LR/B/TM device is
designated, processing time is quickened by 0.050 - (µs). Especially for operand designated data block
initial device, processing time of two words will be quickened by 0.050(µs).

■ Effective use of a module/macro


In order to use module or macro validly, enable program structure to to more optimal, please use local device or
local mark number to the maximum extent.Precautions for use of local device is explained below.
· The following devices can be used as global devices: KV-5000/3000 I/O relay, device distributed to expansion unit,
reference device via touch panel etc externally connected equipment, universal device in the whole project, device that
requires data transmission between modules, and other devices required for global device processing.

3-176 - KV-5000/3000 Series User’s Manual-


3-12 Programming Skills

· Local Device shall be numbered from 0 using consecutive numbers as possible.

LADDER PROGRAMMING
· Since R, DM is distributed in expansion unit, as global device, use area is required. When using local
devices, give priority to MR or EM/FM.
"3-10 Local Device", Page 3-131
For local label, see "Label", Page 3-162.

■ Use either index modification or indirect specifying


Two methods are available to change the device designated by instruction operand in operation
process: " index modification " and "indirect specifying ".
3

Programming Skills
<Index modify>
  ○Designate concise method.
  △Specify device type cannot be changed.
  △ Index register Z cannot be used as local device.
    ->If "ZPOP" and "ZPUSH" instructions are used, it is not necessary to consider available
quantity of index register, use index for modification.
     

<Indirect specifying>
  ○Specify device type can be changed.
  △Specify method is complicated. (special instruction should be used when processing address).

It is advisable to use simple "Index modification" function in condition other than changing device
category.
" Index Modification", Page 3-73

Program Troubleshooting Debug

Eliminating errors in program is called "Debug (debugging)".


If KV STUDIO monitor function is used, state of actually connected KV-5000/3000 PLC can be checked.
In addition, in the monitor, if used together with online editor capable of ladder program edit, more
efficient better debugging can be carried out.
If use "Simulator" function, even if KV-5000/3000 is not available, action of ladder program can also be
confirmed only by individual computer.

- KV-5000/3000 Series User’s Manual- 3-177


3-12 Programming Skills

Conversion
LADDER PROGRAMMING

Simulate KV5000/3000 action on individual computer, and execute debug.

Select "Convert(A)" -> "Convert(C)".

Other procedure · Click the icon.

· Ctrl + F9

3 · select "Monitor/Simulator (N)" -> "Transfer to PLC -> Monitor (C)" from the menu for
Programming Skills

automatic conversion, transmission, start monitor.


· if select "Monitor/Simulator (N)" -> "Simulator (L)" from the menu, it can convert automatically,
and start simulation.

<When conversion is finished normally>


The message "Conversion end OK" is displayed on the [Output window].
Display use proportion of program capacity in "Conversion result" dialog box.
"Program Capacity", Page 3-11

<When conversion fails>


Display error content in "Output window".
Double click error, jump to the location of this error directly. Please make correction one by one in
sequence.

"Programming Key Points", Page 3-169


KV STUDIO User's Manual "A-2 Error Message Lists"

Select "Convert (A)" -> "Convert individual modules/macros (M)" from the menu to convert
module/macro respectively. In case of many errors, and errors cause difficult determination,
please use this method.

Transfer

Select "Monitor/Simulator (N)" -> "Transfer to PLC (W)" from the menu to transmit converted ladder
program to KV-5000/3000 PLC.

Other procedure Click the icon.

3-178 - KV-5000/3000 Series User’s Manual-


3-12 Programming Skills

LADDER PROGRAMMING
Note
Under default settings, when program is transmited, each module/macro stored in PLC
body will not be deleted. If you want to delete unused module when executing program
transmission, please set "Clear module/macro in PLC" check box of "Transfer program"
dialog box to selected state.

After selecting "Monitor/simulator (n)" -> "Transfer to PLC-> Monitor mode (C)" from menu, it
executes operation from conversion to transmitted automatically, and starts monitoring.

■ Write in the RUN mode


3

Programming Skills
Under KV-5000/3000 PLC RUN state, transmit, write ladder program.
Writing in the so-called RUN mode is rewrite function of KV-5000/3000 PLC for ladder program under
RUN state. Action fine adjustment and independent variable change can be performed without stopping
device and production line.
Extension value of scanning time written in RUN is up to 2ms.

Select when
write RUN.

Danger may occur due to the status of the control equipment connected in
WARNING KV-5000/3000 when writing in RUN mode. Caution!

● Data that cannot be written in RUN


· Projects different from the content stored in KV-5000/3000
· Unit configration
· Execute sequence of module
· Entire assignment setting of local device
· CPU unit buffer capacity setting
· Action when error occur

● Conditions that cannot be written in RUN


· When number of local device used changes
· When macro instruction is added/deleted
· When call sequence of macro instruction changes
· When macro independent variable settings changes
· When automatically guaranteed local work area is exceeded due to increase/change/delete of local
label or edit of KV script
- KV-5000/3000 Series User’s Manual- 3-179
3-12 Programming Skills
LADDER PROGRAMMING

Note
· When write is finished in RUN, even if ON/OFF state of execution condition changes,
differential instruction in write range will not be executed.
· Even if change timer or counter setpoint and execute writing operation in RUN, change
current value will not be changed when writing is finished.

Monitoring

3 Use monitor program to transmit the ladder program prepared using ladder editor (Ladder Editor) to
KV-5000/3000 PLC, carry out actual execution, check out action condition.
Programming Skills

Use monitoring function to execute the following operation.


· Program action condition can be confirmed in real time by ladder or real time chart monitoring.
· Select the operation mode of the KV-5000/3000 PLC.
· By executing entry update disable, forced setting/reset, carry out forced ON/OFF operation for entry
contact execution on monitoring frame.
· It is easy to modify set value and current value of device data and timer/counter.
· Save/read designated range of current value of the device on memory card.
· Return part device to default value.

To start monitoring, select "Monitor/simulator(n)" -> "Transfer to PLC -> monitor mode(C)" from the
menu. Before operation, please connect KV-5000/3000 PLC and PC in advance in communication
enable state.

Other procedure ·Click the icon.

· Ctrl + F8

In KV STUDIO title bar, display current state (monitoring/online edit/editor etc).

Monitoring operation can be executed via tool bar or menu.

For detailed information of the functions, please refer to KV STUDIO User's Manual "Chapter 9 monitor and simulator".

3-180 - KV-5000/3000 Series User’s Manual-


3-12 Programming Skills

Online edit

LADDER PROGRAMMING
Use online edit function, change ladder program directly on KV STUDIO monitoring frame.Use these
convenient functions, adjust and change simple program on final debugging site for programming.
In monitoring execution process, select "Monitor/Simulator (N)" -> "Start online edit (O)", start online
edit from the menu.
Edit position will display light blue, check which cell is corrected clearly at a glance.

Other procedure · Select "online edit" on mode bar

· Click the icon.


3

Programming Skills
· F10

The online edit function may serious damage or injure workers if it is used in the wrong way.
Thoroughly check the following points to ensure correct use of this function:
࡮Before using online edit, thoroughly check the peripheral equipment, and use in a state
that will prevent physical injury or damage if equipment operate unexpectedly.
WARNING ࡮Do not add circuits (e.g. execution condition B contact circuits) that operate immediately
after a program is transferred. Doing so might cause equipment to run away.
࡮If ON output instructions (e.g. OUT) are deleted and the ladder program is transferred,
the outputs are held in an ON state.

For online edit transmission, only write the changed circuit block in PLC body.However, in the
following condition, execute write operation for the changed module/macro as a whole.
· When several modules are changed
·When script edit exceeding local work area is executed
·When increase local mark number to exceed local work area
·After edit the program in macro (macro is transmited as a whole.)
·When individual assignment number of local device is changed
·When macro call is increased
·When ENDH instruction is edited

With respect to restriction matters and precautions for writing in RUN mode, please refer to "Write in the
RUN mode", Page 3-179".
For online edit function, please refer to KV STUDIO User's Manual , "9-9 online edit function ".

- KV-5000/3000 Series User’s Manual- 3-181


3-12 Programming Skills

Simulator
LADDER PROGRAMMING

Use simulator, while PLC is not connected, simulate action of ladder program prepared using ladder
editor on PC.
Use this program to perform the following operation.
· Use Ladder Monitor, Registration Monitor (time sequence diagram) and Batch Monitor, check out
program operating state in real time.
· Through various execution method, simulated continuous scanning/consecutive step or single step/a

3 scanning cycle.
· Utilize single step and consecutive steps reverse execution etc convenient functions for debug work
Programming Skills

efficiently.
· Setpoint and current value of timer, counter or device etc can be changed simply.
· Forced set bit or reset can be performed for the contact.
Select "Monitor/Simulator (N)" -> "Simulator (L)" from the menu to start simulator.

Other procedure · Select "simulator "in mode bar

· Click the icon.

· Ctrl + F2

Display current state in KV TUDIO title bar (simulator/monitoring/editor etc).

Perform analog simulation operation in tool bar or menu.

For detailed information of the functions, please refer to KV STUDIO User's Manual, "9-11 simulation
function - execute analog simulation operation".

■ Difference from monitor program


In simulator, through a scanning cycle execution, single step execution, single step reverse execution
etc functions, control tiny running state can be controlled better than monitor.
Since only CPU action can be simulated, action of expansion unit cannot be checked. In addition, there
is certain restriction to some CPU built-in functions and device actions.

Please refer to KV STUDIO User's Manual, "9-11 simulator function -simulator restriction"

3-182 - KV-5000/3000 Series User’s Manual-


3-12 Programming Skills

Monitoring functions

LADDER PROGRAMMING
In order to use monitoring and simulator more validly for debugging, functions are described below.
For detailed information of operating method of the functions, please refer to KV STUDIO User's Manual.

■ Change the current value or status of device


● Bit device ON/OFF
Double click the CELL to change bit device state.Double click at each time, state will reverse.
3
Other procedure After selecting the cell to change bit device state, click Space key.

Programming Skills
Note
During monitoring, timer/counter contact and external I/O relay cannot execute ON/OFF
operation.

To forcibly turn external I/O relays ON/OFF during monitoring, select "Debug(D)" -> "forced
set/reset register(X) or Inhibit input refreshing(F)" from the menu.

● Batch change window


Select cell of current value of the device to be changed, click F2 key.

Display "Batch change (device value change) " window.If several cells are selected, click F2 key,
display all devices included in the selected range.
Through entry a new value, change current value.

If select use index modification or indirectly designated instruction, display the reference device.

- KV-5000/3000 Series User’s Manual- 3-183


3-12 Programming Skills

● Registration monitor/batch monitor


LADDER PROGRAMMING

In order to register the device in Registration Monitor and Batch Monitor, select the instruction
containing monitoring device, when aligning with the cell in " " state, drag and drop the device into
"Registration Monitor" dialog box.

3
Programming Skills

·/if several cells are selected, perform drag and drop operation, all devices within the selected
range will be registered.
·In "Registration Monitor" dialog box, device can also be entry directly..

● Watch window
All devices contained in the circuit block with selected CELL execute monitoring function automatically.
To hide/show the screen, select "Monitor/Commission" -> "Hide/show monitoring window" from the
menu bar.

● Real time chart monitor


Display information of the devices logged on in logon monitoring by timing curve.
Open " Real time chart monitor " from the menu displayed after log on monitoring and right click.
Loaded data can be traced back to the past for display, the value of selected point can also be
displayed.
Other procedure Select Monitor/Simulator (N) -> Real time chart monitor
"9-6 Real-time graphics monitoring" in the KV STUDIO User's Manual

3-184 - KV-5000/3000 Series User’s Manual-


3-12 Programming Skills

■ Display through the assignment destination of local devices/local labels

LADDER PROGRAMMING
Display the local device/local mark number prepared ladder program in monitor or simulator by
assignment object device distributed during conversion.
Select “Tool (t)"-> "Option (o)" from the menu, open "Setup option" dialog box, set Set display mode, set
"Display local assign devices during monitor" check box to selected state.

Mark.
3

Programming Skills
Local mark number distributed to local work area.
"Local label assignment", Page 3-163

■ Validate module or macro execution state


Click work space underside "monitoring" mark number in monitor/simulator, confirm the displayed
"module/macro monitor".

- KV-5000/3000 Series User’s Manual- 3-185


3-12 Programming Skills

■ Monitor CPU built-in function


LADDER PROGRAMMING

Right click "KV-5000/3000" on " work space ", select "Customize monitor (c)" from displayed menu,
display "Select custom monitor" dialog box. Select monitoring function, press "display" button, display
customized monitoring for the functions.

Other procedure Select "View(V)" -> "Custom Monitor(P)" from the menu.

(example) when monitoring CPU frequency counter

3
Programming Skills

Note
In simulator execution process, there is restriction for part function and device action.
Please refer to KV STUDIO User's Manual, "9-10 simulator function -simulator restriction"

3-186 - KV-5000/3000 Series User’s Manual-


3-12 Programming Skills

■ Monitor expansion unit

LADDER PROGRAMMING
On "work space", after select "Unit monitor (c)" from right click menu of the "units", display "unit
monitor" dialog box.

Other procedure ·Select "Display(V)" -> "Unit monitor(J)" from the menu.
· When monitoring through unit editor, after the units are selected, display from right click
menu.

(example) when monitoring KV-AD40

Programming Skills
Note
Display is unavailable when simulator runs.

Interrupt function

The so-called interrupt (Break) is the function to interrupt ladder program execution for the purpose of
checking certain instant state in continuously processed ladder program execution process.Use
interrupt function, it is unnecessary to add ladder circuit block for preparing state checkout.
In KV STUDIO, according to device state and value etc, "device interrupt" and "line interrupt" can be used.

Break functions during monitoring may cause a major hazard depending on the states of control
WARNING devices currently connected to the KV-5000/3000 as execution of the ladder program is aborted
once the break condition is established. Pay full attention to this before starting execution.

Note
During monitoring, please pay attention to the following points:
· When interrupt function is used, it is impossible to read and write ladder program
(including write in RUN mode).
· When power supply is OFF, operating mode RUN->PROG is switched, monitoring stops/ends
(including communication is abnormal), PLC error occurs, all interrupt settings will be deleted.

·Perform interrupt settings in PROG state, after changing to RUN state, check out action.
·In monitoring process, when use interrupt function to entry interrupt state, if output relay is
OFF, turn CR2302 on.

- KV-5000/3000 Series User’s Manual- 3-187


3-12 Programming Skills

■ Device interrupt
LADDER PROGRAMMING

According to state change of bit device and the value of work device, interrupt might occur.
In monitoring process, set up an interrupt condition; in analog simulation process, set up 16 interrupt
conditions simultaneously.
Select "Debug (D)" -> "Setup device break (B)" from the menu, set interrupt condition in the popped
"Setup device break" dialog box.

3
Programming Skills

Can be set only when


the Simulator is running.

Only one point can be


set during monitoring.

If condition is established, interrupt occurs, "Break information" dialog box will be displayed, program
execution is interrupted.Click "OK" button, program is still interrupted.

If interrupt is applied, and PLC run is interrupted, during monitoring, also execute " execute 1 step
(F8)" and " a scanning execute 1 scan (F9)". When restart to run, click " RUN/Cont scan
(F5)".

After execute CALL/MCALL/MSTRT instruction in steps, step shift is not required in


subprogram and macro, after execute CALL/MCALL/MSTRT instruction, use next instruction
to regenerate interrupt.

3-188 - KV-5000/3000 Series User’s Manual-


3-12 Programming Skills

LADDER PROGRAMMING
Note
· CR/CM/Z/CTH/CTC cannot be set as condition.
· During monitoring, interrupt condition is only limited to device consistency/inconsistency.
· During monitoring, if interrupt condition is established, the following parts will also execute
interrupt.
· In the end of scanning ... Cursor moves to the first line in mnemonic symbol list of
originally executed module.
· instruction of processing object device ... If it is bit device, word processing instruction
containing object bit device channel, and instruction of the same channel for
processing other bits will execute interrupt. 3
· During monitoring, in the following conditions, even if interrupt condition is established,

Programming Skills
instruction of processing object device will not execute interrupt.
· When designating condition by double word, only process one word instruction on
upper bit or lower bit
· When designating condition via bit device, execute word processing instruction for
channels containing this bit and channels before and after that simultaneously.

■ Row interrupt
Designate the part of ladder program to be interrupted. Up to 4 points can be set simultaneously during
monitoring, up to 16 points can be set simultaneously during simulation.

● Row interrupt of the ladder program


In case ladder line to be interrupted is selected, select "Set/cancel rung break" from right click menu.
After line interrupt is set, display red round mark beside line No. On the left.

● Line interrupt of mnemonic symbol list

1 Double click the line No. Of ladder to be interrupted.

Double click
row No.

Display "Mnemonic list" dialog box. Selected step consistent with the selected line.

- KV-5000/3000 Series User’s Manual- 3-189


3-12 Programming Skills

2 In the "Mnemonic list" dialog box, double-click the rung (step) to perform the break at.
LADDER PROGRAMMING

Other procedure After selecting a line, select "Set/cancel rung break (S)" from right click menu.

Indicates position of
current row executed. Select corresponding
mnemonics.

3
Display “?” after
Programming Skills

setting row interrupt.

Note
For simulator, during scanning execution (continuous/one scanning) line interrupt cannot be
added. When scanning is finished, cursor is moved to the top line in mnemonic symbol list
of the first module in execution sequence..

3-190 - KV-5000/3000 Series User’s Manual-


APPENDICES
APPENDICES
Record KV-5000/3000 series control relay (CR)/control memory (CM) list or
error list, command list used in this book etc.

1 PLC unit Error List ••••••••••••••••••••••••••••••••••••••••••••A-2


2 CR/CMlist•••••••••••••••••••••••••••••••••••••••••••••••••••••••A-7
3 ASCII Code Table••••••••••••••••••••••••••••••••••••••••••• A-19
4 Instruction List ••••••••••••••••••••••••••••••••••••••••••••••• A-20
5 Unusable Instruction List •••••••••••••••••••••••••••••••••• A-23
6 Shorted input list of mnemonic symbol ••••••••••••••••• A-24
7 List of Shortcut Keys ••••••••••••••••••••••••••••••••••••••• A-26
8 Unusable Character String List••••••••••••••••••••••••••• A-36
9 Index •••••••••••••••••••••••••••••••••••••••••••••••••••••••••• A-37

- KV-5000/3000 Series User’s Manual- A-1


1 PLC unit Error List
To describe the cause and treatment method for error No. And information displayed when KV-5000/
3000 body error occurs.
These errors may also be confirmed by KV STUDIO (error monitoring).
No. Message Causes Remedy
CALLネスト Exceed nest limit of Occur during the execution of program.Please note
10
CALL nest subroutine. application method of subroutine, correct program.
APPENDICES

FORネスト Occur during the execution of program.Please


FOR to NEXT instruction
11 note application method of FOR to NEXT
FOR nest nest exceeds the limit.
instruction, correct program.
INTネスト The interrupt concurrently Occur during the execution of program.Please note
12
INT nest exceeding the limit. application method of INT instruction, correct program.
MPSネスト MPS to MPP instruction nest Occur during the execution of program.Please note application
13
MPS nest exceeds the limit. method of MPS to MPP instruction, correct program.
PLC unit Error List

BREAK コスウ Number of BREAK instructions Occur during conversion.Please control the number of
14
BREAK Number exceeds the limit. BREAK instructions between FOR to NEXT within the limit.
コンバート Occur during conversion.Cause of conversion failure
15 Conversion fails. during KV STUDIO conversion.Please transmit the
Convert
program to body after cause is eliminated.
オブジェクトサイズ Project size of the program
19
Object Size exceeds capacity. Please reduce the size of program.
コードサイズ The code size of program The size of program can be checked via KV STUDIO
20
Code Size exceeds the limit.
マクロネスト Number of macro nests in multiple Please reduce macroinstruction in interrupt
22
MACRO nest interrupt exceeds the limit. program.
フセイナワリコミ
23
Illegal Interrupt
フセイナマクロ
24 Please connect power again after
Illegal Macro
カンセツシテイエラー troubleshooting.
25 System error.
Illegal Pointer Please contact the nearest office in case of
フセイナアドレス frequent occurrence.
26
Illegal Address
フセイナオブジェクト
27
Illegal Object
スキャンタイム Please correct program according to the following

オーバー conditions, check whether exceeding scanning time.

·FOR to NEXT instructions, etc performed repeatedly.

· jump processing instructions such as the CJ/


NCJ to LABEL instructions, etc.
When the scan time is over · program calling instructions such as CALL,
30
300ms MCALL instructions, etc.
Scan Time Over
· The instructions with longer processing time
such as FMOV, WSR and MAX instructions.

·Interrupt or constant cycle module processing


capacity is heavy or frequency is too high,
program cannot be executed normally.

A-2 - KV-5000/3000 Series User’s Manual -


1 PLC unit Error List

No. Message Causes Remedy


ラダースタックオー Please connect power again after troubleshooting.
31 バーフロー System error. Please contact the nearest office in case of
Ladder Stack Overflow frequent occurrence.
ラダーナシ Transfer programs to the PLC before
40 No program.
No Ladder operation.

APPENDICES
ユニット チェックサム
50*1 Expansion unit setting damaged.
Unit Checksum
Please use KV STUDIO or memory card to
ユニット セッテイ
Unit setting information not transfer the unit setting information to the PLC.
51 ジョウホウ
set.
Unit Setup Information
Expansion unit is logged on Please firstly cut off system power supply, use
ユニット ミセツゾク
52 in unit set up information, unit editor to connect already set expansion

PLC unit Error List


No Unit Connection
but actually not connected. unit.
カクチョウバス Please remove noise source.
Bus communication may
*1
53 ユニット タイムアウト Please contact the nearest office in case of
stop due to noise.
Unit Timeout frequent occurrence.
The expansion unit set using the
ユニット ダイスウ
54*2 Unit Editor is different from the Please firstly cut off system power supply, use
Unit Number
number of units actually connected. unit editor to connect already set expansion
unit.
ユニット シュベツ The expansion unit set using the Unit
55*1
Unit Type Editor is different from actual unit type.

カクチョウバス
Please remove noise source.
ツウシン Bus communication may
56*1 Please contact the nearest office in case of
Extend Bus Comm stop due to noise.
frequent occurrence.
Error
エンドユニット
57 ミセツゾク End unit not connected. Please disconnect system power, connect end unit.
No End Unit
ユニット バージョン Connect the expansion unit that Please firstly cut off system power supply, use unit editor to
59*1
Unit Version cannot be connected to the CPU unit. connect already set expansion unit.
FLASH ROM

イジョウ
80 Flash ROM abnormal.
FLASH ROM
Please contact the nearest office.
Damaged
SRAM イジョウ
81 Hardware fault.
SRAM Damaged
デンチ ヲ コウカン
Backup battery voltage
83 シテクダサイ Please replace backup battery.
lower.
Low Battery

*1 Unit No. For which error is displayed in access window.


*2 Number of actual connected units displayed in access window

- KV-5000/3000 Series User’s Manual - A-3


1 PLC unit Error List

No. Message Causes Remedy


SRAMクリア Due to low voltage of backup battery, Please firstly replace stand by battery, then

シテクダサイ RAM contents (current values of execute SRAM eliminate.Only delete device
84
CM,DM, EM, FM, R,B,CR, LR, T, value, alarm limit.Ladder program will be not
SRAM Backup
C,CTH, CTC) are destroyed. deleted.
APPENDICES

RTC デンアツ テイカ Due to voltage lower of backup Please replace backup battery, check clock
85
RTC Low Voltage battery, clock data may lose. data, if required, reset clock.

メモリカードイジョ Please check file system in memory card.


Memory card may be
ウ Please check using chkdsk instruction of
damaged.Might stopped
87 Windows instruction prompt.
under influence of
Memory Card Error (example) when memory card is E driver:
electromagnetic, noise etc.
PLC unit Error List

C:\WINDOWS>CHKDSK E:
メモリカード ガ
Please remove memory card according to
ヌカレマシタ The card is pulled out during
88 correct operation steps.
Memory Card memory card accessing.
"Used on the KV-5000/3000", Page 2-45
Removed
メモリカード
Power is disconnected Please use memory card according to correct
アクセスチュウ オフ
89 during memory card operation steps.
Memory Card Power
accessing. "Used on the KV-5000/3000", Page 2-45
OFF
メモリカード Accessing other memory
Please terminate memory card access before
90 カンリョウマチ cards occurs during memory
operation.
Memory Card Busy card accessing.
イーサコントローラ

イジョウ (only KV-5000) abnormal


91
Ethernet-C among Ethernet controllers.
Damaged
アクセスウィンドウ Please connect power again after

イジョウ Access window controller troubleshooting.


92
Access Window abnormal. Please contact the nearest office in case of
Damaged frequent occurrence.
キノウカクチョウ

ユニット イジョウ CPU function expansion unit


93
Expansion Module abnormal.
Damaged
キノウカクチョウ
ユニット ID Connect non-applied CPU
94 请确认连接到CPU单元左侧的功能扩展单元。
Expansion Module function expansion unit.
ID
ファイル アクセス Accessing CPU unit flash
95 チュウ memory, processing cannot Please try to execute again.
File Access Busy be executed.

A-4 - KV-5000/3000 Series User’s Manual -


1 PLC unit Error List

No. Message Causes Remedy


フセイナデンソウ
118 データ
Illegal Data
ウォッチドックタイマ
120
Watch Dog Timer

APPENDICES
スタック オーバーフロー
121
Stack Overflow
System error.
システムエラー
122
System Error Please connect power again after
デバイス ハンイ troubleshooting.
123 Out Of Device
Please contact the nearest office in case of
Range
frequent occurrence.

PLC unit Error List


リソース
124
Resource
エラーバッファ
125 オーバーフロー System errors exceed the limit.
Error Buffer Overflow
エラーバッファ
126 イジョウ System error.
Error Buffer Invalid
ジドウヨミコミ Automatic reading from
Memory card fails due to the
following reasons. · please release write protection, transfer to
127 Cpu Auto Load ·Settings write protection in the PLC.
failure CPU system setting. ·Please transfer the file applicable to the PLC.
·A problem occurs in the file
content in memory card.
ラダー エンザン ·Please confirm program, correct calculation error reason.
Operation error (CR2012 · Confirm expansion information in case of
128
Ladder Calc ON error), error, correct the cause of operation error.
"When No.128 (calculation error)", Page 3-21
ユニット エラー Unit error occurs (direct Unit No.,unit type, unit error No., , error sentence for which
129 access switch is red lamp error is displayed in access window.For specific
Unit Error
illumination error). description, please refer to instruction manual of the units.
ダイレクト IO Direct I/O error occurs (the unit for
which direct access designated Please confirm model of the unit for which
130
Direct IO relay is distributed is not suitable for direct I/O relay is distributed.
real time processing).
FLASH ROM

フォーマット
131 FlashROM format abnormal
FLASH ROM
After clearing all, please connect power again.
Format
"All Clear Mode", Page 2-37
ラダーファイル Program saved in flash
132 フセイ memory is abnormal.
Illegal Ladder File

- KV-5000/3000 Series User’s Manual - A-5


1 PLC unit Error List

No. Message Causes Remedy


Start Up Error Abnormity occurs in start Please turn on it again.(error cannot be
250
Please Reset processing. eliminated.Or is not reserved in error log.)

Please contact the nearest office in case of


251 AW Timeout Error Part error.
frequent occurrence.
APPENDICES
PLC unit Error List

A-6 - KV-5000/3000 Series User’s Manual -


2 CR/CM list

Control Relays (CR)

Control relay (CR0000 - CR3915) may realize confirmation of CPU unit action state, settings or monitoring of built-in functions etc.
Control relay reversed in the system cannot be used.
Attribute
Device No. Function

APPENDICES
R: Read only

Blank: R/W

CR0000 Logging tracing execution ON: enabled, OFF: disabled


CR0001 R Logging/tracing operation in progress
CR0002 R Logging/tracing file write result
CR0003 R Alarm for 50% buffer or less in Record
CR0004 R Record buffer overflow
CR0005 R Write in RUN

CR/CM list
CR0006 to CR0007 - Logging/tracing Reserved for system
CR0008 R function (IDO) Logging/tracing error
CR0009 R Record/follow-up memory card capacity insufficient error
CR0010 R Record/follow-up device, trigger set up abnormal
CR0011 R Tracing file save trigger monitor
CR0012 R Tracing data capture complete
CR0013 R Record/track write setting
CR0014 to CR0015 - Reserved for system
Logging/tracing
CR0100 to CR0915 (same as CR0000 to CR0015)
function(ID1 to ID9)
Real-time chart
CR1000 to CR1015 (same as CR0000 to CR0015)
monitor(ID10)
CR1100 to CR2001 - Reserved for system
CR2002 R Always ON
CR2003 R Always OFF
CR2004 R +10ms clock pulse (Duty ratio 50%)
CR2005 R 100ms clock pulse (Duty ratio 50%)
CR2006 R 1s clock pulse (Duty ratio 50%)
CR2007 R When running starts, cut off a scanning cycle
CR2008 R When running starts, connect a scanning cycle
CR2009 On when the operation result is negative or overflow
CR2010 R ON when the operation result is 0
CR2011 R On when the operation result is positive
CR2012 R ON when calculation operation error
CR2013 to CR2015 - Reserved for system
CR2100 R CTH0 dedicated internal clock (1µs)
CR2101 R CTH0 dedicated internal clock (10µs)
CR2102 R CTH0 dedicated internal clock (100µs)

- KV-5000/3000 Series User’s Manual- A-7


2 CR/CM list

Attribute
Device No. R: Read only Function
Blank: R/W

CR2103 Automatic reset of CTH01 (ON: reset, OFF: not reset)


CR2104 Disable match output for R00500/R00504 comparator. ON: disable OFF: enable
High-speed
Set R00500/R00504 comparator match output to OFF (ON: proceed
CR2105 counter
OFF: not proceed)
Action when
APPENDICES

comparator Set R00500/R00504 comparator match output to OFF (ON: proceed


CR2106 CTC0 is on OFF: not proceed)
At each time when on, reverse R00500/R00504 comparator - output ON/
CR2107
OFF state (ON: set, OFF: not set)
CR2108 Disable match output for R00500/R00504 comparator. ON: disable OFF: enable
Set R00500/R00504 comparator match output to OFF (ON: proceed
CR2109
Action taken OFF: not proceed)
when High-
Set R00500/R00504 comparator match output to OFF (ON: proceed
CR/CM list

CR2110 speed Counter


OFF: not proceed)
Comparator
CTC1 is ON At each time when on, reverse R00500/R00504 comparator - output ON/
CR2111
OFF state (ON: set, OFF: not set)
CR2112 Automatic reset of CTH01 (ON: reset, OFF: not reset)

Single phase
High-speed 1Single 2Single 4Single 2pulse
Without direction With direction
counter CTH0
CR2113 to CR2115 CR2113 OFF ON OFF ON OFF ON
count input
CR2114 OFF OFF ON ON OFF OFF
mode selection
CR2115 OFF OFF OFF OFF ON ON

CR2200 R CTH1 dedicated internal clock (1µs)


CR2201 R CTH1 dedicated internal clock (10µs)
CR2202 R CTH1 dedicated internal clock (100µs)
CR2203 Automatic reset of CTH01 (ON: reset, OFF: not reset)
CR2204 Disable match output for R00501/R00505 comparator. ON: disable OFF: enable
Action taken
Set R00500/R00504 comparator match output to OFF (ON: proceed
CR2205 when High-
OFF: not proceed)
speed Counter
Comparator is Set R00500/R00504 comparator match output to OFF (ON: proceed
CR2206 ON OFF: not proceed)
The output ON/OFF status of R00501/R00505 is inverted (ON: set,
CR2207
OFF: not set) each time ON.
CR2208 Disable match output for R00501/R00505 comparator. ON: disable OFF: enable
Set R00500/R00504 comparator match output to OFF (ON: proceed
CR2209
Action taken OFF: not proceed)
when High-
Set R00500/R00504 comparator match output to OFF (ON: proceed
CR2210 speed Counter
OFF: not proceed)
Comparator
CTC3 is ON At each time when on, reverse R00500/R00504 comparator - output ON/
CR2211
OFF state (ON: set, OFF: not set)
CR2212 Automatic reset of CTH01 (ON: reset, OFF: not reset)

Single phase 1Singl 2Singl 4Singl


High-speed 2pulse
Without direction With direction e e e
counter CTH1
CR2213 to CR2215 CR2113 OFF ON OFF ON OFF ON
count input
CR2114 OFF OFF ON ON OFF OFF
mode selection
CR2115 OFF OFF OFF OFF ON ON

CR2300 External output disnabled (ON: set, OFF: not set)


CR2301 External input refresh disnabled(ON: proceed, OFF: not proceed)
CR2302 External output disnabled (ON: set, OFF: not set) in case of BREAK

A-8 - KV-5000/3000 Series User’s Manual-


2 CR/CM list

Attribute
Device No. R: Read only Function
Blank: R/W

CR2303 -fixed scanning time running (ON:enabled, OFF: disabled)


Scanning time settings (constant scanning time running. END processing time
CR2304 R
settings) only one scanning on in case of overflow
Set input time constant of full input for CPU unit (ON: set to alarm -> CM1620 OFF: set
CR2305

APPENDICES
not to alarm)
CR2306 R When backup battery abnormal ON
CR2307 Clear Min./Max. value of scan time
CR2308 Set END processing time (ON: enable, OFF: disable)
CR2309 to CR2315 - Reserved for system

Not used Up Down Level


CTH0 external
CR2400, CR2401 CR2400 OFF ON OFF ON
signal preset

CR/CM list
CR2401 OFF OFF ON ON

CR2402 Select CTH0 counter code (ON: ring, OFF: linear)


CR2403 Test CTH0 overflow/underflow (on: tested OFF: untested)

Not used Up Down Level


CTH1 external
CR2404, CR2405 CR2404 OFF ON OFF ON
signal preset
CR2405 OFF OFF ON ON

CR2406 Select CTH1 counter code (ON: ring, OFF: linear)


CR2407 CTH1 overflow or underflow(ON: yes, OFF: no)
CR2408 CTH 0 reserve(ON: disable,OFF: enable)
CR2409 CTH1 reserve (ON: disable,OFF: enable)
CR2410 CTH0 internal startup relay (ON: counting enabled,OFF: counting disabled)
CR2411 CTH1 internal startup relay (ON: counting enabled,OFF: counting disabled)
CR2412 R CTH0 changing direction (ON: subtract, OFF: addition)
CR2413 R CTH1 changing direction (ON: subtract, OFF: addition)
CR2414 R CTH0 dedicated internal clock (50ns)
CR2415 R CTH1 dedicated internal clock (50ns)
CR2500 External output disabled (ON: set, OFF: not set)

Single-phase Single-phase 2phase 1


Set up input 2pulse
without direction with direction multiplication
CR2501, CR2502
Frequency source CR2501 OFF ON OFF ON
counter (CTH0) CR2502 OFF OFF ON ON

CR2503 Hz/rpm switching(ON: rpm,OFF: Hz)


Use the function of rotating once to update rotation speed (ON: use
CR2504
alarm, OFF: do not use alarm)
CR2505 CTH0 comparator matching output relay switch (ON: R504 OFF: R500)
CR2506 Designate frequency pulse output (CTH0) (ON: proceed, OFF: not proceed)
CR2507 Specify frequency pulse(CTH0)output end
CR2508 External output disabled (ON: set, OFF: not set)

Single-phase Single-phase 2phase 1


Set up input 2pulse
without direction with direction multiplication
CR2509, CR2510
Frequency source CR2509 OFF ON OFF ON
counter (CTH1) CR2510 OFF OFF ON ON

CR2511 Hz/rpm switching (ON: rpm,OFF: Hz)


Use the function of rotating once to update rotation speed (ON: use
CR2512
alarm, OFF: do not use alarm)

- KV-5000/3000 Series User’s Manual- A-9


2 CR/CM list

Attribute
Device No. R: Read only Function
Blank: R/W

CR2513 CTH1 comparator matching output relay switch (ON: R505 OFF: R501)
CR2514 Designate frequency pulse output (CTH0) (ON: proceed, OFF: not proceed)
CR2515 Specify frequency pulse(CTH1)output error
APPENDICES

Single-phase Single-phase 2phase 1


2pulse
without direction with direction multiplication
CR2600,CR2601 INT R000 interrupt polarity CR2600 OFF ON OFF ON
CR2601 OFF OFF ON ON

CR2602,CR2603 INT R000 interrupt polarity (the same with CR2600, CR2601)
CR2604,CR2605 INT R001 interrupt polarity (the same with CR2600, CR2601)
CR2606,CR2607 INT R003 interrupt polarity (the same with CR2600, CR2601)
CR2608,CR2609 INT R004 interrupt polarity (the same with CR2600, CR2601)
CR/CM list

CR2610,CR2611 INT R005 interrupt polarity (the same with CR2600, CR2601)
CR2612,CR2613 INT R006 interrupt polarity (the same with CR2600, CR2601)
CR2614,CR2615 INT R007 interrupt polarity (the same with CR2600, CR2601)
CR2700,CR2701 INT R008 interrupt polarity (the same with CR2600, CR2601)
CR2702,CR2703 INT R009 interrupt polarity (the same with CR2600, CR2601)
CR2704 to CR2715 - Reserved for system
CR2800 Send interrupt signal (when ON)
CR2801 R Scan once ON when receiving text data
CR2802 R Text data read error
Serial
CR2803 R Scan once ON when receiving text data error
communication
CR2804 Start sending text data( send in progress ON)
CR2805 Use bit unit to receive text data (ON: proceed, OFF: not proceed)
CR2806 Use word unit to send text data (ON: proceed, OFF: not proceed)
CR2807 to CR2813 - Reserved for system
Zero suppression during execution of ASC command (full postfix), FASC command
CR2814
(ON: proceed, OFF: not proceed)
The sign "+" is not used when DASC.S, DASC.L and FASC instructions are executed
CR2815
(ON: proceed, OFF: not proceed)
CR2900 user message display 1 (ON: display OFF: not display)
Access window
CR2901 user message display 2 (ON: display OFF: not display)
CR2902 to CR2915 - Reserved for system

A-10 - KV-5000/3000 Series User’s Manual-


2 CR/CM list

Attribute
Device No. R: Read only Function
Blank: R/W

CR3000 Limit switch CW direction input


CR3001 Limit switch CCW direction input
CR3002 Origin sensor input
CR3003 Stop sensor input

APPENDICES
CR3004 R Origin return in progress
CR3005 R Origin return complete
CR3006 Positioning complete relay
CR3007 CPU Positioning Error/error clear
CR3008 function X axis Warning/clear warning

CR3009 Pulse output in progress/emergency stop

CR/CM list
CR3010 Driver operation start
CR3011 Current value change request (level detection)
CR3012 Operation speed change request (level detection)
CR3013 Comparator 2 consistency relay
CR3014 -
Reserved for system
CR3015 -
CR3100 Limit switch CW direction input
CR3101 Limit switch CCW direction input
CR3102 Origin sensor input
CR3103 Stop sensor input
CR3104 R Origin return in progress
CR3105 R Origin return complete
CR3106 Positioning complete relay
CR3107 CPU Positioning Error/error clear
CR3108 function Y axis Warning/clear warning

CR3109 Pulse output in progress/emergency stop


CR3110 Driver operation start
CR3111 Current value change request (level detection)
CR3112 Operation speed change request (level detection)
CR3113 Comparator 2 consistency relay
CR3114 -
Reserved for system
CR3115 -
CR3200 to CR3209 - Reserved for system
CR3210 R Any record/follow-up memory card is using
CR3211 R To use Memory Card
CR3212 R Memory card ID complete
CR3213 R With memory card
CR3214 R Execute command of memory card in progress
CR3215 R Memory card write protection (ON: write protection, OFF: no write protection)
CR3300 to CR3415 Alarm relay
CR3500 R Alarm relay operation in progress (ON when any of CR3300 to CR3415 is ON)
CR3501 Record when alarm relay is ON-> OFF (ON: reserve, OFF: unreserve)
CR3502 Clear alarm relay log when OFF to ON

- KV-5000/3000 Series User’s Manual- A-11


2 CR/CM list

Attribute
Device No. R: Read only Function
Blank: R/W

CR3503 to CR3513 - Reserved for system


CR3514 HKEY Multiple key disabled
CR3515 R instruction Scan end
CR3600 to CR3615 R HKEY instruction information storage area
APPENDICES

CR3700 F1 customize switch 1


CR3701 F2 customize switch 2
CR3702 F3 customize switch 3
CR3703 F4 customize switch 4
CR3704 LED1 customize indicator 1
CR3705 LED2 customize indicator 2
CR/CM list

CR3706 LED3 customize indicator 3


CR3707 LED4 customize indicator 4
CR3708 Operation panel Green back light (illuminates when ON)
CR3709 KV-D30 Red back light (illuminates when ON)
CR3710 System information display language (ON: Japanese, OFF: English)
CR3711 Buzzer ON
CR3712 Screen display settings (on: positive display, OFF: negative display)
CR3713 Alarm interrupt enable (ON: enable, OFF: disable)
CR3714 Page conversion (rise switch to CM0401 value page, forced OFF)
CR3715 Use "▲" and "▼" for Page switching (ON: disabled, OFF: enabled)
CR3800 When in on state, external output 0 is also in on state
CR3801 When in on state, external output 1 is also in on state
CR3802 to CR3815 - Reserved for system
CR3900 Error log cleared when OFF->ON
CR3901 Alarm cleared when OFF->ON
CR3902 R Severe error log is the largest number
CR3903 R Maximum number of alarm records
CR3904 R RUN/PRG toggle switch status (ON: RUN side OFF: PROG side)
CR3905 R Serious error occurring
CR3906 R Alarm occuring
CR3907 Power ON log cleared when OFF->ON
CR3908 Power OFF cleared when OFF->ON
CR3909 Error clear currently occurring error(Only SET/RES instructions)
CR3910 to CR3915 - Reserved for system

A-12 - KV-5000/3000 Series User’s Manual-


2 CR/CM list

Control Memory CM

Control memory (CM0000 - CM5999) may realize confirmation of CPU unit action state, settings or
monitoring of built-in functions etc.
Control memory reversed in the system cannot be used.

APPENDICES
Attribute
Device No. R: Read only Function
Blank: R/W

CM0000, CM0001 Set up 1st line display device


CM0002, CM0003 Operation panel Set up 2nd line display device
CM0004, CM0005 KV-D30 Set up 3rd line display device
CM0006, CM0007 - 0 Page Set up 4th line display device
CM0008, CM0009 Reserved for system
CM0010 to CM0199 Page 1 to 19 (same as CM0000 to CM0009)

CR/CM list
CM0200, CM0201 Set up 1st line display attribute
CM0202, CM0203 Set up 2nd line display attribute
Operation panel
CM0204, CM0205 Set up 3rd line display attribute
KV-D30
CM0206, CM0207 Set up 4th line display attribute
0 Pages
CM0208 Setup module 1
CM0209 Setup module 2
CM0210 to CM0399 Page 1 to 19 (same as CM0200 to CM0209)
CM0400 For conversion enable/disnable setting
CM0401 For settings of page conversion
CM0402 Operation panel Current display page
CM0403 to CM0409 KV-D30 Reserved for system
CM0410 to CM0415 Direct access function
CM0416 to CM0499 - Reserved for system
CM0500 to CM0699 - Reserved for system
CM0700 R (year)
CM0701 R (month)
CM0702 R (day)
Read from
CM0703 R (hour)
calendar timer
CM0704 R (Minute)
CM0705 R (s)
CM0706 R (week)
CM0707 - Reserved for system
CM0708, CM0709 R Free Run Counter (32-bit, 1ms)
CM0710 R Current memory No.of FM
CM0711 - Reserved for system
CM0712 R Execution time of constant cycle module (10µs unit)
CM0713 to CM0715 - Reserved for system
CM0716 Maximum exeuction time (10µs unit) for Fixed Period Module
CM0717 to CM0719 - Reserved for system
CM0720 R Scan time measuring value (10µs unit)
CM0721 Fixed scanning time run set value (10µs unit)
CM0722 R Exceeds scanning time set up (-fixed scanning time running/END processing time settings) scanning time (10µs unit)
CM0723 END processing time measured value (10µs unit)
CM0724 to CM0725 - Reserved for system
CM0726 R Maximum fixed scanning time (10µs unit)
CM0727 R Minimum fixed scanning time (10µs unit)
CM0728 END processing time set value (10µs unit)
CM0729 Exceeds scanning time set up (-fixed scanning time running/END processing time settings) scanning time (10µs unit)
CM0730 to CM1479 - Reserved for system
CM1480, CM1481 R Frequency measuring result(Hz or rpm)
Frequency counter
CM1482 1Number of placed pulse
function (CTH0)
CM1483 Scan times

- KV-5000/3000 Series User’s Manual- A-13


2 CR/CM list

Attribute
Device No. R: Read only Function
Blank: R/W

CM1484, CM1485 Specify frequency Setup frequency (Hz)


CM1486 pulse output function. Duty ratio (0 to 100%)
CM1487 to CM1489 - Reserved for system
CM1490, CM1491 R Frequency measuring result (Hz or rpm)
Frequency counter
CM1492 Number of pulses per rotation
APPENDICES

function (CTH1)
CM1493 Scan times
CM1494, CM1495 Specify frequency Setup frequency (Hz)
CM1496 pulse output function. Duty ratio (0 to 100%)
CM1497 to CM1593 - Reserved for system
CM1594 CTH0 change direction detection constant
CM1595 CTH01 change direction detection constant
CM1596, CM1597 Lower limit of CTH0 ring counter
CM1598, CM1599 Lower limit of CTH1 ring counter
CR/CM list

CM1600, CM1601 CTH0 ring counter upper limit


CM1602, CM1603 CTH1 ring counter upper limit
CM1604, CM1605 CTH0 preset value
CM1606, CM1607 CTH1 preset value
CM1608 CTH0 start, reset, polarity set up
CM1609 CTH0 start, reset, polarity set up
CM1610, CM1611 R INT R00000 Input capture (high bit, low bit) when occurred
CM1612, CM1613 R INT R00001 Input capture (high bit, low bit) when occurred
CM1614, CM1615 R INT R00002 Input capture (high bit, low bit) when occurred
CM1616, CM1617 R INT R00003 Input capture (high bit, low bit) when occurred
CM1618, CM1619 - Reserved for system
CM1620 Setup constant when inputting
CM1621 to CM1659 - Reserved for system
CM1660 to CM1669 R Log/trace Ring Buffer free space (ID0 to ID10)
CM1670 to CM1679 - Reserved for system
CM1680 to CM1689 R Log/trace File Save Counter (ID0 to ID10)
CM1690 to CM1699 - Reserved for system
CM1700, CM1701 Digital trimmer 0 upper limit
CM1702, CM1703 Digital trimmer 1 upper limit
CM1704, CM1705 Digital trimmer 2 upper limit
CM1706, CM1707 Digital trimmer 3 upper limit
CM1708, CM1709 Digital trimmer 4 upper limit
CM1710, CM1711 Digital trimmer 5 upper limit
CM1712, CM1713 Digital trimmer 6 upper limit
CM1714, CM1715 Digital trimmer 7 upper limit
CM1716 to CM1719 Reserved for system
CM1720 user message 1
CM1721 to CM1737 Access user message 2 (up to 24 characters + end character (00 H))
CM1738 Window Setting Inhibited Operation
CM1739 - Reserved for system
CM1740 to CM1756 LD project name (up to 32 characters +end character (00 H))
CM1757 to CM1763 Access window display project name (up to 12 characters + end character (00 H))
CM1764 to CM1799 - Reserved for system
Year month (decimal number, lower two 2 digits represent month,
CM1800 digits above hundred digit represent year.
Serious error Example: 707 -> June, 2007
CM1801 log day
CM1802 (latest) hour(0 to 23)
CM1803 minute
CM1804 Error No.
CM1805 to CM1899 Error log (2 to 20 records, same as CM1800 to CM1804)

A-14 - KV-5000/3000 Series User’s Manual-


2 CR/CM list

Attribute
Device No. R: Read only Function
Blank: R/W

Year month (decimal number, lower two 2 digits represent month,


CM1900 digits above hundred digit represent year.
Power ON log Example: 707 -> June, 2007
CM1901 day
(latest)
CM1902 hour(0 to 23)

APPENDICES
CM1903 minute
CM1904 second
CM1905 to CM1999 Power ON log (2 to 20 records, same as CM1800 to CM1804)
CM2000 I/O setting
CM2001 Start sensor
CM2002, CM2003 Comparator 0
CM2004, CM2005 Comparator 1
CM2006 Origin return: starting speed

CR/CM list
CM2007 Zero return: acceleration/deceleration time
CM2008, CM2009 Origin return: running speed
CM2010 JOG operation: starting speed
CM2011 CPU JOB operation: acceleration/deceleration time
CM2012, CM2013 Positioning JOG operation: running speed
CM2014, CM2015 function Current value change setting value
CM2016, CM2017 X axis Operation speed change setting value
CM2018 Set up the origin return detail
CM2019 Operation in progress point No.(M code)
CM2020, CM2021 R Current position
CM2022, CM2023 R Current speed
CM2024 Error code
CM2025 Specify point No.
CM2026, CM2027 Resting position coordinate setpoint
CM2028, CM2029 Comparator 2
CM2030 I/O setting
CM2031 Start sensor
CM2032, CM2033 Comparator 0
CM2034, CM2035 Comparator 1
CM2036 Origin return: starting speed
CM2037 Zero return: acceleration/deceleration time
CM2038, CM2039 Origin return: running speed
CM2040 JOG operation: starting speed
CM2041 CPU JOB operation: acceleration/deceleration time
CM2042, CM2043 Positioning JOG operation: running speed
CM2044, CM2045 function Current value change setting value
CM2046, CM2047 Y axis Operation speed change setting value
CM2048 Set up the origin return detail
CM2049 Operation in progress point No.(M code)
CM2050, CM2051 R Current position
CM2052, CM2053 R Current speed
CM2054 Error code
CM2055 Specify point No.
CM2056, CM2057 Resting position coordinate setpoint
CM2058, CM2059 Comparator 2
CM2060, CM2061 CPU Target value/amount of movement
CM2062 Positioning Startup speed
CM2063 Acceleration/deceleration time
function
CM2064, CM2065 Operation speed
Point parameter
CM2066 Operation mode
CM2067 Specified pulse number for stop sensor
CM2068, CM2069 0 Reserved for system

- KV-5000/3000 Series User’s Manual- A-15


2 CR/CM list

Attribute
Device No. R: Read only Function
Blank: R/W

CM2070 to CM2379 Point parameter 1 to 31 (The same with CM2060 to CM2069)


CM2380 to CM2389 - Reserved for system
CM2390 R Error code used for memory card instruction
CM2391 Power OFF when accessing memory plug-in board (when occurred: the value other than 0)
CM2392 to CM2399 Reserved for system
APPENDICES

Interrupt times (INT0 to INT3, CTC2, CTC3, CTC0, CTC1, positioning X axis,
CM2400 to CM2416
positioning Y axis, INT4 to INT9, fixed cycle module)
CM2417 to CM2999 - Reserved for system
CM3000 Number of received texts
CM3001 to CM3999 Text received data (1998-byte)
CM4000 Number of sending texts
CM4001 to CM4999 Text send data (1998-byte)
Year month (decimal number, lower two 2 digits represent month,
CR/CM list

CM5000 digits above hundred digit represent year.


Example: 707 -> June, 2007
Power OFF log
CM5001 day
(latest)
CM5002 hour(0 to 23)
CM5003 minute
CM5004 second
CM5005 to CM5099 Power OFF log (2 to 20 units the same with CM5000 to CM5004)
Year month (decimal number, lower two 2 digits represent month,
CM5100 digits above hundred digit represent year.
Example: 707 -> June, 2007
CM5101 day
CM5102 HH
CM5103 Latest serious minute
CM5104 error detail second
CM5105 information 1 Error No.
CM5106 unit* Effective data number of expansion information
CM5107 Extension information 1*
CM5108 Extension information 2*
: :
: :
CM5126 Extension information 20*
Year month (decimal number, lower two 2 digits represent month,
CM5150 digits above hundred digit represent year.
Example: 707 -> June, 2007
CM5151 day
CM5152 hour
CM5153 Latest general minute
CM5154 warning detail second
CM5155 information 1 Error No.
CM5156 * Effective data number of expansion information
unit
CM5157 Extension information 1*
CM5158 Extension information 2*
: :
: :
CM5176 Extension information 20*
CM5177 to CM5999 - Reserved for system
* Extension information error is coded as follows:

A-16 - KV-5000/3000 Series User’s Manual-


2 CR/CM list

· When No.128 (calculation error)


Extension information n Description
Extension information1 Details of error
1 0 (not used)
1 Improper indirect specification
2 The indirectly specified target is T/C

APPENDICES
3 Improper simple indirect specifying
4 Beyond operand range
5 Floating real number overflow
6 Improper device specifying
7 ROOT operand is negative
8 No ENCO instruction ON bit
9 Floating-point real number error

CR/CM list
10 Trigonometric function operand error
11 data cannot be converted
12 Improper table specifying
13 Time comparison instruction operand error
14 Cam switch operand error
15 Frequency counter instruction operand error
16 0 division operation
17 Record ID illegal
18 Direct Processing Error
19 The units cannot direct processed
20 Subroutine does not exist for transfer target
21 Writing during RUN, cannot execute command
22 Expansion unit special command object error (unit No.)
Extension information1 2 00H fixed
Extension information1 3 Step number high bit error
Extension information1 4 Step number low bit error
Extension information 5 to 20 Use SJIS to store module name.(the part other than module name is 00H)

· No.50,53,55,56,58,59 (unit ID related errors)


Extension information n Description
Unit No. (according to occurrence state of error, when unit No. Cannot be
Extension information1 1
designated, it will not be saved.)
Extension information 2 to 20 00H fixed

· When No.54 (error related with number of units)


Extension information n Description
Extension information1 1 Number of units on unit setting information
Extension information1 2 Actually connected number of units
Extension information 3 to 20 00H fixed

- KV-5000/3000 Series User’s Manual- A-17


2 CR/CM list

· When No.129 (unit error)


Extension information n Description
Extension information1 1 Unit No.
Extension information1 2 Error No. of each unit
Extension information 3 to 20 00H fixed

· In case of error numbers other than above


APPENDICES

Extension information n Description


Extension information 1 to 20 00H fixed
CR/CM list

A-18 - KV-5000/3000 Series User’s Manual-


3 ASCII Code Table

ASCII Code Table

High 4 bits

0 1 2 3 4 5 6 7 8 9 A B C D E F

APPENDICES
N D S
0 U
L
L
E P 0 ˜ P ˼ p ࡯ ࠲ ࡒ
S D
1 O
H
C
1 ʽ 1 A Q a q DŽ ࠕ ࠴ ࡓ
S D
2 T
X
C
2 ” 2 B R b r Nj ࠗ ࠷ ࡔ
E D
3 T
X
C
3 ʿ 3 C S c s nj ࠙ ࠹ ࡕ

ASCII Code Table


E D
4 O
T
C
4 ˀ 4 D T d t ǃ ࠛ ࠻ ࡗ
E N
5 N
Q
A
K ˁ 5 E U e u DŽ ࠝ ࠽ ࡙
A S
6 C
K
Y
N ˂ 6 F V f v ࡥ ࠞ ࠾ ࡛
Low 4 bits

B E
7 E
L
T
B ’ 7 G W g w ࠔ ࠠ ࠿ ࡜
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 ˷ k ̗
E
ࠜ ࠨ ࡅ ࡠ
C FF → ˈ ˘ L \ l ̘ ࡖ ࠪ ࡈ ࡢ
D CR ← ࡯ ˙ M ˹ m ̙ ࡘ ࠬ ࡋ ࡦ
E SO ↑ ˊ ˚ N ˺ n ̚ ࡚ ࠮ ࡎ ࠐ
D
F SI ↓ ˋ ? O ˻ o E
L ࠶ ࠰ ࡑ °

- KV-5000/3000 Series User’s Manual- A-19


4 Instruction List
Command and processing outline are as shown in the table.For related detailed content, please refer to
description page of the commands.
The following execution condition symbols are used in the list of instructions: for execution at every
scan, for execution for one scan only at an up edge, and for execution for one scan
only at a down edge.
APPENDICES

Ex
ec
uti Descr
on
Sorting mnemonics Sign Instruction function co iption
nd
iti Page
on

Log record instruction

n
LOGE Logging enabled for specified log ID. 2-64
LOGE
Instruction List

n
Log

LOGD Logging disabled for specified log ID. 2-64


LOGD

n
TRGD Capture log data of ID specified. 2-66
TRGD

High-speed processing instructions


.D CTH n Response frequency
CTH S Line drive input: single-phase 100 khz, phase
.L difference 50 khz
High-speed counter

.D Open collector input: single-phase 60khz, phase


2-114
difference 30khz
CTC S 32 bit(0 to 4294967295Or
.L CTC n
-2147483648 to 2147483647)Up/down counter
operation

RFSCTH Refresh current value of high-speed counter to the


RFSCTH n 2-118
updated value.

  Frequency counter instructions


FCNT n
FCNT Use high speed counter, test frequency. 2-134
Counter

S1 S2 D

RCNT n Use high speed counter, test rotating speed of pulse


RCNT S1 S2 D
2-136
input.

  Cam switch instructions


MCMP
S1 S2 D
MCMP Operate multiple control sections comparer. 2-140
n
Cam switch

ABSENC
ABSENC S1 S2 D1 Use absolute type encoder, operate the cam. 2-144
D2

INCENC
INCENC S1 S2 S3 Use incremental encoder, operate the cam. 2-148
D1 D2

  Specify frequency pulse output instruction


Pulse output

S Use high speed counter, perform pulse output of


PLSOUT PLSOUT n1 2-154
specified frequency.
n2

A-20 - KV-5000/3000 Series User’s Manual-


4 Instruction List

Exe
cuti Descr
Sorti mnemonics Sign Instruction function on
iption
ng con
ditio
n Page
  Positioning instructions
Ladder control

n
PLSX Start Trapezoidal control of X axis.
PLSX

APPENDICES
2-186
PLSY n Start trapezoidal control of Y-axis.
PLSY

JOGX
JOG operation

JOGX CW Execute JOG operation of X-axis.


CCW
HIGH
2-188
JOGY
JOGY CW Execute JOG operation of Y-axis.

Instruction List
CCW
HIGH
Origin returning

ORGX ORGX Start origin return on the X-axis.

2-190
ORGY ORGY Start origin return on the Y-axis.
Teaching

TCHX TCHX Acquire current position of X-axis.


2-192
TCHY TCHY Acquire current position of Y-axis.
Current value update Operation speed Moving to initial position

HOMEX HOMEX Start moving to home position of X-axis.

2-194
HOMEY HOMEY Start moving to home position of Y-axis.

S
CHGSPX Change the operation speed of X-axis.
CHGSPX
2-196
S
CHGSPY Change the operation speed of Y-axis.
CHGSPY

RFSPSX Refresh current value and speed of X-axis to the


RFSPSX
updated value.

2-198
RFSPSY Refresh current value and speed of Y-axis to the
RFSPSY
updated value.

- KV-5000/3000 Series User’s Manual- A-21


4 Instruction List

Exe
cuti Descr
Sorti on
ng mnemonics Sign Instruction function con iption
ditio
n Page
  High-speed processing instructions
Input time constant

HSP Reduce time constant of input relay, improve input


APPENDICES

HSP D 3-46
response characteristic.

DI DI Disable execution of interrupt programs. 3-47

EI EI Enable execution of interrupt programs. 3-47

D
DIC Set up interrupt disnable range. 3-48
Instruction List

Interrupt

DIC

INT Interrupt program before implementing RETI


INT S - 3-50
command.

RETI
RETI Indicates the end of the interrupt program. - 3-50

  Module instructions
MDSTRT
MDSTRT S Start to execute specified module.
Module

3-106
MDSTOP
MDSTOP S Stop to execute specified module.

  Macro instruction

MCALL
MCALL ෎Ѣ㽕ᠻ㸠ⱘᅣ Executes the sub-routine macro specified.
Macro

MSTRT
MSTRT ෎Ѣ㽕ᠻ㸠ⱘᅣ Execute specified self-hold type macro. 3-122

MEND
MEND Stops execution of the self-hold type macro.

A-22 - KV-5000/3000 Series User’s Manual-


5 Prohibited Instruction List
To describe the command that cannot be used in initialization module, macro, subroutine, and interrupt routine.

● Initialization module, fixed period module, interrupt routine


Instruction type Desciption
Common @XXXX instruction Differential execution style
LDP/LDF Load pulse/load pulse fall

APPENDICES
ANP/ANF AND pluse/AND pulse fall
ORP/ORF OR pulse/OR pulse fall
Contact Instructions
LDPB/LDFB Load pulse/load pulse fall
ANPB/ANFB AND bar pulse/AND bar pulse fall
ORPB/ORFB OR bar pulse/OR bar pulse fall
DIFU/DIFD Differential UP / Differential DOWN
Basic Instructions

ONDL/OFDL Connect delay/cut off delay


Output instructions SHOT One shot

Prohibited Instruction List


FLIK Flicker
ALT Alternate
TMR/TMH/TMS Timer/high-spd timer / high-spd 1ms timer
C Counter
Timer/counter OUTC Out counter
instructions ITVL Interval timer
UDC UP/DOWN counter
UDT UP/DOWN timer
Connection/end
MEP/MEF Mep/Mef
Instruction
Applied Instructions

Shift Instruction SFT Shift


STG/JMP/ENDS Control block/jump/end control block
Control block
W-ON/W-OFF Wait ON/wait OFF
processing instructions
W-UE/W-DE Wait UP edge/wait DOWN edge
File register instructions FRSTM/FRLDM File register saves in batches/file register reads in batches
Data processing instructions HKEY Hex key entry
Extended Instructions

Cam switch instructions ABSENC/INCENC Absolute/incremental encoder


Frequency counter instructions FCNT/RCNT Frequency/rotation speed measurement
PID instructions PID PID
MWRIT/MREAD/ Read/write memory card/get mem card space/create
Memory card instructions MFREE/MMKDIR mem card drct
MRMDIR/MDEL delete memory card file/folder
Access window instructions AWNUM/AWMSG User message 1/2

● Macro

Instruction type Desciption


Applied
Macro instruction MCALL/MSTRT Call macro/start macro
Instructions

* To describe MEND (macro end) command in self-hold type macro.It cannot be used in module or subroutine type macro.

● Subroutine

Instruction type Desciption


Applied Control block
STG/JMP/ENDS Control block/jump/end control block
Instructions processing instructions
Extended High-speed processing
INT/RETI Interrupt/interrupt return
Instructions instructions
- KV-5000/3000 Series User’s Manual- A-23
6 Mnemonics Abbreviation
Mnemonics abbreviation for KV STUDIO instructions or devices.

● Instruction

Instruction Abbreviation
LD,AND A,X
APPENDICES

LDB,ANB B,LDI,LDNOT,ANI,ANDNOT,/ *3
Contact Instructions ORB ORI,ORNOT
LDP,ANP P
LDF,ANF F
BLD,BAND BA
Bit contact instructions
BLDB,BANB BB
LD=,AND= =
LD<,AND< <
Mnemonics Abbreviation

LD>,AND> >
Compare instruction
LD<=,AND<= <=
LD>=,AND>= >=
LD<>,AND<> <>
OUT O,Y
OUB OB
SET S
Output instructions
RES R,RST
DIFU U,PLS
DIFD D,PLF
BOUT BO
BOUB BOB
Bit output instructions
BSET BS
BRES BR
TMR T,TIM,OUTT
TMH TH,TIMH,OUTH
Timer/counter
*1
TMS TS,OUTS
instructions
C CNT
UDC CNTR
END E,FEND
Connection/end Instruction
ENDH H
W-ON WON
W-OFF WOFF
Stage instruction
W-UE WU, WUE
W-DE WD,WDE
MC IL
Flow instructions
MCR ILC
UREAD FROM
Buffer memory instructions
UWRIT TO
INC ++
Arithmetic/comparison
DEC --
instructions
ROOT SQRT
Logic operation EORA XOR,XORA
instructions ENRA XNORA

A-24 - KV-5000/3000 Series User’s Manual-


6 Mnemonics Abbreviation

Instruction Abbreviation
DASC DSTR
RDASC DVAL
Text processing HASC HSTR
instructions RHASC HVAL
FASC FSTR
RFASC FVAL

APPENDICES
CAL+ +
CAL- -*2
CAL* *
CAL/ / *3
Simple operation CAL& &,WAND
instructions CAL | | ,WOR
CAL~ ~, WXOR

Mnemonics Abbreviation
CAL^ ^,NOT,CML
CAL>> >>,SFR
CAL<< <<,SFL
High-speed processing INT I
instructions RETI IRET

*1 Timer/counter command may realize input of command and device No. Without blank.
(For example) TMR 0002 DM00001 -> 2 D1
*2 When input "-" in " ladder edit " window directly, input transverse connecting wire.
After entering "-" in the "Direct Entry" dialog box, ( Esc )you can enter "CAL-instruction".
*3 After entering "/" in the "Ladder Edit" window, you can enter "LDB instruction".
After entering "-" in the "Direct Entry" dialog box, ( Esc )you can enter "CAL/instruction".

● Device name

Device name Abbreviation


R None (only PDF format)
MR M
LR L
DM D
EM E
FM F

● Device No. and constant


Device No. and constant

- KV-5000/3000 Series User’s Manual- A-25


7 List of Shortcut Keys
Shortcut key list of control functions.

Effective Shortcut Key for Unit Editor

● File ● Window
APPENDICES

Import + Unit Configuration area +


Close + Select unit +
Unit setting +
● Edit
Changing Settings +
Cut +
Message area +
Copy +
Paste + ● Help
List of Shortcut Keys

Delete How to use Unit Editor


Unit comment + + ● Unit configuration area operation
Block comment + +
Move cursor _ _ _
System comments + +
Move cursor to head of the
Unit preset +
rung
Batch input relay No. + Move cursor to tail of the
rung
● Convert
Delete configured unit
Jumping to Error Line
+ _ _
Auto-assign Relay/DM Number selection
_
Verify device
● Unit selection window operation
● Set up slave
Move cursor _ _ _
Setup slave + Add selected unit
Import slave info +
● Unit setup window operation
KL Unit information copy + +
Paste KL unit information + + Move cursor _

KL address setting +
+ _ _
Display unit move
_
● Display Input
Unit setting display Input/confirm
UNIT MONITOR + + Cancel
Customize monitor + +
● Information area operation
Buffer memory monitor + +
Move cursor _

Unit editor "Slave Settings Screen (slave station set up frame) " effective shortcut key

● File Copy +

Import slave info + Paste +

Close + Delete
Input unit/slave comments + +
● Edit
Unit/slave reservation +
Cut +

A-26 - KV-5000/3000 Series User’s Manual-


7 List of Shortcut Keys

● Convert ● Local configuration area operation


Jumping to Error Line Move cursor _
Auto Address The Unit Setup window of the
Assignment selected unit is displayed.
Address check Delete configured unit

● Display ● Unit Selection window operation

APPENDICES
Unit and slave setting Move cursor _ _ _
content Add selected unit

● Window ● Unit setup window operation


Slave Configuration
+ Move cursor _
Area
Input

List of Shortcut Keys


Unit Selection window +
Input/confirm
Unit Setup window +
Cancel
Address setup window +
Message area + ● Address setup window operation

● Help Move cursor _

How to use Unit Editor

KV STUDIO Valid Shortcut Keys

For projects with ◆ , distribution of shortcut mode key may be changed.

Effective shortcut key for initial frame

● File ● Monitor and simulator


New a project + PLC unit monitor +
Open a project + Read from PLC +

● Display
Workspace +
Output window +

Effective shortcut key for edit mode

● File ● Edit
New a project + Undo +
Open a project + Redo +
Save project Cut +
+
Save Copy +
Print +
Paste +
Paste-selected + +
Find +
Operand replacement +
Create cross reference

- KV-5000/3000 Series User’s Manual- A-27


7 List of Shortcut Keys

Cross refence Vertical wiring + /


+ Connecti
Rung comments list input/delete +
Previous cross reference◆ + ng line
transversal wiring + /
◆ edit
Next cross reference input/delete +
Start + Display crossing reference
End + point of part at cursor position
APPENDICES

Previous block + Delete the command on left


Next block + side of cursor position
Jump Delete cursor position instruction
Previous symbol +
Use instruction at cursor position
Next symbol
Direct input
rung start
Move cursor position
rung end
symbol rightwards
List of Shortcut Keys

Change previous block + +


Jump Input NO contact ◆
Change next block + +
Input NC contact ◆ +
+ /
Insert blank rung Normal open contact OR input ◆
+
NC contact OR input ◆ +
Rung comments +
Normal open contact OR input ◆
Insert folder Ladder Diagram + + normal open contact coil input ◆ +
◆ +
SET
Delete rung +
RES ◆ +
Rung ineffectivity - set up +
TMR ◆ +
Rung ineffectivity - cancel +
TMS ◆ +
Empty rung + + C◆ +

DIFU ◆ +
bookmark Setting + +
DIFD ◆ +
+ +
Release MOV ◆ +
◆ +
LDA
+
Select rung ( + )*1 STA ◆ +

( + )*2 LDP ◆ +

Arrange ladder + + LDF ◆ + +


Edit list +
Change operand ORP ◆ + +
Change device comments +
Input longitudinal ORF ◆ + +
connecting line ◆
Input transversal MEP ◆ + +
( )
connecting line ◆
transversal
Connectin + MEF + +
connecting line of
g line edit ( + )
run end
INV + +
Delete longitudinal
+
connecting line ◆ Modify a-b contact;
Delete transversal modify suffix; enter
+
connecting line ◆ Contact b
*1 Effected only the cursor at the left end (1th column). Direct input/current value change◆
*2 Effected only the cursor at the left end (10 th column).

A-28 - KV-5000/3000 Series User’s Manual-


7 List of Shortcut Keys

+ + ● Script
Next cell ◆ *
+ Insert area script +
+ + Insert frame script +
Previous cell ◆ *
+ Convert selected script +
Increase device number + + Hide/show ladder +
Decrease device number + +
Script function list +

APPENDICES
* Effected only when the Ladder Edit window is split.
+ +
Script tip
● Display
Workspace +
● Convert
Output window +
Convert ◆ +
Instruction/macro + +
module/macro single
selection panel ◆ ( )* +
conversion ◆

List of Shortcut Keys


Comment edit window +
● Monitor and simulator
Device use list +
+ +
Display zoom in + Monitor mode ◆

Display zoom out + PLCTransfer->Monitor


+
Mode◆
+
Label display PLCRead->Monitor mode +

PLC read ◆ +
Display comments ◆ +
Online edit
Display unit device +
Start ◆
Edit window switching + Simulator +

* Effected only no instruction is entered in the selected ● Tool


CELL.
Unit Editor +

● Help
Instruction help
Instruction Reference Manual +

Monitor mode shortcut key

● Edit Previous cross reference +


Search + / Next cross reference
Start + Rung list +
End + Select rung +
Previous Contact ON/OFF switch
+
block
Next block +
Previous
Jump +
symbol
Next symbol
rung start
rung end
Change previous block + +
Change next block + +
Create cross reference

- KV-5000/3000 Series User’s Manual- A-29


7 List of Shortcut Keys

● Display Monitor stop +


Workspace + Start
Online edit
Output window + Setting
Display zoom in + Simulator +
Display zoom out + Hide/show Monitor
+
Label display + window
APPENDICES

Display comments ◆ + ● Debug


Display unit device + Scan once
Modify value Execute single step
Edit window switch +
● Help
● Monitor and simulator Instruction help
Return to Editor ◆ + Instruction Reference
List of Shortcut Keys

+
Start Monitor Manual

Simulation mode short-cut key

● Edit Modify value


Search + ( )
● Monitor and simulator
Select rung +
Start + Return to Editor ◆ +

End + + +
Monitor mode ◆
Previous
+ Start online edit
block
Next block +
Previous
Jump + ● Debug
symbol
Only 1 scan
Next symbol
Execute continuous steps +
rung start
Execute single step
rung end
Execute reverse
Change previous block + + +
consecutive steps
Change next block + +
Execute reverse single step
Create cross reference
Pause
Previous cross reference +
Next cross reference ● Help
Rung list + Instruction help
Contact ON/OFF switch Instruction Reference
+
Manual
● Display
Workspace +
Output window +
Ladder display zoom in +
Ladder display zoom out +
Label display +
Display comments ◆ +
Display unit device +
A-30 - KV-5000/3000 Series User’s Manual-
7 List of Shortcut Keys

Online Edit short-cut key

● Edit Delete longitudinal


+
Undo + connecting line◆
Delete transversal
Redo + +
connecting line◆

APPENDICES
Cut + Connecti
Input/delete
Copy + ng line + /
longitudinal
Paste + edit +
connecting line
Paste-selected + + Input/delete
+ /
Find + transversal
+
Operand replacement + connecting line
Start + + +
Insert folder Ladder Diagram

List of Shortcut Keys


End +
Previous block + Verify Ladder diagram + +

Jump Next block + Edit list +

Previous symbol + Change operand

Next symbol Change device comments +

rung start Delete the instructions on


the left side of cursor
rung end
Delete cursor position instruction
Jump Change previous block + +
Input instruction at
Change next block + +
cursor position directly
Create cross reference
Input NO contact ◆
◆ +
Previous cross reference
Input NC contact ◆ +
Next cross reference ◆
Normal open contact OR input ◆
Rung list +
NC contact OR input ◆ +
+ /
Insert blank rung Normal open contact OR input ◆
+
normal open contact coil input ◆ +
Delete rung +
◆ +
SET
Insert rung comments +
RES ◆ +
Rung ineffectivity - set
up
+ TMR ◆ +
◆ +
Rung ineffectivity - TMS
+
cancel C◆ +

LDP ◆ +
Insert + +
◆ +
DIFU
bookmar
Setting + + DIFD ◆ +
k
+ +
Release LDF ◆ + +

Select rung +
ORP ◆ + +
transversal connecting
line input◆
Connecti transversal connecting ORF ◆ + +
( )
ng line line input◆
MOV ◆ +
edit transversal connection line
+ LDA ◆ +
to rung end
( + ) ◆ +
transversal connecting line STA

- KV-5000/3000 Series User’s Manual- A-31


7 List of Shortcut Keys

* Effected only no instruction is entered in the selected


CELL.
MEP ◆ + +
● Before Using
MEF + +
Insert area script +
INV + +
Insert frame script +
Modify a-b contact;
Convert selected script +
modify suffix; enter
APPENDICES

Contact b.
Direct input/current ● Monitor and simulator
value change Return to Editor ◆ +

● Display + +
Monitor mode ◆
Workspace +
Start Monitor*
Output window +
List of Shortcut Keys

Stop Monitor* +
Instruction/macro + +
Transference
selection panel ◆ ( )*
Online edit Cancel +
Comment edit window +
Setting
Device use list +
Simulator +
Display zoom in +
*The short-cut keys cannot be used in Online Edit.
Display zoom out +
Label display + ● Help
◆ +
Display comments
Instruction help
Display unit device +
Instruction Reference Manual +

GPPQ/GPPA Mode Shortcut Keys List

Assignment can be changed for individual short-cut keys.

Input NO contact TMR Not required


TMS Not required
GPPQ mode
N.C. contact input C Not required
GPPA mode +
LDP +
Normal open GPPQ mode +
LDF +
contact OR input GPPA mode
ORP +
N.C. contact input +
ORF +
Coil input
DIFU Not required
normal open
Not required DIFD Not required
contact coil input
MOV Not required
Input of GPPQ mode +
LDA Not required
longitudinal
GPPA mode STA Not required
connecting line
Delete longitudinal MEP +
+
connecting line Convert + +
Input transversal module/macro
connecting line single conversion
Delete transversal Direct input/
+ Not required
connecting line Current value change
SET Not required
Previous cross reference Not required
RES Not required
A-32 - KV-5000/3000 Series User’s Manual-
7 List of Shortcut Keys

Move to next
Not required Next cell + + +
cross reference
PLC transfer-> Monitor mode
Monitor mode Display comments +
Read PLC Not required Instruction/macro
+ +
Start online edit + input panel

APPENDICES
Returning to Editor

Next cell + + +

CXList of Mode Shortcut Keys

List of Shortcut Keys


Assignment can be changed for individual short-cut keys.

Input NO contact Direct input/

Input NC contact Not required Current value

N.O. contact OR input change


Previous cross
NC contact OR input
reference
Coil input
Move to next
N.C. contact coil input
cross reference
longitudinal PLC transfer->
connecting line input Monitor mode
Delete
Read PLC +
longitudinal +
Start online edit
connecting line Returning to
Input transversal
Editor
connecting line
Delete transversal Next cell + + +
+
connecting line
SET + Next cell + + +
RES +
Monitor mode + +
TMR + +
Display
TMS Not required +
comments
C Not required
Instruction/
LDP Not required
LDF Not required macro input + +

ORP Not required panel


ORF Not required
DIFU Not required
DIFD Not required
MOV Not required
LDA Not required
STA Not required
MEP + +
Convert
module/macro
+
single conversion
- KV-5000/3000 Series User’s Manual- A-33
7 List of Shortcut Keys

How to use / (slash) key

● / Press the "/" button to change cursor position


The following changes can be made.
·N.O. contact, N.C. contact
APPENDICES

/ (slash)

·SET,RSET

/ (slash)
List of Shortcut Keys

·Up, down

/ (slash)

·Suffix

/ (slash) / (slash)

/ (slash) / (slash)

/ (slash)

● If this button is pressed when no insturction is entered in CELL, Contact b will be entered.

/ (slash)

*Entry can be made only in the Direct Entry dialog box.

A-34 - KV-5000/3000 Series User’s Manual-


7 List of Shortcut Keys

MEMO

APPENDICES
List of Shortcut Keys

- KV-5000/3000 Series User’s Manual- A-35


8 Unusable Character String List
Describe character unusable in project name, module name, macro name, mark, device comment.

● Characters that cannot be not used in object name, module/macro name


! " # $ % & ‘ ( ) * , . / : ; < = > ? 
Unusable character string
@ [ \ ] ^ ’ { | } ~  (space)
Character that cannot be used at the
APPENDICES

+ - 0 1 2 3 4 5 6 7 8 9 _
beginning
Character or character string that
_ _0 _1 _2 _3 _4 _5 _6 _7 _8 _9
cannot be used at the end
Illegal text strings Global(case insensitve)

● Character that cannot be used in label


Unusable Character String List

! " # $ % & ‘ ( ) * + , - . / : ; < = > ? @ [ \
Unavailable characters
] ^ _ ’ { | } ~  (space)
Character that cannot be used at the
0 1 2 3 4 5 6 7 8 9
beginning
Global
(the same name as command)
Illegal text strings (Device name)
· alphabet character + R or M+ number
· Letter 1 character + number

● Unusable characters that cannot be not used device comments


Unavailable characters ,

A-36 - KV-5000/3000 Series User’s Manual-


9 Index
This index of terms used in this manual is assigned by alphabet.

Number C

16-bit BIN data •••••••••••••••••••••••••••••••••••••••3-86 C •••••••••••••••••••••••••••••••••••••••••••••••• 3-64, 3-72


16-bit internal register ••••••••••••••••••••••••••••••3-84 Cabling the Unit •••••••••••••••••••••••••••••••••••••••1-7
32-bit BIN data •••••••••••••••••••••••••••••••••••••••3-86 Callable position •••••••••••••••••••••••••••••••••••3-127

APPENDICES
32-bit internal register ••••••••••••••••••••••••••••••3-84 Candidate command ••••••••••••••••••••••••••••••3-153
Can't read •••••••••••••••••••••••••••••••••••••••••••• 3-14
Change device value window •••••••••••••••••••3-183
A Change the current value or status of device 3-183
Character code ••••••••••••••••••••••••••••••••••••• 3-92
Character that cannot be used in mark ••••••••• A-36
About contact protection •••••••••••••••••••••••••••• 1-8 Checking the Content of the Package ••••••••••••1-2
About the Connector •••••••••••••••••••••••••••••••1-10 CHGSPX Instruction •••••••••••••••••••••••••••••2-196
About the memory card ••••••••••••••••••••••••••••2-42 CHGSPY Instruction •••••••••••••••••••••••••••••2-196
ABSENC Instruction •••••••••••••••••••••••••••••• 2-144 CM ••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-73

Index
AC power unit ••••••••••••••••••••••••••••••••••••••••1-35 condition control ••••••••••••••••••••••••••••••••••••••3-4
Outline Dimensions •••••••••••••••••••••••••••••1-37 Configure as per process ••••••••••••••••••••••••3-104
Name and function of each part •••••••••••••••1-35 Connection line edit •••••••••••••••••••••••••••••••3-156
Specification •••••••••••••••••••••••••••••••••••••••1-36 Connector assembly and wiring •••••••••••••••••••1-9
How to Wire the power unit ••••••••••••••••••••1-37 Connector wiring •••••••••••••••••••••••••••••••••••• 1-11
Access window setup ••••••••••••••••••••••••••••••2-34 Constant ••••••••••••••••••••••••••••••••••••••• 3-56, 3-82
Contrast ••••••••••••••••••••••••••••••••••••••••••••2-34 Contrast •••••••••••••••••••••••••••••••••••••••••••••• 2-34
Display language •••••••••••••••••••••••••••••••••2-35 Control memory •••••••••••••••••••••••••••••• 1-17, 3-73
Access window setup ••••••••••••••••••••••••••••••2-34 Control relay•••••••••••••••••••••••••••••••••••••••••• 3-66
Contrast ••••••••••••••••••••••••••••••••••••••••••••2-34 Convert result ••••••••••••••••••••••••••••••••••••••• 3-11
Display language •••••••••••••••••••••••••••••••••2-35 Counter operation •••••••••••••••••••••••••••••••••• 3-65
Access window ••••••••••••••••••••••••••••••••••••••• 2-2 Counter •••••••••••••••••••••••••••••••••1-17, 3-64, 3-72
Access window •••••••••••••••••••••••••••••••••••• 2-2 CPU Monitor ••••••••••••••••••••••••••••••••••••••••• 2-22
Name of each part of the access window •••• 2-6 CPU positioning parameter comparator 2 interrupt 3-35
Function list ••••••••••••••••••••••••••••••••••••••••• 2-3 CPU unit •••••••••••••••••••••••••••••••••••••••••••••• 1-20
Access window ••••••••••••••••••••••••••••••••••••••• 2-2 5V output •••••••••••••••••••••••••••••••••••••••••• 1-27
Access window •••••••••••••••••••••••••••••••••••• 2-2 Derate •••••••••••••••••••••••••••••••••••••••••••••• 1-26
Name of each part of the access window •••• 2-6 Outline Dimensions(CPU) ••••••••••••••••••• 1-34
Function list ••••••••••••••••••••••••••••••••••••••••• 2-3 Outline Dimensions (Start unit, End unit) ••• 1-34
Action during power off ••••••••••••••••••••••••••••1-18 Name and function of each part •••••••••••••• 1-21
Action when calling between MC to MCR Output specification ••••••••••••••••••••••••••••• 1-27
commands ••••••••••••••••••••••••••••••••••••••• 3-128 I/O Wiring Diagram •••••••••••••••••••••••••••••• 1-32
Action when execution condition is OFF ••••• 3-128 Input specification ••••••••••••••••••••••••••••••• 1-24
All Clear •••••••••••••••••••••••••••••••••••••••••••••••2-37 CR ••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-66
Argument ••••••••••••••••••••••••••••••••••••••••••• 3-117 Create Entities •••••••••••••••••••••••••••••••••••••3-126
ASCII code •••••••••••••••••••••••••••••••••••••••••••3-92 CTC Instruction ••••••••••••••••••••••••••••••••••• 2-114
ASCII code •••••••••••••••••••••••••••••••••••••••••••3-92 CTC •••••••••••••••••••••••••••••••••••••••••••• 3-66, 3-72
CTH Instruction ••••••••••••••••••••••••••••••••••• 2-114
CTH ••••••••••••••••••••••••••••••••••••••••••••••••••• 3-72
B

B ••••••••••••••••••••••••••••••••••••••••••••••••••••••••3-59
D
Basic System Configuration •••••••••••••••••••1-2, 1-4
Batch monitor •••••••••••••••••••••••••••••••••••••• 3-184 Data Memory ••••••••••••••••••••••••••••••••• 1-17, 3-67
BCD ••••••••••••••••••••••••••••••••••••••••••••••••••••3-88 DEC ••••••••••••••••••••••••••••••••••••••••••••••••••• 3-87
BIN •••••••••••••••••••••••••••••••••••••••••••••••••••••3-87 DEC(Decimal) ••••••••••••••••••••••••••••••••••••••• 3-87
BIN •••••••••••••••••••••••••••••••••••••••••••••••••••••3-87 Decimal constant ••••••••••••••••••••••••••••••••••• 3-82
Binary Coded Decimal •••••••••••••••••••••••••••••3-88 Default setting of difference execution type command ••3-128
Binary data ••••••••••••••••••••••••••••••••••••••••••3-86 Device interrupt ••••••••••••••••••••••••••••••••••••3-188
Bit connects a scanning cycle only when macro Device mode ••••••••••••••••••••••••••••••••••••••••••2-9
execution starts ••••••••••••••••••••••••••••••••• 3-119 Names and Functions of Setting/Operation Keys •• 2-9
Bit device ON/OFF •••••••••••••••••••••••••••••••• 3-183 Changing device values
Bit device processing of word device •••••••••••3-81 (T, C, CTH/CTC, TRM) ••••••••••••••••••••••••• 2-15
Bit only cuts off a scanning cycle when module Changing device values (when device values are
execution starts ••••••••••••••••••••••••••••••••• 3-105 ON/OFF display) •••••••••••••••••••••••••••••• 2-13
Bit only cuts off a scanning cycle when module Changing device values
execution starts ••••••••••••••••••••••••••••••••• 3-105 (when device values are numerical values) •• 2-14
Bit period a scanning cycle only when macro Device name/comment display ••••••••••••••• 2-12
execution starts•••••••••••••••••••••••••••••••••• 3-119 Method of Operation in the Device Mode ••• 2-10
Bit unit processing of bit device ••••••••••••••••••3-80 Moving to the Device mode •••••••••••••••••••• 2-10
bytes ••••••••••••••••••••••••••••••••••••••••••••••••••• 3-11 Devices That Can be Displayed and Whose
- KV-5000/3000 Series User’s Manual - A-37
9 Index

Settings Can be Changed •••••••••••••••••••• 2-9 Specification •••••••••••••••••••••••••••••••••••••• 1-56


Changing the device type to monitor •••••••••2-10 Every-scan execution module •••••••••••••••••••• 3-96
Changing the monitor value display format ••••••• 2-11 Example for use together with pointer modification 3-78
Device No.list ••••••••••••••••••••••••••••••••••••••••• A-7 Execution in progress ON bit ••••••••••3-105, 3-120
Device notes ••••••••••••••••••••••••••••••••••••••• 3-164 Execution in progress ON bit •••••••••• 3-119, 3-120
Device sheet for high-speed counter •••••••••• 2-119 Execution module in progress ON bit •••••••••3-105
DI Instruction ••••••••••••••••••••••••••••••••••••••••3-47 Expansion data memory •••••••••••••••••••••••••• 3-67
DIC Instruction ••••••••••••••••••••••••••••••••••••••3-48 Expansion input unit ••••••••••••••••••••••••••••••• 1-38
Difference between macro and subprogram • 3-126 Derate •••••••••••••••••••••••••••••••••••••••••••••• 1-39
APPENDICES

Digital Trimmer Mode ••••••••••••••••••••••••••••••2-17 Outline Dimensions ••••••••••••••••••••••••••••• 1-44


Changing Digital Trimmers operate ••••••••••2-17 Name and function of each part •••••••••••••• 1-38
Names and Functions of Setting/Operation Keys 2-17 Wiring and internal circuit diagram •••••••••• 1-40
Direct clock pulse output ••••••••••••••••••••••••• 2-123 Specification ••••••••••••••••••••••••••••••••••••• 1-39
Direct output •••••••••••••••••••••••••••••••••••••••••3-29 Expansion output unit •••••••••••••••••••••••••••••• 1-45
Display and setting of time •••••••••••••••2-20, 2-214 Outline Dimensions ••••••••••••••••••••••••••••• 1-51
Time adjustment ••••••••••••••••••••••••••••••••••2-22 Name and function of each part •••••••••••••• 1-45
Time setting •••••••••••••••••••••••••••••••••••••••2-20 Wiring and internal circuit diagram ••••••••••• 1-47
About time display •••••••••••••••••••••••••••••••2-21 Specification •••••••••••••••••••••••••••••••••••••• 1-46
Names and Functions of Setting/Operation Keys 2-20 Derate •••••••••••••••••••••••••••••••••••••••••••••• 1-46
Index

Operation method ••••••••••••••••••••••••••••••••2-20 Expansion unit •••••••••••••••••••••••••••••••••••••• 1-52


Display instruction list •••••••••••••••••••••••••••• 3-153 Outline Dimensions ••••••••••••••••••••••••••••• 1-55
Display language ••••••••••••••••••••••••••••••••••••2-35 Name and function of each part •••••••••••••• 1-52
Display simple description of command operand •••• 3-153 Specification •••••••••••••••••••••••••••••••••••••• 1-53
Distance from surroundings •••••••••••••••••••••••1-15 External input interrupt setting ••••••••••••••••••• 3-34
DM •••••••••••••••••••••••••••••••••••••••••••••••••••••3-67 External input interrupt •••••••••••••••••••••••••••• 3-34

E F

Edit list ••••••••••••••••••••••••••••••••••••••••••••••••• 3-8 FCNT Instruction ••••••••••••••••••••••••••••••••••2-134


Effective shortcut key for edit mode •••••••••••• A-27 Feedback control •••••••••••••••••••••••••••••••••••••3-2
Script •••••••••••••••••••••••••••••••••••••••••••••• A-29 Fixed string •••••••••••••••••••••••••••••••••••••••••• 3-84
Tool •••••••••••••••••••••••••••••••••••••••••••••••• A-29 Float constant ••••••••••••••••••••••••••••••••••••••• 3-83
Display •••••••••••••••••••••••••••••••••••••••••••• A-29 FLOAT •••••••••••••••••••••••••••••••••••••••••••••••• 3-88
File ••••••••••••••••••••••••••••••••••••••••••••••••• A-27 Floating real number •••••••••••••••••••••••••••••• 3-88
Help •••••••••••••••••••••••••••••••••••••••••••••••• A-29 FM ••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-68
Convert •••••••••••••••••••••••••••••••••••••••••••• A-29 FRLDM Instruction ••••••••••••••••••••••••••••••••3-145
Edit ••••••••••••••••••••••••••••••••••••••••••••••••• A-27 FRSET Instruction ••••••••••••••••••••••••••••••••3-141
Monitor/simulator •••••••••••••••••••••••••••••••• A-29 FRSTM Instruction ••••••••••••••••••••••••••••••••3-143
Effective shortcut key for initial frame •••••••••• A-27
Display •••••••••••••••••••••••••••••••••••••••••••• A-27
File ••••••••••••••••••••••••••••••••••••••••••••••••• A-27 G
Monitor/simulator •••••••••••••••••••••••••••••••• A-27
Effective shortcut key for monitor mode ••••••• A-29
Debug ••••••••••••••••••••••••••••••••••••••••••••• A-30 Global device represents •••••••••••••••••••••••••3-131
Display •••••••••••••••••••••••••••••••••••••••••••• A-30 Global device •••••••••••••••••••••••••••••••••••••••3-131
Help •••••••••••••••••••••••••••••••••••••••••••••••• A-30
Edit ••••••••••••••••••••••••••••••••••••••••••••••••• A-29
Monitor/simulator •••••••••••••••••••••••••••••••• A-30 H
Effective shortcut key for unit editor •••••••••••• A-26
Window •••••••••••••••••••••••••••••••••••••••••••• A-26
Set up slave •••••••••••••••••••••••••••••••••••••• A-26 Hex constant •••••••••••••••••••••••••••••••••••••••• 3-83
Display •••••••••••••••••••••••••••••••••••••••••••• A-26 HEX ••••••••••••••••••••••••••••••••••••••••••••••••••• 3-87
File ••••••••••••••••••••••••••••••••••••••••••••••••• A-26 High-speed counter ••••••••••••••••••••••••• 2-87, 3-72
Help •••••••••••••••••••••••••••••••••••••••••••••••• A-26 Capture the current value based on input ••••••• 2-113
Convert •••••••••••••••••••••••••••••••••••••••••••• A-26 Counter enable function •••••••••••••••••••••••2-109
Edit ••••••••••••••••••••••••••••••••••••••••••••••••• A-26 Read the change direction of current value 2-112
Information area operation •••••••••••••••••••• A-26   Read/change of current value and change of
Unit setup window operation •••••••••••••••••• A-26 setting value •••••••••••••••••••••••••••••••••• 2-115
Unit selection window operation •••••••••••••• A-26 High-speed counter specification ••••••••••••• 2-87
Unit configuration area operation •••••••••••• A-26 Comparator matching output ••••••••••••••••• 2-111
EI Instruction ••••••••••••••••••••••••••••••••••••••••3-47 Preset function ••••••••••••••••••••••••••••••••••2-108
Elimination zero •••••••••••••••••••••••••••••••••••••3-57 Reset mode ••••••••••••••••••••••••••••••••••••••2-105
EM •••••••••••••••••••••••••••••••••••••••••••••••••••••3-67 Hi-speed counter comparator
Error Message List ••••••••••••••••••••••••••••••••••• A-2 ••••••••••••••••••••••••••••••••••••••••1-17, 3-66, 3-72
Error output unit •••••••••••••••••••••••••••••••••••••1-56 HOMEX Instruction •••••••••••••••••••••••••••••••2-194
About error output ••••••••••••••••••••••••••••••••1-56 HOMEY Instruction •••••••••••••••••••••••••••••••2-194
Outline Dimensions •••••••••••••••••••••••••••••1-57 HSP Instruction •••••••••••••••••••••••••••••••••••• 3-46
Name and function of each part •••••••••••••••1-56
Wiring and internal circuit diagram ••••••••••••1-57
A-38 - KV-5000/3000 Series User’s Manual -
9 Index

LOGE Instruction •••••••••••••••••••••••••••••••••• 2-64


I Logging functiion •••••••••••••••••••••••••••••••••••• 2-52
LR ••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-61
Identification number ••••••••••••••••••••••••••••• 3-120
If process count/current value of timer ••••••••••3-66 M
If process setpoint/current value of timer •••••••3-64
INCENC Instruction •••••••••••••••••••••••••••••• 2-148
Index constant •••••••••••••••••••••••••••••••••••••••3-75 Macro •••••••••••••••••••••••••••••••••••••••••••••••• A-23

APPENDICES
Index register ••••••••••••••••••••••••• 1-17, 3-73, 3-74 Macro argument device •••••••••••••••••••••••••• 3-117
Indirect specification •••••••••••••••••••••••3-75, 3-177 Macro Management •••••••••••••••••••••••••••••••3-109
Infinitely ••••••••••••••••••••••••••••••••••••••••••••••3-91 Macro system device ••••••••••••••••••••••••••••• 3-119
Initialize module ••••••••••••••••••••••••••••• 3-96, A-23 Macro type •••••••••••••••••••••••••••••••••••••••••• 3-112
Input mnemonics •••••••••••••••••••••••••••••••••• 3-153 Main routine ••••••••••••••••••••••••••••••••••••••••• 3-27
Input relay ••••••••••••••••••••••••••••••••••••••••••••1-17 Maintenance ••••••••••••••••••••••••••••••••••••••••• 1-58
Input relay ••••••••••••••••••••••••••••••••••••••••••••3-57 Max. count speed of counter ••••••••••••••••••••• 3-65
Installation direction ••••••••••••••••••••••••••••••••1-14 Max. count speed ••••••••••••••••••••••••••••••••••• 3-65
Installation position •••••••••••••••••••••••••••••••••1-14 Max. number of connected units ••••••••••••••••••1-4
Installing environment ••••••••••••••••••••••••••••••1-38 Maximal I/O point ••••••••••••••••••••••••••••••••••• 1-17

Index
Instruction ••••••••••••••••••••••••••••••••••••••••••• A-24 MCALL Instruction ••••••••••••••••••••••••••••••••3-122
INT Instruction ••••••••••••••••••••••••••••••••••••••3-50 MCMP Instruction •••••••••••••••••••••••••••••••••2-140
Internal auxiliary relay •••••••••••••••••••••• 1-17, 3-59 MDSTOP Instruction •••••••••••••••••••••••••••••3-106
Internal register •••••••••••••••••••••••••••••• 3-56, 3-84 MDSTRT Instruction ••••••••••••••••••••••••••••••3-106
Internal work consumption ••••••••••••••••••••••••3-12 Memory card instructions ••••••••••••••••••••••••• 2-51
Interrupt function •••••••••••••••••••••••••••••••••• 3-187 Memory card operation •••••••••••••••••••••••••••• 2-28
Interrupt programs ••••••••••••••••••••••••••••••••••3-28 MEND Instruction •••••••••••••••••••••••••••••••••3-122
Interrupt •••••••••••••••••••••••••••••••••••••••••••••••3-31 Mnemonics list ••••••••••••••••••••••••••••••• 3-8, 3-190
External input interrupt setting •••••••••••••••••3-34 Mnemonics •••••••••••••••••••••••••••••••••••••••••••••3-8
External input interrupt ••••••••••••••••••••••••••3-34 modular system device •••••••••••••••••••••••••••3-105
High-speed counter comparer based interrupt •••3-35 Module configuration example ••••••••••••••••••3-103
Unusable command in interrupt program ••••3-37 Module execution sequence •••••••••••••••••••••3-102
Input capture ••••••••••••••••••••••••••••••••••••••3-35 Module type •••••••••••••••••••••••••••••••••••••••••• 3-96
Item attribute •••••••••••••••••••••••••••••••••••••••••3-13 Monitor CPU built-in function •••••••••••••••••••3-186
Item label •••••••••••••••••••••••••••••••••••••••••••••3-13 Monitor expansion unit •••••••••••••••••••••••••••3-187
Mounting onto the DIN Rail •••••••••••••••••••••••••1-6
MR ••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-61
J MSTRT Instruction ••••••••••••••••••••••••••••••••3-122

JOGX Instruction ••••••••••••••••••••••••••••••••• 2-188 N


JOGY Instruction ••••••••••••••••••••••••••••••••• 2-188

Nesting ••••••••••••••••••••••••••••••••••••••••••••••• 3-28


K
O
Key lock •••••••••••••••••••••••••••••••••••••••••••••••2-41
KV-5000/3000 System universal specification 1-16
General specification ••••••••••••••••••••••••••••1-16 Online edit short-cut key •••••••••••••••••••••••••• A-31
Performance specifications ••••••••••••••••••••1-17 Script ••••••••••••••••••••••••••••••••••••••••••••••• A-32
KV-DR1 •••••••••••••••••••••••••••••••••••••••••••••••1-56 Display ••••••••••••••••••••••••••••••••••••••••••••• A-32
KV-U7 •••••••••••••••••••••••••••••••••••••••••••••••••1-35 Help •••••••••••••••••••••••••••••••••••••••••••••••• A-32
Edit ••••••••••••••••••••••••••••••••••••••••••••••••• A-31
Monitor/simulator •••••••••••••••••••••••••••••••• A-32
L Online edit ••••••••••••••••••••••••••••••••••••••••••3-181
Operation macro procedure ••••••••••••••••••••• 3-111
Option ••••••••••••••••••••••••••••••••••••••••••••••••• 2-59
Latch relay •••••••••••••••••••••••••••••••••••• 3-61, 1-17 ORGX Instruction •••••••••••••••••••••••••••••••••2-190
Line comments •••••••••••••••••••••••••••••••••••• 3-166 ORGY Instruction •••••••••••••••••••••••••••••••••2-190
Link register ••••••••••••••••••••••••••••••••••••••••••3-70 Output Relay ••••••••••••••••••••••••••••••••• 1-17, 3-57
Link relay •••••••••••••••••••••••••••••••••••••••••••••3-59
List of shortcut keys ••••••••••••••••••••••••••••••• A-26
How to use this shortcut keys ••••••••••••••••••• -34
List of CX mode shortcut keys •••••••••••••••• A-33 P
List of GPPQ/GPPA mode shortcut keys ••• A-32
KV STUDIO valid shortcut keys •••••••••••••• A-27 Password ••••••••••••••••••••••••••••••••••••••••••••• 3-14
Effective shortcut key for unit editor •••••••••• A-26 PLSOUT Instruction ••••••••••••••••••••••••••••••2-154
Loading a Memory Card •••••••••••••••••••••••••••2-45 PLSX Instruction ••••••••••••••••••••••••••••••••••2-186
LOGD Instruction •••••••••••••••••••••••••••••••••••2-64 PLSY Instruction ••••••••••••••••••••••••••••••••••2-186
- KV-5000/3000 Series User’s Manual - A-39
9 Index

Pointer modification ••••••••••••••••••••••••3-73, 3-177 TCHX Instruction ••••••••••••••••••••••••••••••••••2-192


Pop restore •••••••••••••••••••••••••••••••••••••••••••3-29 TCHY Instruction ••••••••••••••••••••••••••••••••••2-192
Precautions on connecting unit •••••••••••••••••••• 1-4 Temporary data memory ••••••••••••••••••• 1-17, 3-71
Precautions on grounding •••••••••••••••••••••••••• 1-7 Tile window •••••••••••••••••••••••••••••••••••••••••3-160
Precautions on I/O unit cabling •••••••••••••••••••• 1-7 Time limit control ••••••••••••••••••••••••••••••••••••••3-4
Precautions When Using a Memory Card ••••••2-46 Timer action program way •••••••••••••••••••••••• 3-62
Precautions when using timer instructions •••••3-63 Timer error ••••••••••••••••••••••••••••••••••••••••••• 3-63
Procedure •••••••••••••••••••••••••••••••••••••••••• 3-111 Timer ••••••••••••••••••••••••••••••••••••1-17, 3-62, 3-72
Program capacity ••••••••••••••••••••••••••••••••••• 3-11 TM ••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-71
APPENDICES

Push protect ••••••••••••••••••••••••••••••••••••••••••3-29 To Enable Use of Memory Cards •••••••••••••••• 2-43


Total steps ••••••••••••••••••••••••••••••••••••••••••• 3-12
TRGD Instruction •••••••••••••••••••••••••••••••••• 2-66
R
U
R •••••••••••••••••••••••••••••••••••••••••••••••• 3-57, 3-59
RCNT Instruction ••••••••••••••••••••••••••••••••• 2-136
Register monitor ••••••••••••••••••••••••••••••••••• 3-184 Unit assembly •••••••••••••••••••••••••••••••••••••••••1-5
Relationship between value representations ••3-89 Unit connection •••••••••••••••••••••••••••••••••••••••1-4
Index

Removing the Memory Card ••••••••••••••••••••••2-45 Unit device list ••••••••••••••••••••••••••••••••••••••• 3-68
Removing the terminal block ••••••••••••••••••••••1-13 Unit editor "Slave Settings Screen (slave station set
Replace battery ••••••••••••••••••••••••••••••••••••••1-58 up frame) " effective shortcut key ••••••••••••• A-26
Steps for replacing battery •••••••••••••••••••••1-59 Unit Monitor ••••••••••••••••••••••••••••••••••••••••••••2-6
When battery power is lower •••••••••••••••••••1-58 Functions of Setting/Operation Keys •••••••••••2-6
During battery off •••••••••••••••••••••••••••••••••1-58 Method of Operation (example: on I/O Unit) •••••••2-7
Reserved area ••••••••••••••••••••••••••••••••••••• 3-133 Unusable character string list •••••••••••••••••••• A-36
RETI Instruction ••••••••••••••••••••••••••••••••••••3-50 Unusable character string list •••••••••••••••••••• A-36
RFSCTH Instruction ••••••••••••••••••••••••••••• 2-118 Unusable instruction list ••••••••••••••••••••••••••• A-23
RFSPSX Instruction ••••••••••••••••••••••••••••• 2-198 Use PC ••••••••••••••••••••••••••••••••••••••••••••••• 2-44
RFSPSY Instruction ••••••••••••••••••••••••••••• 2-198 Use situation ••••••••••••••••••••••••••••••••••••••••3-129
Row interrupt ••••••••••••••••••••••••••••••••••••••• 3-189 User Messages ••••••••••••••••••••••••••••••••••••• 2-38
RUN-PROG Switch •••••••••••••••••••••••••••••••••1-28 How to Display User Messages ••••••••••••••• 2-38
Display example ••••••••••••••••••••••••••••••••• 2-38
User Messages 1 •••••••••••••••••••••••••••••••• 2-38
S User Messages 2 •••••••••••••••••••••••••••••••• 2-39
Address setup window operation ••••••••••••• A-27
Window •••••••••••••••••••••••••••••••••••••••••••• A-27
Search method of line notes •••••••••••••••••••• 3-167 Local configuration area operation ••••••••••• A-27
Self-hold macro •••••••••••••••••••••••••••••••••••• 3-113 Display ••••••••••••••••••••••••••••••••••••••••••••• A-27
Sequence control •••••••••••••••••••••••••••••••••••• 3-4 File •••••••••••••••••••••••••••••••••••••••••••••••••• A-26
Service ••••••••••••••••••••••••••••••••••••••••••••••••1-58 Help •••••••••••••••••••••••••••••••••••••••••••••••• A-27
Set display modes •••••••••••••••••••••••••••••••• 3-185 Convert •••••••••••••••••••••••••••••••••••••••••••• A-27
Setting Inhibited Operation ••••••••••••••••••••••••2-39 Edit ••••••••••••••••••••••••••••••••••••••••••••••••• A-26
Setting Inhibited Operation ••••••••••••••••••••••••2-39 Unit setup window operation •••••••••••••••••• A-27
Shift JIS code ••••••••••••••••••••••••••••••••••••••••3-92 Unit Selection window operation •••••••••••••• A-27
Shorted input list of mnemonic symbolt •••••••• A-24
Shorted input •••••••••••••••••••••••••••••••••••••••• A-24
Sign •••••••••••••••••••••••••••••••••••••••••••••••••••3-87 V
Simple indirect specify •••••••••••••••••••••••••••••3-78
simulator mode
Effective shortcut key ••••••••••••••••••••••••••• A-30 Value exceeding maximum value, minimum value
Debug ••••••••••••••••••••••••••••••••••••••••••••• A-30 changes ••••••••••••••••••••••••••••••••••••••••••• 3-91
Display •••••••••••••••••••••••••••••••••••••••••••• A-30 Value expression ••••••••••••••••••••••••••••••••••• 3-87
Help •••••••••••••••••••••••••••••••••••••••••••••••• A-30
Edit ••••••••••••••••••••••••••••••••••••••••••••••••• A-30
Monitor/simulator •••••••••••••••••••••••••••••••• A-30 W
Special-purpose crimping tool ••••••••••••••••••••• 1-9
Split •••••••••••••••••••••••••••••••••••••••••••••••••• 3-160
SRAM Clear ••••••••••••••••••••••••••••••••••••••••••2-36 W •••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-70
Wiring to terminal block unit ••••••••••••••••••••••••1-8
Standby module •••••••••••••••••••••••••••••••••••••3-97
Word Devices ••••••••••••••••••••••••••••••••••••••• 3-67
Subroutine macro ••••••••••••••••••••••••••••••••• 3-112
Subroutine ••••••••••••••••••••••••••• 3-27, 3-126, A-23
Suffix •••••••••••••••••••••••••••••••••••••••••••••••••••3-93
System Configuration ••••••••••••••••••••••••••••••• 1-2
Z

Z ••••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-73
T ZF •••••••••••••••••••••••••••••••••••••••••••••••••••••• 3-68

T •••••••••••••••••••••••••••••••••••••••••••••••• 3-62, 3-72


A-40 - KV-5000/3000 Series User’s Manual -
9 Index

MEMO

APPENDICES
Index

- KV-5000/3000 Series User’s Manual - A-41


Revision History
Revision History Version Details of Revision

Dec 2007 Initial version

- KV-5000/3000 Series User’s Manual -


WARRANTIES AND DISCLAIMERS:
(1) KEYENCE warrants the Products to be free of defects in materials and workmanship for a period of
one (1) year from the date of shipment. If any models or samples were shown to Buyer, such
models or samples were used merely to illustrate the general type and quality of the Products and
not to represent that the Products would necessarily conform to said models or samples. Any
Products found to be defective must be shipped to KEYENCE with all shipping costs paid by Buyer
or offered to KEYENCE for inspection and examination. Upon examination by KEYENCE,
KEYENCE, at its sole option, will refund the purchase price of, or repair or replace at no charge any
Products found to be defective. This warranty does not apply to any defects resulting from any
action of Buyer, including but not limited to improper installation, improper interfacing, improper
repair, unauthorized modification, misapplication and mishandling, such as exposure to excessive
current, heat, coldness, moisture, vibration or outdoors air. Components which wear are not
warranted.
(2) KEYENCE is pleased to offer suggestions on the use of its various Products. They are only
suggestions, and it is Buyer's responsibility to ascertain the fitness of the Products for Buyer's
intended use. KEYENCE will not be responsible for any damages that may result from the use of
the Products.
(3) The Products and any samples ("Products/Samples") supplied to Buyer are not to be used
internally in humans, for human transportation, as safety devices or failsafe systems, unless their
written specifications state otherwise. Should any Products/Samples be used in such a manner or
misused in any way, KEYENCE assumes no responsibility, and additionally Buyer will indemnify
KEYENCE and hold KEYENCE harmless from any liability or damage whatsoever arising out of any
misuse of the Products/Samples.
(4) OTHER THAN AS STATED HEREIN, THE PRODUCTS/SAMPLES ARE PROVIDED WITH NO
OTHER WARRANTIES WHATSOEVER. ALL EXPRESS, IMPLIED, AND STATUTORY
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT OF
PROPRIETARY RIGHTS, ARE EXPRESSLY DISCLAIMED. IN NO EVENT SHALL KEYENCE
AND ITS AFFILIATED ENTITIES BE LIABLE TO ANY PERSON OR ENTITY FOR ANY DIRECT,
INDIRECT, INCIDENTAL, PUNITIVE, SPECIAL OR CONSEQUENTIAL DAMAGES (INCLUDING,
WITHOUT LIMITATION, ANY DAMAGES RESULTING FROM LOSS OF USE, BUSINESS
INTERRUPTION, LOSS OF INFORMATION, LOSS OR INACCURACY OF DATA, LOSS OF
PROFITS, LOSS OF SAVINGS, THE COST OF PROCUREMENT OF SUBSTITUTED GOODS,
SERVICES OR TECHNOLOGIES, OR FOR ANY MATTER ARISING OUT OF OR IN
CONNECTION WITH THE USE OR INABILITY TO USE THE PRODUCTS, EVEN IF KEYENCE
OR ONE OF ITS AFFILIATED ENTITIES WAS ADVISED OF A POSSIBLE THIRD PARTY'S
CLAIM FOR DAMAGES OR ANY OTHER CLAIM AGAINST BUYER. In some jurisdictions, some
of the foregoing warranty disclaimers or damage limitations may not apply.

BUYER'S TRANSFER OBLIGATIONS:


If the Products/Samples purchased by Buyer are to be resold or delivered to a third party, Buyer must
provide such third party with a copy of this document, all specifications, manuals, catalogs, leaflets and
written information provided to Buyer pertaining to the Products/Samples
31-642-1270 31-642-1271

© KEYENCE CORPORATION, 0127-1 084157 E Printed in Japan

You might also like