Home
Downloads
Mach3
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
Resources
Contact Us
Links
CNCZone
German Forum
Italian Forum
Korean Forum
Portugese (Brazil) Forum
Russian Forum (RSK CNCROUTER)
Thai Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 28, 2012, 02:13:49 AM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Select from and to languages
Chinese-simp to English
Chinese-trad to English
English to Chinese-simp
English to Chinese-trad
English to Dutch
English to French
English to German
English to Greek
English to Italian
English to Japanese
English to Korean
English to Portuguese
English to Russian
English to Spanish
Dutch to English
Dutch to French
French to English
French to German
French to Greek
French to Italian
French to Portuguese
French to Dutch
French to Spanish
German to English
German to French
Greek to English
Greek to French
Italian to English
Italian to French
Japanese to English
Korean to English
Portuguese to English
Portuguese to French
Russian to English
Spanish to English
Spanish to French
Machsupport Forum
Mach Discussion
VB and the development of wizards
Macro for the Automatic tool changer in script M6Start.m1s
Pages:
1
Go Down
« previous
next »
Author
Topic: Macro for the Automatic tool changer in script M6Start.m1s (Read 549 times)
0 Members and 2 Guests are viewing this topic.
Marco A
Active Member
Offline
Posts: 4
Macro for the Automatic tool changer in script M6Start.m1s
«
on:
August 30, 2011, 01:42:14 PM »
Here is a macro for automatic tool changer.
'********************************************************
'*
'* Macro for the Automatic tool changer in script M6Start.m1s
'*
'* Description:
'*
'* We have defined fixed positions for each tool.
'* When you input M6 code and a new tool,
'* First, the Z axis goes to "machine zero",
'* then goes to the position of the last tool used
'* and leaves the tool. After that, the Z axis goes
'* to the new tool position and takes the new tool.
'* Finaly, returns to "Machine zero".
'* Before the program begins, the macro checks if the
'* tool number is valid.
'*
'* Process:
'*
'* 1. Z-axis goes to "Machine zero"
'* 2. Then, Z-axis goes to the safe position defined by the user.
'* 3. The Z axis goes down to the height to the tools.
'* 4. Z axis moves to the position of the last tool, moving the
'* X-axis before the Y-axis.
'* 5. The spindle releases the actual tool and the z-axis moves to
'* the position of the new tool.
'* 6. The Z-axis takes the new tool and returns at the safe position
'* 7. Z-axis goes to "Machine Zero".
'*
'*
'* Marco A. Perez C.
'* Sadosa S.A. de C.V.
'*
'* ***********************************************************************
Sub Main() 'Define variables
OldTool = GetOEMDRO (1200)
x = GetToolChangeStart( 0 )
y = GetToolChangeStart( 1 )
z = GetToolChangeStart( 2 )
a = GetToolChangeStart( 3 )
b = GetToolChangeStart( 4 )
c = GetToolChangeStart( 5 )
tool = GetSelectedTool()
NewTool = tool
MaxToolNum = 5 'Maximum number of tools to use.
ToolDown = -50 'Height for the tool change.
ToolUp = 0.0 'Height the Z-axis for the tool change.
PosSec = 50.0 'Safe Position.
If NewTool = OldTool Then
Exit Sub
End If
While NewTool > MaxToolNum
NewTool = Question ("Place valid tool number (between 1 y 5)")
Wend
Code "G00 G53 Z" & ToolUp 'The z-axis is going to "machine zero"
While IsMoving()
Wend
Code "G53 y" & PosSec 'Going to safe position.
While IsMoving()
Wend
Code "G53 Z" & ToolDown 'Down to the height of tools
While IsMoving()
Wend
Call MovePos(OldTool) 'Going to the last position to relase the old tool.
While IsMoving()
Wend
ActivateSignal(Output1) 'Relase the tool.
Code "G4 P1.0"
Code "G53 Z" & ToolUp
While IsMoving()
Wend
Call MovePos(NewTool) 'Go to the new tool position.
While IsMoving()
Wend
Code "G53 Z" & ToolDown 'down the z-axis to hold the tool.
While IsMoving()
Wend
DeActivateSignal(Output1) 'hold the new tool.
Code "G4 P1.0"
Code "G53 y" & PosSec 'Returns to the safe position.
While IsMoving()
Wend
Code "G53 Z" & ToolUp 'Returns z-axis to "machine zero".
Call SetUserDRO (1200,NewTool)
SetCurrentTool( NewTool )
End Sub
Sub MovePos(ByVal ToolNumber As Integer)
Select Case ToolNumber 'Here set the position of each tool.
Case Is = 1
Code "G00 G53 x12.0"
Code "G00 G53 y5.0"
Case Is = 2
Code "G00 G53 x24.0"
Code "G00 G53 y5.0"
Case Is = 3
Code "G00 G53 x36.0"
Code "G00 G53 y5.0"
Case Is = 4
Code "G00 G53 x48.0"
Code "G00 G53 y5.0"
Case Is = 5
Code "G00 G53 x60.0"
Code "G00 G53 y5.0"
End Select
End Sub
Main
Logged
Marco A
Active Member
Offline
Posts: 4
Re: Macro for the Automatic tool changer in script M6Start.m1s
«
Reply #1 on:
August 30, 2011, 05:08:48 PM »
Aquí esta la descripción del mismo macro pasado pero en español....
'********************************************************
'*
'* Macro para intercambiador de herramientas automático del script M6Start.m1s
'*
'* Descripción:
'*
'* Se cuenta con posiciones fijas de diferentes herramientas,
'* Primeramente se va a una posición segura el EjeZ y se posiciona en la última
'* herramienta que utilizó y la deja. Después se mueve a la posición de la nueva
'* herramienta y la toma, regresando al final a la misma posición segura.
'*
'* Procedimiento:
'*
'* 1. Se manda al Eje Z a cero máquina.
'* 2. Se mueve el Eje Z a una posición segura para bajar
'* 3. El eje Z es posicionado a la altura de las herramientas.
'* 4. Se mueve a la posición de la herramienta pasada, primero en 'X' y despues en 'Y'.
'* 5. Se suelta la herramienta y sube el eje Z a una posición dada.
'* 6. Se mueve a la posición de la herramienta nueva.
'* 7. Se baja a la altura de las herramientas y toma la herramienta.
'* 8. Regresa a la posición segura y sube a cero máquina.
'*
'*
'*
'* Sadosa S.A. de C.V.
'*
'* ********************************************************************************
Sub Main() 'Definir variables
OldTool = GetOEMDRO (1200) 'Tomar el valor de la herramienta actual.
x = GetToolChangeStart( 0 )
y = GetToolChangeStart( 1 )
z = GetToolChangeStart( 2 )
a = GetToolChangeStart( 3 )
b = GetToolChangeStart( 4 )
c = GetToolChangeStart( 5 )
tool = GetSelectedTool()
NewTool = tool
MaxToolNum = 5 'Número máximo de herramientas que se puede utilizar.
ToolDown = -50 'Posición de Z a la altura del carrusel de herramientas.
ToolUp = 0.0 'Posición de Z arriba del carrusel.
If NewTool = OldTool Then
Exit Sub
End If
While NewTool > MaxToolNum
NewTool = Question ("Ingresa nùmero de herramienta vàlido (Entre 1 y 5)")
Wend
Code "G00 G53 Z" & ToolUp 'Subir a cero máquina el eje Z.
While IsMoving()
Wend
Code "G53 y10" 'Posición segura.
While IsMoving()
Wend
Code "G53 Z" & ToolDown 'Bajar a la altura de el cambia herramientas.
While IsMoving()
Wend
Call MovePos(OldTool) 'Mover a la posición de la herramienta anterior primero 'X' y despues en 'Y'.
While IsMoving()
Wend
ActivateSignal(Output1) 'Mandar señal para soltar herramienta y esperar a que la suelte.
Code "G4 P1.0"
Code "G53 Z" & ToolUp 'Subir el eje Z para alejarse de la herramienta. (o a una posición donde no pegue con las herramientas)
While IsMoving()
Wend
Call MovePos(NewTool) 'Moverse a la posición donde está la nueva herramienta.
While IsMoving()
Wend
Code "G53 Z" & ToolDown 'Bajar el Eje Z para tomar la Herramienta.
While IsMoving()
Wend
DeActivateSignal(Output1) 'Mandar señal para sostener la herramienta.
Code "G4 P1.0"
Code "G53 y10" 'Regresar a Posición segura.
While IsMoving()
Wend
Code "G53 Z" & ToolUp 'Subir el Eje Z y posicionar en donde estába anteriormente.
Call SetUserDRO (1200,NewTool)
SetCurrentTool( NewTool )
End Sub
Sub MovePos(ByVal ToolNumber As Integer)
Select Case ToolNumber 'Subrutina donde estan las posiciones de cada herramienta.
Case Is = 1
Code "G00 G53 x12.0"
Code "G00 G53 y5.0"
Case Is = 2
Code "G00 G53 x24.0"
Code "G00 G53 y5.0"
Case Is = 3
Code "G00 G53 x36.0"
Code "G00 G53 y5.0"
Case Is = 4
Code "G00 G53 x48.0"
Code "G00 G53 y5.0"
Case Is = 5
Code "G00 G53 x60.0"
Code "G00 G53 y5.0"
End Select
End Sub
Main
Logged
Pages:
1
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Mach Discussion
-----------------------------
=> General Mach Discussion
=> Mach3 under Vista
=> Quantum
=> Mach SDK plugin questions and answers.
===> Finished Plugins for Download
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*i*n*g
=> Mach Screens
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Machscreen Screen Designer
===> CVI MachStdMill (MSM)
=> Feature Requests
=> Non English Forums
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
=> FAQs
-----------------------------
*****VIDEOS*****
-----------------------------
=> *****VIDEOS*****
-----------------------------
General CNC Chat
-----------------------------
=> Share Your GCode
=> Show"N"Tell ( What you have made with your CNC machine.)
=> Building or Buying a Wood routing table.. Beginnners guide..
=> Show"N"Tell ( Your Machines)
-----------------------------
G-Code, CAD, and CAM
-----------------------------
=> G-Code, CAD, and CAM discussions
=> LazyCam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> GearoticMotion Preliminary testing
=> Tempest Trajectory Planner
=> Contec
=> dspMC/IP Motion Controller
=> HiCON Motion Controller
=> Third party software and hardware support forums.
=> Galil
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Mesa
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Sieg Machines
=> Promote and discuss your product
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Downloads
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
=> One on one phone support.
=> Forum suggestions and report forum problems.
-----------------------------
Mach4
-----------------------------
=> Mach4 pre-Alpha Testing
Loading...