Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 11:18:29 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  Macro VB Script for Lathe Toolchanger
Pages: « 1 2 3   Go Down
Print
Author Topic: Macro VB Script for Lathe Toolchanger  (Read 8034 times)
0 Members and 2 Guests are viewing this topic.
mechaniac
Active Member

Offline Offline

Posts: 13


View Profile
« 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
Logged

In theory, there is no difference between theory and practice. In practice there is.
CNCwt
Active Member

Offline Offline

Posts: 66


View Profile
« 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         
Logged
Graham Waterworth
Administrator
*
Online Online

Posts: 1,665


West Yorkshire, England



View Profile WWW
« 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.
Logged

G-Code is on the cutting edge

Autovalues Engineering, CNC machining specialists, Bradford, England
mechaniac
Active Member

Offline Offline

Posts: 13


View Profile
« 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

   
Logged

In theory, there is no difference between theory and practice. In practice there is.
tantan
Active Member

Offline Offline

Posts: 68


View Profile
« Reply #24 on: April 19, 2008, 09: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
Logged
mechaniac
Active Member

Offline Offline

Posts: 13


View Profile
« Reply #25 on: April 27, 2008, 11:21:13 AM »

Hi all,

My toolchanger is running now:

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


Greets,
Helmut

Logged

In theory, there is no difference between theory and practice. In practice there is.
tantan
Active Member

Offline Offline

Posts: 68


View Profile
« Reply #26 on: April 30, 2008, 12: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
Logged
tantan
Active Member

Offline Offline

Posts: 68


View Profile
« Reply #27 on: May 02, 2008, 01: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
Logged
Pages: « 1 2 3   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!