For another example, assume that you want to generate a pocket milling cycle from the geometric information on a line. Since lines are set up to generate a G01 or LINEAR move, a second motion block definition is needed.
The $PP file would need the following entries:
SEQNO#PB#LINEAR#RAPID#X#Y#Z#PA=$LINE1.1
SEQNO#POCKET#XI#YI#PDEPTH=$LINE2.1
G00;D#LINEAR;E#RAPID=RAPID
G01;D#RAPID;E#LINEAR=LINEAR
X#3.4=X
Y#3.4=XI
Y#3.4=YI
G72;G#2#1=POCKET
Z#3.4=PDEPTH
The 'G' switch on the G72 code causes the postprocessor to switch to group number 2 for NC code output. Additionally the code also causes the group number to change back to 1 when the code is output to the NC file. This provides the ability to output a pocket cycle from a line and then switch back to the normal G00, G01 interpretation of a .DXF line. If you want to output a pocket cycle for each line, define the switch as "G#2#2", which causes the postprocessor to use group 2 definitions until switched back. You can build a code to switch back to group 1 by adding the entry:
;G#1#1=GROUP1
to the $PP file. Whenever the text statement "GROUP1" is processed, no output will be generated, but the 'G' switch will still be implemented changing the group number to 1.
Example:
DXF file contains |
NC code produced |
Comments |
Text: "LINEAR" |
None |
"RAPID" disabled |
Line: 0,0 to 1,1 |
N001G01X1.Y1. |
Output NC code |
Line: 1,1 to 2,2 |
N002G01X2.Y2. |
Output NC code |
Text: "PDEPTH/0.05" |
None |
0.05 saved |
Text: "POCKET" |
None |
"G72" saved, group switched to 2 |
Line: 2,2 to 3,3 |
N003G72X1.Y1.Z0.05 |
Output NC code |
Line: 3,3 to 4,4 |
N004G01X4.Y4. |
Output NC code |
Note that even though G01 line output is in absolute mode, the group 2 definition for a line uses the incremental geometric entries "XI" and "YI" in order to form the correct values for the X,Y pocket milling cycle.