Yaskawa J50M Instructions User Manual
Page 106

2.11.4 OVERVIEW OF USER MACRO BODY (Cent’d)
operation Commands
A .
B .
(3)
A.
B.
Arithmetical operations ( +, -, *, / , “ )
Functional operations (SIN, COS, ROUND, . ..)
Control
Commands
Branch command (IF <qualification
GOTO n)
Repeat command (WHILE <qualification
DO m)
Using these commands, a program which requires
complicated operations and conditional judgments can
be written in the general format. The feature of user
macro is to enable the programming of a wide range of
NC functions from a simple machining cycle which is
rather a subprogram to a special, complicated canned
cycle, and the storing of these cycles in the machine.
Described below are details of the commands mentioned
above.
Main Program
G65
2.11.5 VARIABLES
Instead of directly assigning a value to an address in a
user macro body, the address can be designated by a
variable. When this variable is
during execution,
the corresponding value is searched from the variable
area to provide the address value.
There are three types of variables: local
variable,
common variable, and system variable.
Each is identifiable by a variable number.
To the local variables, real numbers can be
. .
assigned using the argument
part of
macro call command by G65 or G66.
(1)
V a r i a b l e s ( # 1 t h r o u g h # 3 3 )
A local variable is the one that is used for each
macro locally, That is, when the local variable
is used, the variable area ( #1 through #33) is
independently allocated for each macro call,
certain values are stored by argument designa-
tion, and the results of operations in macro are
retained.
Single-1evel Macro
—
—
09201 ;
“ #1, #2, #3
G65 P9205
Double-level Macro
09205 ;
#2
#3
Read /write
Enabled
Argument
Read /write
Designation
Enabled
Local variable area
Local variable area
for single-level macro
for duplicate-level macro
The variables #1, #2, #3, . . . of the same macro
Example
assume different values each time it is called. Each local
variable is reset for each macro
and is registered by
argument designation. The variable not designated
becomes “blank.” Each local variable is set to “blank at
the time of power-on and reset operations.
The local variables can also be used in the main
program, as in macro of other levels.
01000;
O 8000;
M98 P 8000 ;
# 2 = 2 ;
M99;
M30;