This documentation describes the operating mode of the Lenze application template
"ApplicationTemplate" which serves as a basis for programming a Lenze automation system
afterwards. The used automation system consists of a PLC for the "Controller-based Automation"
system and drive components which are connected via the bus system.
Read the mounting instructions supplied with the controller first before you start
working!
The mounting instructions include safety instructions which must be observed!
Note!
This documentation is a supplement to the »PLC Designer« online help.
Tip!
Information and tools regarding the Lenze products can be found in the download area at:
http://www.Lenze.com
This manual is part of the "Controller-based Automation" manual collection. The manual collection
consists of the documents:
Documentation/abbreviationSubject
System manuals (SHB)• "Controller-based Automation"
Communication manuals (KHB)• "Controller-based Automation" EtherCAT®
Software manuals (SW)• Controller
• Visualization
• "Controller-based Automation" CANopen®
• "Controller-based Automation" PROFIBUS®
•»PLC Designer«
• »Engineer«
• »VisiWinNET® Smart«
•»Backup & Restore«
Information on the use of the controller beyond the field of "Controller-based
Automation" can be found in the system manuals tailored to the application case.
Further information on Lenze products which can be used in connection with "Controllerbased Automation" can be found in the following documentation:
Mounting & wiringSymbols:
MAs Controller Printed documentation
MA i700 servo inverter Online help / PDF file
MAs Servo Drives 9400
MAs Inverter Drives 8400Abbreviation:
MA I/O system 1000 (EPM-Sxxx)BA Operating instructions
MAs for communication cards (MC-xxx)KHB Communication manual
MAs for communication modulesMA Mounting instructions
SW Software manual
Parameterisation, configuration, commissioningSHB System manual
SW Controller
SW Servo-Inverter i700
SW Servo Drive 9400 HighLine/PLC /
Regenerative power supply module
9400 HighLine commissioning guidelines
SW Inverter Drives 8400
StateLine/HighLine/TopLine
SHB I/O system 1000 (EPM-Sxxx)
BAs for servo system ECS (ECSxE, ECSxM)
KHBs for communication modules
Programming
SW 9400 function library
Reuse
SW Application Sample i700
SW Application Samples
SW ApplicationTemplate
Target group
This documentation addresses to all persons who plan, commission, and program a Lenze
automation system on the basis of the Lenze "ApplicationTemplate" as part of the "Controller-based
Automation".
Screen shots/application examples
All screenshots in this documentation are application examples. Depending on the firmware
version of the Lenze device and the software version of the engineering tools installed (here: »PLC
Designer«), the representation of the actual screen display may deviate.
Please observe the following safety instructions when you want to commission a controller or
system.
Read the documentation supplied with the controller or the individual components of
the system carefully before you start to commission the devices!
The device documentation contains safety instructions which must be observed!
Danger!
According to today's scientific knowledge it is not possible to ensure absolute freedom
from defects of a software.
If required, systems with integrated controllers have to be equipped with additional
monitoring and protective equipment in accordance with the safety regulations valid in
each case (e.g. law on technical equipment, regulations for the prevention of accidents),
so that an impermissible operating status does not endanger persons or equipment.
During commissioning persons must keep a safe distance from the motor or the
machine parts driven by the motor. Otherwise there would be a risk of injury by the
moving machine parts.
Stop!
If you cha nge par ameter s in the »PLC De signer« whil e an onl ine con nectio n to the devic e
is established, the changes are directly accepted in the device!
An incorrect parameterisation can result in unpredictable motor movements. By an
unintentional direction of rotation, too high speeds or jerky operation, powered
machine parts can be damaged!
The ApplicationTemplate is a Lenze application template for standardised and convenient
programming in the »PLC Designer«.
• The ApplicationTemplate is included in the »PLC Designer« (from version 3.3) as project
template. Create a new project - open the ApplicationTemplate
•The L_EATP_ApplicationTemplate.compiled-library library includes the structure and the basic
functionality of the ApplicationTemplate. The L_EATP_ApplicationTemplate library
4.1Objective of the ApplicationTemplate
The ApplicationTemplate...
• ...helps to implement the mechatronic structure of an automation system (which is available as
a tree structure) in a modular manner.
• ...enables the integration of predefined machine modules with prepared applications (for
instance a cross cutter).
• ...simplifies and speeds up the creation of PLC programs in the long term by re-use of a
standardised and modularised folder structure.
( 31)
( 110)
What are the advantages of the ApplicationTemplate?
The ApplicationTemplate facilitates programming with the »PLC Designer« ...
• ...by a predefined folder structure which "cleans up" and which can be extended individually.
• ...renders the navigation for extending or creating machine programming easier.
• The ApplicationTemplate contains ready-made, re-usable machine modules and module
applications which minimise the risk of compilation errors in order to thus reduce time and
costs.
In order to map the desired automation system in the »PLC Designer« on the basis of the
ApplicationTemplate, the structure of the whole machine application must be created in the »PLC
Designer«.
• In a first step, the machine structure must be divided into machine modules.
•The A10_MachineModuleTree machine module tree (MMT) shows the machine modules in
the form of a tree structure from left to right.
[4-1]Machine structure tree (MMT) in the ApplicationTemplateCounter, A10_MachineModuleTree folder
The ApplicationTemplate...
• ...supports two to five hierarchy levels of machine modules.
• ...supports up to 30 machine modules.
[4-2]MMT (Machine Module Tree) with up to five possible hierarchy levels of machine modules
The overall functionality of the automation system is structured in a modular manner in the
ApplicationTemplate. This means that every subfunction of the machine is included in one of the
machine modules. Due to the modular structure, individual (or multiple) subfunctions of a machine
can be reused
machine parts.
• A machine module represents the function of a machine part; for instance a conveying belt, or
a cross cutter.
• The overall functionality of, for example, a bag form, fill, and seal machine, contains the "Cross
cutter" and "Transport unit" subfunctions. The two subfunctions are to be converted to a
separate machine module each.
Machine module in the ApplicationTemplate
. Advantage: The respective function does not have to be recreated for further
[4-3]Structure of a machine module
• Every machine module contains the BaseChannel ("Base Data") which serves as a data
channel for the basic functions of the ApplicationTemplate.
• The basic functions of the ApplicationTemplate are the State machine and the Error handling.
Every machine module has an AppChannelData structure (ACD structure). An ACD structure can be
defined in a machine module if necessary.
• Via the ACD structure, data are provided to/received from the higher-level machine module.
• Via the ACD structure, process data can be exchanged between the user's own module
applications.
A machine module (MFB) always contains at least one module application (MAP). Up to three MAPs
per MFB are possible.
•Via the MM_IO, MM_Par; MM_Vis, MM_PD structures, the module application (MAP) is to be
connected to the "outside world" (the respective sub-function of the automation system).
•By means of the MM_IO structure, the inputs/outputs of the terminals/the fieldbus are to be
connected.
•The MM_Par structure contains all variables that are to be managed by the recipe manager.
•The MM_Vis structure contains all variables that can be controlled or are to be displayed via an
external visualization.
•The MM_PD structure contains all persistent variables.
Every machine module has an
MM_Address input which
serves to assign the relativeaddress to the machine
module.
[4-4]Illustration: Sample illustration MMT in the sample project L_ApplicationTemplateCounter
The following must be observed when relative addresses are assigned to the machine modules:
•The relative address is to be assigned to every machine module (value range: 1...29).
• During the initialisation phase, the »PLC Designer« generates an absolute address for every
machine module.
• Example of the relative
The diagram shows the absolute module address (black) and the relative module address (white).
• In the event of an error, the absolute address enables an error analysis. This for instance makes
it possible to retrace the module which has caused the error in each case. Error handling
4.3.4Module application (MAP)
The module application (MAP) contains the function of the corresponding machine module.
• The ApplicationTemplate supports up to three
machine module.
and absolute module addressing:
( 92)
tasks. Hence, up to three MAPs can be used per
•In the A11_ModuleAppCalls folder, the MAPs are to be assigned to the tasks:
ModuleAppCalls (MAC).
The machine modules (MM_xxx) communicate with each other via the MM_Machine machine
control module by means of the BaseChannel communication channel and the AppChannelData
structure.
• The communication channels provide for a bidirectional data exchange.
• The BaseChannel is defined as a structure in the ApplicationTemplate.
One or several slave modules are always exactly connected to one higher-level master module.
However, the master only always communicates with one slave module. Slave modules cannot
communicate directly with each other, but only via the higher-level master module.
The higher-level machine module (master) communicates with the lower-level machine modules
(slaves) via data channels (channels). During the initialisation, the ApplicationTemplate generates
a BaseChannel and an AppChannelData(ACD) structure.
[4-5]Exchange of information between the machine modules (L_ApplicationTemplateCounter)
BaseChannel: exchange of control and status data (Control/Status basic data)
The BaseChannel...
• ...contains the control / status information of the state machine.
• ...contains the error handling.
The ACD structure...
• ...serves to exchange application process data between machine modules.
• ...is a data structure for the definition of own process data.
• ...must always be derived from the L_EATP_ACD_Base
Every machine module features one state machine. State machine ( 77)
• If a machine module is integrated in the machine module tree (if it is not decoupled from the
MMT), the state machine of the master module controls all state machines of the lower-level
machine modules.
• When all slave modules have changed to the requested state, the master module also changes
to the requested state.
Exception: During the initialisation, all machine modules are in the "INIT" state and,
independently of the slave or master, change to the "READY" state if it is enabled:
SMEnableInitToReady(TRUE);
State transitions - overview
The following status diagram illustrates the possible operating states of the state machine:
• After the start (switch-on / re-initialisation), the module is in the "Init" state.
• In standby/waiting mode, the module is in the "Ready" state.
• "Warning" is a special status (independent, "orthogonal" state), which does not influence the
operational performance of the machine module.
The error handling of the ApplicationTemplate provides mechanisms by means of which responses
(errors, warnings, messages) can be defined and triggered in the module applications (MAP) of the
machine modules (MM)
Further mechanisms are:
• The forwarding of error states in the MachineModuleTree (MMT).
• An application-global error list with the current error status of all machine modules contained
in the MMT.
• Transmission of errors and events to the central logbook of the controller.
Further information can be found under: Error handling
( 92)
22
Lenze · ApplicationTemplate · 1.3 EN - 04/2013
Structuring the automation system: Standard procedure
5Structuring the automation system: Standard procedure
This section describes the standard procedure to create an application with the »PLC Designer«
based on the ApplicationTemplate.
• Use the following recommendations as a guide in order to be able to then create a PLC project
in the »PLC Designer« in a structured manner using the ApplicationTemplate and to program it
effectively.
• Due to the structured layout of the ApplicationTemplate (the consistency in these structures
and the compliance with these structures), applications can be created more quickly and hence
integrated in an existing PLC program more quickly.
[5-1]Recommended procedure for creating a project efficiently.
StepActionWhat has to be done?Description
Gain an overview of the
overall functionality of the
machine structure.
• Divide the overall
functionality of the
machine structure into
subfunctions.
• Transfer the identified
subfunctions of the
machine structure to
machine modules.
In this project phase, programming
is not yet required! Assign the
relative address to the machine
modules. ( 25)
Lenze · ApplicationTemplate · 1.3 EN - 04/201323
Structuring the automation system: Standard procedure
Create machine modules
containing the subfunctions
of the machine structure in
each case: one subfunction =
one machine module.
• Define the interfaces for
the module applications
(MAPs).
• Optionally create the
visualization for the
respective machine
module.
• Each machine module is
provided with a state
machine. Irrespective of
the active status, the
module application (MAP)
calls a corresponding
action. The action is
subordinated to the
module application.
• Within these actions,
create the logic which is to
be executed if the
machine module (MM) is
in the corresponding
status.
• In order to be able to call
machine functions in different
tasks, corresponding module
applications have to be created.
• More information about
structuring within a module
application: Structuring
within a machine module
( 26)
• Define variables.
• Declare variables in the
(MM_IO, MM_Par, MM_Vis,
MM_PD) variable lists.
• Integrate newly created
machine modules into the MMT
(machine module tree).
• Assign the relative address to
the machine modules.
Creating module applications
( 62)
24Lenze · ApplicationTemplate · 1.3 EN - 04/2013
Structuring the automation system: Standard procedure
Assign the relative address to the machine modules.
5.1 Assign the relative address to the machine modules.
In order to modularise programming of a machine system, the individual subfunctions of the overall
functionality of the automation system have to be mapped in the form of machine modules.
Example: Bag form, fill, and seal machine ("Flow Packer")
• It is helpful to outline the machine structure with t he indi vidual subfun ctions in a tree st ructur e.
• For this, the individual sub functions of the machine have to be transferred to corresponding
machine modules.
Examples of machine modules
•"Virtual master"
•"Infeed" (feeder)
•"Outfeed" (extractor)
• If the individual subfunctions are structured in the form of machine modules, the interfaces are
to be assigned to the module application (MAP).Creating your own machine modules: Copy/
insertMM_EmptyModule ( 51)
• Assign the input and output variables...
...in variable lists MM_IO, MM_Par, MM_Visu and MM_PD and
...to the variables of the AppChannelData (ACD) structure.
Lenze · ApplicationTemplate · 1.3 EN - 04/201325
Structuring the automation system: Standard procedure
In order to create a clearly arranged
module application, it is advisable to
divide the module applications (MAP)
into subfunctions and to structure
them correspondingly.
5.2.1Assigning the MAP subfunctions to individual tasks
In a first step, the functions are to be assigned to the individual tasks. The ApplicationTemplate
supports multitasking with three tasks. More information can be found under: Multitasking
( 98)
• Task "High" (standard value: 2 ms)
• Task "Mid" (standard value: 6 ms)
• Task "Free" (unsolicited)
One module application can be used per task.
• Task and module application are assigned in the A11_ModuleAppCalls folder.
•The MAC_Task_High program part for instance calls all module applications which are to
pass through a high priority task Task_High.
[5-2]ApplicationTemplateCounter sample project: MAC_Task_High calls the Module1_App1 module application.
26
Lenze · ApplicationTemplate · 1.3 EN - 04/2013
Structuring the automation system: Standard procedure
For easy structuring, Lenze recommend to use the Actions of the ApplicationTemplate.
•The Actions must be lower level to the module application.
• Actions are marked with the icon.
Example of structuring a module application:
[5-3]The SMDispatcher method calls the S01-S11 actions. The actions can be viewed in the ModApp1/Statesfolder.
An Action is always connected to a POU (example: function block of an MAP module application).
• Thereby the action only uses the data of function block. This means that the action does not
feature an own declaration part. The variables used in the action are declared in the function
block (i.e. in the MAP module application).
• The action does not feature any
local variables.
28
Lenze · ApplicationTemplate · 1.3 EN - 04/2013
Overview - the structure of the ApplicationTemplate
The ApplicationTemplateCounter includes a sample program with three machine modules and a
predefined visualization. The sample program serves to test the basic functions of the
ApplicationTemplate. The sample program in the ApplicationTemplateCounter
Standard procedure
The main steps are summarised in the following table:
StepAction
1.Create a new project - open the ApplicationTemplate
2.Update the controller in the project (optional)
3.Going online
• Compiling the project data
• Transferring the project to the control - "Log in"
4.Loading and starting the PLC program
5.Getting started - operating the ApplicationTemplate
( 33)
( 33)
( 33)
( 31)
( 32)
( 33)
( 35)
( 134)
Further information on the parameter setting and configuration of the respective bus
system can be found in the following communication manuals (KHB):
• Communication manual EtherCAT: "Controller-based Automation" EtherCAT
• Communication manual CANopen: "Controller-based Automation" CANopen
Detailed commissioning steps
The following section describes the individual commissioning steps in detail.
Follow the instructions specified step by step to commission your automation system.
• Communication manual PROFIBUS: "Controller-based Automation" PROFIBUS
30Lenze · ApplicationTemplate · 1.3 EN - 04/2013
Loading...
+ 147 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.