Legal information
SIMATIC CPG Template
Entry-ID: 109475572, V1.0, 03/2019
2
© Siemens AG
2019 All rights reserved
Legal information
Use of application examples
Application examples illustrate the solution of automation tasks through an interaction of several
components in the form of text, graphics and/or software modules. The application examples are
a free service by Siemens AG and/or a subsidiary of Siemens AG (“Siemens”). They are non-
binding and make no claim to completeness or functionality regarding configuration and
equipment. The application examples merely offer help with typical tasks; they do not constitute
customer-specific solutions. You yourself are responsible for the proper and safe operation of the
products in accordance with applicable regulations and must also check the function of the
respective application example and customize it for your system.
Siemens grants you the non-exclusive, non-sublicensable and non-transferable right to have the
application examples used by technically trained personnel. Any change to the application
examples is your responsibility. Sharing the application examples with third parties or copying the
application examples or excerpts thereof is permitted only in combination with your own products.
The application examples are not required to undergo the customary tests and quality inspections
of a chargeable product; they may have functional and performance defects as well as errors. It is
your responsibility to use them in such a manner that any malfunctions that may occur do not
result in property damage or injury to persons.
Disclaimer of liability
Siemens shall not assume any liability, for any legal reason whatsoever, including, without
limitation, liability for the usability, availability, completeness and freedom from defects of the
application examples as well as for related information, configuration and performance data and
any damage caused thereby. This shall not apply in cases of mandatory liability, for example
under the German Product Liability Act, or in cases of intent, gross negligence, or culpable loss of
life, bodily injury or damage to health, non-compliance with a guarantee, fraudulent
non-disclosure of a defect, or culpable breach of material contractual obligations. Claims for
damages arising from a breach of material contractual obligations shall however be limited to the
foreseeable damage typical of the type of agreement, unless liability arises from intent or gross
negligence or is based on loss of life, bodily injury or damage to health. The foregoing provisions
do not imply any change in the burden of proof to your detriment. You shall indemnify Siemens
against existing or future claims of third parties in this connection except where Siemens is
mandatorily liable.
By using the application examples you acknowledge that Siemens cannot be held liable for any
damage beyond the liability provisions described.
Other information
Siemens reserves the right to make changes to the application examples at any time without
notice. In case of discrepancies between the suggestions in the application examples and other
Siemens publications such as catalogs, the content of the other documentation shall have
precedence.
The Siemens terms of use (https://support.industry.siemens.com) shall also apply.
Security information
Siemens provides products and solutions with industrial security functions that support the secure
operation of plants, systems, machines and networks.
In order to protect plants, systems, machines and networks against cyber threats, it is necessary
to implement – and continuously maintain – a holistic, state-of-the-art industrial security concept.
Siemens’ products and solutions constitute one element of such a concept.
Customers are responsible for preventing unauthorized access to their plants, systems, machines
and networks. Such systems, machines and components should only be connected to an
enterprise network or the Internet if and to the extent such a connection is necessary and only
when appropriate security measures (e.g. firewalls and/or network segmentation) are in place.
For additional information on industrial security measures that may be implemented, please visit
https://www.siemens.com/industrialsecurity.
Siemens’ products and solutions undergo continuous development to make them more secure.
Siemens strongly recommends that product updates are applied as soon as they are available
and that the latest product versions are used. Use of product versions that are no longer
supported, and failure to apply the latest updates may increase customer’s exposure to cyber
threats.
To stay informed about product updates, subscribe to the Siemens Industrial Security RSS Feed
at: https://www.siemens.com/industrialsecurity.
Table of contents
SIMATIC CPG Template
Entry-ID: 109475572, V1.0, 03/2019
3
© Siemens AG
2019 All rights reserved
Table of contents
Legal information ..................................................................................................... 2
1 Introduction .................................................................................................... 5
1.1 Overview ........................................................................................... 5
1.2 Mode of operation .............................................................................. 7
1.2.1 CPG Template Foundations ............................................................... 7
1.2.2 PackML State Machine Model............................................................ 7
1.2.3 PackML Mode Manager ..................................................................... 9
1.2.4 PackML Standard Interface (PackTags) ............................................. 9
1.2.5 S88 Make2Pack (modular design) ................................................... 10
1.2.6 CPG Template Event Manager ........................................................ 11
1.2.7 LPMLV30 Function Blocks ............................................................... 12
1.3 Understanding the CPG Template ................................................... 12
1.3.1 Make2Pack Division of Functions .................................................... 13
1.3.2 What is meant by “Summation”? ...................................................... 15
1.3.3 Overview of Programming Tasks ..................................................... 16
1.4 Components used ........................................................................... 19
2 Engineering .................................................................................................. 20
2.1 CPG Template Global Data Blocks .................................................. 20
2.1.1 Alarm............................................................................................... 20
2.1.2 Warning ........................................................................................... 21
2.1.3 Status .............................................................................................. 21
2.1.4 HMI_Data ........................................................................................ 22
2.1.5 HMI_Data_Custom .......................................................................... 23
2.1.6 PackML ........................................................................................... 24
2.1.7 PackTags ........................................................................................ 24
2.2 CPG Template Configuration Data Blocks........................................ 28
2.2.1 AlarmCfg ......................................................................................... 28
2.2.2 WarningCfg ..................................................................................... 29
2.2.3 StatusCfg ........................................................................................ 29
2.2.4 MessagePrefix ................................................................................. 30
2.2.5 PackMLCfg ...................................................................................... 30
2.3 Unit Machine Blocks ........................................................................ 32
2.4 Equipment Module Blocks ............................................................... 34
2.5 Control Module Blocks ..................................................................... 36
2.5.1 Control Module Programming Examples .......................................... 36
2.6 The EM Data Block .......................................................................... 40
2.7 LMPLV30 Supporting Blocks ........................................................... 43
2.8 CPG Supporting Blocks ................................................................... 44
2.8.1 CPG_Event ..................................................................................... 44
2.8.2 CPG_EventManager ........................................................................ 46
2.8.3 CPG_EventSummation .................................................................... 49
2.8.4 CPG_EventSummationBegin ........................................................... 52
2.8.5 CPG_EventSummationEnd.............................................................. 53
2.8.6 CPG_EventSortFilter ....................................................................... 54
2.8.7 CPG_AlarmHistory .......................................................................... 56
2.8.8 CPG_AlarmMove ............................................................................. 57
2.8.9 CPG_OEE ....................................................................................... 58
2.8.10 CPG_ModuleInitalize ....................................................................... 59
2.8.11 CPG_MsgScroll ............................................................................... 60
2.8.12 CPG_ArrayLength ........................................................................... 61
2.9 CPG Template Data types ............................................................... 62
2.9.1 CPG_typeEvent ............................................................................... 63
2.9.2 CPG_typeEventCfg ......................................................................... 63
2.9.3 CPG_typeEventStatus ..................................................................... 63
Table of contents
SIMATIC CPG Template
Entry-ID: 109475572, V1.0, 03/2019
4
© Siemens AG
2019 All rights reserved
2.9.4 CPG_typeEventSummation ............................................................. 65
2.9.5 CPG_typeMessagePrefix ................................................................. 66
2.9.6 CPG_typePackML_ModuleSts ......................................................... 66
2.9.7 CPG_typeParameterDINT ............................................................... 67
2.9.8 CPG_typeParameterReal ................................................................ 67
2.9.9 CPG_typeParameterString .............................................................. 67
2.9.10 CPG_typeProdCountDINT ............................................................... 68
2.9.11 CPG_typeSortFilter.......................................................................... 68
2.10 CPG Template Constants ................................................................ 69
3 HMI ................................................................................................................ 72
3.1 Screen layout .................................................................................. 72
3.2 Navigation ....................................................................................... 73
3.2.1 First level (primary navigation) ......................................................... 73
3.2.2 Second level (secondary navigation) ................................................ 74
3.2.3 Third level (optional) ........................................................................ 74
3.3 Numbering and naming screens ...................................................... 74
3.4 Adjusting the Navigation .................................................................. 77
3.4.1 Adjusting the number of second level topic buttons .......................... 77
3.4.2 Screen Templates ........................................................................... 77
3.4.3 Adjusting the second level topic button screen activation ................. 78
3.4.4 Adjusting the second level topic button text ...................................... 79
3.5 Functions/screens and their integration ............................................ 81
3.5.1 HMI Tags......................................................................................... 81
3.5.2 User Administration ......................................................................... 81
3.5.3 Scripts ............................................................................................. 83
3.5.4 Text List........................................................................................... 83
3.5.5 Graphic lists..................................................................................... 84
3.6 Preconfigured HMI Screens ............................................................. 85
3.6.1 Machine Control .............................................................................. 85
3.6.2 Settings ........................................................................................... 89
3.6.3 Alarms and Events .......................................................................... 91
3.6.4 Diagnostics ...................................................................................... 93
3.6.5 Formats ........................................................................................... 95
3.7 Multi-language ................................................................................. 95
4 Extending the template ................................................................................ 96
4.1 Adding a new Equipment Module ..................................................... 96
4.1.1 Adding the EM into the module summation ...................................... 99
4.1.2 Adding the EM into the event summation ....................................... 100
4.2 Adding a new Control Module to an existing EM ............................ 100
4.2.1 Creating supporting tags for the new CM ....................................... 103
5 Additional information ............................................................................... 108
5.1 Tips and Recommendations .......................................................... 108
5.1.1 Template Modifications .................................................................. 108
5.1.2 Global Memory .............................................................................. 108
5.1.3 Number of Event Languages ......................................................... 108
6 Appendix ..................................................................................................... 109
6.1 Service and support ....................................................................... 109
6.2 Application Support........................................................................ 110
6.3 Links and literature ........................................................................ 110
6.4 Change documentation .................................................................. 110
1 Introduction
SIMATIC CPG Template
Entry-ID: 109475572, V1.0, 03/2019
5
© Siemens AG
2019 All rights reserved
1 Introduction
1.1 Overview
State-of-the-art packaging machines and lines are extremely versatile and must
provide high throughput rates with the highest possible degree of flexibility.
Reducing the total cost of ownership and investment security are also crucial
issues. Big end customers expect machines from different vendors to have the
same usability and diagnostics. In addition, a standardized access to the machine
data from upper level systems must be guaranteed to be able to e.g. analyze
product flow, acquire machine operating hours or calculate performance data. The
key to achieving these objectives is adopting international standards.
This application template, known as the SIMATIC CPG Template, can be used as
a basis to implement an OMAC PackML compliant project and provides you with
the tested code with clearly defined interfaces, including an HMI template.
The SIMATIC CPG template combines the PackML guidelines for mode and states
management and standard interface (PackTags) together with the ISA-S88
Make2Pack modularity concept and an integrated alarming concept to provide you
with a ready to use solution for your OMAC compliant projects.
Key facts
The CPG template is an OMAC PackML compliant template project which includes
the following features: