1
VB and the development of wizards / Tool change Z pos. remember
« on: May 14, 2009, 07:21:19 AM »
I will make a macro for tool change. I have seach the forum, but can't find something I can use.
I have a contact plate in a fixed position.
Its connected to input #13
The program:
I start the macro.
Machine move to the top pos. (G53 Z140 F3000)
Machine move to the xy pos for contact plate (maybe G53 X5 Y440 F7000)
Machine move down to higest tool pos. rapid (G53 Z50 F3000)
Machine move slowly until tool touch the contact plate.
Store the Z value in variable
Machine move to top pos. (G53 Z140 F3000)
Now I change the tool. Then i am finish I start the macro
Machine move to the top pos. (G53 Z140 F3000) ' for the most the current pos.
Machine move to the xy pos for contact plate (maybe G53 X5 Y440 F7000) ' for the most the current pos.
Machine move down to higest tool pos. rapid (G53 Z50 F3000)
Machine move slowly until tool touch the contact plate.
Set the Z value = variable
Machine move to top pos. (G53 Z140 F3000)
and now the tooltip from the new tool should be the same position as the old tooltip.
Now to the code. I am not strong in commands so here i have som holes i wish you could help me with.
Code "G53 Z140 F3000"
While IsMoving()
Wend
Code "G53 X5 Y440 F7000"
While IsMoving()
Wend
Code "G53 Z50 F3000"
While IsMoving()
Wend
Code "G53 Z0 F100"
**move until input#13 is high** (here i don't know what to do)
** if timeout the stop ** (some securety for reach the contact)
StoreValue=GetOEMDRO(2) ' z position
SetUserDRO (1000,StoreValuel) *remember the value
Code "G53 Z140 F3000"
While IsMoving()
Wend
(after the new tools is in place)
Code "G53 Z140 F3000"
While IsMoving()
Wend
Code "G53 X5 Y440 F7000"
While IsMoving()
Wend
Code "G53 Z50 F3000"
While IsMoving()
Wend
Code "G53 Z0 F100"
**move until input#13 is high** (here i don't know what to do)
** if timeout the stop ** (some securety for reach the contact)
Restorevalue=GetUserDRO(1000)
SetOEMDRO(2,Restore value) ' new z position
Code "G53 Z140 F3000"
While IsMoving()
Wend
Someone who can help me with the missing code?
Maybe I set input#13 up to probe og userinput or something. Not desided yet.
I have a contact plate in a fixed position.
Its connected to input #13
The program:
I start the macro.
Machine move to the top pos. (G53 Z140 F3000)
Machine move to the xy pos for contact plate (maybe G53 X5 Y440 F7000)
Machine move down to higest tool pos. rapid (G53 Z50 F3000)
Machine move slowly until tool touch the contact plate.
Store the Z value in variable
Machine move to top pos. (G53 Z140 F3000)
Now I change the tool. Then i am finish I start the macro
Machine move to the top pos. (G53 Z140 F3000) ' for the most the current pos.
Machine move to the xy pos for contact plate (maybe G53 X5 Y440 F7000) ' for the most the current pos.
Machine move down to higest tool pos. rapid (G53 Z50 F3000)
Machine move slowly until tool touch the contact plate.
Set the Z value = variable
Machine move to top pos. (G53 Z140 F3000)
and now the tooltip from the new tool should be the same position as the old tooltip.
Now to the code. I am not strong in commands so here i have som holes i wish you could help me with.
Code "G53 Z140 F3000"
While IsMoving()
Wend
Code "G53 X5 Y440 F7000"
While IsMoving()
Wend
Code "G53 Z50 F3000"
While IsMoving()
Wend
Code "G53 Z0 F100"
**move until input#13 is high** (here i don't know what to do)
** if timeout the stop ** (some securety for reach the contact)
StoreValue=GetOEMDRO(2) ' z position
SetUserDRO (1000,StoreValuel) *remember the value
Code "G53 Z140 F3000"
While IsMoving()
Wend
(after the new tools is in place)
Code "G53 Z140 F3000"
While IsMoving()
Wend
Code "G53 X5 Y440 F7000"
While IsMoving()
Wend
Code "G53 Z50 F3000"
While IsMoving()
Wend
Code "G53 Z0 F100"
**move until input#13 is high** (here i don't know what to do)
** if timeout the stop ** (some securety for reach the contact)
Restorevalue=GetUserDRO(1000)
SetOEMDRO(2,Restore value) ' new z position
Code "G53 Z140 F3000"
While IsMoving()
Wend
Someone who can help me with the missing code?
Maybe I set input#13 up to probe og userinput or something. Not desided yet.