Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: rrc1962 on May 15, 2015, 10:31:36 PM

Title: Persistent DRO's
Post by: rrc1962 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
Title: Re: Persistent DRO's
Post by: pbarratt 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
Title: Re: Persistent DRO's
Post by: rrc1962 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.
Title: Re: Persistent DRO's
Post by: rrc1962 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
Title: Re: Persistent DRO's
Post by: Chaoticone 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.
Title: Re: Persistent DRO's
Post by: rrc1962 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.
Title: Re: Persistent DRO's
Post by: Chaoticone 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.
Title: Re: Persistent DRO's
Post by: rrc1962 on May 24, 2016, 02:36:06 PM
Switched to using the PLC script and it's working great now.  Thanks
Title: Re: Persistent DRO's
Post by: Chaoticone on May 24, 2016, 02:50:23 PM
 :)