Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: pedropin on July 09, 2019, 11:38:06 PM
-
good day to all
I have 2 spinlles in my cnc separated 100mm on the X axis.
I need to write a macro to use 2 tools / tool 1 and tool 2 /
if the gcode calls the tool 1 activate the output # 1
if the gcode calls the tool 2 deactivate the output # 1 and activate the output # 2, now correct the offset of 100mm on the X axis
I do not know how to write this macro for mach3
I appreciate a help
thank you
-
in this case i would work with two workoffset. for example:
G54 = spindle 1
G55 = spindle 2
and modify the GCode to activate the G54/G55 whenever the entire spindle is used.
to Switch on the wright spindle M3 should be modified. example:
If GetOEMDro(46) = 1 Then 'G54 is selected
DeactivateSignal(OUTPUT2) 'Turn off Spindle 2
ActivateSignal(OUTPUT1) 'Turn on Spindle 1
End If
If GetOEMDro(46) = 2 Then 'G55 is selected
DeactivateSignal(OUTPUT1) 'Turn off Spindle 1
ActivateSignal(OUTPUT2) 'Turn on Spindle 2
End If
code for M5 would be:
DeactivateSignal(OUTPUT2) 'Turn off Spindle 2
DeactivateSignal(OUTPUT1) 'Turn off Spindle 1
-
good day
I really appreciate your help.
Is it possible to insert this macro into the postprocessor? to do it automatically.
the output file is; Mach3 ATC mm (* .txt). from Vectri Aspire.
Attached example of the file (* .txt)
again thank you very much
-
I think it's a bit more complicated than that.
You really want to do this in the M6 tool change macro.
You'll need to assign specific tool numbers to each spindle, and check the tool number, then turn on the appropriate spindle.
I'd use G52 to do the offset, rather than change offsets.
-
i think if the Toollenght of the specific tool witch is used in each spindle gets touched in this spindle, it should
be no Problem, because it Looks like the machine has only one z-axis.
the example code i posted will be in M3 and M5 macro (Spindle on/off) and has nothing to do with postprocessor.