Internet PLC Forum

General => Technical support => Topic started by: smcmains on August 19, 2009, 06:40:34 AM

Title: Saving values in DM[]
Post by: smcmains on August 19, 2009, 06:40:34 AM
I'm using a T100MD-2424+ PLC for a gauging application in our facility.  I would like to save part count in a DM[] location (every time a part is ran, the part count goes up).  I only have 1 concern.  In the Programmer's Reference (pageA1-6) it states that "EEPROM has a typical life-span of about 100,000 to 1,000,000 erase-write cycle.  Exceeding this limit will "wear out" the EEPROM and resulting in a read error when the PLC operates".  If I'm storing part count in a DM location will this be a problem.  This gage will run aproximately 30,000 parts per week so it would not take long to reach the 100,000 erase-write cycles.  Do the DM's get saved in the EEPROM and will this be a problem.
Title: Re:Saving values in DM[]
Post by: support on August 19, 2009, 09:43:24 AM
DMs are located in RAM and have unlimited read and write cycle. They are not stored in EEPROM. Only SAVE_EEP, SAVE_EEP$, SETTIMERSV and SETCTRSV commands save to EEPROM and these are the kind of commands you want to take note not to exceed their life limit.

Note that DM are 16-bit variables so their counts are between -32768 to 32767. If you need larger range then you should use two DMs to store one data point, with one of the DM record from 0 to 9999 and once it exceeds 9999, set it to zero and increment the next DM by 1.


E.g.    DM[I+1] = DM[I+1]+1
          IF DM[I+1] > 9999
                 DM = DM+1    ' carry to the 10000 digit
                DM[I+1] = 0
          ENDIF
 
I is used as an index in the above example. It can be anything else.