While you will normally base a new post on an existing post, in this tutorial, you create program formats from scratch. The formats you create are applicable to a Fanuc0 control.
- Open 001.fm in FeatureCAM from the Examples\Tutorials\XBUILD folder.
- In XBUILD open the text.CNC file.
- Select Formats > Move > Linear from the menu.
- The
Formats
editor opens, and the contents of the
Linear
program format are displayed.
At this point the format contains only the literal Linear_Move. This means that every time this program format is called, the string Linear_Move is output to the NC file.
Our goal is to create the following line:
{N<SEQ>}{<MOTION>}{X<X-COORD>} {Y<Y-COORD>}{Z<Z-COORD>}{F<FEED>}<EOB>
- Delete all of the text in the format.
- Now let's create the collection of reserved words and then add the literals.
- Select File > WordList from the Menu bar. The list of reserved words is displayed.
- Select the Modal Delimiters option so that all of the reserved words are surrounded by brackets { }.
- Find <SEQ> in the Reserved List dialog, and click on it. The string {<SEQ>} is inserted into the format.
- Insert the
<MOTION>,
<X-COORD>,
<Y-COORD>,
<Z-COORD>,
<FEED>, and
<EOB> reserved words to get the string shown below:
{<SEQ>}{<MOTION>}{<X-COORD>}{<Y-COORD>} {<Z-COORD>}{<FEED>}{<EOB>}
- Type
N before the
<SEQ> reserved word:
{N<SEQ>}
- Enter the
X,
Y,
Z, and
F literals to result in the following strings:
{<MOTION>}{X<X-COORD>}{Y<Y-COORD>} {Z<Z-COORD>}{F<FEED>}{<EOB>}
- Select File > Quit from the menu, and click Yes to save the format. The Formats editor closes.
- Select File > Exit from the menu, and click Yes to save the file.
- In
FeatureCAM, generate toolpaths for
slot1.
The following lines of real G-code have replaced the Linear_Move strings:
N25G1Z-5.0F105. N35X52.5F209.
- Use the
Formats editor to modify the following program formats:
Program Start
%<EOB> :<PROG-NAME><EOB> {N<SEQ>}G17G21G40G49G80G90G94<EOB> {N<SEQ>}T<TOOL>M6<EOB> {N<SEQ>}<MOTION>G90G<FIXTURE> X<X-COORD>Y<Y-COORD>S<SPEED> <SPINDLE><EOB> {N<SEQ>}G43Z<Z-COORD>H<TOOL> <COOLANT><EOB>
Rapid
{N<SEQ>}{<MOTION>}{X<X-COORD>} {Y<Y-COORD>}<EOB>
Z Rapid
{N<SEQ>}{<MOTION>}{Z<Z-COORD>}<EOB>
Program End
{N<SEQ>}G28G91Y0Z0M9<EOB> {N<SEQ>}M30<EOB>
File End
%<EOB>
- Save your changes to the post, and regenerate the NC code to create the following program:
% :001 N25G17G21G40G49G80G90G94 N35T1M6 N45G0G90G54X32.5Y0.S5200M3 N55G43Z15.862H1M8 N65Z2.54 N75G1Z-5.0F105. N85X52.5F209. N95G0Z15.862 N105G28G91Y0Z0M9 N115M30 %%