Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: Bill_O on February 28, 2019, 12:13:30 PM
-
I have tried several things to get a specific number in the CurrentX dro.
G92 works but it also is an offset which messes up some other things.
-
I have tried several things to get a specific number in the CurrentX dro.
Have you tried clicking in the DRO and typing the number you want?
Tom
-
tom,
i need to do it within a lua script
in mach3 when i used g92 it behaved much different than it does in mach4
it all has to do with some positioning that i need to adjust multiple times
bill
-
off the top of my head i think that I used something like this in a script
xpos = mc.mcAxisGetPos(inst, mc.X_AXIS) -- Get X Axis Position
scr.SetProperty("dro134","Value", tostring(xpos))
gary
-
Gary,
I will give that a try.
I tried using droCurrentX and that did not work.
Where did you find the dro numbers?
Bill
-
Gary,
That did not work but thanks for the assistance.
Bill
-
screen edit just rename the x dro name to whatever you like and replace your dro name with scr.SetProperty("your dro name","Value", tostring(xpos))
gary
-
Gary,
I just made a new dro and it appears to be working.
Not sure why the one native to mach4 wouldn't do it.
Having another problem so I am not positive it is working but it looks like it.
Thanks,
Bill
-
Make sure that the droCurrentX editor property is not still set as read only. This was reported a year ago for the lathe screen set and wasn't changed the last time I downloaded a new version last fall.
Not sure what you are trying to do but I think you probably should be using mc.mcAxisSetPos(inst,mc.X_AXIS,10.3456) rather than changing screen values.
Just my 2 cents worth
HTH
RT