Yaskawa J50M Instructions User Manual

Page 102

Advertising
background image

2.11 USER MACRO

G66, G67)

2.11.1 OVERVIEW

Special programs written by the machine builder or user
by the use of a group of commands are registered in the
part program memory, These programs can be called by
the use of G65 or G66 command to execute them.

These special programs are referred to as the

user macro

which can be written and stored

in the same format as a subprogram.

Main Program

G65

(Argument

/

Designation) ;

Main Program

M98

;

User Macro Body

-09001 ;

to

Variable

operation Command
Control Command

M99 ;

Subprogram

-01234 ;

M99 ;

I

However, unlike a subprogram, a user macro

allows:

( 1 ) U s e o f v a r i a b l e s .

(2) Computation between variable or between

constants.

(3) Use of control commands such as conditional

b r a n c h .

These features enable the user macro body

to provide a generalized program that requires
complicated computations and decisions.

The “argument designation” in calling a user

macro body from the main program makes it
possible to assign the real numbers to the vari-
ables in the body.

This enables this user macro

to run as a series of specific program that pro-
vide tool movements.
In this manual, the user macro body is sometimes
referred to as “macro program” or, simply,

“macro.

2.11.2 USER MACRO CALL COMMANDS

A user macro body may be called in the following
five manners:

No.

Type of Call

Simple call

Modal call

3

Call by arbitrary
G code

Call by M code

5

Call by T code

(1)

S i m p l e C a l l

C o d e

Remarks

G65

I

G66

G67:

For cancel.

G x x

Txxxx 4

digits max.

G65

.

.

(argument designation) ;

The macro program whose program number was speci-

fied by P is called and is executed L times. The default

value of L is 1. When the designation of an argument to

the user macro is desired, specify it in (argument desig-
nation).

“Argument designation” is the assignment of

real numbers to the “local variables” used in the user
macro. For details, see 2.11.3 ARGUMENT DESIGNA-

TION.

( 2 )

G66

.

.

( argument designation) ;

This command provides the mode to call the macro
program of the program number specified by P.
Each time a move command is executed, the spec-
ified macro is run L times.

G67 ;

This command cancels the modal call mode.

(3) Macro call by Arbitary

G

C o d e

Gxx ( argument designation) ;

This provides the command which is equivalent to

P (argument designation) ;. For Gxx, ten sets of

G codes of GO 1 through G 199 except for those designat-
ed by NC machine builder may be set for the parameter.

The macro program numbers which correspond to these

G codes are as follows :

#6120 . . . Sets G

program number

. . . Sets G

program number

to

#6129 . . . Sets G

program number

code

which calls

macro

09010.

code

which calls the macro of

09011.

code which calls the macro of

09019.

94

Advertising