Siemens S7-300

BNA

Member
Join Date
Sep 2003
Location
Give
Posts
117
Hi' All

For a project i need to keep count of how many pieces the machine makes, is it in any way possible to store a value from a counter even if the Plc is powerless for 3 months or more, or do i have to purchase a mecanical counter for this ?

Regards

Brian
 
Data blocks, in new S7-300 CPUs, are stored in the flash card MMC. For ever.
 
I know how put put the counter value into a datablock but this will by set to initial value if you repower the Cpu.

How do you STORE the values in a datablock on the memorycard ?????
 
CPU 300-C
SIMATIC Manager / Station simatic 300 / Hardware / Open CPU --> Retentive memory and select "Number of S7 Counter Statrting with C0:

memory areas will be retentive even without a battery backup (in the backup memory of the CPU).
 
You don't need to, the current S7 300 CPUs do it for you, although be aware that in some of the CPUs (for example the 317) you can define some DBs to be non retentive. By default, DBs are always retentive (as are all other memory areas, Merker, Timer, Counter, etc., although you can usually define that only a certain part of the memory is retentive, or in the case of the smaller CPUs, this is predefined).

Edit: I see I overlapped with rgua, but in essence we're saying the same thing. The question is, do you really need to save your counter value in a DB, or will it suffice to make the counter itself retentive as described by rgua?
 
Last edited:
Just remember, the counters only go up to 9999. If you want to go higher and retain the count (counters are non-retentive) use a DINT (Double integer) in a DB. You can go up over 4 billion. Use the Integer function from the menu and you will see ADD_DI. If you want to be creative, you could create a DB, fill it with DINTs and store 4 billion counts for each day for a few years. It would only take a few lines of code.
 
The S7 Counters are (for a definable number) retentive in current 300-Series CPUs, but as RRobbins says, they only count to 9999.

The IEC- Counters count over the signed integer range of ~-32k - +32k, but are NOT retentive.

If you need large counts AND retentive, the DINT / DB solution is the way to go.
 
Thanks

The solution whit the DINT is what i need, this machine is running aprox. 60 strokes/min for 8 to 10 hours a day, and the counts will only be reset ones or twice a year.

So i think that the retentive DB whit DINT is what i need.
 
better not to use a standaard s5-counter.

built your own counter with a DBx.DBDxx
(a double word in a datablock)

retentive, and counts up to 2.000.000.000.....
 

Similar Topics

Hello all. I have an ESA HMI that is connected to a Simatic S7-300 (CPU312). I have uploaded the program from the PLC which is written with Step7...
Replies
6
Views
1,429
Hello. There is a problem with Siemens S7 300. We got a replacement PLC but it does not run the program from the MMC. The new PLC is dated 2011...
Replies
3
Views
676
Hi to all, Our company does not usually use Siemens PLCs, but have a press with one in it. We are trying to change the IP address in our Simatic...
Replies
2
Views
1,062
G'day guys, I am setting up a s7-300 as a test rig for the workshop and when I downloaded the PLC is not going into run mode, I keep getting a...
Replies
35
Views
5,181
I am trying to write just MSEC to S7 300 Controller date/time using OI.SIDIRECT Aveva communication driver? The old HMI (WINCC) tag is assigned...
Replies
1
Views
1,054
Back
Top Bottom