Hello Guest it is January 24, 2022, 03:46:36 PM

Author Topic: Macro VB Script for Lathe Toolchanger  (Read 33343 times)

0 Members and 1 Guest are viewing this topic.

Re: Macro VB Script for Lathe Toolchanger
« Reply #20 on: December 26, 2007, 05:27:19 AM »
Hello Weedy,

In your macros, there is no offsetting of the tool during turning the ATC, to prevent collision. Do you carry out this  with separate G- Code or want you to integrate this in your actual macro?
 I think, integrating in the macro is the more convenient way, I've done this, see above, but have a problem with positioning in incremental coordinate mode.

Greetings,
Helmut
In theory, there is no difference between theory and practice. In practice there is.

Offline CNCwt

*
  •  65 65
    • View Profile
Re: Macro VB Script for Lathe Toolchanger
« Reply #21 on: December 26, 2007, 06:56:33 AM »
Hi Helmut,

I have not touched yet the macro vb for the toolchanger safe position codes. I think I will be including the safe tool change position in the macro when I finalize my setup. The offset is taken care of by the tool table if I am not mistaken.

If you look at this video (http://www.youtube.com/watch?v=8oVD7mrY9zw), you will notice that every time a tool change is being made, it goes back to a safe tool change position.

Can you elaborate further with your problem in positioning in incremental coordinate mode?

Thanks,
Weedy         

Online Graham Waterworth

*
  • *
  •  2,437 2,437
  • Yorkshire Dales, England
    • View Profile
Re: Macro VB Script for Lathe Toolchanger
« Reply #22 on: December 26, 2007, 07:03:05 AM »
Helmut,

if your machine has homing switches fitted then one way to go to a safe position is by using G53 Xnnn Znnn this is a known point in machine coordinates from the zero return point.

Graham.
Without engineers the world stops
Re: Macro VB Script for Lathe Toolchanger
« Reply #23 on: January 05, 2008, 02:38:54 PM »
Hi Weedy, Graham,

Sorry for the late response (i had to spend some holidays with my family) . I have tried another solution for the work offset, because in the old version is making troubles, if the machine is in G91 (incremental) mode. In this mode, moving with machine coordinates will not work.
In my new version, the mode will not influence the moving.

BTW: How can i realize a "do nothing" in VB Script ?




'Werkzeugwechslermakro f. Trolcut430, Helmut Heigl, R0.8 08/01/05
Sub Main()
OldTool = GetOEMDRO (1200) 'actual tool
tool = GetSelectedTool()'new tool selected
incremental= GetOEMLED (49)'get coordinate system (absolute or incremental)
NewTool = tool
MaxToolNum = 4    'number of tools
ToolFreistX = 40   'Offset "X"
ToolFreistZ = 40   'Offset "Z"          

If NewTool = OldTool Then
   Exit Sub
End If
While NewTool > MaxToolNum
NewTool = Question ("Bitte andere Werkzeugnummer eingeben: 1-" & MaxToolNum)
Wend
Code "G91"'change to relative coordinates
While IsMoving()
Wend
Code "G00 X" & ToolFreistX & " Z" & ToolFreistZ 'offset tool
While IsMoving()
Wend
ActivateSignal(Output1) 'turning toolpost clockwise "ON"
Call MovePos(NewTool)
While IsMoving()
Wend
DeActivateSignal(Output1) 'turning toolpost clockwise "OFF"
Code "G4 P.5" 'short time- delay, can possibly been deleted
While IsMoving()
Wend
ActivateSignal(Output2) 'turning toolpost CCW (clamping)"ON"
Code "G4 P0.5"    'wait for clamping
While IsMoving()
Wend
DeActivateSignal(Output2) 'turning toolpost CCW (clamping)"OFF"
Call SetUserDRO (1200,NewTool)
SetCurrentTool( NewTool )'show new tool
Code "G00 X-" & ToolFreistX   & " Z-" & ToolFreistZ 'set new tool to old coordinates
If incremental = 1 Then
Code "G91"
While IsMoving()
Wend
Else
Code "G90"

While IsMoving()
Wend
End If

End Sub
.
.
.
.

Greets from Austria,

Helmut

   
In theory, there is no difference between theory and practice. In practice there is.

Offline tantan

*
  •  116 116
    • View Profile
Re: Macro VB Script for Lathe Toolchanger
« Reply #24 on: April 19, 2008, 10:52:34 AM »
hi,

thanks for all these replies, they have been a great help to get started. but i have 3 questions about the VBcode:

1. how can i become the "GetOEMDRO (1200)". I cannot find this on my screens in MACH3 turning. is it possible to become this dro on a screen.
2. the Code "G4 P1.0" does not work at all. the line is executed but it does not delay? is it a configuration fault somewhere in mach?
2. my macro only runs if i start i manually, i thought it would run continuously.

thanks

antoine
the Netherlands
Re: Macro VB Script for Lathe Toolchanger
« Reply #25 on: April 27, 2008, 12:21:13 PM »
Hi all,

My toolchanger is running now:

http://www.youtube.com/watch?v=VehHjJcrR2M


Greets,
Helmut

In theory, there is no difference between theory and practice. In practice there is.

Offline tantan

*
  •  116 116
    • View Profile
Re: Macro VB Script for Lathe Toolchanger
« Reply #26 on: April 30, 2008, 01:11:08 PM »
hi,

that realy looks good. i hope you can help me with one of my questions; see first post in "VB and development of wizards"

thanks

antoine

Offline tantan

*
  •  116 116
    • View Profile
Re: Macro VB Script for Lathe Toolchanger
« Reply #27 on: May 02, 2008, 02:01:49 PM »
hi anyone,

i think my problem is solved (with help of ron). using only "T5" on the MDI line starts the M6start macro. but the toolnumber is not interpreted correctly by the m6start macro. typing "M6 T0505" works well.

hope this will help others.

antoine
the netherlands