Machsupport Forum
Mach Discussion => Mach4 General Discussion => Mach4 Plugins => Topic started by: KPfundstein on November 14, 2024, 03:47:26 PM
-
Hi, I try to use the mcAxisSetSoftlimitMin on the z Axis to avoid a tool crash against the machine when working with different tools. During the M6 script i update the Softlimit with a new value. The problem is, that the value is not active immediately. after I close mach4 and restart it again the value is updated and used. is there any different possibility to update soft limits during M6 ?
-
I already tried to enable and disable the limits 🙂 for testing outside M6 I added a Button to the screen and tested different code....
Test1:
mc.mcAxisSetSoftlimitEnable( 0, mc.Z_AXIS, 0)
rc = mc.mcAxisSetSoftlimitMin( 0, mc.Z_AXIS, -100)
mc.mcAxisSetSoftlimitEnable( 0, mc.Z_AXIS, 1)
Test2:
mc.mcSoftLimitSetState(0, mc.Z_AXIS, 0)
rc = mc.mcAxisSetSoftlimitMin( 0, mc.Z_AXIS, -100)
mc.mcSoftLimitSetState(0, mc.Z_AXIS, 1)
Test3:
mc.mcAxisSetSoftlimitEnable( 0, mc.Z_AXIS, 0)
mc.mcSoftLimitSetState(0, mc.Z_AXIS, 0)
rc = mc.mcAxisSetSoftlimitMin( 0, mc.Z_AXIS, -100)
mc.mcSoftLimitSetState(0, mc.Z_AXIS, 1)
mc.mcAxisSetSoftlimitEnable( 0, mc.Z_AXIS, 1)
I also tried to disable and enable the axis....
mc.mcAxisEnable(0,mc.Z_AXIS,0)
mc.mcAxisSetSoftlimitEnable( 0, mc.Z_AXIS, 0)
mc.mcSoftLimitSetState(0, mc.Z_AXIS, 0)
rc = mc.mcAxisSetSoftlimitMin( 0, mc.Z_AXIS, -100)
mc.mcSoftLimitSetState(0, mc.Z_AXIS, 1)
mc.mcAxisSetSoftlimitEnable( 0, mc.Z_AXIS, 1)
mc.mcAxisEnable(0,mc.Z_AXIS,1)
the result is always the same ;-( Softlimits only updated after restart of mach4
-
Have you tried toggling the softlimit button on screen?