Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: Bill_O on February 28, 2019, 12:13:30 PM

Title: changing value in CurrentX dro
Post 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.
Title: Re: changing value in CurrentX dro
Post by: thosj on February 28, 2019, 12:23:43 PM
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
Title: Re: changing value in CurrentX dro
Post by: Bill_O on February 28, 2019, 12:26:15 PM
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
Title: Re: changing value in CurrentX dro
Post by: gorf23 on February 28, 2019, 12:41:59 PM
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
Title: Re: changing value in CurrentX dro
Post by: Bill_O on February 28, 2019, 02:00:13 PM
Gary,

I will give that a try.
I tried using droCurrentX and that did not work.
Where did you find the dro numbers?

Bill
Title: Re: changing value in CurrentX dro
Post by: Bill_O on February 28, 2019, 03:16:24 PM
Gary,

That did not work but thanks for the assistance.

Bill
Title: Re: changing value in CurrentX dro
Post by: gorf23 on February 28, 2019, 04:11:06 PM
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
Title: Re: changing value in CurrentX dro
Post by: Bill_O on February 28, 2019, 05:50:48 PM
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
Title: Re: changing value in CurrentX dro
Post by: rhtuttle on February 28, 2019, 07:28:53 PM
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