You are on page 1of 2

support.industry.siemens.com | Product Support | Thursday, 13.

 December 2018
 Print this page   Generate PDF

Entry type: FAQ, Entry ID: 45045947, Entry date: 11/13/2015

How do you define a setpoint value with the ramp function in STEP 7 (TIA Portal)?
Using the "Ramp" function block you can define rising and falling ramps within a time interval.
Description
In the world of automation, a ramp function is very often used when handling setpoint values. The attached STEP 7 (TIA Portal) library includes the following blocks:
"Ramp": FB with the program of the ramp function generator
"Ramp_DB": Instance DB of FB "Ramp".
"ContrDB": Global DB for activating the FB "Ramp"
"Cyclic interrupt": Cyclic interrupt OB in which the FB "Ramp" is called to start the block after defined time slots.
Fig. 1 shows the call of the FB "Ramp" in the cyclic interrupt OB and the parameterization of the actual parameters (tags of the global DB) with the formal parameters of
the function block.
  

Fig. 1
Via the "SetPoint" parameter you enter the desired setpoint value (via HMI, for example) and you get the current setpoint value at the output "Out". The table below
shows the Input and Output parameters of the FB "Ramp".
  
Parameter Data type Description 

Input parameter

InitFB Bool Initialization, definition of the desired setpoint value

SetPoint Real Setpoint value without ramp function

Change rate for evaluating the ramp function.
Rate Real
Unit: Setpoint value unit/second

Output parameter

Out Real Setpoint value with ramp function

Example for using the FB "Ramp"
The setpoint value is to be first initialized on the value 10 and then within 10 seconds increased to the value 60. Fig. 1 shows the rising ramp after change of the setpoint
value from 10 to 60 in relation to the change rate.
  

Fig. 2
The FB "Ramp" is called in OB30 "Cyclic interrupt" and the timing cycle of the OB30 is 0.1s. If the rate set = 1/s, the rising ramp would last for 50s (change of the setpoint
value from 10 to 60). To shorten the time to 10s the rate must be 5/s.
1. Initialize the setpoint value to the value 10. Give the formal parameters the following values:
InitFB = True
SetPoint = 10
Rate = 5
2. Change the setpoint value to 60. Give the formal parameters the following values:
InitFB = False
SetPoint = 60
Rate = 5
The duration of the rising ramp (green line in Fig. 2) is now 10s.
Download
The attached download includes the library "45045947_RamGenerator_Lib_STEP7-TIA-Portal" with the blocks described above for S7-1200/S7-1500. Unpack the Zip file
in a separate directory on your hard disk. Then you can use STEP 7 (TIA Portal) to open and edit the library.
Note
You can only open and edit the library in STEP 7 (TIA Portal). Further information about opening libraries is available in Entry ID: 37364723  .
For V13 SP1 and V14 SP1:
    45045947_RamGenerator_Lib_STEP7-TIA-Portal.zip (1.1 MB)  
V15 and higher:
    45045947_RamGenerator_Lib_STEP7-TIA-Portal_V15.zip (282.6 KB)
Creation Environment
The screens in this FAQ response were created with STEP 7 (TIA Portal) V13 SP1.

Security information
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. For more information about industrial security, please visit
http://www.siemens.com/industrialsecurity.

Entry belongs to product tree folder(s):
This entry is associated to 102 product(s).
 Show/Hide picture 1
 Show/Hide picture 2

© Siemens AG 2009-2018 - Imprint Privacy policy Cookie policy Terms of use Digital ID 0.0.0.0

You might also like