Author Topic: Reset without changing DM Values  (Read 11897 times)

mvincent

  • Newbie
  • Posts: 8
  • Ska Brew!
    • View Profile
Reset without changing DM Values
« on: November 21, 2011, 07:05:22 AM »
How can I reset all I/O's, counters, and sequencers, without losing my DM values?  I need to have an E-stop on a machine, but I don't want to lose all DM values....

Thanks
Matt

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Reset without changing DM Values
« Reply #1 on: November 21, 2011, 11:47:52 AM »
Which PLC model are you using?

The best way is to execute a SAVE_EEP command and save the range of DM that you need to the EEPROM/FRAM and upon power on a 1st.Scan pulse can execute an INIT function and load the data from the EEPROM/FRAM back to the DM.

Email: support@triplc.com
Tel: 1-877-TRI-PLCS

mvincent

  • Newbie
  • Posts: 8
  • Ska Brew!
    • View Profile
Re:Reset without changing DM Values
« Reply #2 on: November 21, 2011, 08:39:11 PM »
I am using  2 -F2424's and one Nano and only one F2424 has to retain the data as I am writing to the other slaves.  I looked at the save eep command and am still unsure on how to convert 16 bit integer data to to DM values.  I am using DM[110]-DM[115].  All help is appreciated!

Thanks
« Last Edit: November 21, 2011, 08:55:33 PM by mvincent »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Reset without changing DM Values
« Reply #3 on: November 21, 2011, 11:21:15 PM »
You can run a FOR NEXT loop to save the data

FOR I = 0 to 5
   SAVE_EEP  DM[110+I],  I + 10  ' (save in FRAM address 10 to 15)
NEXT

RESET  ' after the data are saved, you then do a RESET.


'  the following should be in the INIT function
'  Functions to load from FRAM back to DM:

FOR I = 0 to 5
    DM[110+I] = LOAD_EEP(I+10)
NEXT





Email: support@triplc.com
Tel: 1-877-TRI-PLCS

mvincent

  • Newbie
  • Posts: 8
  • Ska Brew!
    • View Profile
Re:Reset without changing DM Values
« Reply #4 on: November 22, 2011, 06:13:49 AM »
Thanks!