KV8000 FFFF
KV8000 FFFF
KV8000 FFFF
Chapter
OVERVIEW
1
Chapter SPECIFICATIONS
2 AND WIRING
Chapter UNIT INSTALLATION
Programmable Controller 3 AND MAINTENANCE
Chapter LADDER
4 PROGRAMMING
Read this manual before using the product. • List of PLC Unit Errors
• Lists of CR and CM Devices
Keep this manual in a safe place for later reference. • Index
• CPU units
• Power supply units
• Expansion I/O units
• Bus connection units
Supported CPU Units
Frequently Asked Questions
• KV-8000
• KV-8000A
www.keyence.com/controlfaq
Preface
This manual describes how to connect to and maintain the KV-8000 Series and also describes the CPU
built-in functions and how to create ladder programs. It also includes the specifications and usage
methods of CPU units and expansion I/O units. For expansion special units other than those listed
above, see the user's manual of the corresponding unit.
When you are writing programs, read the "Instruction Reference Manual," “ST Language Programming
Manual,” "Script Programming Manual," and "KV STUDIO User's Manual" together with this manual.
Store this manual in a safe place so that you can retrieve it whenever necessary.
Provide this manual to the end-users of the device.
KV-8000 Series Manuals
All the following PDF manuals can be found and opened in the help file of KV STUDIO. In addition, the
latest versions of the PDF manuals can be downloaded from the KEYENCE website.
Name Description
This manual. This manual, which describes the system
KV-8000 Series CPU Unit User's Manual configuration and specifications of the KV-8000 Series. It also
describes how to create ladder programs.
KV-8000/7000/5000/3000/1000 Series and KV This manual describes the instructions that are available in
Nano Series Instruction Reference Manual ladder programming.
KV-8000 Series This document describes how to create an ST language program and
ST Language Programming Manual the Operators, Control Statements, and Functions that can be used.
KV-8000/7000/5000/3000/1000 Series and KV This manual describes how to create script programs and the
Nano Series Script Programming Manual available operators, control sentences, and functions.
KV STUDIO User's Manual This manual describes how to operate KV STUDIO.
D42GB
- KV-8000 Series User’s Manual - 1
Safety Precautions
Symbols
This document contains notices that you should observe to ensure your own personal safety, as well as to protect
the device and connected equipment. These notices are marked according to the level of danger as shown below.
Important Indicates cautions and limitations that must be followed during operation.
General Precautions
• Do not use the device with the purpose of protecting human beings.
• This device is not intended for use as an explosion-proof product. Do not use
this device in a hazardous location or in a location that has a potentially
explosive atmosphere.
DANGER • Do not use this product in an application that may cause death, serious injury
or serious property damage due to a failure with this product should occur,
such as nuclear power plants, on aircraft, trains, ships, or vehicles, used within
medical equipment, playground equipment, roller coasters and other rides, etc.
• Output circuit and internal circuit malfunctions sometimes prevent control from
being performed normally. Be sure to provide a safety circuit in control
systems where circuit malfunctions may lead to fire or other serious accidents.
• Provide a safety circuit that bypasses the PLC to enable failsafe operation of
WARNING the entire system in the event that the PLC fails.
• You must perform a sufficient risk assessment for the machine where this
product is to be installed prior to installing this product. Provide appropriate
protective fail-safe measures on the machine independent from this product in
case a failure with this product should occur.
• Before you use this device, verify its functionality and performance at startup
and during operation.
CAUTION • If the equipment is used in a manner not specified by the manufacturer, the
protection provided by the equipment may be impaired.
• Proceed with care when modifying the device, or when using it in a manner that
falls outside of the ranges indicated in its specifications, since KEYENCE is
unable to guarantee device functionality or performance in such situations.
NOTICE • Use this device in combination with other devices only after careful
consideration, since the device may fail to satisfy its functionality and
performance capabilities as a result of factors such as its usage conditions and
the environment in which it is used.
UL Certificate
This product complies with the following UL and CSA standards and has been certified by UL.
Be sure to consider the following specifications when using this product as a product specified by UL.
• Be sure to install it in a conductive enclosure (an industrial control panel) with IP54 or higher.
• Use stranded copper wire (twisted wire) with a wire gauge of AWG #12 to #22 and temperature
rating of 105ºC or higher when wiring to the terminal block on the KV-PU1. The tightening torque is
1.4 N·m. (12.4 lb.-In)
• Use stranded copper wire (twisted wire) with a wire gauge of AWG #16 to #22 and temperature
rating of 105ºC or higher when wiring to the DC power input terminal block on the CPU unit. The
tightening torque is 0.5 N·m.
• When using KV-PU1, please do not supply 24V of electricity from the DC power terminal platform
of the CPU unit.
• Use this product under pollution degree 2.
• Overvoltage category I (II when using KV-PU1)
• Use this product at the altitude of 2000 m or less.
• Indoor use only.
• Please confirm that circuit connected to input output terminal (connector, etc.) of this product
corresponds to SELV.
• Use this product with one of the following power supplies.
• UL/CSA certified power supply that provides Class 2 output as defined in the NFPA70(NEC:
National Electrical Code) and CEC (Canadian Electrical Code).
• UL/CSA certified power supply that has been evaluated as a Limited Power Source as defined in
UL60950-1 and CAN/CSA-C22.2 No.60950-1.
Ͳ 匏͑匶匶͙͑ 櫋怺殯͑愯暧皻柦匶沖沲͚
決͑匶匶垚͑櫋怺殯 ͙Ͳ 匏 ͚͑洊沖砒洇穯匶匶嵢昢͑砖廪沖͑嬖垚͑斲殯沖垚͑決͑洖汊
渂汞穞柢匶͑愚岂彶 ͑͝儆洛歾汞͑滆櫳櫖昢͑斲殯穞垚͑冉汊͑徯洇求嵢͑穯城埪 ͟
CE Marking
Keyence Corporation has confirmed that this product complies with the essential requirements of the
applicable EC Directives, based on the following specifications. Be sure to consider the following
specifications when using this product in the Member States of European Union.
● EMC Directive
• Applicable standard EN61131-2, Class A
• When installing the KV-5500/5000/3000 Series, it must be installed in an conductive enclosure
(industrial control panel) with IP54 or higher.
• Use a shielded cable for the signal lines located outside of the conductive enclosure (industrial
control panel). The shielded cable must be grounded.
• Be sure to use the functional earthing terminal on the unit for grounding, if applicable.
These specifications do not give any guarantee that the end-product with this product incorporated
complies with the essential requirements of EMC Directive. The manufacturer of the end-product is
solely responsible for the compliance on the end-product itself according to EMC Directive.
Notes on compatibility
<The control panel>
• If seams exist within the top or bottom plate of the control panel, strip the coating to maintain
electric potential.
• When grounding the control panel, use a thick grounding wire to create low impedance even at
high frequencies.
<Grounding shielded cables>
• Do not ground shielded cables near the expansion unit, otherwise, the grounded cables will receive
electromagnetic induction from cables that were present before grounding was implemented.
• After removing and exposing a section of the outer covering for the shielded cable, connect this
part to the control panel in a wide area. (When using clamp brackets or other such tools, be sure to
strip the paint from the contact)
• Do not ground electrical wires by soldering them to shielded wires, as this method will increase
high-frequency impedance and nullify the shield effect.
● Low-voltage Directive
The Low-voltage Directive is applied to KV-B8RC and KV-B16RC. It is not applicable to any other models.
• Applicable standard EN61131-2 (KV-B8RC/KV-B16RC)
• Overvoltage Category II
• Pollution degree 2
• When installing the KV-5500/5000/3000 Series, it must be installed in an enclosure (industrial
control panel) with IP54 or higher.
• The rated relay load of the KV-B16RC is 8A per common. In other words, when all eight channels
are used, the maximum load per channel is 1A, and when four channels are used, the maximum
load per channel is 2A.
• The KV-B8RC is an independent contact and the rated relay load is 2A per channel.
Be sure to consider the following specifications when using this product as an UL/C-UL Listed product.
This is a class A product. In a domestic environment this product may cause radio interference in which
case the user may be required to take adequate measures.
Ͳ 匏͑匶匶͙͑ 櫋怺殯͑愯暧皻柦匶沖沲͚
決͑匶匶垚͑櫋怺殯 ͙Ͳ 匏 ͚͑洊沖砒洇穯匶匶嵢昢͑砖廪沖͑嬖垚͑斲殯沖垚͑決͑洖汊
渂汞穞柢匶͑愚岂彶 ͑͝儆洛歾汞͑滆櫳櫖昢͑斲殯穞垚͑冉汊͑徯洇求嵢͑穯城埪 ͟
1
OVERVIEW of the KV-8000 Series, communication channels with PCs, and the
occupied areas of the units.
2
Chapter SPECIFICATIONS AND It describes specification and wiring of CPU unit, AC power unit,
3
2 WIRING expansion I/O unit, bus connection unit of the KV-8000 series.
4
Chapter UNIT INSTALLATION This chapter describes how to install the KV-8000 Series as well as 5
3 AND MAINTENANCE how to attach units, wiring precautions, and maintenance procedures.
6
This chapter describes the specifications and setup methods of the
Chapter LADDER functions that you have to use when creating ladder programs. You
Chapter EXPANSION I/O UNIT This section describes the functions provided by the KV-SIR32XT
Chapter 1 OVERVIEW
1-1 System Configuration............................................................................................. 1-2
System Configuration Overview ·········································································· 1-2
(1) Power Units································································································ 1-3
(2) CPU Units ·································································································· 1-3
(3) KV-8000/7000 Series Expansion Units ····························································· 1-3
(4) Bus Connection Units ··················································································· 1-4
(5) KV-5000/3000 Series Expansion Units ····························································· 1-4
(6) End Units ··································································································· 1-4
Connecting to Communication Devices································································· 1-5
1-2 Unit Reservation ..................................................................................................... 1-6
Chapter 2 SPECIFICATIONS
2-1 Series Common Specifications ............................................................................. 2-2
General Specifications ······················································································ 2-2
Performance Specifications ················································································ 2-3
Operation during Power Outages········································································· 2-4
2-2 CPU Unit .................................................................................................................. 2-5
Package Contents ···························································································· 2-5
Names and Functions of Parts ············································································ 2-6
RUN-PRG Selector Switch ················································································· 2-8
Wiring and Internal Circuit Diagram······································································ 2-8
Dimensions····································································································2-10
2-3 AC Power Unit ........................................................................................................2-11
Names and Functions of Parts ···········································································2-11
Specification ··································································································2-12
How to Wire ···································································································2-12
Dimensions····································································································2-13
2-4 Expansion I/O Unit of KV-8000/7000 series (KV-SIR32XT) ................................ 2-14
Names and Functions of Parts ···········································································2-14
Specifications ·································································································2-15
Wiring and Internal Circuit Diagrams ···································································2-16
Dimensions····································································································2-17
2-5 Expansion Input Unit ............................................................................................ 2-18
Name and Function of Each Part ········································································2-18
Specification ··································································································2-19
Wiring and Internal Circuit Diagram·····································································2-20
APPENDICES
1 List of PLC Unit Errors ················································································ A-2
2 Lists of CR and CM Devices ······································································· A-10
Control Relays (CR)························································································ A-10
Control Memory Entries CM ············································································· A-14
3 ASCII Code Table······················································································ A-18
ASCII Code Table ·························································································· A-18
4 List of Instructions···················································································· A-19
5 List of Unusable Instructions ····································································· A-21
6 List of Abbreviated Mnemonics ·································································· A-23
7 List of Shortcut Keys ················································································ A-25
Shortcut Keys That Are Valid in the Unit Editor ····················································· A-25
Shortcut Keys That Are Valid in KV STUDIO························································ A-27
List of GPPQ and GPPA Format Shortcut Keys ···················································· A-33
List of CX Format Shortcut Keys········································································ A-34
List of Logix Format Shortcut Keys····································································· A-35
How to Use the Key ························································································ A-37
8 List of Characters That Cannot Be Used ······················································ A-39
9 Precautions for Using the Existing KV Series Extension Unit ························· A-42
List of Compatible Equipment ··········································································· A-42
Usage Restrictions ························································································· A-43
10 Precautions When Changing From One KV-8000 Series Model to Another ······· A-45
Model Replacement Procedure ········································································· A-45
Differences Related to Functions Such as CPU Special Hardware Functions·············· A-46
Device Range Comparison Table ······································································ A-48
Instructions That Have Differences ···································································· A-49
Differences between Control Relays and Control Memory Entries ···························· A-49
Differences between variable and label······························································· A-50
11 Index······································································································· A-52
Mnemonic lists are included on the pages in which sample ladder programs are introduced.
You can use mnemonic lists to easily enter ladder programs.
3 In the ladder edit area of KV STUDIO, click the cell in which you want to insert a sample ladder
program, then, on the "Edit" menu, click "Edit list" to display the "List edit" dialog box.
Alternative procedure
• Ctrl + D
Terminology
Terminology Description
This refers to electronic equipment that you can use to freely control equipment by
Programmable controller
changing programs. They are also called PLC (Programmable Logic Controller).
KV-8000 Series
PLC KV-8000/8000A made by Keyence.
KV-8000
KV-7000 Series PLC KV-7500/7300 made by Keyence.
KV-5000/3000 Series PLC KV-5500/5000/3000 made by Keyence.
CPU unit This refers to the KV-8000/7500/7300 and KV-5500/5000/3000.
This refers to expansion I/O units and expansion special units, other than the CPU
Expansion unit
unit, that can be used with the KV-8000 Series.
This is a connection unit that is necessary when using expansion unit for《KV-
Bus connection unit 5000/3000 series》with《KV-8000》series. The end unit is necessary at the right
end when using the bus connection unit.
S-Unit It is an expansion unit which corresponds to CPU inner bus of the KV-8000 series.
It is a high-performance expansion unit compatible with the KV-8000 series CPU
X-Unit
inner bus.
It indicates high speed inner bus that corresponds to unit interruption from KV-8000
CPU inner bus
series CPU to the bus connection unit.
This refers to the unit that must be connected on the right of the other units when
End unit
using KV-5000/3000 Series expansion units.
KV STUDIO This refers to the software that supports the creation of KV-8000 Series programs.
Ladder program This refers to programs that are created with KV STUDIO.
① ② ③ ④ ⑤ ⑥
AC power unit CPU unit Expansion unit for the Bus connection unit Expansion unit for the End unit
KV-PU1 KV-8000(A) KV-8000/7000 Series KV-7000C KV-5000/3000 series
(24 VDC, 1.8 A) (I/O, special) (I/O, special)
KV-PU1 KV-SIR32XT
POWER
0 1 2 3 4 5 6 7
8 9 10 11 12 13 14 15
0 1 2 3 4 5 6 7
8 9 10 11 12 13 14 15
IN
OUT
OPEN
IN OUT
SD Memory Card
KV-M16G/M4G/M1G
Cable
(1m)
PC (OP-42142)
Cable
(2m)
(OP-42141)
The end unit is necessary at the right end only when using the bus connection
Point
unit, expansion unit of KV-5000/3000 series.
OVERVIEW
(1) Power Units
System Configuration
When the KV-8000 series runs at 100 - 240 V AC, the KV-PU1 AC power unit should be connected on
the leftmost side. Each CPU unit should only be connected with one KV-PU1.
Using 24 V DC
When the KV-8000 series runs at 24 V DC, the KV-PU1 power unit is not used. Power (24 V DC) is
supplied via the KV-8000 DC power input terminal block.
The AC power unit can be connected to the left side of CPU unit and expansion input/output unit and
expansion special unit, KV-7000C can be connected to the right side. The end unit must be connected
when expansion unit for KV-5000/3000 series is connected using the bus connection unit to the right
side.
The end unit is necessary even when the expansion unit for KV-5000/3000 series is not
Reference
connected when the bus connection is connected.
With the KV-8000 Series, you can improve programming efficiency by using functions such as modules,
function blocks, macros, local devices and KV scripts.
The expansion special unit for KV-8000/7000 series will always be connected to the right side of CPU
unit and left side of KV-7000C. (When the expansion unit of KV-5000/3000 series is not used, it is not
necessary to connect KV-7000C.)
You can connect up to 16 KV-8000/7000 Series expansion units per CPU unit.
When using expansion input/output unit and expansion special unit for KV-5000/3000 series by
connecting to KV-8000 series, be sure to always use it by attaching to right side of bus connection unit.
Be sure to connect an end unit on the right side of the right most expansion unit.
When two sets of expansion units are used, a total of 48 KV-8000/7000 Series expansion units can be
connected. (excluding some expansion units)
Please connect to bus connection unit, expansion input output unit for KV-5000/3000 series and to the
right side of expansion special unit. An error will occur when it is not connected and will not operate.
The end unit is not necessary when CPU unit and expansion unit for KV-8000/
Point
7000 series is connected.
OVERVIEW
Connecting to Communication Devices
This section describes the communication channels that are used to perform communications between
1
the CPU unit and a PC or touch panel.
System Configuration
When communicating with a PC
KV-8000(A)
USB port (USB communication)
Serial port*1
*1 A converter should be equipped separately on the serial communication unit and the PC side.
KV-8000(A)
Serial port*1
*1 A converter should be equipped separately on the serial communication unit and the PC side.
You can use the unit reservation function to use the same project to manage units even if the unit
configuration is different. For example, even if you have an installation in which an expansion analog
1 input unit is attached as an option, you can use the same project to operate the system. This makes
project management easy.
Unit Reservation
Project A
0 1 2 3
KV-SIR32XT KV-SIR32XT KV-SAD04
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
8 9 10 11 12 13 14 15 8 9 10 11 12 13 14 15
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
8 9 10 11 12 13 14 15 8 9 10 11 12 13 14 15
IN IN
OUT OUT
CH0
V0+
I0+
0-
Unit reserve KV-SAD04
COM
V1+
I1+
CH1
1-
COM
V2+
I2+
CH2
2-
COM
V3+
I3+
CH3
3-
COM
IN OUT IN OUT
Configuration A Configuration B
KV-SIR32XT KV-SIR32XT KV-SIR32XT KV-SIR32XT KV-SAD04
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
8 9 10 11 12 13 14 15 8 9 10 11 12 13 14 15 8 9 10 11 12 13 14 15 8 9 10 11 12 13 14 15
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
8 9 10 11 12 13 14 15 8 9 10 11 12 13 14 15 8 9 10 11 12 13 14 15 8 9 10 11 12 13 14 15
IN IN IN IN
V0+
I0+
CH0
0-
COM
V1+
I1+
CH1
1-
COM
V2+
I2+
CH2
2-
COM
V3+
I3+
CH3
3-
COM
IN OUT IN OUT IN OUT IN OUT
• When you make a reservation for a unit, if the unit is present in the actual
Point
configuration, a unit configuration error will not occur, and the system will
operate normally.
• Regarding units other than the ones that you are making reservations for, if the
information that you have used the Unit Editor to configure differs from the
information of the devices that are actually connected, a number of units error or a
unit classification error will occur, and you will not be able to operate the system.
• If you use the number of a unit that is not present in the actual configuration (a
reserved unit) as an operand in an instruction (Function block instruction, etc.),
an error will not occur during conversion, but an operation error (a minor error)
will occur during execution. You can use the following methods to avoid
calculation errors.
• Include the expansion unit presence relay in a logical AND with the execution
conditions.
• Configure the CPU system settings (the operation when an error occurs) so
that the CPU operation is set to continuation (to ignore errors).
• When expansion unit for KV-5000/3000 series is being used, there is an
expansion unit which requires power switch on /off in order to reflect the
modification of the unit number.
• You can use the expansion unit n presence relays (CR4001 onwards) to check
Reference
whether the expansion unit for each unit number is actually connected.
• You can add expansion units to the right of reserved units.
• If you make consecutive reservations for multiple instances of the same unit to
connect less units in the actual configuration than the total number of units that you
have specified, the connected units operate with unit numbers assigned from the left.
For example, if you make reservations for unit numbers 1, 2, and 3 as KV-SIR32XT,
but only use two KV-SIR32XT units, the connected units will be recognized as unit
numbers 1 and 2 when they operate (you cannot have a gap between unit numbers
such as assigning unit numbers 1 and 3).
This section provides the specifications of the KV-8000 Series and describes the operation of the
KV-8000 Series when the power is turned off.
General Specifications
2
Item Specification
Series Common Specifications
When using a system configuration that When using a system configuration that
System configuration includes KV-5000/3000 Series Expansion uses only KV-8000/7000 Series Expansion
Units Units
Power supply voltage 24 V DC (±10%) 24 V DC (-15% +20%)
Surrounding air
0 to +50°C (no freezing) 0 to +55°C (no freezing)
temperature*1
Relative humidity 10 to 95% (no condensation) 5 to 95% (no condensation)
Storage temperature -20 to +70°C -25 to +75°C
Storage humidity 10 to 95% (no condensation) 5 to 95% (no condensation)
Operating atmosphere As little dust and corrosive gases as possible
Operating altitude 2000 m or below
Pollution degree 2
Overvoltage category Ⅰ(Ⅱ when using KV-PU1)
1500Vp-p or above, pulse width 1μs, 50 ns (by noise simulator)
Noise immunity
Conforms to IEC standards (IEC61000-4-2/3/4/6)
1500 V AC for 1 minute, between power supply terminal and I/O terminals and between
Withstand voltage
all external terminals and case
50 MΩ or more (500 V DC megger used to perform measurements between power
Insulation resistance
terminal and input terminals, and between all external terminals and case)
Number of
Intermittent vibration
scans
Frequency Acceleration Amplitude
5 to 9 Hz - 3.5 mm
JIS B 3502
Vibration resistance*2 Conforms to 9 to 150 Hz 9.8 m/s2 - 10 times (100
IEC61131-2 minutes) in each
Continuous vibration
of the X, Y, and
Frequency Acceleration Amplitude Z directions
5 to 9 Hz - 1.75 mm
9 to 150 Hz 4.9 m/s2 -
Acceleration: 150 m/s2. Application time: 11 ms. Triple in each of the X, Y, and Z
Shock resistance
directions.
CPU unit : 400 mA or below
Consumption current
Bus connection unit : 30mA or below
CPU unit : Approx. 340 g
Weight Bus connection unit: Approx. 130 g
KV-B1 (Battery): Approx. 10 g
*1 Indicated on the lower, central part of the unit in the industrial control panel.
*2 When installing DIN rail.
SPECIFICATIONS
Performance Specifications
Item Specification
Calculation control method
I/O control method
Program storage method
Refresh method
2
Program language Expanded ladder, KV script, mnemonic, ST Language
2 • If the supply voltage decreases, the CPU unit stops, and the output is turned off.
Automatic recovery
• When the supply voltage recovers, operation is automatically restarted.
Series Common Specifications
SPECIFICATIONS
Package Contents
The package contains the following items. Before you use the product, make sure that the package
contains everything it is supposed to contain. 2
Products packaged with KV-8000(A)
CPU Unit
CPU unit
KV-8000(A)
Instruction
Manual
KV-8000/
8000A
Instruction
Manual
When using the extension unit for the KV-5000/3000 series, the bus connection unit KV-7000C should
be equipped separately.
The items packaged with KV-7000C are as follows.
Instruction
Manual
KV-7000C
Instruction
Manual
The utmost care has been exercised in packing the items, however, in the event that items malfunction
or are damaged, contact your KEYENCE office.
2 KV-8000(A)
When the covers are closed When the covers are open
ķAccess window
ŀMemory card
access LED
ĸSetup keys
ĹRUN-PRG
ĻUSB access LED selector switch
ĺUSB connector
ĽEtherNet/IP access LED
(Upper: LINK, Lower: NS)
ļRJ-45 (Ethernet) connector
SPECIFICATIONS
No. Name Function
Configure unit settings and monitor the unit.
The backlight is used to indicate operation status.
① Access window
RUN: White
PRG: Red 2
② Setup keys Used for access window operations.
CPU Unit
③ RUN-PRG selector switch Switch between RUN mode and PRG mode.
④ USB connector For connecting with USB.
The lamp lights when data is received from/sent to a
⑤ USB access LED
USB.
Connector used to connect the network cable (RJ-45
⑥ RJ-45 (Ethernet) connector
modular connector) (100BASE-TX).
LINK…Indicates the link status of the other party's
machine.
Green lamp on: link established
Green lamp flashes: sending/receiving data
Lamp off: link not established
EtherNet/IP access LED NS…Indicates data sending/receiving status
⑦ (Upper: LINK, Lower: NS) Green lamp on: connection established
Green lamp blinking: connection not established.
Red lamp on: IP address overlapping
Red lamp blinking: timeout has occurred on one or
more connection
Lamp off: IP address not set
⑧ Backup battery connector (with cover) Used for installing KV-B1.
⑨ Memory card slot Slot for inserting memory card.
⑩ LED indicating memory card access Lit while the memory card is being accessed.
Connector for connecting the power unit
⑪ Connector for connecting the KV-PU1 (power unit).
(unit side panel with cover)
Connector for connecting expansion units
⑫ Connector for connecting expansion units.
(unit side panel with cover)
It is a terminal block (M3 screw) for 24 V DC power input.
⑬ DC power input terminal block
(MAX3.2A)
Do not connect USB cables to RJ-45 (Ethernet) connectors. (Failure to heed this
NOTICE
caution may lead to damage.)
There are two modes for CPU unit: RUN mode and PRG mode.
2 Mode can be selected through the RUN-PRG Selector Switch shown on the
right.
CPU Unit
In case of serious error, even if the switch is in RUN position, it will be switched to
Point
PRG mode.
When the switch is in RUN position, you can switch between PRG mode and RUN
Reference
mode via KV STUDIO.
KV-8000(A)
Ethernet communication can be realized via external equipment such as RJ-45 connector and PC or
touch panel, etc. Besides, EtherNet/IP communication can be also realized.
"5-8 Ethernet/EtherNet/IP Communication", Page 5-110
RJ-45(EtherNet/IP)
1
connector
2
3
4
5
6
7
8
SPECIFICATIONS
Ethernet communication specifications
Item Specification
Baud rate 100 Mbps (100 BASE-TX)
Transmission medium STP or category 5 or better UTP *1
Maximum cable length 100 m 2
Maximum number of
2
CPU Unit
connected hub stages
MDI/MDI-X auto switching
available
function
LINK
(green)It displays link status with the other device.
Light on:Link established.*4
Light off:Link unsuccessful.
NS(green, red)*5 It displays the communication status of network.
Display Light off:IP address is not configured.
Green light on:More than 1 connection established.
Green light blinking:Not a single connection is established.
Red light on:IP address is overlapping.
Red light blinking:1 or more connection (tag configuration) has timed out, of
which KV-8000 is going to be the target *6.
KV-8000(A) conforms to the IEEE802.3 standard.
*1 STP refers to shielded twisted pair cable
UTP refers to unshielded twisted pair cable
*2 The maximum cable length is considered to be the distance between CPU unit and hub.
*3 When an Ethernet switch is used, there is no restriction on the number of cascading hubs.
*4 The established link is considered as the status in which power of communicating device is on, and is also
properly connected to the Ethernet with cable.
*5 The NS(green, red) lamp will turn on (during self test) in the order of NS green, NS red when power is
inserted.
*6 The side in which the connection will open is the originator, and the side in which it will be opened is the
target.
Dimensions
CPU Unit
2 1.4 115
Unit: mm
27.3
CPU Unit
92.5
35.9
90
3.9
56.3
16.7
16.7
4
14.9 14.9
16.9
5.6 95
27.3
92.5
35.9
90
4
22.6 95
End unit
Unit: mm
90
90
9
9 8
8 80
80
SPECIFICATIONS
This sections describes name, function and technical specification of each part of KV-PU1 AC power
unit.
AC Power Unit
KV-PU1 KV-PU1
POWER POWER
(1) POWER LED (3) Lock lever
• When over current (the POWER LED is OFF) occurs, please temporarily turn the
power off and eliminate the reason for the fault.
NOTICE • When overvoltage occurs, output stops (the POWER LED turns off).
Turn the power OFF for more than 3 minutes and then turn it back on again.
• When using KV-PU1, do not supply power from the power terminal of CPU unit.
Specification
Output capacity 1.8 A (total for power of all units and operation power)
Internal consumption current 0.96A or below
Dwell time 20ms or below (with rated input and output condition)
Start-up time Max. 3 s
Output mode Relay (B contact)
Rated load 24 V DC, 0.5 A
ON resistance 50 m or less
OFF ON 10 ms or less
Response time
ON OFF 5 ms or less
Electrical: 100,000 cycles or more (20 cycles/min)
Relay life
Mechanical: 20 million cycles or more
Relay replacement Not possible
Weight Approx. 300 g
How to Wire
100 -240 V AC
(+10%, -15%)
Such as insulated
transformer, noise filter
• To reduce line noise, please connect 1:1 insulated transformer and noise filter.
Point
• To reduce induction influence, please twist the cable.
• The KV-PU1 has a built-in fuse as a power cutoff device.
• The primary and secondary circuits are reinforced and insulated in the
equipment.
SPECIFICATIONS
Dimensions
2.5
8
1.2
27.3
41.3
AC Power Unit
35.9
92.5
26.3
75
4
12.5 53 46.6 95
(with the cover open)
This section describes the names and functions of the parts of the KV-SIR32XT Expansion I/O Units. It
also provides the specifications of the units.
KV-SIR32XT
0 1 2 3 4 5 6 7
(1) Direct access switch
8 9 10 11 12 13 14 15
0 1 2 3 4 5 6 7 (2) I/O indicator
8 9 10 11 12 13 14 15
*1 In the following instances, the LED will light in red even if a unit error has not occurred.
When a unit number error, unit type error or other error occurs at power on and CPU unit information is
configured for one CPU, the CPU unit may have caused a system error.
In this case, an error will be displayed in the access window.
* An optional 40-pin connector for connecting the KV-SIR32XT is available.
SPECIFICATIONS
Specifications
24 V Input
49℃ 51℃ 53℃
100
26.4 V Input
NOTICE 80
28.8 V Input
60 60%
50%
40 40%
20
0
0 10 20 30 40 50 55 60
Ambient temperature(℃)
4.4kΩ
Internal circuit
Photocoupler insulation
Input power
supply
Insulated circuit
Protection circuit
COM2
COM3
SPECIFICATIONS
Dimensions
KV-SIR32XT
2
8
95
1.2
27.3
35.9
90
13.4
4
95
36 112
(145)
This chapter describes name, function and technical specification of every part of KV-5000/3000 series
expansion input unit (KV-B16XC/C32XC/C64XC).
24V 24V
5V 5V
L H
(4) Input terminal block (1) Input voltage toggle switch (2) Input connector (5) Lock lever
SPECIFICATIONS
Specification
External connection
(16 point) (32 point) (64 point)
2
Removable terminal block Connector (MIL standard)*1 Connector (MIL standard)*1
mode
If the number of inputs in ON status exceeds the specified range, the unit may fail.
NOTICE
Relationship between continuous simultaneous ON rate and ambient temperature
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 (%)
120 120
20 ℃ 33 ℃ 25 ℃ 35 ℃
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 (℃)
2 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
24 / 5 VDC
* COM circuit-shorted internally
SPECIFICATIONS
KV-C32X Wiring diagram KV-C32XC internal circuit diagram
1 18
2 19
3 20
000̚015
100̚115 4.3kΩ
2
4 21
Internal circuit
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
24 / 5 VDC 24 / 5 VDC
Input continuous and simultaneous ON rate should not exceed the range of
NOTICE
technical specification. Otherwise, equipment damage may result.
2
2 19 2 19
3 20 3 20
4 21 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
* In KV-5000/3000 Series
15 32 15 32 expansion units, Pin No. is
16 33 16 33 arranged as 1, 2, 3 vertically.
17 34 17 34
24 VDC 24 VDC
IN
470Ω
COM0̚3
Photocoupler-isolation
Input supply
SPECIFICATIONS
Input continuous and simultaneous ON rate should not exceed the range of
NOTICE
technical specification. Otherwise, equipment damage may result.
Point
Please use OP- 42224 connector (34-pin) for 64-point unit.
Do not use OP-23139.
2
Dimensions
KV-B16XC
2 2.8
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]
SPECIFICATIONS
This section describes name, function and specification of each part of KV-5000/3000 series expansion
input unit (KV-B8RC/KV-B16RC/KV-B16TC(P)/KV-C32TC(P)/KV-C64TC(P)/KV-B16TD/KV-C32TD/
KV-C64TD).
(3) Output terminal block (1) Output connector (4) Lock lever
Specification
30 °C
100
20
0
0 10 20 30 50
Ambient temperature (°C)
SPECIFICATIONS
KV-B16TC KV-C32TC KV-C64TC
Type KV-B16TD KV-C32TD KV-C64TD
(16 point) (32 point) (64 point)
Output mode
Transistor (NPN) (C type)
MOSFET (N-ch) (with overcurrent protection function) (D type) 2
External connection
Removable terminal block Connector *1
0
C1
Expansion Output Unit
1
C2
2
C3
3
C4
4
C5
5
C6
6
C7
7
NC
NC
KV-B8RC
Terminal No. Signal name Signal name Terminal internal circuit diagram
No.
P C0 COM0
000 0 L
P C1 COM1 000~007
P C2 COM2
001 1 L
P : OUT
Internal circuit
002 2 L Load
P C3 COM3 L
003 3
P C4 COM4 L
004 4
P C5 COM5 L
005 5
P C6 COM6 L
COM
006 6
P C7 COM7 L
007 7
NC NC
NC NC
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
SPECIFICATIONS
KV-B16TC/B16TD internal circuit diagram
2
000 0 L
L 3 003
002 2 L
L 5 005 000 to015
004 4 L
L 7 007
Internal circuit
OUT
C0 COM0 Load
008 8 L
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. D type is MOSFET (N-ch) output Load power supply
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
COM1 C1 power
1 18
2 19
3 20
2 4 21
5 22
6 23
7 24
Expansion Output Unit
8 25
9 26
10 27
11 28
12 29
13 30
* In KV-5000/3000 Series expansion units, Pin No.
14 31
15 32 is arranged as 1, 2, 3 vertically.
16 33
17 34
KV-C32TC/C32TD 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
D type is MOSFET (N-ch) output Load power
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
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
SPECIFICATIONS
KV-C64TC/C64TD Wiring diagram KV-C64TC/C64TD 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
2
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
D type is MOSFET (N-ch) output
14 31 14 31
15 32 15 32
* In KV-5000/3000 Series expansion units, Pin No.
16 33 16 33
17 34 17 34 is arranged as 1, 2, 3 vertically.
L side H side
Connector pin No. Connector pin No.
1 18 1 18 Load power supply
2 2 19
3 20
2 19
3 20 Photocoupler-isolation
COM0
COM1
Internal circuit
Expansion Output Unit
4 21 4 21 COM2
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 * In KV-5000/3000 Series expansion units, Pin No.
16 33 16 33 is arranged as 1, 2, 3 vertically.
17 34 17 34
SPECIFICATIONS
Dimensions
KV-B8RC/B16RC/B16TC/B16TD/B16TCP
2.8
2
90 35.9
3.5 80
9 29 3 96.5) Unit: [mm]
KV-C32TC/C32TD/C32TCP
2.8
27.3
90 35.9
3.5 80
9 23 3 96.3
(125) Unit: [mm]
KV-C64TC/C64TD/C64TCP
2.8
27.3
90 35.9
3.5 80
9 29 3 96.3
(125) Unit: [mm]
Introduces name, function as well as technical specifications of KV-5000/3000 series expansion input
unit (KV-B8XTD/C16XTD/C32XTD).
24V 24V
5V 5V
L H
(4) Input terminal block (1)Input voltage toggle switch (2) Input connector (5) Lock lever
SPECIFICATIONS
Technical specifications
KV-C16XTD(16 + 16 KV-C32XTD(32 + 32
Type KV-B8XTD (8 + 8 point)
Internal consumption
Below 30mA Below 40mA Below 65mA
current
Weight About 130g About 110g About 130g
*1 According to MIL-C-83503
*2 KV-C32XTD has 2 point input COM and output COM, which are universal inside. Input COM and output
COM are independent.
*3 All terminals support two-wire system (however, do not support two-wire system proximity sensor EV Series)
*4 Input COM and output COM are independent.
"KV-B8XTD internal circuit diagram", page 2-36 "KV-C16XTD internal circuit diagram", page 2-37
"KV-C32XTD internal circuit diagram", page 2-38
45°C 50°C
100 100%
NOTICE 80 80%
60
26.4V input
40
24V input
20
0
0 10 20 30 40 50
Ambient temperature(°C)
Terminal No.
000~007 4.3kΩ
1
Internal circuit
0 IN
3
2 5V. 24V
5 Switch circuit
4 COM0
7
6 Optical coupler insulation
C0
8 Input power supply
9
10
11
12
13
14
15
C1
KV-B8XTD internal circuit diagram (output)
Insulation
Terminal No. Direction Signal name power supply
Signal name Direction Terminal No.
1 input 001
000 input 0
3 input 003
002 input 2
5 input 005
004 input 4 100~107
7 input 007
006 input 6
C0 input COM0
100 output 8 L
L 9 output 101
Internal circuit
COM1
Power supply for load
SPECIFICATIONS
KV-C16XTD wiring diagram KV-C16XTD internal circuit diagram (Input)
1 18
2
000~015 4.3kΩ
2 19
Internal circuit
IN
3 20
5V. 24V
4 21 Switch circuit
*COM is independent.
2 2 19
3 20
2 19
3 20
4 21 4 21
Extension I/O 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 * In KV-5000/3000 Series expansion units, Pin No.
16 33 16 33 is arranged as 1, 2, 3 vertically.
17 34 17 34
KV-C32XTD internal circuit diagram (Input) KV-C32XTD internal circuit diagram (output)
Insulation
000~015 power supply
100~115 5.6kΩ
Internal circuit
IN
470Ω
200~215
300~315
COM0~1
OUT
Internal circuit
COM3
Power supply for load
For 32 point I/O unit, please use OP-42224 connector (34 pin).
Point
OP-23139 cannot be used.
SPECIFICATIONS
Dimensions
KV-B8XTD
2.8
2
90 35.9
3.5 80
9 29 3 96.5) Unit: [mm]
KV-C16XTD
2.8
27.3
90 35.9
3.5 80
9 23 3 96.3
(125) Unit: [mm]
KV-C32XTD
2.8
27.3
90 35.9
3.5 80
9 29 3 96.3
(125) Unit: [mm]
It describes name and function of each portion of the bus connection unit (KV-7000C).
2 Front
Bus Connection Unit
When bus connection unit is used, the end unit must be attached to the right end
Point
of system.
SPECIFICATIONS
Dimensions
2
1.2
5.6 95
27.3
35.9
90
4
22.6 95
This section describes name, function and technical specification of each part of KV-EB1S/KV-EB1R expansion
unit.
(6) OP cable
24V 0V
(4) Power toggle switch (bottom)
SPECIFICATIONS
Specification
Expansion Unit
About Connection / Setting
Vertical
KV-EB1S
KV-EB1R
■ 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.
2
■ Use the power on previous section
Expansion Unit
When using the power from the previous section supplied via OP cable, set
POWER
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 KV-U7
KV-U7 KV-EB1R Connect KV-U7 to left side of KV-EB1R.
KV-U7
OC
OUTPUT
24VDC
1.8A
L
INPUT
100-240V
AC
50/60Hz
0.98A
N
When supplying power separately from KV-EB1R, please note the following
points.
• Turn ON power: please supply power from KV-EB1R side first.
NOTICE • Turn OFF power: Please disconnect power from CPU unit 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.)
• When using KV-EB1 for 3 section addition, and using other powers for each
Point equipment, please wrap 2 turns of ferrite core on power cable (Kitagawa
Industries: RFC-10). When using KV-U7, please adopt anti-noise measures such
as FG grounding, etc.
SPECIFICATIONS
Dimensions
KV-EB1S
2.8
2
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]
2
Expansion Unit
This section describes how to construct units and how to install units on DIN rails and similar objects.
3 KV-PU1
POWER KV-SIR32XT
0
8
0
8
1
9
1
9
2
10
2
10
3
11
3
11
4
12
4
12
5
13
5
13
6
14
6
14
7
15
7
15
IN
KV-SDA04 KV-SAD04
AX1/2
KV-MC20V
AX1
OUT
Connecting Units
AX2
V0+ V0+
I0+ I0+
CH0 CH0
COM 0-
NC COM
V1+ V1+
I1+ I1+
CH1 CH1
PULL COM 1-
TEACHING
NC COM UNIT
V2+ V2+
I2+ I2+
CH2 CH2
COM 2-
NC COM
V3+ V3+
I3+ I3+
CH3 CH3
COM 3-
NC COM
IN OUT
Power unit CPU unit Expansion unit Bus Expansion End unit
for KV-8000/7000 series connection unit for
unit KV-5000/3000
series
• The CPU unit uses backup capacitors to store clock data. If the unit is not
Point
powered for an extended time period, clock data may be lost. (If lost, CPU error
85 "Clock data lost" occurs.) You may install an optional battery (KV-B1) to
prevent the clock data from being lost.
• When the bus connection unit is used, the end unit is required at the right end.
The no end unit error occurs when there is no end unit.
• When the bus connection unit is not used, please attach expansion unit joining
connect cover to the unit at the right end during use.
KV-EB1S
KV-EB1R
Constructing Units
KV
-S
0
IR
32
XT
3
1
8
2
0 9 10 3
Connecting Units
8 1 11 4
9 2 12 5
10 3 6
13
11 4 14 7
12 5 15
13 6
14 7
15
IN
OU
T
KV-8000 KV-SIR32XT
(left side) OU
T (right side)
OU
T
OU
T
2
10 3
4
8 11
9 2 5
3 12
10 13 6
11 4 14 7
12 5 15
13 6
14 7
15
IN
OU
T
OU
T
OU
T
KV
-B
3
16
XC
KV-8000
Connecting Units
+
Bus connection unit KV-B16XC
(left side) (right side)
KV
-B
16
XC
KV
-B
16
XC
KV
When bus connection unit is used, an end unit unconnected error will occur if the
Point
end unit is not attached to the right end.
This section describes how to install connected units on and remove connected units from DIN rails.
Installing units
Connecting Units
unit.
Top clip
DIN rail
Removing units
This section describes precautions regarding the installation environment of the units and describes the
panel mounting position.
Installation Environment
• A location with an ambient humidity that is not within the range of 5 to 95%RH
• A location in which condensation forms because of sudden temperature changes
• A location with corrosive or combustible gas
• A location with heavy dust, salt, iron powder, or soot
• A location that is subject to direct vibration or shock
• A location that is subject to sprayed liquids such as water, oil, and drugs
• A location in which strong magnetic and electric fields occur
• A location at an altitude exceeding 2000 m
Installation Position
Device orientation
When you install the CPU unit in a panel, ensure that the front surface faces out.
K
V
-S
3
2
0
X
T
8
D
1
0
2
8
10
3
9
11
10
4
3
12
11
5
4
13
6
12
KV
14
7
13
-S
6
KV-S40AD
15
40
14
AD
7
15
IN
OUT
7
12 13 14 15
7
12 13 14 15
6
IN
6
5
KV
OUT
-S
32
5
XT
4
0 D
4
1
8
3
2
11
0 9
KV-S32XTD
3
3
10
11
1
2
8 4
10
11
9 2 5
2
12
10
1
10 3 6
13 KV
9
11 4 7 -S
1
14 40
0
12 5 15 AD
8
6
0
13
8
14 7
15
IN
OUT
OUT
3
30 mm Space above, on the left of and below the device
Allow 30 mm of space for heat dissipation.
30 mm
Unit Installation
Series units
30 mm
If the panel temperature (the temperature indicated on the lower, central part of
Point
the unit) exceeds the ambient usage temperature, reduce the temperature by
using methods such as forced air cooling and improving ventilation by increasing
the space around the device.
When using an expansion unit, make sure that the upper and lower units are
separated by 60 mm or more to minimize the effect of heat.
This section describes how to assemble connectors, the wiring and internal circuits of each unit, and
how to wire each unit.
Wiring precautions for I/O units and expansion I/O units are given below. Be sure to read these
Input
RL
Output
24 V DC D-type ground
Grounding precautions
• Ground each device separately using D-type grounding facilities. In addition, ensure that the
grounding resistance in this situation is 100 or less.
• If separate grounding is not possible, ground all the devices from a common point. However, in this
situation, all cables must be the same length.
• Use the FG terminals to ground the devices (do not ground the power supply terminals).
B
A B A
Contact protection
When you are using clutches, motors, solenoids, or other inductive loads, an inrush current will flow
when power is applied to the load, and inverting voltage will be generated when the load is turned off.
Inrush current and inverting voltage are major factors in reducing the life of the contact. To reduce the
occurrences of these phenomena, provide a contact protection circuit.
Contact protection circuit example
With an AC load (1) With a DC load (1)
3
Contact
Contact
Wiring Precautions
L L
a b
L L
Zener diode
Non-linear resistance
• Supply voltage 24 to 48 V To position b
100 to 200 V To position a
Attach the power supply so that it behaves in this manner.
• Use a load coil that has a rating that is less than or equal to the capacity of the contact.
• Use a diode that has a withstand voltage at least 10 times the circuit voltage and that has a forward
current that is greater than or equal to the load current.
• Attach the diode, non-linear resistance, and CR circuit directly to the relay coil terminal.
B
Wiring Precautions
d2
Compatible dimensions
B : 6 mm or less
L
Y terminal part dimensions
L : 13 mm or less
B : Y-shaped part outer size
d1 : Diameter of power line outlet d2 : 3.2 mm or more
d2 : Y-shaped part inner width
(part that the screw grips)
L : Total length d1
Recommended products
Manufacturer Model B d1 d2 L Compatible Wire (Stranded)
Nippon Tanshi Co., Ltd. VD1.25-3 5.5 1.7 3.3 11.5 0.25 to 1.65 mm2 (AWG 22 to 16)
DAIDO SOLDERLESS
6.0 1.7 3.7 12.8 0.25 to 1.65 mm2 (AWG 22 to 16)
TERMINAL MFG. CO., LTD. F1.25-C3.5
NICHIFU Co., Ltd. 0.3Y-3 5.2 1.0 3.2 12.0 0.3 to 0.5 mm2 (AWG 22 to 20)
JST Mfg. Co., Ltd. 0.5-3A 5.0 1.0 3.2 12.5 0.2 to 0.5 mm2 (AWG 26 to 22)
FUJI TERMINAL V1.25- 5.7 3.3 3.8 20 0.25 to 1.65 mm2 (AWG 22 to 16)
INDUSTRY CO., LTD. YASS3.5
Hold the screwdriver so that it is perpendicular with the terminal block screws when
Reference
wiring cables to the terminal block. Tightening the screws with the screwdriver held in
any orientation other than perpendicular with the terminal block screws may damage the
terminal block.
(2) When using rod terminals with insulating sleeves Insulating sleeve
Depending on the thickness of the wire's sheath, it may be difficult
Contact part
to insert the wire into the insulating sleeve. Therefore, use the
outline diagram as a reference when you select wires. 8mm
2 to 2.8mm
12.5 to 14mm
Recommended manufacturer Shape
AI0.25-8BU(AWG24)
AI0.34-8TQ(AWG22)
Phoenix Contact
AI0.5-8WH(AWG20)
AI0.75-8GY(AWG18)
When connecting equipment on each unit, please connect the wire from each equipment on the
connector (female) on the unit side.
Wiring Precautions
• The following matching cable must be used:
Wire gauge : AWG24 to 22 (twisted 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 cutting 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 and OP-51404, etc.)
Wire gauge : AWG28 to 26
Cross-section area: 0.08 to 0.14mm2
Sheath O.D.: Ø1.3 to Ø1.1
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
NOTICE
may be damaged if too large force is applied in crimp connection. Be sure to take
care.
Handle
Crimping plier
Body
3
Wiring Precautions
Shielded cover
Vertical cover Oblique cover
OP-23139(34-pin) OP-42224(34-pin)
OP-22184(40-pin) OP-51404(40-pin)
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34
Below
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40
Below
* When using KV-5000/3000 Series expansion units, Pin No. is arranged as 1, 2, 3 horizontally.
Connector wiring
The wiring method of using special crimping tool is introduced below. Contact, shield sleeve and wire
shall be prepared.
Wiring Precautions
Clamp part
Contact-break position
2 Insert contact into the contact stand of special crimping tool and contact directly (Fig. A).
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
Wire
Shielded cover
Shielded cover
Close it here
8 Fix the wire with band as shown.
Belt
Precautions When Using the USB Port to Communicate with a PC or Other Peripheral
0 V of the power supply of CPU units is electrically connected to the SGs of the USB port. An electric
potential difference between the port and SG at the destination could damage the CPU unit and
devices connected at the destination. For example, if you positively ground (perform grounding on the
24 V side) the products, a potential difference will occur, and current will flow along the path shown in
the following figure. This may cause damage to the products. Do not wire the products in the manner 3
shown in the following figure.
Wiring Precautions
External power CPU unit PC or other peripheral
supply
+24V +24V
FG
This section describes how to inspect and maintain the units as well as how to replace batteries and
relays.
Inspection
3 When the CPU unit and other units are used for a long time, problems such as the connecting section
of the connectors becoming loose occur. Continued use of devices in this state may cause operating
Maintenance
difficulties.
For this reason, periodically inspect the unit body, wired parts and other sections of CPU units and
other units.
The main items to inspect are listed below.
• Are the connecting sections of the connectors of each unit disconnected or loose?
• Are the connecting sections of the connectors disconnected or loose?
• Are the terminal block screws loose?
• Are the wiring cables between the unit and the other devices damaged?
Maintenance
Dirt adheres to the CPU unit and other units when they are used over a prolonged period of time.
Clean off any dirt from the units using a clean, dry cloth.
Dust and dirt on fine components such as connectors can be removed with a cotton swab or similar
item after first removing the connector.
About Maintenance
Battery
Data such as ladder programs, device comments, and setting information is recorded on flash ROM. Data
such as device values, and the error log is recorded on nonvolatile RAM.
However, backup capacitors are used to save the clock data, so this data may be cleared. Use a battery
(KV-B1) if you need to back up the clock data.
"How to set clock data" (page 3-18)
Reference When no battery is used, a battery depleted error will not be generated. 3
Maintenance
Operation with no battery
The CPU unit can be operated without a battery.
The message "CPU Error E85" or "CPU エラー E85" or "CPU 错误 E85" appears when the voltage in the
backup capacitors drops and the clock data is cleared. This message is automatically displayed and
need not be preset.
NS T
™ ▼BA
et/IP
rN
Ethe
LINK
NS T
™ ▼BA
et/IP
rN
Ethe
3 Turn the power ON and make sure that the access window is not displaying an error.
3-4 Maintenance
If necessary, use one of the following methods to set the clock data.
• While using KV STUDIO to perform monitoring, on the "Debug" menu, click "Setup calendar timer."
• Use the WTIME instruction in a ladder program.
• Set the data using a clock from the access window.
• If you are using a touch panel (VT5/VT3 Series), use the PLC time and date synchronization function.
(If you are using the restoration function, the time will be adjusted automatically.)
"VT STUDIO Reference Manual"
If the clock data is cleared, the following functions may not operate correctly.
Reference
• Logging/trace function (execution time of logging/trace differs)
• Error monitor function (the error occurrence times will be incorrect)
• Weekly contact instructions
Restoration Method
Maintenance
appears when the error occurs.
• Use a ladder program to set the error clear request relay (CR3909). (This method can only be used
for minor errors).
• Restart the product.
• When a BOOL array type variable is assigned to CR, the element number of the
Point
array should be specified with a value.
When specified with device or variable, the SET instruction cannot operate properly.
• Some major errors related to the system may require power restart.
3-4 Maintenance
• When a BOOL array type variable is assigned to CR, the element number of the
Point
array should be specified with a value.
When specified with device or variable, the SET instruction cannot operate properly.
3
Maintenance
CPU function version can be upgraded by updating the system program from the KV STUDIO or
memory card. The update procedure is as follows.
1 The version can be confirmed through "Tool (T)" -> "Functional version validation (X)" ->"Update
system program (U)" on the KV STUDIO menu.
3
Maintenance
Point • System program updates can be carried out when connected via USB.
2 Whether or not the connected KV-8000 series is the latest version or not should be confirmed,
and if it is not, the (update) button should be clicked to begin the system version upgrade.
3-4 Maintenance
• If the system program is the latest version, the dialog below will be shown.
Point
3
Maintenance
• If there is other communication between the CPU unit and computer when the
Point
system program update is executed, the following dialog is displayed and the
system update is not performed.
Maintenance
2 The saved memory card data should be stored in the memory card, and the loading process
should begin.
• For information about loading from the memory card (including auto load/run
Point
load), please see "Load" (page 5-140) and "Auto Load Function" (page 5-45).
• If loading is performed when the memory card data is stored in the CPU
memory, loading will fail.
3-4 Maintenance
3
Maintenance
LADDER PROGRAMMING
LADDER
PROGRAMMING
This chapter describes the specifications and setup methods of the functions
that you have to use when creating ladder programs. You can improve
programming efficiency by using modules, function blocks, macros and local
devices.
conditions of the equipment and devices are recorded in control units in advance. When operations are
started, the target operations are executed in sequence according to the status and conditions of the
equipment and devices in order to assemble the vehicle. This is called sequence control.
PLCs (Programmable Logic Controllers) such as the KV-8000 Series are used as the devices for
sequence control.
4
What Is Sequence Control?
Reference • In JIS (Japan Industrial Standards), sequence control is defined as "control for
successively advancing each step of a control procedure according to a predetermined
order or an order determined according to a fixed logic."
• In PLC control, in addition to sequence control, feedback control is also available.
Feedback control is the process of detecting the current value of the object and
comparing this with the target value and then repeatedly performing control until the
values match.
(Examples) Temperature control, pressure control, and speed control
LADDER PROGRAMMING
Let's take a close look at a fully automatic washing machine as an example of sequence control.
When you press the start button, the fully automatic washing machine follows the predetermined order
to automatically carry out the washing sequence. The washing sequence control is shown below.
ON
(1) Insert the clothes to be washed, and
Start press the start button.
Basic sequence control is divided into three main groups: sequence control, condition control, and time
limit control. Target control circuits are designed by combining these types of control.
Sequence control
In sequence control, the next operation in a predetermined sequence starts when an external signal,
4 such as from a detector, indicates that the previous operation has finished.
Sequence control of the fully automatic washing machine
(2) Water intake I Water intake finishes (3) Washing (washing motor starts)
What Is Sequence Control?
(4) Drainage I Drainage finishes (5) Spin drying I (spin dry motor starts)
Reference Typical ladder program instructions used in sequence control include STG and JMP.
Condition control
In condition control, operations are performed when, in combination with the status signals of the object
being controlled, predetermined conditions are met.
Condition control of the fully automatic washing machine
(3) Washing The washing machine door is opened. Pause The washing machine door is
closed. (3) Washing
(5) Spin drying I The washing machine door is opened. Pause The washing machine door is
closed. (5) Spin drying I
Reference Typical ladder program instructions used in condition control include STP, STE, CJ, NCJ,
and LABEL.
Reference Typical ladder program instructions used in time limit control include TMR and LDWK.
LADDER PROGRAMMING
"Mnemonics" are used as the language for operating the programs that you have created on the CPU
unit. Also, the separation of 16-bit and 32-bit values and signed and unsigned values is determined not
by the instructions, but by the suffixes used.
Ladder Program
Ladder circuits are schematics of actual wiring diagrams. The ladder circuits that you write in KV
STUDIO are called ladder programs.
In KV STUDIO, in addition to the instructions for general switches and lamps that are available, you
4
Programming Language
have access to instructions such as useful ones for controlling ON time and OFF time and for PID
control. You can easily write sequence control programs by combining these instructions.
R000
T1
T1 R001 R500
T1 R002
T2
T2 R003 R501
In addition, you can use expanded ladder mode with KV STUDIO to reduce the number of ladder rungs
and make processing sequences clearer, both of which improve the readability of your programs.
"Expanded ladder mode" (page 4-258)
ST Language
While Ladder Program is suitable for describing Sequence Control, it is often cumbersome to describe
numerical processing such as the complex calculation and character string, and difficult to debug and
maintain.
You can use ST Language instead of Ladder Program to describe complex parts, thereby effectively
creating programs.
Since control statements can be written, the You can make comments without considering
program flow becomes very easy to understand. the internal register for arithmetic processing.
Point To use the ST language, CPU function version 2.1 or later is necessary.
LADDER PROGRAMMING
KV Script
Although ladder programs are suitable for sequence control programs, using ladder programs for
complicated calculation processing that handles values and processing that handles character strings leads
to complicated programs, which makes debugging and maintenance difficult.
KV script is a programming language that has been developed to compensate for these ladder program
problems. By using scripts as substitutes for the parts of a program that become too complicated when
written as a ladder program, you can create programs efficiently.
4
The script can be mixed together with a
Programming Language
ladder program, and you can write
comments on each line of the script.
KV script
You can write control sentences, so it You can write mathematical formulae
is easy to understand the flow of the without having to consider the calculation
program. processing and internal registers.
Reference Script programs are converted into ladder programs before they are executed.
You can monitor the operations of script programs after they have been converted into
ladder programs.
Mnemonics
Mnemonics are the language that is used to make the ladder programs that you have created operate
on the CPU unit.
By simplifying mnemonics, expanded ladder programs are expressed in a manner that is easy to
understand visually.
Expanded ladder programs are converted to mnemonics lists when they are transmitted to the CPU
unit.
4 You can edit the mnemonics list in KV STUDIO, but this is not required when you create normal ladder
programs.
Programming Language
LD R000
OUT R500
LD R002
OUT R501
LD R003
OUT R502
Reference • To edit the mnemonics list, on the "Edit" menu, click "Edit list."
Alternative procedure Ctrl + D
• Mnemonics lists are included in this manual for CPU built-in functions and instruction
sample programs. You can use these mnemonics lists to easily enter sample programs.
"How to Use Mnemonic Lists" (page 16)
• When you create expanded ladder programs, you can reduce the production costs of
programming by entering instructions as mnemonics.
"Mnemonic entry" (page 4-238)
LADDER PROGRAMMING
Suffixes
Suffixes are appended after an instruction. You can use them to change the way that device data is
handled. There are the following seven types of suffixes.
Programming Language
MOV.S
MOV.D
MOV.L
MOV.F
MOV.DF
MOV.A
.A The data type processed by the instruction varies depending on the data type of the variable
used by the operand. The .A suffix is only supported by some instructions. For details, refer to the
"Instruction Reference Manual".
In KV STUDIO, .U is not displayed. Also, instructions that do not have a suffix are processed as 16-
bit, unsigned BIN data.
Instructions to which suffixes are applied are executed with BIN data treated as decimal values
according to the suffix.
Therefore, if the suffix is different, the results of executing an instruction may differ even if the BIN data
is the same.
The .A suffix can be used on KV-8000 Series CPU units with CPU function version
Point
2.3 or later.
MEMO
LADDER PROGRAMMING
4
Programming Language
LADDER PROGRAMMING
Project Configuration
Project
4
Projects
Program
Unit settings
User documents
マク
Logging and tracing settings マク Blocks
Function
Structure
Point You can use one project to manage the information of only one KV-8000 Series.
Program
A program is constructed from modules, function blocks and macros.
By repeatedly executing this program, you can perform various types of control.
"4-8 Program Structure and Operation" (page 4-82)
"4-9 Modules" (page 4-98)
"4-10 Function Blocks" (page 4-117)
"4-11 Macros" (page 4-178)
Unit settings
Use this to manage the unit configuration and the detailed settings of each unit. You can use KV
STUDIO to easily configure the settings.
See the "User's Manuals of each expansion unit".
"Chapter 3 UNIT EDITOR" in the "KV STUDIO User's Manual"
Device comment
LADDER PROGRAMMING
By assigning a comment to each device, you can make it easier to see what functions are assigned to
each device.
"Device comments" (page 4-252)
Variable
Set the variable name and data type. When using variables, any names defined can be used for
programming, which makes the program more readable.
"4-5 Variable" (page 4-55)
4 Structure
Set the structure. When using structures, variables with the same structure can be registered /
Projects
monitored in batch.
"Structure" (page 4-59)
LADDER PROGRAMMING
Set the logging trace function of device data.
"5-5 Logging/Tracing" (page 5-57)
Projects
Program Capacity
The percentage of the program capacity that is used is calculated automatically by KV STUDIO when
you convert the program and is displayed in the "Convert result" dialog box, so you do not have to
perform the calculations and manage this information by yourself.
You will not be able to transmit or run the program if the number of steps,
Point
program size, object size or internal work consumption is exceeded.
<Total steps>
LADDER PROGRAMMING
The total number of steps is the total number of instructions and rung comments used in
the project.
The number of steps used is displayed on the left side of the ladder diagram after the
program is converted by KV STUDIO.
000610
000610
4
Projects
000610
The number of steps used in the program is indicated below
each rung number.
000633
000638
000643
Item Description
4 The ladder programs stored in the CPU unit are write protected (a
confirmation dialog will be displayed when an attempt is made to write
Write protection
Projects
to these programs). You can use this to prevent the programs from
being overwritten by mistake.
The ladder programs stored in the CPU unit are read protected (it will
Read protection not be possible to read these programs). You can use this to prevent
your valuable programs from being leaked.
To read the ladder programs stored in the CPU unit, you will be
prompted to enter the password in the dialog box that appears).
Project password * When you have set read protection, the password entry dialog box
will not be displayed, and you will not be able to read the ladder
programs.
When you are editing a project, if you attempt to display the program, a
Program passwords
dialog box will be displayed asking you to enter the password.
Transfer to PLC
LADDER PROGRAMMING
• Reading projects from the base unit (1)
You can set read protection to prevent projects from being read.
In this situation, even when the project password has been set, the confirmation dialog box will not be
displayed.
• Reading projects from the base unit (2)
You can set a project password so that a dialog box asking the user to enter the password will be
displayed.
• Writing projects to the base unit
4
You can set write protection so that a confirmation dialog box is displayed when an attempt is made
Projects
to overwrite the project.
Reference When you have set a project password, if the password authentication fails, you will have
to wait a set amount of time until you can read the project again. Also, the wait time gets
longer each time that the authentication fails. The project password authentication
disabled status relay (CR2314) turns ON when you can no longer perform read
authentication due to repeated password authentication failures.
The number of consecutive password authentication failures and the total number of
password authentication failures are stored in CM1658, the number of consecutive
project password authentication failures, and CM1659, the total number of project
password authentication failures.
࣮ࣟࢻ /RDG ࣖ䖳
ࣛࢺࣉࣟࢸࢡࢺ :ULWHSURWHFWHG ߏؓᣚ
ࡉࢀ࡚࠸ࡲࡍ ȼ
ᙉ⾜ࡋࡲࡍ " )RUFH/RDG" ᱥੜᕰᢝ㺂ϋ
• Saving
When read protect and project password is configured, save can be executed, but it only saves value
of the device and ladder program will not be saved.
Project passwords
LADDER PROGRAMMING
You can set passwords on projects to place restrictions on what can be read from the CPU unit.
Follow the procedure below to set a password.
1 Click "Workspace."
4 Enter the password in both text boxes (the second is for confirmation), and then click "OK."
After you set the password, when an attempt is made to read this project from the CPU unit, a dialog
box will be displayed asking the user to enter the password.
The user has to enter the password to read the project from the CPU unit.
Also, when you transfer a project that has a different password to the PLC, to protect the projects on the
PLC, you have to enter the password, or transfer all items.
LADDER PROGRAMMING
You can set protection on projects to place restrictions on writing to and reading from the CPU unit.
To configure protection settings, in the workspace, click "CPU System Setting" and then "Protection
Setting."
Projects
Select the checkboxes, and then transfer programs to the CPU unit to enable the protection settings.
If you transfer programs to the CPU unit when you have set read protection, you
Point
will not be able to monitor the execution status of the ladder program from that
point.
After you finish debugging, set read protection, and then transfer programs to the
PLC.
If you are using a password and read protection at the same time, the password
confirmation dialog box will not be displayed, and you will not be able to read
projects.
Reference For details on program passwords, see "Module Passwords" (page 4-114),
"Setting a Function Block Password" (page 4-141) and "Macro Passwords"
(page 4-191).
devices that can be specified with dedicated symbols and numbers (such as Relay, Timer, Counter, and
Data memory). Both are written after the instruction and used to give the data used in the instruction or
to store the execution result of the instruction. This section describes the Device.
Lists of Devices
Bit devices
4 Start of Operation
Indirect
Local Index Specification (*)*7
Device Number of Main
Range*1 Device Modification
Devices
Word devices
LADDER PROGRAMMING
Indirect
Number Start of Operation Local Index
Device Specification (*)
Range of Main Function Device Modification
Name PROG
Points Power On (@) (:Z/:#) Reference Storage
RUN
DM00000 to Clear and
Data Memory 65535 Hold Yes Yes Yes Yes
DM65534 hold*2
Expansion data EM00000 to Clear and
65535 Hold Yes Yes Yes Yes
memory EM65534 hold*2
Consecutive
4
number mode:
524288 Devices that can store No
ZF000000 to
numerical data (16 bit) Clear and
File register ZF524287 Hold Yes Yes Yes
hold*2
Current bank: (32768
Devices
FM00000 to ×16 Yes*10
FM32767 banks)
W0000 to Clear and
Link register*8 32768 Hold No Yes Yes Yes
W7FFF*8 hold*2
Temporary Devices that can store
TM000 to TM511 512 Clear Clear Yes Yes Yes Yes
memory numerical data (16 bit)
Current value and set
Timer value of the 10 μs, 1 ms, Current value:
(current value T0 to T3999 4000 10 ms, and 100 ms down Clear*4 Hold Yes Yes Yes No
and set value) timers and of the 10 ms Set value: Hold
up/down timer (32-bit)
Current value and set
Counter
value of the down counter
(current value C0 to C3999 4000 Clear/hold*6 Hold Yes Yes Yes No
and up/down counter (32-
and set value)
bit)
Devices that are used with
Index register Z1 to Z23 23 Clear Clear No No No No
index modification (32-bit)
Devices used to control
CM0000 to the PLC functions and to
Control memory 7600 Hold Hold No No No No
CM7599 capture the PLC status (16
bit)
*1 Because this is used as a local device, the applicable range of global devices is limited by the number
of reserved local devices.
"List of Local Devices" (page 4-201)
*2 You can change the clear/hold setting by using "Power off holding" in the CPU system settings.
*3 "Lists of CR and CM Devices" (page A-10)
*4 Up/down counters (UDT) hold the current value.
*5 Z11~Z23 are reserved for the system, so cannot be used.
*6 You can change the hold/clear setting by using "Power off holding" in the CPU system settings. (This
only applies to contacts and current values.)
*7 The devices that have "Yes" in the Storage column can be written as "* (device)". The devices that
have "Yes" in the Reference column can be specified indirectly Z11 and Z12 are reserved for the
system, so you cannot use these devices.
"Indirect Specification" (page 4-46)
*8 Use hexadecimal numbers to specify the device numbers.
*9 "DR" is the label for direct processing. When the label is "DR", local devices cannot use indirect
specification.
"Direct processing" (page 4-83)
*10 Local devices cannot perform bank switching.
The arguments used in the function block only are as shown below.
Indirect Local
Argument Index
Argument name Description Specifying Device
type Modify(:)
(*) (@)
Device values or constants are
IN Any argument name No No No
used as argument for processing.
Written to the device that
OUT Any argument name specified the operation results. No No No
4 IN-OUT
Leading
Any argument name Devices are used as argument.
Leading relay (R) assigned to
No No Yes*1
argument.
Leading Leading data memory (DM)
Unit
UM UM0 to UM9 assigned to the unit is No No Yes
DM processed as an argument.
Unit number is processed as an
No. UV UV0 to UV9 No No No
argument.
Constants
LADDER PROGRAMMING
Constant Range Main Function
Used to specify decimal constants.
#0 to #65535 (unsigned 16 bit)
When you select
-32768 to +32767 (signed 16 bit) Reference
Decimal (#) XYM marking mode,
#0 to #4294967295 (unsigned 32 bit)
this is displayed as
-2147483648 to +2147483647 (signed 32 bit)
"K."
-3.4E + 38 ≤ N ≤ -1.4E - 45
Single precision
N=0 Used to specify single precision
floating-point real
1.4E - 45 ≤ N ≤ +3.4E + 38 floating-point constants.
4
number
(Approximately 7 significant digits)
-1.79E + 308 ≤ N ≤ -2.23E - 308
Double precision
N=0 Used to specify double precision
Devices
floating-point real
2.23E - 308 ≤ N ≤ 1.79E + 308 floating-point constants.
number
(Approximately 16 significant digits)
Used to specify hexadecimal
constants.
$0000 to $FFFF (16 bit) When you select
Hexadecimal ($) Reference
$00000000 to $FFFFFFFF (32 bit) XYM marking mode,
this is displayed as
"H."
Fixed character Used to specify fixed character
Examples) "Model number ABC", "MON/08:30:15"
string (" ") strings.
Internal registers
Number Start of Operation
Device Name Range Main Function
of Points (Power On, PRG RUN)
A device used to temporarily store data
Internal register - 1 Clear
(16 bit, 32 bit, 64 bit)
4 Example
DM0:Z01 (If the value of Z1 is 100, this means DM100.)
Devices
XYM marking
LADDER PROGRAMMING
You can use the following XYM marking to specify devices (R (DR)/MR/LR/ DM/EM/FM).
KEYENCE Device Number during XYM
Device Name XYM Marking
Marking Marking
X (DX) 0000 to 1999F*1
Relay R (DR)
Y (DY) 0000 to 1999F*1
Data memory
LR
DM D
L
00000 to 65534
4
Devices
Extended data memory EM E 00000 to 65534
*1 The device numbers of 0000 to 199915 are also displayed during XYM marking for R to which the
input/output is not assigned.
To switch to XYM marking, in KV STUDIO, on the "Tools" menu, click "Options," "Display mode setting,"
and then "XYM marking."
Suffix entry
Devices:(R (DR) / MR / LR / B / T / C / DM / EM / FM / ZF / W / TM / CM / *DM / *EM / *FM / *ZF / *W /
*TM) Enter .□ (□:U, S, D, L, F, DF, B, T) here.
Example
DM0.F (Values DM0 - DM1 are calculated as floating point data)
R1000.U (calculated as 16-bit data between R1000 - R1015)
Power off holding is a function that can be set to retain or clear device data in the event of a power
outage.
To configure this setting, open the CPU system setting from the <<KV STUDIO>> workspace and
select "System settings" "Power off holding."
LADDER PROGRAMMING
Bit Devices
I/O relay R
Overview The input relays are the devices that are used to capture the ON/OFF information from
the peripherals and to transfer this information to the PLC.
The output relays are the devices that are used to transfer the ON/OFF instructions and
the calculation results from the PLC to the PLC peripherals.
Devices
Channel number (000 to 1999) Contact number (00 to 15)
R01012
Device name Device number (00000 to 199915)
Reference • "R" can be omitted when you write the device. (However, you cannot omit "R" for
operands in which you can enter a constant.)
• You can use zero suppression when you write your programs
(Example) R12
• This can be used as a word device.
"Processing Bit Devices in Units of Words" (page 4-50)
• If you include "D" in the device name, the relay will operate as a direct I/O relay.
(Devices that do not support direct I/O will operate as standard relays even when "D" is
included in the device name.)
(Example) DR5000 R5000 will operate as a direct output relay.
"Direct I/O relay (DR)" (page 4-83)
• When you select XYM display mode, input relays are displayed as "X" and output
relays are displayed as "Y."
"XYM marking" (page 4-25)
Details • One bit of the input relay is assigned per one input terminal.
• One bit of the output relay is assigned per one output terminal.
• You can specify a contact (normally open) or b contact (normally closed).
Default setting When the power is turned on and when the mode switches from PRG to RUN, the status
LADDER PROGRAMMING
Unit number: Starting with the CPU unit, numbers are assigned in the order
(00, 01, 02, 03, 04 and so on) that the units are connected.
Unit relay number: Starting from 00000, the number of relay points that will be
occupied are assigned as the relay number.
Unit number 00 01 02 03 04 05
*1 In the case of KV-B8XTD, each input / output relay occupies 1 CH, and only the first 8 bits are
valid.
Link relay B
LADDER PROGRAMMING
Overview These relays are used to perform data linking in simple PLC links etc. Hexadecimal
notation is used to specify device numbers, which is different from other relays.
B1A6F 4
Device name Device number (0000 to 7FFF)
Devices
Reference • You can use zero suppression when you write your programs.
(Example) B7A
• This can be used as a word device.
"Processing Bit Devices in Units of Words" (page 4-50)
Application These relays can be used to perform data linking in EtherNet/IP communication etc.
Default setting When the power is turned on and when the mode switches from PRG to RUN, the status
is cleared and the devices are turned OFF.
R
Overview You can use R devices that are not assigned to an expansion unit relay as internal
auxiliary relays.
Notation Device numbers are structured as shown below.
(Example)
Channel number (000 to 1999) Contact number (00 to 15)
4 R01012
Devices
Range 00000 to 199915 (excluding the numbers that are assigned as expansion input unit
numbers)
Default When the power is turned on and when the mode switches PRG ⇔ RUN, the status is
cleared and the devices are turned OFF.
B
Overview You can use B devices that are not assigned to the link relays of EtherNet/IP communication
etc. as internal auxiliary relays.
B1EE7
Device name Device number (0000 to 7FFF)
Reference • You can use zero suppression when you write your programs.
(Example) B7A
• This can be used as a word device.
"Processing Bit Devices in Units of Words" (page 4-50)
Default setting When the power is turned on and when the mode switches PRG ⇔ RUN, the status is
cleared and the devices are turned OFF.
MR
LADDER PROGRAMMING
Overview These devices can only be used with CPU internal functions.
MR002809
Device name Device number (000000 to 399915)
4
Devices
Details These cannot be assigned as unit devices of expansion units.
Default setting When the power is turned on and when the mode switches from PROG to RUN or from
RUN to PRG, the status is cleared and the devices are turned OFF.
LR (Latch relay)
Overview These devices can only be used with CPU internal functions. These devices are used to
hold the status of devices.
LR02308
Device name Device number (00000 to 99915)
Range LR000 to LR99915
Timer (contact) T
LADDER PROGRAMMING
Overview Timers have a contact (1 bit), a set value (32 bits), and a current value (32 bits). These
devices function as follows: when the current value of a count-down timer is 0 (time is up)
or when the current value of a count-up or count-down timer matches the set value or 0,
the contact turns ON.
T0501
Devices
Device name
The contact, current value, and set value are determined by the operands of the instruction used.
Details There are five types of timers: the 1 ms timer, the 10 ms timer, the 100 ms timer, the 10 µs
timer, and the up/down timer.
Default setting When the power is turned on and when the mode switches from PRG to RUN, the status
is cleared and the devices are turned OFF.
When the power is turned on and when the mode switches from PRG to RUN, the current
value is set to the same value as the set value.
The set value is held.
Reference You can use zero suppression when you write your programs.
(Example) T501
LADDER PROGRAMMING
To program timer operations, specify in the timer instruction operands the timer number and settings
(the length of time until time is up) of the timer that you want to use.
(Example)
Contact number (0000 to 3999) Set value (0 to 4294967295)
Devices
Reference • You can also specify a device in the set value.
For details, see "Timer and Counter Instructions" in the KV-8000/7000/5000/3000/1000
Series and KV Nano Series "Instruction Reference Manuals."
• You can use a device with the same number with both a timer and counter.
Timer error
Timer error is shown below:
• TMR (100 ms timer): Within + (±100 ms + 1 scan time)
• TMH (10 ms timer): Within + (±10 ms + 1 scan time)
• TMS (1 ms timer): Within + (±1 ms + 1 scan time)
• TMU (10 µs timer): Within + (±10 µs + 1 scan time)
• UDT (up/down timer): Within + (±10 ms + 1 scan time)
When you use a timer instruction between subroutine instructions (SBN to RET), between step
instructions (STP to STE), or between condition branch instructions (CJ or NCJ to LABEL), if, while the
timer instruction is being executed, the execution conditions are turned OFF between the above
opening and closing instructions, the timer's current value will not be updated.
The time calculation continues, and the current value of the timer reflects the elapsed time when the
instructions are executed again. If the set time has elapsed, the timer contact will normally be turned
ON immediately after the execution begins again. However, even if the set time has elapsed, if there is
a long time before execution starts again, the timer contact may not be turned ON. Therefore, execute
timer instructions under the condition that the execution of the timer instruction and its surrounding
4 instructions will not be stopped.
Devices
(Example) Programming a timer instruction with a set value of 20 seconds between the SBN and RET
instructions
8 seconds 20 seconds
ON
Execution
condition OFF
Timer
(set value: Current Seconds 20 ・18・16・14・ 12 0
20 seconds) value
ON
Contact
OFF
The timer's current value is not updated. When the timer restarts,
its contact is turned ON.
Reference • Note that the ONDL, OFDL, SHOT, and FLIK instructions also operate as explained
above.
• If a program timer instruction with a checked "Perform OFF Process When Stopping
Execution" checkbox in its properties is used, the phenomenon above does not occur as
the timer instruction is reset by the OFF processing when each program stops executing.
"Standby module operation" (page 4-101)
"Function Blocks" (page 4-117)
"Macro Type" (page 4-181)
When you change the value, if the current value is greater than the set value, the
Point
current value will be updated to match the set value.
Counter (contact) C
LADDER PROGRAMMING
Overview Counters have a contact (1 bit), a set value (32 bits), and a current value (32 bits).
These devices function as follows: when the counter's current value is the same as the
set value (counting is finished) the contact is turned ON.
C0001 4
Device name
Devices
The contact, current value, and set value are determined by the operands of the
instruction used.
Details There are three types of counters: the counter, the output counter, and the up/down
counter.
Default setting With the default settings, the contact status, current value, and set value are all held.
By clicking "Power off holding" in the CPU system settings, you can configure the settings
so that the contact status, current value, and set value are cleared when the power is
turned on and when the mode switches from PRG to RUN.
Reference • You can use zero suppression when you write your programs.
(Example) C15
• You can use a device with the same number with both a timer and counter.
For details, see "Timer and Counter Instructions" in the KV-8000/7000/5000/3000/1000 Series and KV Nano
Series "Instruction Reference Manuals."
Counting is performed only when both the counter input ON time and OFF time are longer than the
scanning time.
The formulae are shown below. If a counting speed greater than that shown below is necessary, use a
high-speed counter or the interrupt function.
Duty cycle (%) 1
Maximum counting speed = X (Unit: times/second)
100 Scan time (sec)
* The ratio of the time that the signal is ON or the time
4 that the signal is OFF to the total time is called
the duty cycle.
T1 T2
T1
Devices
T2
T1 > T2: Duty cycle = X 100 (Unit: %)
T1+T2
* If a device is used to specify the set value of the counter instruction, the set value of the counter is updated
each scan to the value of the specified device.
When you change the value, if the current value is greater than the set value, the
Point
current value will be updated to match the set value.
Overview These are special internal auxiliary relays that are used to control the PLC functions and
to capture the PLC status.
LADDER PROGRAMMING
Word Devices
Devices
DM06143
Reference • You can omit "M" when writing "DM/EM"
• You can use zero suppression when you write your programs.
(Example) D6143
• You can use this as a bit device.
(Example) DM1100 ...............The lowest bit of DM1100 is processed.
• You can use this as a bit device by specifying the bit position.
(Example) DM1200.12 ..........The 13th bit of DM1200 is processed.
"Bit device processing of word devices" (page 4-52)
• When you select XYM marking mode, this is displayed as "D."
"XYM marking" (page 4-25)
• You can only assign data memory (DM) entries to the unit devices of expansion units.
Details
• The bit width of one device is 16 bits. When the device is being used as an unsigned,
decimal value, it takes on a value in the range of 0 to 65535. When the device is being
used as a signed, decimal value, it takes on a value in the range of -32768 to +32767.
When the device is being used as a hexadecimal value, it takes on a value in the range
of $0 to $FFFF.
DM1
bit bit bit bit
15 8 7 0
16 bits
• You can also use two devices to process 32-bit data. For 32-bit data, the lower 16 bits
will be stored in the data memory entry of the specified device number and the upper
16 bits will be stored in the data memory entry of the next device number. When the
devices are being used as an unsigned, decimal value, they take on a value in the
range of 0 to 4294967295. When the devices are being used as a signed, decimal
value, they take on a value in the range of -2147483648 to +2147483647. When the
devices are being used as a hexadecimal value, they take on a value in the range of $0
to $FFFFFFFF.
DM1 DM0
bit bit bit bit bit bit bit bit
31 24 23 16 15 8 7 0
32 bits
• When you are using data memory to specify the operands of an instruction that handles
32-bit data, specify only the number of the device in which the lower 16 bits are stored.
Default setting You can change the range to hold by using "Power off holding" in the CPU system
settings.
- KV-8000 Series User’s Manual - 4-37
4-4 Devices
Reference
In KV STUDIO, aside from the normal notation, you can use a notation in which the unit
numbers are the reference.
To use the device notation for units, on the "View" menu, click "Display unit device."
4 Unit number: Starting with the CPU, numbers are assigned in the order (00, 01,
02, 03, 04, and so on) that the units are connected.
Devices
Unit DM number: Starting from 0000, the amount of data memory that will be
occupied is assigned as the number.
Unit number 00 01 02 03 04
* When using the CPU built-in EtherNet/IP/Ethernet function, devices are labeled as unit devices with "00_"
as the leading number.
LADDER PROGRAMMING
Overview File register can be classified into ZF whereby all areas are processed sequently and FM
whereby the area is divided into sixteen memory banks which are switched over in
processing.
4
Device name Device No.
ZF000372
Devices
Reference • The letter M in FM can be omitted.
• Zero suppression can be used in 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.
"Bit device processing of word devices" (page 4-52)
• “FM" is displayed as ”F" when the XYM Marking option is selected.
"XYM marking" (page 4-25)
Details • 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 to 65535; if
signed decimal, it will be -32768 to +32767; 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.
ZF2511 ZF2510
bit bit bit bit bit bit bit bit
31 24 23 16 15 8 7 0
32 bits
ZF0・・・・・・・ ・・・・・・・ZF524287
Through switching memory banks, 16 different device ranges are available for a single device.
Since it can be mixed with ZF devices in use, attention should be made in data processing.
For more information about memory bank switching, please refer to "4-14 File Register" (page 4-
226).
Link register W
LADDER PROGRAMMING
Overview These registers are used to perform data linking. Hexadecimal notation is used to specify
device numbers, which is different from other word devices.
Reference
W3A6F
• You can use zero suppression when you write your programs.
4
(Example) W7A
Devices
• You can use this as a bit device. You can also specify the bit position.
(Example) W1200.12 ............The 13th bit of W1200 is processed.
"Bit device processing of word devices" (page 4-52)
16 bits
• You can also use two devices to process 32-bit data. For 32-bit data, the lower 16 bits
will be stored in the data memory entry of the specified device number and the upper
16 bits will be stored in the data memory entry of the next device number. When the
devices are being used as an unsigned, decimal value, they take on a value in the
range of 0 to 4294967295. When the devices are being used as a signed, decimal
value, they take on a value in the range of -2147483648 to +2147483647. When the
devices are being used as a hexadecimal value, they take on a value in the range of $0
to $FFFFFFFF.
W2BE1 W2BE0
bit bit bit bit bit bit bit bit
31 24 23 16 15 8 7 0
32 bits
Default setting You can configure the settings so that the values are held by using "Power off holding" in
the CPU system settings.
Overview Temporary data memory entries are word devices that can be processed in the same
manner as data memory. Each device has 16 bits. When you use calculation instructions,
a part of the device area can also be used to temporarily store the data for the calculation
and the result data.
4 (Example)
Device name Device number
Devices
TM010
Range TM000 to TM003 (used with calculation instructions)
TM004 to TM511 (used with simple indirect specification and similar functions)
TM Number Application
TM000
Calculations (DIV, MUL, and ROOT instructions)
TM001
TM002
Calculations (DIV instruction)
TM003
TM004 to TM511 Simple indirect specification and general use
For details on instructions such as DIV and MUL, see the KV-8000/7000/5000/3000/1000 Series and
KV Nano Series "Instruction Reference Manuals."
For details on simple indirect specification, see "Indirect Specification" (page 4-46).
Default setting When the power is turned on and when the mode switches from PRG to RUN, values are
cleared and set to 0.
Reference • TM000 to TM003 are designed for usage with calculation instructions such as DIV and
MUL. We recommend that you do not use these devices for any other purpose.
• You can use zero suppression when you write your programs.
(Example) TM10
• TM devices are stored in the internal cache, so you can access them at high speeds.
Use timers as word devices when you set the value of the timer (32 bits) and when you read the current
value of the timer (32 bits).
Use counters as word devices when you set the value of the counter (32 bits) and when you read the
current value of the counter (32 bits).
Index register Z
LADDER PROGRAMMING
Overview These are 32-bit word devices that are used to specify the value to add to the target
device number during index modification. You can use these devices in the same manner
as data memory to save data and to store calculation results.
Reference You can use zero suppression when you write your programs.
(Example) Z3
4
Devices
Point • Z11 to Z23 are reserved for the system, so you cannot use these devices.
• You cannot specify the bit for word devices.
• There are no local devices. Use the ZPUSH and ZPOP instructions.
For details, see the ZPUSH instruction in the KV-8000/7000/5000/3000/1000 Series and KV
Nano Series "Instruction Reference Manuals."
For details, see the ZPOP instruction in the KV-8000/7000/5000/3000/1000 Series and KV
Nano Series "Instruction Reference Manuals."
Default setting When the power is turned on and when the mode switches from PRG to RUN, the values
are cleared and set to 0.
Control memory CM
Overview Special word device used for PLC function control and PLC status confirmation.
Index Modification
Index modification is a method for specifying devices by the number that is calculated by adding the
value of the index register (Z) or a constant to devices.
Values in the signed, 32-bit range can be added.
The types of devices that you can use index modification with are R (DR), B, MR, LR, T, C, DM,
EM,FM,ZF, W, and TM. Index modification can be performed over all device ranges.
Index modification can be used together with indirect specification (*) and local devices (@).
4 Point
• Index modification cannot be performed in the following cases.
• CR/CM/Z
• Array type variable / label
Devices
Point Z11~Z23 are reserved for system, so you cannot use these devices. Series.
LADDER PROGRAMMING
Example
The current value, which will be stored in DM10000, is saved when a trigger signal (the
rising edge of R001) is received. Recording starts on the rising edge of R000. Data is
saved in the data memory entries in order, starting from DM0.
R000 MOV.L
On the rising edge of R000,
+0 Z1
index register Z1 is set to 0.
Recording
start button
On the rising edge of R001,
R001 MOV the value of DM10000 is written to
DM10000 DM0:Z1
the target device that is being
4
Trigger signal index modified.
Current Leading save
value destination
Z1
Index register Z1 is incremented
Devices
INC.L
(+ 1).
DM99 1234
Reference • If you need to use 10 or more index registers (Z) in a project, use the index register
instructions (ZPUSH and ZPOP) to store and restore all the index registers of a
program at once.
For details, see "Index Instructions" in the KV-8000/7000/5000/3000/1000 Series and KV Nano
Series "Instruction Reference Manuals."
• In the above example, if the suffix of the MOV instruction was ".L," the value of
DM10000 to DM10001 would be saved as data in the following data memory entries:
DM0 to DM1, DM2 to DM3, ... DM98 to DM99.
Reference If you use modification according to index constants in a macro that uses unit devices, it is
easy to tell what number device is specified from the assigned leading device. This is also
effective when you use UR and UM as argument devices during macro creation.
(Example)
UR0:#2
UM1:#32
"Usage example" (page 4-187)
Indirect Specification
address.
In indirect specification (*), the address is manipulated by means of special instructions to change the
reference device.
Index modification (:Z/:#) can be used together with local devices (@).
(Example)
When you write "*TM10"
Device Value
TM10・TM11 DM0 25
This value indicates * TM10 references 1234
DM1 1234
the address of DM1. or DM1.
DM2 0
DM3 96
• The devices that you can write in "*(device)" (that is, the addresses that can be
Point
stored) are DM, EM, FM, ZF, TM, and W.
• The devices that you can specify indirectly are R, MR, LR, B, T, C, DM, EM, FM,
ZF, TM, and W.
• Only variables set to UDINT type can be written as "(*Variable)" (address can be
stored).
• Array elements, array subscripts and structure members cannot be indirectly
specified with "(*Variable)".
Reference • If the device that you want to specify indirectly is a timer (T) or counter (C), the contact,
current value, and set value are determined by the operands of the instruction that you
use.
• When you are using local devices, write "*@(device)."
4-46 - KV-8000 Series User’s Manual -
4-4 Devices
LADDER PROGRAMMING
Follow the procedure below to perform indirect specification.
1 Use the address set instruction (ADRSET) to write the address of the device that you want to
reference.
(Example)
ADRSET
The address of DM0 is
DM0 TM10
stored in TM10 and TM11.
4
• The devices that can store addresses are TM, DM, EM, FM, ZF, and W.
Devices
Point
• Only UDINT type variables can store an address. However, it cannot be stored
in UDINT type structure members or UDINT type array elements.
For details, see the ADRSET instruction in the KV-8000/7000/5000/3000/1000 Series and KV Nano Series
"Instruction Reference Manuals."
2 To use the operands of the instruction to indirectly specify the device, add the prefix "*" before
the device in which the address is stored.
(Example)
MOV
The value of DM10000 is
DM10000 *TM10
stored in DM0.
DM0
Before you add the prefix "*" in front of the device in which the address is stored,
Point
be sure to use the ADRSET instruction to store the address of the device that you
want to specify indirectly.
3 To change the device that you want to reference, use the specialized indirect specification
commands (ADRINC, ADRDEC, ADRADD, and ADRSUB) to change the stored address.
(Example)
MOV
The value of DM10000 is
DM10000 *TM10
stored in DM1.
DM1
Do not use normal calculation instructions (such as ADD, INC, SUB, and DEC) to
Point
change the address that you want to reference. The ladder program will not
operate correctly.
For details, see "Indirect Specification Instructions" in the KV-8000/7000/5000/3000/1000 Series and KV
Nano Series "Instruction Reference Manuals."
- KV-8000 Series User’s Manual - 4-47
4-4 Devices
The rising edge of R001 is used as the trigger signal, which causes the current value stored in
DM10000 to be saved.
Recording starts on the rising edge of R000. Data is saved in the data memory entries in order, starting
from DM0.
4
R001 MOV On the rising edge of R001, the value of
DM10000 *TM10 DM10000 is written to the target device
Trigger that is being indirectly specified.
Current value Address storage
signal
destination
Devices
DM99 1234
(1) (2)
R000 +0 R002 ADRSET
DW.S DM0 TM10
Measurement Z1 Save Leading save Address storage
start button destination destination 1 destination
selection (3)
R002 ADRSET
DM1000 TM10
Save Leading save Address storage
destination destination 2 destination
selection
(4)
R001 MOV
DM10000 *TM10:Z1
Trigger
signal Measured Address storage
value destination
Z1
INC.L
(5)
LADDER PROGRAMMING
You can use indirect specification that uses temporary data memory (TM) as "simple indirect
specification."
• You cannot use simple indirect specification together with index modification,
Point
indirect specification (*), or local devices (@).
• Simple indirect specification is supported so that existing programs may be
reused. If you are creating new programs, we recommend that you use index
modification or indirect specification.
4
Devices
How to specify simple indirect specification
To use simple indirect specification, write #TMnnn in the instruction operands, and change the value
stored in TMnnn.
The relationship between the value stored in TMnnn and the reference value of simple indirect
specification is shown in the following table.
10000 R000
10001 R001
10002 R002
Relay (R) device indirectly
specified
27913 R17913
27914 R17914
27915 R17915
The range of temporary data memory entries that can be used is TM0 to TM511. However, take care to
not overlap over TM0 to TM3, as these are used for calculations.
• With simple indirect specification, you can specify only DM and R devices and
Point
only the ranges of DM10000 to DM65534 and R18000 to R199915.
• If you attempt to perform simple indirect specification when the value of
temporary data memory is greater than 27915, control relay CR2012, the
calculation flag, will be turned ON when the attempt to execute the instruction
is made, and the instruction will not be executed. Operation will continue.
R006 R1000
With an instruction like this one,
the processing target of both R006 and R1000 is 1 bit.
4 R
0
1
5
R
0
1
4
R
0
1
3
R
0
1
2
R
0
1
1
R
0
1
0
R
0
0
9
R
0
0
8
R
0
0
7
R
0
0
6
R
0
0
5
R
0
0
4
R
0
0
3
R
0
0
2
R
0
0
1
R
0
0
0
Devices
Input relay
Processing target
Output relay
R R R R R R R R R R R R R R R R
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
In calculation instructions, bit devices can be grouped into 16 bits or 32 bits for processing.
If you specify a bit device as an operand of an instruction that processes data in units of words, the
specified bit device will be treated as the leading bit of the word data for processing.
Example
MOV
R1000 DM0
R1015 R1000
1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
MOV.D
R1000 DM0
1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
If the bit device specified as an operand is not the leading channel, the next channel will also be used to
LADDER PROGRAMMING
provide the word unit of data for processing
MOV
R1003 R1505
R1102 R1003
11ch 10ch
1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
4
R1604 R1505
Devices
16ch 15ch
1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
When the word unit of data is taken across multiple channels for processing, the
Point
processing speed decreases.
DM1200.12 R1000
Devices
DM1200
0 1 1 1 0 1 1 0 0 1 1 0 1 1 0 0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
If you specify a word device with an instruction other than those listed above, only the lowest bit of the
specified word device is processed as a bit device.
Example
When the value of DM1000 is #46563 ($B5E3)
DM1000 DM1001
DM1000=#46563($B5E3)
1 0 1 1 0 1 0 1 1 1 1 0 0 0 1 1
Lowest bit
1: The contact turns ON.
0: The contact turns OFF.
In the above example, the contact is turned ON, so the lowest bit of DM1001 is set to 1.
DM1001=#14($E)
0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0
DM1001=#15($F)
0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1
Reference Bits other than the lowest bit are not changed.
LADDER PROGRAMMING
Internal Registers
An internal register is a device that is used to store the calculation results of application instructions,
calculation instructions, and expansion instructions and to temporarily store data during calculations.
The data stored in an internal register is not changed until the next time that new data is stored in the
internal register.
When the power is turned on and when the mode switches from PRG to RUN, the values are cleared
and set to 0.
The usage of the internal registers is automatically separated into the 16-bit, 32-bit, and 64-bit internal
registers according to the instruction and suffixes used.
4
"Suffixes" (page 4-9)
Devices
16-bit and 32-bit internal registers
The 16-bit internal register and the 32-bit internal register are shown below. The 32-bit register consists
of 16 upper bits and 16 lower bits.
bit bit bit bit
31 16 15 0
The lower 16 bits of the 32-bit internal register are known as the 16-bit internal register. The 32-bit
internal register consisting of the lower 16 bits and the upper 16 bits is known as the 32-bit internal
register.
(Expansion)
Data memory Word-unit handling of a
DM/EM (internal auxiliary)
File register
ZF(FM) Current value of a timer relay or control relay
Temporary data memory Constant or counter R00000 to R199915
TM MR000000 to MR399915
Control memory #$
T, C LR00000 to LR99915
CM
Index register CR0000 to CR7915
Z
4
LDA instruction
Devices
(Expansion)
Data memory Word-unit handling of a
DM/EM (internal auxiliary)
File register Current value of a timer
ZF(FM) relay or control relay
Temporary data memory or counter R00000 to R199915
TM MR000000 to MR399915
Control memory T, C LR00000 to LR99915
CM
Index register CR0000 to CR7915
Z
Example
The value of DM0 is read into the internal registers. This value is then multiplied by
2, the value of DM1 is added to the product, and the result is then stored in DM2.
LADDER PROGRAMMING
devices that can be specified with dedicated symbols and numbers (such as Relay, Timer, Counter, and
Data memory). Both are written after the instruction and used to give the data used in the instruction or
to store the execution result of the instruction. This section describes the Variable.
• Since the predefined names can be used for programming, the program readability is improved.
Variable
DM4.L = DM2.L / DM0.L Speed = MovingDistance / OperationTime
• The required size is automatically assigned to the work area of the CPU unit according to the variable
settings. Therefore, there is no need to care about the assignment.
• Variables are automatically assigned even when a program is copied between different projects. Unlike
the devices, the device map need not be changed before copying, which makes the program more
reusable.
• Since the touch panel display of VT5 series also supports the variables of the KV-8000 series, there
is no need to change the device number, etc. on the touch panel display side when changing a
device number of PLC like the devices.
• Unregistered variables used in the program can be imported in batch later, so it is not necessary to
register all variables before programming.
• Devices and variables can be used together.
• Variables can be used only with KV-8000 with CPU function version 2.0 or later.
Point
When using variables, the CPU function version should be upgraded from KV
STUDIO Ver.11.0 or later.
• Variables can be used on the touch panel display only with VT STUDIO Ver.8.0 or
later, and the compatible model is only the VT5 series.
• When using variables in VT STUDIO, it is necessary to obtain the variable
information of KV STUDIO. For details, refer to "VT STUDIO Reference Manual".
• Unit variables settable with the KV-XD02 cannot be used in ladder programs.
Variable Types
There are two types of variables.
Global variables
Variables that are processed in common throughout the project. Variables defined as global variables
can be referenced from multiple programs or the VT5 series touch panel display. For example, if the
global variable "Var_X" is defined, the same entity will be referenced when "Var_X" is used in module A
and when "Var_X" is used in module B.
Global variables can also be assigned manually to CPU unit devices.
Local variables
Variables processed by program. Variables defined as local variables can be referenced only in each
program. For example, if the local variable "Var_Y" is defined in module A and the variable "Var_Y" is
also defined in module B, "Var_Y" used in module A and "Var_Y" used in module B refer to different
entities. Since local variables cannot be referenced from the VT5 series, the variables referenced from
the VT5 series should be registered as global variables.
In addition, local variables cannot be assigned manually to CPU unit devices.
- KV-8000 Series User’s Manual - 4-55
4-5 Variable
LADDER PROGRAMMING
Variable specifications
Item Content
Maximum number of definitions 100000*1
Maximum length of variable name 128 characters (128 characters in regardless of full-width / half-width)
Maximum number of hold settings 30000*2*3
*1 Sum of global and local variables. Depending on the number of characters in the variable name, 100000
may not be set.
*2 Sum of bits, words and counters. Their own number is set in the CPU system settings. Depending on the
number of characters in the variable name, 30000 may not be set.
*3 One variable name registered in the variable edit window is counted as one setting. For example, when
an array type variable with 10000 elements is set, the number of settings will be 1.
The entire variable area can also be held by setting variables that occupy multiple bits or
Reference words with 1 variable name such as array or structure.
The data types and data sizes of variables that can be used with KV-8000(A) are as follows. The CPU unit
automatically assigns the following data sizes to the work area according to the data type of the variables*1*2 .
Data type Alignment size*3
Data size (in bits)
Type name Description (in bits)
BOOL Bit 1 1
UINT 1-word unsigned integer 16 16
INT 1-word signed integer 16 16
UDINT 2-word unsigned integer 32 32
DINT 2-word signed integer 32 32
REAL Single-precision floating point type 32 32
LREAL Double-precision floating point type 64 32
(Number of characters*5 +
STRING※4 String 1) × 8 rounded up to an 16
integral multiple of 16
TIMER Timer ― ―
COUNTER Counter ― ―
ARRAY Array Data type × Array size According to the data type
Maximum member
Structure ― By definition※6
alignment size
Function block Function block By definition※6 32
*1 It is also possible to manually assign to CPU unit devices. In that case, no work area is consumed.
*2 When a variable is set as a constant, the work area is not consumed.
*3 Unit for securing the memory.
*4 The character code processed in STRING type follows the language set in the project language
settings. For details on project language settings, refer to "KV STUDIO User's Manual".
*5 The number of characters is the number of bytes up to NULL. For double-byte characters such as Shift-
JIS, the number of characters is calculated as 2 with 1 character.
*6 Structures and function blocks are data types used by setting multiple data types. Therefore, the data
size is determined by the settings.
4-56 - KV-8000 Series User’s Manual -
4-5 Variable
LADDER PROGRAMMING
Array
Array is a data type that defines a collection of data of the same data type with 1 name. Each data that
constitutes an array is called an element. When using an array, the data type, number of elements and
number of dimensions should be set in addition to the variable name. An array with n dimensions is
called an n-dimensional array. An example of 1-dimensional array to 3-dimensional array is shown
below.
• 1-dimensional array Variable name: Array_A Number of elements: 5
Variable
Number of elements 5
• 2-dimensional array Variable name: Array_B Number of elements: 5×4
Number of elements 4
Array_C
[1,0,0] [1,0,1] [1,0,2] [1,0,3]
Point Array type variables have the same data type for all elements.
MOV
MR000
#0 Array_C[#5,#0,#3]
ACNT
MR000
Array_A #1 duAryLen
Only the ACNT/WSIZE/BSIZE instruction writes the variable name only and processes
Point it as an entire array.
When only the variable name is written by other instructions, only the instruction
processing range from the first element is processed.
For example, when "MOV.D 0 Array_A" is written for the UINT array type variable
Array_A, 0 is stored only in the 2 words Array_A[0] and Array_A[1].
Array specifications
Item Content
Maximum number of elements per dimension 589823
Maximum number of dimensions 8
Maximum data size that can be occupied per array 589823 words
BOOL / UINT / INT / UDINT / DINT / REAL / LREAL /
Data types that can be specified
STRING / Structure / Function block
Subscripts that can be specified*1 Device / constant / variable / expression*2
Data types that can be used for subscript UINT / INT / UDINT / DINT
*1 Specify 0 or a positive integer for the subscript. If any other number is specified, a conversion error or
calculation error will occur.
*2 Only KV scripts can use expressions as subscripts. Expressions cannot be used as subscripts in ladder programs.
• When an element is specified beyond the specifiable range, such as specifying
Point Array_A[10] (11th element) for an array called Array_A set with the number of
elements "10", the value in an unintended area may be referenced. Especially when
using variables or expressions as subscripts, the ACNT instruction or WSIZE
instruction should be executed before referring to the array to obtain the number of
elements in the array or the data size of the entire array, and avoid referring to
elements beyond the specifiable range. A conversion error or calculation error will
occur when specified out of the array range.
"ACNT" (Page 4-66), "WSIZE" (Page 4-68), "BSIZE" (Page 4-70)
• When a device is specified as the subscript of an array, it will be processed as a 16-
bit unsigned integer.
• Bit data such as bit devices (R, MR, etc.), BOOL type variables and word data bits
cannot be specified as array subscripts.
• Depending on the KV STUDIO version, array data types are expressed as follows:
Example: UINT type array with three elements
Ver. 11.20 or later: ARRAY[0..2] OF UINT
Ver. 11.10 or earlier: UINT[3]
4-58 - KV-8000 Series User’s Manual -
4-5 Variable
LADDER PROGRAMMING
Structure
Structure is a data type that defines a collection of multiple variables of different data types with 1
name. Each data that constitutes a structure is called a member. When using a structure, the names of
the members that constitute the structure and the data types of the members should be set in addition
to the variable name. The structure has the following advantages.
• Registering the structure members and data types in advance makes it easier to create variables
with the same structure.
• All members can be monitored in batch by registering a structure variable when monitoring in the
registration monitor window, etc.
• Visual recognition is improved since the contents can be confirmed with the member names.
4
Variable
The following is an example of using the following information of a motor axis in a program.
Current coordinate (CurCoordinate)
Current speed (CurSpeed)
Axis control (Control)
Axis error (Error)
Axis error code (ErrorCode)
If multiple axes are used without a structure, variables with the same content except for the axis
number should be registered as shown below.
When using a structure, the data type should be set to the same structure only when using multiple
axes after defining the data structure of axis information as a structure in advance.
<When not using a structure> <When using a structure>
Also, if no structure is used when monitoring in KV STUDIO, it is necessary to manually enter all
variables, but if a structure is used, the members in the structure can be monitored in batch simply by
entering the variable name.
<When not using a structure> <When using a structure>
This section describes how to write structure type variables when using them in a program.
4 MR000
MOV.L
Structure can also be specified for the data type of structure type variable members. In the following
example, a structure type variable called "ProductionDate" is nested in the structure type variable
Product_A of "ProductInfo".
MOV
MR000
#31 Product_A. ProductionDate. Day
• When a value is written to an entire structure using the FMOV instruction, etc., the
Point
value in an unintended area may be changed if a value larger than the number of
data in the entire structure is specified as the number of data transferred. When an
entire structure is referenced with the FMOV instruction, etc., the WSIZE instruction
should be executed first to obtain the data size of the entire structure.
"WSIZE" (Page 4-68)
• Only the WSIZE/BSIZE instruction writes the variable name only and processes it as
an entire structure. When only the variable name is written by other instructions,
only the instruction processing range from the start of the structure is processed.
For example, if the wisdom "MOV.D 0 Ax1" is written for the structure type variable
Ax1, 0 is stored only in the first 2 words of Ax1.
"BSIZE" (Page 4-70)
LADDER PROGRAMMING
After the offset is specified for the structure members, the memory configuration in the work area of
each member can be set. By setting the memory configuration, when a data link is established with
external equipment, the memory configurations of the structure type members of both companies can
be matched. Offset of the structure members can be set from "Auto" and "Manual".
Variable
Assigns the start of the structure to the boundary of the maximum alignment size
Start of structure among the structure members. However, when assigning to CPU unit devices,
assignment in words is possible regardless of the alignment size.
Start of each Assigns to the boundary of the alignment size of each member. However, BOOL type
member arrays are assigned to the 16-bit boundary.
Var_D has the maximum alignment size of 32 bits among the structure members, so the start of the
structure is configured in an even-numbered area counted from the start of the work area. The
configuration of each member is as follows.
Bit
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+0 Var_A Filler for adjustment
Work area (word)
* Offset to the boundary position of the next alignment size is called filling.
When the offset is manual, the memory configuration can be set arbitrarily according to the following
rules.
Item Content
Assigns the start of the structure to the boundary of the maximum alignment size
Start of structure among the structure members. However, it can be assigned to CPU unit devices in
words.
BOOL type members are in bits, other data type members are in words, and the
4 Start of each member
offset from the start of the structure can be specified.
However, the maximum offset is up to the end of the work area for word offset and
Variable
Example) When a structure with the following members and offset specifications is assigned to
DM1001
Member name Data type Word offset Bit offset
Var_A BOOL 0 0
Var_B INT 2 0
Var_C INT 3 0
Var_D DINT 5 0
The structure can be assigned to CPU unit devices in words, so the start of the structure can be
configured in an odd-numbered device like DM1001.
Bit
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
DM1001 Var_A
Filler for adjustment Since the alignment size of Var_B is 16 bits,
DM1002
15-bit filler will be inserted after Var_A.
DM1003 Var_B
DM1004 Var_C
DM1005 Filler for adjustment
DM1006 Since the alignment size of Var_D is 32 bits,
Var_D
DM1007 16-bit filler will be inserted after Var_C.
Structure specifications
Item Content
Maximum number of structures
800
defined
LADDER PROGRAMMING
Variable Setting
This section describes the procedure from defining variables to using them in a ladder program.
Setting method
1 Select "Display (V)" ▶ "Variable Edit Window (L)" to open the "Variable Edit" dialog.
Other Double-click "Variable" in the workspace
1
4
Variable
2 3 4 5 6 7 8 9
Variable Assignment
LADDER PROGRAMMING
Variables are assigned to the work area when defined. "Work Area Setting" is used to check the
number of used work areas and change the number of assigned work areas.
Select "Display (V)" ▶ "CPU System Setting (P)" in the KV STUDIO menu, and click "Local Overall
Assignment Setting". Click "Work Area Setting" to display the "Work Area Setting" dialog.
4
2
Variable
• When using the ST/Script string function both in the interrupt program (or periodic
Point
module, inter-unit sync module) and in the normal module other than interrupt,
seperetly assign the number of ST/Script string work areas for interrupt/normal
modules. Alternatively, the DI / EI instructions are used during programming so that
interrupt is not input during string processing in a normal module.
If the string function of the interrupt program is executed during the string function
processing in a normal module without assignment, the same work area will be
used, so that the string processing cannot be performed normally.
LADDER PROGRAMMING
Structure Definition
Setting method
1 Select "Display (V)" ▶ "Structure (J)" ▶ "New (N)" to create a new structure.
Other Double-click "Structure" in the workspace
Variable
Item Content
Specifies the name of the structure. Up to 128 characters in regardless of full-width /
Structure name
half-width.
Selects the offset of each member of the structure from "Auto / Manual".
Offset
"Structure member offset specification" (Page 4-61)
The string entered in the input field is displayed on the right of the structure name in
Comment
the KV STUDIO workspace. Up to 8 types of comments 1 to 8 can be set.
2 Set the member name and data type, etc. of each member.
1 2 3 4
ACNT ACNT
Get number of
array elements
Gets the number of array elements in
the specified dimension.
16 bits
n of elements.
Variable
Description of Operation
ACNT When the execution condition is ON, the number of elements in the n th dimension of
the array specified by S is stored in [ D ・ D +1].
• The ACNT instruction obtains the number of elements instead of the word size. For
Point
example, when UDINT (2-word unsigned integer) specifies 4 dimensions, 4 is stored
in [ D ・ D +1]. Word size 8 is not stored.
Calculation flag
LADDER PROGRAMMING
CR2009 No change
CR2010 No change
CR2011 No change
• ON if any of the following conditions is met, and OFF otherwise
• When n is not specified as a constant or n is 0 or a number of dimensions that
does not exist
• When indirect reference or index modification is inappropriate
CR2012
• No change if all of the following conditions are met.
• n is specified as a constant 4
• No indirect specification or index modification is used for D and when the out-of-range
Variable
access of operands is not checked
Sample program
The number of elements in the second dimension of 5×4 two-dimensional array Array_A is stored in
DM0 at the rising edge of input relay R000. Then, 0 is stored in Array_A[4,0],
Array_A[4,1]…Array_A[4,3].
idx
INC. D
NEXT
R000 MOV. D
#0 nLoop
WSIZE WSIZE
Get word size
Gets the word data size occupied by
the specified variable.
4 S
D
Specifies a variable.*1*2
Specifies the result storage location.
―
32 bits
*1 Only variables can be specified for S . Device cannot be specified.
Variable
Description of Operation
WSIZE When the execution condition is ON, the word size occupied by S is stored in [ D ・
D +1].
member3 REAL
• The WSIZE instruction obtains the word size. The WSIZE instruction obtains the
Point
word size. For example, when an array type variable or structure type variable with 4
UDINT data (2-word unsigned integers) is specified, since it is 2 words × 4 = 8 words,
8 is stored in[ D ・ D +1]. It does not store the number of elements or the
number of members.
• [ D ・ D +1] stores the word size including the offset. For details on the offset,
refer to "Structure member offset specification" (Page 4-61).
• [ D ・ D +1] stores the result rounded to word size.
For example, 3 is stored for BOOL[33].
Calculation flag
CR2009 No change
CR2010 No change
CR2011 No change
• ON if any of the following conditions is met, and OFF otherwise
• When indirect reference or index modification is inappropriate
CR2012 • No change if all of the following conditions are met.
• No indirect specification or index modification is used for the operand
• No device or variable is used for the array subscript
LADDER PROGRAMMING
Sample program
The word size occupied by the variable "Products_A" is calculated at the rising edge of input relay
MR000 and stored in DM0. Then, 0 is stored in the area occupied by "Products_A".
4
FMOV
#0 Products_A DM0
FMOV #0 Products_A DM0
The above reference program can be used only when the word size of the variable is
Variable
Point
65535 or less.
When the word size of the variable is larger than 65535, 0 should be stored using the
recipe load function.
"Recipe Load/Save Function" (Page 5-50)
BSIZE BSIZE
Gets bit size
Gets the bit size occupied by the
specified variable.
4 S
D
Specifies a variable.*1*2
Specifies the result storage location.
―
32 bits
*1 Only variables can be specified for S . Device cannot be specified.
Variable
Description of Operation
BSIZE When the execution condition is ON, the bit size occupied by S is stored in [ D ・
D +1].
D +1 D
Number of elements 20
→ Since the number of elements is 20 for the INT type (16 bits), 16 bits × 20 = 320 bits
[ D ・ D +1] stores the bit size including the offset. For details on the offset, refer
Point
to "Structure member offset specification" (Page 4-61).
Calculation flag
CR2009 No change
CR2010 No change
CR2011 No change
• ON if any of the following conditions is met, and OFF otherwise
• When indirect reference or index modification is inappropriate
CR2012 • No change if all of the following conditions are met.
• No indirect specification or index modification is used for the operand
• No device or variable is used for the array subscript
LADDER PROGRAMMING
Sample program
The bit size occupied by the BOOL array type variable "ResultBits" is calculated at the rising edge of
input relay MR000 and stored in DM0. The end number of the array is stored in UDINT type variable
duSizeOfBit, and all the bits of "ResultBits" are reset.
Variable
ZRES
ResultBits[duSizeOfBit]
MEMO
LADDER PROGRAMMING
4
Variable
LADDER PROGRAMMING
#Decimal constants
Overview Values that are displayed with a bit width of 16 or 32 bits are represented in decimal notation.
Constants
#06143
• Signed (when the suffix is ".S" or ".L")
A decimal constant is represented by a sign, which is followed by decimal numbers.
Reference • You can use zero suppression when you write your programs.
• You can also prefix signed constants with "#." If you include "#," only "+" may be omitted.
• When you select XYM marking mode, you can append "K" when you write these constants.
"XYM marking", (page 4-24)
$Hexadecimal constants
Overview Values that are displayed with two bit widths,16 bits and 32 bits, are represented in
hexadecimal notation.
$1AF7
Range • 16-bit constant: $0000 to $FFFF
• 32-bit constant: $00000000 to $FFFFFFFF
If you enter a hexadecimal value that contains letters A to F without the prefix "$,"
Point
an error will occur. If you enter a hexadecimal value that does not contain letters A
to F without the prefix "$," the hexadecimal value will be recognized as a relay (R).
Reference • You can use zero suppression when you write your programs.
• When you select XYM marking mode, you can append "H" when you write these constants.
"XYM marking", (page 4-24)
Reference The prefix "#" can be used. Only "+" can be omitted.
Constants
Notation • Signed decimal values can be written as-is for these constants.
• For 15 digits or more, exponential notation is used.
Range -1.79E + 308 ≤ N ≤ -2.23E - 308
N=0
+2.23E - 308 ≤ N ≤ +1.79E + 308 (approximately 16 significant digits)
If you do not include the opening and closing quotation marks, the string will be
Point
processed as a variable.
Reference To process the quotation mark as a character, escape it by entering two quotation marks.
Point Up to 31 characters when the KV-8000 CPU function version is lower than 2.0.
Point In ST language, the string is written between " ' ' ".
LADDER PROGRAMMING
values, hexadecimal values, binary coded decimal (BCD) values, single precision floating-point real
numbers, and double precision floating-point real numbers.
The character codes that can be processed are ASCII code and shift JIS code.
Binary Data
On the KV-8000 Series, all data is processed by devices and internal registers as binary data.
One digit of a binary value is processed as a bit unit. A bit indicates two states: 0 (OFF) and 1 (ON).
4
16-bit binary data
Highest bit
0 0 1 0 0 1 1 1 0 0 0 1 0 0 0 0
Weight of
=
15
=
14
=
13
=
12
=
11
=
10
=
9
=
8
=
7
=
6
=
5
=
4
=
3
=
2
= 1
=
0
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 each bit
32768 16384 8192 4096 2048 1024 512 256 128 64 32 16 8 4 2 1 Decimal
number value
0 + 0 +8192 + 0 + 0 +1024+512 +256 + 0 + 0 + 0 +16 + 0 + 0 +0 +0 = 10000
Highest bit
If you are using a DM, EM, ZF(FM), TM, or other 16-bit word device to process a 32-bit device, 2
consecutive words will be used. The lower 16 bits of data are processed by the word device with the
smaller number, and the upper 16 bits of data are processed by the word device with the larger number.
Reference Whether a device is processed as 16-bit data or 32-bit data is determined by the suffix.
"Suffixes" (page 4-9)
Value Notation
Binary BIN
The internal binary data of the CPU unit is indicated as 0s and 1s without any changes. When a digit is
greater than 1, the digit is carried.
Highest bit
4 bit
15
bit
8
bit
7
bit
0
How Data Is Processed
Weight of
=
15
=
14
=
13
=
12
=
11
=
10
=
9
=
8
= 7
=
6
=
5
=
4
=
3
=
2
=
1
=
0
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 each bit
32768 16384 8192 4096 2048 1024 512 256 128 64 32 16 8 4 2 1 Decimal
number value
(Example) 0110110100110001
Decimal DEC
The internal binary data of the CPU unit is indicated as decimal values.
Unsigned
For 16-bit data, the range of values that can be processed is 0 to 65535. For 32-bit data, the range of
values that can be processed is 0 to 4294967295.
Signed
Whether a value is positive or negative is determined by the highest bit (0: positive; 1: negative).
For 16-bit data, the range of values that can be processed is -32768 to +32767. For 32-bit data, the
range of values that can be processed is -2147483648 to +2147483647.
Reference These values can be entered as instruction operands. Prefix the value with "#" or a sign.
(Examples) #1000, +12, and -25489
Hexadecimal HEX
The internal binary data of the CPU unit is indicated as hexadecimal values.
For hexadecimal values, four bits are processed as one digit. Because the values that can be
expressed in a single digit are 0 to 15 in decimal notation, A, B, C, D, E, and F are used for values
greater than 9. When a digit is greater than F, the digit is carried.
For 16-bit data, the range of values that can be processed is $0000 to $FFFF. For 32-bit data, the range
of values that can be processed is $00000000 to $FFFFFFFF.
Reference These values can be entered as instruction operands. Prefix the value with "$."
(Example) $00FF
LADDER PROGRAMMING
With binary coded decimal notation, 4 bits are processed as 1 digit in the same manner as hexadecimal
notation. In the same manner as decimal notation, when a digit is 9, the digit is carried, so the letters A
to F are not used.
For 16-bit data, the range of values that can be processed is 0000 to 9999. For 32-bit data, the range of
values that can be processed is 00000000 to 99999999.
Example
bit
15
bit bit
8 7
bit
0
4
When 16-bit data is stored as shown above, while the actual value is $0987
(#2439 in decimal notation), in binary coded decimal, this value is handled in
decimal notation as "0987."
0 0 0 0 1 0 0 1 1 0 0 0 0 1 1 1
Thousands Hundreds Tens Ones
position position position position
0 9 8 7
Binary coded decimal is a useful notation to use when processing data that comes from an external
source (such as a digital switch).
However, this data must be processed as binary data in calculations performed by the CPU unit. When
reading data from an external source, use the TBIN instruction to convert the data to binary data. When
outputting data to an external device (such as a digital display), use the TBCD instruction to convert the
data to binary coded decimal data.
Reference To enter binary coded data values as instruction operands, prefix the value with "$" to
enter the value in hexadecimal notation.
Double precision floating-point real numbers are processed as values in which 64-bit data has a
decimal point.
You can use values in the following range (N).
-1.79 × 10+308 ≤ N ≤ -2.23 × 10-308
N=0
+2.33 × 10-308 ≤ N ≤ +1.79 × 10+308
Reference • These values can be entered as double precision floating-point instruction operands.
In addition to the normal notation using the decimal point (example: -1.2345), you can
• The precision of double precision floating-point real numbers is 64-bit double precision.
There are approximately 16 significant digits.
• Double precision floating-point real numbers stored in 64-bit data are represented
internally in the IEEE standard format.
• Whether a device is processed as single precision floating-point data or as double
precision floating-point data is determined by the suffix.
"Suffixes" (page 4-9)
The correlations between binary values, decimal (unsigned and signed) values, hexadecimal values, and
binary coded decimal values are shown below.
16-bit data
Decimal Binary
Hexa-
Coded
decimal Binary (BIN) Binary (BIN)
Unsigned Signed Decimal
(HEX)
(BCD)
0 +0 0 0000 0000 0000 0000 0000 0000 0000 0000 0000
1 +1 1 0000 0000 0000 0001 0001 0000 0000 0000 0001
2 +2 2 0000 0000 0000 0010 0002 0000 0000 0000 0010
3 +3 3 0000 0000 0000 0011 0003 0000 0000 0000 0011
4 +4 4 0000 0000 0000 0100 0004 0000 0000 0000 0100
5 +5 5 0000 0000 0000 0101 0005 0000 0000 0000 0101
6 +6 6 0000 0000 0000 0110 0006 0000 0000 0000 0110
7 +7 7 0000 0000 0000 0111 0007 0000 0000 0000 0111
8 +8 8 0000 0000 0000 1000 0008 0000 0000 0000 1000
9 +9 9 0000 0000 0000 1001 0009 0000 0000 0000 1001
10 +10 A 0000 0000 0000 1010 0010 0000 0000 0001 0000
11 +11 B 0000 0000 0000 1011 0011 0000 0000 0001 0001
12 +12 C 0000 0000 0000 1100 0012 0000 0000 0001 0010
13 +13 D 0000 0000 0000 1101 0013 0000 0000 0001 0011
14 +14 E 0000 0000 0000 1110 0014 0000 0000 0001 0100
15 +15 F 0000 0000 0000 1111 0015 0000 0000 0001 0101
16 +16 10 0000 0000 0001 0000 0016 0000 0000 0001 0110
...
...
...
...
...
...
99 +99 63 0000 0000 0110 0011 0099 0000 0000 1001 1001
100 +100 64 0000 0000 0110 0100 0100 0000 0001 0000 0000
...
...
...
...
...
...
32767 +32767 7FFF 0111 1111 1111 1111 0999 0000 1001 1001 1001
32768 -32768 8000 1000 0000 0000 0000 1000 0001 0000 0000 0000
...
...
...
...
...
...
65534 -2 FFFE 1111 1111 1111 1110 9998 1001 1001 1001 1000
65535 -1 FFFF 1111 1111 1111 1111 9999 1001 1001 1001 1001
32-bit data
LADDER PROGRAMMING
Decimal Hexadecimal
Binary (BIN)
Unsigned Signed (HEX)
0 +0 0 0000 0000 0000 0000 0000 0000 0000 0000
1 +1 1 0000 0000 0000 0000 0000 0000 0000 0001
2 +2 2 0000 0000 0000 0000 0000 0000 0000 0010
3 +3 3 0000 0000 0000 0000 0000 0000 0000 0011
4 +4 4 0000 0000 0000 0000 0000 0000 0000 0100
5 +5 5 0000 0000 0000 0000 0000 0000 0000 0101
6 +6 6 0000 0000 0000 0000 0000 0000 0000 0110
7
8
+7
+8
7
8
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0111
1000
4
+9
...
...
...
99 +99 63 0000 0000 0000 0000 0000 0000 0110 0011
100 +100 64 0000 0000 0000 0000 0000 0000 0110 0100
...
...
...
...
2147483647 +2147483647 7FFFFFFF 0111 1111 1111 1111 1111 1111 1111 1111
2147483648 -2147483648 8000000 1000 0000 0000 0000 0000 0000 0000 0000
...
...
...
...
4294967294 -2 FFFFFFFE 1111 1111 1111 1111 1111 1111 1111 1110
4294967295 -1 FFFFFFFF 1111 1111 1111 1111 1111 1111 1111 1111
...
...
...
Changes to values when the value is greater than the maximum value or
LADDER PROGRAMMING
16-bit data
Changes to values when 65535 is exceeded Changes to values when the value is greater than
the maximum value or smaller than the minimum
1 0001 1 0001
0 0000 0 0000
65535 FFFF -1 FFFF
65534 FFFE -2 FFFE
65533 FFFD -3 FFFD
⋮
⋮
Reference Whether a device is processed as 16-bit data or 32-bit data is determined by the suffix.
"Suffixes" (page 4-9)
32-bit data
Changes to values when 4294967295 is exceeded Changes to values when the value is greater than
the maximum value or smaller than the minimum
value
Unsigned decimal notation Hexadecimal notation Unsigned decimal notation Signed decimal notation
3 00000003 3 00000003
2 00000002 2 00000002
1 00000001 1 00000001
0 00000000 0 00000000
4294967295 FFFFFFFF -1 FFFFFFFF
4294967294 FFFFFFFE -2 FFFFFFFE
4294967293 FFFFFFFD -3 FFFFFFFD
⋮
⋮
⋮
0 ∞ ("----" is displayed)
0 ∞ ("----" is displayed)
LADDER PROGRAMMING
Character Codes
The numbers that are assigned to the characters that are used to process ladder programs in terms of
character strings are called character codes.
The device can handle the character codes used by the KV-8000 Series.
ASCII code
This character code uses 8 bits to represent 1 half-width character.
(Examples) A ... $41 1 ... $31
4
UNICODE
This character code uses 16bits to represent 1double-byte character.
Reference It will be entered as the operand of character processing instruction, calendar point of
contact instruction. Character strings are placed inside quotation marks (").
(Examples) "ABC format" "MON/08:30:15"
UNICODE supports the alphabet, symbols, Japanese, Chinese, Korean and other languages. Please
note that some character codes are not available.
CPU system settings other settings "Tools (T)" "KV STUDIO language settings (2)"
The CPU unit follows the procedure shown below to execute programs repeatedly.
CPU built-in Ethernet/
EtherNet/
Control processing Peripheral processing IP (KV-8000(A))
Automatic refreshing
4 Program execution
Communication processing
Access window processing
Direct access switch processing
Ethernet function
or
One scan
Memory card access
EtherNet/IP function
Program Structure and Operation
Logging/trace function
etc.
Synchronization
High speed processing is achieved through parallel execution of control processing, peripheral
processing and CPU built-in Ethernet/EtherNet/IP processing.
Reference In addition to the three processes mentioned above, there are also unit-interrupting
process, interrupting processes by fixed period module execution/inter-unit synchronizing
modules as well.
"4-13 Interrupts" (page 4-206)
Control processing
One control processing stage is called a scan. Scan time is the execution time of one scan.
Automatic refreshing
The status and values of devices assigned to the CPU built-in functions and expansion units are
updated. First, the device status and values to be generated are transferred to each unit. Next, the
status and values of each unit are transferred to the input devices.
Program execution
Calculation processing of the stored program method is performed. The ladder program instructions
are executed one instruction at a time in order starting from the first step.
END processing
Device values and other data used in peripheral processing and CPU built-in Ethernet/EtherNet/IP
processing executed in parallel are applied to control processing. Furthermore, an error check of the
whole system is performed.
Reference Normally, the END processing time is determined automatically according to the program
execution time. However, you can set the END processing time in situations such as
when there is a great deal of data communications with the peripherals.
"Setting the END processing time" (page 4-92)
Peripheral processing
In this process, information other than that used in program processing, such as communications and
data management information, is processed. In addition, instructions related to memory cards, calendar
timers and similar are executed.
The process is designed to minimize the effect of processing on scan time by operating in parallel with
control processing.
4-82 - KV-8000 Series User’s Manual -
4-8 Program Structure and Operation
Direct processing
LADDER PROGRAMMING
As written above, automatic refreshing processing, in which the status and values of devices assigned
to the CPU built-in functions and expansion units are updated, is normally performed only once per
scan. To update information during program execution (direct processing), use one of the following
methods.
The following direct processing can only be executed when a real time
Point
compatible expansion unit is connected.
4
Reference If you are using XYM marking, write "DX" and "DY."
"XYM marking" (page 4-25)
CR2002 MOV
DM0 R5000
Always ON
Calculation result
RFSY
R5000 #16
For details, see the RFSX and RFSY instructions in the KV-8000/7000/5000/3000/1000 Series and KV Nano
Series "Instruction Reference Manuals."
Each unit has a buffer memory that makes it possible to retrieve unit information and write commands
any time during program execution. EtherNet/IP and Ethernet built into the KV-8000 CPU have similar
functionality.
The buffer memory read instruction (UREAD) and the buffer memory write instruction (UWRIT) can be
used for directly read/write data from and to buffer memory.
See "UREAD/UWRIT/UFILL instructions" in the "KV-8000/7000/5000/3000/1000 Series Instruction
Reference Manual"
See "List of Buffer Memories" in the "Expansion Unit User's Manual"
LADDER PROGRAMMING
The following items are checked when the power is turned on. If everything is OK, operations are
started.
• Hardware check and initialization
• Device check and initialization "Configuring Power Off Holding Settings (Latching)" (page 4-26)
4
Power on/off log
Event/error settings
LADDER PROGRAMMING
There are two types of errors: serious errors that stop operation and minor errors in which operation
continues.
For details on the CPU unit errors, see "A-1 List of PLC Unit Errors" (page A-2).
For details on the expansion unit errors, see the "User's Manual" of each expansion unit.
Event/error setting
4 To set the severity (serious or minor) of CPU unit errors, open "CPU system settings" in the KV
STUDIO workspace and select "Event/error setting".
Program Structure and Operation
Error log
Up to 32 serious error logs or 200 minor error logs could be kept. When it exceeds the maximum
number, it will be deleted from the old one. In addition, while using KV STUDIO to perform monitoring,
you can view the log in the "Event/error monitor".
LADDER PROGRAMMING
The detailed information of the latest error is recorded in control memory entries.
Control Memory Description
CM5100 Year and month represented as a decimal number (the last
two digits represent the month, and the digits starting from
the hundreds digit represent the year)
Example: 1910 -> October 2019
CM5101 Day
Hour
4
CM5102
CM5103 Minute
Second
: :
: :
CM5126 Detailed information, piece #20*
CM5152 Hour
CM5153 Minute
: :
: :
CM5156 Detailed information, piece #20*
* The detailed information varies as shown on the next page according to the number of the error that
occurred. Please refer to the detailed information up to the number stored in Detailed information,
number of valid pieces of data.
Detailed
Description
Information, Piece n
Error details
0 (Not used.)
1 Incorrect indirect specification.
2 The indirectly specified target is T/C.
3 Incorrect simple indirect specification.
4 Outside of operand range.
5 Floating-point real number overflow.
6 Incorrect device specification.
7 The ROOT instruction operand is negative.
4 8
9
No bits set to ON with the ENCO instruction.
Floating-point real number format error.
10 Incorrect trigonometric function instruction operand.
Program Structure and Operation
• Error numbers 50, 53, 55, 56, 58, 59, and 63 (unit ID errors)
LADDER PROGRAMMING
Detailed
Description
Information, Piece n
Detailed information, Unit number (the unit number will not be stored if it cannot be determined according to the occurrence
piece 1 (CM5107) conditions of the error)
Detailed information,
pieces 2 to 20 Fixed to 00H
(CM5108 to CM5126)
Scan Time
The time required to execute one control processing sequence (automatic refreshing program
execution END processing) is called the scan time. The scan time varies according to the program
size and the type of instructions that are used.
Scan time Scan time Scan time
4
refreshing processing refreshing processing refreshing processing
If the scan time exceeds 300 ms, a scan time over error (CPU error number 30) will
Program Structure and Operation
Point
occur, and operations will stop (the mode will be switched to PRG mode).
Reference • To view the actual measured scan time, while using KV STUDIO to perform monitoring,
on the "Debug" menu, click "Scan time monitor."
• The actual measured value of scan time can be confirmed at CM1000 to 1001 (1μs
unit).
"A-2 Lists of CR and CM Devices" (page A-10)
During normal program execution, the scan time varies according to factors such as (1) the execution
status and processing details of each program and (2) interrupt processing.
By using the fixed scan time processing function, you can maintain a fixed scan time.
Not using the fixed scan time operation function (normal operation)
0.9 ms 1.1 ms 1.0 ms
The scan time varies according to the execution status of each instruction of each program.
LADDER PROGRAMMING
Example) When the value is set to 1.2 ms:
1.2 ms 1.2 ms
In one scan, after all processing is completed, operations do not proceed to the next step until the set
amount of time elapses, so it is possible to fix the scan time.
• If the scan time is longer than the set time, the scan time will be extended.
4
Point
Be sure to confirm the actual measured scan time of the target program before
Point Set a value that is larger than the actual scan time.
Reference • The actual measured value of scan time can be confirmed at CM1000 to 1001 (1μs
unit).
"A-2 Lists of CR and CM Devices" (page A-10)
• If the scan time value is exceeded, CR2304 is set to ON for one scan only.
During normal program execution, the scan time varies according to factors such as (1) the execution
status and processing details of each program and (2) interrupt processing.
If you set the END processing time, END processing is executed for a fixed length of time in each scan.
Because the maximum scan time is large regardless of whether there is a great deal of data
communications with the peripherals, use this function in situations such as when you cannot set the
fixed scan time operation.
2ms 2ms
Reference The actual measured value of END processing time can be confirmed at CM1002 to 1003
(1μs unit).
"A-2 Lists of CR and CM Devices" (page A-10)
LADDER PROGRAMMING
Program Configuration
In a single scan, program execution consists of the modules being executed in the predetermined
order, and within each module, the main routine program being executed step by step from its first step.
Module 1
Automatic refreshing
Module 2 4
END processing
Module n
In each module, you can create the main routine program, subroutine programs, and interrupt
programs.
Module
Subroutine programs
Interrupt programs
Reference Function blocks and macros can be called from within the module, but the function blocks
and macros themselves are constructed from main routine and subroutine programs.
Interrupt programs cannot be created.
"4-10 Function Blocks" (page 4-117)
"4-11 Macros" (page 4-178)
The program from the start of the program to the END instruction is called the main routine program.
If you will not write any subroutine or interrupt programs, write the ENDH instruction immediately after
the END instruction.
END
ENDH
Point If the END or ENDH instruction is not present, a conversion error will occur.
Reference The END and ENDH instructions are inserted automatically when you create a new
program, so do not delete these instructions.
Subroutine programs
Subroutine programs are programs that are executed from the main routine program by using the CALL
(call subroutine) or ECALL (call subroutine between modules) instruction. When the execution
condition of the CALL instruction turns ON, the subroutine program is executed.
If you want to perform the same processing in multiple locations of the main routine or if you want to
process a program only when the set conditions are met, you can execute the program only when
necessary by writing it as a subroutine program.
You can write up to 100 subprograms (numbered from 0 to 99) between the END and ENDH
instructions.
Each subroutine program starts with the SBN (subroutine entry) instruction and ends with the RET
(subroutine return) instruction.
In one program, you cannot give multiple subroutine programs the same number. In the main routine
program, you can make multiple CALL instructions to the same subroutine program number.
For details, see the CALL, SBN, and RET instructions in the KV-8000/7000/5000/3000/1000 Series and KV
Nano Series "Instruction Reference Manuals."
CALL #0
Main routine program
CALL #1
END
Programs
SBN #0
RET
Subroutine programs
SBN #1
RET
ENDH
LADDER PROGRAMMING
• If the SBN instruction that corresponds to the CALL instruction does not exist,
Point
a conversion error will occur.
• If the SBN instruction that corresponds to the ECALL instruction does not
exist, a conversion error or a calculation error will occur.
• The INT, RETI, STG, JMP, and ENDS instructions cannot be used in subroutine
programs.
• Be careful when you use differential execution type instructions, timer
instructions, function block instructions, and macro instructions in subroutine
programs.
For details, see "Precautions for Differential Execution Type Instruction" in the KV-8000/
7000/5000/3000/1000 Series and KV Nano Series "Instruction Reference Manuals."
"Precautions when using Timer instructions" (page 4-34)
4
"Function block instructions" (page 4-141)
• From within a subroutine program, you can use the CALL and ECALL instructions to
Reference
call up to 16 layers of other subroutine programs (nesting).
• Although a subroutine program can call itself (a recursive call), if more than 16 layers of
nesting occur during operations, a CALL nesting error (CPU error number 10) will
occur.
R001 #0
Main routine CALL
program
END
SBN
#1
Subroutine
programs RET
SBN Call
#0
Subroutine R000 #1
programs CALL
RET
ENDH
Interrupt programs
LADDER PROGRAMMING
Use the interrupt function when you are acquiring short signals, during input response, and when you
are performing highly accurate time measurements. When the interrupt conditions are met, the
processing of the main routine program is interrupted, and the interrupt program is executed
immediately. After interrupt processing is completed, the processing of the main routine program begins
again from the point where it was interrupted.
The only interrupt condition is unit interrupt.
Interrupt
4 condition met
Program Structure and Operation
Input
Interrupt program
processing
END
Module
INT #1 #1
RETI
Interrupt programs
INT #2 #4
RETI
ENDH
LADDER PROGRAMMING
Reference • There are no restrictions on the order that you write subroutines and interrupt programs.
END
Module
SBN #1
INT #1 #1
RET
RETI
Subroutine programs
Interrupt programs
4
• Interrupt programs are executed even when their modules are not being executed.
• Interrupt programs are executed regardless of the execution status of the module, so
you can make it easier to understand the project structure by managing a single stand-
by module as the one that contains all the interrupt programs.
"4-13 Interrupts" (page 4-206)
Overview
A normal ladder program that is used to control a device involves multiple processes such as
initialization, automatic operation, manual operation, and error handling. Traditionally, these multiple
processes have been managed consecutively in a single ladder program. With KV STUDIO, you can
create programs within a project for the different aspects such as processes and functions, and then
manage these programs as independent components (modules).
<Traditionally> <With KV STUDIO>
Project Project
4 [Error processing]
Modules
[Automatic operation]
[Manual operation]
[Automatic operation]
Modules
All processing is written in You can separate the ladder program into
order in a single ladder different functions and processes,
program that is like a long and manage each of them as its own
scroll. module.
Module management
In KV STUDIO, modules are managed from the workspace of each project.
You can easily reuse programs by importing programs.
Importing
programs
To display the workspace, click the corresponding item on the "View" menu. You can also use the icons
on the toolbar to show and hide this element.
You can change the display position of this element.
Reference You can also reuse modules by opening multiple instances of KV STUDIO and copying the
modules between applications.
Module features
LADDER PROGRAMMING
It's easy to understand the structure of an entire program
When you use the workspace of KV STUDIO, each module is displayed as a tree, so even individuals
who did not create the program can understand its entire structure at a glance.
Modules
Modules are
displayed as a
list.
Module E Module G
Module Type
There are "every-scan execution modules", "initialization modules", "standby modules", "fixed period
modules" and "inter-unit synchronization modules" as modules.
Use the KV STUDIO workspace to manage these different types of modules that you create. You can
also change the module type after you create modules.
4 These modules are executed from the first scan when operations start (when power is turned on and
when the mode is switched from PRG to RUN).
You can use the module instructions, module stop (MDSTOP) and module start (MDSTRT), to control
Modules
Reference • If you use a module instruction but do not control the execution status, the module will
be executed during each scan.
• When you create a new project in KV STUDIO, one every-scan execution type module
with the same name as the project will be created automatically.
Initialize module
These modules are executed only during the first scan when operations start. Use these modules to
perform initializations such as the initial processing of devices and restoring the default settings of KV-
8000 Series functions. Even if there are no initialize modules in the project, the KV-8000 Series can
operate. Create these modules as necessary.
<Traditionally> <KV STUDIO>
Initial processing 1 Initial processing module
CR2008
CR2008
. . .
CR2008: This is turned ON for only one scan when operation starts.
By registering modules as initialize modules, you can reduce the scan time by the time that is required
to process the initialize module programs because these modules will not be executed from the second
scan.
Standby module
LADDER PROGRAMMING
These modules are stopped when operations start. You can use the module instructions (MDSTRT and
MDSTOP) to control the execution status of these modules during operation.
"Module instructions" (page 4-115)
Modules
Assemble
Execution
・・
starts
R000
MDSTRT
Automatic
operation
Execution R000 MDSTOP
stops Automatic
operation
・・・
END
ENDH
You cannot operate the KV-8000 Series with only standby modules. Be sure to
Point
use these modules together with at least one every-scan execution type module
or initialize module.
Reference You can control the execution status of every-scan execution type modules in the same
way.
Reference The initial status of the differential execution instruction when the execution of a standby
module starts is ON when a rising edge is detected and OFF when a falling edge is
detected. For example, if this is turned ON from the first scan when execution starts,
rising edge differentials will not be detected.
The operation when standby modules stop executing (when an MDSTP instruction is executed) differs according
to the "Program property" -> "Perform OFF Process When Stopping Execution" setting of each program.
In the case of KV-8000A, the setting is not displayed, and the operation is the same
Point
as when "OFF processing when execution stopped" item is always checked.
4
Modules
Module A
Executing Executing Executing Executing Executing Executing
(every-scan
execution
type) Module B Module B
Execution starts Execution stops
Reference The ladder program within the module operates the same as when the execution condition of
the MC instruction is turned OFF for just one scan before operations are stopped.
For details, see the MC and MCR instructions in the KV-8000/7000/5000/3000/1000 Series and
KV Nano Series "Instruction Reference Manuals."
4-102 - KV-8000 Series User’s Manual -
4-9 Modules
Fixed-Period Module
LADDER PROGRAMMING
Routines in Fixed-Period Module can be separated from ordinary scanning and executed according to
pre-defined period. Each project can use 4 fixed period modules.
Modules
Example
CR2002
EI
Always ON
The execution cycle of fixed period modules can be set only from KV STUDIO. It
Point
can’t be changed from the ladder program.
When the "When operation begins, set to execution state" check box is selected
(default)
If EI instruction is executed, begin to execute Fixed-Period Module.
Start operation
4 cycle module
Execute E1 instruction
Modules
When the "When operation begins, set to execution state" check box is not
selected
In EI instruction execution state, the module instruction is used to control execution state of Fixed
Period Module.
For OFF processing, please see "Standby module operation" (page 4-101).
• When all of the following conditions are met, the period fluctuation is within 15 µs.
Reference
• 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
• High priority interrupt conditions have not been executed.
• Low priority interrupt conditions have not been executed beforehand (4 μs
maximum when they have been executed)
• The KV-5000/3000 Series expansion units are not used (14 μs maximum when
they have been used)
• DI instructions/DIC instructions are not being used to inhibit interrupts.
• 1 ID is not registered with a device of 513 words or more during the recording/
tracking setting.
• When fixed-period execution timing occurs in interrupt inhibited 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 "Interrupts".
4-104 - KV-8000 Series User’s Manual -
4-9 Modules
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 Z23)
• TM0 to TM3
Relay To programmed in just executed STG instruction operand
4
• Index register Z01 to Z10 can be set to execute save/reset processing in "CPU
Modules
Reference
system setting" "fixed period execution and user interrupt" settings.
The program within the inter-unit synchronous module is run in a preset cycle, separate from regular
scans. One Inter-unit Synchronous Module project can be used per project.
The value that can be configured for the cycle will differ depending on the expansion
Point
Point unit performing the inter-unit synchronization. Please check the manual for each
expansion unit.
CR2002
EI
Always ON
The priority should be configured from [Fixed cycle operation and user interruption setting] in [Program
settings] after opening “CPU system settings” from the《KV STUDIO》workspace.
LADDER PROGRAMMING
If "Be in a performing state when starting operation" is checked (default)
If an EI command is performed, operation of the inter-unit synchronous module will begin.
Start operation
Execute EI instruction 4
Inter-unit
Modules
synchronization module
Inter-unit
synchronization module
The performance cycle will be counted from when operation begins, regardless of the
Point
Point performance state or the inter-unit synchronous module.In case of executing EI
command while driving in inter-unit synchronization module mode, it might performed
immediately after EI command execution without waiting for the cycle of inter-unit
synchronization execution.
• If all the conditions below are to be met, the variation between cycles will be within 15μs.
Reference • If “Authorize interruption while performing a command” is being checked with the〔Fixed
cycle performance and user interruption settings〕of the〔CPU settings〕
• A user interruption with a higher priority than the inter-unit synchronous module is not
being used
• A factor with a high interruption priority is not being performed
• A factor with a low interruption priority is not being performed immediately before (4μs at
most will be added when being performed)
• An expansion unit for the KV-5000/3000 series is not being used (14μs at most will be
added when being performed)
• A command from DI command/DIC command is not being prohibited
• If the inter-unit synchronizing execution timing has come while it is in interruption disable
mode (DI command execution), the inter-unit synchronization module execution will be
started immediately after turns to interruption enabled mode (EI command execution).
The inter-unit synchronous module should be run as an interruption process, separate from regular
scans. See "4-13 Interrupts" for further details on the interruption process.
Saving/restoring of the items below will be conducted automatically when beginning/finishing the inter-
unit synchronous module performance, in the same way as a regular interruption process.
• Internal register
• Operation flag (CR2009-CR2012)
• Index register (Z11-Z23)
• TM0-TM3
• Relay stated in the operand of the STG command performed directly before
4 Reference
The index register Z01-Z10 can be configured to conduct a saving/restoring process
with "Fixed cycle performance and user interruption settings" "CPU system settings".
Modules
LADDER PROGRAMMING
Module Execution Sequence
You can set the execution sequence within a scan of the modules registered in a project.
Normally, this is the order in which the modules are created. Only when the execution sequence within
a scan of the ladder programs has an effect on operations should you change the sequence.
From the workspace, open the "CPU system setting" dialog box, and then click "Program setting" and
then "Execute sequence of modules."
Order
1 PosInit
Module Name Module Type
Initialize Range within which
4
the order can be changed
Modules
2 HSPInit Initialize
The following rules apply to setting the execution sequence of modules within a scan.
• You can change the order of initialize modules, but you cannot switch the order of initialize modules
with those of other types of modules.
• You can change the order of every-scan execution type and standby modules, but you cannot move
these modules ahead of the initialize modules in the sequence.
[Legend]
4
Modules
Configuration by functions
Modules are created according to process details, connected devices, and expansion units.
Use the every-scan execution type and standby modules differently depending on the execution
conditions when operations start.
Stopping the unnecessary modules makes debugging easier and reduces scan time.
Module control*
* The execution status of each function is controlled by the "Project" module. Create the "Project" module if
necessary.
4-110 - KV-8000 Series User’s Manual -
4-9 Modules
Configuration by processes
LADDER PROGRAMMING
Modules are created according to processes and operations.
In this example, the modules to be executed when operations start are created as every-scan
execution type modules and all other modules are created as standby modules.
Process 1
4
Modules
Process 2
※
Error
Process 3
surveillance*
Process 5
Reference Because the module execution sequence is the execution sequence within a scan, there
is also no need to consider the module execution sequence when creating programs by
processes.
When you create a new project, one every-scan execution type module with the name "Main" is created
automatically, so you can create programs without considering modules.
4
Modules
LADDER PROGRAMMING
Module System Devices
A module system device is a device that is used to capture the operation status of a module.
Only the bit that is turned ON during execution can be referenced by other programs.
Reference KV STUDIO automatically assigns module system devices to the CPU unit work area. 4
Modules
Bit that is turned ON for only one scan when module execution starts,
"@CR2008"
This bit is turned ON for only the first scan after module execution starts.
From the second scan, it is turned OFF.
This bit can only be referenced from its own module. It cannot be referenced from the macros executed
in its own module.
In KV STUDIO, this device is represented by "@CR2008."
Bit that is turned OFF for only one scan when module execution starts,
"@CR2007"
This bit is turned OFF for only the first scan after module execution starts.
From the second scan, it is turned ON.
This bit can only be referenced from its own module. It cannot be referenced from the macros executed
in its own module.
In KV STUDIO, this device is represented by "@CR2007."
Example
_AutoExec _main
Module Passwords
Module passwords
You can limit who can display modules in KV STUDIO by setting passwords on the modules.
Follow the procedure below to set a password.
Alternative procedure ・ Select the module in the workspace, and select "Program" -> "Properties" from the
menu.
・ Select and right click the module in the workspace and select "Setup password"
from the menu.
4 Enter the password in both text boxes (the second is for confirmation), and then click "OK."
After you set the password, when an attempt is made to display the module in KV STUDIO, a dialog
box will be displayed asking the user to enter the password.
If the user does not enter the password, they will not be able to display the module in KV STUDIO.
M
Module instructions
LADDER PROGRAMMING
MDSTRT MDSTRT Module execution
start
Starts the execution of the
specified module
Modules
Operation Explanation Occupied size
S Specifies the module name.* 1 —
*1 Use of " ", # , $ is not allowed. Directly enter the name of the module set on KV STUDIO.
The number of characters that can be entered is as follows.
• KV-8000(A)、KV-7000 (CPU function version 2.0 or later)
Up to 64 characters regardless of half-width or full-width
• KV-7000 (CPU function version lower than 2.0)
Up to 24 characters regardless of half-width or full-width
• KV-5500/5000/3000/1000、KV Nano Series
Up to 24 half-width alphanumerics, or up to 12 full-width alphanumerics
Operation Description
MDSTRT When the execution condition is ON, the module specified by S is started.
The specified module starts operating from the next scan.
Nothing happens on modules that are already started up.
MDSTOP When the execution condition is ON, the module specified by S is started.
Nothing happens on modules that are already stopped.
This instruction can also stop the self-module.
The OFF process when stopped differs according to the CPU unit. Refer to the instruction manual
foreach CPU unit for details.
Operation flags
LADDER PROGRAMMING
Sample Program
4
When the rising edge of input relay R000 is detected, the module currently selected by mode switching
Modules
(R001 to R003) is executed, and execution of all modules is stopped when input relay R009 turns ON.
During execution of one of the modules, execution of other modules cannot be started.
For details on the module execution ON bit, see "Modules" in the "Module System Devices" (page 4-
113).
LADDER PROGRAMMING
Overview
Function blocks are circuit blocks used repeatedly in a project that are registered as one component
under a name of your choosing. By creating function blocks, you can use the sections of ladder
programs in the same way that ladder instructions are used, which enables you to reduce the amount
of time you spend writing programs. When you make changes to the program, just by modifying the
data in the location that is registered as a function block, all the process details executed when the
corresponding function block is called in the project are changed. This reduces the amount of time that
you spend changing programs and also prevents mistakes that occur during program modifications.
<Before the introduction of function block> <After the introduction of function block>
4
Function Blocks
Project 1 Project 1
[ModuleA] [ModuleA]
Function blockC
[ModuleB]
Function
block call
[ModuleB]
Function blockC
of instructions in the function block (devices and values) at the time that the function block is called.
Furthermore, arguments can be set to any name, so the contents of the argument are easy to see and
the readability of the program can be improved.
[Reference] For the differences between function block and macro, see "Differences
Reference
between Function Blocks and Macros" (page 4-175).
LADDER PROGRAMMING
Usage Procedure
Function Blocks
(2) Set the arguments.
Set arguments for the function block.
"Setting Arguments" (page 4-131)
There are two types of function blocks: “function blocks” and “functions”.
Function blocks
Overview
4 The function block executes the program in the function block when the execution condition is ON.
There are three instructions for executing function blocks, which have the following characteristics.
Function Blocks
FBCALL FBSTRT FB
Item
Function block call Function block start Function block call
Start method Execution condition of the function block ON
• Stop the program (module, function block, etc.) that executes the function block
• The execution condition of the MC instruction is turned OFF when executed between
Stop method the MC and MCR instructions
• FBCALL instruction is
• The FEND instruction is executed in the function block
turned OFF
Specify by
instance name 〇 〇 -
• When the function block is started from the program written between END and ENDH
Point
of the module, it does not stop even if the module is stopped.
• If the execution condition of the MC instruction is turned OFF when executed
between the MC and MCR instructions, the execution result will not be reflected in
the argument of argument type OUT.
• The FBCALL/FBSTRT instruction can be used only with KV-8000 with CPU function
version 2.0 or later. When programming with KV-8000 with CPU function version 2.0
or later, it is recommended to execute the function block using the FBCALL/FBSTRT
instruction.
• If the instance name is specified in ST language and executed, it can be stopped by
turning off the execution condition.
How to use
Configured in a ladder program for use.
LADDER PROGRAMMING
When a function block is configured, the function block type variable is registered. When a function
block type variable is registered, an instance for entity execution will be generated. When variables are
registered with different names for the same function block, different instances will be generated
accordingly and different memory areas will be occupied. When a function block is executed by
specifying an instance, the FBCALL/FBSTRT instruction should be used.
4
Variable name Data type in the program for Instance B
memory
execution
area Function block A
Instance B Function block A Instance B area
Function Blocks
Instance C Function block A Instance C area
Instance C
Function block A
• Instance can be specified only when executing a function block with the FBCALL/
Point
FBSTRT instruction. No instance can be specified in case of the FB instruction, and
an entity is always generated by the number of calls.
• The same instance can be specified for multiple times in the same program.
• When using the FBCALL/FBSTRT instruction, the KV-8000 CPU function version
should be upgraded to 2.0 or below using KV STUDIO Ver.11.0 or later.
When an instance of the function block is generated, the function block arguments of the specified
instance can be referenced from outside the program in the function block. Argument name" is written
for referencing.
For example, when the function block is called by specifying an instance as shown below, the value of
the OUT argument "Area" of the instance Triangle1 can be referenced from outside the function block
by writing "Triangle1.Area".
Triangle1
CalcArea
EN ENO
DM4
Value can be referenced with
DM0 Base Area
"Triangle1.Area"
DM2 Height
However, the following restrictions exist depending on the setting of the argument type.
Enable input and enable output refer to the function block symbols "EN" and "ENO".
Instance B
inside of the function block. It can be used by writing "EN" in the program inside the
EN
function block. However, values cannot be referenced or changed by writing "Instance
name.EN" from outside the program in the function block.
It is always ON during execution of the function block, and is OFF when execution of the
function block is stopped. However, when a value is written by the program inside the
ENO
function block, the written value will be reflected. Values can also be referenced by writing
"Instance name.ENO" from outside the program in the function block.
The following shows the operation diagram of EN and ENO when a function block is executed.
ENO
Instance B.ENO
Always ON during execution of the function block. When ENO is written for use in
writing ENO in the function block as shown on the right, the the function block.
state of ENO in the function block can be reflected.
• When the ENO value in the function block is referenced with "Instance name.ENO", it
Point
is necessary with the FBCALL/FBSTRT instruction. The FB instruction does not
support EN/ENO.
• When using the FBCALL/FBSTRT instruction, the KV-8000 CPU function version
should be upgraded to 2.0 or higher using KV STUDIO Ver.11.0 or later.
• EN/ENO need not be set as an argument, and will not be counted as the number of
arguments.
Operation description
LADDER PROGRAMMING
An explanation of the function blocks is shown in the following figure.
Here is an example of specifying and executing Instance B of Function Block A and Instance D of
Function Block C.
For details on instances, refer to "Function block instance" (page 4-121).
ON Instance B
as different devices for different instances.
4
Function block A
Function Blocks
Instance B
Instance D
ON
Function block C
Instance D
2 The execution conditions and operation states are as follows depending on the instruction that
starts the function block.
Instance B
OFF
Function block A
Instance B
Instance D
OFF Function block C
Instance D
Stop conditions
LADDER PROGRAMMING
Instance B
OFF
Function block A
Instance B
Instance D
・ When a function block is executed with the FB/FBSTRT instruction, the FEND
Point instruction should be executed with the execution condition of the function block
set to OFF. When the FEND instruction is executed while the execution condition of
the function block is ON, the function block will not stop.
・ If you execute a function block with an instance name from the FBCALL instruction
or ST language, turn off the execution condition of the function block and stop the
function block.
・ When using function block instances with array types, only the instance specified
with the subscript can be executed/stopped by the execution condition turning ON/
OFF.
If the subscript specifies something other than a constant, note that changing this
subscript before execution/stopping will lead to the instance specified with the
subscript prior to the change not being executed/stopped.
LADDER PROGRAMMING
The operation when stopped of the function block differs according to the "Program property" ->
"Perform OFF Process When Stopping Execution" setting.
In the case of KV-8000A, the setting is not displayed, and the operation is the same
Point
as when "OFF processing when execution stopped" item is always checked.
Function Blocks
If "Perform OFF Process When Stopping Execution" is not checked
The function block stops at the following timing.
・Next scan after the FEND instruction is executed in the function block (For FB/FBSTRT instruction)
・When the execution condition of the function block is turned OFF (For FBCALL instruction)
If the function block is described in END to ENDH, the execution of the function
Point
block will not stop even if the destination module is stopped. "Function block
instructions" (Page 141)
Function block A
execution conditions OFF ON *1 *1 OFF*2 OFF*3
Execution condition of
4 the FEND instruction
within Function block A
- OFF OFF ON *1 -
Function Blocks
Function block A
execution conditions OFF ON ON OFF OFF*1
*1: If this has been turned ON, the function block will start executing.
Off processing when function block execution stops performs the same processing as when
Reference the MC instruction execution condition is OFF, for one scan only.
For details, see the MC and MCR instructions in the KV-8000/7000/5000/3000/1000 Series and
KV Nano Series Instruction Reference Manuals.
LADDER PROGRAMMING
The storage of values for function block arguments differs according to the "Program property" ->
"Automatically Convert Types When Passing Arguments by Value" setting of each program.
• When using the Logix format, the "Automatically perform type conversion when
Point passing arguments by value" check box is selected by default.
Otherwise, it is cleared by default.
• The "Automatically perform type conversion when passing arguments by value"
setting is only possible on KV-8000 Series units with CPU function version 2.3 or
later.
Function Blocks
When the "Automatically perform type conversion when passing arguments by value" check box is
cleared
When storing values from operands to IN arguments or from OUT arguments to operands, binary
values are stored with no type conversion.
Function block
When the "Automatically perform type conversion when passing arguments by value" check box is
selected
Before values are stored from operands to IN arguments, type conversion is performed to match the IN
argument data type.
Before values are stored from OUT arguments to operands, type conversion is performed to match the
operand data type.
Function block
• When the "Automatically perform type conversion when passing arguments by value"
Point check box is selected, only variables and IN/OUT/IN-OUT function block arguments can
be specified for operands. Devices and unit function block arguments cannot be
specified.
• When the "Automatically perform type conversion when passing arguments by value"
check box is selected, indirect references and index modified variables cannot be
specified for operands.
- KV-8000 Series User’s Manual - 4-127
4-10 Function Blocks
Functions
LADDER PROGRAMMING
Overview
Functions operate like subroutine programs, and execute the program in the function only when the
execution condition is ON. After being executed, the execution proceeds to the next step. If the execution
condition is OFF, the program in the function is not executed, and execution proceeds to the next step.
Usage method
Function blocks are placed in the ladder program and used.
4
MR0
Function Blocks
Function A
Operation description
An explanation of the functions is shown in the following figure.
In this example, function block A is called twice from within module 1.
When the execution condition is ON, execution leaves module 1 and the ladder program in function A is executed.
After being executed, the execution returns to module 1 and proceeds to the next step.
If the execution condition is OFF, function A is not executed, and execution proceeds to the next step.
.
Module1
The function generates one object (function A) that
is the same regardless of how many times it is
called. Local variables/local devices used in the
function operate as the same device each time,
ON even if they are called from different locations.
Function A
Function A
ON
Function A
OFF
Function A
• Local variables/local devices used in the function are shared. Take care when
Point
they are executed multiple times in the same scan, or if a function is executed
using an interrupt program.
• When monitoring, the value of local devices used in the function display the
result of the last time they were executed in the same scan.
• Functions do not create instances.
4-128 - KV-8000 Series User’s Manual -
4-10 Function Blocks
LADDER PROGRAMMING
The arguments EN and ENO can be used program in the function in addition to the set arguments.
Argument
Content
type
The ON/OFF status of the function execution condition is transferred to the inside of the
EN function. It can be used by writing "EN" in the program inside the function block. The status
of "EN" cannot be referenced directly from outside the program in the function.
It is always ON during execution of the function, and is OFF when execution of the function
is stopped. However, when a value is written the program in the function, the written value
ENO will be reflected.
The value of "ENO" stored in the previous function can be referenced by writing
4
Function Blocks
"_FUN_ENO" outside the program in the function.
The following is the operation diagram of EN, ENO and _FUN_ENO when the function is executed. In
the following example, Function A and Function B can be executed, but since ENO in Function B is
OFF, _FUN_ENO as the execution condition of Function C also remains OFF, and Function C cannot
be executed. In this way, it can be used during branch processing with the internal state of the previous
function.
ON Function A Function A
EN
ENO
_FUN_ENO Function B
Function B
EN
The ENO status of the previous function is ENO is written for use in the
reflected. function block.
• When the ENO value in the previous function is referenced with "_FUN_ENO", the
Point
KV-8000 CPU function version should be upgraded to 2.0 or later using KV STUDIO
Ver.11.0 or later.
• EN/ENO need not be set as an argument, and will not be counted as the number of
arguments.
The function return value is an argument with the same name as the function that can be used in the
program inside the function. The return value can be referenced from a program outside the function.
Since the FUN function is used in the script to directly process the function return value, it is not
necessary to set an argument for storing the calculation result inside the function.
The following is the ST and KV script for storing the return value of Function1 in DM100.
ST program DM100: = Function1 (DM0, DM1);
For example, if the program in Function1 is a program that calculates the area of a triangle with the first
argument as the base and the second argument as the height, the calculation result of the area of the
triangle is stored in DM100 by writing as above.
LADDER PROGRAMMING
Setting Arguments
Function Blocks
Module1
Instance B
Function block A
EN ENO Call
R001 Argument 1 Argument 3 DM0
#50 Argument 2
Instance B
Argument 1 MOV
Argument 2 Argument 3
Devices and values specified when
a function block is called are passed
to the argument, and the argument
is used in the ladder program in the
R001 MOV
function block, and executed. #50 DM0
Setting method
Arguments are set in the argument setting area displayed in the top of the function block ladder edit
window.
Alternatively, set them by right clicking the function block in the workspace, and selecting "Argument
settings (Z)", and setting them in the "Set function block arguments" dialog box.
Alternative procedure Select the function block in the workspace, and select "Program (M)" -> "Argument
settings (Z)" from the menu.
Argument names
LADDER PROGRAMMING
4 Argument types
There are 4 types of argument: IN, OUT, IN-OUT, and Unit. The specifications for each type are shown below.
Function Blocks
Up to 64 arguments can be set in total. Up to 32 IN, OUT, and IN-OUT arguments can be set each, and
up to 8 Unit arguments can be set.
Indirect Index
Argument Display
Argument name Description *1
Specification Modification
type position
(*) (:)
*1 The position in which it is displayed above the function block symbol differs depending on the argument type.
For IN-OUT arguments, the same input/output device is displayed on both the left and right, and can be
edited from either.
*2 Specify only the target unit number in function block inputs/outputs.
Up to 8 units can be specified as arguments in one function block.
*3 When the data type is array / structure, index modification cannot be performed.
When using variable-length strings and arrays as arguments, the argument type should be
Reference
set to IN-OUT.
4-132 - KV-8000 Series User’s Manual -
4-10 Function Blocks
LADDER PROGRAMMING
Set the data type of the argument. The data types that can be set differ depending on the argument type.
• For IN, OUT and IN-OUT arguments
Set the data type of the argument. The data types that can be set differ depending on the argument type.
Function Blocks
advance. When set to IN-OUT, the maximum number of characters and the number of elements can be
set to variable. However, if a STRING type array is set to IN-OUT, the number of elements can be set to
variable but the maximum number of characters cannot.
For an argument with a large number of characters or array elements, it takes a long time to copy after
setting it to IN/OUT, so it is recommended to set it to IN-OUT.
• For Unit arguments
Sets the unit type. You can select from the units placed in the unit editor.
Initial value
An initial value can be set for IN, OUT arguments. An initial value cannot be set for IN-OUT arguments.
When an initial value is set, and the argument value is omitted, the initial value is used when executing
the function block.
• Arguments will be initialized in the following cases in KV-8000 with CPU function
Point
version 2.0 or later.
• When the program is transferred after the function block definition is changed
for arguments with Hold set
• When arguments without Hold set are switched from PROGRAM mode to RUN mode
However, the arguments of the function block executed by the FB instruction are
initialized when switching from PROGRAM mode to RUN mode, even if Hold is set.
Initialization is not performed when the function block starts and stops.
• The arguments are also initialized when starting and stopping function blocks in KV-
8000 with CPU function version 1.0.
Hold
Hold can be set when the argument type is IN or OUT.
When "Hold" is checked, the value of the argument will be held even when the power is turned off.
• When using the FB instruction without specifying the instance name, the value will
Point
not be held. To hold, use the FBCALL or FBSRT instruction to specify the instance
name and execute it.
• When Hold is set for arguments, KV-8000 CPU function version should be upgraded
to 2.0 or later using KV STUDIO Ver.11.0 or later.
Private
LADDER PROGRAMMING
4 Comments
Explanatory comments that are displayed below the argument name can be set as necessary.
Function Blocks
• Configure the comment section (below the function block name) in program
Point properties.
• When the CPU function version is lower than 2.0, an argument uses a local work
area of the following size.
• When the argument type is IN or OUT
The size is 4 words when the display format is LREAL(double-precision floating
point type), and 2 words otherwise
• The size is 2 words when the argument type is IN-OUT
• The size is 6 words when the argument type is unit
• For CPU function version 2.0 or later, an argument will use the following local work
area sizes.
• When the argument type is IN or OUT
When the data type is structure, array or string, the data size is rounded up to an
even number of words, LREAL type is 4 words, and other data types are 2 words
• The size is 4 words when the argument type is IN-OUT
• The size is 6 words when the argument type is unit
• If the same "function" is executed in a main routine program and interrupt program
simultaneously, the argument value is saved/restored when the interrupt program is
executed.
• If the total number of local work words used by saved/restored arguments
exceeds 6912 words, a calculation error [Ladder stack overflow] occurs.
• When the argument setting of the function block is different from the data type of the
variable specified in the argument, the operation is as follows depending on the
argument setting.
• IN argument, OUT argument
Structure and array :A conversion error occurs when
(Specified number of elements) data types / numbers of elements
are different
String :A conversion error occurs when
(Specified maximum number of characters) data types are different
Other data types :A warning occurs during
conversion when data types are
different
• IN-OUT argument
Structure and array :A conversion error occurs when
(Specified number of elements) data types or numbers of elements
are different
Array :A conversion error occurs when
(Variable number of elements) data types are different
String :A conversion error occurs when
(Specified maximum number of characters) data types or maximum numbers
of characters are different
Other data types :A warning occurs during
conversion when data types are
different
• Arguments set in IN and OUT are copied to the work area. Therefore, if the size of
an argument is large, it is recommended to set the IN-OUT argument, which does
not require copying time and consumes less work area.
4-134 - KV-8000 Series User’s Manual -
4-10 Function Blocks
LADDER PROGRAMMING
Placing Function Blocks
1 Drag the function block in the workspace and drop it in the ladder edit area.
The dialog for entering the variable name will be automatically displayed. Enter the variable name
(instance name) and click "Overwrite".
* When a function block is configured by drag and drop, the FBCALL instruction is used (The function
block stops when its execution condition is turned OFF).
Function Blocks
Other Enter "FBSTRT" or "FBCALL" with the keyboard.
Press the space key to select a function block name from the candidates or enter it directly.
Press the space key again and enter the instance name. If the instance has been created
beforehand,it will be displayed as a candidate.
2 Specify the device to assign in the "Change operand" dialog box, and click the "Overwrite"
LADDER PROGRAMMING
button.
Function block
4
Function Blocks
Alternative procedure You can enter an argument directly in the direct entry dialog box.
LADDER PROGRAMMING
Function block usage example
The following is an example of how function block arguments are used in the ladder program.
The example shows function block B being executed from module A.
Argument usage example
No. Argument types Argument name/device
1 IN Input 1
2 OUT Output 2
3
4
IN-OUT
Unit Device
Input/output 3
UR/UM/UV0
4
Function Blocks
Unit number 1 ... KV-SAD04 R30000∼R30115
DM10000∼DM10059
Module A
instance C
Function block B
R100
EN ENO
#1 UnitNo
UR0:#2 MOV
UM0:#4 Output 2
Input/output 3 → MR000
R30002 DM10004 DM0 UR/UM0 →(KV-SAD04)
Applies value
Input/output 3
RES
MR000
END
ENDH
Output processing
To use unit device UR0 / UM0, specify the device number using indirect reference.
Reference
Example) To specify R36604 when the unit's leading relay number is R30000
R36604 = R30000 + 66ch (=66 × 16 = 1056) + 4
= R30000 + 1060
= UR0:#1060
- KV-8000 Series User’s Manual - 4-137
4-10 Function Blocks
LADDER PROGRAMMING
Function blocks can be executed even if the parameter values used and output devices are not set. You
can create function blocks so detailed settings are provided, and use typical values to use them easily, etc.
Function blocks can be used for IN or OUT type arguments without specifying input / output device.
• For KV-8000 with CPU function version 1.0, when the argument type is IN, it can
4 Point
be omitted only when the initial value is set.
• For KV-8000 with CPU function version 1.0, all arguments that are not omitted
Function Blocks
must be listed with smaller No. than the omitted arguments (arguments of the
middle No. cannot be omitted).
If IN arguments are abbreviated, when function block execution starts the value set as the initial value is
automatically stored in the argument, and they are executed according to the initial value. "Initial
value" (page 4-133)
If OUT arguments are abbreviated, the argument value is not output when function block execution ends.
Input1, Input2, Output1 arguments can be omitted for the following function block.
IN argument
OUT argument
"???" is written to omit the argument during direct input. The following is an example of omitting the
No.3 and No.4 arguments.
• Only KV-8000 with CPU function version 2.0 or later can enter "???" and omit the
Point
middle argument.
• When an argument is omitted with "???", enter all ? in half-width characters without
spaces.
LADDER PROGRAMMING
Argument Privacy Settings
In function blocks some of the arguments can be set as private. Function blocks with multiple
adjustment parameters provided so they can be used even when carrying out complicated control can
be created, and they can be made available with the setting parameters hidden so they can be used
easily by the person in charge.
"Private" (page 4-134)
Usage example 4
This example sets Input 2 (No. 5) to private.
Function Blocks
Click the "Private Argument
Password Setting" button
Reference • The "Detail (D)" checkbox only appears when an argument is set to private.
• If the input device for arguments set to private is not edited (is omitted), the initial
value is used.
Other function blocks can be called from function blocks. (Function block nests)
Function blocks where nesting is possible differ according to the program type (function block/function)
as shown below.
4 Function block
Function
Yes
No
Yes
Yes
Function Blocks
Module 1
Call
Function block 1
Function block 1
Call
Function block 2
Function block 2
Function block 3
Call
Function block 3
8 layers maximum
• The same function block as the function block used to call cannot be nested.
Point
• If the program type is function block, a separate object is created each time it is
Instance.
When using nesting, pay attention to the volume of the program/local device.
If the program type is function, only one object is generated regardless of the
number of times it is called, so the volume of the program/local device does not
increase even if nesting is used.
"Function Block Type" (page 4-120)
• Programs with more than 8 layers of nests cause a conversion error during
conversion in KV STUDIO.
• When a program is transferred with a matching discrepancy, and the nest is
more than 8 layers when executed, CPU error E33 "Program Exceeds Nesting
Limit" occurs and operation stops.
LADDER PROGRAMMING
Setting a Function Block Password
Passwords can be set to function blocks so the program display is limited in KV STUDIO.
Follow the procedure below to set a password.
Function Blocks
• Select and right click the function block in the workspace and select "Setup
Password" from the menu.
4 Enter the password in both text boxes (the second is for confirmation), and then click "OK."
After you set the password, when an attempt is made to display the function block in KV STUDIO, a
dialog box will be displayed asking the user to enter the password.
If the user does not enter the password, they will not be able to display the function block in KV
STUDIO.
Function blocks can be set to read only so program editing is limited in KV STUDIO.
Follow the procedure below to set the function block to read only.
• Select and right click the function block in the workspace and select "Setup
Password" from the menu.
Status Description
The program can be edited.
The program cannot be edited.
The program can be edited. If the project is reopened, the program becomes
uneditable again.
Use this to temporarily enable editing.
LADDER PROGRAMMING
Function Block System Devices
A function block system device is a device that is used to capture the operation status of a function
block.
Point You cannot attach device comments to function block system devices.
Reference KV STUDIO automatically assigns function block system devices to the CPU unit internal
work area. 4
Function Blocks
Bit that is turned ON for only one scan when function block execution starts,
"@CR2008"
This bit is turned ON for only the first scan after function block execution starts.
From the second scan, it is turned OFF.
This bit can only be referenced from its own function block. It cannot be referenced from the program
that called this macro.
In KV STUDIO, this device is represented by "@CR2008."
Bit that is turned OFF for only one scan when function block execution starts,
"@CR2007"
This bit is turned OFF for only the first scan after function block execution starts.
From the second scan, it is turned ON.
This bit can only be referenced from its own function block. It cannot be referenced from the program
that called this macro.
In KV STUDIO, this device is represented by "@CR2007."
System devices such as @CR2008 can be used in function blocks, but not in
Point
functions.
1 Select the function block to set program properties for in the workspace.
Disable program
Check this box to disable the function block. Function blocks can also be disabled by right clicking and
selecting "Disable/Enable".
Read Only
Check this box to set the function block to read only.
"Setting Function Blocks to Read Only" (page 4-142)
Comment
LADDER PROGRAMMING
Sets function block comments. If a comment is set it is displayed beneath the function block name.
Comments can be up to 256 characters long.
Function Blocks
Specialized system function blocks designed for the uses of the unit are provided for some units.
2 Drag the system function block and drop it in the ladder edit area.
A function call instruction that calls the selected system function block is placed.
The selected system function block is also added to the project at the same time.
4
Function Blocks
Reference Refer to the user manual for each unit for information about the system function block
function.
LADDER PROGRAMMING
Register a function block library
You can register the created function block in the library to divert it as materials. Since the function
block registered in the library is registered beforehand as a user function block when creating a new
project, you can save the trouble of importing the function block each time you create a project.
Function Blocks
Point KV STUDIO Ver.9.10 or later can register the function block in the library.
FB Function block
call
Calls the specified function
block.
Stops execution of the function
FEND FEND Function block
end
block. (Written in the function
block)
4 Ladder program
Execution condition
Entry mode
※1
S
F B 〔
S Argument 1 Argument 2 …〕
Function Blocks
Input1 Output1
※1
InOut1 InOut1
UnitNo
Execution condition ※1
S
Input1 Output1
F U N 〔
S Argument 1 Argument 2 …〕
※1
InOut1 InOut1
UnitNo
*1 The number of operands other than the function block / function name and the data that can be specified
differ as follows depending on the argument settings set in the function block / function to be executed.
• IN : Devices, variables, labels and constants can be specified.
• OUT : Devices, variables and labels can be specified. Constants cannot be specified.
• IN-OUT : Devices, variables and labels can be specified. Constants cannot be specified.
• Unit : Devices, variables, labels and constants can be specified.
*2 Handling of T, C, TIMER type variables and COUNTER type variables specified for the IN-OUT
argument differs depending on the instruction used in the function block / function.
Example) For the MOV instruction, the current value is handled. For details, refer to the operation
description of the respective instruction.
*3 "", # and $ cannot be used. Directly enter the name of the function block/function set in KV
STUDIO. Up to 64 characters can be entered regardless of full-width or half-width.
The FB instruction, FEND instruction and FUN instruction can be used with the
Point
KV-8000 series CPU units and KV-7000 Series CPU units with CPU function version
2.0 or later.
"KV-8000(A) Series CPU Function Version" (Page 2)
LADDER PROGRAMMING
Description of Operation
FB The function block specified by S starts up when the execution condition is ON.
Execution of the specified function block is started from the scan where the execution
condition changes from OFF to ON.
Once execution starts, the function block continues to be executed even if the
execution condition is OFF.
FEND Function blocks with a FEND instruction written to them stop when the execution
condition is ON.
FUN The function specified by S is executed when the execution condition is ON. 4
The OFF process when stopped differs according to the program settings. Refer to the instruction
Function Blocks
manual for the CPU unit for details.
Point
• Writing in RUN mode is not possible if the number or sequence of calls of the FB
instruction is changed.
• Function block stops in the following cases.
• When the read source program stops
• When a FEND instruction is executed in a function block
• If the FBCALL/FBSTRT/FB instruction execution condition stays ON, the FEND
instruction is ignored.
• The FEND instruction cannot be written in the module or function.
• The FEND instruction cannot be used to stop other function blocks.
• The previous state of differential execution type instructions in function blocks is
initialized every time the execution of the function block is started. (rising edge
differentiation: ON, falling edge differentiation: OFF)
• Differential execution type instructions and timer instructions cannot be used in
functions.
• In the following cases the function block/function being executed stops when each
module/function block stops or when the execution condition for each set of
instructions turns OFF.
• When an FBCALL/FBSTRT/FB/FUN instruction is written to a module/function block
• When an FBCALL/FBSTRT/FB/FUN instruction is written to master control
(between the MC~MCR instructions)
• When an FUN instruction is written to stage (in the STG - JMP instructions)
• In the following cases the function block/function being executed is canceled when the
execution condition for each set of instructions turns OFF. The function block execution
resumes when each set of instructions is executed. The previous state of differential
execution type instructions in function blocks is not initialized at this time. (If it is
written in the initialization module only, 1 scan is executed when operation starts.)
• When an FBCALL/FBSTRT/FB/FUN instruction is written to sub-routine
(between the SBN~RET instructions)
• When an FBCALL/FBSTRT/FB/FUN instruction is written to conditional branch
(between the CJ/NCJ~LABEL instructions)
• When an FBCALL/FBSTRT/FB/FUN instruction is written to step (between the
STP~STE instructions)
• When an FBCALL/FBSTRT/FB/FUN instruction is written to interrupt (between
the INT~RETI instructions)
• When an FBCALL/FBSTRT/FB instruction is written to stage (between the
STG~JMP instructions)
• FB instructions cannot be used in functions.
• FB/FUN instructions cannot be used in macros.
• FBCALL/FBSTRT/FB/FUN instructions that call the function block/function itself
cannot be used in that function block/function.
• Sub-routine programs can be used in function blocks/functions, but interrupt
programs cannot be used.
• When performing a certain function block/function multiple times in a project, the
global devices / global variables / global labels used for the OUT/OUB instruction
in a function block/function will become double coil.
- KV-8000 Series User’s Manual - 4-149
4-10 Function Blocks
Operation flag
LADDER PROGRAMMING
CR2009 The state depends on the processing result in the function block/function to execute.
CR2010 The state depends on the processing result in the function block/function to execute.
CR2011 The state depends on the processing result in the function block/function to execute.
ON in the following cases. Otherwise, OFF.
• When the indirect specification or index modification range is inappropriate
• When the unit specified in the "Unit" argument type is not connected
CR2012
• When the unit specified in the "Unit" argument type and the unit specified in the argument
4 settings differ
• When an access outside the operand range occurs
Function Blocks
Point
The state of the operation flag cannot be changed by the FEND instruction.
Sample Program
Function block "Function block A" execution starts with variable 1 (unit number) as #1 and variable 2 as
DM0 at the rising edge of input relay R000.
Function block "Function block A" stops when input relay R001 is ON.
(Mnemonics list)
Function block A
・・・・
LD R001
FEND
R001 FEND
・・・・
Function "Function B" is executed with variable 1 as EM0 and variable 2 as MR000 when input relay
R002 is on.
R002 Function_B
(Mnemonics list)
LADDER PROGRAMMING
FBCALL Instance type
function block start
Calls the specified function block
and executes the instance.
EN EN0 F B C A L L S1 〔
S2 Argument 1 Argument 2 …〕
4
Input1 InOut1
InOut1 Output1
UnitNo
Function Blocks
S2
Execution condition S1 *1
EN
Input1
EN0
InOut1
F B S T R T S1 〔
S2 Argument 1 Argument 2 …〕
InOut1 Output1
UnitNo
The FBCALL instruction and FBSTRT instruction can be used with KV-8000 series CPU
Point
units with CPU function version 2.0 or later.
"KV-8000(A) Series CPU Function Version" (Page 2)
Description of Operation
FBCALL When the execution condition is ON, the function block specified by S1 is activated and
the instance specified by S2 is executed.
The specified function block is executed when the scan is turned from OFF to ON.
Once started, the execution of the function block continues while the execution condition is
ON.
When the execution condition turns OFF, the execution of the function block stops.
FBSTRT When the execution condition is ON, the function block specified by S1 is activated and
the instance specified by S2 is executed.
The specified function block is executed when the scan is turned from OFF to ON.
Once started, the execution of the function block continues even if the execution condition is
OFF.
When the function block is stopped, the FEND instruction is executed in the function block.
The operation of the OFF process at stop varies depending on the program settings.
「"Operations when stops" (page 4-125)
• The previous state of the differential execution type instruction in the function block
is initialized each time the execution of the function block starts. (Rising edge
differential: ON, falling edge differential: OFF)
• When each module / function block stops or the execution condition between the
instructions turns OFF in the following cases, the function block being executed stops.
• When the FBCALL/FBSTRT instruction is written in a module / function block
• When the FBCALL/FBSTRT instruction is written in the master control (between
MC and MCR instructions)
• When the execution condition between the instructions is turned OFF in the
following cases, the function block being executed is interrupted. Next, the
execution of the function block is resumed when the instructions are executed. At
this time, the previous state of the differential execution type instruction in the
function block is not initialized. (When written in the initialization module, only 1
scan is performed at the start of operation.)
• When the FBCALL/FBSTRT instruction is written in a subprogram (between the
SBN and RET instructions)
• When the FBCALL/FBSTRT instruction is written in a conditional branch
(between the CJ/NCJ and LABEL instructions)
• When the FBCALL/FBSTRT instruction is written in a step (between the STP and
STE instructions)
• When the FBCALL/FBSTRT instruction is written in an interrupt (between the INT
and RETI instructions)
• When the FBCALL/FBSTRT instruction is written in a stage (between the STG and
JMP instructions)
• The FBCALL/FBSTRT instruction cannot be used in a function.
• The FBCALL/FBSTRT instruction cannot be used in a macro.
• The FBCALL/FBSTRT instruction that calls the function block in itself cannot be used.
• Subprograms can be used in function blocks, but the interrupt program cannot be used.
• If the same function block is executed for multiple times in a project, using a global
device / global variable for the OUT/OUB instruction in the function block will result
in a double coil.
Calculation flag
LADDER PROGRAMMING
CR2009 Depends on the processing result in the function block executed.
CR2010 Depends on the processing result in the function block executed.
CR2011 Depends on the processing result in the function block executed.
ON in the following cases, and OFF otherwise.
• When the range of indirect specification or index modification is inappropriate
• When the unit specified in the argument of the argument type "unit" is not connected
CR2012
• When the unit specified in the argument of the argument type "unit" is different from the unit type
specified in the argument settings
• When an out-of-range access of operands occurs
4
Function Blocks
* When the argument is inappropriate, the function block cannot be executed.
When CR2012 is turned ON, the error details are stored in CM5150~CM5176.
"Error log" (page 4-86)
Sample Program
When the input relay R002 is ON, the instance named "Instance B" of the function block "Function
Block B" is executed with argument 1 as EM0 and argument 2 as MR000. The execution stops when
the input relay R002 turns OFF.
The instance named "Instance A" of the function block "Function Block A" is executed with argument 1
as #1 and argument 2 as DM0 at the rising edge of input relay R000.
When the input relay R001 is ON, the execution of "Instance A" of "Function Block A" is stopped.
<Mnemonic list>
This section describes the system function block for << KV-8000 >> used in the ladder program.
Function block
Function Overview Page
program name
Bistable function block The output signal is controlled by the Set/
SR 4-155
(Set priority) Reset signal. (Set priority)
4
Bistable function block The output signal is controlled by the Set/
RS 4-157
(Reset priority) Reset signal. (Reset priority)
Rising edge detector R_TRIG Detects the rising edge. 4-159
Function Blocks
LADDER PROGRAMMING
Bistable function block
SR (Set priority)
The bit state is controlled by the combination
of Set/Reset signal. (Set priority)
Argument
Function Blocks
2nd argument Reset
Specifies the bit on
whether to reset.
Sample program
The bFlag state is controlled by the state combination of bFlag1 and bFlag2.
Description of Operation
The "Keep" state is controlled by the bit state combination of bits specified in "Set" and "Reset".
Combination table
RESET
ON OFF
ON ON ON
S
OFF OFF (Keeps the last state)
4 ON
①
Set OFF
Function Blocks
②
ON
Reset
OFF ③ ④ ⑤
ON
Keep
OFF
LADDER PROGRAMMING
Bistable function block
RS (Reset priority)
The bit state is controlled by the combination
of Set/Reset signal. (Reset priority)
Argument
Function Blocks
2nd argument Reset
Specifies the bit on
whether to reset.
Sample program
The bFlag state is controlled by the state combination of bFlag1 and bFlag2.
Description of Operation
The "Keep" state is controlled by the bit state combination of bits specified in "Set" and "Reset".
Combination table
RESET
ON OFF
ON OFF ON
S
OFF OFF (Keeps the last state)
4 ON
Set OFF ①
Function Blocks
②
ON
Reset
OFF
③ ④
ON
Keep
OFF
LADDER PROGRAMMING
R_TRIG Rising edge detector Turns on by just one scan at the rising edge.
Argument
Function Blocks
edge. rising edge.
Sample program
Turns bStart on by just one scan at bRdy rising edge.
Description of Operation
At the rising edge of the bit specified in "Input", "Output" turns on by just one scan.
ON ①
Input
OFF
ON
Output
OFF
F_TRIG Falling edge detector Turns on by just one scan at the falling edge.
Argument
falling edge.
edge.
Sample program
Turns bStop on by just one scan at bLimit rising edge.
Description of Operation
At the rising edge of the bit specified in "Input", "Output" turns on by just one scan.
ON
Input ①
OFF
ON
Output
OFF
LADDER PROGRAMMING
CTU Up counter 16-bit Up counter.
Argument
1st argument
4th argument Output
Counter Input
Specifies the bit to be
Specifies the bit to be
output when counting up.
4
counted up at the rising
Function Blocks
edge.
5th argument
2nd argument Reset
Counter Value
Specifies the bit on
Specifies the data that
whether to reset.
stores the Counter Value
to be counted up.
3rd argument Preset Value
Specifies the upper limit that
does not be counted up.
(0 to 32767)
Sample program
Counts up the iCount by the number of bEject rises.
Description of Operation
At the rising edge of the bit specified in "Counter Input", counts up the "Counter Value". When "Counter
Value" exceeds "Preset Value", "Output" turns on and "Counter Value" is no longer incremented. While
"Reset" is ON, the "Counter Value" becomes 0.
ON ④
Counter Input OFF
4 Reset
ON
OFF
①
②
③
Function Blocks
ON
Output
OFF
Preset Value 10
Counter Value 7 8 9 10 0
LADDER PROGRAMMING
CTD Down counter 16-bit Down counter.
Argument
1st argument
4th argument Output
Counter Input
Specifies the bit to be
Specifies the bit to be 4
output when Counter
counted down at the
Function Blocks
Value is 0.
rising edge.
Sample program
Counts down the iCount by the number of bEject rises.
Description of Operation
At the rising edge of the bit specified in "Counter Input", counts down the "Counter Value". The "Counter
Value" starts from "Preset Value", and when it reaches 0, "Output" turns on and "Preset Value" is no
longer decremented. While "Load" is ON, "Counter Value" becomes "Preset value".
④
ON
Counter Input OFF
4 ON
②
Load ①
OFF
Function Blocks
ON
Output
OFF
Preset Value 10
Counter Value 3 2 1 0 10
LADDER PROGRAMMING
CTUD Up/Down counter Refers to the Up/Down counter
Argument
Function Blocks
up at the rising edge. output when Counter
value exceeds Preset
value.
2nd argument
Down counter input
7th argument
Specifies the bit to be counted
Down counter output
down at the rising edge.
Specifies the bit to be
output when Counter
3rd argument Reset signal value is 0.
Specifies the bit on whether to
reset Counter Value.
8th argument Counter value
Specifies the data that
4th argument Load signal stores Counter Value.
Specifies the bit on whether
to be loaded to Preset Value.
Sample program
Increments iCount by bIn and decrements iCount by bEject.
Description of Operation
The "Counter Value" is counted up at the rising edge of the bit specified by "Up Counter Input", and is
counted down at the rising edge of the bit specified by "Down Counter Input". "Counter Value" starts
from 0, and when it matches "Preset Value", "Increment Output" turns on; or starts from "Preset Value",
and when it reaches 0, "Decrement Output" turns on. While "Increment Output" and "Decrement
Output" are ON, "Counter Value" is no longer incremented or decremented. While "Reset" is ON,
"Counter Value" becomes "0", and while "Load" is ON, "Counter Value" becomes "Preset Value". If
4 "Reset" and "Load" are ON at the same time, "Counter value" will be "0".
ON
Function Blocks
ON
Reset OFF
ON
Load
OFF
ON
Increment Output
OFF
ON
Decrement Output OFF
Preset Value 10
Counter Value 1 2 3 4 5 6 7 8 9 10 0 1 2 10 9 8 7 6 5 4 3 2 1 0 1 2 1
LADDER PROGRAMMING
TON_100MS 100ms On-delay On-delay that in 100ms units
Argument
Function Blocks
counted up at the turns on when Elapsed
rising edge. Time exceeds Set Time.
Sample program
Counts the time when bInput is ON.
Description of Operation
The "Eapsed Time" increases while the bit specified in "Input" is ON. When "Set Time" has elapsed,
"Output" turns on and the "Elapsed Time" no longer increases. When "Input" turned off, "Elapsed Time"
becomes 0 and "Output" also turns off.
ON
Input
OFF
4 ON
Output
Function Blocks
OFF
Set Time
Elapsed Time
If the Execution Condition is skipped by CJ/NCJ instruction, etc., the value of "Elapsed
Point
Time" is not updated, but the timekeeping continues during that time. When it is
executed next time, the Elapsed Time will be updated to the elapsed time instead of 0.
When using it in the IF statement of ST/Script, please note that the Execution
Condition may be jumped internally by CJ or NCJ.
LADDER PROGRAMMING
TON_10MS 10ms On-delay On-delay that in 10ms units
Argument
Function Blocks
Specifies the bit to be Specifies the bit that
counted up at the turns on when Elapsed
rising edge. Time exceeds Set Time.
Sample program
Counts the time when bInput is ON.
Description of Operation
The "Eapsed Time" increases while the bit specified in "Input" is ON. When "Set Time" has elapsed,
"Output" turns on and the "Elapsed Time" no longer increases. When "Input" turned off, "Elapsed Time"
becomes 0 and "Output" also turns off.
ON
Input
OFF
4 ON
Output
Function Blocks
OFF
Set Time
Elapsed Time
LADDER PROGRAMMING
TON_1MS 1ms On-delay On-delay that in 1ms units
Argument
Function Blocks
counted up at the turns on when Elapsed
rising edge. Time exceeds Set Time.
Sample program
Counts the time when bInput is ON.
Description of Operation
The "Eapsed Time" increases while the bit specified in "Input" is ON. When "Set Time" has elapsed,
"Output" turns on and the "Elapsed Time" no longer increases. When "Input" turned off, "Elapsed Time"
becomes 0 and "Output" also turns off.
ON
Input
OFF
4 ON
Output
Function Blocks
OFF
Set Time
Elapsed Time
LADDER PROGRAMMING
TON_10US 10μs On-delay On-delay that in 10μs units
Argument
Function Blocks
counted up at the turns on when Elapsed
rising edge. Time exceeds Set Time.
Sample program
Counts the time when bInput is ON.
Description of Operation
The "Elapsed Time" increases while the bit specified in "Input" is ON. When "Set Time" has elapsed,
"Output" turns on and the "Elapsed Time" no longer increases. When "Input" turned off, "Elapsed Time"
becomes 0 and "Output" also turns off.
ON
Input
OFF
4 ON
Output
Function Blocks
OFF
Set Time
Elapsed Time
LADDER PROGRAMMING
Differences between Function Blocks and Macros
Like macros, function blocks are a function that collect ladder circuits like a single ladder instruction.
This section compares function block operation to macro operation.
For details on macros, see "Modules" (page 4-98)
Object creation
[Function block]
Program type: Function block
Entities are generated by the number of instances.
4
Function Blocks
Program type: Function
One object is generated, regardless of the number of times it is called in the program.
[Macro]
An object is generated every time it is called in the program.
Callable position
[Function block]
Program type: Function block
Can be called from modules and function blocks.
Program type: Function
Can be called from modules, function blocks, and functions.
Nests of up to 8 layers can be created.
"Function Block Nests" (page 4-140)
[Macro]
Can be called from modules. Macros cannot be called from macros.
Argument type
[Function block]
IN: The device value is stored in the argument when execution starts.
OUT: The argument value is stored in the device when execution ends.
IN-OUT: The device reference is stored when execution starts.
[Macro]
P: The device reference is stored when execution starts.
V: The device value is stored in the argument when execution starts.
Other Differences
LADDER PROGRAMMING
4 Argument
Argument name
Up to 128 characters long
Unit:
Local devices P0 - 9, V0 - 9,
UR0 - 9, UM0 - 9, UV0 - 9
Local devices UR0 - 7, UM0 - 7, UV0 - 7
Function Blocks
MEMO
LADDER PROGRAMMING
4
Function Blocks
Overview
A macro is a section of a ladder program that has been registered with a name so that it can be used
repeatedly in a project. By creating macros, you can use the sections of ladder programs in the same
way that ladder instructions are used, which enables you to reduce the amount of time you spend
writing programs. When you make changes to the program, just by modifying the data in the location
that is registered as a macro, all the process details executed when the corresponding macro
instruction is called in the project are changed. This reduces the amount of time that you spend
changing programs and also prevents mistakes that occur during program modifications.
4 <Before the introduction of macros> <After the introduction of macros>
Macros
Project 1 Project 1
[ModuleA] [ModuleA]
MacroC
[ModuleB]
Macro call
[ModuleB] instructions
MacroC
MacroC
Register the
same
[MacroC]
processing
as a macro.
Macro management
In KV STUDIO, the workspace is used to manage macros for each project.
Macro features
LADDER PROGRAMMING
Macros can be used as original instructions
If you register a ladder program segment that occurs multiple times in the program as a macro, you can
reduce the amount of time you spend writing programs and you can also reduce input mistakes.
As a result, the number of rungs in the ladder program decreases, which makes it easier to understand
the program structure.
You can assign any name to the macro that you want to register.
Macros
"Setting Arguments" (page 4-186)
Usage Procedure
LADDER PROGRAMMING
Macro Type
There are two types of macros: subroutine macros and self-hold macros.
Subroutine macros
Overview
Subroutine macros operate the same as subroutines in that the macro may only be executed when its
execution condition is turned ON. The program within the macro is executed each time that the macro
call instruction (MCALL) is executed. After the macro finishes executing, execution proceeds to the next
4
step after the macro call instruction. If the execution condition is turned OFF, the program within the
Macros
macro is not executed, and execution proceeds to the next step.
Usage method
To start a subroutine macro, use the MCALL instruction from a module.
Operation description
An explanation of the operation of subroutine macros is shown in the following figure.
In this example, macro A is called twice from within module 1.
Reference To differentiate between the objects of the created macro, "#(management number)" is
appended after the macro name.
In KV STUDIO, this is only displayed during monitoring and simulation.
Module1
Macro objects (MacroA#1 and MacroA#2) are created
separately by each MCALL instruction.
When the execution conditions of the MCALL
instruction are ON, execution leaves Module1, and
the macro is executed.
ON
MCALL MacroA
MacroA#1
OFF
MCALL MacroA
×
MacroA#2
The operation when subroutine macros stop executing (when the execution condition turns from ON to
OFF) differs according to the "Program property" -> "Perform OFF Process When Stopping Execution"
setting of each program.
In the case of KV-8000A, the setting is not displayed, and the operation is the same
Point
as when "OFF processing when execution stopped" item is always checked.
4
Macros
Execution condition
OFF ON ON OFF OFF
to call MacroA
Reference For OFF processing when macro execution stops, the same processing is performed as
when the MC instruction execution condition is OFF for one scan only.
For details, see the MC and MCR instructions in the KV-8000/7000/5000/3000/1000 Series and
KV Nano Series Instruction Reference Manual.
4-182 - KV-8000 Series User’s Manual -
4-11 Macros
Self-hold macros
LADDER PROGRAMMING
Overview
Self-hold macros operate the same as subroutine macros in that the macro may only be executed when
its execution condition is turned ON. The program within the macro is executed each time that the macro
call instruction (MSTRT) is executed. Once the macro has started, it is continually executed during
subsequent scans, regardless of the execution condition of the macro call instruction, until the macro
execution stop instruction (MEND) is called from within the macro.
4
Usage method
Macros
To start a self-hold macro, use the MSTRT instruction from a module.
Operation description
An explanation of the operation of self-hold macros is shown in the following figure.
In this example, macro A is called twice from within module 1.
1 When the execution condition is turned ON, macro A starts.
Module1
ON
MSTRT MacroA
MacroA#1
MEND
ON
MSTRT MacroA
MacroA#2
MEND
Reference To differentiate between the objects of the created macro, "#(management number)" is
appended after the macro name.
In KV STUDIO, this is only displayed during monitoring and simulation.
2 Once the macro is started, it continues to be executed regardless of the status of the MSTRT
LADDER PROGRAMMING
ON
MSTRT MacroA
MacroA#1
execution continues.
Macros
OFF
MSTRT MacroA
MacroA#2
MEND
3 It stops when the execution condition of the MEND instruction in the macro turns ON.
Module1
OFF
MSTRT MacroA
MacroA#1
ON MEND
OFF
MSTRT MacroA
MacroA#2
ON MEND
LADDER PROGRAMMING
The operation when self-hold type macros stop executing (when an MEND instruction is executed)
differs according to the "Program property" -> "Perform OFF Process When Stopping Execution"
setting of each program.
In the case of KV-8000A, the setting is not displayed, and the operation is the same
Point
as when "OFF processing when execution stopped" item is always checked.
Macros
If "Perform OFF Process When Stopping Execution" is not checked
Self-hold type macros stop on the scan after the macro stop instruction (MEND) is executed.
If "Perform OFF Process When Stopping Execution" is checked
In only the one scan after the macro stop instruction (MEND) was executed, self-hold macros are
executed with all execution conditions turned OFF. *
They will be stopped from the following scan.
[Image of the operation of a self-hold macro]
Execution condition
OFF ON *1 *1 OFF*2 OFF*3
to call Macro A
Executing with
Macro A Stopped Executing Executing Executing Stopped
conditions turned OFF
Reference For OFF processing when macro execution stops, the same processing is performed as
when the MC instruction execution condition is OFF for one scan only.
For details, see the MC and MCR instructions in the KV-8000/7000/5000/3000/1000 Series and
KV Nano Series Instruction Reference Manual.
- KV-8000 Series User’s Manual - 4-185
4-11 Macros
LADDER PROGRAMMING
Setting Arguments
4 Module1
Macros
Argument 1 MOV
Argument 2 DM0
When the macro is called,
the specified devices and
values are used during
the execution of the R001 MOV
macro's ladder program. #50 DM0
Usage example
LADDER PROGRAMMING
A usage example of argument devices is shown in the following figure.
In this example, the macro call instruction of macro 1 is executed from module 1.
Macros
DM10000∼DM10059
Module1
@CR2008 MCALL Macro1 マクロ命令
Macro instruction
#1 MR000 #1000
Argument 1 Argument 2 Argument 3
DM0
Argument 4
UM0: DM10000
UR0: R30000
Call P0: MR000
V0: #1000
Module1 V1: #1234
R30000 R30001
UR0:#02 P0
SET
R30002 MR000
P0 MOV
#0 UM0:#4
MR000 DM10004
MOV
V1 UM0:#3
#1000
If you are using character strings as arguments, use argument device "P", and
Point
specify the leading device in which the character string is stored. You cannot use
argument device "V" to designate character strings directly.
A macro system device is a device that is used to capture the operation status of a macro.
Only the bit that is turned ON during execution can be referenced by other programs.
4 Reference KV STUDIO automatically assigns macro system devices to the CPU unit internal work
area.
Macros
Bit that is turned ON for only one scan when macro execution starts, "@CR2008"
This bit is turned ON for only the first scan after macro execution starts.
From the second scan, it is turned OFF.
This bit can only be referenced from its own macro. It cannot be referenced from the module that called
this macro.
In KV STUDIO, this device is represented by "@CR2008."
Bit that is turned OFF for only one scan when macro execution starts,
"@CR2007"
This bit is turned OFF for only the first scan after macro execution starts.
From the second scan, it is turned ON.
This bit can only be referenced from its own macro. It cannot be referenced from the module that called
this macro.
In KV STUDIO, this device is represented by "@CR2007."
Example
_BatchSend_2 _ParamCalc_1
Reference To use this bit that is turned ON during macro execution, you need an ID number for each
macro that you want to call.
"Bit That Is Turned ON during Macro Execution" (page 4-189)
LADDER PROGRAMMING
Bit That Is Turned ON during Macro Execution
Overview
This bit is turned ON when the macro is being executed. Because this bit can be referenced from all
modules, it is useful in situations such as when you want to reference the bit before calling the macro to
control macro execution.
To use this bit that is turned ON during macro execution, you need an ID number for each macro that
you want to call.
In KV STUDIO, this device is represented by "_(macro name)_(ID number)."
4
How to set the bit that Is turned ON during execution
Macros
The bit that is turned ON during execution can be used when " Ident.No. (execution bit)" is checked in
the "Operand" dialog box.
1 Move the cursor to the MCALL/MSTRT instruction and press the 㾑 key.
The "Operand" dialog box appears.
Alternative procedure Move the cursor to the MCALL/MSTRT instruction, and select "Edit (E)" -> "Change
operand (O)" from the menu.
The bit that is turned ON during macro execution cannot be used if the "Ident.No.
Point
(execution bit)" checkbox is not checked.
ID number
To use the same macro repeatedly in the same project, change the number each time that you want to
use the macro.
If you specify the same number for different instances of the same macro, a
Point
conversion error will occur.
Usage example
LADDER PROGRAMMING
@DM0 #100
Macro4_1
MSTRT Macro4_2
4 @DM10 #1000
Macro4_2 Macro4_2
Macros
If you write the bit that is turned ON during execution of an unused macro (a
Point
macro that is not specified by a macro call instruction in the project), a
conversion error will occur.
Reference You can use macro call instructions that call a macro with an ID number together with
macro call instructions that call the same macro without an ID number.
@DM0 #100
@DM10 #1000
LADDER PROGRAMMING
Macro Passwords
Macro passwords
You can limit who can display macros in KV STUDIO by setting passwords on the macros.
Follow the procedure below to set a password.
Macros
menu.
• Select and right click the macro in the workspace and select "Setup password" from
the menu.
4 Enter the password in both text boxes (the second is for confirmation), and then click "OK."
After you set the password, when an attempt is made to display the macro in KV STUDIO, a dialog box
will be displayed asking the user to enter the password.
If the user does not enter the password, they will not be able to display the macro in KV STUDIO.
M
Macro instructions
LADDER PROGRAMMING
*1 The number of operands other than the macro name and the data that can be specified differ as follows
depending on the argument settings set in the macro to be executed.
•P :Devices, variables and labels can be specified. Constants cannot be specified.
•V :Devices, variables, labels and constants can be specified.
• Unit :Only constants can be specified.
*2 Handling of T, C, TIMER type variables and COUNTER type variables differs depending on the
instruction used in the macro.
Example) For the MOV instruction, the current value is handled. For details, refer to the operation
description of the respective instruction.
*3 "", # and $ cannot be used. Directly enter the name of the macro set in KV STUDIO.
Up to 12 half-width alphanumerics and 6 full-width alphanumerics can be specified.
However, up to 12 full-width alphanumerics can also be specified in the KV-8000/7000 series.
*4 When an ID No. is used, the format becomes "(macro name)_(ID No.)". Example) Batch transmit_2
For details on ID No., see the User's Manual of the CPU unit used.
LADDER PROGRAMMING
Description of Operation
MCALL The sub-routine macro specified by S is executed at every scan when the execution
condition is ON.
Execution of the specified macro is started from scans where the execution
conditionchanges from OFF to ON.
MSTRT The self-hold type macro specified by S is executed at every scan when the execution
condition is ON.
Execution of the specified macro is started from scans where the execution
conditionchanges from OFF to ON.
4
Once execution is started, the macro continues to be executed even if the
Macros
executioncondition is OFF.
MEND Self-hold type macros with a MEND instruction written to them stop when the
executioncondition is ON.
The OFF process when stopped differs according to the CPU unit. Refer to the instruction manual
foreach CPU unit for details.
Subroutine macros: "Operations when execution stops" (page 4-182)
Self-hold macros : "Operations when execution stops" (page 4-185)
• Writing in the RUN mode is not possible if the MCALL/MSTRT instruction is added or deleted.
Point • To stop execution of a self-hold macro, use the MEND instruction in the macro.
When the MSTRT instruction execution condition holds ON, the MEND instruction is ignored.
• The MEND instruction cannot be programmed in modules and sub-routine macros.
• Other macros cannot be stopped by the MEND instruction.
• The previous state of differential execution type instructions in macros is initialized
every time that execution of a macro is started. (rising edge differentiation: ON, falling
edge differentiation: OFF)
• When T/C/CTH has been specified to an operand whose MCALL/MSTRT instruction
attribute is a value, the following values are handed over to the macro:
T/C : Current value (32-bit data)
CTH : Current value (32-bit data)
CTC : Setting value (32-bit data)
• In the following cases the macro being executed stops when each module stops or when
the execution condition for each set of instructions turns OFF.
• When an MCALL/MSTRT instruction is written to the module
• When an MCALL/MSTRT instruction is written to master control (in the MC –
MCR instructions)
• When an MCALL instruction is written to stage (in the STG - JMP instructions)
• In the following cases the macro being executed is canceled when the execution
condition for each set of instructions turns OFF.
The macro execution resumes when each set of instructions is executed.
The previous state of differential execution type instructions in macros is not initialized
at this time.
(If it is written in the initialization module only, 1 scan is executed when operation starts.)
• When an MCALL/MSTRT instruction is written to sub-routine (in the SBN – RET
instructions)
• When an MCALL/MSTRT instruction is written to conditional branch (in the CJ/
NCJ - LABEL instructions)
• When an MCALL/MSTRT instruction is written to step (in the STP – STE instructions)
• When an MCALL/MSTRT instruction is written to interrupt (in the INT – RETI instructions)
• When an MSTRT instruction is written to stage (in the STG - JMP instructions)
• MCALL and MSTRT instructions can not be used in macros.
• MCALL/MSTRT instructions cannot be used in function blocks/functions.
• Sub-routines can be used in macros, but interrupt programs can not be used.
• When performing a certain macro repeatedly in a project, the global devices / global
variables used in OUT/OUB instruction in a macro will become double coil.
Operation flag
LADDER PROGRAMMING
CR2009 The state depends on the processing result in the macro to execute.
CR2010 The state depends on the processing result in the macro to execute.
CR2011 The state depends on the processing result in the macro to execute.
ON when the indirect specification or index modification range is inappropriate, the unit specified
by UR/UV/UM while using the KV-8000/7000 series is not connected, or an access outside the
CR2012 operand range occurs. Otherwise itis OFF.
It will not change when indirect specification or index modification is not specified in the operand,
4 *
and the access outside the operand range is not checked.
Point The state of the operation flag does not change by the MEND instruction.
Sample Program
The sub-routine macro (macro A) is executed with EM0 as argument 1 and #10 as argument 2
wheninput relay R000 is ON.
At the rising edge of input relay R001, execution of self-hold macro "Macro B" is started with #1
asargument 1 (unit No.) and #10 as argument 2.
When input relay R002 is ON, execution of self-hold macro "Macro B" is stopped.
LD R002
MEND
R002 MEND
・・・・
LADDER PROGRAMMING
Differences between Macros and Subroutines
The same as subroutine programs, call instructions are used to start macros. In this section we will
show a comparison of the macro and subroutine operations.
For details on subroutine programs, see "Subroutine programs" (page 4-94).
Object creation
[Macro]
The number of objects that will be created is equal to the total number of macro call instructions
4
(MCALL or MSTRT) that you write in a module.
Macros
Module1 MacroA#1
Call
MCALL MacroA
MacroA#2
Call
MCALL MacroA
Call MacroA#3
MCALL MacroA
Module2
MacroA#4
Call
MCALL MacroA
Reference • Macros that are registered in the project but that are not called (unused macros) are not
transferred to the CPU unit. Unused macros are not included in the targets to be verified
during project verification and during verification with the PLC.
• To differentiate between the objects of the created macro, "#(management number)" is
appended after the macro name. In KV STUDIO, this is only displayed during
monitoring and simulation.
[Subroutine]
LADDER PROGRAMMING
Subroutines are written between the END and ENDH instructions of a program, and they are executed
by the subroutine call instruction (CALL) that is written in the main routine program of the program.
Objects are not created each time that a call instruction is executed.
Module1 Module2
You can execute
#0 the subroutines of
CALL other modules by
using the ECALL
4 #0
CALL
instruction.
#0
Macros
CALL
END END
SBN SBN
#0
Call
× #0
RET RET
ENDH ENDH
Callable position
[Macro]
In a module, you can write macro call instructions anywhere in the main routine, in subroutines, and in
interrupt routines. You cannot write macro call instructions in macros.
[Subroutine]
Subroutine call instructions are only valid in the program in which the subroutine is created. To execute
subroutines in other modules, use the inter-module subroutine call instruction.
Name
[Macro]
You can freely assign names to macros.
"List of Characters That Cannot Be Used" (page A-39)
[Subroutine]
Numbers are used to manage subroutines.
Arguments
LADDER PROGRAMMING
[Macro]
Macros have arguments.
[Subroutine]
Subroutines do not have arguments.
Macros
executed. Each device in which it is written maintains its status from the last time it was executed.
If "Perform OFF Process When Stopping Execution" is checked, when stopped all programs are
executed with the execution condition OFF in the next scan only. For example, the devices written with
the OUT instruction are automatically turned OFF.
"Macro Type" (page 4-181)
In the case of KV-8000A, the setting is not displayed, and the operation is the same
Point
as when "OFF processing when execution stopped" item is always checked.
[Subroutine]
The program in the subroutine is not executed. The written devices retain their status from the last time
the subroutine was executed.
[Subroutine]
The same as macros, except that the operation is only performed when execution starts for the first
time. When execution starts for the second time and later, the status is set to that of the previous
execution.
Operation when the program is called between the MC (master control) and MCR
(master control reset) instructions
• When the MC instruction's execution condition is turned ON
Macros and subroutines operate normally.
[Subroutine]
Subroutines are not executed.
Applications
LADDER PROGRAMMING
When you want to retain the status and values of the devices that you are using in the locations that
programs are called
[Macro] ...........Better
Because separate objects are created for each call instruction, if you use macros together with local
devices, you can retain the status from the previous execution without having to consider problems
such as device conflicts.
4 [Subroutine] ....Good
Because the same program is executed, you have to use indirect specification or a similar method to
Macros
create a program that stores and restores the status of the devices that you are using.
[Subroutine] ....Good
You have to write the program so that the execution condition is not turned OFF until the operations are
finished.
Also, when you want to execute multiple instances of this type of processing at the same time, you
have to write the program while considering device conflicts and the various operation statuses.
[Subroutine] ....Better
Because the number of objects created remains the same no matter how many times the subroutine is
called, the more times the subroutine is called, the more you can reduce the number of steps.
MEMO
LADDER PROGRAMMING
4
Macros
Therefore, it was necessary for the user to manage all devices used in the program.
In KV STUDIO, for each program, local devices can be processed as separate devices. Even if you use
a local device with the same number in a different program, because it will be processed as a separate
device, you can easily manage the assignments of devices that are used only within the module or
macro.
In contrast with the local devices that are valid only within a program, devices that are shared within the
entire project are called global devices.
ModuleA
Local
Program
devices
ModuleB
Program (Global)
Devices Local (Global)
Program
devices Devices
MacroC
Program Local
devices
You have to write this as "@device number" only when you want to specify the
Point
device number as the operand of a timer or counter instruction.
Mnemonic input example: TMR @0 #100
LADDER PROGRAMMING
List of Local Devices
The number of local and global devices that are reserved when you create a project and the default
ranges of these devices are shown below. To change the reserved number of local devices, from the
workspace, open the "CPU system setting" dialog box, and then click "Entire assignment setting of local
devices."
Local Device Global Device
Local Devices
Relay (R)*3 None
R000 to R199915 (2000ch)
• If you are using relays (R) and temporary memory entries (TM) as local devices,
Point
you have to set the number of devices that you will use.
• The following devices must be processed as global devices.
• The device that is allocated to CPU unit and expansion unit
• Devices that are referenced by connected peripherals such as touch panels
• Devices that are common to the entire project
• Devices that have to transfer data between modules
• The first local device is number 0. Use local devices with as small numbers as
possible.
• Because R and DM devices are assigned to units, an area that is used as global
devices is required. For local devices, use MR and EM devices with a higher
priority.
• If you use a local device or global device outside of the usable range, a
conversion error will occur.
• When you are using instructions in which you specify the leading device in the
operands, index modification, and indirect specification, do not exceed the
usable range of local and global devices.
During conversion, local devices are automatically assigned to the reserved areas that have been
prepared for the different device types in advance.
Device area
Leading device
Project 1
4 ModuleA
Global devices
Local of Project 1
Program
Local Devices
devices
Convert
ModuleB
Global
devices Local Local devices of
Program
devices ModuleA
Convert
Local devices
MacroC
of ModuleB
Local Reserved area of
Program Convert local devices
devices Local devices
of MacroC
Not used
Last device
• For function blocks and macros, a number of local devices equal to the number
Point
of times it is called in the project is assigned.
• For function type function blocks, only one local device is assigned regardless
of the number of times it is called, to make sure there is always only one object.
Reference Just like global devices, you can assign device comments to local devices.
LADDER PROGRAMMING
The number of local devices that are reserved for usage in a project is set in advance, but you can
change the number of devices used per type of device. The changes that you make are saved in KV
STUDIO, so there is no need to make the same changes each time that you create a new project.
From the workspace, open the "CPU system setting" dialog box, and then click "Entire assignment
setting of local devices."
Local Devices
Configuring device settings for programs
You can set the number of reserved local devices for usage in each program, and you can make this
setting for each type of device. The default setting is "Auto." With this setting, the number of local
devices used in a program is set automatically, so there is normally no need to consider the number of
local devices.
From the workspace, open the "CPU system setting" dialog box, and then click "Set program type
device."
Typical examples of errors occuring during ladder conversion are shown below.
An attempt is made to use as a global device the device area that has been reserved for local
devices.
•Check the "Global device range" settings on the "Entire assignment setting of local devices" screen.
Leading device Last device
Entire assignment Global devices Reserved area of local devices
•There is a chance that the unit devices you have used the Unit Editor to set are using the local
device area. Check whether this is the case.
Leading device Last device
Entire assignment Global devices Reserved area of local devices
An attempt is made to use a local device that has been assigned outside of the range for local
devices.
This error can only occur when you configure settings manually.
Check the settings on the "Set program type device" screen.
Example
@DM0 @DM1999
Assigned separately to programs
Setting range @DM3000
LADDER PROGRAMMING
Check the settings under "Display local assignment" on the "Entire assignment setting of local
devices" screen. See if there are devices whose settings, such as the number of devices used, are
displayed in red. Configure the settings—by increasing the reserved number of applicable devices
or by decreasing the number of local devices set for each program—so that the number of devices
that can be used (the number of reserved local devices) is greater than the number of devices used.
Insufficient number of
Leading device Last device
reserved devices
Entire assignment Global devices Reserved area of local devices
Local Devices
"Setting assignments in batches" (page 4-203)
Overview
Normal PLCs execute ladder sequences by repeating the following cycle: input processing, program
execution, and then output processing. Therefore, signals shorter than the scan time cannot be applied.
If you use the interrupt function, you can execute processing at the point in time that an interrupt occurs
regardless of the scan time.
When an interrupt occurs, even if a program is being executed, the execution is temporarily interrupted,
and the interrupt program that corresponds to the interrupt condition is executed. After the interrupt
4 program is completed, the processing of the interrupted program begins again.
Interrupts
Input processing
Interrupt program
Program
execution
execution
Output processing
Device processing
LADDER PROGRAMMING
Device processing when an interrupt occurs is shown below.
For details on I/O processing, see "I/O Processing during Interrupts" (page 4-212).
4
Interrupt program
Interrupts
(output processing)
You can use the "User interrupt" screen on the "CPU system setting" dialog box
Point
to specify whether to save and restore index registers Z1 to Z10.
Reference To update to the latest status device values that are not automatically refreshed:
• Use "DR" to write an I/O relay.
• Write the RFSX or RFSY instruction.
"Direct processing" (page 4-83)
Processing time
When it suffices all of the following conditions, the time until the start of interruption will be 15μs
(TYP.4μs) or shorter.
• When selecting the "Enable interrupt in instruction execution" checkbox in "Fixed period execute and
user interrupt" setting of CPU System Settings"
• It does not use interruption program with higher priority than that interruption program
• It does not use the expansion unit for KV-5000/3000 series (maximum +14μs when it is used)
• When many devices are not refreshed by the inter-unit synchronization input or output refresh
• 1 ID is not registered with a device of 513 words or more during the recording/tracking setting.
In addition, the activation, finishing process time (refresh/ saving/recovery of each device) of
interruption program is 2.5μs in total.
Reference The time until processing of the interrupt starts is as stated above, but if a direct
processing instruction is executed for an expansion unit for the KV-5000/3000 Series at
the start of the interrupt program, it may take some time for the interrupt program to
complete.
• When KL-N20V, KV-CL20, KV-DN20, KV-H20, KV-H20S and KV-H40S are used:
115 μs
• When an expansion unit for units other than the KV-5000/3000 Series above are used:
55 μs.
CR2008
EI
4
condition
#1 #0 #1
Main routine program
The interruption program can not be executed
Interrupts
Interrupt program
The interruption program will be written
RETI
between“END”
“ENDH”
, .
ENDH
Reference • To disable interrupts, use the interrupt disable (DI or DIC) instructions.
• When interrupts are disabled, even if an interrupt occurs, the interrupt program will not
be executed until interrupts are enabled.
• The interrupt program starts when interrupts are enabled.
• Even if you have not executed the interrupt enable (EI) instruction, system interrupts
caused by peripheral processing are executed.
"EI Instructions" (page 4-218)
"DI Instructions" (page 4-218) and "DIC Instructions" (page 4-220)
You can only write one INT instruction per interrupt condition.
Point
• Some instructions cannot be used in interrupt programs.
See "Instructions That Cannot Be Used in Interrupt Programs" (page 4-
210).
• To reduce the interrupt response time when executing interrupts using
KV-SIR32XT, use the unit editor to reduce the input time constant (default
value: 10 μs).
LADDER PROGRAMMING
Interrupt Priority
You can set the interrupt priority for the case in which multiple interrupt conditions are met at the same
time.
To configure this setting from the KV STUDIO workspace, open the "CPU system setting" dialog box
and select "Fixed period execute and user interrupt setting" in the "Program setting."
Interrupts
You can set the priority to "High", "Middle", or "Low". When an interrupt program is being executed, the
programs of higher order interrupts will be executed, but the programs of same-level and lower order
interrupts will have to wait until the interrupt program currently being executed is finished.
Also, if you select the "Enable interrupt in instruction execution" checkbox, you can suppress variations
in interrupt response time because interrupts will be executed mid-process for instructions that have
long processing times.
If a different interrupt occurs while an interrupt program is being executed, the operation varies
according to the priority settings. See the following table.
Priority of Program Whose Interrupt Has
Priority of Interrupt Program Being Occurred (B)
Executed (A)
High Middle Low
High Wait Wait Wait
Execute
Middle Wait Wait
immediately
Execute Execute
Low Wait
immediately immediately
Wait: After the currently executing interrupt program (A) finishes, the program whose
interrupt has occurred (B) will be executed.
Execute immediately: The currently executing interrupt program (A) is interrupted, and the program
whose interrupt has occurred (B) is executed.
After interrupt program (B) finishes executing, interrupt program (A) continues
from the point it was interrupted at.
FLIK Flicker
ALT Alternate
TMR, TMH, TMS, and Timer, high-speed timer, 1 ms high-speed timer, and 10
TMU µs high-speed timer
C Counter
Timer and counter OUTC Out counter
instructions
ITVL Interval timer
LADDER PROGRAMMING
Instruction Type Instruction
Data processing
HKEY and SORTN Hexadecimal key input and binary data division sort
instructions
Cam switch
ABSENC Absolute encoder
instructions
PID instructions PID and PIDAT PID and PID with automatic tuning
Expansion instructions
MWRIT/MREAD/
Write storage/Read storage/Acquire storage capacity/
MFREE/MMKDIR/
Create storage directory/Load storage character string/
MPRINT/MREADL/
Read one rung of storage/Copy storage file/Move
Storage instructions MCOPY/MMOV/
MREN/MFREEK/
storage file/Rename storage file/Acquire free storage
capacity/Acquire storage file status
4
MSTAT
Interrupts
MRMDIR/MDEL Delete storage folder/Delete storage file
Input processing
When the interrupt program starts, relay status is captured during the scan of input processing (I/O
update).
Since the interrupt program captures the input relay status at that time, it is necessary to use DR to
specify a relay number or use a direct refresh instruction (RFSX instruction) to update.
4 Example
Interrupt condition met
Interrupts
ON
R30000
OFF
ON
R30001
OFF
ON
R30002
OFF
R30001:OFF R30001:ON
R30002:OFF R30002:ON
Interrupt program
OFF ON OFF ON
Output processing
LADDER PROGRAMMING
Interrupt programs have no output processing. After an interrupt program is finished, output is
generated by the output processing (automatic refreshing) of the main routine program.
However, if you write a DR device (such as DR30200) on an output relay, output is generated
immediately when the program is executed (direct output).
Example DR30201: Output
Interrupts
① ②
CR2002 DR30200
(1) SET
CR2002 DR30201
(2) SET
Reference To update to the latest status device values that are not automatically refreshed:
• Use "DR" to write an I/O relay.
• Write the RFSX or RFSY instruction.
• It describes direct refresh instruction such as “UREAD/UWRIT”.
• Enter a unit dedicated instruction.
"Direct processing" (page 4-83)
Sample Program
4 • Output relay R30200 is turned ON for 1 second from the rising edge of input relay R30000.
Scan
Interrupts
ON
ON
END
INT
Interruption
Unit No. factor
#1 When input relay R30000
#0
turns ON, output R30200
KV-SIR32XT R30000
is turned ON.
CR2002 DR30200
SET
Always ON
RETI
ENDH
LADDER PROGRAMMING
The pulse widths of pulses applied to the input relay are measured.
ON
Pulse width
• The pulse width will be measured by 0.1 μs unit by using the input
capture function.
• At the falling edge of the R30000 input relay, the input capture value of R30000 (IN000) rising edge
(buffer memory #0, #1) is stored in data memory [DM10 and DM11] and the input capture value of the 4
falling edge (buffer memory #2, #3) is stored in data memory [DM12 and DM13] by UREAD instruction.
Interrupts
• The value of [DM10/DM11] will be subtracted from [DM12/DM13].
• The measured values are stored in data memory entries [DM20 and DM21].
• The [DM20 and DM21] values are converted to 1 μs units and stored in [DM22 and DM23].
<Mnemonic List>
R30000 UREAD. D At the falling edge
#1 #0 DM10 #2 of R30000, LDF R30000
the result of input UREAD.D #1 #0 DM10 #2
Switch KV-SIR32XT IN 000 rising IN 000 capture is read. MPS
input input capture L rising time LDA.D DM12
CON
SUB.D DM10
DM12 DM10 DM20 The time from
CON
LDA. D SUB. D STA. D rising edge to
STA.D DM20
falling edge is MPP
IN 000 IN 000 ON time
falling time rising time obtained. LDA.D DM20
CON
EXT.D
DM20 #10 DM22 It converts the CON
LDA. D EXT. D DIV. D STA. D measured time DIV.D #10
ON time ON time to μs unit. CON
(μs unit) STA.D DM22
END
ENDH
END
ENDH
• It measures the passing time from input relay R30002 to input relay R30003.
4 • The measured value is stored in data memory entries DM0 and DM1 in units of 0.1 µs.
<Mnemonic List>
Interrupts
R30003 UREAD. D
LDP R30003
#1 #8 DM30 #1
UREAD.D #1 #8 DM30 #1
IN002 rising IN002 At the rising edge of UREAD.D #1 #12 DM32 #1
KV-SIR32XT
input capture L rising time R30003, MPS
the result of input LDA.D DM32
capture is read. CON
UREAD. D
SUB.D DM30
#1 #12 DM32 #1 CON
STA.D DM40
KV-SIR32XT IN003 rising IN003
input capture L
MPP
rising time
LDA.D DM40
The time from the CON
DM32 DM30 DM40 IN002 rising edge to EXT.D
LDA. D SUB. D STA. D IN003 falling edge CON
IN003 IN002 Elapsed time is obtained. DIV.D #10
rising time rising time CON
STA.D DM0
END
DM40 #10 DM0 It converts the ENDH
LDA. D EXT. D DIV. D STA. D measured time to
Elapsed time Elapsed time μs unit.
(μs unit)
END
ENDH
LADDER PROGRAMMING
Interrupt Processing Instructions
Interrupt INT
Executes the interrupt program from this instruction to the RETI
4-222
4
instruction
Interrupts
Interrupt return RETI Indicates the end of the interrupt program 4-222
DI DI
Disable
interrupts
Disables the execution of interrupt
programs
EI EI
Enable
interrupts
Enables the execution of interrupt programs
Execution condition
4 DI D I
Interrupts
Operation Description
DI When the execution condition turns ON, the execution of interrupt programs is disabled.
Use this instruction when you want to temporarily disable interrupts.
EI When the execution condition turns ON, the execution of interrupt programs is enabled.
Use this instruction to enable the interrupt programs that have been disabled with the DI
instruction.
• When the EI instruction is executed, interrupts are enabled until the DI instruction is executed.
• When operations start, interrupts are disabled.
• If interrupts occur while the DI instruction is being executed (while interrupts are disabled), the
execution of the interrupt programs will be put on hold.
When the EI instruction is executed, the interrupts that were put on hold are executed.
• When an interrupt program starts, interrupts are enabled (EI). During the execution of an interrupt
program, to execute further interrupt programs, the priority of these further interrupts must be set
higher than that of the currently executing interrupt program. To set priorities, click "CPU system
setting" and then "User interrupt." You can set up to three levels of priorities.
Operation flags
LADDER PROGRAMMING
Sample Program
When input relay R000 is turned ON, the execution of interrupt programs is disabled.
When R000 is turned OFF, the execution of interrupt programs is enabled.
Interrupts
DIC DIC
Interrupt disabled
range
Sets the interrupt disabled range
4 EI
Specifies the bit device that generates the interrupt enabled/ 1 bit
D
disabled status
Operation Description
DIC Use this instruction together with the EI instruction.
When the execution condition turns ON, the execution of interrupt processing is disabled
from the DIC instruction to the EI instruction.
The interrupt enabled/disabled status prior to the execution of the DIC instruction is
generated by the device specified by D .
If interrupts were enabled prior to the execution of the DIC instruction, the device
specified by D is set. If interrupts were disabled, the device is reset.
CR2002 D CR2002 D
DIC DIC
D D
EI EI
OFF ON
Interrupts disabled Interrupts enabled
Interrupt program
Operation flags
LADDER PROGRAMMING
CR2009 No change in status
CR2010 No change in status
CR2011 No change in status
This is turned ON if the range of indirect specification or index modification is incorrect. Otherwise,
this is turned OFF.
CR2012 There is no change in status if the operands do not specify indirect specification or index
modification.
* If CR2012 is turned ON, the instruction will not be executed.
When CR2012 is turned ON, the detailed error information is stored in CM5150 to CM5176.
4
"Error log" (page 4-86)
Interrupts
Sample Program
Interrupts are disabled during operation processing. After the DIC instruction is executed, the status of
interrupt processing is returned to the status that was present prior to the DIC instruction being
executed.
I
LADDER PROGRAMMING
RETI RETI
Interruption end Indicates the end of the interrupt program
4 ( )
I S
Interrupt program
Interrupts
RETI
R E T I
( I R E T )
Operation Description
INT This instruction specifies the start of an interrupt routine when an interrupt factor specified
in n2 on the unit specified in n1 occurs.
RETI This instruction specifies the end of the interrupt routine.
The internal register, index register, operation flag, TM0 to TM3 are automatically
Point
saved when an interrupt routine starts. Each saved value is returned when the
interrupt routine ends. Under the default settings, only Z11 and Z12 index
registers are saved/restored. You can use "CPU system settings" → "Fixed
period execution and user interrupt" to configure settings to save and restore the
Z1 to Z10 index registers.
Operation flags
LADDER PROGRAMMING
Instruction Execution Timing
INT and RETI The instruction is executed on the rising or falling edge of the operand.
Scan
Interrupts
Sample Program
Executes interrupt by occurrence of interrupt factor 3 of unit number 1, executes direct refresh and
immediately outputs R30200.
<Mnemonic List>
LD CR2002
CR2002
EI
EI END
Always ON INT #1 #3
LD CR2002
END SET DR30200
RETI
ENDH
INT
Interruption
Unit number factor
#1 #3
CR2002 DR30200
SET
Always ON
RETI
ENDH
LADDER PROGRAMMING
Operation Description
IEDGE When the execution condition is ON, sets 1 word of data specified in S as
the interrupt detection condition of the n2 factor of the n1 unit.
The detection conditions are as follows according to the value of S .
S Detection condition
0 to 1 Rising edge
2 Falling edge
3 Both Rising and Falling 4
Edges
Interrupts
• When 4 to 65535 is specified in S , no calculation error occurs, but the
Point
detection conditions will not be changed.
• When this instruction is complete, the above detection condition setting is
changed.
@IEDGE Only one scan is executed at the rising edge of the execution conditions.
Operation flag
Sample Program
File registers are divided into "ZF" that handle all areas using a consecutive numbering scheme, and
into 16 FM banks (0 - 15).
4 FM32767
FM0
ZF32767
ZF32768
to Bank 1 to
File Register
FM32767 ZF65535
FM0 ZF65536
FM32767 ZF491519
FM0 ZF491520
to Bank 15 to
FM32767 ZF524287
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 "4-4 Devices", "File
Register ZF/FM" (page 4-39).
Bank Switchover
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.
File Register
After transmit the project set in this dialog box to CPU unit, when switch PRG RUN mode, read set
initial value automatically.
KV STUDIO User's Manual "Device Default Value Settings"
Use special instructions to to save and read file register data (file register set values) on memory cards
inserted in the CPU unit or in internal CPU memory .
FRSTM instruction: Saves the file registers in the specified bank to a memory card or CPU memory .
FRLDM instruction: Loads files saved to memory card or CPU memory to the file register in the specified bank.
"FRSTM" (page 4-232), "FRLDM" (page 4-234)
FM32767
FRSTM instruction
FM0
̚
Bank 1
FM32767 Memory card or CPU memory
FM0
̚
Bank 999*
FM32767
* When memory card /
CPU memory is used.
In the case of using
the built-in device only,
it will be up to 15.
Create the file register setpoint for a total of 1,000 files in memory card or CPU memory in advance, and you
will be able to load them whenever needed without having to consider how many devices are involved.
Files (file register setpoint) saved in memory card or CPU memory 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"
4
File Register
PC CPU unit
Ladder
program Memory card
File register
setpoint
Import/export
PLC transfer/read
LADDER PROGRAMMING
PLC is transferred and read just like other project information. Other project information is transferred to
the CPU unit while the file register setpoint is saved to memory card or CPU memory.
File Register
KV STUDIO User's Manual “monitor"
Import/export
Use the storage transfer tool to import and export information.
FRSET FRSET
File register bank
Switch current memory bank
no. of File Register to
switching
@FRSET FRSET determined no..
Description of Operation
FRSET When the execution condition is ON, switch the current bank No. of the file register to the
specified No. of n .
@FRSET This instruction is executed for one scan at the rising edge of the execution condition.
Operation flag
CR2009 No change in status
CR2010 No change in status
CR2011 No change in status
• ON when n >15. (For KV-5500/5000/3000, ON when n >3)
• ON when the indirect specification and index modify range is inappropriate.
CR2012
• ON when an access outside the operand range occurs.
Otherwise OFF
* The instruction is not executed when CR2012 turns ON.
When CR2012 is ON, error details are stored in CM5150 to CM5176.
"Latest error details (CM)" (page 4-87)
LADDER PROGRAMMING
Example
When input relay R000 is ON at the rising edge, switch the current group of file register to Group 1.
<Mnemonic List>
R000 FRSET
#1 LDP R000
FRSET #1
File Register
KV-8000/7000 Series
KV-5000/3000 Series
Description of Operation
FRSTM At the rising edge of execution condition, it will save all file registers of the bank No.
n2 in batch to the storage (memory card for KV-5000/3000 series) specified by n1
in binary format (the file will always be overwritten).
File No. S is specified with number.
The created file is named as \FR\FR (file No. is 3-digit).FRU*.
* The file extension for KV-5500/5000/3000 is FRB.
Create a new folder if there is no "FR" folder.
The end notification is written in D , and the error notification of abnormal end is
written in [ D +1].
• D turns OFF when execution of the instruction starts, and turns ON when write
processing to the storage ends. It becomes ON either when the command is normally
finished, or abnormally finished.
• D +1 turns OFF when the instruction ends successfully, and turns ON when
execution ends in error.
The error code is stored in CM2390.
The command will not be executed when the storage device instructions in execution
Point
relay (CR3214) is ON. Please implement exclusive control using CR3214.
Operation flag
LADDER PROGRAMMING
CR2009 No change in state
CR2010 No change in state
CR2011 No change in state
• ON when the value saved in n is larger than "15" ("3" for KV-5500/5000/3000)
• ON when the value saved in S is larger than "999"
CR2012 • ON when the indirect specification or index modify range is inappropriate.
• ON when an access outside the operand range occurs
4
Otherwise OFF
File Register
"Latest error details (CM)" (page 4-87)
Sample Program
When input relay R000 is ON at the rising edge, store the file register of Group 0 into the memory
cardwith the file No. 10.
KV-8000/7000 Series
;(Mnemonics list)
LDP R000
R000 CR3214 FRSTM ANB CR3214
#0 #0 #10 MR000 FRSTM #0 #0 #10 MR000
KV-8000/7000 Series
4
Input mode FRLDM
n1 n2 S D F R L D M n1 n2 S D
File Register
KV-5000/3000 Series
Description of Operation
FRLDM It will read the data saved in the storage (memory card for KV-5000/3000 series) specified by
n1 to the file register of the bank No. n2 in batch (according to the FRSTM instruction
or the "File Register Settings" of KV STUDIO) at the rising edge of the execution condition.
(The file will always be overwritten).
File No. S is specified with number.
The read file is named as \FR\FR (file No. is 3-digit).FRU*.
* The file extension for KV-5500/5000/3000 is FRB.
The end notification is written in D , and the error notification of abnormal end is
written in [ D +1].
• D turns OFF when execution of the instruction starts, and turns ON when write
processing to the storage ends. It becomes ON either when the command is normally
finished, or abnormally finished.
• D +1 turns OFF when the instruction ends successfully, and turns ON when
execution ends in error.
The error code is stored in CM2390.
The command will not be executed when the storage device instructions in execution
Point
relay (CR3214) is ON. Please implement exclusive control using CR3214.
Operation flag
LADDER PROGRAMMING
CR2009 No change in state
CR2010 No change in state
CR2011 No change in state
• ON when the value saved in n is larger than "15" ("3" for KV-5500/5000/3000)
• ON when the value saved in S is larger than "999"
CR2012 • ON when the indirect specification or index modify range is inappropriate.
• ON when an access outside the operand range occurs
4
Otherwise OFF
File Register
"Latest error details (CM)" (page 4-87)
Sample Program
When input relay R000 is ON at the rising edge, read the data of file No. 10 in the memory card into
thefile register of Group 0.
The procedure from KV-8000 Series installation to operation is shown in the figure below.
4
Push-button switch PB2:OFF PB2 is a b contact switch
Lit status of pilot lamp PB1 PB2
Push-button switch PB1:OFF
(PL) is maintained
Operation details Push-button switch PB2:OFF
even if PB1 is turned OFF.
consideration
Programming Skills
Timing chart RL
ON
PB1 contact
OFF
ON
PB2 contact
OFF
ON PL
PL
OFF
Unit Configuration
When there are many pieces of I/O equipment used in control and
when you are using expansion functions, consider using expansion
units.
Create a Program
"4-7 How Data Is Processed" (page 4-75)
"Program Creation Support" (page 4-238)
"Key Points to Program Creation" (page 4-258)
"4-10 Function Blocks" (page 4-117)
For details, see the KV-8000/7000/5000/3000/1000 Series and
KV Nano Series "Instruction Reference Manuals."
LADDER PROGRAMMING
Programs are converted when they are transmitted to a PLC for
monitoring and when you switch to the simulator. If a conversion error
occurs, remove the cause of the error while referring to the output
window.
Program "Conversion" (page 4-266)
"Local Device Input and Errors during Conversion" (page 4-204)
conversion
"Appendix 1 Error Message Lists" in the "KV STUDIO User's
Manual"
"Key Points to Program Creation" (page 4-258)
4
Programming Skills
Program Change and add programs.
"Creating Clear, Legible Programs" (page 4-252)
changes
"Online edit" (page 4-269)
and "Writing data during RUN mode" (page 4-267)
additions "Simulator edit" (page 4-271)
Use the useful monitor and simulator functions to debug the program.
Monitor "Monitor" (page 4-268)
Monitor and Simulator "Simulator" (page 4-270)
simulator
Completion
This section will explain some convenient functions that can reduce your entry and modification
workload during ladder program creation.
Mnemonic entry
As mnemonic instructions can be entered without a mouse, programs can be created more quickly than
4 when using the "Instruction palette".
Programming Skills
Entry mode
Use the keyboard to enter the first character of the instruction.
(Example) Entering the MOV instruction
Reference On the "Tool" menu, click "Option," click the "Setup edit/key" tab, and then select the
"Zoom out direct entry dialog box" check box to minimize the display of the "mnemonic
direct entry" dialog box.
For details on the instructions, see the KV-8000/7000/5000/3000/1000 Series and KV Nano
Series "Instruction Reference Manuals."
LADDER PROGRAMMING
Reference • You can omit the target devices and values that are specified by the instruction and
operands when you enter the instruction.
(Example) A 0 LD R000
"App-6 List of Abbreviated Mnemonics" (page A-23)
• To use the "mnemonic direct entry" dialog box to edit cells that have already been
entered, press Esc or F2 . (If you click "Option" on the "Tool" menu, click the
"Setup edit/key" tab, and then select the "Start up direct entry by Enter key" check box,
the 㾑 key will be assigned to the "mnemonic direct entry" dialog box.)
Entry assistance 4
Programming Skills
There are several functions that can assist you in entering instructions when you are using mnemonic
entry.
Shortcut keys
LADDER PROGRAMMING
If you use shortcut keys, you can perform operations with just the keyboard and without using a mouse.
Also, because this reduces the number of keystrokes, it also reduces the amount of time spent entering
data.
This section will explain typical shortcut keys.
"App-7 List of Shortcut Keys" (page A-25)
The "mnemonic direct entry" dialog box is displayed, and you can use it to directly enter and edit
mnemonics.
㾑
When a blank cell is selected in editor mode
The "mnemonic direct entry" dialog box is displayed, and you can use it to directly enter and edit
mnemonics.
Ctrl + M
If a cell with an existing entry has been selected, the "Operand" dialog box described above is
displayed, and you can edit the comment.
+ X / C / V
LADDER PROGRAMMING
Ctrl
Ctrl + Shift + V
Set the number of items to paste to paste multiple times.
In addition, you can offset the included devices. 4
See in "5-1 About Edit Functions - Multiple Paste" in the "KV STUDIO User's Manual."
Programming Skills
Ctrl + Z / Y
These are standard editing shortcut keys for Windows applications.
Ctrl + Z Undo
Ctrl + Y Redo
Ctrl + /
Move the cursor in units of ladder circuit blocks.
Ctrl +
Select the entire line in which the selected cell resides.
Ctrl + Shift + /
Change the operand number of the selected cell.
Insert, Delete
LADDER PROGRAMMING
Insert
Delete
Shift + Delete
Delete a rung.
Ctrl +㾑
Insert rung comments.
"Rung comments" (page 4-254)
Draw a connecting line from the selected cell to the end of the line.
Alt + / / /
If there is no connecting line in the direction of the arrow key, draw a connecting line in this direction.
If there is a connecting line in the direction of the arrow key, delete this connecting line.
Ctrl + H
The "Device replace" tab of the "Search/replace" dialog box is displayed.
Space
View
LADDER PROGRAMMING
Ctrl + F7
Ctrl + E
The "Device use list" window is displayed.
You can use this to easily check the unused devices.
See "6-2 About View Functions - Device Use List" in the "KV STUDIO User's Manual."
4
Programming Skills
Page
Ctrl + Up / Ctrl + Page
Down
Ctrl + Space
Shows and hides comments in the ladder editor.
You can search for instructions and operands that match the specified conditions. You can also display
the items that match the search conditions as a list in the output window.
When searching for devices, use the cross reference function. You can display this list just by pressing
the space bar.
"Cross references" (page 4-244)
• Ctrl + F
You can set the target to "Device", "Variable", "Constant", "Program", "Device comment", "Variable
comment", "Hold / Invalid" or "Invalid line".
Cross references
1 Select the device (ladder symbol) whose cross references you want to create.
2 Select "Edit (E)" -> "Cross reference (X)" -> "Create operand list (O)" from the menu.
A list of search results is displayed in the [Search 1]/[Search 2] output window.
Alternative procedure • (space) bar
• Right click and select "Cross reference (L)" -> "Create operand list (O)" from the
menu.
3 Double-click the item that you want to check in the search result list.
LADDER PROGRAMMING
When you double-click a device that is displayed in the list, the cursor moves to the corresponding
device (symbol) on the ladder.
Alternative procedure • F3
• Shift + F3
Programming Skills
4 When you want to move the cursor focus to the next item, press F3 .
Relation mapping
LADDER PROGRAMMING
Point
It can be used only when the compatible model is KV-8000(A).
After entering the object device and clicking "Search (F)", the "Relation Mapping" window will be
displayed with the input device as the object. The information on the ladder programs / functions with
status change or the causes for status change can be displayed in the "Relation Mapping" window.
Ladder
Description of blocks
LADDER PROGRAMMING
Device block
Display the devices used in the ladder block diagram. Click the "Display Switch" button on the upper
left of the "Relation Mapping" window, and then press Ctrl + G to switch between the device comment
display and device display.
Ladder block 4
Programming Skills
Display the module name and line number used by the searched device. When selected, the ladder
program object is displayed in the selected ladder display window.
Point
• The ladder programs cannot be edited in the selected ladder edit window. To edit
the ladder program object, right-click in the selected ladder edit window, select
"Jump", and then edit the original ladder program.
• The scripts cannot be expanded.
Flow block
Display the unit number of the object unit when the searched device is used in the unit program (flow).
Setting block
Display the unit setting name and unit number where the searched device is used. The unit settings
displayed in the setting block are as follows.
• PLC link
• PROTOCOL STUDIO
• Industrial Ethernet (EtherNet/IP (Adapter), PROFINET, CC-Link IE Field, EtherCAT)
• Simple PLC link
• FL refresh setting
• Serial PLC link
• Device initial value setting
• Inter-unit synchronous refresh
Displayed when the device value is changed for the searched device from the human machine
interface or access window.
Point
The device value change block can be displayed only in the monitor / online edit /
replay mode.
Additional search
Click the "+" button displayed in the device block to perform additional search and display for the
cause that has changed the status of the device.
4
Programming Skills
Pinning
You can fix the display of the ladder block by clicking the icon displayed on the ladder block.
Jump
It can only be used in ladder blocks, flow blocks and setting blocks. Right-click the block and click
"Jump (J)" to display the following contents.
Item Description
Ladder block Move to the line of the object ladder.
Flow block Display the object flow.
Setting block Display the object setting screen.
MEMO
LADDER PROGRAMMING
4
Programming Skills
Window menu
LADDER PROGRAMMING
Using the Window menu can help you improve your program creation efficiency.
This section will explain how to use the "tabbed document" in the Window menu.
Tabbed documents
The module, macro can be displayed in tab format by selecting "Window(W)" "Document with tab
attached" from the menu of KV STUDIO Ver.8 or later.
4
Programming Skills
Tab
Use this key to select
tabs and use Alt +
F6 to switch
between tabs.
Drag and drop a tab and use the docking function to easily display modules and macros in tiled format.
Displayed in a tiled
Use drag and drop format at right
to attach at right
Split
LADDER PROGRAMMING
You cannot display a program in its entirety if the program is too long.
You can use the "Split" function to split the display of a program into two, so that you can view two parts
of the program at the same time.
1 On the "Window" menu, click "Split."
Programming Skills
A separating
line is displayed.
Use the mouse
to determine
the split position.
After you
determine
the split position,
you can freely
change
the height.
When you determine the split position, the upper and lower screens both display the start of the
program by default.
Use the scroll bars on the right side of the upper and lower screens to display the desired program
positions.
Alternative procedure If you move the mouse cursor to the position shown in the following figure, the mouse
cursor will change to " ," and you can drag the cursor to start splitting the program
display.
Release the mouse cursor at the position that you want to fix the split.
Reference • You can copy and paste parts of the ladder program between the upper and lower
screens.
• You can also set the display sizes of the screens independently.
Device comments
global devices and local devices. When bit processing is being performed on a word device, you can
use device comments in units of bits.
R4000
Entry method
LADDER PROGRAMMING
The following two methods are available for entering device comments.
• Enter the comments in the "Operand" dialog box ( Ctrl + M ).
• Enter the comments in the "Device comment edit" window.
Reference It is useful to write programs with the "Device comment edit" window displayed, because
you can enter instructions while viewing the device comments. You can display up to three
of these windows at the same time.
4
Programming Skills
Display method
After you set device comments, on the "View" menu, click "Display cmnts" to show and hide the device
comments on the ladder editor.
Alternative procedure Ctrl + Space
Rung comments
LADDER PROGRAMMING
You can write comments on every rung in the ladder editing window.
Rung comments make it easy to understand the contents of each circuit block at a glance during
program editing.
Also, you can display just rung comments in a list and move to the rung of a specific rung comment.
4 Circuit
block
description
Programming Skills
Entry method
Follow the procedure below to enter rung comments.
1 In the ladder editing window, position the cursor on the rung in which you want to enter a rung
comment.
2 Right-click, and then click "Insert rung comment" in the menu that is displayed.
Alternative procedure • On the "Edit" menu, click "Insert," and then "Rung cmnt."
• Ctrl + 㾑
The rung comment editor is displayed as shown below. Enter the rung comment.
LADDER PROGRAMMING
Display the rung comments in the ladder editing window as a list. You can move to the rung whose
comment you select from this list.
Follow the procedure below to search for rung comments.
Alternative procedure Ctrl + L
Programming Skills
The "Search/replace" dialog box is displayed.
4 3
4 Double-click the rung comment whose rung you want to jump to.
LADDER PROGRAMMING
The rung of the selected rung comment will be displayed in the ladder editing window.
4 Double-click
Programming Skills
KV script
Write calculations, character string processing, and other parts that are tedious to write in ladder
programs as KV script.
KV script
For details, see the KV-8000/7000/5000/3000/1000 Series and KV Nano Series "Script Programming
Manuals."
Program organization
LADDER PROGRAMMING
To create programs that are easy to debug and reuse, write programs in modules (components) for
each function and process, and assign easily understandable names to these modules. Also, turn
frequently used ladder circuits into function blocks or macros (original instructions), and give them an
easy-to-remember name so they can be used simply, like instructions.
"4-7 How Data Is Processed" (page 4-75)
"4-10 Function Blocks" (page 4-117)
Device defaults 4
Programming Skills
Use the "Setup defaults device" dialog box to manage the programs in which initializing the devices is
tedious when done by writing all the initializations in the ladder program. When operations start, the
registered values are all written automatically.
Click "device default" in the workspace.
This section explains the information and precautions that you should understand to create ladder
programs.
4 one rung, which reduces the number of rungs in the program, and thus clarifies the processing sequence.
In KV STUDIO, you can switch between expanded ladder input mode and normal ladder input mode.
Programming Skills
Reference • When the expanded ladder mode is enabled, "Expanded ladder mode" on the menu is
displayed with a check mark, and the icon is displayed with a frame surrounding it.
• When you select expanded ladder mode, the cursor does not automatically move to the
right side of the rung when you enter an output instruction, and you can continue
entering instructions on the same rung. When you are in normal ladder mode, the
cursor automatically moves to the right side of the rung when you enter an output
instruction.
• In the default settings, expanded ladder mode is disabled.
(3)
R002
(5) (6)
R003 MOV
#1000 DM0
• To set the module execution sequence, in KV STUDIO, open the "CPU system setting"
dialog box, and then click "Execute sequence of modules."
"Module Execution Sequence" (page 4-109)
LADDER PROGRAMMING
Typical patterns that cause conversion errors are shown below.
Programming Skills
Reference The ladder program to
the right is unconnected, A B
so a conversion error will
occur. C
R1000
Internal
You cannot write instructions such as those for R1000 auxiliary relay R1000
output coils, timers, and counters directly from
the rail.
If execution conditions are not required, insert
the b contact of an unused internal auxiliary #10 CR2002 #10
relay or control relay CR2002 (the contact that is T0 T0
always turned ON) as a dummy.
(Incorrect) (Correct)
A B D R1000 E
R1000
4
A B C
Programming Skills
D R501
Reference When you use KV STUDIO to create a new program, the "END" or "ENDH" instruction is
automatically inserted. Write the "END" or "ENDH" instruction in a ladder program. If you
write these in a script, the program may not operate correctly.
LADDER PROGRAMMING
Non-convertible ladders Convertible ladders
C
4
Programming Skills
In the circuit shown in the figure to the right, A R1000 A R1000 R2000
R2000 will not be output.
By rewriting the circuit, the output can be
generated for only one scan.
C E R2000 C E
F F E
E R2001 C E R2001
Double coil
LADDER PROGRAMMING
If you use two or more of the same OUT or OUB instruction for the same device within a project, the
last instruction to be executed within a scan is given priority, and the other instructions are ignored.
If the instructions are on separate rungs or exist in different programs, they are processed as shown
below.
(Example) As shown in the figure below, when the R2000 output instruction is used twice
・・・
R003 R2000 R003 R1001
・・・
R1000 R2000
A conversion error will not occur for double coil, but do not use them because they make operations
complicated.
To check whether double coil exists, in KV STUDIO, on the "Convert" menu, click "Double coil check."
• If you call the same function block or macro two or more times, a double coil
Point
will occur if an OUT or OUB instruction that uses a global device is present.
• Even if a double coil, there is no effect if it is described in a module or function
block that is not running.
How to avoid double coils between the same function block or macro
LADDER PROGRAMMING
If you call a function block or macro with an OUT/OUB instruction that uses a global device 2 times or
more, a double coil will occur. You can avoid this by processing as shown below.
(1) Set the operand of the OUT/OUB instruction in the function block or macro to an IN-OUT type
argument or argument P.
4
(2) Use the argument added in (1) that is specified in the function block or macro call instruction to
Programming Skills
specify a different internal auxiliary relay per call.
・・・
P1
P1
(3) Add the ladder program to output separately using OR outside the function block or macro.
R1000 R1000
R1001
Interlock
In programs, when one party acts, another party cannot act to prevent simultaneous actions by both
parties. This exclusive processing composition mode is called interlock.
Although this is often necessary for actual equipment, its operations are very complicated to explain, so
it is omitted from the sample programs introduced in the KV-8000/7000/5000/3000/1000 Series
and KV Nano Series "Instruction Reference Manuals."
(Example) A circuit that prevents R2000 and R2001 from being turned ON at the same time
If you use the bit that is turned ON during module or macro execution, you can easily create an
interlock circuit.
"Bit That Is Turned ON during Macro Execution" (page 4-189)
"Macro System Devices" (page 4-188)
When the scan time becomes long, the update period of I/O and values becomes long, so the response
of the machines and equipment worsens. Also, if the scan time exceeds 300 ms, a "Scan time over
error" (CPU error E30) will occur, and it will not be possible to continue operations.
You can reduce the scan time by using the following methods.
4 instructions (MDSTRT and MDSTOP) to only execute the modules when necessary.
"Module instructions" (page 4-115)
Programming Skills
Reference The same concept holds when you use the CJ or GOTO instructions to create programs
with looped processing.
Specifying devices with even numbers to 32-bit and 64-bit processing operands
Use even-numbered devices to specify 16-bit word devices such as DM, W, and TM for the operands of
instructions that process 32-bit or 64-bit data such as those with the .D, .L, .F, or .DF suffix. If you use
two words from an odd number, the processing speed will decrease.
Reference In the same manner, for DM and TM, use even numbers for local devices. During
conversion, even-numbered local devices are always assigned to even-numbered global
devices, and odd-numbered local devices are assigned to odd-numbered global devices.
Therefore, more device areas than those assigned to the program may be used.
LADDER PROGRAMMING
To organize your programs by using modules, function blocks and macros effectively, use local devices
and variable to the maximum extent. Precautions for using local devices are explained below.
• Except for the devices assigned to the CPU unit and the units that you are using, the devices
referenced by the connected peripherals (such as touch panels), the devices that will be shared
among the entire project, and the devices that need to transfer data between modules, use all
devices as local devices.
• The first local device is number 0. Use local devices with as small numbers as possible.
• Because R and DM devices are assigned to units, an area that is used as global devices is required.
Give priority to MR/LR and EM when using local devices. 4
"4-12 Local Devices" (page 4-200)
Programming Skills
"4-5 Variable" (page 4-55).
<Index modification>
Better The specification method is simple.
Good You cannot change the type of devices that are specified.
Good You cannot use index register Z as a local device.
You can use the "ZPOP" and "ZPUSH" instructions without considering how many
index registers you can use.
<Indirect specification>
Better You can change the type of devices that are specified.
Good The specification method is complicated (to process addresses, you have to use
dedicated instructions).
Unless you want to change the device type, we recommend that you use index modification, which is
easier to handle.
"Modification according to index registers" (page 4-44)
Conversion
LADDER PROGRAMMING
Before you use the monitor or simulator, you have to convert the ladder program that you have created
to a format that can be processed by the CPU unit.
• Ctrl + F9
4
• On the "Monitor/Simulator" menu, click "PLC transfer monitor mode" to automatically
Programming Skills
Reference
convert and transfer the data and to start the monitor.
• On the "Monitor/Simulator" menu, click "Simulator" to automatically convert the data
and start the simulator.
Transfer
On the "Monitor/Simulator" menu, click "Transfer to PLC" to transfer the converted ladder program to
the CPU unit.
• With the default settings, the programs stored on the PLC will not be deleted
Point
when you transfer a program. To delete unused programs when you transfer
programs, select the "Clear program in PLC" check box in the "Transfer
program" dialog box.
• If the function version of the project stored in the PLC unit and the function
version of the project you are transferring differ, all clear must be executed
before transferring.
Reference On the "Monitor/Simulator" menu, click "PLC transfer monitor mode" to automatically
convert and transfer the data and to start the monitor.
4-266 - KV-8000 Series User’s Manual -
4-15 Programming Skills
LADDER PROGRAMMING
You can write data during RUN mode if the CPU unit is in the RUN state when you transfer a ladder program.
This function enables you to overwrite the executing ladder program when the CPU unit is in the RUN
state. You can make fine operation adjustments and parameter changes without stopping the device
and the production line.
The scan time of writing during RUN can be extended by maximum 2ms.
Programming Skills
Select this to write data
during RUN mode.
Depending on the status of the control equipment connected to the CPU unit, it
CAUTION may be dangerous to write data during RUN mode. Exercise caution when
executing this function.
• When data finishes being written during RUN mode, even if the execution
Point condition ON/OFF state changes, differential instructions within the range of
data written will not be executed.
• Even if you change the set value of a timer or counter and then write the data
during RUN mode, the current values will not have changed when the data
finishes being written.
Monitor
LADDER PROGRAMMING
The monitor is used to transfer the ladder program that you have created with the ladder editor to the
CPU unit, execute the program, and view the operating status.
4 • Force the input contacts to turn ON or OFF from the monitor screen by carrying out forced set/reset.
• Easily change the device data and the set and current values of timers and counters.
Programming Skills
• Specify the range of data, such as the current value of a device, to save or load the data.
• Return some devices to their initial values.
On the "Monitor/Simulator" menu, click "PLC transfer monitor mode" to start the monitor. Before you
carry out this process, connect the CPU unit and the PC, and configure both devices so that they can
communicate with each other.
• Ctrl + F8
Reference The current status (such as monitor, online editing, or editor) is displayed in the KV
STUDIO title bar.
For details on the different functions, see "Chapter 9 MONITOR & SIMULATOR" in the "KV
STUDIO User's Manual."
Online edit
LADDER PROGRAMMING
You can use the online editing function to change ladder programs directly from the KV STUDIO
monitor screen. This function is useful when you want to make on-site adjustments during the final
debugging of program creation and when you want to change simple programs.
While you are monitoring, on the "Monitor/Simulator" menu, click "Start Online Edit" to start online
editing.
The location being edited is displayed in light blue, which enables you to see which cell is being edited
at a glance.
When the program finishes being transferred, the light blue of the location being edited returns to the
original background color. 4
Programming Skills
Alternative procedure • Select "Online edit" from the mode list.
• Click .
• F10
If the online editing function is used while the PLC is in the RUN state, incorrect
operations may cause serious damage to equipment and serious injury to
workers. Thoroughly check the following precautions to ensure correct use of
this function.
• Thoroughly check the area around the equipment, and ensure that no damage
to equipment and injury to workers will arise even if problems occur when you
CAUTION use the function.
• Do not add circuits that operate immediately after the program is transferred
(such as circuits whose execution condition is the B contact). Doing so may
cause the equipment to run out of control.
• If you delete output instructions that have been turned ON (such as OUT) and
then transfer the program, the output will be retained as being turned ON.
Reference When you transfer data during online editing, only the changed circuit blocks are written
to the PLC. However, changed programs are written in their entirety in the following
situations.
• When several modules have been changed.
When editing the ST/Script which exceeds the local work area
• When variable have been added so that the local work area is exceeded.
• When the program inside of a function block has been edited (the function block is
transferred in its entirety).
• When the program inside of a macro has been edited (the macro is transferred in its
entirety).
• When the number of individual local device assignments has been changed.
• When a macro call has been added.
• When a function block call has been added.
• When the ENDH instruction has been edited.
• When a structure is edited (Modules or function blocks that use the edited structure
are transferred.)
• When global variables and function block arguments used in multiple modules or
function blocks are edited (Modules and function blocks that use the edited global
variables and function blocks are transferred.)
For limitations and precautions of writing data during RUN mode, see "Writing data during RUN
mode" (page 4-267).
For details on the online editing function, see "9-9 Online Edit" in the "KV STUDIO User's Manual."
Simulator
LADDER PROGRAMMING
The simulator simulates on a PC without connecting the PLC the operation of the ladder programs that
you have created with the ladder editor.
You can use the simulator to:
• View the operating status of the program by using the ladder monitor, registration monitor (time
chart), and batch monitor.
• Perform simulations with various execution methods such as continuous scan/continuous step and
continuous step.
• Easily change the set values and current values of timers, counters, and devices.
• Register forced sets and resets of contacts.
On the "Monitor/Simulator" menu, click "Simulator" to start the simulator.
• Click .
• Ctrl + F2
Reference The current status (such as simulator, monitor, or editor) is displayed in the KV STUDIO
title bar.
For details on the different functions, see "9-11 Simulator - Executing Simulator" in the "KV
STUDIO User's Manual."
For details, see "9-11 Simulator - Simulator Restrictions" in the "KV STUDIO User's Manual."
Reference There may be variations in the numeric values of timers because of the performance of
your PC.
Simulator edit
LADDER PROGRAMMING
The simulation editing function allows you to directly edit ladder programs during "KV STUDIO"
simulator operation. This function is useful when you want to make on-site adjustments during the final
debugging of a created program or editing a simple program.
When monitor/online edit is not running, select [Monitor/Simulator(N)] → [Simulation edit] from the
menu to start simulation editing.
The location being edited is displayed in light blue, which enables you to see which cell is being edited
at a glance.
When the light blue edited cells have been transferred, they return to their original background color.
4
Programming Skills
Alternative procedure • Select "Simulation edit" in the mode bar.
• Simulation edit is available only to the CPU unit of the KV-8000/7000 Series.
Point
• You cannot switch from Simulation edit to monitor mode or online edit mode.
Instead, first switch to edit mode, then to monitor mode and finally to online
edit mode.
For details on what functions are available during simulation edit, refer to "Online edit" (page 4-269).
Replay
LADDER PROGRAMMING
Replay is a function that plays back the operation record before and after the set trigger condition is
met. The operation record can be checked while replaying, stopping, rewinding and frame advance, so
that the situation when the fault occurs can be mastered. Select if the replay mode is switched to after
reading the operation record in the CPU unit or opening the already acquired operation record.
The operation record contents that can be played back during replay are as follows.
4 Type Details
Data for different scan times in the buffer memory of the PLC device and extension
Programming Skills
Device
unit before and after the trigger condition is met
Video data shot with KV-CA02 by different frame rates before and after the trigger
Camera
condition is met
Event log of errors or device value changes, etc. before and after the trigger condition
Event/error
is met
Project data Project data when the trigger condition is met
To start replaying, select "Operation Record / Replay (R)" → "Replay Mode (R)" from the menu.
• To use Replay, KV STUDIO Ver.10.0 or later and KV REPLAY VIEWER are required.
Point • The replay function can be used only when KV-8000(A) is selected as the compatible
model.
• It is impossible to change from the replay mode to other modes than the editor
mode.
• For details on the replay mode, refer to "KV STUDIO User's Manual".
• If the project started when switching to the replay mode is different from the project
of the operation record, a dialog will be displayed to close the active project and
start the project of the operation record or play back the operation record using the
active project.
Monitor functions
LADDER PROGRAMMING
This section explains the functions that are useful when using the monitor and simulator to debug
efficiently.
For details on how to operate each function, see the "KV STUDIO User's Manual."
Programming Skills
Alternative procedure Select the cell whose bit device status you want to change, and then press Space .
During monitoring, the contacts and external I/O relays of timers and counters
Point
cannot be turned ON and OFF.
Reference To forcibly turn the external I/O on and off when monitoring, select "Compulsory setting/
reseting registration (X)" from "Debug (D)" from the menu.
The "Correct device value" window is displayed. If you select multiple cells and then press F2 , all the
devices contained within the selected range are displayed.
You can change the values by entering values in the "Current value" column.
Reference If you select an instruction in which index modification or indirect specification is being
used, the referenced device is displayed.
To register a device in the Register monitor or Batch monitor, select the instruction that includes the
device you want to monitor. Move the cursor to the edge of the cell until it becomes a " ," and then
drag the cell to the "Register monitor" dialog box.
4
Programming Skills
Reference • If you select multiple cells and drag them all to the dialog box, all the devices contained
within the selected range will be registered.
• You can also enter devices directly in the "Register monitor" dialog box.
Watch window
This function is used to automatically monitor all the devices that are contained within the circuit block
of the selected cell.
To show and hide this window, on the "Monitor/Simulator" menu, click "Hide/show monitoring window."
LADDER PROGRAMMING
In the monitor or simulator, you can display the local devices and local labels in the ladder program that
you have created as the assignment destination devices that are assigned at the time of conversion.
On the "Tool" menu, click "Option" to display the "Setup option" dialog box. On the "Set display mode"
tab, select the "Display local assign devs during mon" check box.
Programming Skills
Select this check box.
Alternative procedure From the menu, select [Display] → [Display local assign devs during mon(W)].
Monitoring instructions
LADDER PROGRAMMING
You can monitor the devices used in the PIDAT instructions that are written in the ladder program.
Right-click a PIDAT instruction, and on the menu that appears, click "Command monitor" and then
"PIDAT."
This is useful when monitoring measured values, set values, and other parameters that are used with
PIDs.
Alternative procedure On the "Monitor/Simulator" menu, click "Command monitor," and then "PIDAT."
For details, see "Command monitor" in the "KV STUDIO User's Manual."
LADDER PROGRAMMING
(Performance monitor)
You can monitor the execution time of the programs or interrupt programs currently being executed.
Programming Skills
Monitoring units
In the workspace, right-click an expansion unit, and then click "Unit Monitor" in the menu that appears
to display the unit monitor.
Alternative procedure • On the "View" menu, click "Unit Monitor."
• When you are monitoring from the Unit Editor, you can display the unit monitor by
right-clicking a unit and clicking the appropriate menu item in the menu that appears.
(Example) KV-SAD04
Point This cannot be displayed when you are using the simulator.
4
Programming Skills
KV-7500
&GXKEG/QFG
'TTQT%NGCT
7PKV6GUV
5VTCIG
REALTIME
Logic Controller
CARD
Memory Card
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 5-13)
• Auto-read function
When powered on, read data to CPU unit automatically, these data are saved in "AutoLoad" or "AtLoad**"
(** : 01 to 99) (item) folder. If they are saved in "RunLoad" or "RnLoad**" (** : 01 to 99) folder in advance,
during PRG → RUN switching, it will read automatically.
"Auto Load Function" (page 5-24)
Point
When using the recipe load / save function, the CPU function version should be
upgraded to 2.0 or later.
• Logging/tracing 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.
"5-5 Logging/Tracing" (page 5-57)
5
Memory Card
KV
-SI
R3
2X
0 T
1
8
2
0 9 10 3
8 1 11 4
9 2 12 5
10 3 6
13
11 4 14 7
12 5 15
13 6
14 7
15
IN
OU
T
• Logging of device values is easy. Data is tabulated from logs to create data sheets with greater ease.
KV
-SI
R3
2X
0 T
1
8
2
0 9 10 3
8 1 11 4
9 2 12 5
10 3 6
13
11 4 14 7
12 5 15
13 6
14 7
15
IN
OU
T
• It is very easy to identify the error cause. The ladder program when an error occurs can be checked
for each scan, or checked against the frame-by-frame video shot by the camera, which can be used
to identify the cause for the equipment error.
An error occurred
Memory Card
Card reader/writer
This unit is for reading and writing data on memory cards 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) Use the storage transfer tool to read and write via PLC.
Start "Tools (T)" → "Storage transfer tools" in the KV STUDIO menu.
Memory Card
For details, see "KV STUDIO User's Manual."
(3) Use the FTP server function or other device to read and write via PLC.
After using the CPU unit or Ethernet unit that supports the FTP server function, the data of the CPU
memory card in the PLC can be read and written via an Ethernet cable.
Data on a memory card is stored in the "0 CARD" folder.
2
10 3
11 4
9 2 12
10 3
1
11 4
12
1
5
2
Memory Card
KV
-S
IR
32
0 XT
1
8
2
0 9
10 3
8 1 4
11
9 2 12 5
10 3 6
13
11 4 14 7
12 5 15
13 6
14 7
15
IN
OU
T
OU
T
3 After inserting the memory card, close the memory card slot cover until it clicks into place.
3 After removing the memory card, close the memory card slot cover until it clicks into place.
Memory Card
written). Doing so might corrupt the data on the memory card.
• In environments subject to severe noise, it may take longer time to access the
Point
memory card.
(In the worst case, this might damage the card or FAT (File Allocation Table).
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 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 office.
Attribute
Device No. R: Load only Name Description
Empty field: Read/write enabled
Use for reidentification after
unmounting a memory card. Since
memory cards are normally identified
Memory card mount automatically when mounted, there is
CR5400
request no need to run the memory card mount
request.
* Use the SET instruction to run
5 requests.
Unmounts inserted memory cards.
When unmounting is completed, the
Memory Card
Attribute
Device No. R: Load only Name Description
Empty field: Read/write enabled
Memory Card
Recipe save request relay. When
turned from OFF to ON, the recipe
contents of the folder number specified
by CM1876 of the drive specified by
CR5512 Recipe save request CM1875 are referenced, and the
recipe of the folder number specified
by CM1877 is overwritten using the
device / variable values of the CPU
unit.
Recipe save completion relay. ON
when the recipe save is completed.
CR5514 R Recipe save complete
OFF when the recipe save request
relay turns from OFF to ON.
Recipe save failure relay. ON when the
recipe save is failed. OFF when the
CR5515 R Recipe save failed
recipe save request relay turns from
OFF to ON.
Drive number when loading recipe.
Drive number when loading When CR5508 turns from OFF to ON,
CM1870
recipe the recipe of the drive number stored is
loaded.
Folder number when loading recipe.
Folder number when When CR5508 turns from OFF to ON,
CM1871
loading recipe the recipe of the folder number stored
is loaded.
When the recipe load completion relay
Completion code when
CM1873 R turns ON, the completion code is
loading recipe
stored.
Drive number when saving recipe.
Drive number when saving When CR5512 turns from OFF to ON,
CM1875
recipe the recipe is saved to the drive number
stored.
Reference folder number when saving
Reference folder number recipe. When CR5512 turns from OFF
CM1876
when saving recipe to ON, the recipe contents of the folder
number stored are referenced.
Output folder number when saving
Output folder number when recipe. When CR5512 turns from OFF
CM1877
saving recipe to ON, the recipe is saved to the folder
number stored.
When the recipe save completion relay
Completion code when
CM1878 R turns ON, the completion code is
saving recipe
stored.
Attribute
Device No. R: Load only Name Description
Empty field: Read/write enabled
CPU BUILT-IN FUNCTIONS
turns ON.
Project save drive number (request).
Saves the project folder to the drive
specified when the project save
Project save
CM1888 execution request relay turns OFF to
drive number (request)
ON.
0: Memory card
1: CPU memory
Project save folder number (request).
Saves the project folder with the folder
number specified when the project
Project save save execution request relay turns
CM1889
folder number (request) OFF to ON. Enter with 0, 1 to 99. If 0 is
specified, searches for an empty
number and sets it as the folder
number.
Project save The saved drive number is stored. 0 is
CM1890 R
drive number (complete) stored if the project save fails.
• When a BOOL array type variable is assigned to CR, the element number of the
Point
array should be specified with a value. When specified with device or variable,
the SET instruction cannot operate properly.
Memory Card
value of device. Access window
Communication setting KV STUDIO
□.YAS*1
information (File>Memory card)
Unit setting information □.YLB*1
Logging/tracing setting
□.YLG*1
information
CPU memory capacity setting □.YMC*1
operation recorder setting □.YTR*1
Access window setup
□.YAW*1
information
DM DM.ZDV
EM EM.ZDV
FM FM.ZDV*2 *5
KV-8000(A) CM CM.ZDV
CR5502 turns OFF to ON
R R.ZDV Access window
Device
MR MR.ZDV KV STUDIO
File
LR LR.ZDV (Monitor/simulator
>Batch change window)
CR CR.ZDV
B B.ZDV
W W.ZDV
ZF ZF.YDV*5
CR5502 turns OFF to ON
Access window
Email setting information. MAIL*.YSH(*=0 to 48)*4
KV STUDIO
(Email setup tool)
CR5502 turns OFF to ON
FTP client-side setting Access window
FTPC*.YSH(*=0 to 48)
information KV STUDIO
(FTP client-side setup tool)
CR5502 turns OFF to ON
OPC UA server setting
UASVR*.YSH(*=0) Access window
information
KV STUDIO
Version information when CR5502 turns OFF to ON
memory card data are Savelog.txt Access window
generated KV STUDIO
*_XD02.YTC(*=01 to 16) CR5502 turns OFF to ON
Data application unit
KV-XD02 Access window
parameter file *_XD02.YTV(*=01 to 16)
KV STUDIO
CR5502 turns OFF to ON
Camera input unit parameter
KV-CA02 *_CA02.YTC(*=01 to 16) Access window
file
KV STUDIO
KV STUDIO
CR5502 turns OFF to ON
Communication unit
KV-XCM02 *_XCM02.YTC(*=01 to 16) Access window
parameter file
KV STUDIO
KV-XL402 *_XL402.YTC(*=01 to 16) CR5502 turns OFF to ON
Serial communication unit
Access window
KV-XL202 parameter file *_XL202.YTC(*=01 to 16)
KV STUDIO
PROTOCOL STUDIO 2
KV-L2*V settings
File (PS1 compatible PB*.ZSH(*=1A to 48B) *3
(PROTOCOL STUDIO 2)
(standard/Large) mode)
5 KV-L2*V
PROTOCOL STUDIO 2
CR5502 turns OFF to ON
Access window
PB*.YSH(*=1A to 48B)
File (Protocol Studio2 mode) KV-L2*V settings
Memory Card
(PROTOCOL STUDIO 2)
KV-XH16ML *_XH16.YTC(*=01 to 16)
KV-XH04ML *_XH04.YTC(*=01 to 16)
Positioning unit, motion CR5502 turns OFF to ON
KV-XH64EC control unit *_XH64EC.YTC(*=01 to 16) Access window
Parameter file KV STUDIO
KV-XH32EC *_XH32EC.YTC(*=01 to 16)
KV-XH16EC *_XH16EC.YTC(*=01 to 16)
Positioning unit, motion
KV-ML16V/MC40V/ KV-ML/MC settings
control unit KMP*.YSH(*=1 to 48)
MC20V (KV MOTION+)
Parameter file
Communication positioning
unit parameter setting (Point Communication
KV-LH20V SPSP**.YSH (*=1 to 48)
parameter, control/system positioning setting tool *6
parameter)
CR5502 turns OFF to ON
Positioning unit
KV-SH04PL *_SH.YTC (*=01 to 16) Access window
Parameter file
KV STUDIO
Positioning unit
MB*.ZSH(*=1 to 48)
KV-H20G/H20S/ Parameter file KV-H20S/40S/20G settings
H40S Positioning unit (MOTION BUILDER)
MC*.ZSH(*=1 to 48)
Comment file
MV-L40
MLS*.ZSH(*=1 to 18)
Parameter file MV-L40 settings
MV-L40
MV-L40 (MV LINK STUDIO)
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)
*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 It can not save to memory card and CPU memory from the access window. It will operate successfully
even when reading out project data without these files since the configuration itself is saved in DM and
CM.
*4 When performing email setup through 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.
*6 Not created when saved from the access window. However, the set point parameter etc. is stored in
DM.ZDV.
*7 Data that exists only in KV-8000 with CPU function version 2.0 or later.
Access window
How to save
How to read
Select and read the project folders from Access Window of CPU unit.
"Memory Card" (page 5-3)
5
• Methods of only reading some data
Reference
Memory Card
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" (Folder selection:
"Atload**"(**:01~99)) (project) folder are read automatically.
• At PRG -> RUN, project data saved in the "RunLoad" (Folder selection:
"Rnload**"(**:01~99)) (project) folder are read automatically.
The program load can not be executed in RUN mode. Switch to PRG mode to operate the control relay.
Time chart while loading
(1) (4)
(3) (6)
Project load execution request (CR5500)
(2)
Sample program
Since the project load can not be executed in RUN mode, there is no sample program.
(1) (4)
(3) (6)
Project save execution request (CR5502)
(2)
Memory Card
Project save execution failure (CR5507) (5)
* To specify the folder number when saving, use the project save folder number (request) (CM 1888).
communications, etc.)
(2) If the project save fails, the project save execution failure relay turns ON. (for CPU units)
(3) Turn OFF the project save execution request relay when the project save execution end relay turns
ON. (for ladders, monitors, touch panels, or communication, etc.) When the next project execution
request relay turns OFF to ON, the project save execution end relay and the project save execution
failurerelay turn OFF. (for CPU units)
Sample program
5 To perform the program save, execute with the SET command.
Memory Card
CR5502
RES
Project save
execution request
オートローディング失敗
5
The folder number designated at
Please designate number from 0 to
3 Auto Loading Failed CM was out of range during the Load/Save
99.
execution of auto load or run load.
自动加载失败
Memory Card
ロードできません The folder of CM designated to
Please confirm that project data is
4 Cannot load data memory card/CPU memory does Load
inside.
not exist.
无法加载
メモリカードがありません
---------------------------------------------------
CPUメモリアンマウント The load or save was executed Please insert the memory card
Memory card not found during the condition without being when loading from the memory
5 --------------------------------------------------- Load/Save
CPU Memory unmounted able to recognize memory card/ card, or saving to memory card.
PRGモード時のみ可能です
Please switch to PRG mode to
11 PRG mode only It tried to load with RUN mode. Load
load.
仅PRG模式时可执行
空き容量がありません
There are no free space in the
12 No free space Please increase the free space. Load/Save
memory card/CPU memory.
没有可用空间
17 Only when switch in PRG system program when the switch execute version upgrade of the Load
was in RUN mode. system program.
仅开关处于PRG时可执行
5 加载前 需全部清空
to load do not match, all clear must beforehand as the data to load will
be executed before loading the also be cleared.
project.
Memory Card
メモリカードカバーオープン
Please close the memory card
100 Memory card cover open The memory card cover is opened. Load/Save
cover.
存储卡外盖打开
メモリカードがLOCKされています
The memory card is in LOCK Please release LOCK or use
101 Memory card locked Save
status. memory card that is writable.
存储卡被锁定
ロードできません
---------------------------------------------------
セーブできません
Cannot load data Please check the file system of the Load
102 --------------------------------------------------- The memory card is damaged. -----------
Cannot save data memory card. Save
无法加载
---------------------------------------------------
无法保存
ファイル数上限を超過しました The sum of number of files and
folders inside the user memory has Please reduce the file or folder
103 Max no. of files exceeded Load/Save
gone over the upper limit. inside the user memory.
超过了文件数上限
フォルダ階層が深すぎます
The folder hierarchy inside the user Please confirm the folder hierarchy
104 Folder layer too deep Load/Save
memory is too deep. inside the user memory.
文件夹层数过多
• The file is damaged.
• The memory card is damaged.
ロードできません • The card has been extracted
during the loading process.
• It tried to load from CPU
memory with the configuration
Please confirm if the project and
1000 Cannot load data "Load after clearing the user Load
memory card is appropriate.
memory".
• It tried to execute load from CPU
memory with methods other
than the autoload, run load with
无法加载
the configuration "Load after all
clear".
The load/save completion code can be confirmed on the access window in addition to
Reference
the CM.
Memory Card
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)
CPU BUILT-IN FUNCTIONS
5
Memory Card
Item Description
Displays the name of the output target folder for memory card data output. The folder
Output target folder
name changes according to the folder selection, folder number, and load method.
Select folder Select the folder to output memory card data to. Click the far right of the box to
display the "Browse for folder" dialog box.
Specify a folder number.
When 0 is input : No number is added to the end.
When 1 to 99 is input : The 2 specified digits are added to the end of the
folder name.
Folder No.
The device number on the right indicates the device that specifies the folder number
for each load method.
Load when power is turned on : CM1790
Load when mode is changed from PROG to RUN : CM1794
Select the load method. The output target folder name changes according to the
selected load method.
Load when power is turned on : "AUTOLOAD",
Load method
"AtLoad**" (**: 01 to 99)
Load when mode is changed from PROG to RUN : "RUNLOAD",
"RnLoad**" (**: 01 to 99)
Load after clearing
It loads after clearing user memory when it is checked.
user memory
Load after all clear It loads after all clear when it is checked.
Saves the unit system program with the project. The system program is updated
Save system program
when it is loaded. "System Program Update" (page 3-21)
Point If a folder which has the same name is chosen, the data is overwritten and
previous data will be lost.
Device file
1 Connect memory card to PC.
2 Select "Monitor/simulator (N)"→"Device value batch modify/read window (D)" from the menu of
KV STUDIO.
Memory Card
3 Select "File (F)" → "Read memory card (R)" or "Save to memory card (Z)" from the menu of the
batch change/read device values window.
Read: specify the read drive and folder name.
Save: save the registered device and current value.
If the device's default setting of KV STUDIO is employed, the device value can also be
Reference
managed through the memory card.
Automatically load project data saved to the memory card when powered on or at PRG RUN.
Control memory (CM) may be used to select the folder to be read from several folders.
1 KV STUDIO may be used to write item data under "AutoLoad" or "AtLoad**" (** : 01-99) folder
into the memory card.
"Ladder program etc. (except device file)" (page 5-22)
5 2 Insert the memory card into CPU unit memory card slot, close the memory card slot cover, until
“click”is heard.
Memory Card
• When write protection is provided for CPU system setting of KV STUDIO, error
Point
will occur (auto loading failure), it will enter PRG mode. After the error is
eliminated, in RUN mode, run the program before automatic loading.
In the following cases, error will occur (auto loading failure), it will enter PRG mode.
• When CM1790 value exceeds 100
• The memory card does not contain any folder selected by CM1790
• If the function version of the project stored in the PLC unit and of the project to
transfer differ, CPU all clear is required before transferring.
1 Use KV STUDIO to write in item data in memory card under "RunLoad" or "Rnload**"(01~99)
2 Insert the memory card in CPU unit memory card slot, close the memory card slot cover, until
"click".
Memory Card
Select the folder to be read, save value in CM1794 in advance.
• CM1794 value is 0 1 - 99
Read "RnLoad**"(CM1794 value (01-99)) folder.
Folder No. selection steps
1 Save the value in CM1794 from external equipment such as touch panel.
2 PRG RUN switching.
3 Read the folder selected by CM1794.
4 After reading, 0 is saved in CM1794, the read folder No. Is saved in CM1796.
• When write protection is provided for CPU system setting of KV STUDIO, error
Point
will occur (auto loading failure), RUN mode cannot be set. After the error is
eliminated, if memory card is taken out, in RUN mode, it will run the program
before automatic loading.
Error will occur in the following conditions (auto loading failure), it cannot be
set to RUN mode. After the error is eliminated, if take off memory card, run in
RUN mode, it will run the program before automatic loading.
• When the value of CM1794 exceeds 100
• When there is no folder selected by CM1794 in the memory card
• If the function version of the project stored in the PLC unit and of the project to
transfer differ, CPU all clear is required before transferring.
Storage Instructions
CPU BUILT-IN FUNCTIONS
The memory card can be accessed from the ladder program when the storage instruction is used.
5
KV-S32XTD
0 1 2 3 4 5 6 7
8 9 10 11 12 13 14 15
0 1 2 3 4 5 6 7
8 9 10 11 12 13 14 15
IN MMKDIR
OUT
MRKDIR/MDEL
Memory Card
Read
MWRIT
Write
MREAD
IN OUT
MFREE Memory card PC
(Microsoft Excel etc.)
KV-8000(A)
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.
• The storage instruction can be used to access CPU memory as well as memory
Reference
cards.
• The error code of Storage instruction is stored in CM2390. For details of CM2390,
refer to "KV-8000/7000/5000/3000/1000/KV Nano Series Instruction Term
Reference Manual".
Point The equivalent can be realized even when the memory card is used.
• Auto-read function
When powered on, read data to CPU unit automatically, these data are saved in "AutoLoad" or
"AtLoad**" (** : 01 to 99) (item) folder. If they are saved in "RunLoad" or "RnLoad**" (** : 01 to 99) folder
in advance, during PRG→RUN switching, it will read automatically.
"Auto Load Function" (page 5-45)
Point
When using the recipe load / save function, the CPU function version should be
upgraded to 2.0 or later.
5 • Saving program data during normal operation will make it easier to restore the system to its original
state if problems occur after making changes.
CPU Memory (User Memory)
• Design data prepared in Excel, Word or PDF can be saved with the program allowing you to compare
them with the design during maintenance work.
memory using
Troubleshooting Wiring diagram KV STUDIO or
the transfer tool
• This memory can be used as an area for storing device comments and variable.
Default
Project area User memory area The memory
setting
configuration can
be changed
User memory according to how
After Project area
area
changing it is used
CPU memory
CPU memory
Project area
CPU memory:64MB
Area boundaries can be
changed in the CPU 5
memory capacity settings
Unit settings, unit data, access window settings and other settings are stored in a separate area.
Setting method
Use KV STUDIO [Tools] → [CPU memory capacity setting] to change the size of these areas.
Procedures for reading and writing CPU memory (user memory) data
Use one of the following procedures for reading and writing memory card data.
CPU BUILT-IN FUNCTIONS
(1) Use the storage transfer tool to read and write via PLC.
(2) Use the FTP server function or other device to read and write via PLC.
(3) Use the PLC transfer function from KV studio to read and write data*
(* Only user documents and file register settings)
(1) Use the storage transfer tool to read and write via PLC.
Start "Tools (T)" → "Storage transfer tools" in the KV STUDIO menu.
Alternative procedure Menu→All Programs→KEYENCE Applications→KV STUDIO Ver.10G→Tool→
Folders in CPU memory (user memory) and the PC are backed up or stored.
This is only a batch transfer of all data and does not allow you to specify files or folders for reading
or writing.
(2) Use the FTP server function or other device to read and write via PLC.
After using the CPU unit or Ethernet unit that supports the FTP server function, the data of the CPU
memory card in the PLC can be read and written via an Ethernet cable.
The data inside the CPU memory is stored in the “1_CPUMEM” folder.
(3) Use the PLC transfer function from KV STUDIO to read and write data
In a PLC transfer, only CPU memory data such as user documents and file register settings can be
read or written.
Operating Precautions
The following general precautions should be heeded in the use of CPU memory.
• In the following circumstances, data stored in CPU memory may be lost. Please note
that Keyence accepts no liability whatsoever for loss of registered data.
• Incorrect use of CPU memory by the user or a third person.
NOTICE
• Exposure of CPU memory to static electricity and interference.
• When the frequency of saving to CPU memory exceeds 10,000 times. (PLC main
unit error 143: CPU Memory Write Cycle Over occurs)
• You can access CPU memory during memory card access. (You cannot write to
Point
memory card/CPU memory when they are accessed.)
• If user memory is set to write data at all times, write operations will slow down. For
higher write speeds, generate files in RAM and perform write operations before the
system is shut down. "RAM mode" (page 5-47)
• These attributes will be released when file/folder with “Hidden file attribute” and “Read
only attribute” is written to user memory.
Attribute
R: Load only
Device No Empty field: Name Description
Read/write
enabled
When this request goes on, the
difference data is stored CPU memory.
CR3200 CPU memory save request
* Please use the SET instruction when
executing demand.
CR3201 R Saving to CPU memory Goes ON when saving to CPU memory.
5 CR3202 R Saving to CPU memory ended
Goes ON when saving to CPU memory
ends. Turns off when a CPU memory
save request is turned on.
CPU Memory (User Memory)
Attribute
R: Load only
Device No Empty field: Name Description
Attribute
R: Load only
Device No Empty field: Name Description
CPU BUILT-IN FUNCTIONS
Read/write
enabled
In addition to CM1884, CM1892, you can check the load/save completion in the access
Reference
window.
• When a BOOL array type variable is assigned to CR, the element number of the
Point
array should be specified with a value. When specified with device or variable,
the SET instruction cannot operate properly.
KV STUDIO
CR5502 turns OFF to ON
Communication unit
KV-XCM02 *_XCM02.YTC(*=01 to 16) Access window
parameter file
KV STUDIO
KV-XL402 *_XL402.YTC(*=01 to 16) CR5502 turns OFF to ON
Serial communication unit
Access window
KV-XL202 parameter file *_XL202.YTC(*=01 to 16)
KV STUDIO
PROTOCOL STUDIO 2
KV-L2*V settings
File (PS1 compatible PB*.ZSH(*=1A to 48B) *3
(PROTOCOL STUDIO 2)
(standard/Large) mode)
5 KV-L2*V
PROTOCOL STUDIO 2
CR5502 turns OFF to ON
Access window
PB*.YSH(*=1A to 48B)
File (Protocol Studio2 mode) KV-L2*V settings
CPU Memory (User Memory)
(PROTOCOL STUDIO 2)
KV-XH16ML *_XH16.YTC(*=01 to 16)
KV-XH04ML *_XH04.YTC(*=01 to 16)
Positioning unit, motion CR5502 turns OFF to ON
KV-XH64EC control unit *_XH64EC.YTC(*=01 to 16) Access window
Parameter file KV STUDIO
KV-XH32EC *_XH32EC.YTC(*=01 to 16)
KV-XH16EC *_XH16EC.YTC(*=01 to 16)
Positioning unit, motion
KV-ML16V/MC40V/ KV-ML/MC settings
control unit KMP*.YSH (*=1 to 48)
MC20V (KV MOTION+)
Parameter file
Communication positioning
unit parameter setting (Point Communication
KV-LH20V SPSP**.YSH (*=1 to 48)
parameter, control/system positioning setting tool *6
parameter)
CR5502 turns OFF to ON
Positioning unit
KV-SH04PL *_SH.YTC (*=01 to 16) Access window
Parameter file
KV STUDIO
Positioning unit
MB*.ZSH(*=1 to 48)
KV-H20G/H20S/ Parameter file KV-H20S/40S/20G settings
H40S Positioning unit (MOTION BUILDER)
MC*.ZSH(*=1 to 48)
Comment file
MV-L40
MLS*.ZSH(*=1 to 18)
Parameter file MV-L40 settings
MV-L40
MV-L40 (MV LINK STUDIO)
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)
*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 It can not save from the access window to memory card and CPU memory.
*4 When performing email setup through 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.
*6 Not created when saved from the access window. However, the set point parameter etc. is stored in
DM.ZDV.
*7 Data that exists only in KV-8000 with CPU function version 2.0 or later.
Access window
How to save
How to read
Select and read the project folders from Access Window of CPU unit.
"Storage" (page 5-139)
5
• Methods of only reading some data
Reference
The program load can not be executed in RUN mode. Switch to PRG mode to operate the control relay.
(1) (4)
(3) (6)
Project load execution request (CR5500)
(2)
Sample program
Since the project load can not be executed in RUN mode, there is no sample program.
* To specify the folder number when saving, use the project save folder number (request) (CM 1888).
number (request) for storing in the specified folder. (for ladders, monitors, touch panels, or
communications etc.)
(5) If the project save fails, the project save execution failure relay turns ON. (for CPU units)
(6) Turn OFF the project save execution request relay when the project save execution end relay turns
ON. (for ladders, monitors, touch panels, or communication, etc.) When the next project execution
request relay turns OFF to ON, the project save execution end relay and the project save execution
failurerelay turn OFF. (for CPU units)
5 Sample program
This is a program to save the project in the CPU memory (drive number: 1) when MR200 rising edge
CPU Memory (User Memory)
occurs.
When 0 is stored in the project save folder number (request), it searches for an empty number and sets
it as the folder number.
To perform the program save, execute with the SET command.
CR5502
RES
Project save
execution request
自动加载失败
execution of auto load or run load.
99.
5
ロードできません The folder of CM designated to
PRGモード時のみ可能です
Please switch to PRG mode to
11 PRG mode only It tried to load with RUN mode. Load
load.
仅PRG模式时可执行
空き容量がありません
There are no free space in the
12 No free space Please increase the free space. Load/Save
memory card/CPU memory.
没有可用空间
17 Only when switch in PRG system program when the switch execute version upgrade of the Load
was in RUN mode. system program.
仅开关处于PRG时可执行
5 加载前 需全部清空
to load do not match, all clear must beforehand as the data to load will
be executed before loading the also be cleared.
project.
CPU Memory (User Memory)
メモリカードカバーオープン
Please close the memory card
100 Memory card cover open The memory card cover is opened. Load/Save
cover.
存储卡外盖打开
メモリカードがLOCKされています
The memory card is in LOCK Please release LOCK or use
101 Memory card locked Save
status. memory card that is writable.
存储卡被锁定
ロードできません
---------------------------------------------------
セーブできません
Cannot load data Please check the file system of the Load
102 --------------------------------------------------- The memory card is damaged. -----------
Cannot save data memory card. Save
无法加载
---------------------------------------------------
无法保存
ファイル数上限を超過しました The sum of number of files and
folders inside the user memory has Please reduce the file or folder
103 Max no. of files exceeded Load/Save
gone over the upper limit. inside the user memory.
超过了文件数上限
フォルダ階層が深すぎます
The folder hierarchy inside the user Please confirm the folder hierarchy
104 Folder layer too deep Load/Save
memory is too deep. inside the user memory.
文件夹层数过多
セーブできません
clear".
• The memory card has been 5
damaged. Please confirm if the project and
1001 Cannot save data Save
*1No error message is displayed in the access window as this error occurs only during execution by
operating CR.
Use KV STUDIO
From the KV STUDIO menu, you can read and save project data for loading and saving.
CPU BUILT-IN FUNCTIONS
The procedure of creating project data for load save is the same as procedure of
Point
saving to memory card. Please save created folder to the CPU memory.
When save is chosen
5
CPU Memory (User Memory)
Item Description
Displays the name of the output target folder for memory card data output. The folder
Output target folder
name changes according to the folder selection, folder number, and load method.
Select folder Select the folder to output memory card data to. Click the far right of the box to
display the "Browse for folder" dialog box.
Specify a folder number.
When 0 is input : No number is added to the end.
When 1 to 99 is input : The 2 specified digits are added to the end of the
folder name.
Folder No.
The device number on the right indicates the device that specifies the folder number
for each load method.
Load when power is turned on : CM1790
Load when mode is changed from PROG to RUN : CM1794
Select the load method. The output target folder name changes according to the
selected load method.
Load when power is turned on : "AUTOLOAD",
Load method
"AtLoad**" (**: 01 to 99)
Load when mode is changed from PROG to RUN : "RUNLOAD",
"RnLoad**" (**: 01 to 99)
Load after clearing
It loads after clearing user memory when it is checked.
user memory
Load after all clear It loads after all clear when it is checked.
Saves the unit system program with the project. The system program is updated
Save system program
when it is loaded. "System Program Update" (page 3-21)
Point If a folder which has the same name is chosen, the data is overwritten and
previous data will be lost.
When Read is chosen
The "Browse for folder" dialog box is displayed.
For procedures for reading saved data from CPU memory or transferring saved
Point data to PLC, refer to "Procedures for reading and writing CPU memory (user
memory) data" (page 5-30).
5-44 - KV-8000 Series User’s Manual -
5-3 CPU Memory (User Memory)
1 Using KV STUDIO, you can create project data in the "AutoLoad" or "AtLoad**" (**: 01 - 99)
folder names. Using storage transfer tools and FTP server function and so on, you can write
project data to CPU memory (user memory).
"Ladder program etc. (except device file)" (page 5-44)
5
2 Turn off the CPU unit.
1 Use KV STUDIO, the "RunLoad" or "RnLoad**" (**: 01 - 99) folder names to write project
CPU BUILT-IN FUNCTIONS
• CM1794 value is 0 1 - 99
Read "RnLoad**"(CM1794 value (01-99)) folder.
Folder No. selection steps
1 Save the value in CM1794 from external equipment such as touch panel.
2 PRG RUN switching.
3 Read the folder selected by CM1794.
4 After reading, 0 is saved in CM1794, the read folder No. is saved in CM1796.
RAM mode
• RAM which used in RAM mode will be cleared when the power is turned off.
Point
Be sure to save to CPU memory before turning off the power.
• When using the file register instructions or storage instruction to access CPU
Point
memory, the CPU instruction RAM mode relay (CR3207) goes on to engage
RAM mode.
• Deselect the "Save files to non-volatile memory" option in the logging/trace
setting to run in RAM mode during logging when accessing CPU memory.
• The write speed to CPU memory is restricted to prevent memory corruption
from write overload.
Setting method
During ladder program operation, the CPU memory instruction RAM mode relay (CR3207) is ON.
CPU BUILT-IN FUNCTIONS
When loading to CPU memory, the CPU memory save processing request relay (CR3200) is ON.
Time chart
ON
CPU memory
Instruction
RAM mode OFF
(CR3207)
Running
(Storage instructions, etc.)
CPU memory
5
ON
save processing
complete OFF
(CR3200)
ON
CPU Memory (User Memory)
CPU memory
Saving OFF
(CR3201) ON
CPU memory
Saved OFF
(CR3202)
(1) The CPU memory instruction RAM mode relay (CR3207) turns ON, and storage instructions etc.
are executed. (Ladder)
(2) Processing of the storage instruction ends and the CPU memory save processing request relay
(CR3200) goes ON when saving becomes necessary. (Ladder)
(3) When saving data to CPU starts, the CPU save processing relay (CR3201) goes ON. If the CPU
memory saved relay (CR3202) is ON, it turns OFF. (CPU)
(4) When data has been saved to CPU memory, the CPU save processing relay goes OFF and the
CPU memory save processing completed relay goes ON. (CPU)
MR000 CR3207
<Mnemonic List>
LD MR000
OUT CR3207
CPU memory CPU memory instruction
RAM mode term RAM mode LD MR000
ANP MR001
MR000 MR001 MPRINT MPRINT "1:\sample.csv" "test" MR100
“1:\sample.csv” “test” MR100 LDP MR002
CPU memory CPU memory write in ANB CR3201
RAM mode SET CR3200
MR002 CR3201 CR3200
SET
• The CPU memory save processing demand can be executed even when the CPU
Reference
memory instruction term RAM mode relay is ON.
• Use the SET instruction to process a CPU memory save request.
Storage Instructions
CPU unit
KV-8000(A) can save device / variable values in multiple data tables, and switch the device / variable
values in the CPU unit and the unit variable values in the KV-XD02 by switching data tables. This data
table is called recipe data.
The recipe data saved in advance can be read and reflected to the device / variable values after using
the recipe load function.
New recipe data can be created with the current device / variable values after using the recipe save
function.
Recipe data is generated in KV STUDIO and saved in the storage (memory card / CPU memory) of the
5 CPU unit. It is also possible to read the recipe data in the storage of the CPU unit with KV STUDIO.
Recipe data 3
Recipe data 2
Recipe data1
DM0=50
DM1=2
Name= “ABC “
PC
(KV STUDIO)
• The recipe load / save function can be used only with KV-8000 with CPU function
Point
version 2.0 or later.
• TIMER type and COUNTER type variables cannot be read / saved with the recipe
loading / saving function.
5
DM0=50 DM0=50
DM1=2 DM1=2
Name= “ABC “ Name= “ABC “
The project save function is used to save a backup of all set variables.
Reference "Procedures for reading and writing CPU memory (user memory) data", (page 5-30)
This section describes the procedure for creating recipe data in KV STUDIO and transferring it to the CPU
unit storage, and the procedure for reading the recipe data from the CPU unit storage to KV STUDIO.
1 Select "Monitor / Simulator (N)" → "Device Value Batch Change / Read (D)" from the KV STUDIO menu.
2 Register the devices / variables included in the recipe data in the device value batch change /
read window.
5
Recipe Load/Save Function
After selecting "PLC (P)" → "Read all items from PLC (R)" from the device value batch
Reference change / read window menu, the device / variable values in the connected CPU unit can be
read in batch and reflected to the current values.
4 Select "File (F)" → "Save to memory card (Z)" from the device value batch change / read window
menu.
For the load method, select "Load when CR5508 turns from OFF to ON (Recipe load)". Specify the
folder for creating the recipe data and the recipe data number (Folder number: 0∼999), and click "OK".
• When saving directly to the memory card, the location directly under the memory
Point
card should be specified. When saving to a location other than the memory card such
as a PC folder, the "KVRCP" folder should be copied directly under the memory card.
• The load method should be selected before selecting a folder.
• When a PC is not granted the permission to write data out, saving to external media
such as a memory card will fail. For details, contact your PC administrator.
1 Transfer the recipe data in the storage of the CPU unit to a PC.
When recipe data is saved in the memory card, remove the memory card and insert it into the PC.
When recipe data is saved in the CPU memory, use the storage transfer tool, FTP server function or
FTP client function, etc. to transfer the "KVRCP***" folder (*** is the number of recipe data to be read) in
the "KVRCP" folder to the PC.
5
2
3 Select "File (F)" → "Read (R)" from the device value batch change / read window menu.
The dialog for browsing folders is displayed. Select the "KVRCP***" folder transferred to the PC in Step
1.
4 Select the devices / variables to be read from the recipe data to KV STUDIO.
5 The contents of the read recipe data are reflected in the device value batch change / read
window.
After selecting "File (F)" → "Save CSV/TXT file after naming (A)" from the device value batch change /
read window menu, the contents of the recipe data can be saved as a CSV/TXT format file.
This section describes the procedure for reflecting the contents of the recipe data saved in the storage
of the CPU unit to the devices / variables of the CPU unit, and the procedure for overwriting / creating
recipe data using the device / variable values of the CPU unit.
5
Recipe load complete (CR5510)
① Specify the recipe load drive number (0: Memory card / 1: CPU memory) and the drive number and
folder number that save the recipe data to be loaded in the recipe load folder number, and turn the
recipe load request ON.
② When the recipe load is completed normally, the recipe load complete turns ON. "0" is also stored in
the recipe load completion code.
③ Check that the recipe load complete is ON, and turn the recipe load request OFF from the ladder
program. The recipe load complete automatically turns OFF when the next recipe load request is
turned from OFF to ON.
④ When the recipe load fails, both the recipe load complete and recipe data execution failed turn ON.
The completion code corresponding to the cause of failure is stored in the recipe load completion
code.
Reference program
The following is a reference program to load the recipe data of folder number "0" in the memory card.
MR000 MOV ;<Mnemonic list>
#0 CM1870
LDP MR000
Recipe load Drive number MOV #0 CM1870
MOV MOV #0 CM1871
#0 CM1871 SET CR5508
LDP CR5510
Recipe load Folder number
MOV CM1873 DM0
CR5508
SET
Recipe load request
CR5510 MOV
CM1873 DM0
Recipe load complete Recipe load Completion code
① Specify the output location of the recipe data with the recipe data drive number (0: Memory card / 1:
CPU memory) and the output folder number when saving the recipe, and turn the recipe save
request ON. At this time, the devices / variables to be output as recipe data are the devices /
variables written in the recipe data with the number specified by the reference folder number when
saving the recipe.
② When the recipe save is completed normally, the recipe save complete turns ON. "0" is also stored
in the recipe save completion code.
③ Check that the recipe save complete turns ON, and turn the recipe save request OFF from the
ladder program. The recipe save complete automatically turns OFF when the next recipe save
request is turned from OFF to ON.
④ When the recipe save fails, both the recipe save complete and recipe data execution failed turn ON.
The completion code corresponding to the cause of failure is stored in the recipe save completion code.
Reference program
The following is a reference program that refers to devices / variables registered in the recipe data of
folder number "1" in the memory card and saves the values of devices / variables in the PLC as recipe
data of folder number "5".
CR5514 MOV
CM1878 DM0
Recipe save complete Recipe save Completion code
List of completion codes stored in the recipe load completion code (CM1873) and recipe save
completion code (CM1878).
Number Content Cause Countermeasure At occurrence
The write in was not possible since Please configure an empty number
2 Unused number not available Save
there was a file already. to the folder number to save.
The folder number designated at Please designate number from 0 to
3 Out of the specified folder number range Load/Save
CM was out of range during. 999.
The folder of CM designated to
Please confirm that recipe data is
4 No data memory card/CPU memory does Load
inside.
not exist.
Overview
Logging/Tracing
CPU unit
Memory card
"Memory Card"
Logging (page 5-3) Load
CPU memory
"CPU Memory
PC
(User Memory)"
(page 5-27)
(Microsoft Excel, etc.)
Execution relay
Running relay
• If logging/tracing is started without the file being present, a new file will be
Reference
automatically created.
• Logging/Tracing function and Storage instruction can be used at the same time. The
order of priority is Storage instruction> Logging/Tracing function.
Tracing Function
As in the case of logging function, the state or value of device will be logged in buffer memory. When
files are saved, only the specified amount of data preceding and following is extracted and logged in
CPU BUILT-IN FUNCTIONS
SRAM
Time
Date time DM11 DM12 DM13 Buffer area
Date time DM11 DM12 DM13
Date time DM11 DM12 DM13 Auto save as a CSV file
5 Date time
Date time
DM11
DM11
DM12
DM12
DM13
DM13
Date before
triggering CPU memory (user memory)
Date time DM11 DM12 DM13
Logging/Tracing
Routine logging
After the file save destination is set as "internal memory", the data saved can be read
Reference from the real-time diagram monitor of KV STUDIO.
Execution relay
Running relay
When saving data acquired by the tracing function on a memory card, execute the
Point
LOGD instruction by using the data acquisition end as a trigger.
Files will not be generated even if the LOGD instruction is executed before data
acquisition is completed.
5-58 - KV-8000 Series User’s Manual -
5-5 Logging/Tracing
How to Use
Logging/Tracing
(3) Transfer to KV-8000
"Monitor/simulator (N)" - "PLC transfer" → "Monitor (C)"
Setup
CPU BUILT-IN FUNCTIONS
Set separately the file names, device and trigger depending upon every logging/tracing ID.
Item Description
Displays the current logging and tracing function execution status (stopped /
Status
running / error) only during monitoring.
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.
Copy Copy the setting of the selected Logging/tracing ID.
Paste Paste the copied setting to the selected Logging/tracing ID.
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 built-in function monitor of the selected logging/tracing ID is displayed during
Built-in function 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)
*1 Use [real-time chart monitor] to load data when internal memory is selected.
5
See "Real-time chart monitor" in the "KV STUDIO User's Manual."
Data saved in internal memory will be lost when the power is turned off.
Logging/Tracing
"Logging/Tracing" (page 5-57)
File name
CPU BUILT-IN FUNCTIONS
When the data save destination is "internal memory", each item of "file name" can not
Reference
be set.
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 no empty No.
Stop logging".
File No.
*1 After retrieving of remaining No., CPU unit 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.
*2 Select Logging ID4, file number 2, character string "KEYENCE," date information "YYMMDDHHMMSS"
If an update is made at 15:16:17 on March 14, 2019, a "log002_KEYENCE190417.csv" will be created
in the "log4"route folder on memory card or CPU memory.
File name: log (File No.) _ (Character string) (Date)
Up to 32 half-width characters
For information about what to do in case there is no room in the file No., please see "Processing at
start of logging/tracing" (page 5-84).
5
Logging/Tracing
The files created with the recording and tracking function will be identified using
Point
the folder (recording and tracking ID) and file number.
In a storage device, do not create multiple files with the same file number but
containing different character strings or date and time data in the same folder
(logging ID).
Device / variable
CPU BUILT-IN FUNCTIONS
To set the saved device / variable by mixing the bit data and word data.
At most 512 devices can be set for every logging ID.
Example
(1) When all 512 devices are set to the bit data:
ON/OFF state (0 or 1) of 512 bit data will be logged.
(2) When all 512 devices are set to the word data with 1
words:
Values of 512 word data with 1 words will be logged.
5 (3) When all 512 devices are set to the word data with 2
words*1:
Value of 512 word data with 2 words will be logged.
Logging/Tracing
Item Description
"Logging/tracing device setting" dialog box is displayed when "Add" button is pressed.
Add
The 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.
Taking in device When you press the "Taking in device comment" button, the device comment of the set
comment device will be imported into the logging comment area.
For devices
Select from "Decimal 16BIT / Decimal 32BIT / ± Decimal 16BIT / ± Decimal 32BIT /
Hexadecimal 16BIT / Hexadecimal 32BIT / ASCII16BIT / FLOAT". 5
Please set to ASCII16BIT to obtain the SJIS code.
Logging/Tracing
When "FLOAT" is selected, the data will be saved in exponential format. (Example:
0.123E-03)
Data format
To obtain data with a decimal point, convert it to a string using the ladder program, and
select "ASCII16BIT" to save it.
For variables
Only global variables can be specified, and the data type set in the variable edit
window is displayed and cannot be set.
Variables with data types other than LREAL can be specified.
This can be set only when "ASCII16BIT" is selected as the data type or a variable set to
Number of words STRING type is input.
Setting range: 1 to 512
Place the device set through destination device on the front part, and set the number of
Continuous number devices for continuous logging/tracing.
Only array type variables can be set with variables registered.
When setting an array type variable, enter the array name only
The array elements can be set in batch by setting the continuous
number.
Trigger
To set timing of logging/tracing of registered device / variable.
CPU BUILT-IN FUNCTIONS
5
Logging/Tracing
Item Description
Select the trigger type from the following.
Type *1
"Bit device" "Period" "Trigger command (TRGD)" "Data acquisition trigger (flow)"
Enter the bit device or BOOL/TIMER/COUNTER type variable name to be used
Bit device as a trigger.
*1 Bit device
Logging/tracing is run when the specified bit data is in ON state.
Referenced to the processing state of END, the state of bit data isn't logged when ON/OFF during 1 scan.
Device value at END processing of detecting trigger is saved.
If bit data is ON, the device / variable value for each scan and END processing will be saved.
Cycle
Through the built-in timer of CPU unit, logging/tracing according to the specified interval time is run.
Device / variable 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 PRG mode, the timing of time interval is reset.
Option
Logging/Tracing
Item Description
Insert file comments into the
If checked, a file comment is entered at the start of a CSV file.
leading of CSV file
If checked, a device comment is entered.
Add comments row of device *1
If a comment has not been set, the device number will be added.
Attach time stamp to each row *2 If checked, a time stamp is added to every line.
If checked, a time stamp is added to every line. Logging/tracing will start
Add information*3
from 0. When "Add" is selected in a file number setting, numbers will start
from 0 at the middle of the file (the position where numbers are first added).
When a buffer overflow occurs, the data number will reveal how much data
Add data No. to each row
was lost.
The buffer capacity that is targeted in an overflow can be set by opening
the [CPU system setting] in the work space and setting [System setting]
and [CPU unit buffer capacity setting].
The time elapsed from the most recent data acquisition will be logged in
Add data obtain span to each row
1μs unit.
If checked, blank spaces are added for every numeric value that can be
Add space to secure the
zero suppressed. The file size increases, but the location of the first
character count
character can be obtained through calculation.
If checked, data is written to the memory card at each trigger occurrence.
Perform CSV file save for each High-speed logging is possible because the result of each trigger is stored
Save CSV file
trigger in the internal buffer area, and the memory card writing is executed only
when the LOGD instruction is executed.
Save the file to non-volatile If checked, data is written to nonvolatile memory at each trigger
memory occurrence.
Logging operation
If checked, logging data will be stored in CPU memory should the memory
card be removed during logging until the memory card is reinserted. When
Auto-restart logging by inserting
reinserted, the data is automatically saved to the memory card. The operation
memory card
related to saving to memory card at automatic restart depends on "operation
at start". "File name" (page 5-62)
Set upper limit of file capacity If checked, you can set the upper limit of file capacity.
(Only logging) See "Troubleshooting for overflow of file capacity settings" (page 5-85).
The upper limit *6(only logging) The upper limit is set in line or KB units.
- KV-8000 Series User’s Manual - 5-67
5-5 Logging/Tracing
*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.
CPU BUILT-IN FUNCTIONS
Example
2019/04/17,15:16:17
5
When "Save CSV file for every trigger " is checked, the logging result will remain even if power is turned
OFF as long as the write in after trigger has been completed while the logging is executed.
But when power is turned OFF while writing in to memory card, there is a risk of losing content of the
Logging/Tracing
memory card.
In addition, since write in to memory card occurs for every trigger, the accessing time to memory card
will become longer.
Therefore, the buffer overflow will become more frequent.
When the interval of trigger is short, please uncheck the "Saving CSV file for each trigger".
When the saving destination is CPU memory
It always executes save to CSV file for each trigger, but it differs by the check status of "Executes file
save to non memory" if it will remain in the CPU memory even if power is turned OFF.
When it is checked
Since it will be saved to CPU memory for every trigger, the file will remain in CPU memory even when
power is turned OFF. But the accessing time will become longer.
When check is off
The high speed login is possible since data will be created in RAM.
However, since the data created in the RAM mode will be cleared when the power is turned off, you
need to turn on CR3200 and execute the CPU memory save save request before turning off the power
supply.
"RAM mode" (page 5-47)
*5 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.
"Auto restart" refers to the function that a restart will be performed when the memory card is inserted.
*6 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 4-14)
Execution relay
Running relay
Logging/Tracing
Item Description
File
Saving Device Specify a bit device or BOOL type variable.*2
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.
*1 Open "CPU system setting" from work space, Set it with [CPU unit buffer capacity setting]. For details,
see the "CPU unit buffer capacity setting" (page 5-70)
*2 When trigger type is "TRGD instruction", the file saving/triggering state will be confirmed only when
TRGD instruction/function executed.
The traced data saved using the tracing function can be read by the real time chart
Reference
monitor. For details, see the "KV STUDIO User's Manual."
Set the capacity of the buffer to save data with the logging/tracing function.
1 Open [CPU system setting] from the workspace and click in order of [System setting] → [CPU
unit buffer capacity setting].
5
Logging/Tracing
2 Set the capacity of the buffer to be used for ID0 to ID9. If you increase the capacity of the ID to
be used, the amount (the number of samples) of data that can be saved also increases. Please
set within the range not exceeding the total capacity 10240KB of buffer.
Logging/Tracing
The length of 1st line includes 64 characters." "
File Comment 64 Header
is not included in the character length.
File saving trigger state "TRIGGER DATA NO"
32 " " is not included in the character length.
(only tracing) "COMM TRIGGER DATA NO"
File saving trigger occurring The data No. is logged when file
10 1234567890
position (only tracing) saving trigger is activated.
Logging Comments 32 …, "Starting relay" ,… " " is not included in the character length.
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.
DEX 16 bits 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,…
Exponent format is fixed. To log
with decimal point, convert the
floating-point type data to a
FLOAT 13 …, 2.4123E+12,…
character string using the FASC
instruction in the ladder program
and log it as ASCII 16 BIT.
If NULL exists in the character
ASCII16BIT (words)×2+2 …,”a123” … ,… string, the subsequent character
strings are not logged.
- KV-8000 Series User’s Manual - 5-71
5-5 Logging/Tracing
Data line
5
Logging/Tracing
The logging comment set in the [Logging / Tracing Setting] dialog is displayed in the comment
Reference line of the device. When the logging comment is blank, the device name or variable name is
displayed.
Logging Instructions
Logging/Tracing
+ (size of a device comments line)
+ (size of a data line) x (number of data lines)
= (file size)
(size of file comments line) = (the number of characters set up with KV STUDIO) + 4
A half-width character is counted as a letter and a full-width character is counted as 2 letters.
"attach a data No. to each line": Use (A=1) Not Use (A=0)
"Attach a time stamp to each line" : Use (B=2) Not Use (B=0)
Size of device
Item Size
Bit device 2
Unsigned 6
1 word
Signed 7
Unsigned 11
Word device 2 words
Signed 12
Floating point real number 14
ASCII character string (n words) (n x 2) + 3
Data No. 11
Time stamp (date + time) 20
Data capture interval 2~11
An approximate number of files that can be stored can be calculated using the file
size, memory card capacity and CPU memory capacity calculated in the above
NOTICE
steps. However, the actual number of files that can be stored may vary depending
on disk use. Please ensure sufficient free space is available on the disk.
MEMO
CPU BUILT-IN FUNCTIONS
5
Logging/Tracing
Execution condition n
LOGD L O G D n
Operand
n
Description
Logging/tracing specifying ID (0 to 9).*1 *2
Occupied size
16 bits
5
Logging/Tracing
*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
LOGD When execute condition is ON, n will set ID of specified logging/tracing as inhibited
state.
After the instruction is executed, logging/tracing operation relay of every ID is reset,
then logging/tracing is stopped. All log contents till that time are output to the memory
card or CPU memory.
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
Trigger
(Bit device)
Execute
Execute
Execute
Execute
Logging/tracing operation relay
Scan
Execute
Execute
Execute
Logging/tracing operation relay
Operation flag
Sample Program
When input R000 is ON, logging/tracing of ID5 enters into operation enable state.
When input R001 is ON, logging/tracing of ID5 enters into operation inhibited state.
R001 #5
<Mnemonic List>
LOGD
LDP R001
LOGE #5
TRGD TRGD Capture log data Capture log data of specified ID.
Logging/Tracing
Description of Operation
• when using the TRGD instruction to capture data, please select Trigger
Point
Instruction (TRGD) as the Trigger Type in the Logging/Tracing Settings of KV
STUDIO.
• To use Instruction Trigger in the Real-time chart monitor, select Instruction
Trigger from the Trigger Type in the Trigger setting of the Real-time chart
monitor screen. Otherwise no data will be captured even if the TRGD
instruction is executed.
• At most 8 TRGD instructions can be used by 1 project for 1 ID.
Operation flag
Sample Program
CPU BUILT-IN FUNCTIONS
If the following ladder program is included in the fixed period module, logging will be performed every period.
Devices of IDs
Device No. of logging/tracing IDs (0 to 9) Attribute
R: Read only Content
5
ID0 ID1 ID2 … ID9 Blank: R/W
Logging/Tracing
CR000 CR100 CR200 ··· CR900 Execute logging/tracing
CR001 CR101 CR201 ··· CR901 R Logging/tracing operation in progress
Logging/tracing file write end
CR002 CR102 CR202 ··· CR902 R Turns off automatically when the
LOGE instruction is executed.
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
CR009 CR109 CR209 ··· CR909 R Insufficient memory capacity error
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
Minimum buffer free space (in KB
CM1630 CM1631 CM1632 ··· CM1639 R
units)*1
CM1680 CM1681 CM1682 ··· CM1689 R/W File save counter (memory card only)
CM1500 CM1501 CM1502 ··· CM1509 R File save counter (shared)
CM1660 CM1661 CM1662 ··· CM1669 R Buffer free space (in KB) *2
*1 Displays minimum remaining space of the buffer after executing the LOGE instruction. It will be reset
when the next LOGE instruction is executed.
*2 Displays the remaining space of current buffer.
Common devices
Attribute
Device No. R: Read only Content
Blank: R/W
Details of devices
Logging/tracing operation relay
CPU BUILT-IN FUNCTIONS
To enable and inhibited 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 turned ON, all status relays with the same logging/trace ID will temporarily go OFF.
It will be reset when an error occurs.
Logging/Tracing
It turns OFF when the LOGE instruction is executed in the next time.
be stored.
The value will not be cleared automatically.
Storing speed
• The maximum scan time during logging/trace operation is extended up to (20 μs × number of used
IDs) ms.
• When multiple triggers are simultaneously generated and the number of access instances to memory
card or CPU memory increases, scan times increase and buffer overflows occur more often.
Reference
The data failure can be improved by setting of certain scanning time or END processing time.
"Fixed scan time operation" (page 4-90)
5
Logging/Tracing
"Setting the END processing time" (page 4-92)
Logging/Tracing
When "logging / tracing transfer setting" is set with the FTP client function, even if the
Reference
LOGD instruction has not been executed, files generated by "file capacity upper limit
setting over" will be uploaded to FTP every time.
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.
The operation recorder function can be used to save the PLC operation records before and after any
timing (trigger). The data that can be saved in the operation recorder is as follows.
Type Details
Data for each scan time in the PLC devices, variables and buffer memory of the
Device
expansion unit before and after the trigger condition is met
Video data shot with KV-CA02 by different frame rates before and after the trigger
Camera
condition is met
Event log of errors or device value changes, etc. before and after the trigger condition
5
Event / error
is met
Project data Project data when the trigger condition is met
Operation Recorder Function
Point The operation recorder function is a function that can be used only by KV-8000.
The saved operation records can be played back with KV STUDIO or KV REPLAY VIEWER. The ON/
OFF status of the bit device before and after a fault occurs, the value of the word device and the video
shot with the camera*1 can be checked with the ladder program, real-time chart monitor and Replay VT
Viewer*2. Since the time series data can be checked while playing, stopping, rewinding and frame
advancing, etc., it can be used to analyze the fault causes difficult to check after a sensor chatters or a
chucking error occurs due to incomplete stop before chucking, etc.
*1 The small standard camera KV-CA1H or the wide-angle, high-resolution camera KV-CA1W and the camera
input unit KV-CA02 are required.
*2 This is a function to simulate the device data of operation recorder in the PC using the screen data of the human
machine interface. VT STUDIO Ver.7.10 or later is required.
Operation records can be saved in the memory card inserted to the CPU unit or CPU memory, and the
contents can be checked by reading them via the CPU unit or opening files copied to the PC, etc.
CPU unit
Operation recorder
・Device Memory card
・Camera “Memory Card”,
Page 5-3
・Event / error
Save Read
・Project data
CPU memory
“CPU Memory
(User Memory)”, PC
Page 5-27 (KV STUDIO)
• The saved operation records can be checked via the replay mode of KV STUDIO or KV
Point REPLAY VIEWER. Refer to "KV STUDIO User's Manual" for details on the replay mode.
• The video data of the camera is recorded in the camera input unit KV-CA02, and
saved in the CPU unit when the trigger condition is met. Refer to "KV-CA02 User's
Manual" for details.
• The data application unit KV-XD02 can be used to analyze operation records and
display the devices and variables that were the likely causes of problems. Refer to
"KV-XD02 User's Manual" for details.
5-86 - KV-8000 Series User’s Manual -
5-6 Operation Recorder Function
Operation steps
Settings
CPU BUILT-IN FUNCTIONS
Up to 4 operation recorder settings can be created (ID0~ID3). Set the operation recorder for each ID.
5
1 Click "Operation Record / Replay (R)” "Operation Record Setting (P)” "New (N)" from the
Operation Recorder Function
menu.
The "Operation Record Setting" dialog is displayed.
5
Comment Set the comment to be inserted into the saved file name.
Item Description
Automatic Use the minimum folder number from the unused number
Automatic consecutive number between 0 and the value set for the automatic consecutive
consecutive upper limit number upper limit.
Folder number When there is no Select the processing when there is no free number from
number free number "Overwrite / Stop".
Fixed No. Specify a fixed value between 0 and 999.
Device Use the value of the device or UINT/UDINT/TIMER/COUNTER
Device
value type variable (0~999).
If checked, the file name contains the date and time information
when saving the operation record. Since the date and time
information is fixed to the date and time information at the time
of file creation, the file name is not changed when adding a
Date and time
record. When an existing file is overwritten, the old file is
deleted and a file will be created with a new file name.
Year (2000~2099) Month (01~12) Day (01~31)
Hour (00~23) Minute (00~59) Second (00~59)
Add the trigger comment to the folder If checked, the trigger comment is added to the folder name.
Folder name preview An example of the folder name is displayed.
If the free space on the memory card becomes low before the automatic serial No.
Point
upper limit reached, additional data cannot be saved. In that case, you can continue to
save by reducing the automatic serial No. upper limit and setting to "Overwrite" when
there is no more free number (please note that the oldest file will be deleted first).
Collection period
CPU BUILT-IN FUNCTIONS
The setting items are partially different depending on whether "Before and after file save trigger" or
"Start relay" is selected for "Specification method".
5
Operation Recorder Function
Item Description
Specification method Select from "Before and after file save trigger / Start relay".
When "Specification Collection time
Set the time to save the data before trigger.
method" is "Before before trigger
and after file save Collection time after
Set the time to save the data after trigger.
trigger" trigger
When "Specification Start relay Set a relay to start collecting data.
method" is "Start
Collection time Set the time to collect data.
relay"
Specify the bit device or BOOL/TIMER/COUNTER type
Device
variable as a trigger to save the collected data.
File save trigger Conditions Select from "↑" (rising edge) or "↓" (falling edge).
Set the file save trigger comment. The set comment can be
Trigger comment
added to the saved folder name.
Operation of "Before and after file save trigger" and "Start relay"
When "Before and after file save trigger" is selected
• When the condition for file save trigger is met without collecting data for the time
Point
specified in the collection time before trigger, only the data collected successfully is
saved as the operation record.
• When the data for the buffer capacity is collected, the data saved at the start is
overwritten in order.
After a certain
Start relay period of time File save trigger
collected data
All device data for the buffer capacity can be saved when the file save trigger condition is met
Reference while the operation recorder buffer area full save mode (ID0: CR5614) is ON, so the device
data outside the collection period can also be checked.
• If the collected data exists when the start relay is ON, the collected data is discarded
Point
and then the data collection starts.
• If the file save trigger condition is met without the collected data present, no
operation recorder is saved.
• If the file save trigger condition is met before the collection time has elapsed after
the start relay is ON, the data for the collection time will be collected and then the
operation recorder will be saved.
- KV-8000 Series User’s Manual - 5-91
5-6 Operation Recorder Function
Recording object
CPU BUILT-IN FUNCTIONS
5
Operation Recorder Function
Item Description
Saves PLC devices and variables. The devices used in the unit configurations or
Device projects are registered in batch automatically in the initial value state. To register the
devices manually, click "Detailed Settings (T)".
Save the video data shot with the camera input unit KV-CA02. The video data of all
Camera connected cameras is saved for the collection time in the initial value state. To
change the saved camera or collection time, click "Detailed Settings (U)".
Save the log of events, errors, etc. occurred in the PLC. The log that can be saved
is as follows.
• Error log (Serious error / minor error)
Event / error
• Power ON/OFF log
• PLC event log
• Device value change log
Save the project data when the file save trigger occurs. The saved project data is
Project data used as a project when the ladder is displayed in the replay mode of KV STUDIO or
via KV REPLAY VIEWER.
• The scan time will be extended when the recording object contains a device. The time
Point
reference value for scan time extension is displayed on the lower left of the "Operation
Record Setting" dialog. To suppress the scan time extension, please set manually and
reduce the number of registrations.
• Scan time is extended only during data collection. The object when "Specification method"
is "Before and after file save trigger" is other than the period during file saving; the object
when "Specification method" is "Start relay" is from the start relay ON until the collection
time elapses. The scan time extension does not exist at other timings.
• To keep the scan time constant without changing the number of devices registered, use the
constant scan time operation function.
“Fixed scan time operation”, Page 4-90
Device details
Click "Detailed Settings (T)" to display the following dialog. Click "Details (D)" to display a list of
To manually set the device and variable saved, uncheck "Automatic Setting(A)" and then click
"Individual Device Registration(I)".
CPU BUILT-IN FUNCTIONS
Item Description
Program / unit Select the type of device and variable to be saved from the drop-down list.
Leading device Specify the leading device and variable of the device to be saved.
Count Specify the continuous count when saving multiple device and variable in succession.
5 Target preview
Import
Display the result set in "Leading device" and "Count".
Import the setting information of the saved device and variable, and overwrite the current settings.
Export Export the setting information of the saved device and variable.
Operation Recorder Function
Camera details
Click "Detailed Settings(U)" to display the following dialog. Uncheck "Automatic Setting(A)" during
manual setting.
Item Description
Select Check to save the shooting data of the target camera.
FPS when saving Set the FPS when saving the camera shooting data.
Select from "Not Executed / Executed". When "Executed" is selected,
Individual
"Collection Time" can be set manually. When "Not Executed" is selected, the
specification
video within the collection time of operation recorder will be collected.
Collection time
This can be set only when "Individual Specification" is set to "Executed". In
Collection time addition to the collection time of the operation recorder setting, the collection
time of the camera shooting data can be set.
Project data
Set whether to save the project data transferred to the PLC. When checked, the project data will be
saved as operation record. To reduce the capacity of the operation record, uncheck it. When
unchecked, it is necessary to prepare the project data when playing in the replay mode.
Options
CPU BUILT-IN FUNCTIONS
5
Operation Recorder Function
Item Description
When checked, the operation recorder settings are written automatically at the time of
Write automatically
project transfer. If you uncheck it, the information of Device/Variable to be assigned
at the time of PLC
will not be updated, and you can prevent overwriting of the operation record setting
transfer
when designing a project with multiple people.
Suppresses
When checked, the scan time is kept at as close to a constant speed as possible
fluctuations in scan
during operation record saving by suppressing increases in the speed.
time during storage
1 Click "Display (V)” "CPU System Settings (P)" from the menu, and select "Device recorder
buffer capacity setting".
Other •Double-click "CPU System Settings" in the workspace, and select "Device recorder buffer
capacity setting"
When KV STUDIO is in the monitor mode, the maximum collection period (in seconds) of the
Reference device can be checked with the operation recorder monitor that can be displayed from
"Operation Record / Replay (R)” "Operation Record Monitor (M)" in the menu.
When the maximum collection period is shorter than the set value, make fine adjustments as
necessary, such as increasing the buffer capacity and reducing the number of collected
devices.
The execution information and error information of the operation recorder function are assigned to the
control relay (CR) and control memory (CM). The control relay can be divided into the control relay
provided for each ID, and 1 control relay for all IDs.
Device of each ID
Device Property
R: Read only
Device name
number Blank: Read / write
record save completion code”, Page 5-103 for the content of the completion code.
Refer to “Device List for Logging/Tracing”, page 5-79 for details on the devices
Point
common for IDs such as memory card in use.
Operation recording
(CR5601)
① When the operation recorder function is in operation, the operation recording relay (CR5601) and
operation recorder collecting (CR5604) become ON, and the CPU unit starts data collection.
② When the condition for file save trigger is met, the operation recorder save trigger monitor (CR5602)
becomes ON, and the data is collected until the collection time after trigger elapses.
③ When the collection time after trigger has elapsed, the CPU unit starts saving the operation record,
and the operation recorder saving relay (CR5603) becomes ON. While the operation recorder
saving relay is ON, the operation recorder collecting relay is OFF, and the CPU unit stops the data
collection.
④ When the saving of the operation recorder is completed, the operation recorder save trigger monitor
relay and the operation recorder saving relay become OFF, and the operation recorder save
completion relay (CR5607) becomes ON. 0 is stored in the operation recorder save completion code
(CM6000).
⑤ When the file saving fails, the operation recorder save trigger monitor occurrence relay and the
operation recorder saving relay become OFF, and the operation recorder save completion relay and
the operation recorder save error relay (CR5608) become ON. The error code is stored in the
operation recorder save completion code.
• The operation recorder function is in operation when the CPU unit switches from PROG
Reference mode to RUN mode.
• The CR and CM related to the operation recorder function are controlled automatically by
the CPU unit, so there is no need to operate from the ladder program.
During abnormal analysis with the KV-XD02, the operation record save completion
Point
relay turns ON when this analysis is completed after the saving of the operation record
is completed.
collection collection
CPU BUILT-IN FUNCTIONS
Operation recording
(CR5601)
Start relay
(CR5607)
① When the operation recorder function is in operation, the operation recording relay (CR5601)
becomes ON.
② When the device specified as the start relay in the operation recorder setting is turned ON, the
operation recorder collecting (CR5607) becomes ON, and the CPU unit starts data collection. When
the collection time has elapsed, the data collection is ended, and the operation recorder collecting
becomes OFF.
③ When the condition for file save trigger is met after the collection time has elapsed, the CPU unit
starts saving the operation record, and the operation recorder saving relay (CR5603) becomes ON
(If the condition for file save trigger is met before the collection time elapses, the operation recorder
will be saved after the collection time has elapsed).
④ When the saving of the operation recorder is completed, the operation recorder save trigger monitor
relay and the operation recorder saving relay become OFF, and the operation recorder save
completion relay (CR5607) becomes ON. 0 is stored in the operation recorder save completion code
(CM6000).
⑤ When the file saving fails, the operation recorder save trigger monitor occurrence relay and the
operation recorder saving relay become OFF, and the operation recorder save completion relay and
the operation recorder save error relay (CR5608) become ON.
The error code is stored in the operation recorder save completion code.
• The operation recorder function is in operation when the CPU unit switches from PROG
Reference mode to RUN mode.
• The CR and CM related to the operation recorder function are controlled automatically by
the CPU unit, so there is no need to operate from the ladder program.
During abnormal analysis with the KV-XD02, the operation record save completion
Point
relay turns ON when this analysis is completed after the saving of the operation record
is completed.
Completion
Title Error cause Handling method
code
0 Saved successfully Saved successfully Saved successfully
Modify the folder number to be saved
10 No free number Not written as a file already exists
or create a free number.
There is no
An operation recorder is saved when
memory card or Please mount the CPU memory or
11 the memory card / CPU memory
CPU memory is insert a memory card
cannot be recognized
unmounted.
12 No free space
There is no free space in the memory
card / CPU memory
Please increase the free space of the
memory card / CPU memory 5
100 Cover OPEN Memory card cover is open Please close the memory card cover
Completion
Title Error cause Handling method
code
An attempt was made to create a file, but
CPU BUILT-IN FUNCTIONS
Failed to create the it cannot be created successfully Conflict with other memory access
1001
file (The memory content has been Please save again
changed during processing)
Failed to achieve the memory LOCK
Memory access Conflict with other memory access
1002 (Conflict with other memory access
conflict Please save again
processing)
5
Operation Recorder Function
TRGR TRGR
Device record data
acquisition
Device data of the specified ID
5
Operation description
When the data is acquired with the TRGR instruction, it is necessary to set the
Point
sampling period to "Trigger Instruction (TRGR)" in "Operation Record Setting" -
"Device Record Setting" of KV STUDIO in advance.
Calculation flag
CR2009 No change
CR2010 No change
CR2011 No change
• ON when the value specified for the operand is out of the specified range.
• ON when the range of indirect specification or index modification is improper.
CR2012
OFF except the above
• n No change when specified as a constant.
Sample program
CPU BUILT-IN FUNCTIONS
If the following ladder program is described in the Fixed-period module, the device data can be
acquired each time the Fixed-period module is executed.
When the Fixed-period module is executed, it is necessary to set to the interrupt enable
Point
state (execute the EI instruction).
5 “ Fixed-Period Module”, page 4-103
“4-13 Interrupts”, page 4-206
Operation Recorder Function
Save speed
• Scan time will be extended when collecting operation records. The actual scan time can be checked
in the scan time monitor.
• The scan time will not be extended as the data collection stops while the operation recorder is saved.
If the scan time fluctuation is an issue, it can be improved using the fixed scan time operation
Reference or via the setting of END processing time.
“Using the fixed scan time operation function”, page 4-91
“Setting the END processing time”, page 4-92
5
Memory access priority
exists.
When the specification method of the folder number is "Automatic consecutive number"
• When "Overwrite" is selected in "When there is no free number", the oldest folder will be deleted and
overwritten with the same folder name.
• When "Stop" is selected in "When there is no free number", the saving will fail, and the collection of
operation recorder will restart.
How to Connect to a PC
Use a USB cable (OP-35331) to connect the PC and the CPU unit.
• Before you connect the CPU unit to the PC's USB connector, be sure to install
Point
KV STUDIO. 5
• The USB port's SG is shared with 0 V of the power supply. A potential difference
USB Communication
between the product being connected to and the SG will lead to damage to the
CPU unit and to the product being connected to.
When a Windows 11/10/8/7 PC is used, USB is automatically recognized and no driver need to be
installed.
MC protocol communication
communication function"
"Chapter 10 Mail sending/
Mail sending/receiving
receiving function"
"Chapter 11 FTP server
FTP server
function"
"Chapter 12 FTP client-side
FTP client "EtherNet/IP function user's
function"
manual"
"Chapter 14 KV socket
KV socket communication
communication function"
"Appendix-2 Communication
BOOTP client
without Unit Setting/BOOTP"
Implicit (I/O) message
"Chapter 4 EtherNet/IP
Explicit message (client)
communication function"
Explicit message (server)
"Chapter 7 Sensor application
Sensor application function
function"
For specific content of the available functions, please refer to "EtherNet/IP function user's manual" .
The CPU unit is provided with a compact LCD display with 2-color backlight.
The LCD lights white in RUN mode and lights red in PRG mode (halted).
y/RDG 750'LUHFW
y6DYH
y)LOH0DQDJHPHQW
y)UHH6SDFH
/
5
y࣮ࣟࢻ 750ࢲࣞࢡࢺ
Access Window
yࢭ࣮ࣈ
yࣇࣝ⟶⌮ /
y✵ࡁᐜ㔞
yࣖ䖳 750
yؓᆎ
yᮽԬ㇗⨼ /
yਥ⭞グ䰪
.96$'&+ 7HPS:DUQ
$'&RQY'DWD &KHFNWKHDPRXQW
RI:DWHU
.96$'&+ ᗘ␗ᖖ
$'ኚࢹ࣮ࢱ ෭༷Ỉࡢ㔞ࢆ
☜ㄆࡋ࡚ࡃࡔࡉ࠸
.96$'&+ ᓜᔸᑮ
$'&RQY'DWD 䈭⺤䇚߭প≪Ⲻ䠅
Function list
The device data can be changed and monitored through the access window equipped in the CPU unit.
CPU BUILT-IN FUNCTIONS
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.
"Unit Monitor" (page 5-115)
Device mode
5 In this mode, internal devices can be displayed and their settings changed.
"Device Mode" (page 5-118)
Access Window
Storage
The operation such as project save/load, file management, confirmation of free space inside the
memory card and CPU memory is possible.
"Storage" (page 5-139)
Error clear
Clear serious errors of the CPU unit.
"Error Clear" (page 5-127)
Digital trimmer
In this mode, trimmers can be set digitally. The maximum resolution is 4294967296.
"Digital Trimmer" (page 5-128)
Unit Test
In this mode information about the expansion unit, such as the input/output status, can be checked.
"Unit Test" (page 5-130)
CPU monitor
In this mode, the internal functions of the CPU can be monitored.It also allows you to verify names of
projects in the unit, unit serial number and version.
"CPU Monitor" (page 5-134)
Monitoring alarm
This mode allows you to check alarm monitor settings and log.
"Alarm" (page 5-136)
Language
The language displayed can be selected from Japanese, English, Chinese (simplified).
Menu Structure 5
Access Window
Switching among modes is implemented by menu.
Pressing the "MENU" key displays a menu. (When other units are selected, press the direct access key
for the unit, or press "MENU" 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 to scroll the menu up and down.
'HYLFH0RGH ࢹࣂࢫ࣮ࣔࢻ 䖥ݹԬ⁗ᕅ
(UURU&OHDU ࢚࣮ࣛࢡࣜ 䭏䈥䲚 MENU ENTER
8QLW7HVW ࣘࢽࢵࢺࢸࢫࢺ ঋ⎁ݹ䈋
6WRUDJH ࢫࢺ࣮ࣞࢪ ᆎ۞
In the examples shown, Japanese is displayed on the left, English is displayed in the center and
Chinese is displayed on the right. Refer to "11.LANGUAGE" for information on how to switch between
Japanese, English and Chinese.
"Access Window Setup" (page 5-151)
Part of the menu does not correspond to written Chinese. When a non-corresponding
Point phrase is displayed in Chinese, it becomes written English.
When serious error occurs and its log hasn't been cleared, '' '' will be displayed on the upper
Reference right of Access Window.
3.Unit Test(3.ユニットテスト/3.অ⍻ݳ䈅)
4.Storage(4.ストレージ/4.ᆈۘ) Load(ロード/࣐䖭)
Save(セーブ/؍ᆈ)
File Management(ファイル管理/᮷Ԧ㇑⨶)
Free Space(空き容量/ਟ⭘オ䰤)
5.CPU Monitor(5.CPUモニタ/5.CPUⴁ᧗) Project Name(プロジェクト名/亩ⴞ)
Version(バージョン/⡸ᵜ)
Ethernet(イーサネット/ԕཚ㖁)
5 6.Data/Time(6.時計/6.ᰦ䫏)
(7.トリマ/7.ᗞ䈳ಘ)
7.Trimmer
8.Alarm(8.アラーム/8.ᣕ䆖) Monior(モニタ/ᣕ䆖ⴁ᧗ಘ)
Access Window
Monitor Record(履歴モニタ/ᰕᘇⴁ᧗ಘ)
Clear Record(履歴クリア/ᰕᘇ䲔)
9.AW Setting(9.AW設定/9.䇯䰞デ䇮ᇊ) Contrast(コントラスト/ሩ∄)
Comment Number(コメント番号/⌘䟺㕆ਧ)
10.Clear(10.クリア/10.䲔) RAM Clear(RAMクリア/RAM 䲔)
User Mem Clear(ユーザメモリクリア/⭘ᡧᆈۘಘ䲔)
All Clear(オールクリア/ޘ䜘䲔)
11.Language(11.LANGUAGE/11.LANGUAGE)
KV-SIR32XT
0 1 2 3 4 5 6 7
8 9 10 11 12 13 14 15
0 1 2 3 4 5 6 7
8 9 10 11 12 13 14 15
IN
(1) Access Window
OUT
IN OUT
(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 switching between modes and changing settings in each mode.
Key functions differ according to each mode. For details, see the operation
instructions for each mode.
Unit Monitor
When unit error occurs, the direct access switch will turn red, and the error contents will be
Reference 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.
Access Window
Setup operation
General Function When Changing Numerical Values
keys
MENU Displays the menu. It returns to normal display.
Hold down 1 second or longer to change Hold down 1 second or longer to change
ENTER
settings. settings.
Turn the page and select an option to Calculates the amount of change from the
change settings. setting value.
Turn the page. Select an option to change Subtracts the amount of change from the
settings. setting value.
Displays the menu. Changes the number of digits in the
Not used. amount of change.
OUT AX2
5
TEACHING
UNIT
IN OUT
Access Window
Menu display
1 Press the "MENU" key with the direct access switch for the unit flashing (selected).
Changing Settings
Let's take altering the input time constant as an example.
1 Select constant 000 when configured and then press the "ENTER". 5
The currently set time constant can be checked.
Access Window
-85+4:6 -85+4:6 -85+4:6
+PRWV(KNVGT ᤨቯᢙ +PRWV(KNVGT MENU ENTER
WU WU WU
2 Hold down the "ENTER" key for at least one second in this state
The setting value flashes, and the unit enters the change mode. (Not possible during RUN, can only be
modified during PRG mode.)
3 Change the setting value using the up/down keys, and hold down the " ENTER" key for at least
one second.
The setting value stops flashing and is set. (It cancels when the MENU key is pressed.)
Device Mode
CPU BUILT-IN FUNCTIONS
5 LR
B
Latch relay
Link relay
CM
TM
Control memory
Temporary memory
CR Control relay T Timer
Access Window
Operation method
Switch to the Device mode
2 Select "1. device mode ", and press the "ENTER" key.
The monitor screen is displayed in the device mode.
5
2)) MENU ENTER
5
21
The device No. to be displayed can be changed by the "" "" keys. 5
Access Window
Changing type of device to be monitored
1 Press the " / " key in device mode
5
2)) MENU ENTER
5
21
㺃5
㺃05 MENU ENTER
㺃/5
㺃%
㺃&0
㺃70
Press the "ENTER" key. This displays the TM of the specified No.
70
70
'0
MENU ENTER
'0
2 Press the " / " key with the list of device types displayed.
㺃'0
㺃(0 MENU ENTER
㺃)0
㺃=)
5 Press the "ENTER " key. This displays the monitor value in the selected display format.
The display format selected here is applied to all devices.
Access Window
有符号16位十进制 display
Data width 16-bit, hexadecimal
16-bit HEX 16進数16BIT 16位十六进制 display
16-bit BIN 2進数16BIT 16位二进制 Data width 16-bit, binary display
Data width 32-bit, unsigned, decimal
32-bit DEC 10進数32BIT 无符号32位十进制 display
Data width 32-bit, signed, decimal
±32-bit DEC ±10進数32BIT 有符号32位十进制 display
Data width 32-bit, hexadecimal
32-bit HEX 16進数32BIT 32位十六进制 display
ASCII 16BIT ASCII 16BIT 16位ASCII码 ASCII character representation
Data width 32-bit, single-precision
FLOAT FLOAT 单精度浮点型 floating point representation
Data width 64-bit, double-precision
DOUBLE FLOAT DOUBLE FLOAT 双精度浮点型 floating point representation
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.
*1 Display is avalible, but device value rewriting from the access window in this format is not supported.
5
2)) MENU ENTER
5
2))
2 Press the " / " key with the list of device types displayed.
㺃5
㺃05 MENU ENTER
㺃/5
㺃%
5 3 Press the " / " key in the display format selection screen.
Access Window
5 Press the "ENTER" key. This selects comment display, and the display returns to the device mode.
The comment "sensor A" is registered in R1000 and when the comment is not registered to R1001, the
display will be as follows.
5
2)) MENU ENTER
5
2))
Access Window
(In this case, device value will not be stored)
5
2)) MENU ENTER
3 To set the desired device value and hold down the "ENTER" key for at least one second.
Flashing stops and device value will be stored. Press the "MENU" key to stop loading and return to
monitor display.
5
21 MENU ENTER
5
2))
1
CPU BUILT-IN FUNCTIONS
Hold down the "ENTER" key for at least one second with the device to change displayed.
'0
'0
'0
5
Access Window
'0
MENU ENTER
'0
MENU ENTER
'0
'0
MENU ENTER
7 Adjust the device value to a suitable value, and hold down the "ENTER" key for at least one second.
This stores the value, and the screen returns to the monitor display.
It returns to monitor display without executing write in when the "MENU" key is pressed.
5
when upper limit is
6 If a device is not being used by a ladder not set.
AAAA
program (the device is not registered), "Digital Trimmer",
5AAAA
Page 5-128
Access Window
it is displayed as shown in the figure to the left.
There are two kinds of CPU unit errors: minor error and serious error.
In the case of a serious error occurs, pressing a certain key in Access Window will erase
Reference
the error display, but the error cannot be cleared. If you don't operate the Access
Window for 30sor longer, or switch the RUN PRGselector to RUN, the error contents
will be displayed again.
In case of error occurred in the extension unit, check the user's manual of each unit.
When a serious error occurred, CR 3905 turns ON, and error code is stored in CM 5105.
Reference
If a minor error occurred,CR 3906 turns ON, and error code is stored in CM 5155.
With CRsand CMs, you can check the error contents from the touch panel. See
"Latest error details (CM)" (page 4-87)
Error Clear
Access Window
The same as MENU key
The same as ENTER key
How to operate
(UURU&OHDU ࢚࣮ࣛࢡࣜ
1R 1R
1R/DGGHU ࣛࢲ࣮ࣉࣟࢢ࣒ࣛ
3URJUDP ࡞ࡋ
3 After changing the value, hold down the "ENTER" 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 "ENTER" key for more 1s to clear
them. "No error" will be displayed when all of the severe error is cleared.
If an error occurs on the extension unit, the following message will be displayed in the
Reference
access window.
In this example below, you can see that error number 1280 (axis 1 ML-III slave station
communication error) has occurred in KV-XH16ML of unit number 4.
If an error occurs on the extension unit, it is necessary to clear the error on the
extension unit side after removing the error cause. For how to clear the extension unit
error, refer to the user's manual of each unit.
- KV-8000 Series User’s Manual - 5-127
5-9 Access Window
Digital Trimmer
CPU BUILT-IN FUNCTIONS
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 program.
"KV-8000/7000/5000/3000/1000 and Nano Series Instruction Reference Manual, "TMINInstruction""
How to operate
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
Trimmer No.
TRM0 upper limit
Device
CM1700, CM1701
5
TRM1 upper limit CM1702, CM1703
Access Window
TRM2 upper limit CM1704, 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
Unit Test
CPU BUILT-IN FUNCTIONS
These allow you to verify the input/output status and other information of an expansion unit.
This can also be verified when the settings of unit configuration set through KV STUDIO
Reference haven't been transmitted to CPU.
How to operate
Migration to unit test
1 Press the "MENU" key.
A menu is displayed. (If other units are selected, press the "MENU" key twice.)
IN
OUT
IN OUT
The unit that corresponds to unit test is the expansion unit for KV-8000/7000 series and expansion I/O
unit for KV-5000/3000 series.
Please refer to the user manual of each unit regarding the unit test content when the expansion unit for
5
Access Window
KV-8000/7000 series is used. When expansion I/O unit for KV-5000/3000 series is used is as follows.
Shift the verified relay position according to every 16 digits by pressing "" "".
Shift the verified relay position according to every 8 digits by pressing "" "".
Press "" "" key to change the cursor position.
Press "ENTER" key to reverse the output state of cursor position (ON/OFF).
Point Please operate after verifying the state of connected control equipment.
I/O unit
Example) KV-C16XTD
-8%:6& -8%:6& -8%:6&
+0 176 176 MENU ENTER
AAAAAAAA AAAAAAAA AAAAAAAA
AAAAAAAA AAAAAAAA AAAAAAAA
The relay position to confirm can be moved in groups of 16 bits (8 bits for output relay) with the ""
"" key.
"" "" key may be used to change cursor position.
"ENTER" key may be used to inverse output state (ON/OFF) of the cursor position.
Point Please operate after confirm the state of connected control equipment carefully.
Date/Time
CPU BUILT-IN FUNCTIONS
5
Saturday ஔ赞蠅襲 ஔ蔕缽膎
Access Window
Setup operation keys Clock monitor Date and time setting Adjust screen
MENU Displays the menu. Clock monitor display Clock monitor display
Press for one second or
Pressing in the time display
longer to apply the settings
ENTER for 1 second or longer will Make adjustments.
and display the monitor
activate the time setting.
screen
Disabled Change settings Disabled
Disabled Change settings Disabled
The same as MENU key Change setting items. The same as MENU key
Switch to the adjust screen. Change setting items. Invalid
How to operate
Switching clock
1 Press the "MENU" key.
A menu is displayed. (If other units are selected, press the "MENU" key twice.)
Date/time setting
1 Press "ENTER" key for more than 1s in date/time.
5
MENU ENTER
)ULGD\ 㔠᭙᪥ ᱕ᵕӊ
Access Window
3 Select the item using the "" and "" keys.
4 Repeat steps 2 and 3. After setting, hold down the "ENTER" key for at least one second.
"Exec" is displayed at the bottom row of the screen indicating that the time setting request was
accepted.
(In this case, the date/time has not been set.)
Release the "ENTER" key. This applies setting of date/time, and returns the screen to the date/time
display.
It returns to time display without executing time configuration when the "MENU" key is pressed.
Set year, month, day, hour, minute, second, and day of the week accurately.
Point The day of the week is not checked corresponding to the year, month, day, hour,
minute, and second.
0 second adjustment
0 second adjustment is a function for setting the seconds value to "0".
.
The "Adjust will be executed when ENTER is pressed" will be displayed in 3rd, 4th line and time
adjust becomes possible.
(To cancel time adjustment, press the "" key. The "Adjust" display disappears, and the screen returns
to the date/time display.)
CPU Monitor
CPU BUILT-IN FUNCTIONS
CPU's internal functions can be monitored. Meanwhile, the names of projects stored in CPU unit can be
displayed.
5
Indicates the names of projects stored in the CPU
Project Name プロジェクト名 项目名 unit. (The name is set to KV STUDIO)
Indicates the version of the unit system program
Access Window
How to operate
Switch to CPU monitor
Project Name 5
1
Access Window
Select "Project name" in the CPU monitor menu and press the "ENTER" key.
Project name will be displayed.
Version
1 Select "Version" in the menu of CPU monitor and press the "ENTER" key.
The version will be displayed.
The version, serial number for expansion unit other than CPU unit can be confirmed by using
Reference the "" and "" keys.
(It will not appear to the version screen for expansion unit other than for KV-8000/7000
series.)
Alarm
CPU BUILT-IN FUNCTIONS
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.
5 Control relay
CR3300 to CR3415
R/W
R/W
Description
Alarm relay (32). Device comment is registered in
advance.
Access Window
Be sure to operate the alarm relays by the SET and RES instructions. Currently
Point operating alarm relays can be reset and batch-cleared also by the ARES instruction.
The maximum message length that can be displayed in the Access Window is 8 full-
Point width (16 half-width) characters. When no device comment is set, the alarm relay No.
will be displayed.
How to operate
Switch to alarm
1 Press the "MENU" key.
5
The menu will be displayed. (When other page is selected press the "MENU" key.)
Access Window
2 Select "8. Alarm", press "ENTER" key.
Alarm menu is displayed.
Monitor
1 Select "Monitor" in the Alarm menu, and then press "ENTER" key.
The alarm monitor is displayed.
When several alarm relays are in ON state, other alarms can be displayed by pressing "" and "".
(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.
Log display
1 Select "log monitor" in the alarm menu and press the "ENTER" key.
CPU BUILT-IN FUNCTIONS
(1) "01/04"
Alarm log No./total number of logs currently displayed.
(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 "↑".
Log clear
1 In the alarm menu, select "Clear Record"and then select "ENTER."
The confirmation message of cleared logs will be displayed.
Storage
Access Window
Save セーブ 保存 value, device comment, unit setting Information
and log setting Information.
Display a list of directories and files on the
memory card or in the CPU memory.
File Management ファイル管理 文件管理 You can also select Copy, Move or Delete from
the list to process a file.
Display the free space available on the memory
Free Space 空き容量 可用空间 card or in the CPU memory.
How to operate
Switch to Storage
CPU BUILT-IN FUNCTIONS
5
Load
Access Window
1 Select "Load" in the storage menu, and then press the "ENTER" key.
A message appears prompting you to select a memory card or CPU memory storage device.
2 Use "" and "" to select a storage device, then press the "ENTER" key or the "" key.
The (project) folder in the root folder of the memory card or CPU memory appears.
(No file is displayed. Folder names are displayed as "<D>KVSAVE01"where the first three characters
are displayed as "<D>.")
3 Select a folder by pressing "" and "", then press the "ENTER" key or the "" key.
A message asking you to confirm that you want to perform the load operation is displayed.
(QTEGNQCF!
ߐࠇߡ߹ߔ
ᒝⴕߒ߹ߔ߆㧫 ᰃ৺ᔎࠊᠻ㸠˛ 5
• When there is little free space in CPU memory and it is not possible to change CPU
Access Window
memory capacity, the following screen appears.
The CPU memory clear will be executed when the "ENTER" key is pressed for 1
second.
The load will be cancelled when the "MENU" key is pressed.
.QCF ࡠ࠼ ࡴ䕑
/GOQT[(WNN ኈ㊂ਇ⿷ ぎ䯈ϡ䎇 MENU ENTER
%NGCT7UGT/GO! ࡙ࠩࡔࡕࠍ ᤚุᷡ㒰
ࠢࠕߒ߹ߔ߆! ⫼᠋᭛ḷ˛
.QCF ࡠ࠼ ࡴ䕑
Press the "MENU", "ENTER", "", and "" keys to return to the storage menu.
Save
1 Select "Save" in the storage menu and press the "ENTER" key.
CPU BUILT-IN FUNCTIONS
A message appears prompting you to select a storage device, either a memory card or CPU memory.
2 Use "" and "" to select a storage device, then press the "ENTER" key or the ""key.
A message asking you to confirm that you want to save CPU data is displayed.
5
5CXG ࡉ ֱᄬ
MENU ENTER
5CXG1-! ࡉߒ߹ߔ߆! ᰃ৺ֱᄬ"
Access Window
5CXG ࡉ ֱᄬ
-85#8';.$ -85#8';.$ -85#8';.$ MENU ENTER
̒̒ ̒̒ ̒̒
4 After saving is finished, the name of the saved project folder will be displayed.
5CXG ࡉ ֱᄬ
5CXG&QPG ࡉቢੌ 5CXG&QPG
Press the "MENU," "ENTER," " ," and "" keys to return to the storage menu.
5
ロードできません The folder of CM designated to
Please confirm that project data is
4 Cannot load data memory card/CPU memory does Load
inside.
not exist.
无法加载
Access Window
メモリカードがありません
---------------------------------------------------
CPUメモリアンマウント The load or save was executed Please insert the memory card
Memory card not found during the condition without being when loading from the memory
5 --------------------------------------------------- Load/Save
CPU Memory unmounted able to recognize memory card/ card, or saving to memory card.
PRGモード時のみ可能です
Please switch to PRG mode to
11 PRG mode only It tried to load with RUN mode. Load
load.
仅PRG模式时可执行
空き容量がありません
There are no free space in the
12 No free space Please increase the free space. Load/Save
memory card/CPU memory.
没有可用空间
スイッチがPRG時のみ可能です Tried to upgrade the version of Turn the switch to PRG mode then
17 Only when switch in PRG system program when the switch execute version upgrade of the Load
was in RUN mode. system program.
仅开关处于PRG时可执行
18 Unit Type Mismatch different kind of unit compared to Please check unit type of YTC file. Load
the connected unit.
单元类型不一致
An attempt was made to load a
オールクリアが必要 project that requires all clear in Execute all clear and then load the
advance. If the version of the project. If you are loading from the
19 All Clear Reqred Before loading project in the PLC and the project CPU memory, back up the data Load
to load do not match, all clear must beforehand as the data to load will
be executed before loading the also be cleared.
加载前 需全部清空
project.
メモリカードカバーオープン
Please close the memory card
100 Memory card cover open The memory card cover is opened. Load/Save
cover.
存储卡外盖打开
メモリカードがLOCKされています
The memory card is in LOCK Please release LOCK or use
101 Memory card locked Save
status. memory card that is writable.
存储卡被锁定
ロードできません
---------------------------------------------------
セーブできません
Cannot load data Please check the file system of the Load
102 --------------------------------------------------- The memory card is damaged. -----------
Cannot save data memory card. Save
无法加载
---------------------------------------------------
无法保存
ファイル数上限を超過しました The sum of number of files and
folders inside the user memory has Please reduce the file or folder
103 Max no. of files exceeded Load/Save
gone over the upper limit. inside the user memory.
超过了文件数上限
フォルダ階層が深すぎます
The folder hierarchy inside the user Please confirm the folder hierarchy
104 Folder layer too deep Load/Save
memory is too deep. inside the user memory.
文件夹层数过多
• The file is damaged.
• The memory card is damaged.
ロードできません • The card has been extracted
during the loading process.
• It tried to load from CPU
memory with the configuration
Please confirm if the project and
1000 Cannot load data "Load after clearing the user Load
memory card is appropriate.
memory".
• It tried to execute load from CPU
memory with methods other
than the autoload, run load with
无法加载
the configuration "Load after all
clear".
Reference The load / save result can also be confirmed on the CM.
File Management
1 Please select "File Management" from the menu of storage and press "ENTER" key.
2 Use "" and "" to select a storage device, then press the "ENTER" key or the ""key.
The (project) folder and files in the root folder appear.
5
& (4 & (4 & (4 MENU ENTER
& -85#8' & -85#8' & -85#8'
& 7UGT&QE & 7UGT&QE & 7UGT&QE
Access Window
• Long file names and folder names scroll across the display.
Reference • Folder names are displayed as "<D>KVSAVE01"where the first three characters are
displayed as "<D>."
• Please use "" key or the "" key when moving the folder.
• "<D>." represents the current folder and "<D>.." represents the folder that is one hierarchy
above.
3 Select folder and file with "" "" and press "ENTER" key.
The Operation list appears.
4 Select an operation by pressing "" and "", then press the "ENTER" key or the "" key.
The Operation list display appears.
Press the "MENU," "ENTER," " ," and "" key to return to the file list display.
• File information
• Copy
• Please use "" key or the "" key when moving the folder.
• "<D>." represents the current folder and "<D>.." represents the folder that is one hierarchy above.
You can only copy data between different storage devices, for example, between
Reference memory card and CPU memory, or vice versa. (You cannot copy data to the same
storage folder.)
%QR[ ࠦࡇ ࠊ
ޓ ǂ MENU ENTER
%QR[1-! ࠦࡇߒ߹ߔ߆! ᰃ৺ࠊ˛
• Please use "ENTER" / "" key or the "MENU" / "" key when moving the folder.
"<D>." represents the current folder and "<D>.." represents the folder that is one hierarchy above.
4 Copy the file by pressing the "ENTER" key for 1 second or longer.
A message asking you to confirm that you want to perform the copy operation is displayed.
%QR[ ࠦࡇ ࠊ
MENU ENTER
%QR[&QPG ࠦࡇቢੌ ࠊᅠ៤
• A file/folder with the same name as the source is displayed in the screen shown
Point below.
It will be overwritten when the "ENTER" key is pressed for 1 second.
%QR[ ࠦࡇ ࠊ
ޓ ǂ MENU ENTER
1XGTYTKVG! ᦠ߈ߒ߹ߔ߆! ᰃ৺㽚Ⲫ˛
In the screen shown below, hold down the "ENTER" key for 1 second or longer to
cancel copying. 5
Access Window
%QR[ ࠦࡇ ࠊ
MENU ENTER
㨯㨯㨯 ̒̒̒ 㨯㨯㨯
%CPEGN!ޓ ਛᢿߒ߹ߔ߆! প⍜˛ޓ
• Move
5
=/QXG6Q? =⒖േవࠍㆬᛯ? >䗝ᢽ⿏ࡼⳂᷛ@
%27/GOQT[ %27ࡔࡕ &38ᄬ఼ټ MENU ENTER
Access Window
• Please use "" key or the "" key when moving the folder.
• "<D>." represents the current folder and "<D>.." represents the folder that is one hierarchy above.
The copy can only be executed towards the storage that differs such as memory
Reference card→CPU memory, or CPU memory→memory card (It can not copy to the same
storage folder).
/QXG ⒖േ ⿏ࡼ
ޓ ǂ MENU ENTER
/QXG1-! ⒖േߒ߹ߔ߆! ᰃ৺⿏ࡼ˛
4 Press the "ENTER" or "" for 1 second or longer and move the file.
A message asking you to confirm that you want to perform the move operation is displayed.
/QXG ⒖േ ⿏ࡼ
MENU ENTER
/QXG&QPG ⒖േቢੌ ⿏ࡼᅠ៤
• A file/folder with the same name as the source is displayed in the screen shown
Point below.
Press the "ENTER" key or "" key for 1 second or more to overwrite.
/QXG ⒖േ ⿏ࡼ
ޓ ǂ MENU ENTER
1XGTYTKVG! ᦠ߈ߒ߹ߔ߆! ᰃ৺㽚Ⲫ˛
/QXG ⒖േ ⿏ࡼ
MENU ENTER
̒̒̒ ̒̒̒ ̒̒̒
%CPEGN/'07 ਛᢿ/'07 প⍜/'07
In the screen shown below, hold down the "ENTER" for 1 second or longer to cancel
a move operation.
5
Access Window
/QXG ⒖േ ⿏ࡼ
MENU ENTER
㨯㨯㨯 ̒̒̒ 㨯㨯㨯
%CPEGN! ਛᢿߒ߹ߔ߆! প⍜˛
• Delete
&GNGVG 㒰 ߴ䰸
&GNGVG1-! 㒰ߒ߹ߔ߆! ᰃ৺ߴ䰸˛ MENU ENTER
&GNGVG 㒰 ߴ䰸
5 Reference Deleting a selected folder will also delete all the files and folders it contains.
Access Window
Free space
1 Select "Free space" in the storage menu, and then press the "ENTER" key.
A message appears prompting you to select a storage device, either memory card or CPU memory.
2 Use "" and "" to select a storage device, then press the "ENTER" key or the "" key.
The free space on each storage device will be displayed.
Contrast
Access Window
&GXKEG/QFG ࠺ࡃࠗࠬࡕ࠼ 䕃ܗӊᓣ
'TTQT%NGCT ࠛࠢࠕ 䫭䇃⏙䰸 MENU ENTER
7PKV6GUV ࡙࠾࠶࠻࠹ࠬ࠻ ऩ⌟ܗ䆩
5VQTCIG ࠬ࠻ࠫ ᄬټ
2 Select "9. AW Setting" by pressing "" and "", then press the "ENTER" key.
The Access window setup menu appears.
3 Select a "Contrast" by pressing "" and "", then press the "ENTER" key.
v
4 Scroll the contrast values by pressing the "" and "" keys to set an appropriate contrast
value.
Contrast can be set to between 1 and 11.
%QPVTCUV ࠦࡦ࠻ࠬ࠻ ᇍ↨
MENU ENTER
Comment Number
The MENU appears. (If another unit is selected, press the "MENU" key twice.)
2 Please select "9.AW Setting" with "" "" key and press "ENTER" or "" key.
The Access window setup menu appears.
5 3 Select a "Comment number" by pressing "▲" and "▼", then press the "ENTER" key.
4 Hold down the "ENTER" key or the "" key for 1 second or more.
This allows you to switch comment numbers.
5 Select by pressing the "" and "" key, then hold down the "ENTER" key.
The comment number will switch.
CLEAR
RAM clear
You can use RAM clear to clear device values, alarm logs, error logs, PLC event log, device value
change log and current bank numbers of the file register at the same time. It also returns access
window settings to their defaults. A RAM clear initializes R, MR, LR, B, CR, T/C (current values), CM,
DM, EM, FM, ZF, W and Z. Ladder programs, unit setup information, comments, T/C (set values), and
logging setup information will not disappear.
5
Point The RAM clear can only be executed during PRG mode.
Access Window
1 Press the "MENU" key.
The MENU appears. (If another unit is selected, press the "MENU" key twice.)
2 Select "10. Clear" by pressing "▲" and "▼", then press the "ENTER" key or the "" key.
The Clear menu appears.
4 Hold down the "" key while pressing the "ENTER" key for 1 second or more.
The confirmation message is displayed again.
5 When the second confirmation is displayed, hold down the "ENTER" key for 1 second to clear
RAM.
During a RAM clear, the following screen is displayed. When the RAM clear operation ends, the unit is
automatically restarted.
If you do not hold down the "ENTER" key for 1 second or more, the message "Wait..."
Point will not be displayed, and the operation will be ignored.
All Clear
The all clear mode returns the CPU unit settings to their default values. (Ladder clear, device all clear)
CPU BUILT-IN FUNCTIONS
Point The all clear can only be executed during PRG mode.
2 Select "11. Clear" by pressing "" and "", then press the "ENTER" key or the "" key.
The Clear menu appears.
5
̒4#/%NGCT ̒4#/㩂㩢㨻 ̒4#/⏙䰸
㨯7UGT/GO%NGCT 㨯㩟㨺㩅㩨㩜㩝㩢㩂㩢㨻 㨯⫼᠋ᄬ⏙఼ټ䰸 MENU ENTER
㨯#NN%NGCT 㨯㨿㨺㩣㩂㩢㨻 㨯ܼ䚼⏙䰸
Access Window
4 Hold down the "" key while pressing the "ENTER" key for 1 second or more.
The all clear will be cancelled when the "MENU" key is pressed, and returns to the menu display.
The all clear will be cancelled when the "MENU" key is pressed, and returns to the menu display.
5 When the second confirmation is displayed, hold down the "ENTER" key 1 second or more to
perform an All Clear operation.
During an All Clear, the following screen is displayed. When the All Clear operation ends, the unit is
automatically restarted.
If you do not hold down the "ENTER" key for 1 second or more, the message "Wait..."
Point will not be displayed, and the operation will be ignored.
Point The user memory clear can only be executed during PRG mode.
2 Select "10. Clear" by pressing "" and "", then press the "ENTER" key or the "" key.
The Clear menu appears.
5
̒4#/%NGCT ̒4#/㩂㩢㨻 ̒4#/⏙䰸
Access Window
㨯7UGT/GO%NGCT 㨯㩟㨺㩅㩨㩜㩝㩢㩂㩢㨻 㨯⫼᠋ᄬ⏙఼ټ䰸 MENU ENTER
㨯#NN%NGCT 㨯㨿㨺㩣㩂㩢㨻 㨯ܼ䚼⏙䰸
4 Hold down the "" key while pressing the "ENTER" key for 1 second or more.
The confirmation message is displayed again.
5 The user memory clear will be executed when the "ENTER" key is pressed for 1 second or
longer, while the 2nd confirmation screen being displayed.
It will display the next screen while user memory clear is being executed. The completion message will
appear, when the user memory clear is executed and completes.
If you do not hold down the "ENTER" key for 1 second or more, the message "Wait..."
Point will not be displayed, and the operation will be ignored.
You can use window settings from KV STUDIO to make the following settings.
• Display language setting
• Display comment number setting
• Backlight OFF time setting
• User message setting
• The access window allows you to change the language setting, but it will revert to
Access Window
Point the KV STUDIO setting the next time the system is turned on.
• You can change the default display language setting by changing the CM value and
turning the power off and back on again.
(When the display language setting is made both in KV STUDIO and CM, the KV
STUDIO setting takes precedence.)
If you change the set value of the display comment number setting, the comments will change when the
following are displayed.
• Device monitor comment display
• Alarm monitor comment display
• User message
• The access window allows you to change the display comment number setting, but
Point it will revert to the KV STUDIO setting the next time the system is turned on.
• You can change the default display language setting by changing the CM value and
turning the power off and back on again.
(When the display comment number setting is made both in KV STUDIO and CM, the
KV STUDIO setting takes precedence.)
• An interrupt screen that appears will temporarily turn on the backlight (if OFF). It will
Point then go OFF after the set time has elapsed.
• Touching the keys when the backlight is OFF will turn it back ON.
• The backlight is not turned OFF in PRG mode.
• The backlight OFF time setting cannot be changed from the access window.
Display method
When powered on, value may be saved in control memory (CM) from the ladder diagram program,
select initial menu of access window when powered on.
When access window initial menu display function is used, save 1 in CM1780, set the menu displayed
on CM1781-CM1788.
5
Access Window
Reference Decimal number is represented by #, hexadecimal number is represented by $.
Selection scope of the device type (type of the display menu is valid only in
device mode)
Select the device type to be displayed according to the values stored in CM1781.
C $0003 B $001B
DM $0006 W $001C
CM $0007 ZF $002C
TM $0008 Z $0030
MR $0011
Selection method of device No. (type of the display menu is valid only in device
mode or trimmer mode)
Examples
When R1000 is selected
aaa = 10, bb = 0
5
N = 16 x 10 + 0 = 160
Access Window
MOV.D
#160 CM1784
The value of CM1784 and CM1785 is 160 ($A0).
When R10011 is selected
aaa = 100, bb =11
N = 16 x 100 = 11 = 1611 MOV.D
#1611 CM1784
The value of CM1784 and CM1785 is 1611 ($064B).
• For B, W, use the displayed device No. value (hexadecimal number) to select.
Examples
When B1000 is selected
MOV.D
The value of CM1784 and CM1785 is 4096 ($1000). $1000 CM1784
• For T, C, DM, CM, TM, EM, FM, ZF, use the displayed device No. value (decimal number) to select.
Examples
When DM1000 is selected
MOV.D
The value of CM1784 and CM1785 is 1000 ($3E8). #1000 CM1784
1: English (default)
2: Japanese
3: Chinese (simplified characters)
Settings other than the above are disabled.
When setting the default display comment number in the access window setting of KV
Point STUDIO, the setting of KV STUDIO takes precedence.
Display examples
1. When power on is selected, top menu is displayed in the access window.
Save the following settings in CM.
'HYLFH0RGH CM value
Device No. Set content
(UURU&OHDU (hexadecimal)
8QLW7HVW
6WRUDJH AW initial menu display
CM1780 $0001
ࢹࣂࢫ࣮ࣔࢻ
is enabled
࢚࣮ࣛࢡࣜ CM1781 - -
ࣘࢽࢵࢺࢸࢫࢺ
CM1782
ࢫࢺ࣮ࣞࢪ $00000000 Top menu
CM1783
䖥ݹԬ⁗ᕅ
CM1784
䭏䈥䲚 - -
ঋ⎁ݹ䈋 CM1785
ᆎ۞
CM1786 - -
CM1787 - -
CM1788 $0000 Key lock is invalid
2. When power on is selected, device mode, R200 ON/OFF are displayed in the access window.
Save the following settings in CM.
5 CM value
Device No. Set content
2)) (hexadecimal)
5
21 AW initial menu display
CM1780 $0001
is enabled
CM1781 $0000 R
CM1782
$01000000 Device mode
CM1783
CM1784
$00000020 200
CM1785
CM1786 $0000 Default
CM1787 $0000 Device numbering
CM1788 $0000 Key lock is invalid
User Message
Access Window
When user messages with multiple IDs are ON simultaneously, the user message with the lowest
numerical value is displayed.
For details on instructions, refer to the "KV-8000/7000/5000/3000/1000 and Nano Series Instruction Reference
Manual", "5-14 Access Window Instructions."
Display example
Menus can be accessed while a user message is displayed, but focus will
automatically revert to the user message if you do not perform any key operations
for 30 seconds.
• If a CR is set for multiple user message IDs, scroll buttons ( / ) will appear on the
right side. While the scroll buttons are displayed you can press the " " and " "
keys to display user messages for other IDs.
The operations on Access Window can be separately inhibited according to different functions.
The functions and projects of operation inhibited setting are as follows.
Function Item
Unit monitor Change settings
Device mode Change device value
Trimmer Change device value
Alarm Alarm log clear
Load·Save Load, save
Language Change settings
5 All Clear/RAM Clear Execute
User memory clear Execute
Access Window
Example
Write inhibited setting of digital trimmer Write disable setting in inhibited mode
MOV MOV
$0004 CM1738 $0002 CM1738
MOV MOV
$0010 CM1738 $0400 CM1738
In device mode, when device write inhibited is set, it can not be released in the Access
Point Window.
5-162 - KV-8000 Series User’s Manual -
5-9 Access Window
How to operate
Hold down the "" key and "MENU" key simultaneously for 3 seconds or longer to lock or unlock the
keys.
Access Window
#9/GUUCIG #9ࡔ࠶ࠫ 䆓䯂に⍜ᙃ
Under the state of key lock, this display remains unchanged irrespective of any operation, unless you
release key lock.
• During the process of key lock, operation is disabled even if direct access switch is
Point pressed.
• The key lock is not possible during unit monitor, unit test.
MEMO
CPU BUILT-IN FUNCTIONS
5
Access Window
Internal cycle
Expansion unit 1 Perform Perform
Internal
Expansion unit 1 Perform Perform Perform
cycle
In order to adjust the start timing of the internal period by tuning internal period of each expansion
unit, synchronized control in variation under 1 μs and synchronized sampling can be done
between expansion units.
The method for adjusting beginning time and sampling time differs between each unit.
For more information, see the user manual for each unit.
• The expansion unit for the KV-8000/7000 (S-Unit, X-Unit) is the only unit supported
Point
by the inter-unit synchronization. The expansion unit for the KV-5000/3000 is not
supported.
• As inter-unit synchronization function, output control is executed after inter-unit
synchronization period. If high speed output is desired after operation, the direct
refresh command should be used, not the inter-unit synchronization function.
• Inter-unit synchronization module or every-scan execution module (standby
module) can be selected in "Scantime-related settings" of "CPU system settings".
The inter-unit synchronous module performs an output refresh and input refresh for each unit after
beginning inter-unit synchronization (there are cases when it does not, depending on the settings). The
ladder program within the inter-unit synchronous module will be performed afterwards.
In case of not using direct updating command, items modified in inter-unit synchronization module will
be reflected in the next execution of inter-unit synchronization.
Performance commands and such will be run based on the beginning time of the inter-unit
synchronization.
Expansion unit 1
Output relay/output DM
Refresh device (W)
CPU device read
Expansion unit 1
Input relay/input DM
Refresh device (R)
CPU CPU device write
unit
Expansion unit 2
Output relay/output DM
Refresh device (W)
CPU device read
Expansion unit 2
Input relay/input DM
Refresh device (R)
CPU device write
Unit 1
Output buffer
Expansion
unit 1
Unit 1
Input buffer
Unit 2
Output buffer
Expansion
unit 2 Unit 2
Input buffer
• The value read out at the time of input refreshing can read out the data of the same
Point
timing between units, based on the synchronization beginning timing. Please see
the manual for each expansion unit, as the timing for reading out differs between
units.
• Value (command) programmed at the time of output updating will be executed in the
same timing based on synchronization start timing.
• Data refreshed by the inter-unit synchronization module input refresh and output
refresh differs for each unit. Some expansion units have no refresh device (inter-unit
synchronization refresh) or CPU device write/read function. For details, refer to the
expansion unit manual.
• When the inter-unit synchronization refresh timing is set to "Batch (END
processing)", it is not refreshed at inter-unit synchronization I/O refresh. However,
even if the refresh timing is set to "Batch (END processing)", the units set with the
refresh device (inter-unit synchronization refresh) or CPU device write/read function
are always refreshed at the inter-unit synchronization I/O refresh.
Period of inter-unit
synchronization
Period of inter-unit
synchronization
Every-scan execution modules/standby modules are executed every inter-unit synchronization cycle. In
other words, CPU unit program processing is executed with the scan time equal to the inter-unit
synchronization cycle.
- KV-8000 Series User’s Manual - 5-167
5-10 Inter-unit Synchronization Function
When using inter-unit synchronization, output refresh and input refresh for each unit's I/O relays and I/
O DM can be executed in the normal program execution END processing by setting "Refresh timing" to
"Batch (END processing)" in the unit settings for the expansion unit.
Refresh timing settings are only valid for expansion unit relays/DM data. Units set with
5 Point
the refresh device (inter-unit synchronization refresh) or CPU device write/read
function are always refreshed at inter-unit synchronization I/O refresh.
Inter-unit Synchronization Function
CPU unit
Inter-unit synchronization cycle
Inter-unit Inter-unit Inter-unit
Inter-unit synchronization synchronization synchronization synchronization
Internal cycle
Expansion unit 1
Internal cycle
Expansion unit 2
CPU unit
Internal cycle
Expansion unit 1
Internal cycle
Expansion unit 2
The inter-unit synchronization module execution time can be shortened by setting the
Point
expansion unit setting for relays and DM that do not require refreshing when executing
inter-unit synchronization to "Batch (END processing)". However, the refresh status of
expansion unit relays and DM that are set to "Batch (END processing)" will stop
matching the status of the inter-unit synchronization module status at execution.
Refer to the manual for each expansion unit for details of the inter-unit synchronization refresh
devices.
Depending on the expansion unit, you can write data to your chosen device in the CPU unit at inter-unit
synchronization refresh, or read data from the CPU unit. You can use this to read data from the CPU
unit and execute calculation in the unit program, or write calculation results to the CPU.
You can configure the devices that will perform CPU device write/read using the KV STUDIO unit editor.
If the "Inter-unit sync function" in the unit settings tab of each expansion unit in unit editor is set to
5 "Enabled", you will be able to select "CPU device write" and "CPU device read".
Inter-unit Synchronization Function
Click the "Add (A)" button of the "CPU device write/read" dialog box to display the "Select CPU device"
dialog box. From there, you can select the device to read from or write to.
Refer to the manual for each expansion unit for details regarding CPU device write/read.
The following refresh times will be necessary when performing inter-unit synchronization.
For the inter-unit synchronization cycle, configure a cycle with enough time (5 times + 75 μs or higher)
relative to the refreshing time.
N: Unit number
In_R[N]: Number of ch (assumed number of ch) of the interrupting input relay of unit number N
In_DM[N]: Number of DM words (assumed number of DM) of the interrupting input relay of unit
number N
Out_R[N]: Number of ch (assumed number of ch) of the interrupting output relay of unit number N
5 Out_DM[N]: Number of DM words (assumed number of ch) of the interrupting output relay of unit
number N
Inter-unit Synchronization Function
*(a) If the refresh timing of the unit interruption device is being configured to END process
(b) If the refresh timing of the unit interruption device is being configured to inter-unit
synchronization
*(a) If the buffer memory and CPU device are not refreshed
(b) If the buffer memory and CPU device are refreshed
• The devices interrupted for in/output of each model are as follows. (Default Value)
Point
In_R*1 In_DM*1 Out_R*1 Out_DM*1 In_Buf*2 Out_Buf*2 T_Ref
This section describes the procedure for connecting two KV-XH16ML to CPU unit and executing Inter-unit
synchronization.
5
Inter-unit Synchronization Function
You can also set the updating timing to "END processing", in addition to "inter-unit
Reference synchronization".
Set the CPU unit device write/read and inter-unit synchronization refresh devices as necessary.
"CPU unit device write/read" setting "Inter-unit synchronization refresh devices" setting
Of the KV-8000/7000 series expansion units (S-Units, X-Units), the S-Unit does not have
Point
a "CPU unit device write/read" setting (function). Furthermore, some units do not have
an "Inter-unit synchronization refresh" setting.
3 Setting target module which executes inter-unit synchronization by CPU system configuration.
4 Write an EI (enable interruption) instruction to every scan module or other ladder program.
5 The inter-unit synchronous module should be created, and written in the ladder program.
Inter-unit synchronization tracing is a function that simultaneously samples the internal data of KV-
8000/7000 series expansion units (X-Units) that are executing inter-unit synchronization, and the
device values of CPU units such as relays (R) and data memories (DM) at the inter-unit synchronization
cycle, and monitors the waves.
5
Inter-unit Synchronization Function
The basic inter-unit synchronization tracing operation method is the same as for the
Reference
real-time chart monitor. For details, refer to "9-6 Real-Time Chart Monitor" in the
KV STUDIO User Manual.
Only KV-8000/7000 series expansion units (X-Units) are compatible with inter-unit
Point
synchronization tracing. KV-8000/7000 series expansion units (S-Units), and KV-5000/
3000 series expansion units are not compatible.
Start-up method
1 Click "Monitor/Simulator (N)" > "Real-time chart monitor (H)" from the menu.
The "real-time chart monitor" starts up
Registering Devices
2 Select a unit. 5
• Enter part of a comment in "Filter" to filter devices so only those with comments containing
Reference the filter term are displayed.
• Refer to the manual for each unit for details about the devices that can be registered and
how to operate them.
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.
5 (2)OFF setting value (2)ON setting value (2) (2) ON<=(current value) < (2) OFF
current … … … … …
value
Cam Switch
(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
MCMP
MCMP
Multi-stage To perform multi-stage
Cam Switch
Specifies number of data for comparing or the device for storing number of
n 16 bits
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.
Description of Operation
CPU BUILT-IN FUNCTIONS
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
bit bit bit bit
31 16 15 0
S1 ˇ1 30 12 S1 D OFF
n S1 ˇ3 40 30 S1 ˇ2 D ˇ1 ON
bit bit
S1 ˇ5 30 80 S1 ˇ4 15 0 D ˇ2 OFF
S2 30
n ×
˄ǂǂ
5
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
Cam Switch
Point Even if the execution condition is OFF, output will not be changed.
Operation flag
* 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.
"Latest error details (CM)", Page 4-87
Sample Program
Cam Switch
Turns ON for one scan MOV #100 DM10
after operations start 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
MOV #900 DM18
MOV MOV #1000 DM19
#400 DM13 MOV #1100 DM20
MOV #1200 DM21
MOV LD R000
#500 DM14 MCMP DM10 DM0 R30000 #6
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
MEMO
CPU BUILT-IN FUNCTIONS
5
Cam Switch
Cam Switch
D1 N bits
stored*3
D2 Specifies the leading device in which parameters are stored *4 16×8 bits
*1 When you specify a bit device, the [ D2 + 0] × 32 consecutive bits from the start of the channel will be
used.
When you specify a word device, [ D2 + 0] × 2 words will be used.
*2 When you specify a bit device, 16 continuous bits will be used. If you specify a relay other than the
channel's leading relay (such as R002, R106, and R1012), the next channel will also be used to provide
the necessary 16 bits.
*3 When you specify a bit device, [ D2 + 0] bits will be occupied.
When you specify a word device, the result is stored in the lowest bit of the word device. The bits other
than the lowest bit will not be changed.
*4 When you specify a bit device, 128 consecutive bits from the start of the channel will be occupied.
When you specify a word device, 8 words will be occupied.
*5 N is the number of comparison data specified by D2 +0.
Operation Description
CPU BUILT-IN FUNCTIONS
Parameters
Device Details
Amount of data
D2 +0 Sets the amount of data to compare (1 to 32)
to compare
D2 +1 Resolution Sets the encoder resolution (32 to 32768)
Sets the residual gray code (0 to 16384)
Residual (Example) 32, 64, 128, 256, 512, 1024,
Resolution 36 360 720
D2 +2 2048, 4096, 8192, 16384, 32768
gray code
Residual
0 14 76 152
gray code
5 D2 +3
Zero degree
Sets the value to specify as zero degrees (0 to resolution - 1)
value
Cam Switch
Device Details
D2 + 5 D1 D2 +4
Bit 0: Output response error
Conditions
If, within a scan period, the ON and OFF values differ between
two or more output destination devices that are changed or if
there are differences between the ON values or OFF values,
an error will occur. No
Change
No error will occur in the following cases. change
D2 +5 Operation error • When the ON values and OFF values of the outputs that are
changed at the same time are the same.
• When the ON values of the outputs that are changed at the
same time are the same and when the OFF values of the
outputs that are changed at the same time are the same.
Bit 1: Input value out of range error
No
When the encoder's input value is outside of the setting range, No change
change
this will be turned ON.
Use a ladder program to reset the data.
D2 +6
Work area (This cannot be used by the user.)
D2 +7
When the execution condition is turned ON, starting from S1 , the first [ D2 + 0] sets of 32-bit data
(each comprised of two sets of 16-bit, unsigned BIN data indicating the OFF value and ON value) are
compared with the current angle value stored in the device specified with [ D2 + 4], and the results
are stored in the bit devices starting from D1 .
OFF value ON value Comparison Result
bit bit bit bit
31 16 15 0
S1 +1 30 12 S1 D2 +4 D1 OFF
[ D2 +0] sets S1 +3 40 30 S1 +2 bit bit
D1 +1 ON
15 0
S1 +5 30 80 S1 +4 D1 +2 OFF
30
([ D2 +0] x
2 words) S1 +2([ D2 +0]-2)+1 10 30 S1 +2([ D2 +0]-2) D1 + n -2 ON
S1 +2([ D2 +0] 1)+1 30 30 S1 +2([ D2 +0]-1) D1 + n -1 OFF
Cam Switch
destination devices that are changed within the scan
period are different.
OFF value of output destination device (4) does not
equal ON value of output destination device (5).
• If you change the values during operation, the change will immediately be
Point reflected in the output. If you do not want to reflect the changes in the output,
turn the execution condition OFF.
• Do not use the CR2002 (Always ON) control relay as the execution condition.
• Even if the execution condition is turned OFF, there will be no change to the
output.
• You cannot use this function in interrupt programs and initialization modules.
Operation flags
Sample Program
The input values R000 to R007 from the absolute encoder are stored in DM0 and are compared with
the set value. Output relays are then turned ON/OFF according to the following specifications.
Resolution: 256/Rev. Residual gray code: 0. Zero-degree teaching value: 12.
KV-SIR32XT
0 1 2 3 4 5 6 7
8 9 10 11 12 13 14 15
0 1 2 3 4 5 6 7
8 9 10 11 12 13 14 15
IN
OUT
R000
Absolute value type to
encoder R007 IN OUT
When DM0 is greater than or equal to 10.0° and is less than 20.0°, R1500 is turned ON.
When DM0 is greater than or equal to 30.0° and is less than 40.0°, R1501 is turned ON.
When DM0 is greater than or equal to 50.0° and is less than 60.0°, R1502 is turned ON.
CPU BUILT-IN FUNCTIONS
When DM0 is greater than or equal to 70.0° and is less than 80.0°, R1503 is turned ON.
When DM0 is greater than or equal to 90.0° and is less than 100.0°, R1504 is turned ON.
When DM0 is greater than or equal to 110.0° and is less than 120.0°, R1505 is turned ON.
MOV
#400 DM13
MOV
#500 DM14
MOV
#600 DM15
MOV
#700 DM16
MOV
#800 DM17
MOV
#900 DM18
MOV
#1000 DM19
MOV
#1100 DM20
MOV
#1200 DM21
MR000 ABSENC
DM10 DM0 R1500
DM110
• Large-capacity capacitors are used to maintain the built-in clock, so if the device remains
Reference off for two weeks or more (at +25°C), the clock data will be cleared and then set to January
1, 2000.
• When the clock data is cleared, CR2311 is turned ON. It is turned OFF when the clock data
is written.
• If you are using the KV-B1, you can back up the internal clock with a battery.
Clock Function
bit bit
15 0
CM700 Year 0 to 99 The year indicates the last two digits of the year, assuming that "00"
indicates "2000."
CM701 Month 1 to 12
CM702 Day 1 to 31
CM703 Hour 0 to 23 All data is written in 16-bit binary data format.
CM704 Minute 0 to 59
CM705 Second 0 to 59
CM706 Day of the week 0 to 6 The numbers correspond to the days of the week as follows:
0 indicates Sunday, 1 indicates Monday, 2 indicates Tuesday,
3 indicates Wednesday, 4 indicates Thursday, 5 indicates Friday,
and 6 indicates Saturday.
• This data can be read directly by ladder programs (the data is read-only.)
panels, you can synchronize the date and time of the CPU unit with the date and time of the VT5/VT3
Series.
Draw/Edit software
VT STUDIO
Versions 4.6 and later of VT STUDIO have a function for restoring the time and date.
Reference If the clock data of the connected CPU unit is cleared, it will automatically be synchronized to
the time and date of the touch panel.
General I/O
The interruption input, input capture, buffering input, general input can be used simultaneously.
PWM output and common output can not be used at the same terminal at the same time.
6 Please refer to "Wiring and Internal Circuit Diagrams" (page 2-16) for the terminal number of each
input and output.
I/O Functions
I/O Refresh
Normally, during program execution, the status of I/O signals is updated (refreshed) only onceper scan
(during ENDprocessing). You can use the following methods to update the I/O signals at arbitrary
positions in the program (direct processing).
Point However, the editor cannot be used to change the IN000 - IN015 the input range.
Unit Editor
6
You can use the Unit Editor to change the input time constant and the IN100-IN115 range (5 V/
I/O Functions
24 V) of "KV-SIR32XT" input relays.
Automatic recovery will not work when overvoltage protection is activated. Remove
Point
the cause of the problem, run PRG RUN to effect a recovery and clear the error.
This function enables you to check the input status of the "KV-SIR32XT" and cause a unit interrupt to
the CPU.
Use the IEDGE (input interrupt detection condition load) instruction to set the interrupt condition. Then
EXPANSION I/O UNIT FUNCTIONS
Setting Procedures
1 Use the unit editor to set the time constant of the input terminal that the interrupt will use.
6
Unit Interrupt Function
• Since the default value of the input time constant is 10 μs, it will take 10 μs or more
Point
for the interrupt to start when the input is turned ON.
• The input time constant can be set down to 1 μs.
2 Use the IEDGE (input interrupt detection condition load instruction) to set the detection condition.
The interrupt detection condition can be set to detect on the rising edge, falling edge or on both the
rising and falling edge.
The following is a setting example when detecting the falling edge of IN000 of unit number 1 and using
the interrupt function.
Detection condition
Detection condition
setting value
0
Rising edge
1
2 Falling edge
3 Both rising edge and falling edge
Reference If not set, the condition will be detected at the rising edge.
END
INT
Interruption
Unit number factor
#1 #0
KV-SIR32XT R30000
Interrupt Processing
RETI
ENDH
INT
Interruption
Unit number factor It creates the interruption
#1 #0
program and counts up DM0
KV-SIR32XT R30000 within the program.
CR2002 DM0
INC
Always ON
RETI
ENDH
The performance beginning time of the multiple “KV-SIR32XT“ that were connected to the CPU unit can
be run simultaneously.
It can be controlled without being affected from scantime or mismatch of control period of units.
EXPANSION I/O UNIT FUNCTIONS
Output timing
Synchronization Inter-unit
refreshing time synchronous module
Unit 1
R34200
(OUT200)
R34201
(OUT201) Inter-unit synchronization
refresh time out
Unit 2
R35200
→ Inter-unit synchronization
(OUT200) cycle time + after
(synchronization cycle x0.2)
R35201
(OUT201) seconds pass
• State of KV-SIR32XT
terminal Inter-unit synchronization refresh time out
Unit 1
(OUT200)
(OUT201)
Unit 2
(OUT200)
(OUT201)
• The state of the relay changed within the inter-unit synchronous module will be
Point
reflected in the output terminal from the beginning of the next inter-unit
synchronization to after the inter-unit synchronization refresh time out.
• The comparator match read at inter-unit synchronization refresh and signals such as
sync contact output can be simultaneously output for multiple units and multiple
terminals at the inter-unit synchronization cycle x 0.2 (ms). This is because they are
refreshed in the input/output order in inter-unit synchronization refresh.
• If a direct refresh such as DR is performed within the inter-unit synchronous
module, it will immediately be reflected in the output.
If you run the direct updating, some mismatch can be occured in output timing
between the units.
Input timing
Synchronization Inter-unit
refreshing time synchronous module
R34101
(IN001)
Unit 2
R35000
(IN000)
6
R35001
(IN001)
Unit 1
IN000
IN001
Unit 2
IN000
IN001
Items Parameter
Inter-unit synchronization cycle 40.0us~
Input R 2ch (32 points)
Input DM -
Refresh device Output R 2ch (32 points)
Output DM -
Buffer memory -
The inter-unit synchronization cycle varies depending on the extension unit. The settable
Point
minimum cycle follows the control cycle of the unit with the largest control cycle.
6
Inter-unit Synchronization Function
Attribute
Buffer memory address Name
R: Read only
0000 to 0001 IN000_rising edge input capture R
0002 to 0003 IN000_falling edge input capture R
0004 to 0005 IN001_rising edge input capture R
: : :
N*1×4 to N×4+1 IN***_rising edge input capture R
N*1×4+2 to N×4+3 IN***_falling edge input capture
6
R
: : :
0124 to 0125 IN115_rising edge input capture R
For reference examples of ON-time measurements using input capture, refer to "6-11 I/O Unit
Reference Program".
buffering. When trigger buffering is used, it continues sampling until the trigger is entered and shuts
down after it samples the amount of data configured before and after combined at the timing when the
trigger is entered.
Scan time
Input
status
Signals whose ON (OFF) time is shorter than the scan time make it impossible to correctly sample
input status.
Scan time
Input Sampling cycle
status
OFF ON ON ON OFF OFF OFF OFF OFF OFF ON ON OFF OFF OFF OFF ON ON ON ON ON ON ON OFF OFF OFF OFF ON ON ON
Correct sampling of input status is possible even when ON (OFF) time is shorter than the scan time.
Operating mode
Continuous buffering
Sampled data is stored in order. It uses U_RDBF instruction and when the readout of buffering data is
executed, it reads out data to the CPU device and the data of buffer memory will be deleted.
When data items in the buffer memory reaches 4096 items, the buffer overflows and buffering stops.
Buffer memory Data 1 Data 1 Data 1 Data 1 Data 1 Data 2 Data 2 Data 3
Data 2 Data 2 Data 2 Data 2 Data 3 Data 3 Data 4
• Data that has been read out from the buffer is deleted.
Point
• In the read-out, the data is read out starting in order from the oldest data. It can not
read out the data in progress.
Trigger Buffering
Like continuous buffering, this function stores device status and values in an internal buffer. When files
Time
Data 5026
6
N: Number of buffering points
Point Buffer overflow does not occur during trigger buffer execution.
Input information for 16 points found during sampling is stored in one buffer memory
Point
address. To verify the time sequence data for each point, it is necessary to verify the
time sequence for specific bit positions of the read out device.
Usage method
All settings are made in the ladder program.
Buffering setting
Buffering enabled
Attribute
Buffer memory
Name R: Read only Overview
Address
R/W: Read/write
0 : Consecutive
#512 Low_Buffering mode configuration R/W
1 : Trigger (Initial value:0)
#513 Low_Buffering point configuration R/W 1 to 4095
(Initial value : 100)
#514 Low_Buffering cycle configuration R/W 1~65535(µs)
(Initial value : 10)
#515 (System reservation) -
0 : Writing 1 to trigger register
1 : Designated input ON edge
#516 Low_Trigger condition configuration R/W 2 : Designated input OFF edge
3 : Interruption in inter-unit synchronization
(Initial value : 0)
#517 (System reservation)
6
-
#518 Low_Trigger terminal configuration R/W 0 to 31
(Initial value : 0)
#519 Low_ Buffering point configuration before trigger R/W 0 to 4095(Initial value : 0)
0 : None (Initial value)
Buffering Input Function
1 : Serial number
2 : Separately elapsed time of inter-unit
#520 Low_ Select configuration of identification number R/W
synchronization period
3 : Serial numbers of inter-unit synchronization
period
#521~#527 (System reservation) -
0 : Continuous
#528 Low_Buffering mode configuration monitor R
1 : Trigger
(Initial value : 0)
#529 Low_Buffering point configuration monitor R 1 to 4095
(Initial value : 100)
#530 Low_Buffering cycle configuration monitor R 1 to 65535
(µs)
(Initial value : 10)
#531 (System reservation) -
0 : Writing 1 to the trigger register
1 : Designated input ON edge
#532 Low_Trigger condition configuration monitor R 2 : Designated input OFF edge
3 : Interruption in inter-unit synchronization
(Initial value : 0)
#533 (System reservation) -
#534 Low_Trigger terminal configuration monitor R 0~31
(Initial value : 0)
Low_Buffering point configuration monitor before
#535 R 0~4095(Initial value : 0)
trigger
0 : None
1 : Serial number
Low_Select configuration monitor of identification 2 : Time elapsed by the inter-unit
#536 R
number synchronization cycle
3 : Serial number by the inter-unit
synchronization cycle
#537 (System reservation) -
bit0 : Buffering in progress
#538 Low_Buffering condition monitor R bit1 : Waiting for trigger
bit2 : Buffering complete
#539 Low_ Current buffering point monitor R 0 to 4095
0 : Normal
#540 Low_Buffering overflow R
1 : Occurrence of overflow
#541 Low_Buffering point monitor before trigger R 0 to 4095
#542~#543 (System reservation) -
(Hi buffering configuration equivalent to #512 to
#544~#575 R/W
#543)
#576~#639 (System reservation) -
0 : Disabled
#640 Low_Buffering enable R/W
1 : Enabled
0 : Disabled
#641 Hi_Buffering enable R/W
1 : Enabled
#642~#655 (System reservation) -
1 : Trigger Input
#656 Low_Trigger R/W
(Will automatically be updated to 0 after input)
1 : Trigger Input
#657 Hi_Trigger R/W
(Will automatically be updated to 0 after input)
Device (For Low:when IN000 to IN015 is used, For Hi:when IN100 to IN115 is used)
• Buffering mode configuration (For Low: #512, For Hi: #544)
• Configuration of buffering point before trigger (For Low: #519, For Hi: #551)
It configures sampling point before trigger when trigger buffering mode is used.
Configured value 0 to 4095(Initial value:0)
The set value when "1" is written during buffering enable is applied to operation.
1 : Serial number
2: Time elapsed by the inter-unit synchronization cycle
3: Serial number by the inter-unit synchronization cycle
6 4th word
:
Data4
:
bit15
It only stores I/O status
bit0
Buffering Input Function
6
performance will be stored.
Condition bit
Buffering cycle
Buffering data Data99 Data100 Data101 Data102 Data103 Data104 Data105 Data106 Data107
Serial number 3 0 1 2 3 0 1 2 0
The set value when "1" is written during buffering enable is applied to operation.
Reference
If a parameter changes after "1" has been written, the set value and the monitor value may differ.
Use the setting monitor to verify set values that are applied to actual operation.
• Current buffering point monitor (For Low: #539, For Hi: #571)
It monitors the data point within the buffer memory.
• Buffering point monitor before trigger (For Low: #541, For Hi: #573)
It monitors the buffering point before trigger with trigger buffering mode.
If trigger is entered before buffering is implemented for the amount of buffering points
Reference
configured before trigger after the buffering has started in trigger buffering mode, the buffering
point before trigger will complete buffering with the status fewer than the configured value.
Reference Please enter 0 once beforehand and write and execute 1 afterwards.
Reference program
It buffers input condition from IN000 to IN015, 4095 points every 1μs.
Start of
buffering
MR001 UREAD
Confirms buffering
#1 #538 DM8 #1
status.
Start of
buffering KV-SIR32XT Low buffering Low buffering
status monitor status monitor
MR001 UWRIT
#1 #640 #0 #1
Start of
buffering KV-SIR32XT
U_RDBF KV-SIR32XT
CH number Storing device Number of data
#1 It finishes buffering and
#0 EM0 #4095
reads out the buffering
KV-SIR32XT
results when MR001 is
UREAD OFF.
#1 #538 DM8 #1
Reference program
Continuously buffers the input state of IN000 to IN015 every 1 μs. Reads the buffered data every 1ms
EXPANSION I/O UNIT FUNCTIONS
with EM 0 leading.
6
MR000 UWRIT
It stores the configured U_RDBF #1 #0 EM0:Z1 DM3
#1 #512 DM0 #3
value of buffering CAL+ Z1 DM3 Z1
Start of
buffering KV-SIR32XT Low buffering Low buffering
mode configuration mode configuration
Buffering Input Function
MR000 UWRIT
#1 #640 #1 #1 Starts buffering.
Start of
buffering KV-SIR32XT Low buffering
enable
MR000 T0 #100 Read the buffered
T0 result every 1 ms.
Start of U
buffering
T0 UREAD
#1 #539 DM3 #1
+ Z1 DM3 Z1
Buffering point
• PWM can be used simultaneously up to 8 points and can be set individually. They
Point
allow you to set and use the terminals, periods, pulse frequencies output by the
settings.
• Up to 16 KV-SIR32XT can be connected to one KV-8000 series, so a maximum of 128
PWM output functions can be used.
6
Operating mode
Usage method
All settings are made in the ladder program.
PWM setting
Output started
Changing a setting during pulse output allows you to change the waveform output in a 1 x
Reference
PWM period.
Attribute
EXPANSION I/O UNIT FUNCTIONS
#288~#295 -
#296~#303 PWM5 configuration -
#304~#311 PWM6 configuration -
#312~#319 PWM7 configuration -
bit0:output enabled status monitor bit1:
#320 PWM0 output status monitor R output complete
bit2:output competition
Output terminal selection
#321 PWM0 output terminal monitor R
(OUT200~OUT315))
(0~31
#322~#323 PWM0 monitoring number of output pulse R 32 bits, 0 to 4294967295(PLS)
#328~#335 PWM1 output status monitor R
#336~#343 PWM2 output status monitor R
#344~#351 PWM3 output status monitor R
#352~#359 PWM4 output status monitor R #320 to #327 equivalent
#360~#367 PWM5 output status monitor R
#368~#375 PWM6 output status monitor R
#376~#383 PWM7 output status monitor R
#400 OUT200 function monitor R
#401 OUT201 function monitor R
:
bit0:General output in progress
#415 OUT215 function monitor R
bit1:PWM output in progress
#416 OUT300 function monitor R
:
#431 OUT315 function monitor R
#432 OUT200 to 215 monitor R
Output status of each terminal
#433 OUT300 to 315 monitor R
Device
• PWMn(n:0 - 7) output enabled
Select whether to execute PWM output.
• PWMn(n:0 - 7) period
Set the PWM output period in the range 0.1 µs to 429496729.5 µs.
It is recommended that the value be set to 10.0 µs or higher with the delay time of an actual circuit
taken into account.
6
• PWMn(n:0 - 7) ON time
Set the PWM output ON time in the range 0.0 µs to 429496729.5 µs.
It will always be OFF when 0.0μs is configured to ON time.
Changes made during output will take effect when the PWM output period ends.
Reference Program
The following is an example of a program where OUT200 generates PWM output.
EXPANSION I/O UNIT FUNCTIONS
Output 10000 pulses with a period of 100.0 μs (10 kHz) and an ON time of 70.0 μs.
CR2008 MOV
;<Mnemonic List>
#0 DM1 It stores
1 scan ON the configured LD CR2008
PWM Output
at the start
terminal value. MOV #0 DM1
of operation
MOV. D MOV.D #1000 DM2
MOV.D #700 DM4
#1000 DM2
MOV.D #10000 DM6
PWM Cycle LDP MR000
UWRIT #1 #257 DM1 #7
MOV. D LDP MR001
#700 DM4 UWRIT #1 #256 #1 #1
LD CR2002
PWM ON Time MPS
MOV. D UREAD #1 #320 DM10 #1
6 #10000 DM6
PWM Output
MPP
AND DM10.1
UWRIT #1 #256 #0 #1
pulse number
PWM Output Function
MR000 UWRIT
It writes in the
#1 #257 DM1 #7
configured value.
PWM configuration
write in KV-SIR32XT PWM Output PWM Output
terminal terminal
MR001 UWRIT
It executes
#1 #256 #1 #1
the PWM output.
PWM execution
KV-SIR32XT PWM0 Output
enable
CR2002 UREAD
#1 #320 DM10 #1
Always ON
KV-SIR32XT PWM Output PWM Output
condition monitor condition monitor
DM10. 1 UWRIT It stops PWM output
#1 #256 #0 #1 after confirming that
Output PWM output
PWM0 Output
complete KV-SIR32XT enable has completed.
Module instruction
U_RDBF U_RDBF(U)
U_RDBF
Reading out the
It reads out the
buffered input
EXPANSION I/O UNIT FUNCTIONS
Executing
condition @U_RDBF
n1 n2 D n3 @ U _ R D B F n1 n2 D n3
6 n2
D
Specifies the channel number or its storage location. *2
Specifies the start of the storage location for the read value.
16 bits
n3 bits
Exclusive Instruction for the Unit for KV-SIR32XT
Description of Operation
U_RDBF When the executing condition is ON, it reads out n3 word of the buffering data of the
channel designated at n2 of the unit number designated at n1 and stores to that
places D at the top.
When a value other than 0 is configured with the identification number selection of
Point
buffering, please enter the value that is doubled for the point to be read out since 1
data size becomes 2 words.
Computation Flag
CR2009 No change
6
Sample Program
;<Mnemonic List>
T0 #100
T0 LDB T0
TMU #0 #100
U
LD T0
UREAD #1 #539 DM0 #1
T0 UREAD U_RDBF #1 #0 EM0:Z1 DM0
#1 #539 DM0 #1 CAL+ Z1 DM0 Z1
+ Z1 DM0 #2
Z1
Buffering point
Module instruction
U_DISOVP U_DISOVP
Input overvoltage
It configures whether to
activate of disable the
protection function
EXPANSION I/O UNIT FUNCTIONS
input overvoltage
@U_DISOVP U_DISOVP configuration
protection function.
Executing
condition U_DISOVP
n1 S @ U _ D I S O V P n1 S
6 S
Specifies the value to be written or the storage location for the value to be
written.*2 16 bits
(0: Overvoltage protection enabled, 1: Overvoltage protection disabled)
Exclusive Instruction for the Unit for KV-SIR32XT
Description of Operation
Computation Flag
CR2009 No Change
Sample Program
6
It disables the overvoltage protection function of KV-SIR32XT of the unit number 1.
Module instruction
U_DISOCP U_DISOCP
Output overcurrent
It configures whether to
activate of disable the
protection function
EXPANSION I/O UNIT FUNCTIONS
output overcurrent
@U_DISOCP U_DISOCP configuration
protection function.
Executing
condition U_DISOCP
n1 S @ U _ D I S O C P n1 S
6 S
Specifies the value to be written or the storage location for the value to be
written.*2 16 bits
(0: Overcurrent protection enabled, 1: Overcurrent protection disabled)
Exclusive Instruction for the Unit for KV-SIR32XT
Description of Operation
U_DISOCP It disables the overcurrent protection function of KV-SIR32XT of the unit number
designated n1 , when 1 is designated to S when executing condition is ON.
Computation Flag
CR2009 No Change
Sample Program
6
It disables the overcurrent protection function of KV-SIR32XT of the unit number 1.
ST Language function
KV Script function
ST Language function o
Argument/ Type
Description Constant
return value .U .S .D .L .F .DF .B .T
Execution condition. Omissible. If omitted, always
EN - - - - - - .B -
(every scan) is executed.
Specifies the Unit No. of the unit to be read.
Unit .U .U .U .U - - - -
(0 to 48)
Specifies the CH No. of the buffering data to be read
Ch .U .U .U .U - - - -
(0 to 1)
Dst
Specifies the leading of the target data to store the
read buffering data.
.U .U .U .U - - - - - 6
Description of Operation
U_RDBF When the Execution Condition is ON, reads the buffering data of the channel specified
by Ch of the unit number specified by Unit by the DataCount word, and stores in the
device starting with Dst.
Example of Format
U_RDBF (bEnable,#1,#0,auData,#4000);
ST Language function
Argument/ Type
Description Constant
return value .U .S .D .L .F .DF .B .T
Execution condition. Omissible. If omitted, always
EN - - - - - - .B -
(every scan) is executed.
Specify the target unit No.
Unit .U .U .U .U - - - -
(0 to 48)
Specifies the target data to store the setting value.
Flag (0: Overvoltage protection enabled, 1: Overvoltage .U .U .U .U - - - -
6 R
protection disabled)
None - - - - - - - - -
Exclusive Function for the Unit for KV-SIR32XT
Description of Operation
U_DISOVP If 1 is specified for Flag when ON is ON, disables the Overvoltage protection function
of KV-SIR32XT with the unit No. specified in Unit.
Example of Format
U_DISOVP (bEnable,#1,#1);
ST Language function
Argument/ Type
Description Constant
return value .U .S .D .L .F .DF .B .T
Execution condition. Omissible. If omitted, always
EN - - - - - - .B -
(every scan) is executed.
Specify the target unit No.
Unit .U .U .U .U - - - -
(0 to 48)
Specifies the target data to store the setting value.
Flag (0: Overcurrent protection enabled, 1: Overcurrent .U .U .U .U - - - -
R
protection disabled)
None - - - - - - - - -
6
U_DISOCP If 1 is specified for Flag when Execution Condition is 1, disables the Overcurrent
protection function of KV-SIR32XT with the unit No. specified in Unit.
Example of Format
U_DISOCP (bEnable,#1,#1);
KV Script function
U_RDBF ([Executing condition]*1, Unit number, CH number, Storage device, Number of data)
6 n3 Number of Data to Read Out It designates the data point to read out (1 to 8192). .U .U .U U - - - - ○ *2 ○ ○
Exclusive Function for the Unit for KV-SIR32XT
*1 [ ] can be omitted (When the operating condition is omitted, it will always (every scan) execute).
*2 $ (hexadecimal designated) can not be used.
Description of Operation
U_RDBF When the executing condition is ON, it reads out n3 word of the buffering data of
the channel designated at n2 of the unit number designated at n1 and stores to
the device that places D at the top.
Example of Format
Script Description U_RDBF (MR0,#1,#0,EM0,#4000)
Description of Operation When MR0 is ON, it reads out 4000 words of the buffering data of KV-SIR32XT
connected to the first unit starting with EM0.
Ladder Conversion
MR000 U_RDBF KV-SIR32XT
Unit number CH Number Storage Device Number of Data
#1 #0 EM0 #4000
KV-SIR32XT
KV Script function
U_DISOVP (
[Executing Condition]*1, Unit number, Configured value)
*1 [ ] can be omitted (When the executing condition is omitted, it will always (every scan) execute).
6
*2 $ (Hexadecimal designation) can not be used.
Example of Format
Script Description U_DISOVP (MR0,#1,#1)
Description of Operation When MR0 is ON, it will disable the input overvoltage protection function of KV-
SIR32XT connected to the first unit.
Ladder Conversion
KV Script function
U_DISOCP (
[Executing Condition]*1, Unit number, Configured value)
6 *1 [ ] can be omitted (When the executing condition is omitted, it will always (every scan) execute).
*2 $ (Hexadecimal designation) can not be used.
Exclusive Function for the Unit for KV-SIR32XT
Description of Operation
Example of Format
Script Description U_DISOCP (MR0,#1,#1)
Description of Operation It disables the output overcurrent protection function of KV-SIR32XT connected to
the first unit when MR0 is ON.
Ladder Conversion
Monitor
.96,5;7
Configuration
.96,5;7
6
ධຊ ᐃᩘ
Access Window
/ڦ XV
+ڦ
.96,5;7 .96,5;7
,Q ,QSXW)LOWHU
/ڦ XV
+ڦ
The part of configured content can be modified with the access window, but please use the unit editor in
general.
When modifying configuration with the access window, execute with CPU unit in PROGRAM
Reference mode.
The actual modified configuration (modified content becomes active) is when mode of the
CPU unit is switched to RUN mode.
Menu Structure
The access window operates with configuration operation key in the CPU unit.
EXPANSION I/O UNIT FUNCTIONS
Configuration
In General When Numerical Value is Modified
Operation Key
MENU Menu Display Menu Display
It executes modification of configuration It executes modification of configuration
ENTER
when pressed for 1 second or longer. when pressed for 1 second or longer.
It switches page. It modifies select option It adds changed amount from the
when the configuration is modified. configured value.
It switches page. It modifies select option It subtracts changed amount from the
when the configuration is modified. configured value.
Menu Display
6 Not Used.
It modifies the digit of changed amount.
* The modification of configuration is possible only when CPU unit is in PROGRAM mode.
Access Window
OUT AX2
ධຊ ,1
/ڦ /ڦ
+ڦ +ڦ IN OUT
yࣔࢽࢱ y0RQLWRU
yタᐃᐃᩘ y6HW,Q)LOWHU MENU ENTER
yタᐃᐃᩘ y6HW,Q)LOWHU
yタᐃධຊࣞࣥࢪ y6HW,QSXW5DQJH
Press the "MENU" key again, or press the direct access switch that is blinking when
Point
returning to the menu screen of the CPU unit.
"5-9 Access Window"
Configuration Screen
Point The modification of configuration in only possible when the CPU unit is in PRG mode.
The part of configured content of "KV-SIR32XT" can be modified with the access window.
The procedure of modifying constant during input is as follows.
1 Select the category to configure from the menu screen with "" "" key and press the
6
"ENTER" key.
Access Window
The selected configuration screen will be displayed.
.96,5;7 .96,5;7
ᐃᩘ ,QSXW)LOWHU MENU ENTER
XV XV
.96,5;7 .96,5;7
ᐃᩘ ,QSXW)LOWHU MENU ENTER
XV XV
3 Select with "" "" key and press the "ENTER" key for 1 second or longer.
.96,5;7 .96,5;7
ᐃᩘ ,QSXW)LOWHU MENU ENTER
XV XV
The category that can modify configuration and range of configuration is as follows.
Reference
Category Range of Configuration
Constant during input 000
1µs/10µs/20µs/100µs/500µs/1ms/5ms/10ms/50ms
Constant during input 100
Input range (100 to 115) 5V, 24V
Monitor Screen
EXPANSION I/O UNIT FUNCTIONS
It describes the procedure of monitoring I/O status of "KV-SIR32XT" using the access window of CPU
unit.
Method of Monitor
1 Press the "ENTER" key by selecting the channel to configure/monitor by using the "" "" key
in the monitor screen from the menu screen.
The I/O status of selected channel will be displayed to the monitor screen.
.96,5;7 .96,5;7
6 ධຊ
/ڦ
+ڦ
,1
/ڦ
+ڦ
MENU ENTER
Access Window
Reference The input, output status can be confirmed with the LED lamp of KV-SIR32XT.
Unit Test
Point The unit test is only possible when the CPU unit is in PRG mode.
It can be confirmed even when the project that includes the configuration of unit structure that
Reference configures at KV STUDIO is not transferred to the CPU unit.
Test Method
1 After pressing the "ENTER" key with "・Test" from the menu screen, select the channel to test 6
with "" "" key and press "ENTER".
Access Window
The output test screen of the selected channel will be displayed.
.96,5;7 .96,5;7
ฟຊ 287 MENU ENTER
ڦ ڦ
ڦ ڦ
2 Select the terminal to test with "" "" "" "" key and press the "ENTER" key.
The ON/OFF status of output of the selected terminal will switch.
.96,5;7 .96,5;7
ฟຊ 287 MENU ENTER
ڦڦ ڦڦ
ڦ ڦ
Alternative procedure
• Select unit to monitor with unit configuration of workspace and double click. Otherwise, select “Unit
monitor” from right click menu.
• Select “Unit monitor” from the right click menu by selecting unit to monitor from the unit editor.
Otherwise, select [Display] [Unit Monitor] from the menu.
Scan
6
ON
ON
CR2002 DR200
SET
Always ON
RETI
ENDH
ON
Pulse Width
• The input capture function is used to measure the pulse width in units of 0.1 μs.
• The rising time/falling time during falling of input relay R000 will be read out.
• It measures the ON time of the input relay by subtracting the rise time from the fall time.
• It converts ON time to μs unit.
6 R000 UREAD. D
#1 #0 DM10 #2
time during falling of
input relay R000 will
be read out.
the Unit Editor
Leading DM No: -
Leading relay No: 000
KV-SIR32XT IN000 Rise of IN000 input time
I/O Unit Reference Program
OFF
• It measures the passing interval from when the input relay R000 is turned ON until R000 is turned ON
again.
• It reads out the rising time at the rise of R000.
• It stores the difference of this measured value and the previous measured value to data memory
[DM6/DM7] in 1μs unit.
• It stores this measured value to the previous measured value.
6
Sensor 1 ON
Sensor 2 ON Sensor 1
Input Relay R30003
OFF
Lapse Time(μs) Sensor 2
• It measures the passing time from input relay R002 to input relay R003.
• It reads out the rising time of sensor 1 and sensor 2 with the rise of R003.
• It stores the difference of rising time of sensor 1 and sensor 2 in 1μs units to the data memory [DM6/
DM7].
UREAD. D
#1 #12 DM2 #1 ;<Mnemonic List>
LDP R003
KV-SIR32XT IN003 Sensor 2
Rising input Rising time UREAD.D #1 #8 DM0 #1
UREAD.D #1 #12 DM2 #1
MPS
DM2 DM0 DM4 It subtracts rising time LDA.D DM2
LDA. D SUB. D STA. D of R002 from rising time CON
Sensor 2 Sensor 1 Passing time of R003. SUB.D DM0
Rising time Rising time CON
STA.D DM4
MPP
DM4 #10 DM6
It converts the passing LDA.D DM4
LDA. D EXT. D DIV. D STA. D CON
time of 0.1μs unit to
Passing time Passing time EXT.D
1μs unit. CON
(μs unit)
DIV.D #10
CON
STA.D DM6
MEMO
EXPANSION I/O UNIT FUNCTIONS
6
I/O Unit Error Mode
APPENDICES
The appendices include lists of the CPU unit control relays (CR) and control
memory entries (CM), an error list, and a list of the instructions used in this
manual.
FOR-NEXT Exceeds The nesting (nesting) of FOR to Errors that occur during ladder
execution will not occur during KV
11 Setting error Nesting Limit NEXT instruction has gone over the
STUDIO conversion. Modify the
limit. ladder program, paying close
FOR-NEXT 嵌套超限 attention to the proper usage of
FOR and NEXT instructions.
マクロ
ネスト制限オーバー The number of macros nested in
Reduce the number of macro
22 Setting error Macro Exceeds multiple interrupts has exceeded the
instructions in the interrupt program.
Nesting Limit limit.
宏嵌套超限
ラダースタック
エラー Turn the power off and on again.
29 System error A system error has occurred. If this error occurs frequently,
Ladder Stack Error contact your KEYENCE office.
梯形图堆栈错误
ラダースタック
オーバーフロー
Turn the power off and on again.
31 Setting error Ladder Stack A system error has occurred. If this error occurs frequently,
Overflow contact your KEYENCE office.
梯形图堆栈溢出
ラダープログラムなし
Transfer ladder programs to the
40 Setting error No Ladder Program There is no program.
main unit before starting operation.
无梯形图程序
ユニット設定 Please transfer the information of
チェックサム異常 unit configuration to the main body.
Unit Info Checksum The configuration of expansion unit Keep away from the equipment
50 Setting error
APPENDICES
Error is damaged. when it is installed in a place where
the strong electric field or strong
单元设定检验和异常 magnetic field is generated.
ユニット設定情報
未設定 The unit setting information has not Transfer the unit setting information
51 Setting error
No Unit Info Set been configured. to the main unit.
单元设定信息未设定
ユニット未接続 Expansion units that should be
Turn the power off, and then
No Unit Connected present according to the unit setting
52 Setting error connect all the expansion units that
information are not actually
have been set in the Unit Editor.
ユニット台数
不一致 The configuration of unit editor and Turn the power off, and then
54 Setting error Number of Units the number of expansion unit connect all the expansion units that
Mismatch connected actually differs. have been set in the Unit Editor.
单元台数不一致
ユニット種別
不一致 The configuration of unit editor and Turn the power off, and then
55 Setting error the type of actual expansion unit connect all the expansion units that
Unit Type Mismatch differs. have been set in the Unit Editor.
单元类型不一致
エンドユニット
未接続
57 Setting error No end unit is connected. Turn the power off and then connect
No End Unit an end unit.
结束单元未连接
ユニットバージョン The function which can not be used Turn OFF power and connect the
エラー with the version of expansion unit expansion unit configured with unit
Unit Version Error that is error connected is configured. editor.
59 Setting error
Otherwise, the CPU unit that can Otherwise, if the unit corresponds to
not be connected to the expansion system version upgrade, update the
单元版本错误 unit is connected. system version to the latest.
電池電圧の低下
Battery Voltage
83 Time error The voltage of KV-B1 is declining. Please exchange KV-B1.
Degradation
电池电压降低
APPENDICES
RTC 異常
If this error occurs frequently,
86 System error RTC Failure The clock data is abnormal.
List of PLC Unit Errors
メモリカードが
抜かれました
Memory card The memory card was removed Do not remove the memory card
88 Memory Card
operation error while it was being accessed. while it is being accessed.
Removed
存储卡被取出
ストレージ
アクセス中電源OFF
Memory card The power was cut off during Do not turn off power during storage
89 During Storage Access
operation error storage access. access.
PowerOFF
存储体访问过程中断电
ストレージアクセス
完了待ち The switch to RUN mode was
Please operate after the completion
90 Other error Waiting Storage unsuccessful due to storage access
of storage access.
Access in progress.
存储体访问完成等待
アクセスウィンドウ
異常
Clear the error and turn the power
Access Window The communication with the access off and on again.
92 System error
failure window has failed. If this error occurs frequently,
contact your KEYENCE office.
访问窗异常
APPENDICES
• Clear the PLC from KV STUDIO.
断电错误 • Use an expansion access window
cassette.
If this error occurs frequently,
contact your KEYENCE office.
不正な伝送データ
Turn the power on again.
118 System error Invalid Data A system error has occurred. If this error occurs frequently,
contact your KEYENCE office.
非法数据传输
エラーバッファ
オーバーフロー The number of errors occurring Make sure that no more than 16
125 Other error simultaneously in the system has errors occur at the same time.
ErrorBuffer Overflow gone over the limit.. Clear the errors.
错误缓存溢出
ユニットエラー
See the manuals of the units.
The error has occurred in the For details on how to check the error
129 Unit error Unit Error
expansion unit. unit, refer to " Error Clear" (page
5-127).
单元错误
メモリカード
カバーオープン
The memory card cover has been
Memory card Memory Card Cover
135 opened during memory card Close the memory card cover.
operation error Open access.
存储卡外盖打开
メモリカード
LOCKされています The memory card has been LOCK Remove the lock (write protection)
Memory card
136 (write protect) during write in or use a memory card that can be
operation error Memory Card Locked process of the memory card. written to.
存储卡被锁定
CPUメモリ
累積書込回数警告
Please decrease the write in
APPENDICES
The accumulated write in frequency
CPU Memory Write frequency to CPU memory. In
142 Other error to CPU memory is nearing its
Cycle Warning addition, please prepare the CPU
durability.
unit to exchange.
CPU存储器累积写入次
数警告
CPUメモリ
累積書込回数オーバー
CPU Memory Write The accumulated write in frequency
Read the data in the CPU unit
143 Other error to CPU memory has passed its
Cycle Over memory and replace the CPU unit.
durability.
CPU存储器 累积写入
APPENDICES
Detailed information, piece 1
The number of units as specified in the unit setup information
(CM5107)
Detailed information, piece 2
The number of units that are actually connected
(CM5108)
Detailed information, pieces 3 to 20
Fixed to 00H
(CM5109 to CM5126)
• Error number 127 (auto loading failure error)
Detailed Information, Piece n Description
Control relays (CR0000 - CR7915) can be used to perform operations such as checking the operation
status of the CPU unit and setting and monitoring the built-in functions.
Control relays reserved for the system cannot be used.
Attribute
CR R: Read only Function
Blank: Read/write
CR0000 Logging and tracing execution (ON: enabled, OFF: disabled)
CR0001 R Logging or tracing operation in progress
CR0002 R Logging or tracing file writing completion
CR0003 R Logging buffer less than 50% warning
APPENDICES
Attribute
CR R: Read only Function
Blank: Read/write
Zero suppression during execution of DASC and FASC instructions (all suffixes; ON:
CR2814
execute, OFF: do not execute)
Omission of "+" during execution of DASC.S, DASC.L, and FASC instructions (ON:
CR2815
execute, OFF: do not execute)
CR2900 to
- Reserved for the system
CR3005
CR3100 R Inter-unit synchronization refreshing time exceeded
CR3101 to
- Reserved for the system
CR3115
CR3200 CPU memory save save request
CR3201 R CPU memory save being performed
CR3202 R CPU memory save complete
APPENDICES
CR3203 R CPU memory save error
CR3204 to
- Reserved for the system
CR3206
Instruction RAM mode operation
CR3207 The RAM mode activation of file register instructions, storage device instructions towards
the CPU memory. (ON: enable, OFF: disable)
CR3208 to
- Reserved for the system
CR3209
CR3210 R Arbitrary logging/trace operation
CR3211 to
Attribute
CR R: Read only Function
Blank: Read/write
CR4403 R AW right key being pressed
CR4404 R AW MENU key being pressed
CR4405 R AW ENT key being pressed
CR4406 to
- Reserved for the system
CR4414
CR4415 R AW user message being displayed
CR4500 AW line 1 blinking
CR4501 AW line 2 blinking
CR4502 AW line 3 blinking
CR4503 AW line 4 blinking
CR4504 to
- Reserved for the system
APPENDICES
CR4600
CR4601 to
AW user message 1 to 63
CR4915
CR5000 to
- Reserved for the system
CR5315
CR5400 Memory card mount request
CR5401 Memory card unmount request
CR5402 R Memory card used
CR5403 R Memory card recognized
Lists of CR and CM Devices
Attribute
CR R: Read only Function
Blank: Read/write
CR5600 Operation record 0 Save request
CR5601 R Operation record 0 Operating
CR5602 R Operation record 0 Save trigger monitor
CR5603 R Operation record 0 Saving
CR5604 R Operation record 0 Collecting
CR5605 R Operation record 0 Setting error
CR5606 - operation recorder function System reservation
DR5607 R (ID0) Operation record 0 Save completed
CR5608 R Operation record 0 Save error
CR5609 R Device record 0 Buffer shortage
CR5610 to
APPENDICES
- System reservation
CR5613
CR5614 Operation record 0 Buffer area full save mode
CR5615 - System reservation
CR5700 to
operation recorder function(ID1 to ID3)
CR5919
CR6000 to
Reserved for the system
CR7915
Control memory entries (CM0000 - CM7599) can be used to perform operations such as checking the
operation status of the CPU unit and setting and monitoring the built-in functions.
Control memory entries reserved for the system cannot be used.
Attribute
R: Read only Hold
CM Function
Blank: Read/ Yes: Hold
write
CM0000 and
- Reserved for the system
CM0699
CM0700 R Read from RTC (year)
CM0701 R Read from RTC (month)
APPENDICES
Attribute
R: Read only Hold
CM Function
Blank: Read/ Yes: Hold
write
CM1510 to
- Reserved for the system
CM1629
CM1630 to
R Log/trace Ring Buffer minimum free space (ID0 to ID9) (KB)
CM1639
CM1640 to
- Reserved for the system
CM1649
CM1650 R Number of sensor setting instruction executions
CM1651 to
- Reserved for the system
CM1657
CM1658 R Number of consecutive project password authentication failures Yes
CM1659 R Total number of project password authentication failures Yes
CM1660 to
R Logging, trace ring buffer free capacity (ID0 - ID9) (in KB units)
APPENDICES
CM1669
CM1670 to
- Reserved for the system
CM1679
CM1680 to
R Log/trace File Save Counter (ID0 to ID9) (Memory card use) Yes
CM1689
CM1690 to
- Reserved for the system
CM1699
CM1700 and
Digital trimmer 0 upper limit (32-bit)
CM1701
CM1702 and
Digital trimmer 1 upper limit (32-bit)
CM1703
Attribute
R: Read only Hold
CM Function
Blank: Read/ Yes: Hold
write
CM1795 R Run load complete code
CM1796 R Run load folder number (complete)
CM1797 to
- Reserved for the system
CM1868
CM1869 R Number of connected expansion units
CM1870 Recipe load Drive number Yes
CM1871 Recipe load Folder number Yes
CM1872 - Reserved for the system
CM1873 R Recipe load Completion code Yes
CM1874 - Reserved for the system
CM1875 Recipe save Drive number Yes
APPENDICES
CM1875 to
- Reserved for the system
CM1877
CM1888 Project save drive number (request) Yes
CM1889 Project save folder number (request) Yes
CM1890 R Project save drive number (complete) Yes
CM1891 R Project save folder number (complete) Yes
CM1892 R Project save completion code Yes
CM1893 to
- Reserved for the system
CM1999
CM2000 to
R Device record 0 Average sampling period
CM2001
CM2002 to Device record 0 Average number of changed
R
CM2003 operation recorder function devices
CM2004 to (ID0)
R Device record 0 Maximum collection period
CM2005
CM2006 to
- Reserved for the system
CM2009
CM2010 to
operation recorder function (ID1 to ID3)
CM2039
CM2040 to
- Reserved for the system
CM2389
CM2390 R Error code for storage device instruction
Power OFF during storage access
CM2391 (Becomes value other than 0 during occurrence. Please change it to 0 from the
program.)
CM2392 Memory card retry occurrence times (still hold in case of power off)
CM2393 Memory card check error times (still hold in case of power off)
CM2394 Memory card timeout occurrence times (still hold in case of power off)
CM2395 Reset delay time when error occurs on the memory card
CM2396 to
- Reserved for the system
CM2399
CM2400 to
R Inter-unit synchronization refreshing beginning time (0.1μs)
CM2401
CM2402 to
R Inter-unit synchronization refreshing finishing time (0.1μs)
CM2403
CM2404 to Inter-unit synchronization refreshing beginning time maximum (0.1μs)
Yes
CM2405 (To reset, please change it to 0 from this program.)
CM2406 to Inter-unit synchronization refreshing finishing time maximum (0.1μs)
Yes
CM2407 (To reset, please change it to 0 from this program.)
CM2408 to
R Inter-unit synchronization refreshing operation time (0.1μs)
CM2409
Attribute
R: Read only Hold
CM Function
Blank: Read/ Yes: Hold
write
CM2410 to
- Reserved for the system
CM5099
Year and month (Indicated as decimal values. The last
CM5100 R two digits show Month, and previous digits from Yes
hundred show Year. Example: 1210 → October 2012)
CM5101 R Day Yes
CM5102 R Hour Yes
CM5103 R Minute Yes
CM5104 R Details of the latest serious Second Yes
error
CM5105 R Error number Yes
CM5106 R Number of valid pieces of data Yes
CM5107 R Detailed information, piece 01 Yes
APPENDICES
CM5108 R Detailed information, piece 02 Yes
: R Yes
CM5126 R Detailed information, piece 20 Yes
CM5127 to
- Reserved for the system
CM5149
Year and month (Indicated as decimal values. The last
CM5150 R two digits show Month, and previous digits from Yes
hundred show Year. Example: 1210 → October 2012)
CM5151 R Day Yes
CM5152 R Hour Yes
0 1 2 3 4 5 6 7 8 9 A B C D E F
N D S
0 U
L
L
E P 0 @ P ` p ー タ ミ
S D
1 O
H
C
1 ! 1 A Q a q 。 ア チ ム
S D
2 T
X
C
2 ” 2 B R b r 「 イ ツ メ
APPENDICES
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
Q
A
K % 5 E U e u ・ オ ナ ユ
Lower four bits
A S
6 C Y & 6 F V f v ヲ カ ニ ヨ
KN
B E
7 B ’ 7 G W g w ァ キ ヌ ラ
E T
ASCII Code Table
L
B CA
8 S N( 8 H X h x ィ ク ネ リ
9 HT EM ) 9 I Y i y ゥ ケ ノ ル
A LF UB * : J
S
Z j z ェ コ ハ レ
B VT SC + ; K [
E
k { ォ サ ヒ ロ
C FF → , < L \ l | ャ シ フ ワ
D CR ← ー = M ] m } ュ ス ヘ ン
E SO ↑ . > N ^ n ~ ョ セ ホ ゛
D
F SI ↓ / ? O _ o E
L ッ ソ マ °
Execution
Condition
Classification Mnemonic Symbol Processing Outline Description
Page
Logging instructions
n Enables the execution of logging for the
LOGE 5-75
LOGE specified logging ID
Logging
APPENDICES
n
TRGD Captures the logging data of the specified ID 5-77
TRGD
operation recorder instructions
Operation
recorder
List of Instructions
MCMP S1 S2 D
Performs multi-stage comparator operations 5-179
Cam switch
ABSENC
Performs cam operations using an absolute
ABSENC S1 S2 D1 5-183
D2
encoder
D
DIC Sets the interrupt disabled range 4-220
Interrupts
DIC
INT Executes the interrupt program from this
INT - 4-222
instruction to the RETI instruction
RETI
RETI Indicates the end of the interrupt program - 4-222
Module instructions
MDSTRT
MDSTRT Starts the execution of the specified module
Modules
S
4-115
MDSTOP
MDSTOP S Stops the execution of the specified module
Execution
Condition
Description
Classification Mnemonic Symbol Processing Outline Page
S2
S1
FBSTRT EN ENO Executes the specified function block. 4-151
Function blocks
S
APPENDICES
FEND
FEND Stops execution of the function block. 4-148
S
FUN Varies depending on the
Executes the specified function. 4-148
function block to be executed
Macro instructions
List of Instructions
MCALL
MCALL Varies depending on the macro to be executed Executes the specified subroutine macro
Macros
MSTRT
MSTRT Varies depending on the macro to be executed Executes the specified self-hold macro 4-98
MEND
MEND Stops execution of the self-hold macro
APPENDICES
ONDL and OFDL On delay and off delay
Base instructions
Stage processing
instructions
W-UE and W-DE Wait rising edge and wait falling edge
File register instructions FRSTM/FRLDM File register saves in batches/file register reads in batches
RAMP, TPOUT, and Ramp signal, time division proportion output, and advancement
instructions
Calculation
MFREE/MMKDIR/
storage directory/writing in storage character string/storage 1
MPRINT/MREADL/
MCOPY/MMOV/ line read out/storage file copy/storage file migration/storage file
Storage instruction name modification/acquiring free space of storage/acquiring
MREN/MFREEK/
storage file status
MSTAT
MRMDIR/MDEL storage folder deletion/ storage file deletion
Write sensor parameters/read sensor parametrs/execute sensor
Sensor setting instruction SPWR/SPRD/SSVC
service
Access window instructions AWSHOW/AWHIDE Display user message/cancel user message
Function blocks
Instruction Type Instruction
Application instructions Macro instructions MCALL and MSTRT Macro call and macro start
* The FEND (function block end) instruction is written in the function block. It cannot be used in other types of
programs such as functions or modules.
Functions
Instruction Type Instruction
Macro instructions MCALL and MSTRT Macro call and macro start
Application instructions Function block
FBCALL/FBSTRT/FB Function block
instructions
Macros
Instruction Type Instruction
Macro instructions MCALL and MSTRT Macro call and macro start
Application instructions Function block FBCALL/FBSTRT/FB/ Function block / function
instructions FUN
* Write the MEND (macro end) instruction in self-hold macros. It cannot be used in other types of programs
such as sub-routine type macros or modules.
Subroutine programs
Instruction Type Instruction
Stage processing
Application instructions STG, JMP, and ENDS Stage, jump, and end stage
instructions
High-speed processing
Expansion instructions INT and RETI Interrupt and interrupt return
instructions
APPENDICES
List of Unusable Instructions
Instructions
Instruction Abbreviation
LD and AND A and X
LDB and ANB B, LDI, LDNOT, ANI, ANDNOT, and /*3
Contact instructions ORB ORI and ORNOT
LDP and ANP P
LDF and ANF F
BLD and BAND BA
APPENDICES
Bit contact instructions
BLDB and BANB BB
LD= and AND= =
LD< and AND< <
LD> and AND> >
Comparison instructions
LD<= and AND<= <=
LD>= and AND>= >=
LD<> and AND<> <>
Instruction Abbreviation
Logic calculation EORA XOR and XORA
instructions ENRA XNORA
Data control instructions APR SCL
DFLOAT FLTD, DFLTD, DBL, and DBLL
DINTG INTD, DINTD, FIXD, and FIXLD
Floating-point instructions
FTODF ECON
DFTOF EDCON
DASC DSTR
RDASC DVAL
Text processing HASC HSTR
APPENDICES
*1 You can enter timer and counter instructions without a space between the instruction and the
device number.
(Example) TMR 0002 DM00001 T2 D1
*2 If you enter "-" directly in the ladder editing window, a horizontal connecting line will be inserted.
If you enter "-" in the direct entry dialog box ( Esc ), "CAL-instruction" will be inserted.
*3 If you enter "/" directly in the ladder editing window, the "LDB" instruction will be inserted.
If you enter "/" in the direct entry dialog box ( Esc ), "CAL/instruction" will be inserted.
Device names
APPENDICES
rung
Paste Ctrl + V Delete configured units Delete
Delete Delete Shift +
Multi select
Unit comments Ctrl + Shift + U ← •→ •↑ •↓
Block comment Ctrl + Shift + B
Operations in unit selection window
System comments Ctrl + Shift + S
Unit preset Move cursor ← •→ •↑ •↓
Ctrl + R
View
Display unit setting
Built-in Function Monitor Ctrl + Alt + U
Custom Monitor Ctrl + Alt + M
Buffer memory monitor Ctrl + Alt + R
Window
Unit configuration area Alt + U
Select unit Alt + 1
Setup unit Alt + 2
Refresh setting Alt + 3
Message area Alt + 4
Help
How to use Unit Editor F1
- KV-8000 Series User’s Manual - A-25
7 List of Shortcut Keys
Shortcut keys that are valid on the Unit Editor slave setup screen
File Help
Import slave information Ctrl + K How to use Unit Editor F1
Close Alt + F4
Operations in slave configuration
Edit area
Cut Ctrl + X Move cursor ↑ ·↓
Copy Ctrl + C Display the Setup unit
Paste Ctrl + V window of the selected
unit
Delete Delete
Delete configured units
APPENDICES
Delete
Input unit/slave
Ctrl + Shift + U Operations in unit selection window
comment
Reserve unit slave Ctrl + R Move cursor ← ·→ ·↑ ·↓
Enter Tab
Check addresses F6
Enter and confirm
View Cancel Esc
Unit or slave settings
Operations in address setup window
Window
Move cursor ↑ ·↓
Slave configuration area Alt + C
Unit selection window Alt + 1
Unit setup window Alt + 2
Address setup window Alt + 3
Message area Alt + 4
Items that are indicated with a "" can be assigned to other shortcut key sequences.
File Monitor/Simulator
New project Ctrl + N PLC monitor Ctrl + F1
Open project Ctrl + O Read from PLC Ctrl + F5
View
APPENDICES
Workspace Alt + 1
Enter NO contact OR F4
Comment editing window Ctrl + F7
Enter NC contact OR Shift + F4
Device use list Ctrl + E
Enter NO contact coil F7
Enter NC contact coil
Zoom in Ctrl + PageUp
Shift + F7
SET
Ctrl +
Alt + F1 Zoom out
PageDown
RES Alt + F2
Ctrl +
TMR Alt + F3 Display variable
Backspace
TMS Alt + F5
Display cmnts Ctrl + (Space)
C Alt + 0
Display unit device Shift + (Space)
DIFU Alt + F8
Switch between editing
DIFD windows Alt + F6
Alt + F9
MOV Alt + F10 * This is only valid when an instruction is input in the
selected cell.
LDA Alt + F11
STA Alt + F12
ST/Script
Insert area script Ctrl + R
LDP Alt + F7
Insert box script Ctrl + B
Alt + Shift +
LDF
Insert area ST Ctrl + Shift + A
F7
Insert box ST Ctrl + Shift + B
Alt + Shift +
ORP
F8 Convert selected ST/Script Ctrl + T
Alt + Shift + Display/hide converted ladder Ctrl + G
ORF
F9 ST/Script function list Ctrl + (Space)
Alt + Shift + Ctrl + Shift +
MEP ST/Script function tip
F5 (Space)
Alt + Ctrl +
MEF Convert
F5
Convert Ctrl + F9
Alt + Ctrl +
INV
F10 *1 This is only valid when the cursor is in the far-left position
(the first column).
*2 This is only valid when the cursor is in the far-right position
(the tenth column).
A-28 - KV-8000 Series User’s Manual -
7 List of Shortcut Keys
Monitor/Simulator Tool
Ctrl + Shift + Unit Editor Ctrl + U
Monitor mode
F3
Help
PLC transfer monitor
mode Ctrl + F8 Instruction help F1
PLC read monitor mode Ctrl + F1 Instruction Reference
Manual Ctrl + 1
PLC read Ctrl + F5
Start Online Edit F10
Simulator Ctrl + F2
APPENDICES
Edit View
Search Ctrl + F or Workspace Alt + 1
Rung or rung Output window Alt + 2
step number Ctrl + Shift + G
Top
Zoom in Ctrl + PageUp
Ctrl + Home
Bottom
Zoom out Ctrl + PageDown
Ctrl + End
Previous block
Display variable Ctrl + Backspace
Ctrl + ↑
Edit View
Search Ctrl + F ( ) Workspace Alt + 1
Rung selection Ctrl + → Output window Alt + 2
Top Ctrl + Home Zoom in on ladder display Ctrl + PageUp
Bottom Ctrl + End Zoom out from ladder
display Ctrl + PageDown
Previous block Ctrl + ↑ Display variable Ctrl + Backspace
Next block Ctrl + ↓ Display cmnts Ctrl + (Space)
Previous symbol Shift + Tab
Display unit device Shift + (Space)
APPENDICES
APPENDICES
F8 Alt + Ctrl + F5
connection
line INV Alt + Ctrl + F10
Enter horiz. F9 ( − ) Switch between NO contact /
connection and NC contact, change
Edit line suffix, enter NC contact
connection
line Horizontal Alt + Switch between rising edge Ctrl + /
connection line and falling edge
to end of rung ( Ctrl + Tab )
Switch between direct input F2
Delete vert. Shift + F8 and current value
connection
line Register set Ctrl + Shift + J
Monitor/Simulator Help
Return to Editor Ctrl + F1 Instruction help F1
Ctrl + Shift + Instruction Reference
Monitor mode
Manual Ctrl + 1
F3
Online edit transfer F11
Simulator Ctrl + F2
Display/hide watch window Alt + 3
End End
Ctrl + Alt + ←
Help
Prev. changed block
Ctrl + Alt + → Instruction help F1
Next changed block
Instruction Reference
Contact/Coil F12 Manual Ctrl + 1
View
Workspace Alt + 1
Output window Alt + 2
Zoom in Ctrl + PageUp
Zoom out Ctrl + PageDown
APPENDICES
Enter coil F2
F7
Enter NC contact Ctrl + Shift + Alt +
Not assigned Next pane
coil F11
Enter vert. GPPQ format Shift + F9 Ctrl + Shift + Alt +
connection line Previous pane
GPPA format F10 F12
Delete vert.
Ctrl + F10 Monitor mode F3
connection line
Enter horiz. Display cmnts Ctrl + F5
F9
APPENDICES
F3
Next
RES Alt + F2
PLC transfer
TMR Alt + F3 Ctrl + F8
monitor mode
TMS Alt + F5 PLC read Ctrl + F5
C Alt + 4 Start Online Edit F10
LDP Alt + F7 Return to Editor Ctrl + F1
LDF Alt + Shift + F7 Instruction/Macro/
Pack Pallet Alt + Ins
Convert selected
ST/Script Ctrl + Shift + T
Display/hide
converted Ctrl + Shift + G
ladder
Execute
Shift + F8
continuous steps
Execute 1 step F8
Execute reverse
continuous Shift + F7
steps
Execute reverse
F7
1 step
APPENDICES
Pause Shift + F6
List of Shortcut Keys
Ctrl + / (slash)
APPENDICES
/ (slash) / (slash) / (slash)
Ctrl + / (slash)
/ (slash)
• Suffix
/ (slash)
/ (slash) / (slash)
APPENDICES
/ (slash)
List of Shortcut Keys
/ (slash)
/ (slash)
If you press this key when a cell with no instruction is selected, an NC contact
will be entered.
/ (slash)
*
This can only be entered in the direct entry dialog box.
APPENDICES
first character
Character and character strings that cannot
be used as the last character or characters
Character string that cannot be usedGlobal グローバル Global 全局
*1 Can be used on KV-8000 series with CPU function version 2.1 or later.
ARRAY, OF,
AT,
CASE, END_CASE,
CONFIGURATION, END_CONFIGURATION,
CONSTANT,
EN, ENO,
Character strings that cannot be used
EXIT,
• F_EDGE,
FOR, TO, BY, DO, END_FOR,
FUNCTION, END_FUNCTION,
FUNCTION_BLOCK, END_FUNCTION_BLOCK,
IF, THEN, ELSIF, ELSE, END_IF,
INITIAL_STEP, END_STEP,
NOT, MOD, AND, XOR, OR,
PROGRAM, WITH, END_PROGRAM, R_EDGE,
READ_ONLY, READ_WRITE,
REPEAT, UNTIL, END_REPEAT,
RESOURCE, END_RESOURCE,
RETAIN, NON_RETAIN,
RETURN,
STEP,
STRUCT, END_STRUCT,
TASK,
TRANSITION, FROM, END_TRANSITION,
TYPE, END_TYPE,
VAR,VAR_INPUT, VAR_OUTPUT, VAR_IN_OUT,
VAR_TEMP, VAR_EXTERNAL, VAR_ACCESS,
VAR_CONFIG,VAR_GLOBAL,
END_VAR,
WHILE, DO, END_WHILE
• Other character strings (see the IEC61131-3 specifications)
• A variable name cannot have two or more consecutive
underscore characters.
The string "a_b_c" is acceptable, but "a__bc" cannot be used.
APPENDICES
• K
• K + value
• K + value + suffix(U/S/D/L/F/DF)
• K + value + E
• K + value + E + value
Strings that cannot be used • K + value + E + value + suffix(F/DF)
• H + hexadecimal value (decimal value or ABCDEF string)
• The following key words, which are prescribed in KV script
*1 Can be used on KV-8000 series with CPU function version 2.1 or later.
*2 The _ (number) at the end can be used on KV-8000 series with CPU function version 2.1 or later.
Compatibility
Category Device Yes: Compatible
-: Not compatible
-
(Can be used to
AC power unit KV-U7
supply power to the
KV-EB1)
KV-B16XA/KV-B16XC/ KV-C32XA/KV-C32XC/
Input unit Yes
KV-C64XA/KV-C64XB/ KV-C64XC
APPENDICES
KV-B8RC/KV-B16RA/KV-B16RC/
KV-B16TA/KV-B16TC/KV-B16TD/
KV-B16TAP/KV-B16TCP/
Output unit KV-C32TA/KV-C32TC/KV-C32TD/ Yes
KV-C32TAP/KV-C32TCP/
KV-C64TA/KV-C64TC/KV-C64TD/
KV-C64TAP/KV-C64TCP
I/O unit KV-B8XTD/KV-C16XTD/KV-C32XTD Yes
Precautions for Using the Existing KV Series Extension Unit
KV-AD40/KV-AD40V/KV-AD40G/
Analog unit KV-DA40/KV-DA40/ Yes
KV-AM40V
Temperature unit KV-TF40/KV-TP40 Yes
Positioning unit KV-H20/KV-H20S/KV-H40S/KV-H20G Yes
Positioning unit, motion
KV-ML16V/KV-MC20V/KV-MC40V/KV-MX1 Yes
control unit
Communication type
KV-LH20V Yes
positioning unit
High-speed counter unit KV-SC20/KV-SC20V Yes
KV-XLE02 Yes
KV-XCM02 Yes
KV-XL202/XL402 Yes
KV-L20/KV-L20R -
KV-L20V/KV-L21V Yes
KV-EP21V Yes
Communication unit KV-LE20/KV-LE20A -
KV-LE20V/KV-LE21V Yes
KV-FL20 -
KV-FL20V Yes
KV-LM20 -
KV-LM20V/KV-LM21V Yes
KL-N20V/MV-L40/KV-CL20/KV-DN20 Yes
System distribution unit KV-EB1 Yes
Error output unit KV-DR1 -
Bluetooth unit KV-BT1 -
Usage Restrictions
The following restrictions apply when existing KV series expansion units are used with the KV-8000
Series.
KV-XLE02
• Only units of the function version 1.2 or later can be connected.
• For KV-8000A, the Mail send/receive function cannot be used.
KV-XCM02
• For KV-8000A, the mail sending and receiving functions are not available.
APPENDICES
KV-XL202/XL402
• Only units of the function version 1.1 or later can be connected.
KV-XH16ML/XH04ML/XH64EC/XH32EC/XH16EC
• For KV-8000A, the Sync contact output cannot be used.
KV-L21V/KV-L20V
KV-LE21V/KV-LE20V
• VM65536 or later cannot be accessed via KV-LE21V/KV-LE20V.
• When using the host link mode, the range of R that can be read/written via KV-LE21V/KV-LE20V is
R00000 to R99915, and the range of MR is MR00000 to MR99915. (In XYM mode, M00000 to
M64000 can be used), and the range of VM is VM00000 to VM63999.
• When MC protocol mode is used, the expansion unit buffer memory range that can be read and
written to via KV-LE21V and KV-LE20V is 0 to 32767.
• When using the FTP server function, device files of R100000 or higher will not be displayed.
• When FTP server functions are used, MR indicated with 6 digits or more (for example, MR100000 or
higher devices) the last digit cannot be indicated.
• The read/write to CPU memory is not possible when FTP server function is used.
• The read/write to CPU memory is not possible when FTP client function is used.
• For KV-8000A, the Mail send/receive function cannot be used.
KV-EP21V
• VM65536 or later cannot be accessed via KV-EP21V.
• When using the host link mode, the range of R that can be read/written via KV-LE21V/KV-LE20V is
R00000 to R99915, and the range of MR is MR00000 to MR99915.(M00000 to M64000 can be used
when XYM mode is used), and the range of VM is VM00000 to VM63999.
• When the MC protocol mode is used, the expansion unit buffer memory which can read/write via KV-
LE21V/KV-LE20V is from 0 to 32767.
• When using the FTP server function, device files of R100000 or higher will not be displayed.
• When FTP server function is used, the last digit of MR(for example, the device MR100000 or
higher)with 6 or more digits can not be displayed.
• When FTP server function is used, the read/write to CPU memory is not possible.
• When the FTP client function is used, read/write to CPU memory is not possible.
APPENDICES
• When a message communication function is used, the expansion unit buffer memory that can be
read and written to via KV-EP21 is 0 to 32767.
• For KV-8000A, the Mail send/receive function cannot be used.
KV-LM21V/KV-LM20V
• When megalink mode is used, the expansion unit buffer memory that can be read and written to via
KV-LM21V and KV-LM20V is 0 to 32767, and VM is 0 to 63999.
Precautions for Using the Existing KV Series Extension Unit
• When serial PLC link mode is used, the link bit devices and link registers that can be read and written
to via KV-LM21V and KV-LM20V is B0000 to B1FFF and W0000 to W3FFF, respectively.
KV-FL20V
• The link bit device B0000 to B3FFF, link register W0000 to W3FFF, R1000 to R99915 can be read/
written with KV-FL20V.
KV-CL20
• When the transient transfer function is used, write operations to T, C and CR are not available.
KL-N20V
• When starting up in the communication status confirmation mode, keep pressing the direct access
switch until the direct access switch turns green. If the direct access switch is released early, it can
not be started normally and CPU error E 63 [Need to turn on power again] may occur.
The list below describes precautions when changing from a KV-7000 Series and KV-5000/3000 Series
model to a KV-8000 Series model.
Item Description
APPENDICES
Cannot be replaced.
Functions that cannot be used by the model are deleted or initialized when you
change models.
Hardware functions After changing models, check the specifications and use the model within the
specified range.
"Differences Related to Functions Such as CPU Special Hardware
Functions" (page A-46)
Devices other than control relays and control memory entries (CR/CM) cannot
1 In KV STUDIO, on the "File" menu, click "Change model" to execute the model change.
Reference The results of changing the model are saved as the "conversion result text." View the
"conversion result text" to check whether problems such as labels being changed to
unregistered variable have occurred.
Communicati
on port FL-net - - - Yes (KV-5000) -
Ethernet*6 EtherNet/IP Yes Yes - Yes (KV-5500) -
Yes (Ver. 1.1
Socket Yes Yes (KV-5000)
or later) - -
communication (Up to 16) (Up to 8)
(Up to 16)
*1
CPU memory capacity 64 MB total 64 MB total 21 MB total -
Program
1500 k steps 1500 k steps 160 k steps 260 k steps 160 k steps
capacity*1
Device comment
Breakdown 224,000 224,000 102,000 96,000 30,000
capacity*3
Precautions When Changing From One KV-8000 Series Model to Another
User memory
40 MB 40 MB 10 MB -
capacity*1
Memory
Number of
8 8 1*2
Device comments
comment Universal
Yes Yes -
comments
Base Logging Yes Yes -
specifications Without
memory File register Yes Yes -
card Load/Save Yes Yes -
Local work 589824 51000 51000
Maximum number of I/O points 3072 3072 3096
16 units maximum
KV-8000 Series Expansion
(including KV-7000 Series - -
Unit
expansion units)
Number of KV-7000 Series Expansion 16 units maximum
connectable Unit (including KV-8000 Series 16 units maximum -
units (S-Unit, X-Unit) expansion units)
48 units maximum 48 units maximum
KV-5000/3000 Series
(including KV-8000/7000 (including KV-7000 Series 48 units maximum
Expansion Unit
Series expansion units) expansion units)
Instruction
Base instruction execution
execution 0.96 ns 0.96 ns 10.0 ns
speed
speed
Backup using nonvolatile Backup using nonvolatile SRAM backup using the
Device
RAM RAM battery
Variable / Label Yes - -
Backup with condenser
Power Failure for backup(approx. 15 Backup with condenser for
Holding Calender timer (RTC) days) backup(approx. 15 days) Battery backup
When using a battery When using a battery
(approx. 5 years (@ (approx. 5 years (@ 25°C))
25°C))
Flash ROM (can be Flash ROM (can be Flash ROM (can be
Program
rewritten 10,000 times) rewritten 10,000 times) rewritten 100,000 times)
Inputs - - 16 (line driver supported)
Outputs - - 8
I/O
Connector - - MIL connector
Extra power supply output - - +5 V
Fullwidth/halfwidth Fullwidth/halfwidth Fullwidth/halfwidth Halfwidth
Vertical: 4 characters, Vertical: 4 characters, Vertical: 4 characters,
Size horizontal: 16 halfwidth horizontal: 16 halfwidth horizontal: 12 halfwidth
Access characters characters characters
Access window
window
Japanese, English, Katakana or alphabetic
Language Japanese, English, Chinese
Chinese characters
User message Yes Yes -
APPENDICES
Specified frequency pulse output - - Yes
Cam switch function - - Yes
Recording / Buffer capacity 10240KB 2048KB 10240KB
tracking
function Maximum number of devices 512 128 128
*1 The volume of the project area (programs, device comments, etc), and CPU memory area can be set by the user. The
breakdown is for the default settings.
*2 Up to two can be set on KV STUDIO, but only one can be saved on the PLC.
*3 Estimate when the whole project area is used for device comments.
*4 Unit interrupt for the KV-7000 Series, and internal input interrupt for the KV-5000/3000 Series.
*5 24 ±10% V DC when using KV-5000/3000 Series expansion units.
*6 Refer to "EtherNet/IP Function User's Manual" for details.
*7 The Mail communication function cannot be used on KV-8000A.
KV-7500/7300 KV-5500/5000/3000
Item KV-8000(A)
(Ver.2.3 or later) (Ver.2.2 or earlier)
CPU input relays - R000 to R015
CPU output relays - R500 to R507
R00000 to R199915 R00000 to R199915 R00000 to R99915 R01000 to R99915
Internal auxiliary relays
MR000000 to MR399915 MR00000 to MR99915
Latch relays LR00000 to LR99915
Control relays CR0000 to CR7915 CR0000 to CR3915
Timers T0000 to T3999
Counters C0000 to C3999
APPENDICES
The different instructions when changing the model from the KV-5000/3000 series to the KV-8000
series are as follows.
* The instructions are the same when changing the model from the KV-7000 series to the KV-8000
series.
APPENDICES
AWNUM Change to unregistered variable Occurrence of Error -
Access Window Instruction
AWMSG Change to unregistered variable Occurrence of Error -
PLSX Change to unregistered variable Occurrence of Error -
PLSY Change to unregistered variable Occurrence of Error -
JOGX Change to unregistered variable Occurrence of Error -
JOGY Change to unregistered variable Occurrence of Error -
ORGX Change to unregistered variable Occurrence of Error -
ORGY Change to unregistered variable Occurrence of Error -
Positioning Instruction
HOMEX Change to unregistered variable Occurrence of Error -
* When converting to KV-8000A, the unit-specific instructions related to the Mail send/receive
function will be changed to unregistered variables.
For details on the difference between CR (control relays) and CM (control memory entries), in KV
STUDIO, on the "Help" menu click "Handy-Nav(reference programs/tech materials)," and then see
"CR_CM_ConvertTableInChangeModel.xls."
Constant 〇 〇
Hold 〇(Up to 30000 definitions)*3 ―
BOOL(bit) 〇 〇
INT(1-word signed integer) 〇 〇
UINT(1-word unsigned integer) 〇 〇
DINT(2-word signed integer) 〇 〇
UDINT(2-word unsigned
〇 〇
Precautions When Changing From One KV-8000 Series Model to Another
integer)
REAL(Single-precision floating
point) 〇 〇
Data type
LREAL(Double-precision
floating point) 〇 〇
STRING(String) 〇 〇
TIMER(Timer) 〇 〇
COUNTER(Counter) 〇 〇
Array 〇 〇
Structure 〇 ―
Function block 〇 ―
Comment8 types 8 type 1 type
Others
Linked with VT STUDIO*4 〇 ―
*1 Number of definitions is the number of names registered as variables or labels. For example, if an array type
variable or label with 10000 elements is registered, the number of definitions will be counted as 1.
*2 Depending on the number of characters in the variable name, 100000 may not be set.
*3 Depending on the number of characters in the variable name, 30000 may not be set.
*4 When using variables in VT STUDIO, VT STUDIO should be upgraded to 8.0 or later, and the VT model should
be set to VT5 series or Soft-VT.
MEMO
APPENDICES
Precautions When Changing From One KV-8000 Series Model to Another
terminal block wiring ....................................3-10 module execution starts, "@CR2008" ........ 4-113
AC Power Unit BSIZE instruction .............................................4-70
How to Wire .................................................2-12 Built-In Functions ...............................................5-2
Specification .................................................2-12 Bus Connection Unit
Access Window .................................... 5-111, 6-37 Names and Functions of Parts .....................2-40
Names and Functions of Parts ................... 5-114
Operations that Can be Implemented
Through Access Window ........................ 5-111 C
Access window
Function list ................................................ 5-112 C ............................................................ 4-35, 4-42
Access Window Initial Menu Display Callable position ............................................4-196
Function ..................................................... 5-157 Cam Switch Function Overview .....................5-178
Access Window Settings Used by Cam Switch Instructions ................................5-178
KV STUDIO ................................................5-156 Candidate instruction .....................................4-239
Access Window Setup ...................................5-151 Changes to values when the value is greater
ACNT instruction ............................................. 4-66 than the maximum value or smaller than the
Alarm .............................................................5-136 minimum value .............................................4-80
All Clear ......................................................... 5-154 Changing the current value and status of
Applications ................................................... 4-198 devices .......................................................4-273
Argument Abbreviation Settings .................... 4-138 Character Codes ..............................................4-81
Argument Privacy Settings ............................4-139 Characters that cannot be used in labels ....... A-39
Argument types ............................................. 4-132 Characters that cannot be used in program
Array ................................................................4-57 names ......................................................... A-39
ASCII code ...................................................... 4-81 Characters that cannot be used in project
Auto Load Function ......................................... 5-45 names ......................................................... A-39
CLEAR ...........................................................5-153
Clock Function
B Reading clock data .....................................5-187
Writing clock data (Setting the time and
Bank Switchover ............................................ 4-226 date) .......................................................5-187
Battery ............................................................. 3-18 Condition control ................................................4-4
Binary BIN ....................................................... 4-76 Configuration by processes ........................... 4-111
Binary Coded Decimal BCD ............................ 4-77 Configuration Screen .......................................6-39
Binary Data ...................................................... 4-75 Connecting line editing ..................................4-242
Bistable function block (Set priority) .............. 4-155 Connecting to Communication Devices .............1-5
Bit device ON/OFF ........................................ 4-273 When communicating with a PC ....................1-5
A-52 - KV-8000 Series User’s Manual -
11 Index
When communicating with a touch panel ...... 1-5 DIC instruction ...............................................4-220
Connecting Units ............................................... 3-2 Differences between Macros and
Connector Assembly and Wiring ..................... 3-12 Subroutines ................................................4-195
Connector wiring .............................................. 3-14 Digital Trimmer ...............................................5-128
Constants ...............................................4-23, 4-73 Functions of setup key ...............................5-128
Constructing Units ............................................. 3-3 How to operate ...........................................5-128
Contact protection ............................................. 3-9 Dimensions ......................................................2-17
Control memory ........................................2-3, 4-43 Expansion I/O unit (KV-SIR32XT) ................2-17
Control Memory CM ........................................ 4-43 Displaying the assignment destinations of local
Control relay (contact) CR ............................... 4-36 devices and local labels .............................4-275
Convert result .................................................. 4-14 Displaying Unit Monitor ....................................6-42
Correct device value window ......................... 4-273 Double precision floating-point constants ........4-74
Correlations between Value Notations ............ 4-78 Double precision floating-point real numbers
Counter ........................................... 2-3, 4-35, 4-42 DOUBLE-FLOAT ..........................................4-78
APPENDICES
Counter maximum counting speed .................. 4-36 Down counter .................................................4-163
CPU Memory (user memory) ........................... 5-27
CPU Monitor .................................................. 5-134
CPU Unit ............................................................ 2-5 E
CPU Unit Operation ......................................... 4-82
CSV files .......................................................... 5-71 Edit list ...............................................................4-8
CTD ............................................................... 4-163 EI instruction ..................................................4-218
CTU ............................................................... 4-161 EN ..................................................................4-122
Index
CTUD ............................................................. 4-165 ENO ...............................................................4-122
Entry assistance ............................................4-239
Error Clear .....................................................5-127
D Ethernet/EtherNet/IP Communication
(KV-7500 only) ........................................... 5-110
Data memory ..................................................... 2-3 The Role of CPU Built-In EtherNet/IP
Date/Time ...................................................... 5-132 Communication Function ........................ 5-110
0 second adjustment .................................. 5-133 Ethernet/IP communication ............................ 5-110
Date/time setting ........................................ 5-133 Every-scan execution type .............................4-100
Functions of setup key ............................... 5-132 Exclusive Instruction for the Unit for
How to operate ........................................... 5-132 KV-SIR32XT .................................................6-23
Switching clock .......................................... 5-132 Expansion I/O Unit (KV-SIR32XT)
Decimal constant ............................................. 4-55 Names and Functions of Parts .....................2-14
Decimal Constants .......................................... 4-73 Specifications ...............................................2-15
Decimal DEC ................................................... 4-76 Wiring and Internal Circuit Diagrams ...........2-16
Default status of differential execution Expansion input unit ........................................2-18
instructions ................................................. 4-197 Derate ..........................................................2-19
Device Comments ......................................... 4-252 Name and function of each part ...................2-18
Device List for Logging/Tracing ....................... 5-79 Outline Dimensions ......................................2-24
Device Mode .................................................. 5-118 Specification .................................................2-19
Changing device values ............................. 5-123 Expansion output unit
Changing the device value display format . 5-120 Name and function of each part ...................2-25
Changing type of device to be monitored .. 5-119 Outline Dimensions ......................................2-33
Device name/comment display switching .. 5-122 Specification .................................................2-26
Functions of Setup key .............................. 5-118 Wiring and Internal Circuit Diagrams
Operation method ...................................... 5-119 Derate ..........................................................2-26
When display format are not ON/OFF Expansion unit .................................................2-42
(T, C, TRM) ............................................. 5-125 Name and function of each part ...................2-42
When displaying format is other than Outline Dimensions ......................................2-45
ON/OFF (except T, C, TRM) ................... 5-124 Specification .................................................2-43
Device notation for relay (R) units ................... 4-28 Extension I/O unit ............................................2-34
Device notation method ................................... 4-24 Overall dimension drawing ...........................2-39
Device orientation .............................................. 3-6
Devices used by the CPU ................................ 5-32
Devices using memory cards .......................... 5-10
DI instruction .................................................. 4-218
- KV-8000 Series User’s Manual - A-53
11 Index
F I
Falling edge detector ..................................... 4-160 I/O unit wiring precautions .................................3-8
FB instruction ................................................. 4-148 ID No. .............................................................4-189
FBCALL instruction ........................................ 4-151 IEDGE instruction ..........................................4-224
FBSTRT instruction ....................................... 4-151 Index constants ................................................4-45
Feedback control ............................................... 4-2 Index Modification ................................ 4-44, 4-265
FEND instruction ........................................... 4-148 Index register .................................. 2-3, 4-43, 4-44
File Register .................................................. 4-226 Indirect Specification ............................ 4-46, 4-265
File Register ZF/FM ......................................... 4-39 Infinity ..............................................................4-80
Fixed character strings .................................... 4-74 Initialize module ................................... 4-100, A-21
FRLDM 命令 ................................................. 4-234 Input relay ................................................ 2-3, 4-27
FRSET instruction ......................................... 4-230 Inspection ........................................................3-18
APPENDICES
APPENDICES
Ladder Program ................................................. 4-5 Maintenance ....................................................3-18
Latch relay ................................................2-3, 4-31 Maximum number of connected units ................3-2
Link register W ................................................. 4-41 MCALL instruction .........................................4-192
Link relay B ...................................................... 4-29 MCMP instruction ..........................................5-179
List of Abbreviated Mnemonics ...................... A-23 MDSTOP instruction ...................................... 4-115
List of argument devices ................................ 4-186 MDSTRT instruction ...................................... 4-115
List of Characters That Cannot Be Used ........ A-39 MEND instruction ...........................................4-192
Character that cannot be used in device Mnemonics ........................................................4-8
Index
comments ................................................ A-41 Module Configuration Examples .................... 4-110
Characters that cannot be used in function / Module Execution Sequence .........................4-109
function block / structure names .............. A-39 Module System Devices ................................ 4-113
Characters that cannot be used in labels .... A-39 Module Type ..................................................4-100
Characters that cannot be used in program Monitor Screen ................................................6-40
names ...................................................... A-39 Monitoring expansion units ............................4-277
Characters that cannot be used in project Monitoring instructions ...................................4-276
names ...................................................... A-39 Monitoring rising and falling edges of
Characters that cannot be used in structure devices .......................................................4-276
member names ....................................... A-41 Monitoring the execution time in program and
List of Exclusive Function for the Unit for interrupt program units (Performance
KV-SIR32XT ................................................. 6-30 monitor) ......................................................4-277
List of Exclusive Instructions for the Unit for MR ...................................................................4-31
KV-SIR32XT ................................................. 6-23 MSTRT instruction .........................................4-192
List of PLC Unit Errors ...................................... A-2
List of Shortcut Keys ....................................... A-25
How to Use the / Key .................................. A-37 N
List of CX Format Shortcut Keys ................. A-34
List of GPPQ and GPPA Format Shortcut Names and Functions of Parts .................2-6, 2-11
Keys ........................................................ A-33 Nesting .............................................................4-95
List of Logix Format Shortcut Keys ............. A-35
Shortcut Keys That Are Valid in
KV STUDIO ............................................. A-27 O
Shortcut Keys That Are Valid in the Unit
Editor ....................................................... A-25 Object creation ...............................................4-195
List of Unusable Instructions .......................... A-21 Online edit ......................................................4-269
List of Variables and Data Types ..................... 4-56 Operation during Power Outages ......................2-4
Lists of CR and CM Devices ........................... A-10 Operation Inhibited Setting ............................5-162
Lists of Devices Bit devices ............................. 4-20 Operation when the execution condition is
Word devices ............................................... 4-21 turned OFF .................................................4-197
Local Device Assignment .............................. 4-202 Operation when the program is called
Local Devices ................................................ 4-200 between the MC (master control) and
Log Instructions ............................................... 5-73 MCR (master control reset) instructions .....4-197
LOGD instructions ........................................... 5-75 Option ..............................................................5-67
LOGE instructions ........................................... 5-75 Outline Dimensions ..........................................2-10
Logging function .............................................. 5-57 Bus connection unit ......................................2-10
- KV-8000 Series User’s Manual - A-55
11 Index
APPENDICES
Standby module ............................................. 4-101 Up counter .....................................................4-161
Storage .......................................................... 5-139 Up/Down counter ...........................................4-165
Storage Instructions ................................5-26, 5-49 U_RDBF ..........................................................6-31
Structure .......................................................... 4-59 U_RDBF instruction .........................................6-24
Structure Definition .......................................... 4-65 Usage example together with index
Subroutine macros ........................................ 4-181 modification ..................................................4-48
Subroutine programs .................. 4-94, 4-195, A-22 Usage Procedure ........................................... 4-119
Suffixes .............................................................. 4-9 USB Communication .....................................5-109
Index
Summary of Unit Monitor ................................. 6-42 User Memory Clear ........................................5-155
System Configuration ........................................ 1-2 User Message ................................................5-161
System Configuration Overview ........................ 1-2 Display example .........................................5-161
(1) Power Units .............................................. 1-3 How to Display User Message ...................5-161
(2) CPU Units ................................................. 1-3
(3) KV-7000 Series Expansion Units .............. 1-3
(4) Bus Connection Units ............................... 1-4 V
(5) KV-5000/3000 Series Expansion Units ..... 1-4
(6) End Units .................................................. 1-4 Value Notation .................................................4-76
System Function Block .................................. 4-146 Variable ............................................................4-55
System Program Update ................................. 3-23 Variable Setting ................................................4-63
Variable Types .................................................4-55
T
W
T .............................................................4-32, 4-42
Temporary data memory TM ........................... 4-42 What are arguments? ....................................4-186
Temporary memory ............................................ 2-3 What You Can Do with the Built-In Functions ....5-2
Time limit control ............................................... 4-4 What You Can Do with the Memory Card ..........5-3
Timer .............................................. 2-3, 4-32, 4-42 Wiring and Internal Circuit Diagram ...................2-8
Timer error ....................................................... 4-33 Ethernet communication specifications
TON_100MS .................................................. 4-167 (KV-7500) ...................................................2-9
TON_10MS .................................................... 4-169 KV-8000(A) .....................................................2-8
TON_10US .................................................... 4-173 Wiring and Internal Circuit Diagrams ...............2-16
TON_1MS ...................................................... 4-171 KV-SIR32XT I/O wiring diagram ...................2-16
Total steps ....................................................... 4-15 KV-SIR32XT internal circuit diagram
TRGD instructions ........................................... 5-77 (input circuit) .............................................2-16
TRGR instruction ........................................... 5-105 KV-SIR32XT internal circuit diagram
Types of Sequence Control ............................... 4-4 (output circuit) ...........................................2-16
Word Devices ..................................................4-37
Writing clock data (Setting the time and
date) ...........................................................5-187
Writing/Reading Project Data ..........................5-35
WSIZE instruction ............................................4-68
APPENDICES
Index
E 1101-3
Copyright (c) 2022 KEYENCE CORPORATION. All rights reserved. 084755GB 2092-1 D42GB Printed in Japan