Good morning
I found this macro for threading online, it works well but I would like to ask if it is possible to modify it, for my cnc I have to do more passes for example for M6 on the radius set first pass 0.20, second 0.50, third 0.80, last 1.2 and each time I have to create a gcode. Is it possible to modify the macro making it do it automatically? Since I am not capable of it I ask if someone can help me
I attach macro
Title$ = "Filettatura interna"
Prompt$ = "Inserisci RAGGIO ( R ) in mm"
Prompt3$ = "Inserisci valore di profondità ( -Z ) in mm"
Prompt4$ = "Inserisci passo di profondità in mm"
Prompt5$ = "Inserisci avanzamento F"
Default_x$ = "10"
Default_z$ = "2"
Default_st$ = "0.5"
Default_f$ = "1000"
X% = 100
Y% = 100
x = Abs(InputBox$(Prompt$, Title$, Default_x$, X%, Y%))
z = Abs(InputBox$(Prompt3$, Title$, Default_z$, X%, Y%))
st = Abs(InputBox$(Prompt4$, Title$, Default_st$, X%, Y%))
f = InputBox$(Prompt5$, Title$, Default_f$, X%, Y%)
OpenTeachFile "priam.tap"
code "G90"
code "G49"
code "M3 S18000"
code "G1 Z0" & " F800"
code "G0 X0 Y0"
code "G1 X"&x/2
code "F" &f
For i=st To z Step st
code "G2 X"&x/2 & " Y0" & " I-"&x/2 & " J0" & " Z-"&i
Next
code "G1 X0 Y0" & " F800"
code "G1 Z0"
code "M30"
CloseTeachFile
Call LoadTeachFile
example gcode
G90
G49
M3 S12000
G1 Z0 F300
G0 X0 Y0
G1 X0.1
F100
G2 X0.1 Y0 I-0.1 J0 Z-1
G2 X0.1 Y0 I-0.1 J0 Z-2
G2 X0.1 Y0 I-0.1 J0 Z-3
G2 X0.1 Y0 I-0.1 J0 Z-4
G2 X0.1 Y0 I-0.1 J0 Z-5
G2 X0.1 Y0 I-0.1 J0 Z-6
G2 X0.1 Y0 I-0.1 J0 Z-7
G2 X0.1 Y0 I-0.1 J0 Z-8
G2 X0.1 Y0 I-0.1 J0 Z-9
G2 X0.1 Y0 I-0.1 J0 Z-10
G1 X0 Y0 F100
G1 Z0
M30