Documente Academic
Documente Profesional
Documente Cultură
A bolt circle program is a good example of what Custom Macro can do. Looping,
Trigonometry, IF-GOTO, Local and Common
variables are all used in this example. The bolt circle macro makes it quick and easy
to program a circular pattern of holes. Any of
the "G" code drilling cycles can be used with the bolt circle command. The pattern
can be centered anywhere on the part and the
first hole can be at any angle. The information needed to use the command is listing in
the following table:
X
X axis center of the Bolt Circle.
Y
Y axis center of the Bolt Circle.
Z
Depth to drill or bore the hole.
R
Reference point above part.
D
Diameter of bolt circle.
C
"G" code to be used. Any standard Drilling or Boring Cycle can be use.
H
Number of holes in the pattern.
A
Starting angle of first hole from the X axis.
F
Feed rate to be used.
T
Dwell value if G82 cycle is used.
Q
Peck interval if G73 or G83 peck drilling cycle is used.
A value for T and Q are not required for a G81 drilling cycle. All other addresses are
necessary to drill the pattern. This macro
works with any control that has a macro B style language. The manual shows how to
write better error traps for newer controls.
Alarm Generation
If a required address is not given an alarm will occur when the command is executed.
See the bottom of the program for a list of the
alarms. This is one advantage of Custom Macro, you can put error traps in your
cycles!
IF[#7EQ#0]GOTO2001
IF[#11EQ#0]GOTO2002
IF[#9LT#0]GOTO2003
IF[#3EQ#0]GOTO2004
IF[#18EQ#0]GOTO2005
#100=1
#27=#7/2.0
G0X[[COS[#1]*#27]+#24]Y[[SIN[#1]*#27]+#25]
G#3Z#26R#18F#9Q#17P#20
#101=360/#11
N1WHILE[#100LTABS[#11]]DO1
X[[[COS[[#101*#100]+#1]*#27]+#24]]Y[[[SIN[[#101*#100]+#1]*#27]+#25
]]
#100=#100+1
END1
G0T02006
N2006M99