Page 1 of 1

Update Z Axis Softlimit from Macro

PostPosted: Fri Apr 30, 2021 1:30 pm
by maeterlinck
Hi all,
I'm posting this in the Bug forum as I can't see an issue with the code, feel free to move if I'm mistaken.
As part of the M31 macro we update the the Z axis softlimits to prevent machining past the bleeder board - sort of a fail safe. In the past this has worked fine, however it is not correctly updating the field now (now = the last few months - it hasn't been a priority. We don't believe anything major changed to break it). The correct value is shown briefly in the box, but it then quickly reverts back to the original value. We have tried running the commands in different orders without success.

As an aside manually updating this field only works if we press Apply before Save. Pressing Save first (my understanding was this was the same as Apply then Save) causes the value to revert and not update.

These are the lines of code. I've added lines here to show the variables referenced. All else works in the wider script and no errors are generated.

Many thanks,

Nick

Code: Select all
int    Zaxissoftlimitminus = 41;

double Zzero = exec.GetZmachpos();
double zSoft = Zzero - zProbeH;

AS3.Setfield(zSoft, Zaxissoftlimitminus);
AS3.Validatefield(Zaxissoftlimitminus);
exec.Callbutton(168);
exec.Callbutton(167);

Re: Update Z Axis Softlimit from Macro

PostPosted: Thu May 06, 2021 5:57 pm
by maeterlinck
Just a friendly bump. Hope someone is able to help. Thanks,

Re: Update Z Axis Softlimit from Macro

PostPosted: Thu May 06, 2021 9:00 pm
by dezsoe
It's interesting. This should work fine when you don't call it from a running g-code. (Apply/Save conflicts with running g-code, but this is version dependent, because there were versions where this could hang the program, but later this was fixed.) Which version of UCCNC do you use? And yes, Save calls Apply first since a very long time.

Re: Update Z Axis Softlimit from Macro

PostPosted: Mon May 10, 2021 8:35 am
by maeterlinck
Hi Dezsoe,
Thanks for the reply. We are running the the Beta (1.2112).
So I went to take a video of the behaviour and discover that setting the value twice in a row makes it stick.
So, in both manual and automatically (Gcode):
  • Set Value (inc Validate in gCode)
  • Apply
  • Value reverts
  • set value
  • Apply
  • Value now sticks
So I have a work around. This feels very much like a bug. Any further input would be great.
Thanks,

Re: Update Z Axis Softlimit from Macro

PostPosted: Mon May 10, 2021 8:41 am
by dezsoe
Hi Nick,

I have to test it with 1.2113. 1.2112 is already closed.

I wrote you a PM.