4 macroprograms, 1 differences from subprograms – Yaskawa YASNAC PC NC Programming Manual User Manual

Page 251

Advertising
background image

4 - 114

YASNAC PCNC Programming Manual

Chapter 4: Enhanced Level Commands

4.4

MACROPROGRAMS

The NC has a set of instructions that can be used by the machine tool builders and the users to
implement the original functions. The program created by using these instructions is called a
microprogram, which can be called and executed by the commands specified in a block with G65
or G66.

A microprogram provides the following.

•

Variables can be used.

•

Arithmetic and logical operations using variables and constants are possible.

•

Control commands for branch and repeat can be used.

•

Commands to output messages and data can be used.

•

Arguments can be specified.

This makes it possible to create a program in which complicated operations and operations requir-
ing conditional judgment are included.

4.4.1

Differences from Subprograms

Differences between microprograms and subprograms are indicated below.

•

With microprogram call up commands (G65, G66), arguments can be specified. How-
ever, with subprogram call up command (M98), it is not possible to use arguments.

•

If commands other than P, Q, and L are specified in the M98 block, the program jumps
to the specified subprogram after executing these commands. With G65 and G66,
commands other than P and L are regarded as argument specification and the program
jumps to the specified microprogram immediately. In this case, however, the com-
mands specified preceding G65 and G66 are executed normally.

•

With a microprogram, local programs at the same level as the level of the micropro-
gram are used. However, with subprograms, levels of local variables are not changed.

In other words, local variables in a microprogram are different before and after the call
up of the microprogram and those in a subprogram remain the same before and after
the call up of the subprogram.

Advertising