Author Topic: FMD1616-10 PLC Power off  (Read 15233 times)

kurniss19

  • Newbie
  • Posts: 9
  • I'm a llama!
    • View Profile
FMD1616-10 PLC Power off
« on: September 21, 2012, 04:38:04 AM »
Hi, how do I save the current state of all inputs and outputs when I have a power failure with the FMD1616-10 PLC?


support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:FMD1616-10 PLC Power off
« Reply #1 on: September 21, 2012, 07:28:51 AM »
You will need to have FRAM-RTC-0 or FRAM-RTC-256. Then if you turn on the DIP switch #1, variables A to Z, A$ to Z$ and DM[1] to DM[4000] are non volatile since they are backed up automatically to FRAM.

You can save the state of OUTPUT[n], RELAY[n] etc to FRAM using the SAVE_EEP command during power failure by invoking the power failure interrupt service routine (see chapter on Interrupt I/O).

You can then use 1st.Scan pulse to run an initialization routine and LOAD_EEP to load the FRAM data and store them back to the I/O variables.
« Last Edit: September 21, 2012, 07:35:33 AM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

kurniss19

  • Newbie
  • Posts: 9
  • I'm a llama!
    • View Profile
Re:FMD1616-10 PLC Power off
« Reply #2 on: September 21, 2012, 04:46:03 PM »
I have seen the example in the manual but I still do not understand. Please give me an example on how to do this with a simple start stop program?

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:FMD1616-10 PLC Power off
« Reply #3 on: September 22, 2012, 10:24:01 AM »
For the SAVE_EEP and LOAD_EEP functions, please refer to the sample files in the folder:

TRiLOGI\TL6\user\samples\EEPROM.PC6

As for the power failure interrupt, refer to Chapter 9, section 9.3. You need to run the INTRDEF 17, xxx  where xxx is the function number of the custom function that you define as the power failure interrupt function. When power failure occur this function will be called and that is where you put in the SAVE_EEP statements to save the data of the I/O variables that you want to save.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

kurniss19

  • Newbie
  • Posts: 9
  • I'm a llama!
    • View Profile
Re:FMD1616-10 PLC Power off
« Reply #4 on: September 23, 2012, 07:32:27 PM »
Would this work if there was a power failure?

The functions are:

Power_off:
INTRDEF 17, save_states, 1

save_states:

save_EPP Start, 1
save_EPP Stop, 2
save_EPP Start_enable, 3
save_EPP Start, 4

Load_states:

Start = LOAD_EPP(1)
Stop = LOAD_EPP(2)
Light = LOAD_EPP(3)
Start_enable = LOAD_EPP(4)







support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:FMD1616-10 PLC Power off
« Reply #5 on: September 24, 2012, 04:40:16 PM »
Your Start and stop are digital inputs. These need not be saved since the actual digital inputs will be determined by the electrical states of the signal connected to the digital input when the power is returned to the PLC.

For internal relays and digital outputs their logic states can be saved to the FRAM. But you do not save a single binary I/O to FRAM. Instead you should save the entire variable that represent 16 adjacent digital outputs or internal relay bits.

E.g. OUTPUT[1] variable actually stores the states of digital output #1 to #16. Likewise RELAY[1] stores the states of internal relays #1 to #16.

You can use the 1st.Scan bit to run a custom function to run INTRDEF 17, save_states, 1 in order define the power failure interrupt. So in the custom function with label name "save_states" you can define:

SAVE_EEP OUTPUT[1], 1
SAVE_EEP RELAY[1], 1

Upon power on, you can run a custom function LOAD_states which execute:

OUTPUT[1] = LOAD_EEP(1)
RELAY[1] = LOAD_EEP(2)

You can use 1st.Scan to run the INTRDEF 17. But DO NOT use 1st.Scan to run save_states function since you will overwrite what is stored inside the FRAM.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

kurniss19

  • Newbie
  • Posts: 9
  • I'm a llama!
    • View Profile
Re:FMD1616-10 PLC Power off
« Reply #6 on: September 24, 2012, 06:24:58 PM »
Thank you. I will try it later.

kurniss19

  • Newbie
  • Posts: 9
  • I'm a llama!
    • View Profile
Re:FMD1616-10 PLC Power off
« Reply #7 on: September 24, 2012, 07:54:03 PM »
This can only be done with the FRAM-RTC memory module?

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:FMD1616-10 PLC Power off
« Reply #8 on: September 25, 2012, 05:59:05 AM »
Yes FRAM-RTC module provides the necessary non-volatile fast FRAM to store the data before power goes off completely.

Note that FRAM-RTC-0/256 modules are only needed for Nano-10 or FMD PLCs. There are FRAM that are already built-in onto F2424 and F1616-BA CPU board and therefore they don't require FRAM-RTC-0/256 modules.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

kurniss19

  • Newbie
  • Posts: 9
  • I'm a llama!
    • View Profile
Re:FMD1616-10 PLC Power off
« Reply #9 on: October 07, 2012, 04:30:36 PM »
How do I run the custom function load_states?

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:FMD1616-10 PLC Power off
« Reply #10 on: October 08, 2012, 08:46:33 AM »
You can use a special contact called "1st.Scan" which is a contact that is turned on for the first scan of the ladder logic only. This contact is then used to trigger a custom function (any function number will do, you can name it INIT or anything that make sense). Inside the INIT function you will put in the LOAD_EEP(n) statements to load the stored data back to the PLC

E.g. RELAY[1] = LOAD_EEP(10)  ' restore internal relay  #1 to #16  from FRAM or EEPROM.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

kurniss19

  • Newbie
  • Posts: 9
  • I'm a llama!
    • View Profile
Re:FMD1616-10 PLC Power off
« Reply #11 on: October 09, 2012, 08:02:20 PM »
ok how do i store the timer value?

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:FMD1616-10 PLC Power off
« Reply #12 on: October 09, 2012, 11:59:41 PM »
TIMERPV[1] to TIMERPV[64]
Email: support@triplc.com
Tel: 1-877-TRI-PLCS