Update Z Axis Softlimit from Macro

If you think you've found a bug post it here.

Update Z Axis Softlimit from Macro

Postby maeterlinck » Fri Apr 30, 2021 1:30 pm

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);
maeterlinck
 
Posts: 3
Joined: Fri Apr 30, 2021 9:51 am

Re: Update Z Axis Softlimit from Macro

Postby maeterlinck » Thu May 06, 2021 5:57 pm

Just a friendly bump. Hope someone is able to help. Thanks,
maeterlinck
 
Posts: 3
Joined: Fri Apr 30, 2021 9:51 am

Re: Update Z Axis Softlimit from Macro

Postby dezsoe » Thu May 06, 2021 9:00 pm

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.
dezsoe
 
Posts: 2081
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Update Z Axis Softlimit from Macro

Postby maeterlinck » Mon May 10, 2021 8:35 am

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,
maeterlinck
 
Posts: 3
Joined: Fri Apr 30, 2021 9:51 am

Re: Update Z Axis Softlimit from Macro

Postby dezsoe » Mon May 10, 2021 8:41 am

Hi Nick,

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

I wrote you a PM.
dezsoe
 
Posts: 2081
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary


Return to Report a bug

Who is online

Users browsing this forum: No registered users and 2 guests