Page 1 of 1

Exception thrown by M31 macro

PostPosted: Mon Sep 30, 2024 9:34 pm
by DavidT
Hi,
I've been having this error from time to time and to get arround I would reload a backup UCCNC folder.
I would really like to solve this for good.
If anyone can guide me on where to start, it would be appreciated.

The machine is a CNC mill equiped with an ATC and a MPG pendant.
C94 board with UC300ETH motion controller.
M31 is used to set the Z offset of tools.
The tool setter (TS) is simply a piston sitting on a limit switch.
The macro first rapidly touches the TS, back off then slowly touch it again and stop to acquire the position.
It ususally takes a few seconds before the tool goes back up but this is where I sometimes get the error (just before going up).
As I understand, the error occurs while trying to save the settings but I don't get what else is locking it.

Thank you

Re: Exception thrown by M31 macro

PostPosted: Tue Oct 01, 2024 6:50 pm
by cncdrive
Try to put it into a try/catch and in a loop inside the try and some Sleep in between and reset a boolean variable before the loop and set it after successful saving and test the variable and jump out of the loop only if the variable is set or if a macrostop has occured, because maybe the problem is only that the previous saving process did not end yet and you trying to save to the file while it is still in use.