KV-1000 Series: Introduction Manual
KV-1000 Series: Introduction Manual
KV-1000 Series: Introduction Manual
KV STUDIO Functions
Making Projects
Setting up Units
(Unit Editor)
REDUCES PROGRAMMING
MAN-HOURS
Turning Specific Sections of Programs
into Parts for Re-use (modules)
1
Brief description of the reference manuals
The following shows where you can see in the manuals for different purposes while using the KV-
1000 and KV STUDIO.
2
●To re-use KV-700 data
(4) "5-6 Fully Utilizing KV-700 Data"
KV S
TUDIO
3
For safe usage
■ This manual's format
This manual uses the following symbols to alert you to important information.
DANGER Failure to follow these instructions may lead to death or serious injury.
CAUTION Failure to follow these instructions may lead to physical damage (product
malfunction, etc.).
Important
This heading is used to indicate precautions and restrictions that must be fol-
lowed when operating the product.
Note
This heading is used to indicate cautions relating to device operation where
operator error is likely.
Tip Indicates useful information or information that aids understanding of text descriptions.
Indicates a reference item or page to be referred to in this manual and a separate manual.
■ General Precautions
• Verify that this device is operating normally in terms of functionality and performance before the
start of work and when operating the device.
• Provide a safety circuit that does not pass via the programmable controller to enable failsafe
operation of the entire system in the event that the programmable controller fails.
• Output circuit or internal circuit malfunctions sometimes prevent control from being performed
normally. Be sure to provide a safety circuit in control systems where circuit malfunction may
lead to fire or other serious accidents.
• Proceed with care when modifying the KV-1000/700 Series, or when using it in a manner that
falls outside of the ranges indicated in its specifications, since KEYENCE is unable to guaran-
tee device functionality or performance in such situations.
• Use this product in combination with other devices only after careful consideration, since the
KV-1000/700 Series may fail to satisfy its functionality and performance capabilities as a result
of the conditions and environment in which it is used.
• Do not use the KV-1000/700 Series with the purpose of protecting human beings.
• Verify that the KV-1000 is operating normally when operating the KV STUDIO.
4
Conventions Used In This Manual
The following shows how pages in this manual are configured, and the symbols and terminology
used in this manual.
Different procedure
Important information
This is used to indicate
Screen precautions and restrictions
Important
that must be followed when
Before you start this operation, connect the PC to the KV-1000 and enable
operating the product.
communications.
Be sure to read these.
Name of product
Note
First set the unit configuration. Error may occur when you transfer the program Notes:
to PLC if you do not set the unit configuration.
Indicates the page or Describes cautions for
manual to refer to. Tip When you connect by USB for the first time, the USB driver must be installed on the PC.
easily mistaken operations.
The page or manual "KV-1000 Device Configuration" (page 1-14) Be sure to read these.
containing the related Column
information is indicated Deleting units
here. Click to select the unit to delete. Tip
A selected unit is displayed surrounded by a red frame. Press to delete the unit.
Delete
Indicates useful information
Column for reading
or information that aids
at your leisure. Introduces May be deleted
by right-clicking.
understanding
information worth
of text descriptions.
knowing. Also contains
information hints.
2-16
* This page was made for the purpose of explaining page components, and differs from an actual page.
Terminology
5
Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Brief description of the reference manuals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
For safe usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Conventions Used In This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
6
Checking Program Operation without a PLC (simulator) . . . . . . . . . . . . . 2-53
Starting up Simulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-53
How to use Simulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-54
Setting break conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-56
Turning Specific Sections of Programs into Parts for Re-use (modules) . . . 3-2
Types of modules on KV STUDIO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-6
Making a project using an every-scan module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-7
Making a project by using standby modules together with every-scan modules . . . . .3-8
Procedure for Using Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10
Sample program using modules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-25
About Local Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-26
How to use local devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-26
Reasons for using local devices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-28
Making Original Instructions (macros) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-30
When macros are used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-32
Macros use arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-34
Types of macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-35
Procedure for Using Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-38
APPENDICES
7
Introducing the Characters
8
1 ABOUT THE KV-1000
About the KV-1000. . . . . . . . . . . . . . . . . . . . . . 1-2
KV-1000 Functions . . . . . . . . . . . . . . . . . . . . . 1-8
KV-1000 Device Configuration. . . . . . . . . . . . 1-14
1-1
About the KV-1000
Conventional sequence programs comprise control circuits by combining relays, timers, and other
parts.
For this reason, when complex control is performed, the number of required parts increases, and
a large amount of space is required.
Programmable controllers have a built-in microcomputer that runs at high-speed in place of
numerous relays and timers, and are devices dedicated to sequence control that have been
developed for the purpose of reducing the space occupied by control devices.
Programmable controllers, as typified by the KV-1000, are called PLCs (an abbreviation of
Programmable Logic Controllers).
KV-1000
1-2
About the KV-1000
Column 1
Let's take a look at an actual example of sequence control of how a fully automatic
washing machine works.
(1) Switch ON (2) Water supply (3) Wash (4) Drain (5) Spin
End
(6) Water supply (7) Rinse (8) Drain (9) Spin (10) Notification
1-3
About the KV-1000
PLC functions
●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
1 PLCs can be downsized, something which was not possible with conventional relay sequence
control.
ABOUT THE KV-1000
KV-1000
1-4
About the KV-1000
Column
1
Basic sequence control is divided mainly into three types: "sequence control," "condition
control" and "time limit control." Design the target control circuit by a combination of these
control types.
● Sequence control
Sequence control is the most basic of control types. With sequence control, the following
operation is started in a predetermined order when the previous fixed operation ends.
● Condition control
With condition control, an operation is performed when specific conditions are satisfied by
combining various information and signals.
"Click"
Spin for fixed period of time Spin time end, spin stopped
1-5
About the KV-1000
with sequence control using relays and timers, the only means for changing operation was to add
parts or re-wire.
With a PLC, however, you can create the ladder program on a PC instead of having to actually
draw a sequence control circuit diagram. As PLCs run according to this ladder program, the
intended operation can be achieved merely by rewriting the ladder program, and physically
adding on parts or rewiring in a control panel is not required.
Easy programming
on KV STUDIO
1-6
About the KV-1000
Advantages of PLCs
●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
1-7
KV-1000 Functions
KV-1000 Functions
1 The KV-1000 is a high-performance, advanced and highly expandable PLC.
If you further your understanding of the KV-1000, you will find that you can use it efficiently for
ABOUT THE KV-1000
State display
Access window
allows you to
immediately
tell the state of I/O
units and devices.
Multi-function
(16 inputs, 8 outputs)
Memory Card
MMC/SD Memory
Card supported
1-8
KV-1000 Functions
With PLCs, sequence circuits that control output of lamps, etc. can be replaced with a ladder
1
program.
OFF ON
1-9
KV-1000 Functions
The KV-1000 incorporates a newly developed dedicated high-speed chip that optimizes data
ABOUT THE KV-1000
Conventional PLC
KV-1000
Program
Program
Conventional PLC KV-1000
1-10
KV-1000 Functions
Multi-function I/O
The KV-1000 is provided with a Memory Card slot as standard. Use of the MMC and SD Memory
Card slot expands the number of applications of the PLC as indicated below.
1-11
KV-1000 Functions
By splitting up programs and turning split up programs into independent sections (modules),
programming can be distributed between two or more programmers, and programs turned into
modules on other projects can be re-used. This frees you from the conventional "1 project, 1
programmer, 1 program" approach.
[abnormality processing]
[automatic operation]
[manual operation]
[automatic operation]
[manual operation]
[initialization processing]
For details on modules, "Turning Specific Sections of Programs into Parts for Re-use (modules)" (page 3-2).
On the KV-1000, frequently used ladder network blocks can be registered as macros. Registers
macros can be used countless times like instructions.
If you register networks that are frequently used repeatedly as macros, debugging can be made
easier as the man-hours required for programming reduced, and ladder programs can be made
as visually easy to understand.
[module A]
[module A]
[macro 1]
Macro 1
Macro 1
Registering frequently
used ladders
Program using macros
Conventional program
1-12
KV-1000 Functions
KV-AD40
Displacement sensor
1-13
KV-1000 Device Configuration
Bit devices
●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
Bit devices can express two states, for example, "switch ON"←→"switch OFF", or "condition
established (TRUE)"←→"condition not established (FALSE)."
So that actual switches are individually distinguished, respective bit devices on the PLC are
assigned individually different Nos. and are handled as independent devices.
For details on bit devices, KV-1000 Series Programming Manual "1-4 Devices and Constants".
1-14
KV-1000 Device Configuration
Word devices
●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
Whereas bit devices can only express ON and OFF states, word devices can handle numerical
1
values (constants) and text strings as data.
T/C/CTH/CTC
DM/EM/FM/TM/Z/CM
32 bits
16 bits
For details on word devices, KV-1000 Series Programming Manual "1-4 Devices and Constants."
1-15
KV-1000 Device Configuration
1
ABOUT THE KV-1000
1-16
2 MAKING A LADDER PROGRAM
What Is a Ladder Program?. . . . . . . . . . . . . . . 2-2
KV STUDIO Functions . . . . . . . . . . . . . . . . . . . 2-6
Flow of Work for Making a Program . . . . . . . . 2-7
Making Projects . . . . . . . . . . . . . . . . . . . . . . . 2-12
Setting up Units (Unit Editor) . . . . . . . . . . . . . 2-16
Making a Ladder Program (Ladder Editor) . . 2-22
Checking Operation of the Ladder Program (monitor) 2-38
Checking Program Operation without a PLC (simulator) 2-53
2-1
What Is a Ladder Program?
Batteries, switches and lamps are drawn in actual wiring diagrams. Simple wiring diagrams are also
2 easy-to-understand.
OFF ON
When the number of parts increases in easy-to-understand actual wiring diagrams with few parts,
these parts are left on the drawing, and make the wiring diagram more difficult to understand. It is
really hard to draw actual diagrams with complex parts.
Power supply
OFF ON
The circuit of an actual
wiring diagram is easy
Lamp A
to understand, but it's
Switch 1
difficult to make the
drawing.
OFF ON
Switch 2
OFF ON
Switch 3 Buzzer
In actual fact, switches can include sensors and limit switches, and lamps can include solenoid
valves and motors.
2-2
What Is a Ladder Program?
This is why sequence diagrams with symbolical representations of lamps and switches were
conceived. A sequence diagram that expresses parts using symbols is called a "ladder network."
Sequence diagram
In this diagram,
2
parts are turned
into symbols,
On KV STUDIO, the symbols that are used in ladder networks that are created are referred to
simply as "symbols." Switch, lamps, etc. are called "devices." Also, the entire ladder network that
is created is called a "ladder program."
Ladder program
So ladder networks
MR01000 MR02500 drawn on KV STUDIO
are "ladder
MR01001 programs!"
MR01002 MR02501
END
ENDH
MR01000 and MR02501 in the illustration are devices (parts) that are expressed on the PLC.
"KV-1000 Device Configuration" (page 1-14)
2-3
What Is a Ladder Program?
2
Scan
MAKING A LADDER PROGRAM
The flow of operations from input processing through to output processing is called a "scan."
This scan is repeatedly executed on ladder programs.
● Scan time
The time required to perform a single scan (execution of the string of processes from input
processing through to output processing) is called the "scan time."
Output processing
Input processing
Program execution
Output processing
Input processing
Program execution
Output processing
Input processing
Program execution
Output processing
Input processing
Though the scan time changes according to the size of the program and type of instructions used
in the program, you should bear in mind that the longer (more complex) a ladder program is, the
longer the scan time will become.
Note
When a ladder program contains lots of programmed instructions that take time
to process, the scan time sometimes exceeds the allowable range of the KV-
1000. In this case, the "Scan time over" error is generated, and the ladder
program can no longer be executed.
KV-1000 Series Programming Manual "1-3 Projects"
2-4
What Is a Ladder Program?
Column
0 0
10 Secs 10 Secs
2-5
KV STUDIO Functions
KV STUDIO Functions
KV STUDIO is software for making ladder programs.
KV STUDIO is very user-friendly and is provided with outstanding programming capabilities.
Tool bar
Work
space
2-6
Flow of Work for Making a Program
• Monitor
Connects to KV-1000 to allow to you to monitor the operating state of ladder programs.
Debugging in progress
• Simulator
Allows to you to simulate the operating state of ladder programs without actually connecting to KV-
1000.
Debugging in progress
Not needed
KV-1000
2-7
Flow of Work for Making a Program
Start up KV
STUDIO. 1 Start up KV STUDIO.
Create a project.
2 Make a new project. (* For details, see "Making Projects" (page 2-
12).)
• Click the icon on the tool bar.
Click
(1)
Check operation
of the program using
Monitor functions. (2)
(3)
Check operation (3) When you have finished entering the items, click the "OK" button.
of the program
using Simulator
functions. Tip • Limit the project name to 32 1-byte characters (or 16 2-byte
characters). For details of characters that cannot be used and
other restrictions, refer to KV STUDIO User's Manual "2-1
Managing Projects."
2-8
Flow of Work for Making a Program
Make a
program on
Ladder Editor.
Check operation
of the program using
Monitor functions.
Check operation
of the program
using Simulator
functions.
2-9
Flow of Work for Making a Program
Start up KV
STUDIO.
2
MAKING A LADDER PROGRAM
Create a project.
Make a 6 Make the program. (* For details, see "Making a Ladder Program
program on (Ladder Editor)" (page 2-22).)
Ladder Editor.
After exiting Unit Editor, the following screen will be displayed.
Write the ladder program in the [Ladder edit] window.
Check operation
of the program using
Monitor functions.
Check operation
of the program Ladder edit window
using Simulator
functions.
2-10
Flow of Work for Making a Program
Check operation
of the program using
Monitor functions.
Check operation
of the program
using Simulator
functions.
Making Projects
The ladder integration software KV STUDIO is used on the KV-1000 Series. Let's start up KV
STUDIO and try making a project.
Starting up KV STUDIO
2
1 Double-click the icon on the desktop to start up KV STUDIO.
MAKING A LADDER PROGRAM
Startup
title screen
Initial screen
2-12
Making Projects
Making projects
A "project" is a unit for managing a ladder program, unit setup information, comments, and other
information as a single entity.
2-13
Making Projects
2 The [New project] dialog box is displayed. Enter the information of the project to be made.
2
MAKING A LADDER PROGRAM
3 When you have finished all of the information, click the "OK" button.
The following window is displayed.
• When the units to add on to the PLC to be used are already decided
upon, click the "Yes" button.
When Unit Editor is started up, set up the unit confirmation to be used.
(* For details, see "Setting up Units (Unit Editor)" (page 2-16).)
• When the units to add on to the PLC to be used are not yet decided
upon, click the "No" button. (The unit confirmation can be set up later.)
2-14
Making Projects
Saving projects
Save the project you have made or edited.
Click the icon on the tool bar.
2-15
Setting up Units (Unit Editor)
Message area
2-16
Setting up Units (Unit Editor)
2 Adding units
Arrange the units that are to be actually used in a project.
Select the [Unit selection] tab, and drag-and-drop the required units to link them to the CPU.
Column
Deleting units
Click to select the unit to delete.
A selected unit is displayed surrounded by a red frame. Press Delete to delete the unit.
May be deleted
by right-clicking.
Press Delete .
2-17
Setting up Units (Unit Editor)
2
MAKING A LADDER PROGRAM
The auto-assign confirmation message box is displayed. Click the "OK" button.
The relay/DM No. is automatically assigned, and the result is displayed in the message area.
Auto-assign relay/DM
R30000 to R30315
were assigned to the
Input Unit, and
R30400 to R30715
were assigned to the
Output Unit.
2-18
Setting up Units (Unit Editor)
2-19
Setting up Units (Unit Editor)
2
MAKING A LADDER PROGRAM
Column
I/O relay Nos. can be set within the range R01000 to R59915, and data memory Nos. can be
set within the range DM00000 to DM65534.
In the default setting, relay Nos. are batch-assigned in order from R30000(300ch), and DM
Nos. are batch-assigned in order from DM10000. You can also divide up relay Nos. for
input, output and special units, and assign Nos. individually to each of them.
2-20
Setting up Units (Unit Editor)
The following describes functions other than unit configuration and unit setup.
● Building/setting up a KL system
KL Link Systems using the KL Master Unit "KL-N20V" for the KV-1000 can be set on Unit Editor.
2
2-21
Making a Ladder Program (Ladder Editor)
First of all, let's try writing a program in this [Ladder edit] window.
Ladder edit
window
Oh, I see.
You write the ladder
network here.
2-22
Making a Ladder Program (Ladder Editor)
A white framed area in the [Ladder edit] window is called a "cell." Program instructions and
connection lines in this area to build the entire ladder network.
The green border is called the "cursor." When you move the cursor, editing content can move to
the required cell.
Enter ladder symbols (instructions) in the cell indicated this green cursor.
2
Cell indicated by cursor
2-23
Making a Ladder Program (Ladder Editor)
Click here.
Tip • A "NO (normally open)" contact is a "contact that turns ON when a switch or other input
device turns ON."
• NO (NO (Normally Open)) contacts are also called "make contacts."
2-24
Making a Ladder Program (Ladder Editor)
Column
Various ways of entering instructions
●Entering directly using mnemonics
Select the
instruction.
Enter the
name of the
device
to be used.
Click the
"Overwrite"
button to write
the symbol.
2-25
Making a Ladder Program (Ladder Editor)
Enter "MR1000"
here.
2
MAKING A LADDER PROGRAM
2-26
Making a Ladder Program (Ladder Editor)
Enter "MR5000"
here.
2-27
Making a Ladder Program (Ladder Editor)
It must be
2 connected.
MAKING A LADDER PROGRAM
Move the cursor to the 2nd cell, and click the icon on the tool bar.
2-28
Making a Ladder Program (Ladder Editor)
Enter connection lines to all blank cells. Output MR05000 is connected to the NO contact
MR01000 to complete one network.
I've
overwritten it!
It can also
be undone by
right-clicking with
the mouse.
2-29
Making a Ladder Program (Ladder Editor)
2
MAKING A LADDER PROGRAM
If the [Conversion failed] dialog box is displayed, verify the ladder network again referring to the
message that is displayed in the output window.
Output window
Tip • Ladder networks are expressed using symbols so that the operator or other personnel
can understand the content of programs, and cannot be directly interpreted by PLCs.
• The conversion described above must be performed so that the ladder network can be
interpreted by the PLC.
2-30
Making a Ladder Program (Ladder Editor)
Column
Other basic ladder networks
●NC contact networks
A "NC (normally closed)" contact is a "contact that turns OFF when a switch or other
input device turns ON." Output turns OFF when the contact turns ON. Output turns ON
when the contact turns OFF.
2
Tip • NC (NC (Normally Closed) ) contacts are also called "break contacts."
●AND networks
AND networks comprise contacts connected in series. The network is not established
unless both contacts turn ON.
●OR networks
OR networks comprise contacts connected in parallel. The network is established when
one of the contacts turns ON.
MR01004 MR05003
MR01005
●Self-hold networks
Self-hold networks hold their own network state. When output MR05004 turns ON,
contact MR05004 turns ON and the network is established to hold the state.
MR01006 MR05004
MR05004
MR05005
NC contact for canceling self-hold of MR05005
2-31
Making a Ladder Program (Ladder Editor)
2
Buzzer switch Buzzer
MAKING A LADDER PROGRAM
MR01000 MR05000
The fact that MR01000 means a "buzzer switch" and MR05000 means a "buzzer" is not apparent
unless you look at the actual wiring diagram or you are the programmer.
MR01000 MR05000
2-32
Making a Ladder Program (Ladder Editor)
Kanji characters
(2-byte characters)
can also be entered.
2-33
Making a Ladder Program (Ladder Editor)
Adding comments makes it easier to tell the meaning and purpose of networks.
2
MAKING A LADDER PROGRAM
Column
2-34
Making a Ladder Program (Ladder Editor)
2-35
Making a Ladder Program (Ladder Editor)
Column
About self-hold circuits: No.1 (set priority type self-hold network)
2
MAKING A LADDER PROGRAM
With this self-hold network, output (MR05000) continues to stay ON when the execution
condition (in this case, MR01000) turns ON.
Tip • The above self-hold network is called a "set priority type self-hold network."
• This type of network is used, for example, in cases where turning OFF of alarm
output (alarm or alarm lamp) is to be prevented unless the cause of the alarm is
removed when the cause of the alarm (generation of some kind of trouble or
malfunction, etc.) is the execution condition.
2-36
Making a Ladder Program (Ladder Editor)
Column
About self-hold circuits: No.2 (reset priority type self-hold network)
Tip • The above self-hold network is called a "reset priority type self-hold network."
• This network is used, for example, when devices that have started operating by
execution conditions must be stopped after a preset time has elapsed (or by
detection of a limit switch).
2-37
Checking Operation of the Ladder Program (monitor)
Tip • When you connect by USB for the first time, the USB driver must be installed on the PC.
KV STUDIO User's Manual "1-5 Installing the USB Driver"
2-38
Checking Operation of the Ladder Program (monitor)
Writing programs
Write the ladder program you have made to the KV-1000 connected to the PC.
Make sure that the "operation selector switch" on the KV-1000 is set to the Run mode.
Tip • when the "operation selector switch" is set to the PROG mode, the switch must be set
to the Run mode after the ladder program is transferred to the KV-1000 from the PC.
The ladder on the KV-1000 cannot be run if the "operation selector switch" is set to the
Prog mode.
2-39
Checking Operation of the Ladder Program (monitor)
● When the ladder program you have made does not contain an error
The following dialog box is displayed when the program you have made has been correctly
programmed.
When the [Transfer program] dialog box is displayed, this means that the program is ready to be
written.
Tip • By default, all of the checkboxes for the "Trnsfr itms" (information to write to the PLC)
are marked. To disable writing of information, unmark the checkbox.
• For the state of the PLC during writing, select either of "Pause PLC before writing
program" or "Write program with PLC in Run mode".
2-40
Checking Operation of the Ladder Program (monitor)
Click OK.
2
The details of the program error are displayed in the [Output window]. Refer to this for correcting
the program.
Also, if you double-click the error message in the [Output window], the cursor in the [Ladder edit]
window moves to the start of the rung in question.
Tip • When the program contains multiple errors, or when each module contains an error, all
of the error locations are displayed in the [Output window]. This makes it easier to
reach the error locations more quickly.
2-41
Checking Operation of the Ladder Program (monitor)
2
MAKING A LADDER PROGRAM
When the "Yes" button is clicked, the PLC is switched to the Prog mode, and transfer of the ladder
program is started.
Tip • When "Transfer in PROGRAM mode" is selected, the PLC is paused during transfer of
the ladder program, and so devices currently controlled by the PLC stop until the PLC
returns the Run mode.
• To prevent other controlled devices from being stopped, select "Transfer program in
RUN mode".
KV STUDIO User's Manual "9-1 About Monitor/Simulator Functions"
2-42
Checking Operation of the Ladder Program (monitor)
Monitoring programs
When writing of the ladder program is completed, various information (e.g. contact states and
timer current values) can be confirmed.
: Execution run
/continuous scan..................... Sets the PLC to the Run mode.
· Monitor screen
2-43
Checking Operation of the Ladder Program (monitor)
● Ladder Monitor
Confirm the states of contacts and outputs.
2 NO contact MR01000
is in an OFF state.
MAKING A LADDER PROGRAM
NC contact T0100
is in an ON state.
The timer turns
OFF when it reaches
the preset time.
Timer, etc.
Input Output
Instructions
ON state
OFF state
2-44
Checking Operation of the Ladder Program (monitor)
The state of bit devices can be inverted (ON to OFF, OFF to ON) by simple operation.
The MR01000
turned ON.
Note
• Timer/counter contacts and external I/O relays cannot be turned ON/OFF.
• To turn external I/O relays ON/OFF, inhibit input refreshing.
KV STUDIO User's Manual "9-2 Monitor Functions"
2-45
Checking Operation of the Ladder Program (monitor)
Registration Monitor
When Registration Monitor is used, the required devices can be selected and monitored.
Registration Monitor can also display time charts which is handy, for example, for monitoring
networks that do not fit in a single screen.
What is
Registration
Monitor capable of?
2-46
Checking Operation of the Ladder Program (monitor)
Double-click
and then enter
the device No.
2-47
Checking Operation of the Ladder Program (monitor)
● Dragging-and-dropping devices
The devices to monitor can be registered simply by mouse operation.
When you drag a device, the mouse cursor changes to . Drop the device in this state onto
the [Registration Monitor].
Drag-and-drop
*Anwhere in the Registration
Monitor window is OK
It is now registered.
2-48
Checking Operation of the Ladder Program (monitor)
When you drag a selected range, the mouse cursor changes to . Drop the selected range in
this state onto the [Registration Monitor].
Drag-and-drop
*Anwhere in the Registration Monitor
window is OK
2-49
Checking Operation of the Ladder Program (monitor)
2
Directly rewrite the
numerical value here.
MAKING A LADDER PROGRAM
Double-click the
current value
column of the
bit device.
Double-clicking changes
the bit state.
2-50
Checking Operation of the Ladder Program (monitor)
Note
The scale of the time chart is the scale of the timing that individual
communication is performed on the Monitor, and is not the scan time.
To display a more accurate time chart marked for each scan, use the High-speed
Time Chart Monitor.
KV STUDIO User's Manual "High-speed Time Chart Monitor"
2-51
Checking Operation of the Ladder Program (monitor)
When the [Change device values] window is used, the values of devices can be changed during Monitor
or Simulator operation.
The functions and appearance of the [Change device values] window resemble the [Registration
Monitor] window, though it can be used with greater ease.
2
● Calling the [Change device values] window
Select the desired device in the [Ladder edit] window during Monitor (or Simulator) operation and
MAKING A LADDER PROGRAM
Operations in the [Change device values] window are the same as in the [Registration Monitor]
window. (* For details, see "Registration Monitor" (page 2-46).)
To change the device display order, drag the device No. in the window, and drop the device at the
new desired display position.
Move by dragging-
and-dropping. Moved.
2-52
Checking Program Operation without a PLC (simulator)
Starting up Simulator
2
To start up Simulator, select {Monitor/Simulator(N)}→{Simulator(L)} from the menu.
· Simulator screen
Tip • With Monitor functions, where the KV-1000 is connected to the PC, transient changes
such as processing of continuous complicated operations can not be grasped midway.
With Simulator, however, debugging becomes easier to perform as operation results
can be checked at each step.
2-53
Checking Program Operation without a PLC (simulator)
Simulator is provided with various functions such as 1-scan execution and 1-step execution in
addition to continuous scan execution.
Tip • A "step" is a the minimum unit of program execution performed by the PLC, and is
2 used in "mnemonic language" that can be understood by the PLC.
● Execute 1 step:
MAKING A LADDER PROGRAM
Click the icon on the tool bar. The arrow in the [Mnemonic list] window currently
displayed on the right side of the main window moves one unit down (to the next step).
Each click of the icon on the menu advances program execution one step at a time, and
when the ENDH instruction is executed, program execution returns to the initial step.
Also, the cursor in the [Ladder edit] window moves to the top of the network block that contains
the currently executing mnemonic.
2-54
Checking Program Operation without a PLC (simulator)
● Execute 1 scan:
Click the icon on the tool bar.
When the ladder program is executed (simulated) up to the step programmed with the ENDH
instruction, program execution returns and stops at the 0th step.
2-55
Checking Program Operation without a PLC (simulator)
A "break condition" is a condition that causes execution of the ladder program to stop at a specific
step during continuous scan execution or continuous step execution.
Though program execution is advanced up to the desired step if 1-step operation is repeated, this
becomes a difficult task when the ladder program increases in size. This function allows you to
2 check operation more efficiently.
● Rung breaks:
MAKING A LADDER PROGRAM
Rung breaks are used to stop program execution at a specified step (mnemonic).
Rung breaks can be set by double-clicking the mnemonic to stop program execution at in the
Mnemonic list.
If continuous step execution is performed at this time, execution of the ladder program is paused
at the preset break point (rung).
Continuous step
execution
Output window
2-56
Checking Program Operation without a PLC (simulator)
● Device breaks:
Device breaks are used to stop program execution by the state of a specified device.
The change in bit device state (ON ←→ OFF) or the numerical values of a word device can also be
specified as the break condition.
· Selection of module
/macro to set
· Entry of device No.
· Selection of stop condition
Unmarked devices
are ignored.
· Selection of module
/macro to set
· Entry of device No.
· Selection of stop condition
Unmarked devices
are ignored.
2-57
Checking Program Operation without a PLC (simulator)
Column
If you attempt to set a break condition to an extremely long ladder program, it will become
more difficult to find the corresponding mnemonic, making it more difficult to set the device
break.
2 In this case, double-click the desired rung No. of the ladder to set the break condition to.
The mnemonic corresponding to the rung No. will automatically be displayed.
MAKING A LADDER PROGRAM
Double-click the
rung No.
The corresponding
mnemonic is displayed.
Tip • Mnemonics indicate the start of the network block. In the above example ladder, double-
clicking the 7th rung will result in the same mnemonic being displayed.
2-58
3 REDUCING PROGRAMMING
MAN-HOURS
head!
Let's get a
3-1
Turning Specific Sections of Programs into Parts for Re-use (modules)
Assembly on line A
3 Initialization of line A
.....
ages to review the
whole thing.
*** Zero return ***
With conventional ladder
programs, you have to take
into consideration the fact
that a partial correction will
affect the entire program.
.....
3-2
Turning Specific Sections of Programs into Parts for Re-use (modules)
On KV STUDIO, programs are made individually for each process, factory process, function, and
other elements, and each of these is managed as independent parts or "modules" in a single
project.
Project name:
Assembly on line A
Zero return
Manual operation
Abnormality processing
3
Automatic operation
If individual
processing or
So, you don't have to
functions are turned
review the entire
into modules, all you
have to do is to just program when
correct the correcting it!
It won't take long to
desired module.
debug a program of
this size.
· With large (long) programs, it was ·You can tell at a glance where a
hard work finding where the required
particular process is programmed.
programmed script was located. ·The entire program can be debugged
· Debugging was also hard work since
simply as corrections to the program
a partial correction affected the entire
hardly affect other modules.
program.
3-3
Turning Specific Sections of Programs into Parts for Re-use (modules)
If parts of programs are managed individually at separate modules for functions and processes,
you can adapt to additional processes or changes to parts, or delete unwanted functions with
more ease.
** Manual operation **
** Manual operation **
3 ** Automatic operation **
** Automatic operation **
REDUCING PROGRAMMING MAN-HOURS
** Abnormality processing **
** Abnormality processing **
Program
changed
* Inspection process (2 product types) *
* Printing process (1 product type) *
Module deleted
Functions (or processes)
Module added
can be simply added or
deleted if they are turned
into modules.
* Printing process (1 product type) *
3-4
Turning Specific Sections of Programs into Parts for Re-use (modules)
Column
Module library
Modules you have made can also be used in other projects if they are registered to the
module library.
If you put all of the required modules in the module library, you can build the base program
of the project merely by re-using these modules.
Module library
3
Automatic operation
Abnormality processing
Printing process
Manual operation
Assembly process A
Project name:
Machine A assembly line
Zero return
Manual operation
Abnormality processing
Automatic operation
3-5
Turning Specific Sections of Programs into Parts for Re-use (modules)
(1)
3
(2)
REDUCING PROGRAMMING MAN-HOURS
(3)
Projects are configured by making modules of type matched to the target operation.
3-6
Turning Specific Sections of Programs into Parts for Re-use (modules)
With conventional ladder programs, programs were divided into sections by inserting a rung
comment. However, by turning functions or processes into modules, programs can be divided up
more clearly to make the program easier to understand.
Ladder programs divided up into modules have the advantages of being easier to understand,
easier to re-use and easier to debug than conventional ladder programs.
[manual operation]
[manual operation]
3
Zero return module
END
ENDH
Column
3-7
Turning Specific Sections of Programs into Parts for Re-use (modules)
The advantages of dividing ladder programs up into modules can be more fully taken advantage
of by selectively using "every-scan modules" that must be executed when the KV-1000 is in the
Run mode, and "standby modules" that are executed when the execution state is switched by
preset execution conditions.
In this case, it is handier if you program a main module for controlling start/stop of the standby
module.
When every-scan modules only are used When the standby module is controlled
by the main module
* *
Zero return module Zero return module
Main module
Manual operation module Manual operation module
. . .
*Legend
3-8
Turning Specific Sections of Programs into Parts for Re-use (modules)
Column
• Explanation of operation
When the execution condition turns ON, the specified module is started up. The
specified module starts operating from the next scan.
The specified module continues to operate without any need to hold the execution
condition until the MDSTOP module stop instruction is executed.
Note
When this instruction is executed on the initialization module, an error
occurs at ladder program conversion.
• Explanation of operation
When the execution condition turns ON, the specified module is stopped. When stop is
instructed for a module, OFF processing* is executed for only one scan at the next scan
to stop operation of that module.
When stop is instructed for a module, there is no need to hold the execution condition,
and the module will not operate until the MDSTRT module start instruction is next
executed.
* For details on execution of OFF processing, see "Column: Executing modules by
OFF conditions" (page 3-24).
Note
When this instruction is executed on the initialization module, an error
occurs at ladder program conversion.
3-9
Procedure for Using Modules
Study which functions (operations) are to be provided taking the entire device to be
programmed into consideration.
3
STEP2 Generally categorize the program by function.
REDUCING PROGRAMMING MAN-HOURS
Generally categorize the functions (operations) required for controlling the device.
At this time, each categorized function (operation) is called a "module."
Create the "main module" for controlling modules that are created.
Switch multiple standby modules by the main module.
Change the execution order of the required modules as required when multiple modules are to
be executed.
3-10
Procedure for Using Modules
Module A Module B
*** Zero return *** *** Manual operation *** STEP3
Zero return operation of device Manual operation of device
Study other
categories.
Module C Module D
*** Zero return *** *** Automatic operation ***
Processing when trouble occurs Automatic operation of device
during automatic operation
STEP4
Create modules for
Categorize the individual program each individually
functions as modules. categorized function.
The trick is to categorize each of the
modules so that they are independent
of each other as possible.
STEP5
Create the main
module.
STEP6
Change the execution
order of the modules.
3-11
Procedure for Using Modules
STEP4
Create modules for
each individually
Device initialization module
categorized function.
STEP5
Create the main Abnormality processing module Abnormality processing module
module.
STEP6
Change the execution
order of the modules.
3-12
Procedure for Using Modules
Column
...
Abnormality processing module
...
Tip • If you set the program as "main module + multiple standby modules," only the
program that must be processed at all times will be executed as the ladder
program as standby modules will not be called.
For this reason, the scan time will be shorter than that of ladder programs that
do not comprise modules.
Main module:
Zero return • Manual operation • Automatic operation
At least one
Abnormality processing • Communications module is required
processing... for a project.
3-13
Procedure for Using Modules
3 STEP2
Broadly categorize
the program by function.
The [New module] dialog box is displayed.
REDUCING PROGRAMMING MAN-HOURS
STEP3
Study other
categories.
STEP4
Create modules for
each individually
categorized function. Select the type of
module.
STEP5
Create the main
module.
STEP6
Change the execution
order of the modules.
3-14
Procedure for Using Modules
STEP1
Study the configuration
of the overall program.
STEP2 3
Broadly categorize
the program by function.
Let's make the remaining three standby modules and initialization module
in the same way.
If [Workspace] is displayed as shown below, this step is completed.
STEP4
Create modules for
each individually
categorized function.
STEP5
Create the main
module.
STEP6
Change the execution
order of the modules.
3-15
Procedure for Using Modules
● Renaming modules
STEP3
Study other
categories.
In this example, let's rename the every-scan module "main"* for use.
* Any other name is acceptable.
STEP5
Right-click.
Create the main
module.
STEP6
Change the execution
order of the modules. Select.
3-16
Procedure for Using Modules
STEP1
Change the module Study the configuration
name from "Project 1" to of the overall program.
"Main".
STEP2 3
Broadly categorize
Click the "OK" button the program by function.
after changes are completed.
STEP6
Change the execution
order of the modules.
3-17
Procedure for Using Modules
Column
About module/macro properties
Various information is contained in the [Module/macro properties] dialog box.
Tip • A conversion error occurs when the ladder program contains an instruction to start
up a disabled module.
KV-1000 Series Programming Manual "2-4 Editing Modules"
3-18
Procedure for Using Modules
Click the [Execution order] tab in [Workspace], and select the module
whose order is to be changed.
STEP2 3
Broadly categorize
the program by function.
Click the
[Execution order] tab.
STEP4
Create modules for
each individually
categorized function.
Changes the order of
the selected modules.
STEP6
Change the execution
order of the modules.
3-19
Procedure for Using Modules
When you have select the module, click to change the module
order.
STEP1
Different Procedure • Right-click the module whose order is to be changed, and
Study the configuration
of the overall program. select {Move up(U)} or {Move down(D)}.
• Drag-and-drop modules to change their execution order.
Click here.
3 STEP2
Broadly categorize
the program by function.
REDUCING PROGRAMMING MAN-HOURS
STEP3
Study other
categories.
STEP4
Create modules for
each individually
categorized function.
The execution order of
the automatic operation
modules was changed.
STEP5
Create the main
module.
Tip • The initialization module is always executed at the top of the
execution order, and so cannot be placed in descending order
past the second module onwards.
• When the execution order must be set in more detail by
individual modules, we recommend not dividing up the ladder
program and handling the entire ladder program as a single
STEP6 module.
Change the execution
order of the modules.
3-20
Procedure for Using Modules
Executed at
Main
module 1
Main
module 1
3
every scan
Standb
Standby Standb
Standby
module B Scan module B Scan
This section is
Standb
Standby Standb
Standby
not executed
module C module C
until the PLC is
started up.
Standb
Standby Standb
Standby
module D module D
Number of scans
Module name
1st scan 2nd scan From 3rd scan onwards
Device initialization Stop Stop
Execute
module (Cannot be started up.) (Cannot be started up.)
Main
Execute Execute Execute
module 1
Execution order
3-21
Procedure for Using Modules
● Starting up modules
To start up a standby module, use the module exclusive instruction (MDSTRT module start
instruction).
After the start instruction is executed, standby modules start to be executed from the scan
following the scan in which the start instruction was executed.
Module A and
module C startup
3 instructions are
executed. Main Main
module 1 module 1
REDUCING PROGRAMMING MAN-HOURS
Standb
Standby Standby
module A module A
Standb
Standby Standb
Standby
Scan module B Scan module B Scan
Standb
Standby Standby
module C module C
Standb
Standby Standb
Standby
module D module D
Number of scans
Module name
nth scan (n+1)th scan (n+1)th scan onwards
The execution order of the module start instruction (MDSTRT module start instruction) is not
affected as each module is executed in the pre-determined order.
3-22
Procedure for Using Modules
● Stopping modules
To stop execution of a standby module that is started up, use the module exclusive instruction
(MDSTOP module stop instruction).
After the stop instruction is executed, standby modules programmed with the stop instruction
return to a standby state after "OFF processing"* is executed at the following scan.
Standby
Standb
tand Stand
Standby Stand
Standby
Scan module
odule B Scan module
odule B Scan module
odul B Scan
Standby
Stand
tand Stand
Standby Stand
Standby
module
odule D module
odule D module
odul D
Number of scans
Module name
mth scan (m+1)th scan (m+1)th scan onwards
* For details on OFF processing, see "Column: Executing modules by OFF conditions" (page 3-24).
3-23
Procedure for Using Modules
Column
Tip • "Execution by OFF conditions" is the same operation as when the MC master
control instruction turns OFF.
KV-1000 Series Instruction Reference Manual "MC Master Control (MCR) Instruction"
Indicates
that the
"main" module
is currently
executing.
Indicates
that the
"zero return"
module
is currently
standing by.
3-24
Procedure for Using Modules
In this sample program, execution/stop of the four standby modules (zero return module, manual
operation module, automatic operation module, and abnormality processing module) is controlled by
one every-scan module (main module).
● Description of operation
MDSTRT
button) turns ON, the module
(processing function) currently selected 3
R00002
Manual
by mode switching selection (R00001 to
00002 operation R00003) starts to be executed.
Manual selection
3-25
About Local Devices
Local devices are useful, for example, when making a ladder program divided up into multiple
modules for a single project, or when re-using modules in other projects.
3
Every-scan module Standby module
REDUCING PROGRAMMING MAN-HOURS
** Zero return **
MR00014
** Main **
MR00010
** Manual operation **
MR00014
MR00010
** Automatic operation **
MR00014
The same device No.
already exists.
The device No. must
MR00010 be changed.
???
What's this? MR00010
** **
** Abnormality processing
and MR00014 are used MR00014
in various modules.
3-26
About Local Devices
** Zero return**
@MR00014
** Manual operation**
** Main **
@MR00010
@MR00010
@MR00014
**Automatic operation**
@MR00014
Column
Use global devices, for example, when a common device No. is to be used between
modules, or when actual I/O is to be handled.
3-27
About Local Devices
Local devices not only avoid duplicate use of device Nos. between modules, but also provide the
following advantages.
3 ** Zero return **
@MR00014
**Zero return **
@MR00014
REDUCING PROGRAMMING MAN-HOURS
** Manual operation**
** Manual operation**
@MR00010
@MR00010
**Automatic operation**
@MR00014
**Automatic operation**
@MR00010
Module library
**Abnormality processing **
@MR00014
Zero return module
@MR00014
Project Z
(engineer A) module
Main module
(engineer B) module
(engineer C) module
Joint development
3-28
About Local Devices
Column
How local devices work
Local devices are automatically assigned to part of the device area when the ladder
program is converted.
Start
Project 1
Conversion
System devices
When modules/macros are used, part of the local device area is always secured.
The part of the local device area that is secured is automatically assigned for system devices.
Note
Try to program Nos. used in local devices packed, for
example, starting from the leading No. (0). If an
unnecessarily large No. is specified, a large part of the
device area will be secured, and a large load will be
placed on the device area.
3-29
Making Original Instructions (macros)
Project 1
3 <Inspection processing>
<Abnormality processing>
REDUCING PROGRAMMING MAN-HOURS
<Zero return>
<Manual operation>
<Robot control>
3-30
Making Original Instructions (macros)
With KV-1000, ladder networks that are frequently used in a project can be given any name and
registered as macros.
Registering macros facilities programming as user ladder programs can be used as original
instructions.
Call Module 1
Module 2
Call
Macro A call instruction
3
Register
Module 3
Project 1
<Inspection processing>
<Abnormality processing>
<Zero return>
<Manual operation>
Macro A
Macro A
Macro A
Macro A
Macro A
3-31
Making Original Instructions (macros)
● The number of man-hours required for entering ladder programs can be reduced
If you register a ladder network that is frequently used in a project as a macro, the registered
ladder network can be used by simply calling up the macro.
3
REDUCING PROGRAMMING MAN-HOURS
Drag-and-drop
The macro call instruction can be programmed by simply dragging-and-dropping the macro in the
[macro palette].
<Manual operation>
I've got to correct this ...
Corrected
3-32
Making Original Instructions (macros)
the same correction is required on all networks if the same network is used a lot.
<Manual operation> <Robot control> <Automatic box filling> <Automatic operation A>
If the ladder network is registered as a macro, all networks will be corrected by merely correcting
that macro ladder network.
Macro A Macro A
Corrected
All you have to do is to correct the macro network. You do not have to correct the ladder network of the called module.
<Manual operation> <Robot control> <Automatic box filling> <Automatic operation A>
Macro A
Macro A Macro A
Macro A
Macro A
3-33
Making Original Instructions (macros)
When you call a macro, specify the name of the macro and the numerical values or device Nos. to be
processed in that macro at the same time.
The numerical values or device Nos. to be handed over to this macro are called "arguments".
The provision of arguments increases the applicability and re-usability of the macro.
Module 1
...
MCALL Macro A
Call
3 Execution condition
#50 DM01000
...
REDUCING PROGRAMMING MAN-HOURS
Argument 1 Argument 2
Macro A
When you call a macro,
...
use the specified devices #50
and values in the ladder
program in the macro. @CR2008 MOV
Argument 1 @DM00000
DM01000
Column
Up to ten arguments can be specified.
Arguments can be specified when the macro is used. Though the number of arguments is
determined by the ladder in the macro, up to ten can be specified.
Argument 10
#100
KV-1000 Series Programming Manual "3-2 Before You Start Using Macros"
3-34
Making Original Instructions (macros)
Types of macros
There are two types of macros: "sub-routine type macros" and "self-hold type macros."
Macro A #1
Execution condition:
ON state 3
MCALL Macro A
Macro A #2
The above ladder diagram is an example of calling the same sub-routine type macro twice in a
single module.
"Macro A #1" is executed as the execution condition is ON and continues to be executed until the
execution condition turns OFF.
"Macro A #2" is not executed as the execution condition is OFF. The macro stands by to be
executed until the execution condition turns ON.
Execution condition
OFF ON ON OFF OFF
for calling macro A
3-35
Making Original Instructions (macros)
Macro A #1
Execution condition:
ON state
3 MSTRT Macro A
MEND
REDUCING PROGRAMMING MAN-HOURS
Execution condition:
OFF state
MSTRT Macro A
Macro A #2
MEND
The above ladder diagram is an example of calling the same macro twice in a single module.
"MacroA #1" monitors the moment that the execution conditions turns ON and then starts
operating. Though operation is continued even if the execution condition turns OFF, the macro is
no longer executed when the MEND macro end instruction in "macroA #1" is executed.
"MacroA #2" is not executed as the execution condition is OFF. The macro stands by to be
executed until the execution condition turns ON.
Execution condition *2 *3
OFF ON *1 *1 OFF OFF
for calling macro A
Execution condition
of MEND instruction - OFF OFF ON *1 -
in macro A
Column
About macro exclusive instructions
When macro exclusive instructions are used, call (execution)/stop of macros can be
controlled from the ladder program.
● Call sub-routine type macro: MCALL macro call instruction
Ladder program
Execution condition MCALL Macro name
Input method
M C A L L Macro name Argument 1 Argument 2 ... Enter 3
• Description of operation
Input method
M S T R T Macro name Argument 1 Argument 2 ... Enter
• Description of operation
The specified macro is called when the execution condition turns ON. Execution of the
called macro is started immediately from the scan in which it was called.
The called macro continues to execute without any need to hold the execution condition
until the MEND macro end instruction is executed.
• Precautions
Only self-hold type macros are called by the MSTRT macro start instruction.
● Self-hold type macro stop: MEND macro end instruction
Ladder program Input method
Execution condition MEND
M E N D Enter
• Description of operation
The MEND (macro end) instruction is programmed in self-hold type macros. When the
MEND macro end instruction programmed in a macro is executed, the macro is executed by
the OFF condition for the next scan only, and the execution of the macro is stopped.
• Precautions
Execution of the macro does not stop if the MSTRT macro start instruction is in an ON
state when the MEND macro end instruction is executed.
KV-1000 Series Instruction Reference Manual
3-37
Procedure for Using Macros
STEP1 Extract frequently used (scheduled to be used) processing and functions in the program.
Study which processing or functions are considered to be frequently used. Also study factors such
as the applicability of the macro and whether or not the same program has been written in the past.
Determine the type of macro to set, sub-routine type or self-hold type, from the operation and processing content.
The type of macro may be provisionally determined as it can be changed later.
REDUCING PROGRAMMING MAN-HOURS
Create the macro. At this time, enter the macro name and macro type.
Write the ladder program to the macro you have made. At this time, determine the number of
arguments.
Register the type and name of the arguments written in the ladder program.
The macro can now be used. Use the macro call instruction to call the macro.
3-38
Procedure for Using Macros
STEP5
STEP6
To call a macro
you have made
3-39
Procedure for Using Macros
3 STEP2
Determine the
type of macro.
REDUCING PROGRAMMING MAN-HOURS
The [New macro] dialog box is displayed. Enter the macro name.
STEP3
Make the macro.
Enter the macro name here.
STEP4
Make the Next, select the type of macro.
program.
STEP6
To call a macro
you have made When you have finished
entering,click the "OK" button.
3-40
Procedure for Using Macros
STEP1
Extract frequently
used processes and
functions in the program.
STEP2
3
Determine the
type of macro.
Column STEP4
Make the
About renaming macros program.
STEP6
To call a macro
you have made
3-41
Procedure for Using Macros
Argument 1 Argument 2
@CR2008 V0 #00016 #00012 P0
LDA MUL SUB STA
STEP3
P0 and V0 can be
Make the macro. entered in the same way as
regular devices.
· Direct entry
STEP4
Write V0 and P0 instead of writing device Nos.
Make the
program.
· By entering in the [Operand edit] dialog box
Press Alt + F11 on the keyboard.
STEP5
Important
STEP6 In ladder programs, arguments are annotated by a method different
To call a macro from regular devices to distinguish them from other devices.
you have made Arguments for handling constants (numerical values) are annotated
as "V0", and arguments for handling devices are annotated as "P0".
3-42
Procedure for Using Macros
MOV
#00100 @DM00000 STEP2 3
Determine the
#100 type of macro.
Note
Be sure to select the program in rung units.
KV-1000 Series Programming Manual "3-3 Making Macros"
STEP4
The [New macro] dialog box is displayed. When you have entered the
name of the macro, click the "OK" button.
STEP6
Note To call a macro
When creating self-hold type macros, be sure to program the MEND you have made
macro end instruction in the ladder program for the macro.
3-43
Procedure for Using Macros
STEP1
Extract frequently
used processes and
functions in the program.
3 STEP2
Determine the
type of macro.
REDUCING PROGRAMMING MAN-HOURS
STEP4 Column
Make the
program. About annotation of arguments
Arguments are annotated as "P0, P1, P2 ... P9" in the case of
devices, and
as "V0, V1, V2 ... V9" in the case of constants.
For details on arguments, KV-1000 Series Programming Manual "3-2 Before You
Start Using Macros"
STEP5
About @CR2008
Register the arguments.
"@CR2008" is a contact for modules/macros
that turns ON only for one scan when a
module/macro is executed.
Besides this contact, there is also "@CR2007"
that turns OFF only for one scan when a
module/macro is executed.
STEP6 For details, "System devices" (page 3-29)
To call a macro
you have made
3-44
Procedure for Using Macros
This is the display order of the arguments. Select the display format
Write arguments in this order when of the arguments to be
programming macro call instructions. displayed on Ladder Editor. STEP4
Make the
program.
STEP5
3-45
Procedure for Using Macros
● Writing titles
Write titles for arguments P0 and V0. In this step, enter "argument 1
device" for P0 and "argument 2 constant" for V0.
STEP1
Extract frequently After you have entered these, make sure that the titles are displayed in the
used processes and [Macro preview] dialog box.
functions in the program.
3 STEP2
Determine the
type of macro.
REDUCING PROGRAMMING MAN-HOURS
STEP3
Make the macro. The argument title is displayed.
STEP4
Make the
program.
STEP5
When you have finished setting the argument, let's click the "Preview"
button to confirm display when the ladder is displayed.
STEP6
Tip • Macro arguments need not be set when the argument is not
To call a macro
given a title or the order is not changed.
you have made
3-46
Procedure for Using Macros
STEP4
Make the
program.
STEP6
To call a macro
you have made
3-47
Procedure for Using Macros
● Entering arguments
Specify the value or device to the argument.
Here, let's enter EM1000 to the "argument 1 device" and #30 to the
STEP1
Extract frequently "argument 2 device".
used processes and
functions in the program.
3 STEP2
Determine the
type of macro.
REDUCING PROGRAMMING MAN-HOURS
STEP3
Make the macro. Tip • When a device is specified to an argument having a "value"
attribute, the argument becomes the value currently stored to
that device.
STEP4
Make the
program.
Drag-and-drop
STEP5
STEP6
To call a macro
you have made
3-48
Procedure for Using Macros
At this time, the macro call instruction (MCALL and MSTRT instructions)
are automatically selected according to the type of macro.
The MSTRT instruction is selected in the case of self-hold type macros.
STEP1
Extract frequently
used processes and
functions in the program.
STEP2 3
Determine the
type of macro.
STEP4
The operation result is stored to EM01000
Make the
when the execution condition (MR01000) is ON.
program.
30 x 16 - 12 = 468.
STEP5
That's it Register the arguments.
The calculation's right.
STEP6
To call a macro
you have made
3-49
Procedure for Using Macros
Column
Set the password. Enter passwords using one to six 1-byte alphanumeric characters.
When you have finished setting the password, click the "OK" button.
The password will be enabled the next time that KV STUDIO is started up.
3-50
APPENDICES
A-1
1 KV-1000 Error Message Lists
The following describes error messages and remedies to take when an error message is dis-
played.
When the following errors occur, change the mode from the Run mode to the Prog mode, and
remedy the error.
These errors are displayed when an error occurs on the KV-1000 unit.
No. Message Cause Remedy
The number of nested sub-routines This error occurs during ladder execution. Review the
10 CALL Nest exceeds the limit. ladder paying attention to how sub-routines are used.
The number of nested FOR to This error occurs during ladder execution. Review the
11 FOR Nest NEXT instructions exceeds the ladder paying attention to how the FOR to NEXT
limit. instructions are used.
Interrupts exceeding the limit This error occurs during ladder execution. Review the
12 INT Nest occurred simultaneously. ladder paying attention to how the INT instruction is used.
This error occurs during ladder execution. Review the
The number of nested MPS to MPP
13 MPS Nest ladder paying attention to how the MPS to MPP instructions
instructions exceeds the limit.
are used.
This error occurs during conversion. Limit the number of
The number of BREAK instructions
14 BREAK BREAK instructions between FOR to NEXT to within the
exceeds the limit.
specified limit.
Clear the error, and turn the unit ON again. If this error
15 Convert A system error occurred.
occurs frequently, contact your agent.
The object size of the ladder is
19 Object Size exceeded. Reduce the size of the ladder program. The size of the
Code size of the ladder exceeded ladder program can be checked on KV STUDIO.
20 Code Size the capacity.
This error occurs during ladder execution. Review the
The number of macros exceeds the
22 MACRO Nest ladder paying attention to how the macro instruction is
nesting level.
used.
23 Illegal Int
24 Illegal Macro
• Clear the error, and turn the unit ON again. If this error
25 Illegal Pointer A system error occurred. occurs frequently, contact your agent.
26 Illegal Address
27 Illegal Object
Review the following to check that the scan time has not
been exceeded:
• Make sure that there are not too many repeated FOR to
NEST instructions, for example.
• Make sure that jump instructions such as CJ/NCJ to
LABEL instructions have been programmed correctly.
30 Scan Time Over Scan time is 300 ms or more.
• Make sure that program call instructions such as CALL
and MCALL have been programmed correctly.
• Make sure that long-processing time instructions such
as FMOV, WSR and MAX are programmed correctly.
• Make sure that interrupt programs are not being
executed at a high frequency.
Clear the error, and turn the unit ON again. If this error occurs
31 Ladder Stack Over A system error occurred.
frequently, contact your agent.
The ladder program is not Register the ladder program before operating the main
40 No Ladder registered. unit.
The settings of extension/special
50 Unit Checksum units is damaged. Use the Ladder Support software or Memory Card to
The unit setup information is not register unit setup information to the KV-1000 main unit.
51 Configure set.
A-2
1 KV-1000 Error Message Lists
57 No End Unit The End Unit is not connected. Turn the KV-1000 OFF, and connect the End Unit.
A-3
1 KV-1000 Error Message Lists
A-4
2 Index
Ending the Monitor .............................................. 2-43
Symbols Entering arguments ............................................. 3-48
Error ...................................................................... A-2
@ (at mark) ......................................................... 3-27 Error messages ................................................... 2-41
@CR2007 ........................................................... 3-29 Every-scan module ........................................ 3-6, 3-7
@CR2008 .................................................. 3-29, 3-44 Examples of how to make modules .................... 3-13
Execute 1 scan ................................................... 2-55
Execute 1 step .................................................... 2-54
A Expanded data memory ...................................... 1-15
Expansion Unit functions .................................... 1-13
About the execution order of modules ................ 3-21
Actual wiring diagram ............................................ 2-2
Adding units ........................................................ 2-17 G
AND networks ..................................................... 2-31
Arguments .................................................. 3-34, 3-44 Global device area .............................................. 3-29
Auto-assign relay/DM .......................................... 2-18 Global devices .................................................... 3-27
B H
Basic ladder networks ......................................... 2-31 High-speed counter comparators ........................ 1-15
Batch-registering multiple devices ...................... 2-49 High-speed counter comparators (contacts) ....... 1-14
Bit devices ........................................................... 1-14 How local devices work ....................................... 3-29
Break conditions ................................................. 2-56 How to enter instructions .................................... 2-25
break contacts ..................................................... 2-31 How to register arguments .................................. 3-45
Building/setting up a KL system .......................... 2-21
I
C
Index register ...................................................... 1-15
Calling macros .................................................... 3-47 Initialization module ..................................... 3-6, 3-12
Canceling self-hold networks .............................. 2-31 Input relays ......................................................... 1-14
Cell ...................................................................... 2-23 Instruction/macro palette ..................................... 2-25
[Change device values] window .......................... 2-52 Internal auxiliary relays ....................................... 1-14
Changing the order of arguments ....................... 3-46
Changing the setting value/current value of
timers and counters ....................................... 2-50 J
Changing the state of bit devices ........................ 2-50
Communication method other than USB ............ 2-38 Joint development by two or more engineers ..... 3-28
Condition control ................................................... 1-5
Connection line ................................................... 2-28
Continuous scan execution ................................. 2-55 K
Continuous step execution ......................... 2-55, 2-56
Control memory .................................................. 1-15 KV STUDIO .................................................. 2-6, 2-12
Control relays ...................................................... 1-14 KV-1000 .........................................1-2, 1-4, 1-8, 1-10
Conversion .......................................................... 2-30
Counters (contacts) ............................................. 1-14
Counters (current value/setting value) ................ 1-15 L
CPU Unit internal functions ................................. 1-13
Creating macro programs ................................... 3-42 Ladder edit window ...................................... 2-6, 2-22
Cursor ................................................................. 2-23 Ladder Editor ............................................... 2-7, 2-10
Ladder Monitor .................................................... 2-44
Ladder program ...............................1-6, 1-9, 2-2, 2-3
D Latch relays ......................................................... 1-14
Local device reserved area ................................. 3-29
Data memory ...................................................... 1-15 Local devices ...................................................... 3-26
Deleting units ...................................................... 2-17
Device breaks ..................................................... 2-57
Device comment ................................................. 2-32 M
Macro ......................................................... 1-12, 3-30
E Macro exclusive instructions ............................... 3-37
Macro passwords ................................................ 3-50
End of program transfer ...................................... 2-42 Macro preview ..................................................... 3-46
A-5
2 Index
W
Word devices ...................................................... 1-15
Workspace .......................................................... 3-15
Writing programs to the PLC ............................... 2-39
A-7
Revision History
Printing Date Version Details of Revision