17
« on: September 11, 2012, 11:55:00 AM »
numtools = 99 'The number of valid tools
newtool = GetSelectedTool( ) 'read the new requested tool
currenttool = GetOEMDRO(1000) 'user DRO 1000 is used to store the current tool. In this line assign whatever is in this DRO to the variable
While(currenttool< 1 Or currenttool > numtools) 'Check that currenttool contains a legal tool number.
currenttool = question("Please enter the current tool") ' If not ask to enter the current tool in position.
Wend
SetOEMDRO 1000,newtool ' Set user DRO 1000 to the new tool number
If (newtool > 0) Then 'Added this
dist = (newtool Mod 8 ) - (currenttool Mod 8 ) ' the number of turret positions to move to the requested tool.
If (dist < 0) Then 'Check if rollover needed
dist = 8 - Abs(dist)
End If
Code " G91 G0 A" & dist ' Move to the new turret position.
While IsMoving()
Wend
Code " G91 G0 A" & (-dist/5) ' Reverse move to lock - set to 1/5th of one position and can be changed
While IsMoving()
Wend
Code "G90" ' Set back to absolute mode.
SetCurrentTool(newtool)
End If
hi all
ok i have the turret moving but not the correct amount. it takes 266 steps to get one full revolution in motor tuning.
in tool table i have setup some tools and asigned a degree in turret deg.
dose the turret deg relate to the position of the tool in the turret in degrees and if so why does the turret not move to this degree setting.
thanks in advance