Author Topic: Memory after power down  (Read 15636 times)

TWilce

  • Newbie
  • *
  • Posts: 4
  • I'm a llama!
    • View Profile
Memory after power down
« on: June 16, 2012, 09:56:30 PM »
The below function works perfect on the FMD1616-10 but not on the F1616-BA.

The F1616-BA. Does work ok but does not retain memory. I have changed the DM[ ] to the 300 range but the A ? Z does not hold memory. When it reboots the C resets the DM to 0.
I have tried different combinations but no luck. Could you please send me an example of how this is done.

c=c+1
DM[1]=GetHIGH16(C) :)
DM[2]=c
h=c/3600
DM[3]=GetHIGH16(C/3600)
DM[4]=(C/3600)

Thanks Troy


 

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Memory after power down
« Reply #1 on: June 18, 2012, 12:26:06 PM »
F1616-BA does not retain A to Z which are non-volatile memory. However, it retains DM[301] to DM[4000] if DIP switch #1 is turned ON.

You can also save the data that needs to be non-volatile into the FRAM memory by using the SAVE_EEP command and load them back into the volatile memory such as A to Z or DM[1] to DM[300] using the LOAD_EEP(n) command.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

TWilce

  • Newbie
  • *
  • Posts: 4
  • I'm a llama!
    • View Profile
Re:Memory after power down
« Reply #2 on: June 20, 2012, 12:16:44 AM »
As all this is new to me i can not get the load_eep and save_eep to work.

A to z keeps reseting to 0.

What am i doing wrong.

Also the DM[1] = load_EEP(10) can you help me with what location the 10 stands for. I am confused "sorry"

  c=c+32768
DM[301]=GetHIGH16(C)
DM[302]=(c)
h=c/3600
DM[303]=GetHIGH16(h)
DM[304]=(h)
SETLCD 1,1,"HOURS = "+STR$(h)+"    "
save_EEP Gethigh16(c),310  
save_EEP c,311                    

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Memory after power down
« Reply #3 on: June 20, 2012, 10:57:44 AM »
The data memory (called FRAM) that the SAVE_EEP and LOAD_EEP commands access is separate from the DM[] and A-Z variables. There are 6000 memory locations available that are addressed from 1 to 6000. Refer to chapter 1.7 of the F-series user manual for more on program and data memory.

You can load values from FRAM into the A-Z variables using LOAD_EEP when the PLC first powers on and then save them using SAVE_EEP whenever the A-Z values are updated. One example is as follows:

C = LOAD_EEP(311)
SETHIGH16 C,LOAD_EEP(310)
H = LOAD_EEP(313)
SETHIGH16 H,LOAD_EEP(312)

Your code looks good, but you can change the save_eep commands at the end to store all 4 DM[] values as follows:

  c=c+32768
DM[301]=GetHIGH16(C)
DM[302]=(c)
h=c/3600
DM[303]=GetHIGH16(h)
DM[304]=(h)
SETLCD 1,1,"HOURS = "+STR$(h)+"    "

save_EEP DM[301], 310
save_EEP DM[302], 311
save_EEP DM[303], 312
save_EEP DM[304], 313
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

TravisB

  • Newbie
  • Posts: 33
  • I am NOT a llama!
    • View Profile
Re:Memory after power down
« Reply #4 on: July 12, 2012, 11:01:11 AM »
Do the EEP commands work in the simulator? I've been trying and having no luck, so I think not, but I thought I'd ask just in case the mistake is mine.

TWilce

  • Newbie
  • *
  • Posts: 4
  • I'm a llama!
    • View Profile
Re:Memory after power down
« Reply #5 on: July 12, 2012, 12:17:42 PM »
Not sure on the simulator but the programe info with load and save eep works perfect thanks.

Troy

garysdickinson

  • Hero Member
  • Posts: 502
  • Old PLC Coder
    • View Profile
Re:Memory after power down
« Reply #6 on: July 12, 2012, 06:42:13 PM »
The EEP commands DO NOT work on the simulator.

The EEP commands only work on real hardware.

The simulator is very rudimentary.  Unfortunately, there are other things that the simulator cannot handle.  

A good hint is that the simulator does not ask your what PLC you are using, what options you have installed or what revision firmware is running on the PLC.  All of these things would be needed to be "known" by the simulator for it to do a better job.

Sorry,

Gary D.