library for controlled system simulation with step 7
TRANSCRIPT
Applications & Tools
Answers for industry.
Library for Controlled SystemSimulation with STEP 7
STEP 7 V12
Library Description August 2013
Warranty and Liability
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 2
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
Warranty and Liability
Note The Application Examples are not binding and do not claim to be complete withregard to configuration, equipment or any contingencies. The applicationexamples do not represent customer-specific solutions; they are only intended toprovide support for typical applications. You are solely responsible for the correctoperation of the described products. These application examples do not relieveyou of the responsibility to use sound practices in application, installation,operation and maintenance. Through using these Application Examples, youacknowledge that we will not be liable for any damage/claims beyond the liabilityclause described. We reserve the right to make changes to these ApplicationExamples at any time without prior notice. If there are any deviations betweenthe recommendations provided in these Application Examples and otherSiemens publications – e.g. Catalogs – the contents of the other documentshave priority.
We do not accept any liability for the information contained in this document.Any claims against us – based on whatever legal reason – resulting from the use ofthe examples, information, programs, engineering and performance data etc.,described in this Application Example shall be excluded. Such an exclusion shallnot apply in the case of mandatory liability, e.g. under the German Product LiabilityAct (“Produkthaftungsgesetz”), in case of intent, gross negligence, or injury of life,body or health, guarantee for the quality of a product, fraudulent concealment of adeficiency or breach of a condition which goes to the root of the contract(“wesentliche Vertragspflichten”). The damages for a breach of a substantialcontractual obligation are, however, limited to the foreseeable damage, typical forthe type of contract, except in the event of intent or gross negligence or injury tolife, body or health. The above provisions do not imply a change in the burden ofproof to your disadvantage.Any form of duplication or distribution of these Application Examples or excerptshereof is prohibited without the express consent of Siemens Industry Sector.
Siemens Industry Online SupportThis entry is from the Siemens Industry Online Support. The following link will takeyou directly to the download page of this document:http://support.automation.siemens.com/WW/view/en/79047707
Table of Contents
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 3
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
Table of ContentsWarranty and Liability ................................................................................................. 2
1 Library Overview ................................................................................................ 4
1.1 Different user scenarios ....................................................................... 51.2 Hardware and software requirements .................................................. 51.3 Block list ............................................................................................... 61.4 Library resources .................................................................................. 7
2 Explanation of the Blocks ................................................................................. 8
2.1 General ................................................................................................. 82.2 FB Sim_PT1 (FB 50) ............................................................................ 92.3 FB Sim_PT1_asym (FB 51) ............................................................... 102.4 FB Sim_PT2osz (FB52) ..................................................................... 122.5 FB Sim_PT2aper (FB 53) ................................................................... 132.6 FB Sim_PT3 (FB54) ........................................................................... 152.7 FB Sim_PDT1 (FB55) ........................................................................ 162.8 FB Sim_I (FB56) ................................................................................. 182.9 FB Sim_IT1 (FB 57) ........................................................................... 192.10 FB Sim_TempProcess (FB58) ........................................................... 212.11 FB Sim_Lagging (FB59) ..................................................................... 242.12 FB Sim_DT1 (FB60) ........................................................................... 252.13 FB Sim_AllPass1Ord_reel (FB61) ..................................................... 262.14 FB Sim_AllPass2Ord_reel (FB62) ..................................................... 272.15 FB Sim_Valve (FB63) ......................................................................... 282.16 FB Sim_TempProcess_2 (FB 64) ...................................................... 29
3 Integrating the Library into STEP 7 ............................................................... 32
3.1 Adding the Simulation library to the project........................................ 323.2 Interconnection of control elements ................................................... 33
4 Notes and Support ........................................................................................... 34
5 History............................................................................................................... 34
1 Library Overview
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 4
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
1 Library OverviewWhat will you get?
The document on hand describes the “Sim_controlprocess” block library, whichsimulates controlled systems using an S7-CPU.The block library provides you with tested code with clearly defined interfaces.They can be used as a basis for your task to be implemented.A key concern of this document is to describe: all blocks belonging to the block library the functionality implemented through these blocks.
Furthermore, this documentation shows possible fields of application and helps youintegrate the library into your STEP 7 project using step-by-step instructions.
1 Library Overview
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 5
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
1.1 Different user scenarios
Using the “Sim_controlprocess” library enables simulating the controlled system inan S7-CPU.The blocks of the library simulate various simple control elements through lineartransmission elements. Suitable serial or parallel interconnection of the individualsystem elements enables simulating very complex controlled systems as well.The library can be used in the following scenarios, for example: optimizing a controller: simulation of the controlled system where
commissioning at the real process is difficult or hardly possible. for training purposes: simulation of individual controlled system elements for a
clear representation of control technology processes and demonstration ofsoftware controllers.
1.2 Hardware and software requirements
Requirements for this libraryThe following hardware and software requirements must be met in order to use thefunctionality of the library described in this document:
HardwareThe library was tested with CPUs of the SIMATIC S7-1500 series.However, other SIMATIC controllers can also be used as hardware.
SoftwareTable 1-1
Component Order number
STEP 7 V12 (TIA Portal V12) 6ES78221AE02-0YA5
Note The SCL blocks can be easily ported to STEP 7 V5.5.
1 Library Overview
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 6
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
1.3 Block list
The following table lists all blocks of the “Sim_controlprocess” library.The blocks are described in detail in chapter 2.
Table 1-2
Block Symbol Short description
FB50 Sim_PT1 Simulation of a PT1 system. Self-regulatingsystemsFB51 Sim_PT1_asym Simulation of an asymmetrical PT1 system.
FB58 Sim_TempProcess Simulation of a temperature processFB52 Sim_PT2osz Simulation of a PT2 system in a periodical
case.FB53 Sim_PT2aper Simulation of a PT2 system in an aperiodical
case.FB54 Sim_PT3 Simulation of a PT3 system.FB55 Sim_PDT1 Simulation of a PDT1 system.FB60 Sim_DT1 Simulation of a DT1 system.FB61 Sim_Allpass1Ord_reel Simulation of a 1st order allpass.FB62 Sim_Allpass2Ord_reel Simulation of a 2nd order allpass.FB56 Sim_I Simulation of an I system. Non-self-
regulatingsystemsFB57 Sim_IT1 Simulation of an IT1 system.
FB63 Sim_Valve Simulation of a valve.FB59 Sim_Lagging Simulation of a lagging element.
1 Library Overview
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 7
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
1.4 Library resources
ContentThe following section gives you an overview of the size of the blocks of the“Sim_controlprocess” library in the main memory.
Overall sizeThe overall size of all blocks of library “Sim_controlprocess” in the main memory is8514 bytes and 98.3 Kbytes in the load memory.
Size of the individual blocks
Table 1-3
Block Symbol Size of main memory(in bytes)
Size of load memory(in bytes)
FB50 Sim_PT1 529 5251FB51 Sim_PT1_asym 647 6997FB52 Sim_PT2osz 845 9428FB53 Sim_PT2aper 787 8085FB54 Sim_PT3 796 8013FB55 Sim_PDT1 655 7430FB56 Sim_I 552 5830FB57 Sim_IT1 745 7740FB58 Sim_TempProcess 745 8453FB59 Sim_Lagging 477 4645FB60 Sim_DT1 607 6804FB61 Sim_Allpass2Ord_reel 836 8847FB62 Sim_Valve 770 15448
2 Explanation of the Blocks
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 8
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
2 Explanation of the Blocks2.1 General
Description of the blocksThis chapter introduces the parameters of the blocks. Partly, the transmissionfunction of the block is shown and the step response of the respective block.Working with the blocks is generally described in chapter 2.16.The parameters listed below have the same meaning in all blocks of the simulationlibrary. Parameters “Input” and “Output”: REAL
The input and the output of the system are interconnected at the Input andOutput parameters.According to the programmed controlled system realized in the function block,the output follows the input.
Parameter “Calc_Param”: BOOLThe “Calc_Param” parameter ensures that the simulation block recalculates itsinternal tags by means of the connected inputs.At the beginning of each call, the Calc_Param parameter must be set to “TRUE”for at least one cycle and then be set to “FALSE” again so the cycle time of theCPU is not increased unnecessarily by the computing load.
Parameter “Cycle”: REALThe scan time is transferred to the block with the “Cycle” parameter. The“Cycle” parameter must have the same value (in seconds) as the cycle time ofthe calling OB.
2 Explanation of the Blocks
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 9
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
2.2 FB Sim_PT1 (FB 50)
OverviewFB “Sim_PT1” (FB50) simulates a PT1 element. The PT1 element is a proportionaltransmission element with delay time of the 1st order.
ApplicationA PT1 element can, for example, be used for the simulation of a temperaturesystem.
Transmission function
Parameter
Figure 2-1 PT1 element
Table 2-1
Parameter Type Note
Reset IN:Bool
Resets all relevant parameters to ‘0’ including theoutput.
TM_LAG1 IN:Real
Time constant
GAIN IN:Real
Gain factor
Max_Out IN:Real
Maximal value the output can take on before anerror is output
Max_act OUT:Bool
For Max_act = TRUE, the maximal value at theoutput was exceeded.
2 Explanation of the Blocks
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 10
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
Step response
Figure 2-2 Step response PT1 element
2.3 FB Sim_PT1_asym (FB 51)
OverviewFB Sim_PT1_asym (FB 51) simulates a PT1 system which shows different timebehavior at positive or negative response, which makes it an asymmetrical PT1system.
ApplicationAn asymmetrical PT1 element can, for example, be used for the simulation of atemperature system with different behavior for heating and cooling.
Transmission functionAs opposed to FB “Sim_PT1”, the transmission function internally consists of twodifferent PT1 elements for upward and downward movement of the actual value.
2 Explanation of the Blocks
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 11
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
ParameterFigure 2-3 Asymmetrical PT1 element
Table 2-2
Parameter Type Note
Reset IN:Bool
Resets all relevant parameters to ‘0’ including theoutput.
TM_LAG1_up IN:Real
Time constant at positive excitation
TM_LAG1_down IN:Real
Time constant at negative excitation
GAIN IN:Real
Gain factor
Max_Out IN:Real
Maximal value the output can take on before anerror is output
Max_act OUT:Bool
For Max_act = TRUE, the maximal value at theoutput was exceeded.
Step response
for a positive unit jump
for a negative unit jump
Figure 2-4 Step response of asymmetrical PT1 element
2 Explanation of the Blocks
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 12
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
2.4 FB Sim_PT2osz (FB52)
OverviewFB “Sim_PT2osz” (FB52) simulates a vibrating PT2 system. The damping factormust be selected smaller than 1. Accordingly, the system is in the periodical case.
ApplicationA periodical PT2 element can, for example, be used for the simulation ofmechanical systems which execute a lifting/rotary motion and are capable ofvibrating.
Transmission function
Parameter
Figure 2-5 PT2 element in the periodical case
Table 2-3
Parameter Type Note
Reset IN:Bool
Resets all relevant parameters to ‘0’ including theoutput.
OMEGA IN:Real
Angular frequency of the undampened vibrations
DAMP IN:Real
Damping degree: 0<DAMP<1
GAIN IN:Real
Gain factor
Error OUT:Bool
If the value DAMP >= 1, Error = TRUE is set.
Status Out:Word
If the value DAMP >= 1, Status = 16#8001 is set.
2 Explanation of the Blocks
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 13
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
Step response
Figure 2-6: PT2 element with D<1
2.5 FB Sim_PT2aper (FB 53)
OverviewFB “Sim_PT2aper” (FB53) simulates a PT2 system with D>1. The system is in theaperiodic case where there are no vibrations.
ApplicationA PT2 element can, for example, be used for the simulation of a spring pendulum.
Transmission functionIn contrast to FB “Sim_PT2osz”, the transmission function internally consists of twoPT1 elements connected in-series:
2 Explanation of the Blocks
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 14
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
ParameterFigure 2-7
Table 2-4
Parameter Type Note
Reset IN:Bool
Resets all relevant parameters to ‘0’ including theoutput.
TM_LAG1 IN:Real
Time constant for the first PT1 element.
TM_LAG2 IN:Real
Time constant for the second PT1 element.
GAIN IN:Real
Gain factor
Max_Out IN:Real
Maximal value the output can take on before anerror is output.
Max_act OUT:Bool
For Max_act = TRUE, the maximal value at theoutput was exceeded.
Step response
Figure 2-8 Step response PT2 element with D>1
2 Explanation of the Blocks
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 15
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
2.6 FB Sim_PT3 (FB54)
OverviewFB “Sim_PT3” (FB54) simulates a delay element of the 3rd order. Internally, itconsists of the serial interconnection of 3 PT1 systems.
ApplicationA PT3 element can, for example, be used for the simulation of a temperaturesystem with several storage elements.
Transmission function
Parameter
Figure 2-9 PT3 element
Table 2-5
Parameter Type Note
Reset IN:Bool
Resets all relevant parameters to ‘0’ including theoutput.
TM_LAG1 IN:Real
Time constant for the first PT1 element.
TM_LAG2 IN:Real
Time constant for the second PT1 element.
TM_LAG3 IN:Real
Time constant for the third PT1 element.
GAIN IN:Real
Gain factor
Max_Out IN:Real
Maximal value the output can take on before anerror is output.
Max_act OUT:Bool
For Max_act = TRUE, the maximal value at theoutput was exceeded.
2 Explanation of the Blocks
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 16
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
Step response
Figure 2-10 Step response PT3 element
2.7 FB Sim_PDT1 (FB55)
OverviewFB “Sim_PDT1” (FB55) simulates the behavior of a PDT1 element (general rationalelement of the first order).
Transmission function
Parameter
Figure 2-11
Table 2-6
Parameter Type Note
Reset IN:Bool
Resets all relevant parameters to ‘0’ including theoutput.
TM_LAG1 IN: First time constant.
2 Explanation of the Blocks
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 17
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
Parameter Type NoteReal
TM_LAG2 IN:Real
Second time constant.
GAIN IN:Real
Gain factor
Max_Out IN:Real
Maximal value the output can take on before anerror is output.
Max_act OUT:Bool
For Max_act = TRUE, the maximal value at theoutput was exceeded.
Error OUT:Bool
If the value TM_LAG1 = 0, Error = TRUE is set.
Status Out:Word
If the value TM_LAG1 = 0, Status = 16#8001 is set.
Step response
Figure 2-12 Step response PT1 element
2 Explanation of the Blocks
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 18
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
2.8 FB Sim_I (FB56)
OverviewFB “Sim_I” (FB56) simulates a simple integrated system.
ApplicationA I-element can, for example, be used for the simulation of a filling level system(container).
Transmission function
Parameter
Figure 2-13
Table 2-7
Parameter Type Note
Reset IN:Bool
Resets all relevant parameters to ‘0’ including theoutput.
TM_LAG1 IN:Real
Integration time
Max_Out IN:Real
Maximal value the output can take on before anerror is output.
Min_Out IN:Real
Minimal value the output can take on before anerror is output.
Max_act OUT:Bool
For Max_act = TRUE, the maximal value at theoutput was exceeded.
Min_act OUT:Bool
For Min_act = TRUE, the minimal value at theoutput was fallen short of.
2 Explanation of the Blocks
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 19
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
Step response
Figure 2-14 Step response I element
2.9 FB Sim_IT1 (FB 57)
OverviewFB “Sim_IT1” (FB57) simulates a delayed integrator.
ApplicationAn IT1 element can, for example, be used for the simulation of a valve withactuator motor.
Transmission function
ParameterFigure 2-15
2 Explanation of the Blocks
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 20
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
Table 2-8
Parameter Type Note
Reset IN:Bool
Resets all relevant parameters to ‘0’ including theoutput.
TM_LAG1 IN:Real
Integration time
GAIN IN:Real
Gain factor
Max_Out IN:Real
Maximal value the output can take on before anerror is output.
Min_Out IN:Real
Minimal value the output can take on before anerror is output.
Max_act OUT:Bool
For Max_act = TRUE, the maximal value at theoutput was exceeded.
Min_act OUT:Bool
For Min_act = TRUE, the minimal value at theoutput was fallen short of.
Step response
Figure 2-16 Step response IT1 element
2 Explanation of the Blocks
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 21
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
2.10 FB Sim_TempProcess (FB58)
OverviewFB “Sim_TempProcess” (FB58) simulates an asymmetrical temperature processwhich can be actively heated and cooled down.
Connection diagramFB “Sim_TempProcess” (FB58) uses the following equivalent circuit diagram:
Figure 2-17
ActivateHeating
Heatingpower
InputTem-perature
Rth Transistion1 HeatingPower
UseHeatingPower
CTh1 RTh1 RTh1CTh2
IntermediateTemperature
Rth Transistion2 Cooling PowerOut Tem-perature
ExternalCooler
Ambient Temperature
ActivateCooling
RThCooling
2 Explanation of the Blocks
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 22
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
ParameterFigure 2-18
Table 2-9
Parameter Type Note
InputTemperature IN:Real
Input value temperature.
UseHeatingPower IN:Bool
Analog heating signal: UseHeatingPower andActivateHeatingPower = TRUE, Heating Power asdiscrete input.PWM signal: constant value for HeatingPower andUseHeatingPower = TRUE; applying the PWMsignal to ActivateHeatingPower.
ActivateHeating IN:Bool
ActivateCooling IN:Bool
Activate cooling.
CoolingPower IN:Real
Specifying the cooling power.
HeatingPower IN:Real
Specifying the heating power.
AmbientTemperature IN:Real
Ambient temperature.
Reset IN:Bool
Reset all relevant parameters (output is set toAmbientTemperature).
OutTemperature OUT:Real
Output temperature.
IntermediateTemp OUT:Real
Internal temperature.
Tags CTh1/RTh1 and CTh2/RTh2 listed in Figure 2-17 are static tags and can bemodified in the user program.
Note FB “Sim_TempProcess” (FB58) is write protected and can neither be viewed noredited.
2 Explanation of the Blocks
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 23
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
Step responseThe step response to heating corresponds to approximately the step response of aPT1 system.
Figure 2-19 Schematic layout of the step response of FB “Sim_TempProcess”
At an ambient temperature of 22.0° and a heating power of 50, or a cooling powerof 50, the following characteristic values result:
Table 2-10
GAIN T (for 0.63 end value)
heating 0.28 28.6scooling 0.526 16.2 s
NOTICE FB “Sim_TempProcess” (FB58) is know-how protected and canaccordingly neither be viewed nor edited. Usage with PLCSIM V12 is alsonot possible.
2 Explanation of the Blocks
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 24
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
2.11 FB Sim_Lagging (FB59)
OverviewFB “Sim_Lagging” (FB59) simulates a lagging element.
ApplicationUsing FB “Sim_Lagging” (FB59), conveyer systems can be simulated, for example.
Transmission function
ParameterFigure 2-20
Table 2-11
Parameter Type Note
delay_cycle IN:Int
Number of cycles by which the input signal shall berounded.
Error IN:Real
Error = TRUE, if delay_cycle >99.
Status OUT:Word
For Error = TRUE, Status = 16#8001.
Step response
Figure 2-21 Step response of dead time element
2 Explanation of the Blocks
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 25
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
2.12 FB Sim_DT1 (FB60)
OverviewFB “Sim_DT1” (FB60) simulates a delaying derivative element.
Transmission function
Parameter
Figure 2-22
Table 2-12
Parameter Type Note
Reset IN:Bool
Resets all relevant parameters to ‘0’ including theoutput.
TM_LAG1 IN:Real
Derivative time
TM_LAG2 IN:Real
Delay time
GAIN IN:Real
Gain factor
Max_Out IN:Real
Maximal value the output can take on before anerror is output.
Max_act OUT:Bool
For Max_act = TRUE, the maximal value at theoutput was exceeded.
Step response
2 Explanation of the Blocks
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 26
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
Figure 2-23 Step response DT1 element
2.13 FB Sim_AllPass1Ord_reel (FB61)
OverviewFB Sim_AllPass2Ord_reel (FB61) simulates a 2nd order allpass with real zeropoints.
Transmission function
ParameterFigure 2-24
Table 2-13
Parameter Type Note
Reset IN:Bool
Resets all relevant parameters to ‘0’ including theoutput.
TM_LAG1 IN:Real
Time constant 1.
GAIN IN:Real
Gain factor
Max_Out IN:Real
Maximal value the output can take on before anerror is output.
2 Explanation of the Blocks
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 27
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
Parameter Type Note
Max_act OUT:Bool
For Max_act = TRUE, the maximal value at theoutput was exceeded.
Step response
Figure 2-25
2.14 FB Sim_AllPass2Ord_reel (FB62)
OverviewFB “Sim_AllPass2Ord_reel” (FB62) simulates a 2nd order allpass with real zeropoints.
Transmission function
ParameterFigure 2-26
Table 2-14
Parameter Type Note
Reset IN:Bool
Resets all relevant parameters to ‘0’ including theoutput.
TM_LAG1 IN:Real
Time constant 1.
TM_LAG2 IN:Real
Time constant 2.
2 Explanation of the Blocks
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 28
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
Parameter Type Note
GAIN IN:Real
Gain factor.
Max_Out IN:Real
Maximal value the output can take on before anerror is output.
Max_act OUT:Bool
For Max_act = TRUE, the maximal value at theoutput was exceeded.
Step response
, with
Figure 2-27
2.15 FB Sim_Valve (FB63)
OverviewFB “Sim_Valve” (FB62) simulates a valve with adjustable opening and closing time.
Parameter
Figure 2-28
2 Explanation of the Blocks
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 29
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
Table 2-15
Parameter Type Note
Reset IN:Bool
Resets all relevant parameters to ‘0’ including theoutput.
InputUP IN:Real
Control signal “Open valve”
InputDN IN:Real
Control signal “Close valve”
Input_PER IN:Int
Analog manipulated variable
PER_on IN:Bool
Selection switch, whether InputUP/InputDN orInput_PER is used (Input_PER is used for TRUE)
PER_max IN:Real
Upper limit of the analog value of the valve position.
PER_min IN:Real
Lower limit of the analog value of the valve position.
Real_max IN:Real
Upper limit of the converted floating-point value forthe valve position.
Real_min IN:Real
Lower limit of the converted floating-point value forthe valve position
TransitTime IN:Real
Traversing time of the value between the endpositions
Output OUT:Real
Calculated valve position (within the “Real_min”and “Real_max” limits)
Output_PER OUT:Int
Calculated analog valve position (within the“PER_min” and “PER_max” limits)
High_Limit OUT:Bool
Simulated upper valve end position reached atHigh_Limit = TRUE.
Low_Limit OUT:Bool
Simulated lower valve end position reached atLow_Limit = TRUE.
2.16 FB Sim_TempProcess_2 (FB 64)
OverviewFB „Sim_TempProcess_2“ (FB64) simulates a PT3 temperature process. Thefunction block offers an input for heating and cooling respectively.
ApplicationThe function block can be used for the simulating of a temperature process.
2 Explanation of the Blocks
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 30
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
ParametersAbbildung 2-29
Tabelle 2-16
Parameter Typ Anmerkung
COM_RST INOUT:Bool
Initialisiert mit COM_RST = TRUE den Baustein.Wird vom Baustein automatisch zurückgesetzt.
Input_Cool IN:Real
Integrationszeit
Disturbance_Heat IN:Real
Verstärkungsfaktor
Disturbance_Cool IN:Real
Maximalen Wert, den der Ausgang annehmendarf, bevor ein Fehler ausgegeben wird.
AMB_TEM IN:Real
Minimalen Wert, den der Ausgang annehmendarf, bevor ein Fehler ausgegeben wird.
GAIN_Heat IN:Real
Verstärkungsfaktor Heizen.
GAIN_Cool IN:Real
Verstärkungsfaktor Kühlen
TM_LAGx_Heat IN:Real
Verzögerungsfaktor x.-Ordnung Heizen.
TM_LAGx_Cool IN:Real
Verzögerungsfaktor x.-Ordnung Kühlen.
2 Explanation of the Blocks
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 31
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
SprungantwortAbbildung 2-30 step response PT3 element
3 Integrating the Library into STEP 7
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 32
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
3 Integrating the Library into STEP 7The actions below define how to integrate the “Sim_controlprocess” library intoyour STEP 7 V12 project. Subsequently, you can use the blocks of library.
Note The following section assumes that a STEP 7 project exists.
3.1 Adding the Simulation library to the projectTable 3-1 Adding the Simulation library
Nr. Action Note
1. Download the Lib_processcontrol.zip file andextract the file on your engineering station.
2. Open the “Libraries” tab in the right-hand paneand click on “Open global library”.
Navigate to the storage location of theextracted folder and double-click to open the“Lib_processcontrol” file.
2
1
3. Drag the simulation blocks you wish to usefrom the “Master copies” of the library into theprogram block folder of your user program viadrag&drop.
4. Now you can use the inserted blocks in youruser program to simulate systems.
3 Integrating the Library into STEP 7
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 33
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
3.2 Interconnection of control elements
Controlled systemAs an example, a controlled system shall be realized with the following controlelements:
Figure 3-1 Controlled system
PT1 PDT1 Lagg PT2osz
Table 3-2
No. Action Note
1. Add the control elements you wish to use asdescribed in Figure 3-1. In this example theseare the control elements. PT1 (FB Sim_PT1) PDT1 (FB Sim_PDT1) Dead time element (FB Sim_Lagging) PT2 in the periodical case.
(FB Sim_PT2osz)2. Insert the function blocks into your cyclic OB
and leave one respective network between theindividual calls for the MOVE commands.
3. Use MOVE commands to interconnect theoutputs of the control elements with the inputof the subsequent respective control element.
4. Now you have set up a complete controlledsystem.
NoteIf you wish to observe the controlled system,you can use the function of the S7-1500“Traces” for this.
4 Notes and Support
Simulation library "Sim_controlprocess"Version 1.1, Entry ID: 79047707 34
Cop
yrig
htSi
emen
sAG
2013
Allr
ight
sre
serv
ed
4 Notes and SupportOverview
The “Sim_controlprocess” library is used for simulating controlled systems inSTEP 7.
ExamplesThe documentation “Controlling with PID_Compact V2” contains examples how theblocks of the simulation library can be called up and used.The entire documentation, including the library and an example project, can bedownloaded with the following link:http://support.automation.siemens.com/WW/view/en/79047707
5 History
Table Error! Use the Home tab to apply Überschrift 1 to the text that you want toappear here.-1
Version Date Modifications
V1.0 08/2013 First versionV1.1 12/2014 Added Sim_TempProcess_2