show the entry list
STEP 7 (TIA Portal) -- Creating S7 programs -- Creating program sequences
In STEP 7 (TIA Portal) V12, why do you have to insert a SET instruction after a jump command in order to ensure a first scan?
Where in STEP 7 (TIA Portal) V11 is there a program for the S7-1200 that lets different bit patterns rotate or flash under time control?
Recommended programming for S7-1200 and S7-1500 with STEP 7 (TIA Portal) V12
In STEP 7 (TIA Portal) V11, how do you calculate a current arithmetic average value from any number of values read in?
In STEP 7 (TIA Portal) V11, how do you calculate the minimum and maximum limit values for a temperature range?
How do you convert degrees into radians and vice versa in STEP 7 (TIA Portal) V11?
In STEP 7 (TIA Portal) V11, how can you buffer the return values from the "RETVAL" parameter consecutively in a DB?
How do you calculate in STEP 7 (TIA Portal) V11 the distance "D" between two points in a rectangular coordinate system?
How do you define a setpoint value with ramp function in STEP 7 (TIA Portal) V11?
How do you establish a MODBUS-RTU communication with STEP 7 (TIA Portal) for the SIMATIC S7-1200?
In STEP 7 (TIA Portal) V11 how can you invert an output signal of the "Bool" data type after each positive edge?
In STEP 7 (TIA Portal) V11, how can you count forwards and backwards in a bandwidth between -2147483648 and +2147483647?
How can you process 64-bit floating-point numbers in STEP 7 V11 with a SIMATIC S7-300/400 CPU?
In STEP 7 (TIA Portal) V11, how can you buffer the return values from the "RETVAL" parameter consecutively in a DB?
Part number:

Description
When using SFCs and SFBs in the Online mode, it might happen that different return values appear one after the other at the "RETVAL" output parameter or the return value changes only briefly, but is then no longer available for evaluation. The sample program below makes it possible to save the output return values consecutively in a data block.


Fig. 01

Each new return value is read via the "Ret_Val_Save" parameter of the "Save_RetVal" (FC22) and stored in a variable of the global data block "Store" (DB22). The program also has the following properties.

  • Up to 12 input values can be stored. The function and data block can be extended for further requirements so that more than 12 return values can be stored.
  • The return value must be greater than zero.
  • A new or changed return value is stored in the next DB variable.
  • Each address in the data block is reserved for one return value. If an address is already occupied by a return value, the new value is entered in the next DB address.
  • No DB variable is overwritten. Only the last DB variable can be overwritten.
  • The DB variables retain their values until they are reset to zero with the PLC variable "Reset".
  • Once reset, return values can be written to the DB variables one after the other starting at the beginning again.

The attached download contains a STEP 7 project with the blocks described above (FC22, DB22 and OB1). The "Save_RetVal" function contains the German and English comments.

STEP7_V11_SaveRetVal.zip ( 1189 KB )

Download
Copy the "STEP7_V11_SaveRetVal.zip" file into a separate directory and then start the file with a double-click. The STEP 7 (TIA Portal) V11 project is now unpacked automatically with all the associated subdirectories. You can then use STEP 7 V11 to open and process the extracted project.

Creation environment
The following table lists the components that have been used to create this entry and verify the functions described.
 
Test environment Version
PC platform Intel(R) Core(TM)2 Duo CPU P8700 2.53 GHz
PC operating system MS Windows XP SP3
STEP 7 (TIA Portal) V11 + SP2
CPU 1214C (6ES7214-1AE30-0XB0) Firmware V2.1
Table 01

Keywords
Error information, Error code

 Entry ID:43511056   Date:2012-04-04 
I regard this article....as helpfulas not helpful                                 
mySupport
My Documentation Manager 
Newsletter 
CAx-Download-Manager 
Support Request
To this entry
Print
Create PDF 
Send to a friend
QuickLinks
Compatibility tool 
Help
Online Help
Guided Tour