Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started 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
-
I think that would go in the unload script, then you load the values again in the load script.
Peter
-
I was hoping for a check box somewhere called "Persisent DRO's"...like in M3. No big deal to code it though.
-
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
-
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.
-
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.
-
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.
-
Switched to using the PLC script and it's working great now. Thanks
-
:)