Siemens MMC's & those damn actual values

Mylo

Member
Join Date
Aug 2002
Location
Dublin
Posts
135
Hi All,

sorry to be a pain, I've re-read all the previous posts, I've tried to read the Siemens FAQ's & manuals, however it has all simply added to my confusion. Therefore I must ask the question again....

I have Some CPU314's with 64KB Micro memory cards (MMC's)
within these wonderful items I have some FC's,FB's and some DB's
In particular I have 4 x DBs that have the process parameters stored.
Now lets keep this simple (For Me !!), if I remove the MMC and replace it again, the values now change to the "INITIAL" values the DB was first loaded with, as opposed to the current "ACTUAL" values.

The question awaits,,,,,,, How can I store the current values of the process on the MMC so that it always has the updated DB's. I may not be around to UPLOAD and save these values so it must be done transparantly during normal operation..

I would appreciate any help on this, as I just can't seem to get this into my head,,


Cheers

Mylo
 
The first question that comes to mind, is why do you want to remove the MMC anyway, since the CPU can't run without it?

The second question is, by

if I remove the MMC and replace it again

do you mean replace with a new (empty) MMC or replace it with the same one?

With the current 300 series CPU's the DBs are saved on the MMC and, for example, in the case of a power down, the CPU recovers the last values from the MMC when the power comes back. So if you take the MMC out of the CPU, say to save the data to a PG, and then replace your MMC in the CPU and restart the system, your saved data should still be there.

I don't know for certain, but I assume the CPU's operating system continuously writes any data changes in the DBs to the MMC in a background task, because while it might be possible to save everything in the 48kB memory of a 314 to MMC in the event of a power down, it sure as heck isn't going to work with a 317's 512kB!

So under normal circumstances, you will always have the current DB data on your MMC - UNLESS you reload the DB from the PG - then you're back to your "Initial" values!
 
Mylo,

do you remove and re-insert the same MMC ?

Or do you insert a new MMC ?

Or do you insert the same MMC in another CPU ?

I believe that the MMC keeps the actual values as long as it is inserted. I dont think it can know that it has been removed and then re-inserted during power down of the CPU so it should be the same as just staying in the CPU.
But thats speculation, the easiest way to find out about these things is experimenting with the real thing.

There is an SFC84 WRIT_DBL that will let you write to the MMC card, but I am afraid (havent used it, only read about it) that it writes to the same ACTUAL values, so it is not the answer to your problem.
Maybe some experimenting will reveal that it IS the answer.

Would like to know too.
 
I don't know for certain, but I assume the CPU's operating system continuously writes any data changes in the DBs to the MMC in a background task, because while it might be possible to save everything in the 48kB memory of a 314 to MMC in the event of a power down, it sure as heck isn't going to work with a 317's 512kB!
I think that not all of the 317s datamemory is retentive. Have seen a note about it somewhere.
 
Allow me to supply some background,

I was on site with our distributor during the commission, he asked was it possible to disable the machines, I said yeah sure (Flash eijitt!!) and showed him that if you remove the MMC like so... the machine can never work again, aha,, so I demonstrated this and powered back up the machine with No MMC to show that it wouldn't run,

EH VOILA, Then I powered off the machine, re-installed the MMC and found to my horror that all the settings that had been input over the previous week had reverted back to the garbage I invented when I was writing the code, I thought the values would be stored on the MMC, i was wrong............. all the values read thru the HMI were the "INITIAL" values,

this is the cause of my confusion
 
I think that not all of the 317s datamemory is retentive. Have seen a note about it somewhere.

As usual, you're right Jesper, only the first 256 kB are retentive, although this is only stated explicitly as applying to DBs, so I don't know what happens to other areas.

However, I must admit I'm slightly stunned to read Mylo's description of what he tried!

I've got a 314 sitting on my desk looking at me, so I'll shoot over to hall where the 317 is and fetch my MPI adapter back - and then I'll go play.

I'll get back later on to let you know what happens!
 
I can see the logic here.

Because there is no backup battery and the MMC always "remembers" its last state at powerdown, then how do you set the program back to "factory defaults" ?
Thats why the MMC or CPU can sense that it has been removed. Its a way to set the program to "factory defaults" (= initial values).
Maybe there is a configuration bit somewhere to set if it must load initial values or not when an MMC is inserted.
edit: Have just looked in a S7-300 configuration, but cant find such a setting.
 
Last edited:
Hi Guys,

I'm back - and I think I've got the answer.

The retentive memory is for the case when you have a power failure and then when the power comes back the CPU recovers the retentive data from the MMC.

I wote my little program and downloaded it to the 314, by fortunate coincidence, I initialised the DBs with non-zero values.

Then I did what I'm willing to bet a case of beer Mylo did as well - I switched the CPU to STOP, did NOT switch the power off, removed the card, waited a few seconds and put the MMC back in. By now, having noticed the removal of the MMC, the STOP LED is blinking slowly to demand a memory reset - which I did and then restarted the CPU.

Going back into the VAT I then got a surprise - gone were the values I put in with the program - but so were the initial values! Instead everything was zeroed!

After playing around a few times, I finally got it sussed out:

1) switch the power off without stopping the CPU, remove the MMC and plug it back in - all data retained.

2) STOP the CPU, then power down remove the MMC and plug it back in, power the CPU back up and then switch back to run - again everything OK.

3) STOP the CPU, do NOT power down, remove MMC, replace it again, do the memory reset (otherwise you can't start), restart the processor and everthing is zeroed.

Actually, in a way it's quite reasonable, there is no problem with removing the MMC under power - BUT the CPU knows you've done it and demands a memory reset. Now as I read the manuals, after the memory reset, it reloads the program from the MMC but what it looks like is that it does NOT reload the saved memory data, because the CPU knows that it's not recovering from a power failure.

The net result is that what looks like the safest (well, 2nd safest - safest, I think, is STOP the CPU and then power down as well) way of doing things is actually what screws you - just drop the power and everything's OK - funny old world, isn't it!
 
Can you make one last little experiment for me:

Provoke the fault in your example 3.
Then power down the CPU and power up again.
Does it load the MMC with the actual values, or does it still demand an overall reset ?

If you can power down and up again to counter having inadvertedly removed the MMC card, then its all very reasonable.
 
Bad news, although thinking about it, it was to be expected - the "zeroed" values are still there which is fair enough, since following the first cycle, they are now the "current" values.

I just tried out another idea, force fault as in 3), but instead of restarting after the memory reset, power down, switch CPU to RUN and then power back up.

Bad news again still got zeroes instead of data - only this time I can't think of a logical reason off hand. :(
 
Damn Interesting,,,,Bet Siemens don't even know this stuff.......


You could hold onto your case of beer alright RMA, but one thing I that might be different, is that I "Powered" up the CPU without the MMC installed to illustrate that the machine was now useless (AS AM I)
then powered down and re-installed MMC then re-powered up.

BTW whats the bike ?
 
I also tried starting the CPU with the card out, but it didn't make any difference. The key problem is taking the MMC out while the CPU is still switched. What I don't really understand is why it didn't work in the last experiment I tried - that seems to imply that during the memory reset, the saved memory image on the card also gets cleared, i.e. only the basic program as such is left intact, and I can't really see any good reason for that!


BTW whats the bike

It's my old Egli-Vincent Battle of the Twins racer, if I remember rightly the picture was taken in 1987.

The engine is a 1954 Vincent 998ccm V-twin, at the time it was giving about 82 BHP at the rear wheel - and 118dB!

The frame is a 1969 Egli frame, built by Fritz Egli in Switzerland.

In 1988 we had the beast over in USA for the Daytona races in Spring and came in 19th out of a field of 50. Not bad for a 30 + year old engine against the best of the modern twins then available.


Bet Siemens don't even know this stuff

Funny coincidence department - I sent an e-mail to the Siemens hot line this morning asking how the TON16 & TON32 Timers for the FM352-5 behaved if they were started with time = 0.

Got a very belated answer back half-an-hour ago - "Ehmm sorry, we don't know - we've passed your e-mail on to the developement department".
 
Last edited:
You can save the values to the MMC and Reload them later. I have to do this on a WinAC MP-370, beware if you get one.. they have NO retentive memory, they even lose the clock. I have a Unlinked datablock (MMC Stored) that has room for all saved values and then use "WRIT_DBL" to copy the values to their area of the unlinked block when changes are made. I then use "READ_DBL" to copy them back in OB100
 

Similar Topics

Hi Does Siemens supply images for mmc's that have been accidently corrupted or formated?
Replies
1
Views
73
CPU 314-2 PN/DP, was online via laptop over ethernet, then CPU placed in STOP, MMC was removed and placed into SD card slot of an ordinary laptop...
Replies
4
Views
2,357
Hi all, I got a bunch of Siemens MMC cards that seem to be corrupted or something. I was looking for an MMC reader/prommer to format these cards...
Replies
11
Views
4,535
Is it possible to use a non Siemens memory card with a Siemens PLC? And if so how? Would thought you should be able to configure any Memory Card...
Replies
3
Views
2,480
Big hello to everyone, long time no say from me on talks, but i come only with exotics stuff :) There is maybe a new project on the way but it is...
Replies
0
Views
3,335
Back
Top Bottom