Yaskawa J50M Instructions User Manual

Page 125

Advertising
background image

T:

such a case, common variables help.

Using common variables, write the macro to

designate the position of points

and Z. u

and F may also be used for the same purpose.

s :

it! Now, I divide the macro body

into two parts as follows:

(P8)

09000 ;

#loo = #18 ;

#101 = #26 ;

#lo2 = #21 ;

#lo3 = #9 ;

M99 ;

T :

s :

T :

s :

(P9)

09082 ;

GOO

;

GOO

;

GO1

F103 ;

G04

z-

+

R O U N D

;

M99 ;

and I write macro call as follows:

G91 ;

G65 P9000 R-80. z-40.

O F250. ;

G65 P9082 x1OO. Y50. ;

. ;

Very good.

Wait a minute! This canned cycle always re-
turns to the initial point.

I

also

overlooked it.

A program would be

useless if it is not able to designate the

initial point return ( G98) and point-R return
G99) .

To solve this problem, use the system

variable called current value of modal in-

formation command” to know which state, G98

or G99, is provided, and change the specifi-

cation of the tool return destination,

G98 and G99 belong to group “IO. ” So, I
have to use system variable #4010. Is it
right ?

T :

s :

T :

Y e s .

Then, using “IF . . . GO TO . com-

mand, change the specification of the tool
return destination.
There is one more point to be improved.

the program so that the group “

G

codes before execution may be retained after
the execution of this macro. Group

G

codes include GOO through

It looks difficult . . .
What would you say to the following program?

Well done !

Macro Call Program

G91 G99;

G65 P9000 R-80. Z-40.

O

G65 P9082 X1OO. Y50. ;

G65P9082X.. .Y. ..;

G98;

G65P9082 X.. .Y. ..;

User Macro Body

09000;

#100 = #18;

#101 = #26;

#lo2 =

#21;

#lo3 = #9;

#lo4 = o

-----------------------------------

09082;

#lo4 = #lo4 + 1

#1 = #4001; . . .

#2 = #4010; ., .

GOO

#104

GO TO 1;

IF[ #2

GO TO 2;

GOO

GO1

G04

#2

98] GO TO 2;

GOO 7-[ #101]

GOTO 3;

N2 GOO Z-[ ROUND [ #100] + ROUND [

#10111 ;

N3

. . . Restore G Code

M99;

117

Advertising