Forum

S7-1200 retain valu...
 
Notifications
Clear all

[Solved] S7-1200 retain values survive a power cycle but go back to 0 after a download

9 Posts
4 Users
0 Reactions
47 Views
(@bram99)
Trusted Member
Joined: 1 year ago
Posts: 33
Topic starter   [#225]

Hi all, sorry if this is basic. I'm learning on a bench rig at home, S7-1200 1214C with TIA V17, and I have a production counter in a DB with Retain ticked on the members plus two M bits set retentive in the PLC tag table.

Power the rig down overnight and back up in the morning, the counter is still sitting on 148 where I left it, so that part does what I expected. But every time I download a change to the block, even a change that has nothing to do with the counter at all, it comes back as 0 and both M bits are false again.

I've checked afterwards and the Retain boxes are still ticked. Does retentive not mean what I think it means, or is my rig missing a battery somewhere?


Advertisement

   
Quote
 louk
(@louk)
Eminent Member
Joined: 2 years ago
Posts: 27
 

Could be the backup not holding. On an SLC you had a lithium cell keeping the retentive area alive and when that cell went flat everything came back as the program defaults on the next power up, which is more or less what you are describing. If a 1200 has an equivalent I would be looking at that first. Is there a card in the memory card slot, and what does it say on the label?


Advertisement

   
ReplyQuote
(@bram99)
Trusted Member
Joined: 1 year ago
Posts: 33
Topic starter  

No card in the slot at all, it runs from internal memory. And if it was the backup would it not lose the counter overnight as well? Overnight is the bit that works, so I'm not sure that is it.



   
ReplyQuote
(@kiran_s)
Trusted Member
Joined: 2 years ago
Posts: 48
 

You're right, it is not a backup problem. A 1200 has no battery at all, the retentive area lives in non volatile memory on the CPU, and it holds through a power cycle and through STOP to RUN. A download is a different animal. Retentive means kept across power off and across a mode change. It has never meant kept across you replacing the block.

The one that catches everybody is the DB. If you change anything about the interface of that DB, the download puts the whole data area back to the start values and your 148 is gone with it. Look for "Load without reinitialization" in the download dialog.



   
ReplyQuote
(@jcasey)
Trusted Member
Joined: 1 year ago
Posts: 59
 

Same trap in Logix. A download is a fresh data table.



   
ReplyQuote
(@bram99)
Trusted Member
Joined: 1 year ago
Posts: 33
Topic starter  

There's a tick box in the download dialog and mine said it would initialise the retentive memory. Untick that and the counter stays put. But the option is greyed out when I change the DB interface, which is most of the time.



   
ReplyQuote
(@kiran_s)
Trusted Member
Joined: 2 years ago
Posts: 48
 

Greyed out because you changed the structure, that one is expected. For an optimised DB you take a snapshot of the monitor values first, then load without reinitialisation from the right click on the block, and what is in there now gets carried across. If the DB is not optimised you do not get the option at all and you write the value back by hand after the download.

Worth doing it once on your rig with the counter on a number you recognise, so you see which of the two paths you are on before it matters on a real machine.



   
ReplyQuote
(@bram99)
Trusted Member
Joined: 1 year ago
Posts: 33
Topic starter  

Got there. Retentive on a 1200 means it survives power off and STOP to RUN and that is the whole of what it means, nothing to do with a battery because there is not one in the thing. A download rewrites the data area, so my counter goes to its start value unless I untick the reinitialise box, and once the structure changes I have to take a snapshot and load without reinitialisation instead.

Still do not understand why one of my two M bits kept its value through a download last week and the other did not. Thanks louk, kiran_s and jcasey, that was bugging me for days.



   
ReplyQuote
 louk
(@louk)
Eminent Member
Joined: 2 years ago
Posts: 27
 

My battery guess was about forty years out of date. Good thing to learn early.



   
ReplyQuote
Share: