mmMacro Out

Image image063.GIF

This function will read the NC file that is in the editor and translate any macro functions and sub-programs and variable values to standard NC code and save to a separate file. This function outputs only the basic rapid or feed moves in the program.

With this function you could write an NC program with canned cycles and repeated sub-programs and macro variables and later translate that information into NC code coordinates that you could use for machines that do not support those abilities.

Dialog box will ask for filename to save the output to.

If Incremental is checked, the coordinates output to the file will be in incremental distances, otherwise Absolute coordinates will be output.

If there is selected text, only the selected text is read. If no text is selected the reading begins at the cursor location.

Example: The following program cuts an angle on the lathe jaws. Change the parameter variables to output a different program each time.

%

(ANGLE JAW PROGRAM)

(***PARAMETERS******)

#16=776555(PART NUMBER)

(1=OD, 2=ID)

#1=1

#2=19.130(X DIAMETER GAGE POINT)

(Z0 IS FRONT FACE OF JAWS)

#3=.25(Z GAGE POINT, DISTANCE FROM LOCATING FACE)

#4=.5(DEPTH OF JAWS)

#5=3.(ANGLE)

#8=.015(TOOL RADIUS)

 

(******CALCULATIONS*********)

#2=#2/2

#3=#4-#3

#6=[ABS[#3]+.1](ADJACENT)

#7=#6/COS[#5](HYP)

#9=#8/COS[#5](TOOL HYP)

#10=[SIN[#5]*#9]  (TOOL X SHIFT)

#13=SIN[#5]*#7  (X AMOUNT FOR ANGLE)

 

(******** OUTPUT PROGRAM HEADER****)

(TMO %)

(TMO N5G13)

(TMC PART NUMBER [#16])

(TMC [#5] DEG ANGLE OD JAW)

(TMC ---)

(TMC FRONT FACE OF JAWS IS Z0)

(TMC TL A: .015 RADIUS INSERT )

(TMO N10G0X40.Z15.)

(TMO N15T101)

(TMO N20G50S850)

(TMO N25G97S850M4)

(*****END OF PROGRAM HEADER******)

 

IF[#1EQ2]GOTO2

(TL A2)

#15=[#2+[#13+#10]]*2 (NEW X)

GOTO 3

N2

(TL AA2)

#15=[#2-[#13+#10]]*2 (NEW X)

N3

G00X[#15]Z.1(FIRST MOVE)

 

#6=#4-ABS[#3]

#7=#6/COS[#5](HYP)

#13=SIN[#5]*#7( X AMOUNT FOR ANGLE)

IF[#1EQ2]GOTO5

#15=[#2-[#13-#10]]*2 (NEW X)

GOTO 7

N5

#15=[#2+[#13-#10]]*2 (NEW X)

N7

G01X[#15]Z-[#4]F.01 (SECOND MOVE)

 

IF[#1EQ2]GOTO9

G01X#15+1. (THIRD MOVE)

GOTO10

N9

G01X#15-1. (THIRD MOVE)

N10

G0Z.1

G0X40.0Z40.

(*****OUPUT ENDING***

(TMO N55T100)

(TMO N60M0)

(TMO N65M30)

(TMO %)

M30

%

 

Notice comment code TMC is used for outputting a comment line in the file, and TMO is used to output other lines of NC code that would not otherwise be output. Variables found in either of these are changed to actual values.

When the Macro Out function is used, this output will be written to a file:

%

N5G13

(PART NUMBER 776555.000)

(3.0000 DEG ANGLE OD JAW)

(---)

(FRONT FACE OF JAWS IS Z0)

(TL A: .015 RADIUS INSERT )

N10G0X40.Z15.

N15T101

N20G50S850

N25G97S850M4

G00X19.1682Z.1

G01X19.1054Z-.5F.01

G01X20.1054Z-.5F.01

G00X20.1054Z.1

G00X40.0Z40.0

N55T100

N60M0

N65M30

%

 

See Also - Config-Plotting ________________________________________________________________