Share
 
 

Creating program formats

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.

  1. Open 001.fm in FeatureCAM from the Examples\Tutorials\XBUILD folder.
  2. In XBUILD open the text.CNC file.
  3. Select Formats > Move > Linear from the menu.
  4. 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>
  5. Delete all of the text in the format.
  6. Now let's create the collection of reserved words and then add the literals.
  7. Select File > WordList from the Menu bar. The list of reserved words is displayed.
  8. Select the Modal Delimiters option so that all of the reserved words are surrounded by brackets { }.
  9. Find <SEQ> in the Reserved List dialog, and click on it. The string {<SEQ>} is inserted into the format.
  10. 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>}
  11. Type N before the <SEQ> reserved word:
    {N<SEQ>}
  12. 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>}
  13. Select File > Quit from the menu, and click Yes to save the format. The Formats editor closes.
  14. Select File > Exit from the menu, and click Yes to save the file.
  15. In FeatureCAM, generate toolpaths for slot1.

    The following lines of real G-code have replaced the Linear_Move strings:

    N25G1Z-5.0F105.
    N35X52.5F209.
  16. 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>
  17. 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
    %%

Was this information helpful?