Hello Guest it is November 08, 2024, 10:04:54 PM

Author Topic: macro help  (Read 1619 times)

0 Members and 1 Guest are viewing this topic.

macro help
« 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
« Last Edit: July 09, 2019, 11:40:24 PM by pedropin »

Offline TPS

*
  •  2,528 2,528
Re: macro help
« Reply #1 on: July 10, 2019, 02:41:26 AM »
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:

Code: [Select]
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:

Code: [Select]
DeactivateSignal(OUTPUT2) 'Turn off Spindle 2
DeactivateSignal(OUTPUT1) 'Turn off Spindle 1

anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: macro help
« Reply #2 on: July 10, 2019, 07:29:18 PM »

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

Offline ger21

*
  • *
  •  6,295 6,295
    • The CNC Woodworker
Re: macro help
« Reply #3 on: July 10, 2019, 08:54:46 PM »
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.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline TPS

*
  •  2,528 2,528
Re: macro help
« Reply #4 on: July 11, 2019, 03:10:35 AM »
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.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.