Siemens S7/TIA v18: RETAIN column in Datablock: Retained after cycling power?

Mas01

Member
Join Date
Oct 2020
Location
Leicester, England
Posts
1,109
In a data block, if the tag is ticked in the "Retain" column", is it meant to be retained after cycling the power to the PLC?

I'm finding that, after cycling PLC power, the value reverts to the 'Start value'.

I want to retain the value after PLC has been power-cycled.

What's the correct way to do this?

Thanks in advance.

question...retained after power off and on.png
 
Retain is the setting to have it remember the value. A couple ideas:


1) have you downloaded the DB since you checked the box?
2) Is there any code initializing the tag on startup/first scan?
3) The tag will still revert to start value when the DB is reinitialized, such as if you add a new tag to the DB. If the PLC was restarting as part of a DL that included a DB change, then you'd revert to start values unless you have Keep Actual Values active.

4) if you're using PLCSIM instead of the real PLC, it might not support retain memory.
 
Retain is the setting to have it remember the value. A couple ideas:


1) have you downloaded the DB since you checked the box?
2) Is there any code initializing the tag on startup/first scan?
3) The tag will still revert to start value when the DB is reinitialized, such as if you add a new tag to the DB. If the PLC was restarting as part of a DL that included a DB change, then you'd revert to start values unless you have Keep Actual Values active.

4) if you're using PLCSIM instead of the real PLC, it might not support retain memory.

For #4, I am using the real PLC, not a simulation.

For #3, I think you've hit the nail on the head. In my blinkered view of what I've been doing, I've only now seen the 'Keep Actual Values' feature!

I have NOT been using that feature at all, so this could explain a lot.
Cheers
 

Similar Topics

Context: PLC= S7-1212C, HMI=KTP1200 Basic. Hi again, When the "REPORT" button is pressed (on a different screen), it takes the operator to the...
Replies
7
Views
666
Context: PLC= S7-1212C, HMI=KTP1200 Basic. Hi, The operator has reported that, from time-to-time, when he presses the "Generate Report" button...
Replies
5
Views
463
General Question: The PLC and HMI that I've been working on (a laser measurement system) is soon to be transported to the site where it will be...
Replies
2
Views
700
Hi, I'm not sure how to do this... Basically, I want to restrict the user input values for this tag to be in the range 20.001 to 25.0. I...
Replies
17
Views
1,633
Can someone help me with this? I'm no good at SCL - virtually everything I've done so far has been ladder logic. The return value from the...
Replies
13
Views
1,107
Back
Top Bottom