Lenze ApplicationTemplate PackML User Manual

Engineering tools
PLC Designer
Application Template PackML _ _ _ _ _ _ _ _ _
Software manual EN
Ä.OJ_ä
13464162
L

Contents

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
1 About this documentation _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 4
1.1 Document history _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 6
1.2 Conventions used _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 7
1.3 Notes used _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 8
1.4 Terminology used (presented according to the order in the device view) _ _ _ _ _ _ _ _ _ _ _ _ _ _ 9
2Safety instructions _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10
3 Preconditions _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 11
3.1 System requirements _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 11
3.2 Setting up communication to the Controller _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 11
4 What is the ApplicationTemplate PackML? _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 13
4.1 Targets of the ApplicationTemplate PackML _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 13
4.2 Features of the Application Sample PackML at a glance _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 14
4.3 Elements of the ApplicationTemplate PackML _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 15
4.3.1 Machine Module Tree - MMT _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 15
4.3.2 Machine modules (MM) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 16
4.3.3 Addressing the machine modules _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 17
4.3.4 Module application (MAP) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 17
4.3.5 Modes: Machine operating modes _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 18
4.3.6 Communication between the machine modules _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 18
4.3.6.1 Predefined operating modes in ModApp1 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 20
4.3.6.2 Creating own modes _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 21
4.3.7 State machine _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 23
4.3.7.1 State transitions - overview _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 23
4.3.8 Alarmhandling (error handling) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 24
4.3.7.2 Methods for changing over the states _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 24
5 Structuring the automation system: Standard procedure _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 25
5.1 Assign the relative address to the machine modules. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 27
5.2 Structuring within a machine module: Assigning MAP subfunction to the tasks _ _ _ _ _ _ _ _ _ _ 28
6 Overview - the folder structure in the ApplicationTemplate PackML _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 30
7 Opening the ApplicationTemplate PackML _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 32
7.1 Create a new project - open the ApplicationTemplate PackML _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 33
7.2 Updating the controller in the project (optional) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 34
7.3 Going online _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 34
7.3.1 Compiling the project data _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 34
7.3.2 Transferring the project to the control - "Log in" _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 34
7.4 Downloading and starting the PLC program _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 34
7.5 Getting started - operating the ApplicationTemplate PackML _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 35
7.6 Visualisation of the machine modules _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 36
8 Working with the ApplicationTemplate PackML _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 37
8.1 Mapping the actual machine structure: Add devices _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 38
8.2 Creating machine modules: Copy/insert machine module templates _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 41
8.3 Integrating machine modules in the MMT _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 42
8.4 Assigning the module application (ModApp) to the task _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 43
8.5 Create MM Instance: Creating instances of a machine module _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 45
8.6 Delete Machine Module: Remove instances of a machine module _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 46
8.7 Removing machine modules _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 47
8.8 Module ID _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 47
8.9 Inserting an axis _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 49
Contents
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
8.10 Integrating I/O modules of the I/O system 1000 with a machine module _ _ _ _ _ _ _ _ _ _ _ _ _ _ 51
8.11 Creating module applications _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 53
8.11.1 Programming with the module application _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 54
8.11.2 Integrating a module application _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 55
9 Architecture: The ApplicationTemplate PackML in detail _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 58
9.1 Accessing structure variables of machine modules _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 58
9.1.1 Accessing module's intrinsic structure variables _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 58
9.1.2 User Tags: Defining own data elements _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 59
9.1.3 Accessing structures of other machine modules _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 60
9.2 The AppChannelData structure(ACD) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 60
9.2.1 Declaring/recording the ACD structure in the MFB _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 61
9.2.2 Accessing the ACD structure of the master module - by means of the MFB module application 61
9.2.3 Accessing the ACD structure of the slave modules - by means of the modes of the master module 62
9.2.4 The structure MachineModuleData (MMD) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 64
9.3 State machine in detail _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 65
9.3.1 State transitions and conditions - overview _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 65
9.3.2 Methods for changing over the state transitions _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 66
9.3.3 The state transitions in detail: Command_CtrlCmds() method _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 68
9.3.4 Possible states in detail _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 69
9.4 Standard coupling of the machine modules _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 71
9.4.1 Predefined standard mechanism of the state machine _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 71
9.4.1.1 The Command_DisableModule method: Decoupling modules _ _ _ _ _ _ _ _ _ 72
9.4.1.2 Renewed coupling of machine modules _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 72
9.5 Influencing state transitions _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 72
9.6 Stater machine: Query examples _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 73
9.7 Where can the response of a machine module be programmed? _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 75
9.7.1 State transition (state entry/state exit) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 75
9.8 Alarm handling (error handling) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 76
9.8.1 Defining alarms _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 76
9.8.2 Acknowledging alarms _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 77
9.8.3 Acknowledging alarms: Response in the machine module _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 77
9.9 Triggering alarms _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 78
9.10 Central management of alarms _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 79
9.11 The alarm information block _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 80
9.12 Export overview of the alarms of all machine modules: CSV file _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 80
9.13 Logbook _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 81
9.14 Module diagnostics _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 82
9.15 Multitasking _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 82
9.16 Consistent data transfer _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 83
10 Visualising in the ApplicationTemplate PackML _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 86
10.1 Extending the visualization _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 86
10.2 Defining the properties of buttons _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 88
10.3 Adding a visualization: Standard procedure _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 89
11 An overview of the methods _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91
11.1 An overview of the admin methods : Admin_xxx _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 91
11.2 An overview of the command methods: Command_xxx _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 92
11.3 An overview of the status methods: Status_xxx _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 94
Your opinion is important to us _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 98
Lenze · ApplicationTemplate PackML · 1.0 EN - 05/2014 3
About this documentation
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

1 About this documentation

This documentation describes the operating mode of the Lenze "ApplicationTemplate PackML" which serves as a basis for programming a Lenze automation system. The used "Controller-based automation" system consists of a Lenze Controller and drive components which are connected via the bus system.
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:
Type of documentation Subject
System manuals System overview/example topologies
• Controller-based Automation
• Visualisation
Communication manuals Bus systems
• Controller-based Automation EtherCAT®
Online helps/ software manuals
• Controller-based Automation CANopen®
• Controller-based Automation PROFIBUS®
• Controller-based Automation PROFINET®
Lenze Engineering tools
• »PLC Designer«: Programming
• »Engineer«: Configuration of controllers
• »VisiWinNET® Smart«: Visualisation
• »Backup & Restore«: Backing up/restoring data
About this documentation
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Further technical documentation on Lenze products
Further information on Lenze products which can be used in connection with Controller-based Automation can be found in the following documentation:
Mounting & wiring Icons
Mounting instructions
• Controller
• Communication cards (MC-xxx)
• I/O system 1000 (EPM-Sxxx)
•Inverter
•Communication modules
Using sample applications/an application template
Online help/software manuals
• i700 Application Sample
• Application Samples
• ApplicationTemplate
• ApplicationTemplate PackML
Parameterisation, configuration, commissioning
Online help/software manuals
• Controller
• i700 servo inverter
• Servo Drive 9400 HighLine/PLC/ regenerative power supply module
• Inverter Drive 8400 StateLine/HighLine/TopLine
• 1000 I/O system (EPM-Sxxx)
Online help/communication manuals
• Bus systems
•Communication modules
Target group
This documentation addresses to all persons who plan, commission, and program a Lenze automation system on the basis of the Lenze "ApplicationTemplate PackML" as part of the "Controller-based Automation".
Printed documentation
Online help in the Lenze Engineering tool/ software manuals and communication manuals are provided as PDF files on the Internet.
Screenshots/application examples
All screenshots in this documentation are application examples. Depending on the firmware version of the Lenze devices and the software version of the engineering tools installed (»PLC Designer«), the screenshots in this documentation may deviate from the screen representation.
Lenze · ApplicationTemplate PackML · 1.0 EN - 05/2014 5
About this documentation
Document history
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Information regarding the validity
The information in this documentation is valid for the following Lenze software:
Software from software version
»PLC Designer« 3.8
Valid for the following Lenze application templates:
• "Application Template PackML" according to PackML standard: L_ApplicationTemplate PackML

1.1 Document history

Version Description
1.0 05/2014 TD11 First edition
6
Lenze · ApplicationTemplate PackML · 1.0 EN - 05/2014
About this documentation
Conventions used
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

1.2 Conventions used

This documentation uses the following conventions to distinguish between different types of information:
Type of information Writing Examples/notes
Spelling of numbers
Decimal separator Point The decimal point is always used.
For example: 1234.56
Text
Version information Blue text colour All information that applies to from a certain software
Program name » « »PLC Designer«...
Window italics The message window... / The Options dialog box ...
Variable names Setting bEnable to TRUE...
Control element bold The OK button ... / The Copy command ... / The Properties tab
Sequence of menu commands
Shortcut <bold> Use <F1> to open the online help.
Hyperlink underlined
Icons
Page reference (7) Reference to further information: Page number in PDF file.
Step-by-step instructions
version of the drive onwards are marked accordingly in this documentation.
Example: This function extension is available from software
version V3.0!
... / The Name input field ...
If several commands must be used in sequence to carry out a function, the individual commands are separated by an arrow: Select File
If a shortcut is required for a command to be executed, a "+" has been put between the key identifiers: With <Shift>+<ESC> ...
Reference to further information: Hyperlink to further information.
Step-by-step instructions are indicated by a pictograph.
Open to...
Lenze · ApplicationTemplate PackML · 1.0 EN - 05/2014 7
About this documentation
Notes used
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

1.3 Notes used

The following signal words and symbols are used in this documentation to indicate dangers and important information:
Safety instructions
Layout of the safety instructions:
Pictograph and signal word!
(characterise the type and severity of danger)
Note
(describes the danger and explains how to avoid it.)
Pictograph Signal word Meaning
Danger! Danger of personal injuries through electrical voltage
Danger! Danger of personal injury through a general source of danger
Stop! Danger of property damage
Reference to an imminent danger that may result in death or serious personal injury if the corresponding measures are not taken.
Reference to an imminent danger that may result in death or serious personal injury if the corresponding measures are not taken.
Reference to a possible danger that may result in property damage if the corresponding measures are not taken.
Application notes
Pictograph Signal word Meaning
Note! Important note to ensure trouble-free operation
Tip! Useful tip for easy handling
Reference to another document
8
Lenze · ApplicationTemplate PackML · 1.0 EN - 05/2014
About this documentation
Terminology used (presented according to the order in the device view)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

1.4 Terminology used (presented according to the order in the device view)

Term/abbreviation Position in the device view Function
Machine module tree
MMT
ModuleApplicationCalls
MAC
Machine module
MM
Machine module application
ModApp/MAP
Machine function block MFB
A10_MachineModuleTree
A11_ModuleAppCalls
A70_MachineModuleSources
The "MachineModuleTree" (MMT) maps the structure of the automation system in the form of machine modules.
• In the "MachineModuleTree", all machine modules required for the machine are interconnected hierarchically according to the mechatronic interaction.
The module applications are to be assigned to the corresponding task within the "ModuleApplicationCalls".
• Thus it is defined which module application is to be processed within the individual tasks.
A machine module maps a unit of the real machine structure in the »PLC Designer«.
• The machine module is part of the MachineModuleTree(MMT) within which the individual machine modules are interconnected.
The machine module application provides the functionality of a machine module.
• A machine module can contain one or several machine module applications.
The machine function block represents the machine module in the machine module tree (MMT).
Lenze · ApplicationTemplate PackML · 1.0 EN - 05/2014 9
Safety instructions
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

2 Safety instructions

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 commissioning 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 product.
If necessary, systems with built-in controllers must be provided with additional monitoring and protective equipment complying with the relevant safety regulations (e.g. law on technical equipment, regulations for the prevention of accidents) in each case, so that an impermissible operating status does not endanger persons or facilities.
During commissioning persons must keep a safe distance from the motor or the machine parts driven by the motor. Otherwise there is 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!
A wrong parameter setting can cause unpredictable motor movements. By an unintended direction of rotation, a too high speed, or jerky operation, the driven machine parts may be damaged!
Preconditions
System requirements
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

3 Preconditions

3.1 System requirements

[3-1] Sample configuration with a Controller 3200 C
Engineering PC Controller
Hardware PC/notebook PLC (Logic) from firmware V3.8
Operating system Windows XP Windows CE
Required Lenze software »PLC Designer« from V3.8
•Contains the ApplicationTemplate PackML
• Contains the Lenze library "L_EATP_ApplicationTemplate.co mpiled-library"
Further requirements - Depending on the application case:

3.2 Setting up communication to the Controller

• Connect the Engineering PC with the controller via a network cable. The »PLC Designer« accesses the controller via Ethernet.
• Make the IP settings with the »PLC Designer«.
How to check the communication settings:
1. Double-click the desired controller in the Devices view.
Runtime software
•Logic
• Motion (for this purpose, the project data must be updated: "Update Device")
• CAN-/EtherCAT bus system
• CAN-/EtherCAT node
2. Make the desired settings on the Communication settings tab.
•Click the Add gateway button to insert a gateway.
Lenze · ApplicationTemplate PackML · 1.0 EN - 05/2014 11
Preconditions
Setting up communication to the Controller
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
•Enter the desired IP address of the controller.
[3-2] Example: Enter the IP address of the Controller, standard setting: 192.168.5.99
3. Click OK to add the controller as gateway.
4. By double-clicking the desired channel (or clicking the Set active path button), set the
channel selected in the device view below the gateway as active path to the controller.
• Thus, all communication actions directly refer to this channel.
• The currently active path is represented in bold in the list and "(active)" is attached:
5. A device represented in italics is set as active path but has not been found during the last
network scan.
Note!
During initial commissioning, observe the predefined IP address: 192.168.5.99
Further information can be found in the following documentation:
Controller - Parameter setting & configuration
12
Lenze · ApplicationTemplate PackML · 1.0 EN - 05/2014
What is the ApplicationTemplate PackML?
Targets of the ApplicationTemplate PackML
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

4 What is the ApplicationTemplate PackML?

The Lenze ApplicationTemplate PackML is an application template for standardised and convenient programming in the »PLC Designer« according to PackML standard in compliance with the OMAC ("The Organization for Machine Automation and Control").
• From »PLC Designer« version 3.8 onwards, the ApplicationTemplate PackML is included as project template. Create a new project - open the ApplicationTemplate PackML
•The L_EATP_ApplicationTemplate.compiled-library library includes the structure and functionality of the standardised Lenze application template and the extension for the ApplicationTemplate PackML. Die Bibliothek L_EATP_ApplicationTemplate

4.1 Targets of the ApplicationTemplate PackML

The ApplicationTemplate PackML...
• ...helps to implement the mechatronic structure of an automation system (which has been previously implemented as tree topology) in a modular manner according to the PackML standard.
(33)
(89)
• ...enables the integration of predefined machine modules with prepared applications/ technology modules (for instance the functionality for cross-cutting).
• ...simplifies and speeds up the creation of PLC programs in the long term by re-use of a standardised project structure in the form of a modularised folder structure.
What are the advantages of the ApplicationTemplate PackML?
The ApplicationTemplate PackML facilitates programming with the »PLC Designer« ...
• ...by the defined folder structure which "cleans up" and which can be extended individually.
• ...renders the navigation for extending or creating machine programming easier.
• The ApplicationTemplate PackML 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.
Lenze · ApplicationTemplate PackML · 1.0 EN - 05/2014 13
What is the ApplicationTemplate PackML?
Features of the Application Sample PackML at a glance
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

4.2 Features of the Application Sample PackML at a glance

The following predefined functions facilitate implementing a machine application in a PLC:
State machine
Alarm handling (error handling) (76)
Multitasking (82)
Further advantages if the ApplicationTemplate PackML is used:
(23)
Consistent data transfer
• Diagnostic function for every machine module ("generic module diagnosis").
• A defined standard response ("DefaultCoupling") of the state machine. Standard coupling of
the machine modules (71)
For more information on the respective functions, please see the corresponding subchapter.
between the tasks.
14
Lenze · ApplicationTemplate PackML · 1.0 EN - 05/2014
What is the ApplicationTemplate PackML?
Elements of the ApplicationTemplate PackML
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

4.3 Elements of the ApplicationTemplate PackML

4.3.1 Machine Module Tree - MMT

In order to map the desired automation system in the »PLC Designer« using the ApplicationTemplate PackML, the structure of the whole machine application must be created in the »PLC Designer«.
• In a first step, the electronic machine structure (total functionality of the machine) has to be divided into machine modules (subfunctions of the machine).
•The A10_MachineModuleTree machine module tree (MMT) shows the machine modules in the form of a tree structure from left to right.
• The top module is the machine control module. The other functions of the machine are subordinated to the machine control module.
[4-1] Illustration example: Machine structure tree (MMT) in the ApplicationTemplate, folder A10_MachineModuleTree
The ApplicationTemplate PackML...
• ...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
Lenze · ApplicationTemplate PackML · 1.0 EN - 05/2014 15
What is the ApplicationTemplate PackML?
Elements of the ApplicationTemplate PackML
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

4.3.2 Machine modules (MM)

The overall functionality of the automation system is structured in a modular manner in the ApplicationTemplate PackML. 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 further 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 PackML
. Advantage: The respective function does not have to be recreated for
[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 PackML.
• The basic functions of the ApplicationTemplate PackML 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.
16
Lenze · ApplicationTemplate PackML · 1.0 EN - 05/2014
What is the ApplicationTemplate PackML?
Elements of the ApplicationTemplate PackML
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

4.3.3 Addressing the machine modules

Every machine module has an MM_Address input which serves to assign the relative address to the machine module.
[4-4] Illustration example: Sample illustration MMT in the L_ApplicationTemplate sample project
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. Alarm handling
(error handling) (76)

4.3.4 Module application (MAP)

The module application (MAP) contains the function of the corresponding machine module.
• The ApplicationTemplate Pack ML supports up to three used per machine module.
and absolute module addressing:
tasks. Hence, up to three MAPs can be
Lenze · ApplicationTemplate PackML · 1.0 EN - 05/2014 17
What is the ApplicationTemplate PackML?
Elements of the ApplicationTemplate PackML
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
•In the A11_ModuleAppCalls folder, the MAPs are to be assigned to the tasks: ModuleAppCalls (MAC).Assigning the module application (ModApp) to the task

4.3.5 Modes: Machine operating modes

In the ApplicationTemplate PackML, the following machine operating modes are firmly defined: Producing, Maintenance and Manual. Further modes can be added individually.
(43)
Operating mode "Producing" Operating mode "Maintenance" Operating mode "Manual"
[4-5] The ApplicationTemplate PackML includes three firmly defined operating modes, more can be freely defined.
Each operating mode includes a separate state machine.
• If required, more operating modes can be defined. Creating own modes
• The modes and the respective state machine are integrated in the ModApp 1 module application.
• The behaviour of the states is defined in the A12_PackML_Configuration folder in
PackMLConfig. There, it is defined, for instance, which state is when active and in which
states a changeover of the modes is permissible. Predefined operating modes in ModApp1
(20)
• When another operating mode is created, the desired features of the states have to be defined in the PackMLConfig area.

4.3.6 Communication between the machine modules

The machine modules (MM_xxx) communicate with each other via the higher-level MM_Machine machine control module by means of the BaseChannel communication channel and the AppChannelData structure.
(21)
18
• The communication channels provide for a bidirectional data exchange.
• The BaseChannel is defined as a structure in the ApplicationTemplate PackML.
Lenze · ApplicationTemplate PackML · 1.0 EN - 05/2014
What is the ApplicationTemplate PackML?
Elements of the ApplicationTemplate PackML
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 PackML generates a BaseChannel and an AppChannelData(ACD) structure.
[4-6] Exchange of information between the machine modules (L_ApplicationTemplate)
Bus (data): Exchange of control and state data (basic data Control/Status)
Basic functions in the ApplicationTemplate PackML are...
• ...the control / status information of the state machine.
• ...the alarm handling (error handling/error responses).
The ACD structure...
• ...serves to exchange application process data between machine modules.
• ...is a data structure for the definition of own process data.
Lenze · ApplicationTemplate PackML · 1.0 EN - 05/2014 19
What is the ApplicationTemplate PackML?
Elements of the ApplicationTemplate PackML
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
4.3.6.1 Predefined operating modes in ModApp1
Each machine module contains the predefined operating modes Producing, Maintenance and Manual.
The operating modes are located in the machine module template in the folder
A66_EmptyModule_PackML  ModApp1\Modes.
The mode FBs are declared in the MAP-FB in the \ModApp1 folder. Call of the mode FBs in the respective modes method
• The module application App1 contains the instances of the mode blocks Producing, Maintenance and Manual.
• The mode block instances are called in the modes method.
Where can the operating modes be defined?
The configuration of the operating modes is defined in the A12_PackMLConfiguration folder. There, it is defined, for instance, which state is active and in which states a changeover of the mode is permissible.
20
Lenze · ApplicationTemplate PackML · 1.0 EN - 05/2014
What is the ApplicationTemplate PackML?
Elements of the ApplicationTemplate PackML
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[4-7] Defined PackML operating modes in the folder A12
• In this area, the states to be used within the single modes can be defined so that individual state machines can be created by parameterisation (example: xDisableState…) which can be defined in the PackML configuration.
• The transition of the single modes can also be defined in this block. The corresponding inputs (example: xEnableModeTrans…) enable the changeover from the respective state into another mode of the same state. The block base defines the initial mode and state. This configuration is identical in all machine modules of the application.
4.3.6.2 Creating own modes
If required, further operating modes can be defined.
How to create a mode:
1. Enter the desired name for the additional mode in the A71_LocalSources. folder
in the ENUM L_UserModes_PackML by replacing "UserDefined", example: Replacing UserDefined01.
2. Create an instance and set the configuration for the new mode.
Lenze · ApplicationTemplate PackML · 1.0 EN - 05/2014 21
What is the ApplicationTemplate PackML?
Elements of the ApplicationTemplate PackML
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
3. Add the ENUM value for this mode to the configuration block.
4. Add the new mode to ModApp1 by copy/paste of an already available mode and rename it, example: ExampleMode.
5. Instance the newly created mode (FB) in the declaration part of the MAP:
6. Add the additional mode to the modes method and assign the ENUM value of the new mode.
Changeover of the operating modes/Modes
After the additional mode has been implemented, the state machine and the changeover of the modes can be operated with the PackML tags.
22
Lenze · ApplicationTemplate PackML · 1.0 EN - 05/2014
What is the ApplicationTemplate PackML?
Elements of the ApplicationTemplate PackML
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Method Description
Command_UnitMode (eUnitMode:= L_UserModes_PackML.ExampleMode, xUnitModeRequest:=TRUE)
Status_ModeChangeAllowed (L_UserModes_PackML.ExampleMode)
Changes over a mode if this is permissible.
Checks if a changeover of the mode is permissible in the current state.
An overview of the methods

4.3.7 State machine

Each machine module has an own state machine. The state machine of a mode can be created individually: By deactivating single states in the entire state machine.
More information: State machine in detail
4.3.7.1 State transitions - overview
The following status diagram illustrates the possible state transitions of the state machine:
(91)
(65)
[4-8] State machine in the ApplicationTemplate PackML
The current state of the state machine is highlighted in red.
• Active state in the illustration: "Idle"
• "Idle" corresponds to the "Waiting" state and is thus highlighted in yellow.
The colouring in the state machine distinguishes the following states:
Yellow: Waiting state
Green: Acting state
Blue: Dual state (can be "waiting" or "acting")
The "waiting" states "Stopped", "Aborted" and "Execute" cannot
Deactivating a state simultaneously switches off the respective (outbound) transitions. If it is the "Wait" state, it also switches off its "Active" state.
Lenze · ApplicationTemplate PackML · 1.0 EN - 05/2014 23
be deactivated.
What is the ApplicationTemplate PackML?
Elements of the ApplicationTemplate PackML
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[4-9] Example: State machine with deactivated "Complete" state.
Example: Deactivating the "Complete" state deletes the respective "Reset" edge, the "Completing" state and its post edge.
4.3.7.2 Methods for changing over the states
The ApplicationTemplate PackML contains predefined methods to change over the states of the state machine. The following section provides an overview of all methods: An overview of the
methods (91)

4.3.8 Alarmhandling (error handling)

The ApplicationTemplate PackML contains a predefined alarm handling. This error handling provides mechanisms which serve to define and trigger reactions (errors, warnings, messages) in the module applications (ModApps) of the machine modules (MM).
Further mechanisms of the alarm handling 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: Alarm handling (error handling)
(76)
24
Lenze · ApplicationTemplate PackML · 1.0 EN - 05/2014
Structuring the automation system: Standard procedure
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

5 Structuring the automation system: Standard procedure

This section describes the standard procedure to create an application with the »PLC Designer« based on the ApplicationTemplate PackML.
• 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 PackML and to program it effectively.
• Due to the structured layout of the ApplicationTemplate PackML (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.
Step Activity What 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. (27)
Lenze · ApplicationTemplate PackML · 1.0 EN - 05/2014 25
Structuring the automation system: Standard procedure
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Step Activity What has to be done? Description
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: Assigning MAP subfunction to the tasks (28)
• 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 (53)
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 machine modules: Copy/insert
machine module templates (41)
• 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 PackML · 1.0 EN - 05/2014 27
Structuring the automation system: Standard procedure
Structuring within a machine module: Assigning MAP subfunction to the tasks
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

5.2 Structuring within a machine module: Assigning MAP subfunction to the tasks

In order to create a clearly arranged module application, it is advisable to divide the module applications (MAPs) into subfunctions and to structure them correspondingly.
• Each machine module contains three module applications MAP 1-3 which can be assigned to tasks differently prioritised.
• Task and module application are assigned in the A11_ModuleAppCalls folder. The
assignment can be made by right-clicking the folder: With command Create Task Call .
Assigning the module application (ModApp) to the task
In a first step, the functions are to be assigned to the individual tasks. The ApplicationTemplate PackML supports multitasking with three tasks. More information can be found under:
Multitasking
Predefined tasks
Task/priority Standard value To be used for... (example)
"High"
"Mid"
"Free"
One module application can be used per task.
• Task and module application are assigned in the A11_ModuleAppCalls folder.
(82)
2 ms Execution of Motion functions
HighPriority
6 ms Conversion for an external visualization
MidPriority
Unsolicited Communicating via NRT Ethernet
Unsolicited
(43)
28
•The MAC_Task_High program part for instance calls all module applications which are to
pass through a high priority task Task_High.
Lenze · ApplicationTemplate PackML · 1.0 EN - 05/2014
Structuring the automation system: Standard procedure
Structuring within a machine module: Assigning MAP subfunction to the tasks
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[5-2] Sample project ApplicationTemplate Counter: MAC_Task_High calls the Module1_App1 module application.
Lenze · ApplicationTemplate PackML · 1.0 EN - 05/2014 29
Overview - the folder structure in the ApplicationTemplate PackML
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

6 Overview - the folder structure in the ApplicationTemplate PackML

The Lenze ApplicationTemplate PackML facilitates programming with the »PLC Designer«. The ApplicationTemplate PackML has the following structure:
A10_MachineModuleTree (MMT)
The Machine module tree maps the mechatronic functionality of the machine structure in the form of machine modules (MM).
A11_ModuleAppCalls (MAC)
...contains the assignments of module applications (MAP) to the tasks. Assigning the module application (ModApp) to
the task (43)
A12_PackML_Configuration
...contains the configuration of the operating modes and the state machine. Predefined operating modes in ModApp1
(20)
A20_Visualisation
...contains the visualizations for the device-independent functions. Getting started - operating the
ApplicationTemplate PackML (35)
A55_VarLists
...contains the declarations of the global variables:
• Machine modules used: MM_Dcl
•IO variables: MM_IO
• Parameters: MM_Par
• Variables for an external visualization: MM_Vis
• Persistent data: MM_PD
A66_EmptyModule_PackML
• ...contains the source data of the machine modules
•...contains the EmptyModule_PackML template for
creating your own machine modules. Creating machine
modules: Copy/insert machine module templates (41)
A70_MachineModuleSources
• ...contains the individually created machine modulesMachine modules (MM)
• ...contains the visualization of the machine modules.
(16)
A71_LocalSources
...contains machine-independent enumerations, function blocks, structures, visualisations.
A75_UserTags
...contains data elements to be defined individually that can be programmed additionally. User Tags: Defining own
data elements (59)
A90_Resources
...contains the system information such as:
•task settings,
• used libraries,
• Recipe manager,
•Visualization manager.
Loading...
+ 69 hidden pages