KW Multiprog Quickstart
KW Multiprog Quickstart
KW Multiprog Quickstart
Copyright 2002 by
KW-Software GmbH
All rights reserved.
KW-Software GmbH
Lagesche Strae 32
32657 Lemgo
Germany
CONTENTS
CONTENTS 2
INTRODUCTION 4
ABOUT THIS MANUAL 5
PLC PROGRAMMING SYSTEM REQUIREMENTS 6
HARDWARE REQUIREMENTS 6
SOFTWARE REQUIREMENTS 6
INSTALLING THE SOFTWARE 7
DEVELOPING A SAMPLE PROJECT 11
CREATING A NEW PROJECT USING THE PROJECT W IZARD 11
STARTING THE PROJECT W IZARD 11
USING THE PROJECT W IZARD 12
DEVELOPING THE LD CODE 17
INSERTING AN LD NETWORK 17
DECLARING THE PROPERTIES 18
INSERTING A COUNTER USING THE EDIT W IZARD 22
INSERTING THE COUNTER 'RESET' CONTACT 24
DECLARING THE PROPERTIES OF THE COUNTER'S 'RESET' CONTACT 25
INSERTING A SECOND LD NETWORK AND EDITING NETWORK
DESCRIPTION COMMENTS 30
COMPILING THE EXAMPLE PROJECT 37
'MAKING' THE PROJECT 37
HANDLING ERRORS AND MESSAGES 39
DOWNLOADING THE PROJECT TO THE PLC OR IO SIMULATION 40
DEBUGGING THE PROJECT 42
DEBUG MODE 42
ONLINE EDITING 43
CROSS REFERENCE W INDOW 47
VARIABLES W ATCH W INDOW 48
FORCING AND OVERWRITING 49
BREAKPOINTS 50
PRINTING THE PROJECT DOCUMENTATION 53
SELECTING A PRINTER 53
SETTING THE PAGELAYOUT 53
PRINTING THE PROJECT 54
PRINT PREVIEW 54
PRINTING A SINGLE WORKSHEET 55
ADDITIONAL FEATURES 56
USING THE I/O CONFIGURATION 56
CREATING AN USER DEFINED FUNCTION 59
CHANGING THE TASK CYCLE TIME 67
APPENDIX 69
IEC PROJECT COMPONENTS IN THE PROGRAMMING SYSTEM 69
PROGRAM ORGANIZATION UNITS (POUS) 69
INSTANTIATION OF POUS AND FUNCTION BLOCKS 71
VARIABLES AND DATA TYPES 71
VARIABLE TYPES 71
VARIABLES ADDRESSES 72
DATA TYPES 73
INTRODUCTION
MULTIPROG is a standard programming system for IEC
designed PLCs and traditional PLCs. It is based on the
standard IEC 61131-3 and includes the full range of IEC
features.
CREATING
(PHASE 1)
EDITING
(PHASE 2)
COMPILING
(PHASE 3)
DOWNLOADING
(PHASE 4)
DEBUGGING
(PHASE 5)
PRINTING
(PHASE 6)
HARDWARE REQUIREMENTS
60 MB free
Hard disk
memory space
CD ROM drive or
VGA Monitor
Color settings 256 colors True color
Resolution 800 x 600 1024 x 768
Mouse Recommended
SOFTWARE REQUIREMENTS
Figure 1:
Dialog 'Project Wizard
(Step 1 of 6)' for
specifying the project
name and project path
According to the rules for projects, the name and the path of
the project must not contain any blanks or special
characters. The maximum number of characters for the
project name is 24.
Figure 2:
Dialog 'Project Wizard
(Step 2 of 6)' for
entering the first POU
and selecting the
programming language
e. Enter the name for the first POU, which will be automatically
inserted by the Project Wizard in the project tree when
creating the project. Enter 'Main' for our example POU.
Choose the language for the first program by activating the
corresponding radio button.
As we want to program our sample project in the graphical
language Ladder Diagram, select 'Ladder (LD)'.
Figure 3:
Dialog 'Project Wizard
(Step 3 of 6)' for
selecting the
configuration name and
type
Figure 4:
Dialog 'Project Wizard
(Step 4 of 6)' for
selecting the resource
name and type
Figure 5:
Dialog 'Project Wizard
(Step 5 of 6)' for
selecting the task name
and type
l. Enter the name of the first task into the input field (in our
example 'Task').
In the list box select the task type 'CYCLIC'.
Figure 6:
Dialog 'Project Wizard
(Step 6 of 6)' displaying
an overview on the
project settings
Figure 7:
Automatically
generated project in
the project tree
Now that we have created the new project we will start phase 2
and develop the project code.
a. Click with the left mouse button into the worksheet to set an
insertion mark at the position shown below. Here, the
network will be inserted.
c. The network comes with a contact and a coil, and its width
is set automatically as well.
Figure 8:
New LD network in
the worksheet
f. Open the dialog page 'Local scope' and select 'Default' from
the tree.
By selecting this entry we define, that the VAR_EXTERNAL
declaration of the new variable will be inserted into the
variables group 'Default' of the local variables grid
worksheet.
Figure 11:
Dialog 'Contact/Coil
Properties' for
setting the contact
properties
Figure 12:
Dialog 'Contact/Coil
Properties' for
setting the contact
properties
Figure 15:
Dialog 'Variable
Properties' for
setting the counter
properties
Figure 18:
Inserting a contact
in the LD network
e. Move the mouse to the left powerrail and click once to end
the line.
Figure 19:
Connecting the
contact using the
connection mode
Figure 26:
'Variable Properties'
dialog for setting the
variable properties
o. For this coil we select the existing variable 'Motor'. The list
below the 'Name' input field contains all variables which
have already been declared (local or global), depending on
the activated scope radio button.
From the list select the local variable 'Motor'.
Figure 28:
'Contac/Coil Properties'
dialog for selecting a
variable for a coil
Now we want to insert a logic to stop the motor and edit the
network description comments.
Figure 31:
Second LD network
inserted in the LD
code body
worksheet
Figure 32:
Dialog 'Contac/Coil
Properties' for
setting the variable
type for the contact
Now we will insert the timer that controls how long the motor
will run.
h. From the Edit Wizard's 'Group' list box select the group
'Function blocks'.
i. From the list of function blocks select the timer 'TON' ('Timer
On Delay') and insert it by double clicking on it.
Figure 37:
'Variable Properties'
dialog for declaring a
local variable
The last variable we have to declare is the one for the coil
'C004'.
v. This coil will stop the motor when energized. Since we use a
Set coil to start the motor, we need to use a Reset coil to
stop it.
So set the coil type to 'RESET' by selecting the
corresponding list box entry as shown in the following figure.
Figure 40:
'Contact/Coil
Properties' dialog
for setting the coil
and variable type
Figure 41:
LD code worksheet
with inserted
second LD network
and function block
'TON'
By clicking on the button 'Font >>', you can change the font
properties. Select 'blue' as color and the font width '20'.
z. Click 'OK'.
Figure 45:
Dialog 'Resource
settings' for setting
the output device
You can ignore warnings, but you must fix errors to proceed
with the exercise.
Fix all errors (if any have occurred) and re-compile the
project using the 'Make' icon.
Figure 48:
'Download' dialog
for initiating the
project download
The dialog is used to start the download process. You can send
either a "normal" project or the zipped project source (which can
be used as a backup) to the PLC or simulation.
b. To activate the debug mode, make sure that the code body
of our POU 'Main' is open, and click on the 'Debug on/off'
icon in the toolbar:
Note that the states and current values of the variables are
displayed in several colors indicating the different states:
blue = false
red = true
You can toggle between the online and the offline mode by
clicking on the 'Debug on/off' icon.
Figure 52:
Dialog 'Contact/Coil
Properties' for
setting the contact
properties
h. We will use the second input point in the I/O simulator for
the emergency stop. Enter '%IX0.1' as the address for this
variable in the 'I/O address' input field and click 'OK'.
Figure 53:
'Contact/Coil
Properties' dialog
for setting the
contact properties
Figure 56:
Cross reference list
in the sample
project
and
a. If this is not yet the case, switch the worksheet into Online
Mode by pressing the 'Debug on/off' icon.
Figure 57:
Variable Watch
Window
Figure 58:
'Debug: Resource'
dialog for forcing
and overwriting
variables
If you repeat the steps e. and f. the logic will start executing.
STEP 6 BREAKPOINTS
Go: Clicking 'Go' causes the program to execute until the next
breakpoint is met.
and
a. Choose the menu item 'Print Project...' from the 'File' menu.
The 'Print Project' dialog appears.
a. Make sure that the worksheet you want to see is the active
window.
b. Choose the menu item 'Print Preview...' from the 'File' menu.
The print preview of the active worksheet will be displayed.
You can print single worksheets that are opened in the graphic
editor or text editor.
Cross references are not printed using the menu item 'Print'.
How to proceed:
ADDITIONAL FEATURES
At this point you need to select the driver you will use from
the list and configure it as described in the manual for the
corresponding driver.
The current I/O configuration is shown in the dialog. We
want to change this configuration, i.e. we want to define 10
input modules in the existing group.
Figure 62:
'Properties' dialog
for configuring the
I/O Simulator
q. Confirm the dialogs with 'OK' to insert the variable into the
code body and its declaration into the local variables
worksheet.
Figure 68:
'Contact/Coil
Properties' dialog
Compile the project using the 'Make' icon, start and then
download it.
Notice that each time the logic in the main program executes
(motor starts, runs 20 seconds and stops) the value of
'Motor_Cycles' is incremented by 1.
a. Make sure, that the system is in Offline mode, i.e. the icon
'Debug on/off' is not pressed.
APPENDIX
Configurations
Resources
Tasks
Functions
Function blocks
Programs
VARIABLE TYPES
Variables must be declared first in order to be used in the logic.
1. Local variables
2. Global variables
VARIABLES ADDRESSES
You can directly address your variables using the 'I/O address'
input field.
The following table shows the location and size prefixes for
located variables:
I Physical input
Q Physical output
Figure 70:
Local variables grid
worksheet
DATA TYPES
Data types determine the kind of value the variable can have.
Data types define the initial value, range of possible values and
the number of bits.
STRING Sequence of 80
characters