151
G-Code, CAD, and CAM discussions / Re: Drilling Machine Macro
« on: March 13, 2023, 01:37:55 PM »
so your G-code is looking like this:
G1 A10
M07
M09
G1 A20
.
.
M07 and M09 activate your Outputs for drill down/up
replace M07 and M09 for example by M400
so your G-Code will look like this
G1 A10
M400
G1 A20
.
.
now create a Macro M400.M1S in your profile folder C:\Mach3\macros\your profile name
you have to replace Output1 and Input1/2 with the oenes you have declared in Port's&Pin's
G1 A10
M07
M09
G1 A20
.
.
M07 and M09 activate your Outputs for drill down/up
replace M07 and M09 for example by M400
so your G-Code will look like this
G1 A10
M400
G1 A20
.
.
now create a Macro M400.M1S in your profile folder C:\Mach3\macros\your profile name
Code: [Select]
'here activate the output for drill down
ActivateSignal(OUTPUT1)
'here we wait for an Input1 to go to high signal
While Not IsActive(Input1) 'drill down
Sleep(10)
Wend
'here deactivate the output for drill down
DeactivateSignal(OUTPUT1)
'here we wait for an Input2 to go to high signal
While Not IsActive(Input2) 'drill up
Sleep(10)
Wend
you have to replace Output1 and Input1/2 with the oenes you have declared in Port's&Pin's