Application Example TIA PFL Silo V18 en
Application Example TIA PFL Silo V18 en
Industry
Online
Support
APPLICATION EXAMPLE
SIMATIC MTP
Application Example
Silo
SIMATIC Process Function Library (PFL) V3.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 b etween 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.
3. TIA Portal V18 Application Example with SIMATIC Process Function Library ...................................25
6. Appendix .....................................................................................................................................60
1. Introduction
1.1. Overview
This documentation gives a small practical overview over the Process Function Library V3.0 and its components. It also
gives an overview and an explanation about the application example for the MTP TIA Portal project of the silo and how it
works.
With this project the SIMATIC Process Function Library is shown, how it works and how you can use it. You see how the
library needs to be configured in the Service Engineering Tool and what is necessary in the TIA Portal for its usage.
(The update 2 of TIA V18 is mandatory, otherwise the project can’t be opened)
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 [ET 200SP] and a PC-
System [SIMATIC PC station]. All devices are connected via PN/IE and one HMI connection.
After installation, the SIMATIC Process Function Library is located in the following folder:
C:\Program Files\Siemens\Automation\SIMATIC Process Function Library\V3.0.0.0
2. After the PFL-block types are copied to the program blocks folder, the functions "ChkREAL" and "SelST16" are copied
automatically into the program blocks folder, because these functions are used into the PFL-block types.
3. After the PFL-block types are copied to the program blocks folder, the CPU data types "AnaVal", "AnaValFF", "DigVal",
"DigValFF", "DigValT", "DigValTFF" and "ScaVal" are copied automatically to the PLC data types folder, because these
data types are also used into the PFL-block types.
4. After the PFL-block types are copied to the program blocks folder, 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 folder, 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. Drag them into the folder "PLC_1 > PLC alarm
text lists"
6. Add all alarm classes via copy & paste from the PFL to your project. Copy them into the folder "Common data" > "Alarm
classes"
7. Right-click onto the folder "Program blocks" and select the option "Add new block" to add a new block.
8. Select "Cyclic interrupt" from the organization blocks, choose "FBD" as language and insert this block via the "Ok"
button.
2. Add the master copies from the SIMATIC Process Function Library via copy & paste to your project library.
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.
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".
6. Copy the folder "HMITextLists" from the Project library to the "Text and graphic lists" under the HMI_RT of the PC
station.
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.
9. Place the faceplate types with the ending "_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 corresponding instance. In this example, the faceplate icon instance is the "PIDConL".
Therefore it must be connected with "PIDConL_DB_DataHMI". Confirm that step with the green checkmark.
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 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.
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 checkmark.
14. For the next interface tag an internal tag is required. Add a new tag table "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.
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 checkmark.
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
checkmark.
18. The interface tag "MessageCmd" relates to the internal tag "MessageCmd". 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 checkmark.
19. A separate list is imported for each faceplate type. 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 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
checkmark.
21. Some of the faceplate types have got the interface tag "BlinkTact" in addition, which 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 checkmark.
22. Open the screen window "HideTagObject" and copy the button with the text "Show/Hide Tag".
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 or hidden.
24. Open the screen window "MessagesObject" and copy the text field with the text "MessageCmd".
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 executed.
26. As the last step the HMI_RT of PC system [SIMATIC PC station] needs to be compiled.
3.1.2. Software
3.1.2.1. Program blocks
In total there are eleven main program blocks for the functionality. They are located in the folder "Silo". For each process
object, one function block is available. All of them are programmed in FBD.
In the functions, different networks are used for the different usages. The first network is always used for interlocks or
other functions for the main block. The second one contains the main block like the "MotL" for the pump. In the last
network, the MTP block is always included, which is connected to the SIMATIC Process Function Library block. This MTP
block is used as the interface directed outwards of the project to another DCS. All networks have been named according
to their usage.
Blockname Usage
P100 Pump
3.1.2.2. Simulation
For the simulation, four function blocks are available. These blocks are written in SCL.
Function block Usage
These blocks have their call in the corresponding simulation function in the folder "Simulation". In the first function
"Flow_Sim" everything for the simulation of the flow is located. For example, the function blocks "Volumeflow" and
"CalcDose" have their call there. The same applies for the function "Level_Sim". In the "Level_Sim" the function block
"Level" and the refill function are located.
Configuration parameter
The configuration parameter is called "PVconnected" and serves as the indicator if another PEA is connected. The default
value is true. So, if this parameter is false, the start command of the procedure "Dosing" is locked as well as the POs are
interlocked. You need to set it to true if you want to start it.
Procedure parameter
The first procedure parameter is "Pump speed". This parameter defines the speed of the pump during the dosing process.
The second parameter is "Dose liters", this one defines the number of liters, which should get pumped out of the tank. For
the "Pump speed" the default value is set to "1500 1/min", the high limit is "2500 1/min" and the low limit "0 1/min". For
"Dose liters" the default value is set to "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 which is 3200 l.
Report value
To be able to store this process value output a report value was configured. This report value is called "Report dosed
product". The value of the process value outputs will be automatically mirrored in the report values, so there is no need to
connect anything. The configuration only needs to be set up as it has been done before. So, the upper scale needs to be
set to "3200" and the unit is liter.
3.1.2.3.3. Service
For the process, four different control modules are 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 "CM_P100" is responsible for the
pump P100. The second CM "CM_V100" is for the valve V100. The third one is used for the valve V101 and is called
"CM_V101. And the last one is for the controller FIC100 and is called "CM_FIC100". With these bits, each of the control
modules in the project can be controlled. Since version V3.0 of the SIMATIC PFL, it is possible to link the control modules
to their corresponding data blocks in TIA Portal. Therefore, the needed type of data blocks needs to be fetched and
following that, they can be linked. The "CM_P100" for example is linked to the "P100DB".
In the folder "Service parameter", the global parameters are connected to the procedures of the project, except from the
configuration parameter. The "Pump speed" and "Dose liters" are connected to the "Dosing" procedure.
The process value input "External level", the process value output "Dosing speed" and the report value "Report dosed
product" are all connected to the "Dosing" procedure.
The next folder "Steps" contains the configuration of the steps, which are being executed in the different states of the
procedure. In this project, there is one step for each control module. So, there are seven steps, "Step_SetToAuto",
"Step_ExecuteProcess", "Step_SetToMan", "Step_Unholding", "Step_Holding", "Step_Pausing", "Step_Resuming" and
"Step_Resetting". Each step is connected to one or more of the control modules and the options for "Command", "Force"
and "Check" are activated for all except from the step "Step_Resuming". This one does not have the check option.
The last point is the configuration of the procedures. In this project, two procedure configurations are present, "Filling and
"Dosing". In each procedure, all states are configured. The inserted steps in these states are almost the same for all
procedures. In the "Starting" state the step "Step_SetToAuto" is always present, in the three states "Completing",
"Aborting" and "Stopping" the step "Step_SetToMan" is configured. The "Restarting" state contains the step
"Step_Unholding", the state "Holding" contains the step "Step_Holding", "Resetting" contains the step "Step_Resetting",
"Pausing" contains the step "Step_Pausing" and the state "Resuming" contains the step "Step_Resuming". In the "Running"
state in both procedures the step "Step_ExecuteProcess" is configured.
These blocks, like "ConfigurationParameters" or "ProcedureParameters" are copied from the SIMATIC Process Function
Library. It is the same for the "Dose_Setup", this one is also copied from the SIMATIC Process Function Library and
renamed afterwards. Which other blocks need to be copied from the SIMATIC Process Function Library can be seen in the
following picture.
The "CM_Interface" function block contains the conversion of the array bits to its intended purpose. The block converts
the bool and real values to the datatypes "AnaVal" and "DigVal". The outputs are named after their purpose, e.g. the bit,
which is intended to switch the pump P100 to manual mode, is called "ManMode_P100". This block also gives the process
value output "DosedProduct" its value out of the process.
The usage of the outputs of the CM_Interface block is implemented as well as the rest of the program logic of each
process object in the specific function for the different components. In the picture below you can see the code for the
pump P100. If the step "Step_SetToAut" is activated, the pump should go in automatic mode. For the other components,
like the PID controller, the Valve, etc. the code looks similar. For each step from the Service Engineering Tool, a
implementation for the components has been incorporated.
This faceplate is also copied from the SIMATIC Process Function Library like the blocks in chapter 3.1.2.3 "MTP Services".
With the button "Show/Hide Tag" it is possible to show or to hide the tags for all components.
"Hide Tags"
"Show Tags"
2. Afterwards download all data via virtual Ethernet Adapter from the AS.
2. Select following settings during downloading to delete possible legacy settings from previous projects.
7. If you want to change the name, you just need to execute the "WinCC Unified configuration" tool. On the first page,
you can configure these settings.
3.3. Remarks:
3.3.1. Setup Project Properties
2. After the installation of TIA Portal, the interface will look like this:
3. Which Access point you need/use in the TIA Portal can be checked in the "Connections" folder.
4. To configure the PG/PC interface, select the interface "Intel® 82574L Gigabit Network Connection.TCPIP.3" for the
S7Online Access point.
Dosing
This procedure doses the configured number of liters (1000 l) of the content of the tank with the configured pump speed
(1500 1/min). The configuration is done in the Service Engineering Tool.
5. Additional information
5.1. Overview of all additional blocks
In this project several blocks are used, which are not included in the SIMATIC Process Function Library. These blocks are
self-written and are responsible for either the simulation of the process or simplify the programming of the internal logic
of the project. In the following table, you can find a list of all these blocks and a short comment about their function. You
can also see, which block type was used and if they can be used in every project or just in this application example.
5.1.1.2. PIDCon_Config
Due to the same problem as in chapter 5.1, the function "PIDCon_Config" (FC16) was implemented. This block writes the
config parameters for the "PIDConL" block. Also, the inputs for the operating modes can be written. With this method it is
not possible to change the parameter during the runtime.
If you want to make it possible for the operator to change the parameters during runtime, you need to write them directly
into the instance DB as start values.
5.1.1.3. MotSpdCL_Config
Due to the same problem as in chapter 5.1, the function "MotSpdCL_Config" (FC5) was implemented. This block writes
the config parameters for the "MotSpdCL" block. Also, the inputs for the operating modes can be written. With this
method it is not possible to change the parameter during the runtime.
5.1.1.4. State DB
In this global DB, static variables are defined, which are related to the states of a service. Several hex values were assigned
to each state. In this DB, these values for all states are defined for better handling in the project. As a result, during
program execution, the state name can be asked directly without the need to handle the hex values.
5.1.1.5. AccuS_Liter
This block is responsible for the calculation of the pumped amount of liquid in liters. This block originates from the
SIMATIC Process Function Library and is called in the "CalcDose" function block. The calculation of the pumped liters
always gets restarted after the services set the components of the process to automatic mode.
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
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
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