I've been chasing my tail with trying to change the jog increment for a full day. To test it without the xBox so as to limit the possible errors I have done the following:
on the jog panel added a DRO and set it to CurrentJogIncr. When using the 'Incremental Jog Step' button it correctly updates.
I then added a button and in the left up script added the following code which is what I would be doing in the xBox controller:
local mInst=0
local CurInc = mc.mcProfileGetInt(mInst,"Preferences","JogIncSet",0) --make a new setting in profile to hold our current inc number
local SetInc = mc.mcProfileGetDouble(mInst,"Preferences","JogInc"..CurInc,0.00) -- fetch our inc value from the profile JogInc + 2 say = [Preferences][JogInc2]
CurInc = CurInc + 1 -- increment our CurInc by 1
if CurInc > 10 then CurInc = 1 end -- if our CurInc is greater than 10 then go back to 1
mc.mcJogSetInc(mInst, mc.X_AXIS, SetInc) -- set inc for axis
mc.mcJogSetInc(mInst, mc.Y_AXIS, SetInc) -- set inc for axis
mc.mcJogSetInc(mInst, mc.Z_AXIS, SetInc) -- set inc for axis
mc.mcProfileWriteInt(mInst,"Preferences","JogIncSet",CurInc) --set our profile to new CurInc
local s=tostring(CurInc)
mc.mcCntlSetLastError(0,s)
When I use the button the txtJogInc control updates but the DRO does not. You can see from the error messages that the CurInc is updating but when the 'Incremental Jog Step' button is used it is not synced to the last change. There seems to be a flaw in the way the dro works or in the way mach checks to see what the current increment has been changed to...or...in my understanding!
Any help?
RT