I've just found out an interesting connection between DROs which are kept persistent by the Constructor and Destructor macros (Writekey and Readkey), and a plugin which reads those DRO values.

I had code in the "firstrun" block of the plugin 25hz loop method. This code reads the value of a persistent DRO.

However I just couldn't figure out why the DRO value was not being read, then I though maybe the plugin starts very quickly whereas the Constructor macro is a bit of a snail and takes time to finish doing its thing (i.e. writing the value to the DRO).

It appears this theory may be correct because I got things working by having a countdown in the 25hz loop before any of my loop code ran. In my case I had to let the 25hz loop run a minimum of 5 times without executing any of my code.

I would guess that with a Constructor macro with a lot more code it would take longer to complete and therefore a plugin which needed to read "persistent" DROs would have to "delay" for longer before it attempted to read those DROs.

I've asked Cncdrive if it would be a good modification to UCcnc to prevent plugins running until the Constructor macro has completed, otherwise if a plugin immediately attempts to read a "persistent" DRO but the Constructor macro hasn't yet written the value to that DRO..................................

Keith.