Hello Guest it is March 28, 2024, 09:53:45 AM

Author Topic: Add a A DRO  (Read 10233 times)

0 Members and 1 Guest are viewing this topic.

Add a A DRO
« on: October 11, 2009, 09:39:29 AM »
Hi to all,

I have this macro (writen by Graham I think):

' Boxford 160TCL Toolchanger Macro.
'
' Works by turning CW to just past the tool position
' and then CCW into a stop.
' Axis setup as rotary e.g. move 360 = 1 full turn.



If IsLoading() Then
' Do Nothing, program loading
Else

' Dim Variables

Dim Num_Tools As Integer
Dim CW_Steps_Per_Tool As Integer
Dim CCW_Steps As Integer
Dim HoldingDRO As Integer
Dim Requested_Tool As Integer
Dim Current_Tool As Integer
Dim CW_Feed As Integer
Dim CCW_Feed As Integer

Dim moves As Integer
Dim total_move As Integer


' set up some vars

Num_Tools = 6
CW_Move_Per_Tool = 360/Num_Tools
CCW_Move = 10
HoldingDRO = 1050
Requested_Tool = GetSelectedTool()
Current_Tool = GetUserDRO(HoldingDRO)
CW_Feed = 1500
CCW_Feed = 1000
Current_Feed = GetOEMDRO(818)


' start tool change

Message ("Requested Tool No=" & Requested_Tool)

If Requested_Tool > Num_Tools Then
Message "Requested Tool No. too high, program stopped."
Code "M30"
End
End If

If Requested_Tool < 1 Then
'Message "Requested Tool No. too low, program stopped."
Code "M30"
End
End If

If Requested_Tool = Current_Tool Then
' do nothing
Else
' lets do some changing
If Requested_Tool > Current_Tool Then moves = Requested_Tool -Current_Tool
If Requested_Tool < Current_Tool Then moves = Num_Tools - Current_Tool +Requested_Tool

total_move = (moves * CW_Move_Per_Tool)+(CCW_Move/2)

Code "G0 z-10 F1300"
Code "G0 x-10"
Code "G91 G94" 'incremental & Feed per minute
Code "G0 A" & total_move '& "F" & CW_Feed
Code "G0 A" & "-" & CCW_Move '& "F" & CCW_Feed
While IsMoving()
Wend

SetCurrentTool Requested_Tool
SetUserDRO HoldingDRO, Requested_Tool
Code "G90" ' back to absolute movement
Code "F" & Current_Feed
End If
End If

' end of tool change       
I need to put a A DRO on my lathe screen to see if my A axis is running. I don't have anything connects yet. I just want a simulation.
How can I do that?

RGDS
Gabi

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Add a A DRO
« Reply #1 on: October 11, 2009, 10:58:43 AM »
Download Mach Screen or screen 4 and open your screen set and add a dro and save the screen set. You can look in the Wiki to find the a axis dro number. Also, video tutorials that will help can be found in the support tab at the top of this page.  

Mach Screen link.  http://www.kd-dietz.de/index.htm   Click on the english button then project.

Screen 4 link.  http://www.machsupport.com/downloads/Screen4.zip

Brett
« Last Edit: October 11, 2009, 11:02:25 AM by Chaoticone »
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: Add a A DRO
« Reply #2 on: October 11, 2009, 08:14:17 PM »
Hi Brett,

I already try that. Here it is what I do:
-  I put that DRO on screen
- OEM code is 86
- X an Z axis show the right value from macro

A DRO dosent show anything. Why?

RGDS
Gabi

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Add a A DRO
« Reply #3 on: October 11, 2009, 08:48:08 PM »
Instead of makeing the DRO an OEM number, make it a system function, a axis.

Brett
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: Add a A DRO
« Reply #4 on: October 11, 2009, 09:31:44 PM »
Hi Brett,

I try that too and I don't see any numeber moving. Remember it is a screen for a lathe. Sorry to be a PITA but I don't know how to do that. Please help me

RGDS
Gabi
Re: Add a A DRO
« Reply #5 on: October 12, 2009, 04:34:10 AM »
Hi Gabi,

is the macro in the correct directory? Try putting a "message" like  Message ("Test toolchange") on top of the macro and run it from the mdi. This message should appear in the status line. 


Klaus
The brain isn't a soap, it doesn't shrink when used.
Re: Add a A DRO
« Reply #6 on: October 12, 2009, 05:38:08 AM »
Hi Klaus,

I think it is. The  path it is: C:\Mach3\macros\Mach3Turn and the name of that file it is m6661.m1s.

RGDS
Gabi
Re: Add a A DRO
« Reply #7 on: October 12, 2009, 05:47:19 AM »
Hi Gabi

did you see the message in the status line?


Klaus
The brain isn't a soap, it doesn't shrink when used.
Re: Add a A DRO
« Reply #8 on: October 12, 2009, 05:52:28 AM »
Hi Klaus,

I think so. In the macro message it is "Requested Tool NO=1 till 6" It apperas on message line. That is the message you are talking about?

RGDS
Gabi
Re: Add a A DRO
« Reply #9 on: October 12, 2009, 06:29:12 AM »
Hi Gabi,

I just made a test screen.set and it worked OK, I couldn't test on a machine, because I don't have a cnc lathe. One nother thing came into my mind, do you have the A-axis enabled in your pin/port settings?

Klaus
The brain isn't a soap, it doesn't shrink when used.