Siemens S7 Retentive Data Blocks Issue

Barry Kirk

Lifetime Supporting Member
Join Date
Mar 2007
Location
York, PA
Posts
61
I've got a data block, DB310, that contains process information entered from an HMI. Every time the processor is cycled from start to stop to start again, or power is cycled to the processor, the initial values for that DB overwrite the current value.

I would like the PLC to retain the working process values through a power cycle.

When I tried to set up the DB310 as Retentive Memory, the areas section of the Retentive Memory tab show as grayed out.

2 questions.

1) Why is the Areas section grayed out?

2) Would making DB310 retentive maintain the data through a power cycle is there some other procedure I need to follow to save this data?
 
Figured this one out...

The Data Areas are grayed out for S7-300 class processors.

That's an option that's only available on S7-400 processors. The Siemens online help could have been better on this.

Also, figured out why the data kept getting zeroed and it was my fault.
 
This is a new case for me. Mine usually is not like that. Value is back to initial value only if I re-download. DB is always retentive. Can you try smaller DB number, eg. DB 25? I never use that big DB number for S7300
 
In addition, if you forget to set initial value at the first time, initial value is always zero. If you dont want zero initial value, you can set via OB100 or by exporting your DB to STL source, then put wanted initial in the text like below. Delete your original DB, and compile the STL source

DATA_BLOCK DB 12
TITLE =
AUTHOR : _8023
VERSION : 0.0

STRUCT
D_0 : WORD ;
D_1 : WORD ;
D_2 : WORD ;
D_3 : WORD := W#16#2AD6;<-----put initial here in hexadeciaml
END_STRUCT ;
BEGIN
D_0 := W#16#0;
D_1 := W#16#0;
D_2 := W#16#0;
D_3 := W#16#2AD6; <---and here
END_DATA_BLOCK
 
When I said that it was my fault, the DB was getting reset to zero when I redownloaded... Not when power was cycled.

The key part that wasn't explained in the help was that in hardware config PLC object properties / Retentive tab, the areas section is grayed out except for S7-400.
 
JohnW said:
If you are just editing a block or a few blocks then just download those blocks and not all the blocks.


Spot on, this is one of the many advantages of Siemens over other PLC's such as AB's and Modicon, in that you can download small parts of code and you don't have to stop the PLC unless you are making changes to the HW profile or to the parameters of FB's etc.

Even the last part you can do without stopping the PLC if you are careful and know what you are doing.
 
or upload the db before downloading. If the DB is being modified generate the DB into a source and re compile. it will retain the currnet values
 
Wrong answer Barry
Open the online project and copy the online db to the offline project. If you make modifications to the db, the setpoints will retain. Just make sure the modifications are at the bottom of the db
 
About the power-up problem with which this thread started:
You can choose the power-up behaviour of a global DB in the properties of the DB, go to the 2nd TAB 'General - Part 2' and (de)select the 'Non retain' option. When you select 'Non retain' the DB will go back to the value the DB had when it was last downloaded to the PLC. This value is the ACTUAL VALUE in the offline project not the INITIAL VALUE. The INITIAL VALUE is just to fill the DB when you create it.
You can view and edit the ACTUAL VALUES when you set the view in the editor to DATA VIEW.

The tread starts with a picture of the properties of an IM151-8F PN/DP CPU. This is a CPU capable of executing safety programs. F-DB's are never retentive in this type of CPU, I'm not sure about other F-CPU's

see also:
http://support.automation.siemens.com/NL/skm/pdfviewer.asp?HitsPerSite=10&ehbid=html_76%2Fehb%2F31911105%2Ehtm&lang=en&nodeid=31911909&siteid=cseus&query=im151&page=1&view=new
 

Similar Topics

Having trouble with a Siemens S7 226 counter being retentive. I have specified in the System block C ranges offset 0, 6 elements. However, at...
Replies
0
Views
273
I have a small project running on a S7-1500. In the program is a bit %MD66 which is a value input from an HMI. I want to make this value retentive...
Replies
4
Views
3,192
First off, thanks for the patience with my post. Rookie to Siemens. I am trying to use a Retentive timer and it has to be around 24hours. Thus...
Replies
2
Views
1,882
Am I correct to think the Offset is the start and the Number of Elements the end? MB Offset = 14, Number of Elements = 18 Means, MB 14 to MB...
Replies
1
Views
1,671
A client asked me to modify an existing system. It is a Siemens S7-312C compact CPU and a OP3 text display. Now the bitmemory MB0 to MB 60 is used...
Replies
3
Views
2,421
Back
Top Bottom