Author Topic: Initial Value during Programming  (Read 12190 times)

CPEng

  • Newbie
  • Posts: 7
  • I'm a llama!
    • View Profile
Initial Value during Programming
« on: August 29, 2011, 04:00:51 PM »
I'm trying to figure out the best way to initialize non-volatile memory variable to default values during programming.

I have a F1616-BA PLC and have switched DIP #1 to "on" to make DM[300] and above non-volatile.

I thought 1st scan would work but in testing that runs after every power cycle. I need the variables to retain their set values during a power failure, but they need to be initialized to a default value during programming.

Thanks for any help.

garysdickinson

  • Hero Member
  • Posts: 502
  • Old PLC Coder
    • View Profile
Re:Initial Value during Programming
« Reply #1 on: August 29, 2011, 07:49:22 PM »
The F1616BA has a chunk of non-volatile FRAM.  You can initialize this non-volatile memory using the EEPROM manager that is part of the I-Trilogi program.

On the first scan you can copy the non-volatile values into the DM[]. Look up the load_eep and save_eep tbasic functions to see how to access this true non-volatile memory.

I have used this on several of my projects. It allows me to customize a system without having to modify the PLC program.  I can change some of the tuning constants in the non-volatile memory and then reboot the PLC so that it can use the new values.  This is a very useful technique for storing user data.


Gary d
« Last Edit: August 29, 2011, 08:32:18 PM by garysdickinson »

CPEng

  • Newbie
  • Posts: 7
  • I'm a llama!
    • View Profile
Re:Initial Value during Programming
« Reply #2 on: August 30, 2011, 09:33:28 AM »
Gary thanks for the tip.

That looks to be the best way.