Siemens
Industry
Online
Support
APPLICATION EXAMPLE
TIA Portal V19 Application
example for SIMATIC control
Function Library V3.0 and
SIMATIC MTP Creator V4.0.
CFL & MTP Creator / 3.0 & 4.0
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 under
https://www.siemens.com/cert.
Entry ID: 109814588 | V4.0 | 08/2024 © Siemens 2024 | 2
Table of contents
Table of contents
1. Introduction ...................................................................................................................................5
1.1. Overview ..................................................................................................................................................... 5
1.2. Mode of operation ........................................................................................................................................ 5
1.3. Components used ........................................................................................................................................ 5
2. Description of the project ...............................................................................................................6
2.1. CFL control modules ..................................................................................................................................... 6
2.2. PLC program structure .................................................................................................................................. 7
2.2.1. 01_Main ...................................................................................................................................................... 7
2.2.2. 02_CFL......................................................................................................................................................... 7
2.2.3. 03_Simulation .............................................................................................................................................. 8
2.2.4. 04_Program ................................................................................................................................................. 8
2.2.5. 05_ProDiag .................................................................................................................................................. 8
2.3. WinCC Unified Screens .................................................................................................................................. 8
2.4. Simulation Program Concept ......................................................................................................................... 9
2.4.1. Opening locks and layers .............................................................................................................................. 9
2.4.2. Values simulation ......................................................................................................................................... 9
2.5. Automatic program description ................................................................................................................... 10
2.5.1. PID control of pump M0013 ........................................................................................................................ 10
2.5.2. PID control of analogue valve Y0003 ........................................................................................................... 10
2.5.3. Program initiation and termination .............................................................................................................. 10
2.5.4. Filling and emptying of the tank BA001 ....................................................................................................... 10
2.5.5. Heating and cooling of the BA000 ............................................................................................................... 10
3. Initiating project runtime .............................................................................................................11
3.1. PLC simulation............................................................................................................................................ 11
3.1.1. PLCSIM Advanced ....................................................................................................................................... 11
3.1.2. TIA Portal ................................................................................................................................................... 11
3.2. WinCC Unified RT ........................................................................................................................................ 12
3.2.1. TIA portal ................................................................................................................................................... 12
3.2.2. Web browser .............................................................................................................................................. 13
3.3. Frequent issues .......................................................................................................................................... 14
3.3.1. IP Address .................................................................................................................................................. 14
3.3.2. PG/PC interface ........................................................................................................................................... 14
4. MTP File .......................................................................................................................................15
Entry ID: 109814588 | V4.0 | 08/2024 © Siemens 2024 | 3
Table of contents
5. Appendix .....................................................................................................................................16
5.1. Service and support .................................................................................................................................... 16
5.2. Links and literature ..................................................................................................................................... 17
5.3. Change documentation .............................................................................................................................. 17
Entry ID: 109814588 | V4.0 | 08/2024 © Siemens 2024 | 4
Introduction
1. Introduction
This application example for SIMATIC Control Function Library (CFL) implements majority of the blocks offered in CFL and
serves as the showcase for process control tasks. Part of the example is a simulation of the process values based on the
states of the control blocks directly within a PLC program. The application example can be used with SIMATIC MTP Creator
to generate a MTP file according to standard series VDI/VDE/NAMUR 2658.
1.1. Overview
The application example project demonstrates the practical usage of CFL. It can serve as a demonstration of good practice
for a library implementation in TIA Portal engineering. It consists of a PLC program and a WinCC Unified screen. It is
possible to run the simulation with PLCSIM Advanced and WinCC Unified PC runtime. The application example shows the
implementation of a heated reactor demo, which is also used in VDI/VDE/NAMUR 2658 part 2. The PLC program contains
blocks for process values simulation and an automatic program which runs in infinite loop.
1.2. Mode of operation
The CFL supports MTP export with the SIMATIC MTP Creator TIA portal AddIn. MTP is used for fast implementation of
modules into the process orchestration layer (e.g. SIMATIC MTP Integrator). The MTP concepts are standardized in
VDI/VDE/NAMUR 2658. These standards use an example of a "Stirred Tank Reactor" which served as a template for the
demo project.
1.3. Components used
This application example has been created with the following hard- and software components:
Component Amount Article Number Note
TIA Portal V19 Upd2 1 6ES7810-5CE16-0YB5 Engineering tool
WinCC Unified V19 Upd 2 1 6AV2153-2FB02-3LA5 HMI Engineering tool and RT
S7-PLCSIM Advanced V6.0 1 6ES7823-1FA05-0YA5 PLC-Simulation software
CFL RT V3.0 1 6AV2155-0PM02-3LB0 Library for TIA Portal
CFL HMI RT V3.0 1 6AV2156-0HM02-3LB0 Runtime for visualization system
MTP Creator V4.0 1 6AV2156-0EM02-3LA0 Add-In for TIA Portal
You can purchase these components from the Siemens Industry Mall.
This application example consists of the following components:
Component File name Note
Documentation 109814588_Example_for_SIMATIC_CFL_and_MTP_Creator_DOC_V40_en.pdf This document
TIA Portal Project 109814588_Example_for_SIMATIC_CFL_and_MTP_Creator_PROJ_V40.zip
Entry ID: 109814588 | V4.0 | 08/2024 © Siemens 2024 | 5
Description of the project
2. Description of the project
The project implements a S7-1500 PLC (PLC_1) and a WinCC Unified PC RT (HMI_RT_1) with an HMI created according to
the WinCC Unified Template Suite. The PLC serves as controller for all CFL blocks and as the monitored values simulator. It
could also provide an automatic program control loop which serves as a demonstration of automatic operation.
Device name Device type IP Address
PLC_1 SIMATIC CPU 1513-1 PN 192.168.0.2
HMI_RT_1 SIMATIC WinCC Unified PC 192.168.0.1
Between both devices the PROFINET connection PN/IE_1 is established.
2.1. CFL control modules
The following table lists all the CFL blocks implemented with the description of their process function in the demo. Each
control module is represented in the project by instance DB in the PLC program and symbolic faceplate on the HMI screen
(01_Demo).
Component CFL FB Description
AnaBA000 AnaManInt Setting the temperature of the output from BA000
BinBA000 BinManInt Start heating of the tank BA000
L0007 BinMon False if tank BA001 is overfilled
L0005 AnaMon Level of the tank BA001
P0008 AnaMon Pressure in the inlet to the tank BA001
P0012 AnaMon Pressure in front of the pump M0013
P0014 AnaMon Pressure behind the pump M0013
F0016 AnaMon Flowrate behind the pump M0013
T0009 AnaMon Temperature in the tank BA001
M0013 MonAnaDrv Pump for the emptying of tank BA001
M0014 MonBinDrv Exhaust gas pump for tank BA001
AB001 MonBinVlv Outlet valve from heated tank BA000
AB002 MonBinVlv Inlet valve to heated tank BA000
AB052 MonBinVlv Outlet valve from stirred tank BA001
AB056 MonBinVlv Valve opening way to product outlet
PID01 PIDCtrl PID controller for flowrate F0016 based on revolution speed of M0013
Y0001 MonAnaVlv Analogue valve to heated tank BA000
Y0003 MonAnaVlv Analogue valve from heated tank BA000
Entry ID: 109814588 | V4.0 | 08/2024 © Siemens 2024 | 6
Description of the project
Component CFL FB Description
Y0004 MonAnaVlv Analogue valve to stirred tank BA001 from Raw Material inlet
Y0006 MonAnaVlv Analogue valve opening way to cycle outlet
Y0017 MonAnaVlv Analogue valve opening way to Waste outlet
PID02 PIDCtrl PID controller for position of Y0003 based on temperature T0009
2.2. PLC program structure
The PLC program is structured into the following groups.
2.2.1. 01_Main
The main [OB1] block calls only "Demo" [FB1] (with instance "InstDemo" [DB1]) that contains calls of all CFL blocks and
Simulation FBs. The "Configuration" [DB5] database contains all the configuration data for the CFL blocks. "HMIControl"
[DB2] provides an interface for additional tags exchanged with HMI screens. "PeaInformationLabel" [DB45] is a mandatory
DB to export the MTP file with SIMATIC MTP Creator, it contains basic information about PEA.
"ModuleTypePackageRevision" [DB65] is also a mandatory data block for MTP Creator, it contains the version number of
the MTP file.
2.2.2. 02_CFL
In the "02_LCFL" folder all the CFL instances and blocks from the library folder are stored.
Entry ID: 109814588 | V4.0 | 08/2024 © Siemens 2024 | 7
Description of the project
2.2.3. 03_Simulation
The "03_Simulation" folder contains FBs for process values simulation and their instances, also where the complete
simulation program is stored.
2.2.4. 04_Program
The Function blocks in "04_Program" folder contains FBs with a sequence of automatic procedures that can be triggered
from HMI screen.
2.2.5. 05_ProDiag
The "05_ProDiag" folder contains a function block "ProDiagFB" [FB2] (with instance "InstProDiag" [DB4]), and an
organization block "ProDiagOB" [OB250] for ProDiag alarm management.
2.3. WinCC Unified Screens
The demo for WinCC Unified uses the WinCC Unified Template Suite structure. Complete monitoring is implemented on
the screen "10_Application". This screen contains a process visualization of the "Stirred Tank Reactor". The CFL function
blocks in the PLC program are connected to the symbolic faceplates.
All connections to CFL block instances are defined in the HMI Tag table "Demo". Alarm management is implemented using
the ProDiag functionality.
Entry ID: 109814588 | V4.0 | 08/2024 © Siemens 2024 | 8
Description of the project
2.4. Simulation Program Concept
The goal of the 03_Simulation FBs is to simulate real process behavior based on states of the control modules and internal
states of the Heater and Reactor. These states are influenced, for example, by switching of valve positions, turning on/off
drive, or changing input values.
2.4.1. Opening locks and layers
To simplify the switch of all control modules into manual control of the blocks, directly after the PLC initiation, buttons for
unlocking all locks and setting correct OS layer for all the blocks were implemented and their logic is programmed in
"OpeningLocksAndSettingLayers" [FB5].
2.4.2. Values simulation
All simulation calculations of the monitored values are performed by the "PVSimulation01" [FB3] and "PVSimulation02"
[FB10] blocks, which are executed every cycle in "Demo" [FB1].
All the CFL instances blocks used in the demo are connected to the instances of those FBs. "PVsimulation01" and
"PVSimulation02" are called in the Demo function in the network called Simulation. Each FB is divided into a few regions.
Entry ID: 109814588 | V4.0 | 08/2024 © Siemens 2024 | 9
Description of the project
2.5. Automatic program description
The program in this demo does not includes MTP file exporting according to VDI/VDE/NAMUR 2658 part 4. Therefore, it
cannot be classified as a MTP service. The program function blocks in this project are executed in an infinite loop while
the START PROGRAM button is pressed in HMI. The execution stops only when STOP PROGRAM button is pressed in HMI.
The program itself is divided into three FBs. Function code for initiation and termination of the program (START PROGRAM
and STOP PROGRAM) is in "ProgramInitiation&Termination" [FB4], Function logic for Heater and Reactor program is in
"HeaterAutomationProgram" [FB7] and "ReactorAutomationProgram" [FB8]. All the code in each function block is also
divided into a few regions.
2.5.1. PID control of pump M0013
This region ensures transition of process value and manipulated value into and out of PID01 block.
2.5.2. PID control of analogue valve Y0003
This region ensures transition of process value and manipulated value into and out of PID02 block.
2.5.3. Program initiation and termination
This region ensures setting up state and source channels for all the control modules. When the program is started, the
state channels are set to Automatic and source channels to Internal. When the program is stopped the "stateAutomatic" is
set to false as well as "sourceInternal".
2.5.4. Filling and emptying of the tank BA001
This region ensures cyclical change of tank BA001 state as well as subsequent opening ang closing of valves. M0014 is set
to running state during emptying state of BA001. Setpoint for PID01 process value F0016 is changes dynamically in
dependence of current state of BA001. During emptying, M0013 is running and during filling the pump is in stop mode.
2.5.5. Heating and cooling of the BA000
In this region of the FB Program, the handling of heater BA000 statuses cycle is done. It operates independently to
previous region. There are 3 automated statuses: Fast heating, Slow heating and Cooling. The program control status of
following control modules: BinBA000, AB001 and AB002. The input of AnaBA000 is also controlled by this function when
program is running.
Entry ID: 109814588 | V4.0 | 08/2024 © Siemens 2024 | 10
Initiating project runtime
3. Initiating project runtime
3.1. PLC simulation
This application example can run on a simulated PLCSIM Advanced instance. It is also possible to use real SIMATIC
S7-1500 PLC for running the project.
3.1.1. PLCSIM Advanced
1. Open PLCSIM Advanced
2. Configure the instance and start it.
3.1.2. TIA Portal
1. Open TIA Portal.
2. Unpack the downloaded file and then browse for the TIA Portal project.
3. Select PLC_1 and click on download to device.
Entry ID: 109814588 | V4.0 | 08/2024 © Siemens 2024 | 11
Initiating project runtime
4. Select the correct PG/PC interface and click on load.
5. Make sure you select "Start module" on the last popup, then click "Finish".
3.2. WinCC Unified RT
3.2.1. TIA portal
1. At the recently opened project in TIA portal select the PC system device and click on the download icon.
2. At the pop-up window, select Use device name and type "localhost", click on connect and then click on load.
Entry ID: 109814588 | V4.0 | 08/2024 © Siemens 2024 | 12
Initiating project runtime
3. On the next screen select "Full download", "Start Runtime" and uncheck the box for "Keep current user administration
in runtime". Once all selections are done press Load.
4. Open the program SIMATIC Runtime Manager.
5. Check if the project is running. If the project is not listed, press the refresh button. If the project’s traffic light is red,
then press the play button to start it.
3.2.2. Web browser
1. Start your web browser and open the website "https://hostname" (replace hostname for your PC name)
2. Click on WinCC Unified RT
3. Enter the credentials:
User Password
Administrator Siemens123
User Siemens1
4. If you have successfully downloaded the project, you should visualize the Heated Reactor screen.
Entry ID: 109814588 | V4.0 | 08/2024 © Siemens 2024 | 13
Initiating project runtime
3.3. Frequent issues
3.3.1. IP Address
Make sure that your PC has the same IP range in which the PLC is running at 192.168.1.xx
3.3.2. PG/PC interface
In the control panel verify that the communication interface is routed through the correct network card in case your PC
has several networks.
Entry ID: 109814588 | V4.0 | 08/2024 © Siemens 2024 | 14
MTP File
4. MTP File
1. Start the MTP Creator Add-in by opening the interface on the right side of the TIA Portal program.
2. To generate the MTP file of the project you need to right click on the PLC device, select the MTP menu and click on the
export MTP file option.
3. A website with the result log will open, you can locate the MTP file path on the header of it.
Entry ID: 109814588 | V4.0 | 08/2024 © Siemens 2024 | 15
Appendix
5. Appendix
5.1. Service and support
SiePortal
The integrated platform for product selection, purchasing and support - and connection of Industry Mall and Online
support. The SiePortal home page replaces the previous home pages of the Industry Mall and the Online Support Portal
(SIOS) and combines them.
• Products & Services
In Products & Services, you can find all our offerings as previously available in Mall Catalog.
• Support
In Support, you can find all information helpful for resolving technical issues with our products.
• mySieportal
mySiePortal collects all your personal data and processes, from your account to current orders, service requests and
more. You can only see the full range of functions here after you have logged in.
You can access SiePortal via this address: sieportal.siemens.com
Technical Support
The Technical Support of Siemens Industry provides you fast and competent support regarding all technical queries with
numerous tailor-made offers – ranging from basic support to individual support contracts.
Please send queries to Technical Support via Web form: support.industry.siemens.com/cs/my/src
SITRAIN – Digital Industry Academy
We support you with our globally available training courses for industry with practical experience, innovative learning
methods and a concept that’s tailored to the customer’s specific needs.
For more information on our offered trainings and courses, as well as their locations and dates, refer to our web page:
siemens.com/sitrain
Industry Online Support app
You will receive optimum support wherever you are with the "Industry Online Support" app. The app is available for iOS
and Android:
Entry ID: 109814588 | V4.0 | 08/2024 © Siemens 2024 | 16
Appendix
5.2. Links and literature
No. Topic
\1\ Siemens Industry Online Support
https://support.industry.siemens.com
\2\ Link to this entry page of this application examplehttps://support.industry.siemens.com/cs/ww/en/view/109814588
\3\ Sales and delivery release: SIMATIC Control Function Library (CFL) V2.0
https://support.industry.siemens.com/cs/ww/en/view/109825459
\4\ HMI design with the HMI Template Suite (WinCC Unified Template Suite)
https://support.industry.siemens.com/cs/ww/en/view/91174767
\5\ Sales and delivery release for SIMATIC MTP Creator 3.0
https://support.industry.siemens.com/cs/ww/en/view/109823190
\6\ Delivery release WinCC Unified V18
https://support.industry.siemens.com/cs/ww/en/view/109813587
\7\ Modular production with "Module Type Package (MTP)" - Module design with TIA Portal
https://support.industry.siemens.com/cs/ww/en/view/109783062
\8\ TIA Portal V17 Application Example with SIMATIC Process Function Library V2.0 SP2
https://support.industry.siemens.com/cs/ww/en/view/109810699
\9\ Manual: SIMATIC STEP 7 Professional / WinCC Unified SIMATIC Control Function Library
https://support.industry.siemens.com/cs/ww/en/view/109826853
5.3. Change documentation
Version Date Modification
V1.0 08/2024 First version
V1.1 12/2022 Application example updated to new versions of SIMATIC CFL and SIMATIC MTP Creator
V2.0 07/2023 Major update for SIMATIC CFL V1.1 SP1
V3.0 01/2024 Major update for SIMATIC CFL V2.0
V4.0 08/2024 Update example project to TIA Portal V19
Entry ID: 109814588 | V4.0 | 08/2024 © Siemens 2024 | 17