Author Topic: Non Volitile not saving some spots but saves others  (Read 12343 times)

Offline Mike AA

  • PLUS+1 Guru
  • *****
  • Posts: 116
  • Karma: +0/-0
    • Dewind Dewatering
Non Volitile not saving some spots but saves others
« on: October 18, 2016, 03:55:47 PM »
Like the title says I have 3 spots where the Non Volatile Memory Dynamic saves the value and recalls it on power up. I have 2 program locations where the value does not get loaded upon power up and put to the output. Attached is the working and one non working screen shot. I am not sure what I am missing that is causing it to not save? In service tool I can see the value saved in the nv but the output checkpoint and my display don't show a value output.

Chain save all 3 locations save properly, these are integers 0 to 150 or so.

Mode Save resets upon power up. This is booleon.

Thanks,
Mike
« Last Edit: October 18, 2016, 03:59:25 PM by mikeaa12 »

Offline oiltronic

  • PLUS+1 Guru
  • *****
  • Posts: 170
  • Karma: +15/-0
Re: Non Volitile not saving some spots but saves others
« Reply #1 on: October 20, 2016, 07:46:42 PM »
Are you accidentally inverting LeftHopperMode by that S16 switch or is it on purpose?  Regardless, might be simpler to just use a Retype conversion to S16 and a logical NOT if needed.  A few other notes:
  • The Set-Reset latches connected to the output of the flip-flop seem redundant, and I wonder if they induce a one-cycle propagation delay to the signal.
  • Add a transition-to-pulse conversion right when the Sw_Pulse_Soft1 comes in, and feed that one pulse signal to both the Data Flip-Flop and the NV object.  You might be getting multiple transitions on the flip-flop.
  • The Non-Volatile Memory Dynamic object reads out the value at power-up, so the True constant and pulse at the "Read" input pin can be changed to a False constant.
  • The Data Flip-Flop object is not necessarily reset at power-up, at least according to the help documentation.  So you might want to add the typical "OS.Startup" hardware input signal to the Reset pin.

Offline Mike AA

  • PLUS+1 Guru
  • *****
  • Posts: 116
  • Karma: +0/-0
    • Dewind Dewatering
Re: Non Volitile not saving some spots but saves others
« Reply #2 on: October 20, 2016, 09:15:20 PM »
oiltronic,

Thanks for the notes.

Are you accidentally inverting LeftHopperMode by that S16 switch or is it on purpose? I am using the switch to select items in a text list on the display


The Set-Reset latches connected to the output of the flip-flop seem redundant, and I wonder if they induce a one-cycle propagation delay to the signal. I eliminated the Set-Reset latches and the functionality still works, thanks for that, I will go through and remove them where I don't need them.

Add a transition-to-pulse conversion right when the Sw_Pulse_Soft1 comes in, and feed that one pulse signal to both the Data Flip-Flop and the NV object.  You might be getting multiple transitions on the flip-flop.

The Non-Volatile Memory Dynamic object reads out the value at power-up, so the True constant and pulse at the "Read" input pin can be changed to a False constant. Removed the pulse and changed to a False constant. I though I needed to make it true to read during startup, I was confused in what I had read and seen in examples. Thank you.

The Data Flip-Flop object is not necessarily reset at power-up, at least according to the help documentation.  So you might want to add the typical "OS.Startup" hardware input signal to the Reset pin. Not quite sure what this is? I do not need it to reset.

I actually need everything to save how it was before shut down so that it comes right back on power up. This page reads the button(s) on our display and changes 2 hopper augers from manual control to automatic control going through calculations based on our current rate of travel. I need to to stay on auto if they have to quick power down so they don't have to go back and change it, same thing with needing to stay on manual.

I made the changes but still the NV does not read and output the value. In service tool I can see the value saved within the NV but the output returns to false.
« Last Edit: October 20, 2016, 09:18:04 PM by mikeaa12 »

Offline Mike AA

  • PLUS+1 Guru
  • *****
  • Posts: 116
  • Karma: +0/-0
    • Dewind Dewatering
Re: Non Volitile not saving some spots but saves others
« Reply #3 on: October 20, 2016, 10:11:39 PM »
I figured it out. I had IN-ENABLE set to true so it would just route whatever it was getting at the IN to the VAL. I instead connected IN-ENABLE to the same signal as WRITE. The bad part about that is now I may have to press the button twice to change the value, but once the value is set it stays after power down.

-Mike

Offline oiltronic

  • PLUS+1 Guru
  • *****
  • Posts: 170
  • Karma: +15/-0
Re: Non Volitile not saving some spots but saves others
« Reply #4 on: October 20, 2016, 10:42:51 PM »
Glad you figured it out, and sorry that I missed that one when comparing your circuit to an equivalent one of mine, where IN-ENABLE is indeed tied direct to WRITE.

Quote
The Data Flip-Flop object is not necessarily reset at power-up, at least according to the help documentation.  So you might want to add the typical "OS.Startup" hardware input signal to the Reset pin. Not quite sure what this is? I do not need it to reset.
Here's a circuit using OS.Startup to reset an output that is toggled with each button press: