Hello Guest it is April 25, 2024, 01:43:19 PM

Author Topic: Persistent DRO's  (Read 3700 times)

0 Members and 1 Guest are viewing this topic.

Persistent DRO's
« on: May 15, 2015, 10:31:36 PM »
Is there a way...or a setting...to make DRO's persistent like in M3?  Or do I have to save them in registers on exit and load on startup?  If that's the case, where would that script go?

Thanks
Re: Persistent DRO's
« Reply #1 on: May 16, 2015, 11:28:41 AM »
I think that would go in the unload script, then you load the values again in the load script.

Peter
Re: Persistent DRO's
« Reply #2 on: May 16, 2015, 12:20:01 PM »
I was hoping for a check box somewhere called "Persisent DRO's"...like in M3.  No big deal to code it though.
Re: Persistent DRO's
« Reply #3 on: May 19, 2016, 03:43:13 PM »
I posted this a while ago and since have got back to working with M4.  I notice when I add a register, I can set it as persistent.  Sometimes that works and sometimes changing it to persistent makes M4 crash.  The registers that are set to persistent, are persistent.  It's just when I go to change a red X to the green check on the few that are not, M3 crashes.

Any ideas?   Thanks

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Persistent DRO's
« Reply #4 on: May 19, 2016, 09:13:49 PM »
I'm not sure why setting the registers to persistent are causing a crash but have seen it myself. Make sure your using the latest is the best you can do for that right now. I know it was being looked at a while back.

I set up a section in the first run of the PLC script called persistent DROs. You can add yours to that list by adding them to the table. You need to make sure that when you change a value in your DRO or label that you write that value to the ini for it to work.
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: Persistent DRO's
« Reply #5 on: May 19, 2016, 10:58:36 PM »
I added scripts in screen load and unload to read data from a delimited text file on load and populate the text fields...and write data to the file on close.  It's working fine, but probably not the most elegant way around it.

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Persistent DRO's
« Reply #6 on: May 19, 2016, 11:48:49 PM »
That will work too. The reason I put them in the PLC script was the DROs weren't in scope until after screen load. That may have changed since then though.
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: Persistent DRO's
« Reply #7 on: May 24, 2016, 02:36:06 PM »
Switched to using the PLC script and it's working great now.  Thanks

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Persistent DRO's
« Reply #8 on: May 24, 2016, 02:50:23 PM »
 :)
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!