Entry type: FAQ, Entry ID: 45045670, Entry date: 09/09/2010
(0)
Rate

How can you prevent data loss of runtime-generated parameters when updating your S7-1200 PLC program?

  • Entry
  • Associated product(s)

Description
You need to apply changes to your user program running on a S7-1200 PLC, but you do not want to loose your runtime-generated parameters. Buffer your runtime-generated parameters in the HMI "Runtime" recipe function of STEP 7 Basic and download your program changes to your S7-1200 PLC.

To apply this feature, execute the following steps:

  • Prepare your STEP 7 Basic HMI project to buffer your parameters. No changes to your PLC program are necessary.
  • Buffer your parameters in the HMI "Runtime" recipe function of STEP 7 Basic.
  • Download your changed program to your S7-1200 PLC.
  • Retrieve your parameters from the HMI "Runtime".

Capacity of the recipe function:

  • You can buffer up to 20 elements (tags) per recipe.
  • You can use up to a maximum of 5 recipes.

Each recipe allows you to buffer different sets of tags (total sum of tags: 5x20=100). Please find an example project in the attached file.

 
Fig. 01

Configuring the buffering feature in your project
In the following description, the HMI project of the attached STEP 7 Basic project is used.
 

No. Integrating the recipe function
1. Prepare the projects
Follow these steps:
  • Open your own project with STEP 7 Basic.
  • Download, unzip, and open the attached STEP 7 Basic project " DataStore".

This project is designed to match the following devices:

  • S7-1200 PLC with CPU 1214 (6ES7 214-1BE30-0XB0)
  • KPT600PN Basic Panel (6AV6 647-0AD11-3AX0)

The panel type is not important as the HMI "Runtime" can simulate any configured type of KPT Basic Panels.

2. Copy the HMI device into your project
  • Drag and Drop the "HMI_DataStore" HMI project from the attached "DataStore" STEP 7 Basic project into your own project.
  • Drag and Drop the "DataStore" global data block from the "DataStore" project to your own project.
  • Drag and Drop the "RuntimeParameters" global data block from the "DataStore" project to your own project.
  • Compile the data blocks of "PLC_1".

The "RuntimeParameters" data block holds the parameter tags for the example project. It is used to demonstrate this feature. In your own project any data tag capable of holding numerals can be used.


Fig. 02

Important

  • Compile the data blocks of "PLC_1".
  • Make sure the used data tags are "retentive". Otherwise the restored data will not survive a PLC STOP or a power-cycle condition.
3. Delete the HMI tags
Follow these steps:
  • Browse the "Project tree" for the "HMI tags" editor.
  • Select all "HMI_connection_x" entries, and click "Delete" in the context menu.


    Fig. 03

Note
Do not delete the "s_ipAddress" internal tag.

4. Configure the HMI Connection
Follow these steps:
  • Browse for "Device&Networks" and click the "Connections" button. Select the "Connections" tab and delete the HMI connection of the "HMI_DataStore" panel by clicking "Delete" in the context menu. Acknowledge the following dialog window.
     

    Fig. 04
  •  Connect the Ethernet ports of the "HMI_DataStore" panel and the "PLC_1" S7-1200 PLC. A new HMI connection is established.


    Fig. 05
5. Configure the HMI area pointer
Follow these steps:
In the context menu of the "HMI_connection_2" select the "Go to Connections editor.." item (see Fig. 05).
In the "Area pointers" tab, check the Data record area pointer active, and assign the "aw_dataRecord" tag from the "DataStore" data block.
Check the "Job mailbox" area pointer, and assign the "aw_jobMailbox" tag from the "DataStore" data block.


Fig 06
6. Add the tags to recipe function
Follow these steps:
  • Browse the "Project tree" for the "Recipes" item of the "HMI_dataStore" HMI device.
  • In the recipe, view select "Recipe 1"
  • Change to the "Elements" tab, and assign the tags you want to share with your other S7-1200 PLCs to the elements of this recipe.
  • The default setting for decimal places is zero. Increase the number of decimal places up to the resolution you need.
  • Configure up to 20 elements per recipe.

Note
Any invalid tag needs to be deleted or reassigned. Invalid tags are highlighted red.


Fig. 07

7. Configure the screen tags
  • Browse the "Project tree" for the "Screens" folder of the "HMI_DataStore" device, and open the "root screen".
    Assign the "aw_dataRecord[3]" word tag to the status output field.


    Fig. 08
     
  • Assign the "HMI_connection_2" connection to the "Release" event of the Change IP button.

     
    Fig. 09
Table 01

Buffering and retrieving the parameters with HMI "Runtime"
 

No.

Buffering and retrieving the parameters

1. Start the HMI "Runtime" of STEP 7 Basic
Follow these steps:
  • Select the "HMI_DataStore" HMI device.
  • Click the "Start runtime" button.


    Fig. 10
2. Buffer the parameters in the HMI
Follow these steps:
  • On your HMI display select "Recipe_1" and click the "OPEN" button. The "Recipe_data_record_1" opens.

     
    Fig.11
     
  • Press the "PLC>>HMI" button to read the parameters from the S7-1200 PLC. The "Save as" window opens.


    Fig. 12
     
  • To save the data record number "1", enter the number "1" in the "Number" input field, and click the "OK" button.
     
     
    Fig. 13
     
  • Click the "Open" button to see the parameter values of this data record.

     
    Fig. 14

Your parameters are now stored in Runtime.

Note
You can also archive / retrieve parameter element values.

3. Download your program
Click the "Download to device" button to download your program to your S7-1200 PLC.


Fig. 15

4. Restore the parameters to the PLC
Follow these steps:
  • On your HMI display select "Recipe_1" and click the "OPEN" button. The "Recipe_data_record_1" opens. See Fig. 11/12 for details.
  • Press the "HMI>>PLC" button to write the parameters to your S7-1200 PLC.
Table 02

Adjusting the IP address
Change the IP address, that is configured in the HMI connection, if you want to access another S7-1200 PLC (for example, PLC_2). Each S7-1200 PLC has a unique IP address.
 

No. Adjust the IP address
1. If the IP address of the S7-1200 PLC in the project does not match the IP address of the actual S7-1200 PLC you are using, you must change the IP address configured in the HMI "Runtime" (for example, you run the same project on several S7-1200 PLCs).

Follow these steps:

  • On your HMI "Runtime", enter the IP address of the S7-1200 PLC (for example, "192.168.0.1") in the input field.
  • Click the "Change IP" button.


    Fig. 16
Table 03

Requirements

  • S7-1200 PLC
  • Ethernet cable
  • PG / PC
  • STEP 7 Basic V10.5

S71200_DataStore.zip ( 3134 KB )