DB variables reset to zero upon warm restart/power cycle

nfthree

Member
Join Date
Jul 2014
Location
Orlando, FL
Posts
12
We have 5 machines each using a 418-2 CPU. 4 of the lines have automatic bleed off valves to purge gases which might accumulate during production. The fifth line had the bleed off valves, but they were not automatic.

The networks were basically copied from one of the working machines and added to FC3 and the variables for 2 timers and 2 counters were added to DB20 to add the automatic bleeding. Everything was working well until we had a power outage at which point the variables for the timers and counters in DB20 were set to zero, effectively disabling the outputs for the bleed valves.

I have made sure that the initial values for these variables were set offline, saved, and then downloaded to the PLC. Whenever I do a warm boot or recycle power, these values are not set to the initial value though but are set to zero. After a warm boot, I can simply select DB20 from my offline project and download it the PLC which correctly sets the variables to their initial value. I should also note that this DB is a shared one and the only instance of the use of the variable is a read in the added networks.

I've been in contact with Siemens support and they are unable to replicate the issue. They suggest that something is indirectly addressing these variables but I just dont see anything that might be overwriting them.

Has anyone had a similar experience where DB variables were not being retained during a power cycle or warm boot?

o_O
 
I've never heard that there was ever a 418 CPU. Check the serial number of the CPU and the firmware version (online) you've got actually running, then you could check the firmware updates for the CPU, if there is any of such problems fixed in a newer version.

Did you check the diagnostic buffer if it was really a warm and not a cold start?

Do you have any memory card inside the card-slot, for example a flash memory card?
 
I've never heard that there was ever a 418 CPU. Check the serial number of the CPU and the firmware version (online) you've got actually running, then you could check the firmware updates for the CPU, if there is any of such problems fixed in a newer version.

Did you check the diagnostic buffer if it was really a warm and not a cold start?

Do you have any memory card inside the card-slot, for example a flash memory card?

Sorry, the CPU is 416-2.

Yes, it was a warm start. I've done both software warm boot and using the switch on the CPU to warm boot.

The is a memory card installed which is writable.
 
I've just looked at the firmware updates with V5.x, there were no fixed problems regarding data loss on warmstart.

I would check the diagnostic buffer if there are any suspicious entries after restart.

There are different memory cards. You can have a RAM memory card and a flash memory card. The flash memory card can only be written in stop mode. If you power off the CPU and you have no or empty batteries in the CPU, then on restart it loads the program from the flash card, and also the initial values of the DBs saved on there.
 
I have made sure that the initial values for these variables were set offline, saved, and then downloaded to the PLC.

Have you use the option from menu Edit -> Initialize Data Block in data view, after you have set the initial values you want?
With this function, the all initial values of the DB are copied to actual value of the DB.
 
I've just looked at the firmware updates with V5.x, there were no fixed problems regarding data loss on warmstart.

I would check the diagnostic buffer if there are any suspicious entries after restart.

There are different memory cards. You can have a RAM memory card and a flash memory card. The flash memory card can only be written in stop mode. If you power off the CPU and you have no or empty batteries in the CPU, then on restart it loads the program from the flash card, and also the initial values of the DBs saved on there.

There was an BCD error from FC1 which I corrected. It was a timer variable incorrectly pointing to a wrong address.

Have you use the option from menu Edit -> Initialize Data Block in data view, after you have set the initial values you want?
With this function, the all initial values of the DB are copied to actual value of the DB.

Thanks for the suggestion. I tried this but I'm getting the same results.
 
Hmm, that's a strange problem. Can you post the diagnostic buffer of a restart sequence? You can save it as plain text, and then post it.

I would add a new datablock with some initial values, and see if it has the same behaviour. Or, if possible, load the CPU with the problem with a complete new project (only empty OB1 and a single DB) and test it.
Or test the startup sequence with your program inside Plcsim or a different S7-400 CPU with a different firmware.

Btw: Merry Christmas
 
Make sure that the DB is not marked as non retain.

You can check this by right clicking the DB and choose properties and then check the options in general part tab 2

Non-Retain:

This option allows you to define the retentive behavior of data blocks.
The option is only effective if the CPU supports the retention properties of the DBs. A data block with the "Non-Retain" property in such a CPU (e.g. CPU 317 V2.1) is not saved in the retentive memory and is therefore reset to the load value after every power OFF and power ON and after every STOP-RUN transition of the CPU.
A data block with the "Non-Retain" property takes up RAM but no retentive memory.
 
Just to follow up and close this thread.

I found the culprit to be a file that was being opened and writing to the data block. This file did not contain the newly created variables and I am assuming that they then were set to zeroes.

I've worked around the issue by hard coding the values for the timers and counters into the logic.

I still have to see about adding these variables to the file on our HMI so that I can move back to using variables.

Thanks for all your help and input into this matter.

Happy New Year!
 

Similar Topics

Hi everybody.. I have this to clean variables: as I can be simplified by using a single function?? Thanks in advance..:)
Replies
2
Views
1,427
Hi, we are using Rx3i CRU320 redundant PLC system and we noticed a discrepancy between Primary and Secondary controller. Couple of variables (DI)...
Replies
8
Views
270
Hi everyone, I was wondering how we declare Persistent Variables in Studio 5000 (main reason to keep the values during power cycle and program...
Replies
5
Views
241
Hello everyone, how can I see in machine edition (in 1 overview) which variables are not in use? When I create a new variable it continues with...
Replies
2
Views
558
Hello, programming an AB Micro850 for the first time, using the developer edition of CCW and trying to figure out how to best structure...
Replies
5
Views
602
Back
Top Bottom