Blog

Siemens Simatic S7-300 - Retaining Values When Downloading a Datablock

Siemens Simatic S7-300 - Retaining Values When Downloading a Datablock

A simple yet common problem when programming a Siemens Simatic S7-300 PLC is losing the data already stored in the PLC after downloading an updated data block.

If you are simply adding items to the end of a flat data block (not adding items to a user-defined type (udt) within the data block, for example) then to retain the values of the data block follow these quick steps.

  1. Go online with all of the blocks in Simatic Manager.
  2. Copy the online version of the data block whose values you would like to retain into your offline project.
  3. Add the items to end of the data block
  4. Download - your values will be retained.

If you need to make a more complicated change to the data block such as adding items to a udt used with the data block, a few more steps are needed. Even if you have first saved a copy of your online values prior to making the change, the values will be lost after you save the change. Therefore, follow these extra steps.

  1. Follow steps 1 and 2 above.
  2. Open the datablock and Generate Source for the data block. File -> Generate Source. This will save a version of your data block and the values in a file in the Sources folder.
  3. Make all changes that you need to the data block then Save and Close the data block.
  4. Open the Source file you created and compile it. This will set all values in the data block equal to the values you see in the Source file.
  5. Download - your values have been retained.

Learn more about DMC's expertise in Siemens S7 PLC programming.

Comments

Petr
# Petr
Important point is that symbolic addressing instead of absolute addressing must be choose, otherwise symbolic names of db will be lost!
dimas
# dimas
Thanks for the article.
Can you check and confirm the following:

Online DB values stored that way will stay long and be upplied (rewrite actual values in PLC) each time you download that DB block (instead of zeroed initial values) until you recompile the original block definition.

It could be a big side effect..
dimas
# dimas
Thanks for the article.
Can you check and confirm the following:

Online DB values stored that way will stay long and be upplied (rewrite actual values in PLC) each time you download that DB block (instead of zeroed initial values) until you recompile the original block definition.

It could be a big side effect..
ajit
# ajit
how to log change values in s7-300 plc after downloading
gamal
MORE DETAILS PLEASE
gamal
more details please
gamal
more details please
Ken Brey
This procedure is great! I will use this.

Post a comment

Name (required)

Email (required)

CAPTCHA image
Enter the code shown above: