Hello,
This custom macro was set up by the factory on a couple of our swiss machines to help control chips. It works awesome so feel free to use it if you have some unruly chips.

As the program exists you can only turn in Z. This works fine most of the time but I would like to be able to program in some taper in X. Could you guys tell me if this would be possible?

All it does is turn/dwell/turn/dwell ect.

Z=end
Q=turn distance before dwell
D=Dwell in seconds
F=Feed

Here is the existing program:

O0061(G1 MACRO: SET PARAMETER 6050 TO 61)
(CHANGE TO O9010 WHEN INSTALLED)
IF[#7LE0]GOTO5
IF[#9LE0]GOTO6
IF[#17LE0]GOTO7
IF[#26LE0]GOTO8
#501=#5042
IF[#501GT#26]GOTO10

WHILE[#501LT#26]DO1
N1G01Z#501F#9
G04X#7
#501=#501+#17
END1
G01Z#26F#9
M99

(CUTTING Z+ TO Z-)
N10
#501=#5042
WHILE[#501GT#26]DO1
N1G01Z#501F#9
M99

N5#3000=1(D MISSING)
N6#3000=2(F MISSING)
N7#3000=3(Q MISSING)
N8#3000=4(Z MISSING)

__________________________________________________ _____________

So, here's my (uneducated) thinking on how to improve this

#501=#5042---------------------- (#501=current Z position)
#502=[[#26-#5042]/#17] ---- [turn length/peck distance] (formula to get # of "pecks")
#10=#503------------------------- (didnt look up what # U actually is so its 10 for this example)
#503=[#503/#502 ] -------------(per peck U move)

WHILE[#501LT#26]DO1
N1
G1 Z#501 U#503 F#9
G4 X#7
#501=#501+#17
END1
G1 Z#26 U#503 F#9
M99

Could this work? thoughts? thanks!
__________________