TIA Portal V17 Application Example With SIMATIC Process Function Library
TIA Portal V17 Application Example With SIMATIC Process Function Library
Application Example
with SIMATIC Process
Function Library V2.0
Siemens
SIMATIC Process Function Library (PFL) V2.0 SP1 Industry
Online
https://support.industry.siemens.com/cs/ww/en/view/109805499 Support
Legal information
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
© Siemens AG 2022 All rights reserved
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.
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 2
Table of contents
Table of contents
Legal information ..................................................................................................... 2
1 Introduction .................................................................................................... 5
1.1 Overview ........................................................................................... 5
1.2 Mode of operation.............................................................................. 5
1.3 Components used ............................................................................. 5
2 How to use the SIMATIC Process Function Library V2.0 SP1 ...................... 6
2.1 Library ............................................................................................... 6
2.1.1 Library download and import .............................................................. 6
2.1.2 Usage of SIMATIC Process Function Library block/data types ........... 8
2.1.3 Usage of SIMATIC Process Function Library visualization ............... 11
3 TIA Portal V17 Application Example with SIMATIC Process Function
Library ........................................................................................................... 25
3.1 Project Setup ................................................................................... 25
3.1.1 Hardware Configuration ................................................................... 26
3.1.2 Software .......................................................................................... 26
3.1.2.1 Program blocks................................................................................ 26
3.1.2.2 Simulation ....................................................................................... 27
3.1.2.3 MTP Services .................................................................................. 28
3.1.2.4 HMI Runtime ................................................................................... 35
© Siemens AG 2022 All rights reserved
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 3
Table of contents
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 4
1 Introduction
1 Introduction
1.1 Overview
This documentation gives a small practical overview over the Process Function
Library V2.0 SP1 and its components. It also gives an overview and an explanation
about the application example for the MTP TIA Portal project and how it works.
With this project the SIMATIC Process Function Library is shown, how they work
and how you can use them. You see how it needs to be configured in the Service
Engineering Tool and what is necessary in the TIA Portal for their usage.
software components:
Table 1-1
Component Note
Windows 10 Enterprise LTSC 2019
TIA V17 Upd2
WinCC Unified V17
S7-PLCSIM Advanced V4.0
SIMATIC Process Function Library V2.0 SP1
(The update 2 or update 1 of TIA V17 is mandatory, otherwise the project can´t be
opened)
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 5
2 How to use the SIMATIC Process Function Library V2.0 SP1
2.1 Library
In the following chapter the general handling of the library is shown. Especially how
the user can use the included objects and bring them to visualization in runtime.
The description starts with a TIA project which includes a PLC [CPU 1513-1 PN],
an IO device_1 [ET200SP] and a PC-System [SIMATIC PC station]. All devices are
connected via PN/IE and one HMI connection.
© Siemens AG 2022 All rights reserved
The following chapter describes how to include the SIMATIC Process Function
Library into the project and how you can use it.
Download and install the SIMATIC Process Function Library on your target system
which should fulfill the Software and Hardware prerequisite.
You can find the software with the following link:
https://support.industry.siemens.com/cs/ww/en/view/109805499
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 6
2 How to use the SIMATIC Process Function Library V2.0 SP1
After the installation the SIMATIC Process Function Library is in the following
folder:
Open the two libraries in your TIA Portal environment. For that open the menu
“Global libraries” on the right side. Open the explorer window with the “Open global
library” button. Choose the global library in the field “Files of type”. Select the
library and press “Open”. Store the library in a separate folder. Repeat this for the
second library.
© Siemens AG 2022 All rights reserved
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 7
2 How to use the SIMATIC Process Function Library V2.0 SP1
The following chapter describes how the library objects can be used in the PLC
[CPU 1516-3 PN/DP].
1. Open the folders for the block types in the library on the right side. Select the
PFL-block types “PIDConL”, “MotL”, “MotSpdCL”, “VlvL”, “AccuS”, “MonAnL”
and “MonDiL” and shift them via drag & drop to the program blocks of the PLC
[CPU 1516-3 PN/DP].
© Siemens AG 2022 All rights reserved
2. After the PFL-block types are copied to the program blocks, the functions
“ChkREAL” and “SelST16” are copied automatically to the program blocks
because these functions are used into the PFL-block types.
3. After the PFL-block types are copied to the program blocks the CPU data types
“AnaVal”, “AnaValFF”, “DigVal”, “DigValFF”, “DigValT”, “DigValTFF” and
“ScaVal” are copied automatically to the PLC data types because these data
types are also used into the PFL-block types.
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 8
2 How to use the SIMATIC Process Function Library V2.0 SP1
4. After the PFL-block types are copied to the program blocks the HMI data types
“HMI_AccuS”, “HMI_MonAnL”, “HMI_MonDiL”, “HMI_MotL”, “HMI_MotSpdCL”,
“HMI_PIDConL” and “HMI_VlvL” are copied automatically to the PLC data
types because these data types are also used into the PFL-block types.
5. Add the PLC alarm text lists via drag & drop from the PFL to your project. It is
located unter “PLC_1 > PLC alarm text lests”
© Siemens AG 2022 All rights reserved
6. Add all alarm classes via copy & paste from the PFL to your project. It is
located into “Common data” > “Alarm classes”
7. Go to the folder “Program blocks” and click on the right mouse button to add a
new block.
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 9
2 How to use the SIMATIC Process Function Library V2.0 SP1
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 10
2 How to use the SIMATIC Process Function Library V2.0 SP1
In the following chapter it is described how the library objects are used in the PC-
System [SIMATIC PC station].
1. All faceplates from the library folder “PFL–Visualization” should be added to
the project library over the context menu of the “Visualization” folder in the
global library.
© Siemens AG 2022 All rights reserved
2. Add the master copies from the SIMATIC Process Function Library via copy &
paste to your project library
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 11
2 How to use the SIMATIC Process Function Library V2.0 SP1
3. All common HMI tables from the library folder “Common” should be copied via
drag & drop to the folder “HMI tags” under the HMI_RT of the PC station.
4. All screens from the library folder “Common” should be copied via drag & drop
to the folder “Screens” under the HMI_RT of the PC station.
© Siemens AG 2022 All rights reserved
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 12
2 How to use the SIMATIC Process Function Library V2.0 SP1
5. The scheduled tasks “Tact500ms” from the library folder “Tact” should be
copied via drag & drop to the Scheduled tasks under the HMI_RT of the PC
station. This task is used to toggle the internal HMI-Tag “tact500ms”.
© Siemens AG 2022 All rights reserved
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 13
2 How to use the SIMATIC Process Function Library V2.0 SP1
7. Add a new tag table “PLCTags” with a click on the left mouse button.
8. Move the instance data blocks from the program blocks folder via drag & drop
to the tag table. With that step all tags from the PLC are configured because all
tags are stored in a separate data structure.
© Siemens AG 2022 All rights reserved
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 14
2 How to use the SIMATIC Process Function Library V2.0 SP1
9. Place the faceplate types with “_Icon” into the “Screen” window.
10. Select the faceplate icon instance and go to the properties. Under the interface
the first connection needs to be set to the DataHMI-Tag of the cooresponding
instance. In this example the faceplate icon instance is the “PIDConL”. So it
© Siemens AG 2022 All rights reserved
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 15
2 How to use the SIMATIC Process Function Library V2.0 SP1
11. For the next interface tag an internal tag is required. Add a new tag table
“TagNames” with a click on the left mouse button.
12. Create an internal tag for every instance and set a unique tag name into the
start value. It is important that there is a “/” in the text string. Before the “/” there
© Siemens AG 2022 All rights reserved
should be the PLC name where the instance is located. After the “/” it should
be the same name as the instance data block in the PLC. This is very
important because this name is also used for the message windows and to
setup the corresponding message filter.
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 16
2 How to use the SIMATIC Process Function Library V2.0 SP1
13. The “TagName” of the interface can now be connected to the internal tag. In
this example it relates to “PIDConL_Name”. Confirm that step with the green
hook.
14. For the next interface tag an internal tag is required. Add a new tag table
© Siemens AG 2022 All rights reserved
“TagComments” with a click on the left mouse button. This tag interface can
also be set empty. In this case the default comment will be shown in the
faceplate.
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 17
2 How to use the SIMATIC Process Function Library V2.0 SP1
15. Create an internal tag for every instance and set a comment.
16. The “TagComment” of the interface can now be connected to the internal tag.
In this example it relates to “PIDConL_Comment”. Confirm that step with the
green hook.
© Siemens AG 2022 All rights reserved
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 18
2 How to use the SIMATIC Process Function Library V2.0 SP1
17. The interface tag “TagVisibilty” relates to the internal tag “TagVisibilty”. This
internal tag should be used for all faceplate instances. This tag is used to hide
& unhide the tag name of the block icon. Confirm that step with the green hook.
18. The interface tag “MessageCmd” relates to the internal tag “MessageCmd”.
© Siemens AG 2022 All rights reserved
This internal tag should be used for all faceplate instances. This tag is used to
handle the call of the message window and to set the necessary message
filter. Confirm that step with the green hook.
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 19
2 How to use the SIMATIC Process Function Library V2.0 SP1
19. For every faceplate type an own list is imported. The corresponding operator
messages for the faceplate type are listed. The texts are multi-language
capable.
20. The interface object “MessageText” relates to the corresponding text lists. This
© Siemens AG 2022 All rights reserved
object is used to handle the operator message from the faceplate window. In
this example it relates to “PIDConL_3”. Confirm that step with the green hook.
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 20
2 How to use the SIMATIC Process Function Library V2.0 SP1
21. Some of the faceplate types have got the interface tag “BlinkTact” in addition
and it relates to the internal tag “tact500ms”. This internal tag should be used
for all instances. This tag is used for blinking several objects in the faceplate.
Confirm that step with the green hook.
© Siemens AG 2022 All rights reserved
22. Open the screen window “HideTagObject” and copy the button with the text
“Show/Hide Tag”.
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 21
2 How to use the SIMATIC Process Function Library V2.0 SP1
23. Paste the button with the text “Show/Hide Tag” into all screen windows. With
that button the tag names of all faceplate block icon can be shown hide or
unhide.
24. Open the screen window “MessagesObject” and copy the text field with the text
© Siemens AG 2022 All rights reserved
“MessageCmd”.
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 22
2 How to use the SIMATIC Process Function Library V2.0 SP1
25. Paste the text field with the text “MessageCmd” into all screen windows. With
that text field the message window is called, and the setup of the
corresponding message filter will be done.
26. As the last step the HMI_RT of PC-System [SIMATIC PC station] needs to be
© Siemens AG 2022 All rights reserved
compiled.
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 23
2 How to use the SIMATIC Process Function Library V2.0 SP1
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 24
3 TIA Portal V17 Application Example with SIMATIC Process Function Library
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 25
3 TIA Portal V17 Application Example with SIMATIC Process Function Library
The hardware configuration is built up with an 1513-1 CPU and a ET200-SP. For
the HMI runtime WinCC Unified V17 is in use.
© Siemens AG 2022 All rights reserved
3.1.2 Software
In total there are eight main program blocks for the functionality. They are located
in the folder “CleanerStation” For each process object is one function block. All of
them are programmed in FBD.
In the functions are always different networks for the different usages. The first
network is always used for interlocks or other functions for the main block. In the
second one you can find the main block like the “MotL” for the pump. And in the
last network is always the MTP block, which is connected to the SIMATIC Process
Function Library block. This MTP block is used as the interface out of the project to
another DCS. All networks are named after their usage.
Table 3-1
Blockname Usage
1. FIC100 PID control
2. FIT100 Flow measure
3. FIT100_Liters Pumped liters
4. LAH100 High Level
5. LAL100 Low Level
6. LIT100 Level measure
7. P100 Pump
8. V100 Valve
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 26
3 TIA Portal V17 Application Example with SIMATIC Process Function Library
3.1.2.2 Simulation
© Siemens AG 2022 All rights reserved
For the simulation there are four function blocks. These blocks are written in SCL.
Table 3-2
Function block Usage
1. CalcDose Calculates the pumped water in liter
2. Level Calculates the fill level of the tank
3. PT1 Opens the valve with PT1 behavior
4. Volumeflow Calculates the volume flow in l/s
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 27
3 TIA Portal V17 Application Example with SIMATIC Process Function Library
These blocks have their call in the corresponding simulation function in the folder
“Simulation”. In the first function “Flow_Sim” everything for the simulating the flow
is located. For example, the function blocks “Volumeflow” and “CalcDose” have
their call there. The same is for the function “Level_Sim” and “Vlv_Sim”. In the
“Level_Sim” the function block “Level” and the refill function are located. In the
function “Vlv_Sim” is the call of the PT1 controller for the opening and closing
behavior of the valve “V100”.
© Siemens AG 2022 All rights reserved
The Services are configured in two different tools, in the TIA Portal and in the
Service Engineering Tool. For general information about the Service Engineering
Tool a manual is delivered with the installation package of the SIMATIC Process
Function Library. It is in the following folder:
C:\Program Files\Siemens\Automation\SIMATIC Process Function
Library\V2.0.1.0\Manuals\en-US
In the chapter 12 Services all parameters and settings/configurations of the tool are
explained. In this document is only a general overview over the tool and the
explanation for the project specific configuration.
In the Service Engineering Tool, the general structure of the services is configured.
There you can define the global service parameters, the control modules, the
connection of the global parameter to the procedures, the steps, and the
procedures itself.
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 28
3 TIA Portal V17 Application Example with SIMATIC Process Function Library
© Siemens AG 2022 All rights reserved
For this project there are only two global parameters needed. Both are configured
in the “Procedure parameter” folder. The first one is “Flow_Cleaner”. This
parameter defines the volume flow for the service (Used in the DoseByFlow
service). The second parameter is “Liter”, this one defines the amount of liter,
which should get pumped out of the tank.
The configuration values for these parameters are also defined here. After the
export to the TIA Portal, they get stored in the corresponding DB for the global
service parameters. They can only be changed in the Service Engineering Tool
and needs to be exported to the TIA Portal afterwards. For example, the default
value or the max and min values/limits. For the “Flow_Cleaner” there is the default
value “25 l/s”, the high limit “32 l/s” and the low limit “0 l/s”. For “liters” the default
value is “1000 l”, the limits are “3200 l” (high) and “0 l” (low). The high limit/max
value is defined by the maximum fill level of the tank, and this is 3200l.
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 29
3 TIA Portal V17 Application Example with SIMATIC Process Function Library
For the process are seven different control modules available. These control
modules are bits in the ServiceControlBlockMedium, which are stored in the
“CmCommand” array. With these bits it is possible to activate the different states
and conditions of the objects and to define the process. The first one is responsible
to set all components in the manual mode. This is needed when the service is
done. The second one sets all components in the automatic mode. Before each
service can be started, the components need to be in automatic mode. The third,
the fourth and the fifths control module are for the procedures, so the main function
of each service. The fifths control module “Unhold” is used to define the operation
during the state “Unholding” of the service. The same is for the control module
“Hold”, “Stop”, “Pause” and “Resuming”.
In the folder Service parameter, the global parameters are connected to the
© Siemens AG 2022 All rights reserved
In the next folder “steps” is the configuration of the steps, which gets executed in
the different states of the procedure. In the project is one step for each control
module. So, there are seven steps. The step “Step_ModeMan”, “Step_ModeAut”,
“Step_Dose”, “Step_DoseFlow”, “Step_Emptying”, “Step_Unhold”, “Step_Hold”,
“Step_Stop”, “Step_Pause” and “Step_Resuming”. Each step is connected to its
corresponding control module and the options for “Command”, “Force” and “Check”
are activated for all.
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 30
3 TIA Portal V17 Application Example with SIMATIC Process Function Library
At the end is the configuration of the procedures. In this project are three of them.
The “DoseByVolume”, “DoseByFlow” and “DoseToEmpty” procedure. In each
procedure are the states “Starting”, “Running”, “Completing”, “Stopping” and
“Aborting” configured. The inserted steps in these states are almost the same for
© Siemens AG 2022 All rights reserved
all procedures. In the “Starting” state is always the step “Step_ModeAut”, in the
three states “Completing”, “Aborting” and “Resetting” is the step “Step_ModeMan”
configured. In the “Restarting” state is the step “Step_Unholding”, in the state
“Holding” is the step “Step_Holding”, in “Stopping” is the step “Step_Stop”, in
“Pausing” is the step “Step_Pause” and in the state “Resuming is the step
“Step_Resume” configured. In the “Running” state is in all three procedure the
specific step for the procedure inserted. For example, the step “Step_Dose” is in
the “Running” state of the “DoseByVolume” procedure.
In the TIA Portal you define, what is to do, when the different control modules are
activated and you need to define all DBs, where the information for the
configuration in the Service Engineering Tool is stored.
In the project are two main functions, in which almost the whole implementation for
the MTP services is located. It is the “CM_Interface” function block and the
“Service” function. In the “Service” function all needed blocks and functions have
their call, like the function blocks for the parameters and values, the data block for
the services, the control module interface function, or the safety function block for
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 31
3 TIA Portal V17 Application Example with SIMATIC Process Function Library
the services. The blocks for the parameters and values are used to store the
information of the global and local parameters, which are configured in the Service
Engineering Tool.
© Siemens AG 2022 All rights reserved
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 32
3 TIA Portal V17 Application Example with SIMATIC Process Function Library
© Siemens AG 2022 All rights reserved
In the “CM_Interface” function block is the conversion of the array bits to its
intended purpose. The block converts the bool and real values to the datatypes
“AnaVal” and “DigVal”. So, the outputs are named like their purpose, e.g. the bit,
which is intended to switch to manual mode, is called “Man_Mode”.
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 33
3 TIA Portal V17 Application Example with SIMATIC Process Function Library
The implementation of this mode switching, and the real implementation is to find in
the specific function for the different component. In the picture below you can see
the code for the pump. If the step “Step_ModeAut” is activated, the pump should
go in automatic mode. For the other components, like the PID controller, the Valve,
etc. it looks similar. For each step from the Service Engineering Tool is an
implementation for the components.
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 34
3 TIA Portal V17 Application Example with SIMATIC Process Function Library
© Siemens AG 2022 All rights reserved
In the HMI Runtime you have following structure. On the right side is the tank with
its level indicators and on the left are the valve, the pump, the PID controller and
the flow indicator. In the tank is the operating faceplate for refilling the tank. And on
the left side on top, with the orange area with the text “idle”, is the service control
faceplate.
This faceplate is also copied from the SIMATIC Process Function Library like the
blocks in chapter 3.1.2.3 MTP Services.
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 35
3 TIA Portal V17 Application Example with SIMATIC Process Function Library
With the button “Show/Hide Tag” it is possible to show or to hide the tags for all
components.
“Hide Tags”
“Show Tags”
© Siemens AG 2022 All rights reserved
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 36
3 TIA Portal V17 Application Example with SIMATIC Process Function Library
Start PLCSIM Adv with PLCSIM Virtual Eth. Adapter and add there a PLC S7-1500
with corresponding IP Address of the controller. Then start the controller.
© Siemens AG 2022 All rights reserved
Afterwards download all data via virtual Ethernet Adapter from AS.
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 37
3 TIA Portal V17 Application Example with SIMATIC Process Function Library
Select during the download following settings to delete possible legacy settings
from previous projects.
© Siemens AG 2022 All rights reserved
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 38
3 TIA Portal V17 Application Example with SIMATIC Process Function Library
To connect to the runtime Server, you need to enter the computer name of your
machine as URL. In this project it is “tiav17”.
If you want to change this, you just need to execute the “WinCC Unified
configuration” tool. There on the first page, you can configure these settings.
© Siemens AG 2022 All rights reserved
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 39
3 TIA Portal V17 Application Example with SIMATIC Process Function Library
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 40
3 TIA Portal V17 Application Example with SIMATIC Process Function Library
3.3 Remarks:
3.3.1 Setup Project Properties
Right mouse click on windows button and open control panel and open the
communication settings.
© Siemens AG 2022 All rights reserved
After the installation of the TIA Portal it will look like this:
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 41
3 TIA Portal V17 Application Example with SIMATIC Process Function Library
Which Access point you need/use in the TIA Portal can be checked in the
“Connections” Folder.
To configure the PG/PC interface, select the interface “Intel® 82574L Gigabit
Network Connection.TCPIP.3” for the S7Online Access point.
© Siemens AG 2022 All rights reserved
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 42
3 TIA Portal V17 Application Example with SIMATIC Process Function Library
Usually, the PLCSIM Virtual Ethernet adapter the ip address is not setup.
The IP Address of the PLCSIM Virtual Ethernet adapter must be in the same
subnet as the plant bus.
© Siemens AG 2022 All rights reserved
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 43
4 Services in the HMI
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 44
4 Services in the HMI
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 45
4 Services in the HMI
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 46
4 Services in the HMI
5. Refill process stops automatically if the tank is refilled. It is not possible to stop
the process
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 47
5 Additional information
5 Additional information
5.1 Convert blocks “BoolToDigVal” and “RealToAnaVal”
With the SIMATIC Process Function Library and the TIA Portal it is not possible to
write integer or boolean directly to the block and input. The reason for this is, that in
the TIA Portal each parameter/input/output has its own status. This status must
also be set to “16#80” that it can be written. Therefore, are two self-written
functions in the project. The first one is the “BoolToDigVal” (FC10). These blocks
convert the input of datatype “Bool” with the given status to the output with
datatype “DigVal”. This output can then be connected to the blocks in the project.
The second function “RealToAnaVal” (FC9) converts the input value with datatype
“Real” and the given status to the datatype “AnaVal”.
© Siemens AG 2022 All rights reserved
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 48
5 Additional information
5.2 AccuS_Liter
This block is responsible for the calculation of the pumped liters. It is a block out of
the SIMATIC Process Function Library and is called in the “CalcDose” function
block. The calculation of the pumped liters gets always restarted when the services
set the components of the process to the automatic mode.
© Siemens AG 2022 All rights reserved
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 49
5 Additional information
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 50
5 Additional information
If you want to make it possible for the operator to change them during the runtime,
you need to write the parameter directly into the instance DB as start value.
© Siemens AG 2022 All rights reserved
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 51
5 Additional information
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 52
5 Additional information
© Siemens AG 2022 All rights reserved
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 53
5 Additional information
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 54
6 Appendix
6 Appendix
6.1 Service and support
Industry Online Support
Do you have any questions or need assistance?
Siemens Industry Online Support offers round the clock access to our entire
service and support know-how and portfolio.
The Industry Online Support is the central address for information about our
products, solutions and services.
Product information, manuals, downloads, FAQs, application examples and videos
– all information is accessible with just a few mouse clicks:
support.industry.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:
siemens.com/SupportRequest
© Siemens AG 2022 All rights reserved
Service offer
Our range of services includes the following:
• Plant data services
• Spare parts services
• Repair services
• On-site and maintenance services
• Retrofitting and modernization services
• Service programs and contracts
You can find detailed information on our range of services in the service catalog
web page:
support.industry.siemens.com/cs/sc
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 55
6 Appendix
The Siemens Industry Mall is the platform on which the entire siemens Industry
product portfolio is accessible. From the selection of products to the order and the
delivery tracking, the Industry Mall enables the complete purchasing processing –
directly and independently of time and location:
mall.industry.siemens.com
TIA Portal V17 Example with SIMATIC Process Function Library V2.0
Entry-ID: 109810699, V2.0, 08/2022 56