Zenon First - Steps
Zenon First - Steps
First steps
v.7.00
1
© 2012 Ing. Punzenberger COPA-DATA GmbH
Distribution and/or reproduction of this document or parts thereof in any form are permitted solely
with the written permission of the company COPA-DATA. The technical data contained herein has been
provided solely for informational purposes and is not legally binding. Subject to change, technical or
otherwise.
Contents
4. Variables ..................................................................................................................................... 9
4.1 Drivers ......................................................................................................................................................... 9
4.2 Data types ................................................................................................................................................. 11
4.2.1 Creating a new simple data type ................................................................................................ 11
4.2.2 Creating a new structure datatype ............................................................................................. 13
4.3 Variables.................................................................................................................................................... 15
4.3.1 Creating a new simple variable .................................................................................................. 16
4.3.2 Creating a new structure variable .............................................................................................. 18
3
Welcome to COPA-DATA help
GENERAL HELP
If you miss any information in this help chapter or have any suggestions for additions, please feel free to
contact us via e-mail: documentation@copadata.com (mailto:documentation@copadata.com).
PROJECT SUPPORT
If you have concrete questions relating to your project, please feel free to contact the support team via
e-mail: support@copadata.com (mailto:support@copadata.com)
If you realize that you need additional licenses or modules, please feel free to contact the sales team via
e-mail: sales@copadata.com (mailto:sales@copadata.com)
2. First steps
Welcome and thank you for choosing zenon. We want to make the introduction to the use of zenon as
simple and pleasant as possible. The first step in this direction is made with this tutorial. Nevertheless,
an introducing tutorial cannot replace proper training.
This tutorial will introduce you to the basic operation of zenon. You will learn here how to create a
project and how to draw screens, which display the values from your PLC in dynamic elements.
4
A new project
3. A new project
In this step, you will learn what workspaces and projects are. We will create a workspace and, within
that, an example project.
Info
We recommend to create a new subdirectory for each new workspace. This makes sure
that all important files are in one directory.
Enter C:\ as path an then enter the name ‘EXAMPLE’ for the workspace. If it does not exist, the
directory C:\EXAMPLE is created after confirming the entries of the dialogbox with OK and the file
EXAMPLE.WSP6 is written into the directory.
The directory name and the name of the workspace file are generated automatically by zenon but they
can be changed later.
5
A new project
Enter the project name ‘PROJECT1’ and accept the default path.
Info
If VBA is activated in your Editor (default setting), the selection dialog for executing a
wizard will open now. Wizards are VBA macros, with which you can automate the work
in the Editor. In this example we will not use a wizard, so we close the dialog with
Cancel.
In the detail view you now see a list of the projects belonging to this workspace.
6
A new project
We will use this properties window rather often in this training. Generally, it shows the properties of the
object, which is selected in the detail view of the project manager. The icons on the top border of the
property windows allow you to show the properties in different views:
7
A new project
Symbol Meaning
Grouped The properties are combined into logical groups.
Show/hide favorites In the favorites, you can put together the most frequently used properties by
using the context menu of the property window. Here, you can show or hide
the favorites.
Show/hide all If the favorites are shown, you can hide all other properties with this symbol
properties for a better overview.
Sorted logically With this icon, the displayed properties are sorted according to their logical
connectedness.
Sort ascending With this icon, the displayed properties are sorted in alphabetically
ascending order.
Sort descending With this icon, the displayed properties are sorted in alphabetically
descending order.
Expand all By clicking on the '+' on the left border of the property window, you can
open a closed node. This icon automatically expands all closed nodes.
Reduce all By clicking on the '-' on the left border of the property window, you can
close an expanded node. This icon automatically closes all expanded nodes.
Display properties A window with the description of the selected property is displayed. To close
help the help window, click on the X on the top right-hand corner of the window.
Info
With the context menu of the properties window you can define which properties should
be displayed in the favorites.
RUNTIME VIEW
8
Variables
4. Variables
In this step, you will learn how zenon connects to a process and how it receives values from the PLC.
For that, we are going to create a driver and then define variables for this driver.
4.1 Drivers
To communicate with a data source (PLC field bus, etc.) it is necessary to connect to a driver. Depending
on the needs of the project, the necessary drivers (depending on the PLC) and their process variables
have to be created.
Activate the context menu of the entry Drivers with the right mouse button.
9
Variables
Scroll down in the list of Available drivers until you reach the folder Siemens.
Choose the driver S7 TCP-IP. The entry is put in the field Driver name as shown in the dialog box
Definition of driver. Close the dialog by confirming the selection with OK.
All other tabs of this dialog are driver-specific, i.e. different according to the chosen driver. As we do not
have a PLC at the moment, we do not have to regard these settings in this example.
10
Variables
Generally speaking, data types are independent of the driver. But not all drivers support object types of
all data types. When you are asked to select a data type, only the data types supported by your driver
will be available.
In addition to the pre-defined data types, you can create your own data types. Two possibilities are
available here: Simple data types and structure data types.
In this step, you will learn how to create simple and structure datatypes.
Activate the context menu of the entry Datatypes with the right mouse button.
11
Variables
In the property window, the properties of the data type Temperature sensor are now displayed
and we can make all the necessary changes.
Change the properties Unit, Decimals, Linear value adjustment and Value range PLC of the
datatype as shown in the illustration above.
Value range PLC digital value from the temperature sensor, in this case 16 bit resolution in the
PLC
Value adjustment linear analog value from temperature sensort, according to our setting, this
corresponds to Min. 0,00 ºC / Max. 655,35 ºC in the project.
12
Variables
Example
Create three more limits for the datatype Temperature sensor:
Limit 2: 100; MIN; dark blue; no alarm
Limit 3: 400; MAX; dark red; no alarm
Limit 4: 500; MAX; light red; alarm
13
Variables
Activate the context menu of the entry Datatypes with the right mouse button.
Select USINT as the basic datatype. The data type should be embedded.
If a basic data type is embedded in a structure data type, the properties of that data type can be
changed in the structure element independently from the basic data type.
14
Variables
After finishing the structure element the structure data type is available in the list.
Now we will create further structure elements for this data type.
Activate the context menu of the structure data type "Motor" with the right mouse button.
Example
Create another structure element for the structure datatype Motor:
4.3 Variables
A process variable is the interface between the data source (PLC, field bus, etc.) and zenon. For correct
detection and open-loop/closed control of a process, it is necessary to have an exchange of process data
on the one hand and the input of setpoint values and commands on the other hand. Process data and
settings are defined for single process variables and the parameters are entered and changed in the
variable list.
In this step, you will learn how to create single variables and variable arrays, which are based on simple
or structure data types.
Info
Many zenon drivers allow the import of variables from the PLC program or directly from
the PLC, which means that you do not have to create the variables manually. You will find
the necessary information for the variable import in the according driver documentation.
Because we have neither a PLC nor an S7 project in our example project, we will create the variables
manually.
15
Variables
In the project manager, activate the context menu of the entry Variables by a right click.
16
Variables
As we changed the array dimensions, not only one but four variables have been created. With our
settings, these variables automatically get their addresses, i.e. we only have to define a start
offset. zenon calculates the remaining addresses automatically.
In the section Addressing set the property Start offset to the value 11.
This results in the following addresses:
Temp[1,1] Offset 11
Temp[1.2] Offset 13
Temp[2.1] Offset 15
Temp[2.2] Offset 17
The property last used offset accordingly reads: 18/7 (Offset 18 / Bit 7).
The variable list in the detail view of the project manager now should have the following entries.
Info
Always use logical names for the process variables in order to keep a better overview.
17
Variables
Leave the options 'Each data type starts with new offset' and 'Activate all elements' as proposed
by the default.
18
Screens and functions
Your variable list in the detail view of the project manager should look like the illustration below:
5.1 Frames
A frame has to be created before we can draw our first screen. Every screen is based on a frame.
A frame is the basis for the window technique. This is where general settings are made, like:
19
Screens and functions
Functions can especially refer to one frame (Alarms: Ackn. flashing, Hardcopy, etc.)
screens rarely have to be closed by hand, as there can only be one screen of a frame open at a time.
Info
Always create at least two frames.
1 frame for preocess screens
1 frame for button bars
Open the node screens in the Project Manager and select the entry Frames.
With Frame new in the context menu you create a new frame.
A frame with the name Frame_0 is automatically created. You can change the properties of the frame in
the property window.
20
Screens and functions
The size of the frame is set to the current screen resolution by default. We now change these settings,
so that some space is left over on the top and on the bottom of the screen. We need the space at the
top for the status line and the one at the bottom for creating a button bar later. For our example, we
use a screen resolution of 1024*768.
Example
Create a frame with the name Button Bar for the button bars. The size of the frame
should range from left/top 0/700 to right/bottom 1024/768.
5.2 Screens
A screen is a window with special predefined properties. Each screen has to be based on a frame.
21
Screens and functions
Info
Nevertheless, you can create a screen in a new project without having created a
frame before.
In this case however zenon automatically creates a frame with the default settings in the
background.
With Screen new in the context menu you create a new screen.
A screen with the name Screen 0 will be created. You can change the properties of the screen in the
property window.
In the section General enter the screen name Start Pic and take care that the screen has the
Screen type Standard.
In the section Frame make sure, that the screen is linked to the frame Process screen.
Open this new screen with a doubleclick on the screen name in the detail view of the project
manager or by opening the context menu with a right-click and selecting the entry Open screen.
Info
As this is the first screen that we have saved, the screen name will be added
automatically to the project properties under the property Start pic in the group
Graphical design.
22
Screens and functions
Example
Now create a screen with the name Hall. This screen should also be linked to the
frame Process screen.
Now create a screen with the name BB-Start. Link the frame Button bar to this screen.
Vector elements The appearance of these elements in the Runtime always stays the same.
Dynamic These elements change their appearance in the Runtime (usually depending on the value of a varia
elements
Static text
In the screen Start pic, press the left mouse button on the desired location and hold it while
pulling up a square.
23
Screens and functions
You can now adjust the properties of the element in the property window. If you want to change the
properties lateron, you only have to select the element in the screen - by clicking on it with the left
mouse button. Then the properties are again available in the properties window.
Open the context menu in the detail view an select the entry Font new.
The Windows standard dialog for the definition of fonts opens now.
Now select Times New Roman bold 36 and confirm the setting with OK.
24
Screens and functions
The detail view of the Project Manager now lists New font 1 and the properties window shows the
properties of the new font.
The fonts selected here can be used in all elements that include text.
Select the text element in the starting screen and open the section Font in the properties
window.
25
Screens and functions
Click on the icon Save screen or select the entry Save screen from the context menu of the
screen.
Text button
First we will create buttons for our button bar BB-Start to switch between the screens Start Pic and Hall.
26
Screens and functions
Select the command Text Button from the menu Dyn. Elements.
With the left mouse button pressed down you now draw a dynamic element on the screen BB-
Start (ca. 1.5 cm high and 3 cm wide).
The dialog box for selecting functions opens automatically after you release the mouse button.
For Line 1 enter the text Start Pic and for Line 2 the text Alt+S.
27
Screens and functions
In the Runtime, you can now execute the function either by clicking the button or by pressing the key
combination.
Enter Alt-S by clicking into the input area and pressing that key combination.
Example
Create a corresponding button for the screen Hall with the text Hall 1 and Alt 1 and
the according key combination.
Create another button for the function Exit program with the text Exit and the
key combination Alt+E.
Info
We recommend to define a separate font for the text of the button and to use this font
for all buttons in the project. If you want to change the size or any other attribute of the
font at a later moment the changes will then be updated for all buttens automatically.
Screen Functions
You can link functions to each screen, which will automatically be executed on opening or closing the
screen. We will use this functionality now to open the button-bar with the start screen.
28
Screens and functions
In the detail view of the Project Manager select the screen Start Pic.
As Start function, select the function Screen switch: BB-Start from the list.
Now, whenever the screen Start pic is opened, the screen BB-Start will also be opened
automatically.
Numerical value
Select the entry Numerical value from the menu Dyn. Elements.
With the left mouse button pressed down you now draw a dynamic element on the screen
"HALL“ (about 2 cm high and 5 cm wide).
Now the dialog for the variable selection opens.
In the dialog box Variable selection, highlight the variable Temp[1.1] and then press the button
OK.
29
Screens and functions
Info
If the variable selection does not open automatically, perform the following actions:
In order to change the size of a dynamic element you click on one of ist markers (the cursor is a double
arrow, you hold the left mouse button pressed down and by moving the mouse change the size of the
element.
In order to move a dynamic element, click on it (the cursor is an arrow cross), hold the left mouse
button pressed down and drag the element to its new position.
30
Screens and functions
Click on the icon Save screen or select the entry Save screen from the context menu of the
screen.
Example
Now create further numerical value elements for the variables Temp[1.2], Temp[2.1] and
Temp[2.2].
Info
The simplest way to do this is as follows:
Select the element and copy it with Ctrl-C to the clipboard, then paste it three times with
Ctrl-V. Now you can drag the desired variables on the elements with the mouse.
Bar Graph
Select the command Bar Graph from the menu Dyn. Elements.
31
Screens and functions
With the left mouse button pressed down you now draw a dynamic element on the screen
„HALL“ (ca.7 cm high and 3 cm wide).
In the dialogbox Variable selection, highlight the variable Temp[1,1] and then press the
button OK.
In the properties window under Colors/Colors static set the Bar color to green.
Indicating Instrument
Select the command Indicating instrument from the menu Dyn. Elements.
With the left mouse button pressed down you now draw a dynamic element on the Start Pic
(ca.15 cm high and 20 cm wide).
Select the variable Temp[1,2] in the dialogbox Variable selection and then press the button
OK.
In the properties window open the section Representation and then Scale.
Set the Main ticks to 100 and the Sub ticks to 20.
So there will be a long tick with the value at every 100 and a short one with out value every 20.
Trend Graph
Select the command Trend curve from the menu Dyn. Elements.
With the left mouse button pressed down you now draw a dynamic element on the Start Pic
(ca.15 cm high and 20 cm wide).
Now the dialog for the variable selection opens.
Doubleclick the variables "Temp[1,1]" and "Temp[1,2]" in the dialogbox 'Variable selection'.
32
Runtime (Online operation)
In the properties window you will now find the new section Curves.
In the properties window, open the section Curves and then Curve[1].
33
Runtime (Online operation)
2. In the start menu in the folder Programs/COPA-DATA/zenon700 with the entry zenon Logic
Runtime.
First the screen Start (because it was automatically entered in the configuration as the Start
screen) and then the screen BL-Start (because it is opened via the Start function of the
screen Start).
Now we will have a look at how to find your way in an existing Runtime project.
Click into an empty area of the screen with the right mouse button.
If you keep the mouse button pressed long enough the name of the screen appears at the position of
the mouse pointer.
Now click on the numerical value element for the variable Mode with the right mouse button.
On the left side above the element, the name of the linked variable will now be displayed.
Now click on the numerical value element for the variable Temp[1,1] with the left mouse button.
The standard dialog for settings values opens and allows you to change the value of this variable.
Set the value of the variable Temp[1,1] to 300.00 and close the dialog with OK.
Set the value of the variable Temp[1.2] to 350.00 and close the dialog with OK.
With the buttons Start Pic and Hall 1 in the button bar you can switch between the two process
screens.
Switch to the screen Hall 1 and watch the behaviour of the dynamic elements there.
The driver is set to the counting simulation mode and the bar of the bar graph is moving.
34
Runtime (Online operation)
Info
If you have not defined a button for stopping the Runtime and if the Windows title bar is
not available, the Runtime can also be closed with the key combination Alt+F4.
35