Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: c30232 on November 08, 2014, 11:10:15 PM
-
I am using the below script to move a gantry move or specifically a selectable rip fence for a gang-rip saw. I need help redefining the DRO in the script from User DRO to X DRO.
Distance = GetUserDRO(1008)
Code "g90 G0 X" & distance & "A" & distance
The User DRO is the value of the coordinate used to position the fence. I would like to capture the value from from the Y axis DRO in place of the user DRO.. The User DRO is a manual entry. The Y axis DRO would be derived from the jog movement of Y which drives a laser line.
Thus the distance + X DRO rather than the user DRO.
-
Hmm, I got it to work as below by changing to OEM codes, however, I have not been successful when using the standard code label.
Distance = GetOEMDRO(801)
Code "g90 G0 X" & distance & "A" & distance
-
Try this.
SetUserDRO(1008, 1.234) 'UserDRO(1008) = 1.234
Distance = GetUserDRO(1008)
Code "g90 G0 X" & distance & "A" & distance
'X and A move to 1.234
-
Thanks, I will give it a try. What does 1.234 represent?
I found a conflict when the value goes negative and and scratched this out.
Distance = (GetDRO(30) * -1) + (GetOEMDRO(800) - GetOEMDRO(803))
Code "F30 g90 G0 X" & distance & "A" & distance
-
Thanks, it works.