Upload
ovidiu-ciobanu
View
218
Download
0
Embed Size (px)
Citation preview
8/10/2019 Starterset Manual 21gb
1/86
8/10/2019 Starterset Manual 21gb
2/86
Starter Set Manual ecomat 100 Type R 360
Starter Set Manual ecolog 100plus
03/ 2005, from software version CRxxxx_P
Guarantee note
This manual was written with the utmost care. However, we cannot assume any guarantee for the
contents.
Since errors cannot be avoided despite all efforts we appreciate any comment.
We reserve the right to make technical alterations to the product which might result in a change
of contents of the manual.
8/10/2019 Starterset Manual 21gb
3/86
I
What you can find in this manual
1. What you should know...........................................................1-1
Required previous knowledge ......................................................................... 1-1
Structure of the manual .................................................................................... 1-1
How to find your way around .................................................................... 1-1
1.1. Overview of the documentation............................................................. 1-2
Hardware............................................................................................................ 1-3
2. Installation...............................................................................2-1
2.1. Hardware of the PC................................................................................. 2-1
2.2. Software set-up....................................................................................... 2-1
2.3. Program start .......................................................................................... 2-4
Settings 2-6
New project............................................................................................... 2-6
Directories................................................................................................. 2-6
Libraries .................................................................................................... 2-8Hardware configuration............................................................................2-11
3. The start...................................................................................3-1
3.1. Basics and concepts .............................................................................. 3-1
3.2. A short ecolog 100plusproject as a start ............................................... 3-3
Description................................................................................................ 3-3
Add Program............................................................................................. 3-5
Defining variables ..................................................................................... 3-6
Saving..................................................................................................... 3-12
Other languages ..................................................................................... 3-13
Program test ........................................................................................... 3-13
Visualisation............................................................................................ 3-16
3.3. Online Test ............................................................................................ 3-27
Preparations ........................................................................................... 3-27
8/10/2019 Starterset Manual 21gb
4/86
Starter Set Manual ecomat 100 Type R 360II
Operating system.................................................................................... 3-28
Program test online................................................................................. 3-32
Sampling Trace....................................................................................... 3-38
Documentation........................................................................................ 3-43
4. Exercises ................................................................................ 4-1
4.1. Logic functions ....................................................................................... 4-1
Program structure ..................................................................................... 4-1
Example 1! Error! ...................................................................................... 4-3
Example 2 ................................................................................................. 4-4
4.2. Higher-level functions ............................................................................ 4-5
Timer and counter function ....................................................................... 4-5
Practical application.................................................................................. 4-6
5. Appendix................................................................................. 5-7
5.1. Buttons .................................................................................................... 5-7
File functions............................................................................................. 5-7
General functions...................................................................................... 5-8
Online functions ........................................................................................ 5-8
General editing functions .......................................................................... 5-8
Editing functions for SFC .......................................................................... 5-9
Editing functions for LD............................................................................. 5-9
Editing functions for FBD ........................................................................ 5-10
Functions for Sampling Trace ................................................................. 5-10
Functions for Visualisation .......................................................................5-11
5.2. Brief instructions .................................................................................. 5-12
New Project............................................................................................. 5-12
Libraries and hardware configuration...................................................... 5-13
5.3. Remarks for solutions .......................................................................... 5-13
6. Index......................................................................................... 15
8/10/2019 Starterset Manual 21gb
5/86
1-1
1 What you should know
In this chapter we will give you an overview of the following points:
What previous knowledge is required to be able to work with this manual? What is the structure of this manual?
How do you find your way through this manual?
What information you find in this manual.
Why this
manual?
Every user knows the problem: new software and new hardware. You will come
across many unknown issues which at the beginning take up a lot of time and
thus money.
When you work with the system more frequently you will find that many worksteps keep repeating themselves. You no longer concentrate on how to create
a new project or how to declare a variable, but concentrate on the process to be
controlled.
This manual therefore describes in many details, step by step, the procedure of
creating programs and handling the hardware.
When you use this manual as recommended, you will be able to quickly reach
your goal to effectively use the controller system ecomat 100.
1.1 Required previous knowledge
This training manual is directed at people who have some basic technical
knowledge. Some experience in controller technology and PLC programming
skills are useful.
1.2 Structure of the manual
This manual provides learning support for starters. As experience increases
more interim steps can be skipped.
How to find your way around
To facilitate work with this manual we have added some helps for you.
To be able to directly get to a certain subject use the table of contents of this
manual.
The index will also help you get to the term you are looking for.
At the beginning of a chapter we are giving you a brief overview of the contents
of that chapter.
8/10/2019 Starterset Manual 21gb
6/86
Overview of the documentation
1-2
Headers The header of each page on the right provides you with the title of the current
chapter. On the left you will find the current header of second order.
Footnotes In the footnotes of each page you will find the chapter-related number of thepage.
selective
reading
In the marginal column you will find comments which make finding certain
paragraphs easier for you.
There you will also find pictograms and markings the meaning of which is
explained below.
Note
Paragraphs marked with this pictogram give safety-related information. Read
these paragraphs very carefully.
Arrow Here you are given important notes to help you with the correct handling of
ecomat 100.
1.3 Overview of the documentation
Working with a controller of the ecomat R 360 system requires several
documents. A brief overview should help you to cope.
Catalogue
Overview of the data sheets
Manual for the program development with ecolog 100plus
Software description
System manual ecomat 100 type R 360
Technical description, hardware-specific function blocks
Mounting and installation instructions
hardware specific, are supplied with the unit
Training manual
Step-by-step introduction
8/10/2019 Starterset Manual 21gb
7/86
What you should know
1-3
www.ifm-electronic.com
Each printed medium such as this manual will become obsolete sooner or later;
looking at the speed of technical changes, rather sooner. This also applies to
hardware and software. To find out about the current version, please see the
web address indicated on the left. Usually you will find there updates of the
software and the current version of the documentation for downloading (seee.g. page 2-3).
1.4 Hardware
In the training manual reference will be made quite often to the hardware. To be
noted:
The different types of the controller ecomat 100 type R 360 (e. g. CR2500,
CR0020, CR0501) vary in their different hardware configurations.
For the programming software this means:
it has to be adapted to the hardware. The process will be briefly described
below. You will find more information in the programming or system manual.
it might be necessary to change e.g. the addresses of inputs or outputs in
example programs.
It would be much too complicated to write an introduction into the software foreach type. That is why as an example the handling of the controller
CR 2500 will be described.
When you work with another version later on, this must, of course, be taken
into account for the examples. Another subdirectory must be set and other
libraries must be loaded. Since the type designation, here CR0015, is also
used for the directory and file names, e.g. subdirectory CR0015, this should
be no problem. To keep the following text clear, this will not be pointed out
separately.
When, for example, you work with the starter set of the controller CR 0105,
virtually everywhere 2500 can be replaced by 0105 in the following examples.
The only difference is that with the starter set some steps can be skipped. Here
some settings have already been made to facilitate the start. No harm will be
done, though, if for example you load the operating system once again for
reasons of practical training.
http://www.ifm-electronic.com/http://www.ifm-electronic.com/http://www.ifm-electronic.com/http://www.ifm-electronic.com/8/10/2019 Starterset Manual 21gb
8/86
8/10/2019 Starterset Manual 21gb
9/86
2-1
2 Installation
2.1 Hardware of the PC
Minimum PC with Pentium processor
MS Windows from version 95
16 MB RAM
Hard disk with 20 MB available
Mouse and additional serial interface
2.2 Software set-up
Set-up The installation is started as usual. If the autostart function of the CD-ROM drive
is active, the ecolog software installer starts. The selection will be described
below.
Figure 1: Installer
The following programming examples were created using the programming
software version 2.1. In this version the language is selected.
8/10/2019 Starterset Manual 21gb
10/86
Software set-up
2-2
Figure 2: Version
The version you use depends for example on your hardware version, on the
version of its operating system, etc. If you use different versions it may become
necessary to also install different software versions. You can, of course, install
this and other programs subsequently, for example if you want to work with a
PDM or with CAN modules. You may also want to install the documentation on
your PC. To be able to see or print the documentation here or on CD you need
Acrobat Reader. These installations will not be described in this training
manual.
The software is installed by clicking on Set-up. The individual steps will not be
described here.
We recommend to adopt the default settings, e.g. the directory name, paths,
etc. This will save unnecessary work. This will also make it easier to
understand the following examples.
The following directories are then on the hard disk:
C:\Program Files\ifm electronic\ecop_21e Program file ecolog 100plus
C:\Program Files\ifm electronic\ecop_21e\LIB general libraries
C:\Program Files\ifm electronic\ecop_21e\LIB\CR2500_Nunit-specific files
C:\Program Files\ifm electronic\ecop_21e\PROJEKTE your projects,
examples
8/10/2019 Starterset Manual 21gb
11/86
Installation
2-3
The directory CR2500_N is an example of the starter-set. If you work with
another version, e.g. CR0501, it is CR0501_N that has to be opened as will be
described in the next chapter.
N This letter N stands for the date of the update (release). The current version
can be found on the web (see 1.3). The new versions are, for example,
required for the new hardware versions. We recommend to change these
versions only if it is necessary. It is a lot easier, if all systems used are of the
same version, even it is not the latest one.
At any rate the downloader should also be installed.
Figure 3: Downloader set-up
8/10/2019 Starterset Manual 21gb
12/86
8/10/2019 Starterset Manual 21gb
13/86
Installation
2-5
Figure 5: Example program
We will not deal with this any further here. The continuous work on this project
is made easier if the one opened last is loaded automatically during program
start-up. Therefore the example program will open here If you do not want this,
you can change it via Project Options 'Auto load'..
Figure 6:Project options 1
8/10/2019 Starterset Manual 21gb
14/86
Settings
2-6
2.4 Settings
New project
Before starting with the programming of the controller you would normally have
to make some additional settings.
In the starter set all required settings have already been made. In this case
the following information is for information only.
These settings are part of each project and are saved with it. This way you can
easily work on projects for various hardware configurations with the same user
interface. To show how the settings are made we open a new project via File
Newor a new project.
Figure 7: New project
This start window will be discussed in more detail further below. For the time
being we select the option FBDand confirm it by OK.
Directories
Search path Since the same programming surface is used for different hardware
configurations, the required files need to be accessible. The unit-specific files
are listed in different subdirectories. It would be confusing to provide all of
them right from the start. First, it has to be stated in which subdirectory they
can be found.
8/10/2019 Starterset Manual 21gb
15/86
Installation
2-7
This is done via the menu items: 'Project' 'Options'. Select the category
Directoriesin the displayed dialogue window (see Figure 8).
Figure 8: Set directories
The first line indicates where the library files can be found and the second line
where the program files are to be stored. It is indicated:
C:\Program Files\ifm electronic\ecop_21e\lib
C:\Program Files\ifm electronic\ecop_21e\projekte
Starter set This is the controller type CR2500. The unit-specific libraries are in the
subdirectories, e.g. of the starter set
CR2500 C:\Program Files\ifm electronic\ecop_21e\lib \CR2500_N
and are linked via Insert Additional library.
Model panel During the trainings a model panel with the controller CR 0020 is used.The
unit-specific libraries are in the subdirectory
CR0020 C:\Program Files\ifm electronic\ecop_21e\lib \CR0020_Q
The index _Q following the unit designation indicates the current software
version (see page 2-3).
In the starter set the directory for the unit-independent libraries is already set.
8/10/2019 Starterset Manual 21gb
16/86
Settings
2-8
Libraries
Predefined
functions
A modern programming software to IEC 61131-3 should allow the
administration of self-created program modules. They only have to becreated once and can then be used as often as required. Administration in
ecolog 100plus
is handled via libraries. Furthermore, a number of standard
functions and hardware-specific functions have been predefined. These
libraries have to be loaded if necessary.
File size Each added library makes the project file bigger. Therefore no unnecessary
libraries should be added. At the beginning it may be difficult to judge which
library is necessary and which is not necessary. A hint is given by the name
of the library. If, for example the name is CRXXXX*.*, you will only need the
library if you work with the unit CRXXXX. As experience increases,
differentiation is getting easier. However, the file size is only critical with very
complex programs.
A consequence resulting from the keyword file size affects the program
modules created. It is unfavourable to combine them all in one library. If they
are separated it is easier to focus on those that are actually needed.
No menu
active
At the beginning the question is occasionally asked what is to be done if most
menu items are not active at first which is shown by the grey colour. This
happens, for example, when the work on a project was finished with File
Close. To activate them a project has to be opened. This is done via the
menu item File Newor the respective button (you will find an overview
of the buttons in the annex, see 5.1. The procedure was described above,
see page 2-6). To be sure let us compare:
The top line then reads:'EcoPlus - (Untitled)*'
The name can be assigned when saving the file.
CR2500as an
example
Below we will show how to prepare a project for the controller CR2500 as an
example.
Entries The menu items Window Library Manager' open a window in which no
entries can be seen at first.
8/10/2019 Starterset Manual 21gb
17/86
Installation
2-9
Figure 9: Library Manager 1
Entries can be made via InsertAdditional library'.
Figure 10: Additional library
The available libraries are shown on a mouse click.
Figure 11: Selection of libraries
Standard.LIB As mentioned above you can find many libraries here. The (unit-independent)
Standard:LIB should be loaded in any case.
8/10/2019 Starterset Manual 21gb
18/86
Settings
2-10
After the libraries have been inserted the library manager looks as follows:
Figure 12: Library Manager 2
A glance at the library manager shows what kind of module it is. This also
explains the name of the library.
Help If during program creation you are not sure which module is needed or what
the inputs and outputs mean you have the possibility to call help via Helpin
the toolbar. There you will find detailed descriptions and examples. Often it is
faster and easier to call the library manager and to mark the respective
module there. Then you can often find the information you are looking for inthe declaration part (see figure 12 top right). This applies above all to the
unit-specific libraries (see figure 14). The help would be much too extensive if
all unit-specific modules were explained there. A glance at the library
manager can save leafing through the manual.
CR2500 Now the unit-specific library has to be added. By double-clicking the folder
Cr2500_N (see figure 11) is opened.
Figure 13: Unit-specific library
8/10/2019 Starterset Manual 21gb
19/86
Installation
2-11
By clicking on Openthe library is added.
Figure 14: Library Manager 3
We are not done yet! Programming not only requires the library files but also
e.g. the operating system. It is therefore not sufficient to only enter the
libraries in the manager.
Hardware configuration
CR2500 Here again we refer to the unit CR2500. As mentioned above, the settings for
CR2500 have already been made for the completed examples so that we do
not have to worry about them in the starter set. For a new project for the
starter set the library Cr2500_N has to be inserted again. Since the features
of the hardware versions are fixed, various variables have also been
declared in advance.
Declarations As is the case with each efficient software, ecolog 100plus
declares variables.
Declarations, presentation, notations etc. are described in detail in the
manual for the program development. In our manual we will describe thisprocess briefly in the individual steps (see e.g. page 3-37).
Below we will describe the process of loading the hardware configuration.
8/10/2019 Starterset Manual 21gb
20/86
Settings
2-12
There are again several possibilities to
open the respective window. You can
either click on the Resources index in
the navigation bar and double-click on
the controller configuration (then youcan also check if the libraries have
been integrated) or directly via the
button. At first the respective window is
empty.
Figure 15: Navigation bar Resources
Figure 16: PLC Configuration empty
The requested PC configuration, the firmware, is called via Add Firmware.
Open subdirectory CR2500_N in the window and select file CR2500_N.M66
which you will find there. The file format should not be changed.
8/10/2019 Starterset Manual 21gb
21/86
Installation
2-13
Figure 17: Insert firmware
At first the usual dialogue field to open a file is displayed. If you did not indicate
any other names or directories during installation, you will find the respective file
as in Figure 18 at c:\programme\ifm electronic\ecop_21\.Lib\Cr2500_N
Figure 18: Select firmware
N Remember: N is the designation for the current version. You might find
another letter for another version.
After marking the file and confirmation with the called configuration is
displayed.
8/10/2019 Starterset Manual 21gb
22/86
8/10/2019 Starterset Manual 21gb
23/86
3-1
3 The start
This chapter is a kind of "introductory course for ecolog 100plus
. You will get to
know the operation and the handling of the program, i.e. you will get a brief
insight into almost every function of ecolog 100plus.
The most important part of this introductory course is the complete creation of a
program example directly on your PC.
3.1 Basics and concepts
What is ecolog
100
plus
?
ecolog 100plus
is a complete development environment for your controller of
the ecomat R 360 range (ecolog 100
plus
stands for ecolog, the programminglanguage, and 100plus for the improvements as compared to the earlier
version of the ecomat 100).
ecolog 100plus
is an easy-to-handle tool for creating control programs to IEC-
61131-3.
What is IEC-
61131-3?
IEC-61131-3 is an international standard for the creation of control programs.
It is important to know that only the programming language has been
standardised, not the programming surface (window structure, presentation
of values in the online mode, data saving, etc.). The programming languages
of ecolog 100plus
meet this standard.
What is aproject?
In ecolog 100plus
a project is the combination of components. Thesecomponents solve a given control task (e.g. sequential control of a device,
signal pre-processing for a part of a plant, ...).
Which are the
main
components of
an ecolog
100plus
project?
The main components of an ecolog 100plusproject are:
POUs (program organisation unit, executable program)
structures (data organisation)
visualisations
Which
programminglanguages are
available?
ecolog 100plussupports the following programming languages:
LD (ladder diagram)
IL (instruction list)
FBD (function block diagram)
SFC (sequential flow chart)
ST (structured text)
CFC (graphical function block diagram)
8/10/2019 Starterset Manual 21gb
24/86
Basics and concepts
3-2
How is a
project
defined?
The definition of a project includes:
The hardware configuration
- definition of inputs and outputs
The creation of components
- POUs
- structures
- visualisations
How do I test
my project?
The true test of a project is the commissioning of the actual system. On the
other hand, the simulation mode of ecolog 100plus has proven to be a very
valuable possibility for testing the program.
What is the
simulation
mode?
The simulation mode simulates the program run of the controller in the PC.
This type of test without using the control system or the plant enables the
elimination of errors at the desk, thus saving time and nerves. The effect can
be enhanced by displaying the simulated plant by means of visualisation.
The use of the simulation in conjunction with the versatile debug functions
(troubleshooting functions) in ecolog 100plus
allows a simple and efficient
complete program test.
Which debug
functions does
ecolog 100plus
have?
ecolog 100plus
includes the following debug functions:
Forcing (writing) of I/Os and variables
Definition of watch windows for data presentation
Setting of breakpoints in the simulation mode (stop of the program run)
Execution of programs
- as single scan
- from breakpoint to breakpoint in the simulation mode
Sampling Trace (diagram of variables as a function of time)
And the
documentation
?
The complete project can be documented at any time in whole or in parts or
can be exported into a text file.
Conclusion This overview shows that ecolog 100plus as a complete development
environment for your ecomat controller exceeds the functions of a commonprogramming surface. Let's take a little project to show that we are not
promising too much.
8/10/2019 Starterset Manual 21gb
25/86
The start
3-3
3.2 A short ecolog 100plus
project as a start
Description
This chapter will describe a short project demonstrating the basic steps in
ecolog 100plus. The processes are more or less described like a "recipe".
Task A lampCis to be ON when two switches Aand B are closed. This really simple
system can be shown as in Figure 20.
Figure 20: Problem
ecolog 100plus
is to
implement and
visualise this system
The first step
The first steps usually are as follows:
Start ecolog 100plus
Open an existing project or start a new one
Integrate libraries and hardware configuration in the new project
Starting a new
project
To start a new project select option 'File' New or alternatively click on the
button . This step was already described in 2.4, page 2-5.
PLC_PRG Usually a new object is added via the menu. Since the first step in a new project
should always be adding the main program module PLC_PRG which plays a
particular role, the window New module will open automatically when a new
project is started with the preset PLC_PRG.
As shown in Figure 7 and again in figure Figure 21
8/10/2019 Starterset Manual 21gb
26/86
A short ecolog 100plus project as a start
3-4
the object is to get the name PLC_PRG,
the type is to be a Program and
the language is to be FBD
Figure 21: PLC_PRG as FBD
FBD FDB was chosen because it is the language most frequently used.
Click on to get a screen similar to Figure 22.
Figure 22: PLC_PRG window
We have now added the module PLC_PRG to the project. PLC_PRG is
executed cyclically and activates the modules (programs, functions, function
blocks; for details see below) that are called.
Please observe the following very important instructions:
Check if all these points
correspond
Name: PLC_PRG
Type: Program
Language: FBD
8/10/2019 Starterset Manual 21gb
27/86
The start
3-5
Allprojects must have oneand only one PLC_PRG.
All modules to be directly activated via PLC_PRG, must be called here,
otherwise they will notbe executed!
Point 1 has already been described. To illustrate point 2 we want to add asecond program to the project and call it with PLC_PRG to ensure its cyclical
execution.
Settings If you have not yet done so, work through the sections until hardware
configuration starting on page 2-6.
Add Program
Adding an
FB_AND
Add a program with the name FB_ANDto the project with menu item Project
Object Add...(Figure 23).
Figure 23: Project Add Object
A window similar to Figure 24 should show.
Figure 24: Window Module FB_AND
8/10/2019 Starterset Manual 21gb
28/86
A short ecolog 100plus project as a start
3-6
Defining variables
Variables can be displayed in form of a table or text. Below we will describe the
text form but you can change the form of displaying variables at any time. In the
context of programming, the definition of the characteristics of a variable is
called a declaration. We use the option declaration as text. That is the defaultsetting. It can be changed under Project Options Editor, if requested.
Defining
variables (text
form)
The new variables A and Bare to be defined as binary, i.e. BOOL. To do so, we
proceed as follows:
Move the cursor to the end of line 0002 and press the Enterkey (Figure
25).
A new empty line has been added in line 0003.
Enter the definition as in Figure 26.
Key word BOOL is a so-called key word. Its meaning is predefined. For example, it
cannot be used as a name for a variable. Since ecolog 100plusknows the key
words, the programmer is supported during entry. The notation, whether small
or capital letters, is not important. After entering, the text is checked and
recognised key words are automatically represented correctly and highlighted in
colour, see Figure 26.
Figure 25: Declarations as text
Figure 26: Enter declarations
There are alternative possibilities for the declaration which will be shown shortly
(Figure 34).
Move the cursor to the end of
line 0002 and press 'ENTER'.
A blank line shows.
You can enlarge the upper part of
the window by pulling down the
separating line with the mouse.
Do not forget the semicolon!
8/10/2019 Starterset Manual 21gb
29/86
The start
3-7
Add AND
operation
Figure 27: Add Operator
Click on the first network (grey field with the number 0001 in the bottom part of
the window), as shown inFigure 27. The form of the cursor, here shown as a
dotted rectangle, can be changed, if requested, via Project Options Mark.
Add the ANDby clicking on in the symbol bar or by
calling Insert Operator(see Figure 28)
Figure 28: Menu Insert Operator
Independent of the method you use, an AND module should now be added to
network 0001 (figure 29).
Figure 29: Inserted operator
Network 0001 with
dotted rectangle ascursor
If windows with such a colouredbackground appear on the
screen, remember F2!
8/10/2019 Starterset Manual 21gb
30/86
A short ecolog 100plus project as a start
3-8
F2: The key In this place we want to point out a possibility to help you program moreefficiently and avoid typing errors at the same time: the key. When
working with ecolog 100plus you often reach points requesting a selection
between several input possibilities.
You can see an example in Figure 29. ecolog 100plus has entered an ANDoperator here as default setting. The field with the coloured background
(Windows standard setting is blue) signals such an option. Press to open
a dialogue window. Try it, and you will get a list of operators that can be used
here. You can select the requested operator by means of a double-click. This
option saves a lot of typing and also prevents typing errors! In our case the
default setting AND is okay and you should close the window by pressing
(Figure 30).
Figure 30: Help Manager
Forgotten thesettings A common mistake in the early stages is to open a new project and to forget thelibraries and the hardware configuration (page 2-7 and2-11) in the heat of the
work. You will become aware of it when you use the help manager for function
blocks, for example. If you do not find any the reason why is that you have not
linked any library.
Operands Add the operands Aand Bas inputs of the AND operator by replacing ???as
shown inFigure 31.
Figure 31: Add operands
The result of the operation has to be assigned to an operand. This is, for
example, done by clicking on:
Move the bar to the
requested operator
and select it with
doubleclick or OK.
8/10/2019 Starterset Manual 21gb
31/86
The start
3-9
A click to the right of the AND operator symbol generates a cursor (dotted
rectangle) as shown in Figure 31.
Figure 32: Add operand
Figure 33: Operand added
When you leave the input field the system detects that variable C has not yet
been defined and automatically opens a window for the variable declaration
(Figure 34).
Figure 34: Window Variable declaration
The entries in this window can be changed individually. In this case they are
exact. A comment should be added.
You should make it a matter of habit to add many comments. This is takingsome time at the moment. However, you will save a lot of time for
troubleshooting or modification of the program.
This should be acknowledged by pressing . The variable
declaration is now entered in the top part of our module window.
Click on the IM - Ricon and
replace ???by C.
8/10/2019 Starterset Manual 21gb
32/86
A short ecolog 100plus project as a start
3-10
Figure 35: Declared variables
A and Bcould have been defined in the same simple and comfortable way. We
just wanted to demonstrate the different selection possibilities for declarations.
In figure 35 you can also see the syntax for entering comments. They can, of
course, also be subsequently added or modified.
Should the variable declaration window not open, the option Autodeclarationunder Project Options Editorhas to be activated.
Figure 36: Autodeclare
Local In the fields class and type the default settings were simply taken over. We
would just like to point out that the variables in the example were declared
locally. That means that the declaration only applies to this module. If a
variable, e.g. an input, is to be used in several modules it is easier to declare it
as a global variable. Using the selection field type helps to avoid invalid
declarations. During declaration the option Autodeclarealso helps to prevent
syntax errors which may cause confusing error messages in compilation,
especially at the beginning .
This completes our little module.
Activating
FB_AND in
PLC_PRG
The program FB_AND is to be called in PLC_PRG. For this purpose please
activate the window of PLC_PRG (Figure 37) and call menu item Insert'
Function Block(Figure 38).
8/10/2019 Starterset Manual 21gb
33/86
The start
3-11
Figure 37: Enter program call in PLC_PRG
In the dialogue window (the Help Manager) that appears please select the
option User defined Programson the left (Figure 38). Select FB_AND in the
box on the right and . You find the call for FB_AND in network0001 of PLC_PRG.
Figure 38: Added module
And all this just
for anAND?
Of course, an AND operation can also be directly inserted in PLC_PRG. We
have selected the way via the subroutine call in PLC_PRG for an important
reason. We wanted to demonstrate that all modules (in this case module
FB_AND) to be activated directly via PLC_PRG need to be listed there. It istherefore not enough to just create the module (--> The modules of a project
are not calledautomatically!).
1. Open
PLC_PRG
by double-clicking
2. Enter
the
program
call
Function
block
8/10/2019 Starterset Manual 21gb
34/86
A short ecolog 100plus project as a start
3-12
Onlymodule PLC_PRG is automatically processed cyclically.That is why all
other modules have to be activated directly or indirectly by PLC_PRG.
It is not sufficient for the execution of a module that it is entered in the modulelist of the project!
Saving
At first, it will take some time for you to achieve this result. Later you will be able
to program an easy link very fast.
In any case it should become normal to save the result after each work step.
This can be done e.g. via File Save.
Figure 39: Save file
Once the project has been saved for the first time, the window File Save as
opens automatically:
Figure 40: Save file as...
The file will be saved in the directory Projekte (default). It is clearer to save the
files here.
8/10/2019 Starterset Manual 21gb
35/86
The start
3-13
Other languages
And what about
the other
languages?
At this point it would go too far to explain the other languages in more detail.
Still, we want to show you our little program example in Instruction List, in
Structured Text and in Ladder Diagram (Figure 41).
Figure 41: Examples in other languages
The CD contains further program examples giving an overview of the individualprogramming languages. They are described in detail in the manual for the
program development ecolog 100plus saved on the CD as PDF file.
What have we
achieved so
far?
So far we have written two programs (PLC_PRG and FB_AND). The
subroutine FB_AND was entered in PLC_PRG so that P_AND is now also
activated by PLC_PRG.
Program test
How do wecontinue?
Our project has now reached a stage where we can test if it meets ourexpectations. The first program test is normally carried out as follows.
'Online'
'Simulation'
Select the option Onlineand make sure that the simulation mode is active.
This is the case when you see a tick () before Simulation. Should that not be
the case click on Simulation(Figure 42).
8/10/2019 Starterset Manual 21gb
36/86
A short ecolog 100plus project as a start
3-14
Figure 42: Simulation
Online Login Selecting the option Online Login (see Figure 40) or clicking on
compiles the project. If a syntax error is detected, ecolog 100pluswill give you
a message in the Messageswindow and will refuse login. We cannot explain
all possible syntax errors in this place. Double-clicking on the error message
automatically takes you to the faulty line.
Let's assume that the program contains no errors or that all errors have been
corrected. In both cases the system should have logged in correctly.
Online Start Activate the program run by Online Start(seeFigure 42) or press the F5key
or click on
The status line (shown below in the program window) should now show
.
Display the FB_And program on the monitor (double-click on the program
name in the module list on the left in the program window). The program
window should look like Figure 43.
8/10/2019 Starterset Manual 21gb
37/86
The start
3-15
Figure 43: Program active
If the status line cannot be seen at all, activate Project Options Desktop'.
Just click to activate the tick ().
Change
variable values
As shown in Figure 43the values of the three variables A, B andCare FALSE
(OFF). By means of the option Online Write Values' the values can be
changed as follows:
Double-click on FALSE at A and B, and TRUE appears in red as shown in
figure 44. However, these changes are not yet active! They have to be sent to
the (simulated) controller first.
Figure 44: Change values
This is done with option Online Write Values'(Figure 45)or alternatively with
the key combination +. The values of the variables A and B are
now TRUE(ON). This causes variable Cto change from FALSEto TRUE(the
colour in the bottom part of the window changes to blue) as a result of the And
link (see Figure 46).
ONLINE, SIM and RUN
must be active.
8/10/2019 Starterset Manual 21gb
38/86
A short ecolog 100plus project as a start
3-16
The colour changes may be difficult to see on the (monochrome) printout. This
shows that going through this manual does not replace the practical work with
the controller. It is meant to support you. You will get most benefit by putting the
example in practice and trying own ideas.
Figure 45: Write Values
You can test other combinations of A and B in the same way, e.g. Figure 46.
Figure 46: Vary values
VisualisationNow that we have tested the function of the system let's move to visualisation
which will be explained below.
Visualisation with ecolog 100plus
has to be done offline. To be on the safe side
you should try to remember to stop the program processing by before
logging out. Then log out ecolog 100plus
by calling the option Online Logout'
or by clicking on .
8/10/2019 Starterset Manual 21gb
39/86
The start
3-17
Figure 47: Insert visualisation
insert new
visualisation
screen
Upon calling the option Project Add Object... you will be asked to state the
name of the new visualisation image (figure 48). We have chosen the name
AndVis. Once the name has been entered a new empty visualisation screen
appears (see figure 49).
Figure 48: Name visualisation
Figure 49: Visualisation start window
Grid At first a grid is displayed in the default setting. If you do not need it, you can
eliminate it under Extras Settings....
8/10/2019 Starterset Manual 21gb
40/86
A short ecolog 100plus project as a start
3-18
Drawing a
picture
Eight different types of elements can be drawn and animated with the
visualisation. First, we will use the rectangle. The other elements are created
and animated in the same way.
Call the option Insert Rectangle (Figure 50)or click on the button and
draw a rectangle by
placing the cursor on the empty screen
pressing the left mouse key and keeping it pressed
pulling the mouse to the bottom right until a rectangle of the required size
appears
releasing the mouse key.
The result should be similar to Figure 51.
Figure 50: Visualisation Insert Object
Figure 51: Inserted Rectangle
Context: To establish a context between picture element and module variable you need
to define a context between (visualisation) action and (variable) value.
These entries are made in the screen Regular Element Configuration.For
entering variables can be used again. But first, the project needs to be
compiled in order to generate the variable list. For this purpose, call option
'Project' Rebuild all'. In this case, however, it is not necessary since we were
logged in before (page 3-14) and the project is compiled automatically after
login.
8/10/2019 Starterset Manual 21gb
41/86
The start
3-19
Configuring
element
A double-click on your new rectangle opens the window for the configuration of
picture elements in the visualisation (figure 52). For each category there are
input fields describing the picture element. It is not necessary to make an entry
for each field. First select the category Variables.
Figure 52: Variable configuration
To change the colour of the picture element (in this case the rectangle) move
the cursor to the field next to Colour: press to open a screen for selecting
variables (Figure 53). A double-click on the module FB_ANDgenerates a list of
the defined variables (Figure 54). Another double-click on variable Agenerates
a correct variable entry in the field Colour: the window Regular Element
Configuration. The assignment is now complete.
Figure 53: List of variables
A doubleclick on
FB_Andopens a list
of the defined
variables
Under '.'you can
select the global
variablesof the
project
8/10/2019 Starterset Manual 21gb
42/86
A short ecolog 100plus project as a start
3-20
Figure 54: Variables of the POU
F2 The help manager is particularly helpful in this context because it often happens
that only A instead of FB_And.A is entered. Then you will not get the result
described further below, however. In this context we would like to remind youthat A, for example, is a local variable. FB_And.Ameans the variable Ain the
POU FB_And. The assignment is thus clear.
Interaction Interaction between the user and the variables of the system is to happen via
mouse click on the picture element. The state (TRUE/FALSE) of the assigned
variable is to be changed and displayed accordingly (the so-called toggling, see
Figure 55).
Colour change The status of the variables is indicated by the colour of the picture element. This
happens after the following assignment between picture element and variable
value has been made:
colourvariable FALSE
alarm colourvariable TRUE
Activate
interaction
Click on category Input:
To allow the user to change the variable value, click Toggle Variable in the
category Input and enter again FB_And.A.
Figure 55: Input Toggle Variable
Colour Select screen Regular Element Configuration and click on Colour.
8/10/2019 Starterset Manual 21gb
43/86
The start
3-21
Figure 56: Regular Element Configuration Colour
Click on to open the colour selection screen in the category
Colours. Select a colour by clicking and confirm with As this is the
colour for the FALSE state of the variable, we have selected grey for our
example.
Repeat this process for and, if requested, for the frame of the
element . We have selected the colour green for the Alarm Colour
Inside (TRUE state). However, as is usually the case with colours, this, of
course, always a matter of taste and discussion.
Figure 57: Colour selection
Text To give our rectangle a name, please enter the letter A in the field Text. Thisdesignation is entered in the centre of the element.
The window Regular Element Configuration should now look like Figure 58. If
this is the case, please close by pressing
8/10/2019 Starterset Manual 21gb
44/86
A short ecolog 100plus project as a start
3-22
Figure 58: Regular Element Configuration
VariableB (a
simple copy)
We now want to create another picture element for variable Bthat should look
like the one for variable A. The option Merge/Insertwill be helpful. To do so:
Click on element A
Click on
A copyof the element (with settings) is made (in the temporary storage)
Click on
The copy is inserted in the picture above the original.
Move the cursor on the new element A, press the left mouse key, drag the
element to the requested position and release the mouse key (see figure 59
and figure 60).
Figure 59: Merge Element
When the element A ismarked, click on the Merge
icon and then on the Insert
icon. Then click on the copy
and drag it to the new
position.
8/10/2019 Starterset Manual 21gb
45/86
The start
3-23
Figure 60: Element merged and pasted
Now configure the second element:
Call up the element configuration with a double-click,
replace Aby Bfor variables, input and text and
acknowledge the entry with .
The element for variable Bhas been successfully inserted.
Variable C Copy the element of variable Aagain for the presentation of variable C. Change
the configuration of the new element as follows:
Shape : ellipse
Input : no input
Colours/Alarm Colour/Inside : redVariables/Colour Change : FB_AND.C
Text : C
Whichever way you have taken - the configuration window should look likeFigure 61.
Figure 61: Configuration Element C
The visualisation window should at least resemble Figure 62 (artistic license
granted).
Doubleclick to set the
new configuration
8/10/2019 Starterset Manual 21gb
46/86
A short ecolog 100plus project as a start
3-24
Figure 62: Finished visualisation
Working with
the
visualisation
We can now test the newly created visualisation picture. Log in ecolog 100plus
and start the program. Proceed as described before. The following points will
serve as a reminder:
Online Simulation ( shows that the simulation is active)
Online Login
Online Start
First click on rectangle Ain the visualisation, then on rectangle B. The colours
of the two rectangles should change to green (or to another colour, should you
have used your artistic licence). The green colour shows that the variables now
have the state TRUEin the program.
If you now watch the colour of the ellipse of variable Cyou will see the result of
the programmed link the colour of the element changes to red (or to what your
artistic license has defined). The red colour corresponds to the value TRUEof
variable Cas a result of the AND operation (C=A AND B).
By clicking on the rectangles you can set the different plant states and watch
the reaction of the program (see Figure 63 and Figure 64).
8/10/2019 Starterset Manual 21gb
47/86
The start
3-25
Figure 63: Visualisation state 1
Figure 64: Visualisation state 2
And now Save To save your project, use the option File' Save as...(see Figure 40).
Figure 65: Window Save As...
Here you enter the name of the project in the field for the file name as is
common in Windows. The file name must have the extension .pro, so replace
* by e.g. Easyand and acknowledge with .
8/10/2019 Starterset Manual 21gb
48/86
A short ecolog 100plus project as a start
3-26
When the correct option is activated (Project Options Ask for Project
Info'), a dialogue window for project information is shown automatically before
saving (figure 66).
Figure 66: Project information
You can fill it in (or leave it).
We strongly recommend to make abundant use of the various possibilities to
document the project.
Your complete project including the visualisation is now saved in the file
Easyand.pro!
A simple Save' instead of Save as...would have been sufficient. We have
described the process in detail in case that, in the heat of the work, you have
forgotten to save before (see Figure 39).
But now it's time for a break and we will leave the programming system for the
time being.
For this purpose stop the program ('Online' 'Stop') (see page 3-16), then log
out ('Online' 'Logout'). Then use the option File' Exit' or the key combination
+ to close the program ecolog 100plus
.
We hope that this quick introduction has given you a little overview of ecolog
100plus
making you curious to find out more about the other possibilities of the
system. The following chapters will consolidate your knowledge and very
quickly turn you into an ecolog 100plusexpert!
8/10/2019 Starterset Manual 21gb
49/86
The start
3-27
3.3 Online Test
We now want to load the same program into the controller and test it there.
Copy project Of course, we have to modify the first project Easyandfor the on-line test. For
this purpose we will first create a copy with the name ANDOL (online) withSave as...'as described above.
Preparations
Simulator We will now work with the physical hardware. You will need to define the input
states and watch the reaction of the outputs. That is what we use the EC 2014
simulator for. It can be used directly for testing simple program functions. A
different simulator box is used for the starter set.
Forcing
Besides the manual preset of input states, e.g. on the simulator box, it is alsopossible to force the states in the controller. This means that e.g. the state of an
input is defined without any consideration of the actual state. When playing with
the software without any inputs and outputs connected there is, however, no
difference to the off-line program test in the simulation mode. In practice this
function is more useful to the skilled user for debugging. The user should be
skilled because forcing might start unintended processes when the controller is
connected to the peripheral equipment. If you use this function you should know
exactly the kind of damage that might be caused by a possible avoidance of
safety scans in the program.
Starter set When working with the starter set the following section can be skipped. It
concerns the simulator EC 2014.
Familiarise yourself with the accessories of the simulator. It consists of:
EC 2022
EC 2023
EC 2014
Adapter RS 232
Adapter
a digital box with 6 switches to simulate digital inputs (2 pieces).
an analogue box with 6 pots to simulate analogue inputs.
the actual simulator. The plug on its cable is a special version. An additional
socket is brought out of it which permits the connection of another CAN
component.
an adapter, e.g. to connect the PC.
We do not need the second adapter right now.
To be connected to the simulator (see also the installation instructions of the
simulator supplied):
Supply voltage
The 24 V power supply is to be ordered separately. It is to be connected to the
terminals of the multi-way connector strip marked VBBand GND.
http://www.ifm-electronic.com/ifmde/web/dsfs!EC2014.htmlhttp://www.ifm-electronic.com/ifmde/web/dsfs!EC2014.htmlhttp://www.ifm-electronic.com/ifmde/web/dsfs!EC2014.htmlhttp://www.ifm-electronic.com/ifmde/web/dsfs!EC2022.htmlhttp://www.ifm-electronic.com/ifmde/web/dsfs!EC2023.htmlhttp://www.ifm-electronic.com/ifmde/web/dsfs!EC2023.htmlhttp://www.ifm-electronic.com/ifmde/web/dsfs!EC2022.htmlhttp://www.ifm-electronic.com/ifmde/web/dsfs!EC2022.htmlhttp://www.ifm-electronic.com/ifmde/web/dsfs!EC2014.htmlhttp://www.ifm-electronic.com/ifmde/web/dsfs!EC2014.html8/10/2019 Starterset Manual 21gb
50/86
Online Test
3-28
Controller ecomat R 360, CR 2500 (or CR0020,...)
The connecting cable is firmly connected with the simulator. On the controller
side it has a 55-pin connector used in mobile controllers to ensure the high
protection rating.
Control box
To test easy program functions it is sufficient to connect the control box
designated 0 5 to the socket designated 00 05. In addition to another control
box an analogue box to simulate analogue input signals is also supplied with
the simulator.
PC
The connection is made via the supplied cable. It has a 9-pole socket on the
side of the PC. If the PC has COM2 as a 25-pole connector, an additional
adapter is required. It has a multi-way connector strip on the side of the
simulator. The corresponding location on the simulator is marked RS 232/RxD
and RS 232/TxD. Above it there is the marking CANH and CANL to point out
that the CAN bus can be connected to the unassigned terminals.
A power supply is integrated in the control panel used during the trainings. As
long as you work with the simulator, the supply voltage can be taken via the
CAN connection because the supply voltage is on the same potential in the
whole (simulator) system.
Operating system
In principle, the steps for loading the operating system must be executed only
once. When the system is delivered, no operating system is stored in thecontroller. It must be loaded only once. The procedure must only be repeated
(again only once) when a new version of the operating system is required. This
shows how flexible the control system is. For a PC for example the installation
of a new BIOS required the exchange of an EPROM. This is only successful if
hardware compatibility was checked thoroughly. This has only changed for the
current version. For the ecomat R 360 only the software has had to be loaded.
For the controller in the starter kit the operating system CR02500_N.H86 (and
the first test program) has already been loaded.
If you have to load another operating system version or if you want to load an
operating system into a new controller, use the program downloader. This
program is on the CD "Software, tools and documentation" and can be installed
via the installation platform. Here you will also find the description of the
downloader.
If you have not prepared this step, the downloader will now have to be installed.
Start the set-up as described in 2.2,Figure 1 to Figure 3. By clicking ecolog
downloader Figure 67 will take the place of Figure 3.
.
8/10/2019 Starterset Manual 21gb
51/86
The start
3-29
Figure 67: Downloader set-up
For detailed information see Description tab.
Continue After successful installation the downloader can be started.
Figure 68: Downloader StartA first test of the correct communication is clicking Get Identity.
8/10/2019 Starterset Manual 21gb
52/86
Online Test
3-30
Figure 69: Get Identity
If there is already an operating system on the controller, its version number is
displayed. This ensures that the communication works reliably.
Hex-File Click on Open File and change to the directory C:\Program Files\ifm
electronic\ecop_21e\Lib\Cr0015_Q. Mark the file Cr0015_Q.h86.
Figure 70: Open downloader file
After clicking Openthe name of the file is shown in the title line.
Figure 71: Downloader with open file
Now the operating system can be loaded. Here there is a brief overview of the
downloader. If you want to continue working right away, skip this paragraph. For
detailed information about the downloader see Documentation on the CD.
Using the downloader ensures, e.g.:
8/10/2019 Starterset Manual 21gb
53/86
The start
3-31
- to load the operating system in the controller (which happens in the next step)
- to read the program file from the controller
- to write the program file in the controller
- to save data from the controller
To be more precise, the program file is read as a Hex file. This depends on the
fact that the entire file for the project, the source file, with visualisation,
assignments, declarations, comments, etc. is stored on the hard disk of the PC.
The compiled program file is then loaded into the controller as a hex file. After
reading, this file can virtually not be edited. Reading would make sense, e.g., if
you want to transfer a program from one controller to another and the source
file is not accessible. The other functions are self-explanatory.
The file needed has been opened in the downloader. The only thing that
remains to be done is to click on Download(Figure 71)and to wait until the
process is completed.
Interface If you receive an error message while the connection between the PC and the
controller is established (figure 72 or figure 69 instead), you should check if:
the correct controller is switched on or
the correct interface is set up.
E.g.
Figure 72: Communication error
Click on 'Interface parameter'in the menu bar (Figure 71).
Figure73: Downloader Interface Parameter
In this case the COM port is set to Com2. Change this setting as required. The
other settings are usually not changed.
The downloader is a powerful tool which, however, requires more experience
and background knowledge to make full use of its possibilities.
8/10/2019 Starterset Manual 21gb
54/86
Online Test
3-32
Figure74: Downloader Break of Endless Loop
In this context we do not want to describe all possibilities but only give an
important example. It is possible that the controller gets into an uncertain state.
This hardly ever happens in standard operation but e.g. if a fault occurs while
the program is being loaded. The proven measure of resetting, switching off and
switching on again can help. If necessary, the operating system will have to be
loaded again. In any case the connection to the controller can be made. If,
however, an endless loop caused by a fault in the program occurs, this case is
more critical. This can also happen to an experienced programmer, if for
example a forward jump turns into a backward jump when networks are shifted
in the FBD. In this case a reset will not help because the program gets into the
loop again after restart. The relevant function of the downloader (Figure74)will
solve this problem.
Now the usual process of programming should be continued. The downloader is
terminated and we will return to ecolog 100plus.
Program test online
In the following text we will start to gradually leave out the description of the
intermediate steps. When working with ecolog 100plus a lot will (hopefully)
become routine. You can focus on the important points, the process to be
controlled, and it will not take a long time to find what you need in the menu
items. However, should a problem come up you can find the solution in thestep-by-step instructions above.
Login First of all the connection to the controller is established by Online Login or
. You will get the message to download the program (simulation mode off).
Figure 75: Message Download Program
8/10/2019 Starterset Manual 21gb
55/86
The start
3-33
Compilation is only started when the program has been changed. As you have
already started the function Login before, the program file for the controller is
already there and does not need to be generated again.
If no program had been loaded into the controller before, you will receive a
message that is slightly different from figure 75. If, however, there is already a
program in the memory of the controller, it will be overwritten by the new one
and thus it is lost if the source program is no longer available.
Before overwriting the loaded program you can, if required, save it with the
independent DOWNLOAD program. You can, of course, only save the program
file of the controller, the source program is not saved in the controller. The
program file has been saved, but cannot be edited (see page 3-33).
The message can now be acknowledged with .
Start program When the program has been loaded in the controller, program processing has
to be started. The line at the bottom, the status line, reads (after starting):
Figure76: Status line
When the program runs it can be tested as before.
Assignment At first you cannot see any difference to the simulation mode. But the simulator
has not even been used yet! The state of the inputs does not influence the
state of the variables A, Band C! This would not be possible anyhow since no
assignment has been made. In our example it would make sense to assign A
and Bto the inputs and Cto an output.
But how can the controller start processing the program without this
assignment? A, Band Cwere declared as BOOL. This is a declaration for bits
that are not assigned to any input or output. In a PLC such bits are a useful tool.
They are markers (flags). That means that the program is only processed in the
marker range. It is also possible to assign a defined address to a marker. If this
assignment is not made by the programmer it is done automatically by the
program. In many cases it is of no importance which marker address is used.
So the project still needs some modification before it can be tested with the
simulator.
Declarations To demonstrate the process again, we will simply delete the declarations using
the common editing functions: Mark and Delete. The new declarations are
entered automatically so that the blank lines can also be deleted.
8/10/2019 Starterset Manual 21gb
56/86
Online Test
3-34
Figure 77: Edit declarations
Once again If variable A is entered again in FB_AND(PRG-FBD) of the ANDfunction, the
declaration window will open again (if the Autodeclarationoption is active). A
can now be assigned to a physical address.
Figure 78: Declaration of an input
Local or global? The class VARis left unchanged. Thus the variable is declared to be local, as
stated above. If this input is used in several POUs, it may be easier to declare it
to be global (class VAR_GLOBAL). The advantage is that it only has to be
declared once. The disadvantage is that it does not appear on the list of
variables of the POU during the program test (see Figure 43): The separate
window Global Variableshas to be opened. To do so, click on the Resources
tab in the navigation bar (see Figure 15) and then the window is opened by
double-clicking on Global_Variables.
Below or above will open:
Figure 79: Global variables
For a correct assignment it is necessary to observe the correct spelling very
carefully. This will be briefly described below. Please refer to the hardware
documentation to find out which addresses are available and which of these are
binary or analogue inputs or outputs.
8/10/2019 Starterset Manual 21gb
57/86
The start
3-35
Syntax of
declarations
Figure 80: Syntax of declarations
The first input is assigned to address %IX0.08. Finish the input with
and the following entry will appear in the declaration window:
Figure 81: Entered declaration
AT Note the key word ATwhich stands for the actual assignment.
The assignment of the inputs results from the location of the control box (see
labelling of the simulator). Band Care declared accordingly, Cof course as an
output (%IX0.8 and %QX0.0).
The visualisation also needs to be adapted. Above the window Regular Element
Configuration was opened by double-clicking the object designated A. In Input
the function: Toggle Variablewas selected.However, this does not make sense
any longer. It is the real states that are to be displayed. Therefore the tick is
removed in Input for A, B (see Figure 69), for C it should not have been
possible before to make an entry.
The project has now been modified for testing in the controller.
Before the online test, you should check if controller and simulator are ready.
Login The program is then compiled again via menu item Online Login' or
(compilation is started automatically after a modification) and loaded in the
controller ('Online' 'Simulation'not active!).
%IX0.08depending on the
controller configuration
Length
X: 1 bit (BOOL)
B: 8 bits (BYTE)
W: 16 bits (WORD)
D: 32 bits (DOUBLE WORD)
Mark for physical
address
Type
I: input
Q: output
M: marker
8/10/2019 Starterset Manual 21gb
58/86
Online Test
3-36
Figure 82: Error message
The example shows the error message that will appear if you forget to declare
C. This also results in the warning that a non-declared variable is used in the
visualisation. In Figure 82the window for messages was already enlarged. By
double-clicking on the error message the POU in which the error has occurred
will open.
If the tick is removed from Messages in the menu Window(simply click on
it), the window will be closed.
After Chas been declared, the declaration window should show the following:
Figure 83: Declarations complete
After a new login the message is displayed again if the program has to be
loaded (Figure 75).
Acknowledge with and the program is downloaded.
A look at the status line reminds us that the program needs to be started.
Online The declaration part shows the current status. In addition, the function AND
simplifies the checking of the state of the variables by showing them in different
colours depending on their status. The presentation on the monitor, in ANDand
in the visualisation, should show no change of the simulation.
The difference is that we do not work with markers any longer which change
their state via mouse click, but with the physical inputs and outputs. The state of
the inputs is defined by switching the simulator box.
The following text can be skipped, when you use the Starter set. Continuereading the chapter Sampling Trace on page 3-38.
When you use other hardware versions, e. g. CR 0020, please refer to the data
sheet if there is used a relay.
8/10/2019 Starterset Manual 21gb
59/86
The start
3-37
Output So the program should now be processed as in the simulation. The state of the
inputs can now also be verified on the simulator. At the same time it is
noticeable that the state of the output changes according to the state of the
inputs in AND as well as in the visualisation (see above for the description of
how to activate it). However, it does not change on the simulator. Why is thatso?
In this context we have to remind you of the monitoring concept, see system
manual. There it is described that the RELAY bit has to be set so that the
outputs are not only switched internally like markers but also externally.
RELAY For the time being, this bit will not be further processed by the program in this
simple example. It can be easily used as the first program network. Before the
first network a new program network is created by Insert Network (before)in
the window PLC_PRG. The content reads:
TRUE RELAIS
Figure 84: Set relay
The name and the assignment to a marker address are predefined. This
information is given in the window PLC Configuration. In the Help Manager
(F2) you will find the variable as system variable.
Program test After login during which the changed program is compiled again the program
has to be restarted. The relay should now energise with a perceivable click. You
can now also see on the simulator that the output is switched.
8/10/2019 Starterset Manual 21gb
60/86
Online Test
3-38
Sampling Trace
For a program test it is very useful that the current states of the variables are
displayed. But there are limits. If you, for example, want to simultaneously
monitor several variables defined in different windows it is not always possible
to change the windows fast enough. For this purpose you can enter differentvariables in a special window, the Watch Window. This happens via
Resources Watch- and Receipt Manager. We will not go into any further
details. You can find a detailed description in the Manual for the Program
Development.
Trace Tool It is a matter of luck (even in the Watch window) to detect e.g. short input
pulses on the monitor. In many cases it would be of advantage if the variables
were shown in a timing diagram, like on an oscilloscope. ecolog 100plus provides
this possibility.It is called Sampling Trace. Since it is an important tool we will
give you a brief example.
Sampling Trace The states of A, B and C are to be sampled. To do so click on SamplingTracein the window Resources.
Figure85: Sampling Trace
The window Sampling Trace opens.
Figure 86: Sampling Trace new
8/10/2019 Starterset Manual 21gb
61/86
The start
3-39
Trace
configuration
You find the other functions via the context-sensitive menu Extras. First, we
define the variables to be monitored. This is done via Extras Trace
configuration.
Figure 87: Trace configurationIn this window you enter the variables (maximum 8) the values of which are to
be sampled. Before doing so we will briefly explain the fields of the window.
Figure 88: Window Trace Configuration
8/10/2019 Starterset Manual 21gb
62/86
Online Test
3-40
How does it
work?
Let us first explain the background. Max. 500 values of each Trace Variable
can be saved. When the memory is full, sampling starts again from the
beginning. The oldest values are overwritten. If you e.g. want to evaluate the
Sampling Trace in peace, you have to stop it so that the values are not
overwritten. That can be done manually, via the menu, or automatically bymeans of the Trigger Variable. If you enter Ahere, for example, the next 50%
of the values will be sampled after A has changed its state from 0 to 1.
Sampling would then be stopped.
In the example the Trigger Variable is not used. The field remains empty. That's
the way it should be. But:
In an earlier version of the software this field should not have been empty for
the option Trace Auto Read. Just enter a variable that does not change. The
variable RELAY (see above) is a good choice. In the following version this little
flaw was eliminated.
Scanningfrequency The scanning frequency can be selected in multiples of 10 ms. The defaultvalue 0 means scanning in each cycle. Since the cycle time is in the ms range
for the short program, this would be much too fast. Here a scanning frequency
of 100 ms has been selected.
Trace variables To enter the Trace variables in the list, enter them in the bottom field first. Use
. Double-click on P_AND. and A, B and C are displayed. They are
selected and entered in the list. Since they were defined in the module P_AND,
the module name, separated by a dot, is used as a prefix.
Figure 89: Help Manager Trace Variables
finishes the configuration.
Assignment The window Sampling Traceis empty. The variables now have to be assigned
the colours with which their state is shown. Click on next to the field below
Var 0and the variables that can be selected are shown. Click on FB_AND.A
and Var 0 is assigned to variable A. Do the same to enter FB_AND.B and
FB_AND.C.
8/10/2019 Starterset Manual 21gb
63/86
The start
3-41
Figure 90: Assignment Trace Variables
Start Trace To be able to monitor the state of the variables, establish the connection to the
controller via Online Login'or .
The trace is sampled in the controller as communication is too slow to save all
values in the PC. The Trace Configurationtherefore has to be downloaded in
the controller.
After the program has been started, the Trace configuration has to be
downloaded into the controller and activated with Extras Start Trace.
At first, you see nothing. Sampling is started in the controller, but you first have
to give the instruction to transfer the contents of the Trace Bufferto the display.
For this purpose use menu item Extras Read Trace . A kind of snapshot is
loaded. It is more interesting to have a dynamic presentation of the state by
means of Extras' 'Auto Read'.
It is worthwhile to have a quiet look at all the possibilities of the sampling trace.
This tool is very powerful. You can say: ecolog 100plus
saves the oscilloscope.
And during the normal hectic during set-up you might lose too much time if you
are not really familiar with the sampling trace.
Buttons When working with the sampling trace some (context sensitive) buttons appear
which help you speed up your work. These buttons are described in the
appendix.
Examples:
8/10/2019 Starterset Manual 21gb
64/86
Online Test
3-42
Figure 91: Sampling Trace 1
Figure 92: Sampling Trace 2
8/10/2019 Starterset Manual 21gb
65/86
The start
3-43
Figure 93: Sampling Trace 3
In this short introduction we cannot describe all functions such as saving
sampling trace in detail. We refer you to the manual for program development.
Just one quick note on the sampling trace:
If the signals have such a high frequency that the sampling trace is difficult to
read (e.g. figure 92), the presentation can be stretched via Extras Stretch.
Documentation
A complete project also requires, of course, some documentation. Again, pleaserefer to our manual for the program development. Below we will only show
some examples.
Documenting In the menu Projectyou will find e.g. the item Document'.
8/10/2019 Starterset Manual 21gb
66/86
Online Test
3-44
Figure 94: Document Project
Click on this item, and a window opens:
Figure 95: Window Document Project
Here you can select what is to be documented. You can also select several
components using the standard marking functions.
8/10/2019 Starterset Manual 21gb
67/86
The start
3-45
Figure 96: Selection of modules for documentation
The following points will only be described briefly, not in detail.
Documentation
Set-up
If you don't like the form of documentation you can click on e.g. File' Printer
Setup....
Figure 97: Documentation Setup
You will find that you can load predefined formats.
Figure 98: Selection of formats for the documentation
8/10/2019 Starterset Manual 21gb
68/86
Online Test
3-46
In order to modify the file in which the parameters of the frame, as it is called in
ecolog 100plus
, are saved, click on Edit.... The settings can be made in the
window which is opening.
Figure 99: Options for setting up the documentation
And just to remind you of what we have already mentioned for sampling Trace:
We recommend that you familiarise yourself with all these options calmly. To
create a documentation under time pressure, when the project should already
be finished, will probably not lead to the optimum results.
8/10/2019 Starterset Manual 21gb
69/86
4-1
4 Exercises
4.1 Logic functionsIn the brief introduction of chapter 3 only a simple logic function (AND) was
used as an example. Those who have studied this chapter should not have any
problems to set up other logic functions or networks from linked logic functions
without any help. This will not be described in detail here. Some exercises
should help you become more familiar with the subject. For some short hints for
the solution see the annex.
Program structure
Some brief remarks should help to clearly structure the programs. Experience
has shown that even experienced programmers do not understand their own
program any more after some weeks. The meaning of a good structure
becomes particularly evident if some people work on partial programs or if
several people are to make modifications. In such cases it is necessary to make
exact agreements and to set up rules how the program is to be structured. Even
though this takes quite some time in the beginning and seems to be quite
complex, it will become clear during the first search for errors at the latest, that
this time was a good investment.
Documentation Besides the item structure which is being dealt with in detail below, we also
want to remind you that detailed and clear comments are always helpful.
Program
structure
There is not THE ideal program structure so that you can simply give an
example solution which can serve for orientation. Therefore you will find below
tips which should be seen as suggestions.
Networks It is confusing to have one network for each link. In principle you can assign a
marker to the result of a link and to further link this marker in the next network.
Then it is pretty tiring to pursue the effects of the change of a bit in the first
network via many other networks.
Vice versa it is also confusing when there are many links in one network. This is
in particular the case if lateral scrolling is necessary because the chain of links
is too long. Then the process described above is of advantage.
As is often the case it is a matter of finding a good compromise between these
extremes.
8/10/2019 Starterset Manual 21gb
70/86
Logic functions
4-2
S/R It helps to set up the program in a clear way if you regularly use the self-hold
function. This does not have to be done for each auxiliary marker. The author
prefers a program structure that has two networks for each output. At the end of
one of them you find SET OUTPUT, at the end of the other one RESET
OUTPUT. This structure has the following advantages:
Division It is mostly very different conditions with which the output is switched ON or
OFF. In complex situations this easily causes conflicts. The division described
above divides the problem into two partial problems each of which when
looked at separately can be easily handled.
Trouble-
shooting
Troubleshooting during program creation or during operation is made easier.
Only two cases are possible:
one output becomes active although it should not (hopefully a rare case
because it is dangerous)
one output does not become active although it should.
In either case the structure described will help to quickly find the cause.
Priority The priority is also easily defined. An alarm lamp should for example be
protected against unauthorised switching off; a drive, however, should not start
running once the limit position has been reached. The sequence of the two
networks defines the priority.
Consequence If you decide for the function block diagram which is often the case you
should stick to it consistently. You have to bear in mind: The sequence of the
networks has nothing to do with the chronological sequence of the process. An
example for illustration:
Example -
conveyor
A conveyor transports a workpiece for processing. After processing the
conveyor transports the workpiece further on. Often the program is structured
as follows:
1 (or several) network(s) conveyor
1 (or several) network(s) processing
1 (or several) network(s) conveyor
This is confusing. This structure can cause many errors when there are several
processing stations. This structure is OK for the sequential flow chart. The
function block diagram does usually not reflect the chronological sequence of
the process. If the conveyor starts twice it does not have to be started in twonetworks. In the interest of the switching logic this only means that in one of the
networks there is an OR function with two conditions for starting the conveyor.
Apart from that more interlocks and safety scans are, of course, implemented
by other links.
You will get a clear program structure if you set up the network from the back,
i.e. from the output.
8/10/2019 Starterset Manual 21gb
71/86
86 Exercises
4-3
Figure100: Example program structure
The following example shows an error that occurs frequently.
Example 1! Error!
Q and I are meant to stand for output and input. Study the following example:
Figure101: Example of a program errorWhat is the reaction of the output?
Here other operators such as an AND
operator for safety scans can be
inserted.
Here other
conditions and