Hello Guest it is March 29, 2024, 09:52:21 AM

Author Topic: DRO Script help.  (Read 2376 times)

0 Members and 1 Guest are viewing this topic.

Offline c30232

*
  •  122 122
    • View Profile
DRO Script help.
« 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.   

Offline c30232

*
  •  122 122
    • View Profile
Re: DRO Script help.
« Reply #1 on: November 08, 2014, 11:37:48 PM »
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
Re: DRO Script help.
« Reply #2 on: November 11, 2014, 07:12:31 PM »
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

Offline c30232

*
  •  122 122
    • View Profile
Re: DRO Script help.
« Reply #3 on: November 11, 2014, 07:22:51 PM »
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   

Offline c30232

*
  •  122 122
    • View Profile
Re: DRO Script help.
« Reply #4 on: November 11, 2014, 09:19:25 PM »
Thanks, it works.