Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: juki77 on December 27, 2019, 05:31:40 PM
-
Hi, how are you ?, I have built a machine that has two heads, one fixed with a laser and the other with a z-axis and tangential (A-axis).
I would like to know if you can create a macro that when you read a tool change in the g-code, the macro calls the offset on the X and Y axes of that tool.
I tried but I don't understand any programming and I haven't found something like that on the web. I've seen videos of machines that do it but I can't do it.
Thanks a lot
best regards
-
witch toolchange macro depends on your Settings Config->General Config->Tool Change
if Stop spindle. Wait for cycle Start is selected M6Start.m1s will be excecute when M6 is called in GCode and M6End.M1s
will be started after pressing Cycles Start after Toolchange is fineshed.
if Auto Tool Changer is selected only M6Start.M1s will be exceuted.
in one of this macro you can do your own code, f.e.
'get new tool number
newtool = GetSelectedTool()
'select Offset by toolnumber
If newtool = 1 then
Code "G54"
Else
Code "G55"
End If
-
Hello TPS, the macro worked perfect !!!, once the tangential has done its job, when it detects the new tool automatically applies the g55 which is the offset of the laser pointer.
I ask you another question, you may know.
When you start cutting with the laser pointer, I have electrically deactivated the Z axis and the A with the M07 since the laser pointer is fixed and operated by the M03.The problem is that when the M07 command falls, both the Z and A move a little when reconnected by the relay, losing the original position
The path I generate with sheetcam and the post is mach3 tangential.
Do you know how in a trajectory to ignore the Z and A axis without editing the code g?
I thank you for your help,
Then I will record a small video and upload it.
best regards ?
-
Why do you have to deactivate the Z and A axis?
If they are not commanded in the g-code they will not move anyway
-
you can use:
DoOEMButton(252) 'disable Z-axis
DoOEMButton(253) 'disable A-axis
a second call off OEMButtons will enable them again
to check wether thay are enabled/disabled you can use OEMLed's
If GetOEMLed(88) Then
MSGBox "Z-Axis is disabled"
End If
If NOT GetOEMLed(88) Then
MSGBox "Z-Axis is enabled"
End If
If GetOEMLed(89) Then
MSGBox "A-Axis is disabled"
End If
If NOT GetOEMLed(89) Then
MSGBox "A-Axis is enabled"
End If