0
5.9kviews
What is Macro statement in APT. Explain with suitable example?

Mumbai University > mechanical engineering > Sem 7 > CAD/CAM/CAE

Marks: 6 Marks

Year: May 2016

1 Answer
0
129views
  1. The language that provides the macro capability consists of the MACRO and TERMAC statements, which define the bounds of the macro definition, and the CALL statement, which defines the location in the part program where the macro is to be executed.
  2. The macro definition start (MACRO) statement is used to indicate the beginning of a definition of a macro. The general format of this statement is:
  3. SMAC = MACRO/ list
  4. A Macro variables can be used to represent other unsubscripted APT symbols, vocabulary words (except for the fixed-field Words and the word CALL), or numbers.
  5. They cannot be used to represent statement labels, subscripted symbols, or arithmetic expressions.
  6. A macro variable must satisfy the rules that apply to a variable symbol, with the exception that it can appear elsewhere in the same part program; that is, the same symbolic name can be used as a macro variable in more than one macro in the same part program; also, the same symbol can be used as a statement label or variable symbol external to macros that use it as a macro variable.
  7. A macro variable cannot be subscripted; to be used within the macro, each macro variable must be listed to the right of the slash in the MACRO statement.

    EXAMPLE.-

    PARTNO / APT-1

    CLPRNT

    UNITS / MM

    NOPOST

    CUTTER / 20.0

    \$ \$ GEOMETRY DEFINITION

    SETPT = POINT / 0.0, 0.0, 0.0

    STRTPT = POINT / 70,70,0

    P1 = POINT / 50, 50, 0

    P2 = POINT / 20, -20, 0

    C1 = CIRCLE / CENTER, P2, RADIUS, 30

    P3 = POINT / -50, -50, 0

    P5 = POINT / -30, 30, 0

    C2 = CIRCLE / CENTER, P5, RADIUS, 20

    P4 = POINT / 50, -20, 0

    L1 = LINE / P1, P4

    L2 = LINE / P3, PERPTO, L1

    L3 = LINE / P3, PARLEL, L1

    L4 = LINE / P1, PERPTO, L1

    PLAN1 = PLANE / P1, P2, P3

    PLAN2 = PLANE / PARLEL, PLAN1, ZSMALL, 16

    \$ \$ MOTION COMMANDS

    SPINDL / 3000, CW

    FEDRAT / 100, 0

    FROM / STRTPT

    GO/TO, L1, TO, PLAN2, TO, L4

    TLLFT, GOFWD / L1, TANTO, C1

    GOFWD / C1, TANTO, L2

    GOFWD / L2, PAST, L3

    GORGT / L3, TANTO, C2

    GOFWD / C2, TANTO, L4

    GOFWD / L4, PAST, L1

    GOTO / STRTPT

    FINI

Please log in to add an answer.