Hello Guest it is March 28, 2024, 07:52:26 AM

Author Topic: Macro Tutorial  (Read 13121 times)

0 Members and 1 Guest are viewing this topic.

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: Macro Tutorial
« Reply #10 on: July 02, 2019, 03:07:12 PM »
ok we are on the conditional programming road.
not so easy in Mach3 but with some tricks

example GCode:
Code: [Select]
#100=2

G1 X0 F500
M1234
M98 P#100 L1
M30

O1
G1X1 F500
M99
M30
%

O2
G1X2 F500
M99
M30
%

M98 subroutine call based on param #100 witch is set to 2 at the begining

M1234 will set it to 1 so O1 is excecuted.

within M1234 you can modify #100 however you want an call any programmed subroutine Oxx

M1234 code:
Code: [Select]
SetVar(100,2)

the macro call (M1234 or whatever) gives you all possibilties.
look for Inputs
do calculations
modify some other vars witch are used in the subroutine
And so on


anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.