Macro Job Function
Macro Job is a method of creating a custom “instruction” that performs a desired set
of functions. This is similar to programming a child job and using the CALL JOB
instruction, but the advantage is that it can only be created, opened, and edited in
the Management Mode. Another advantage is that its custom name can represent its
purpose for ease of operator comprehension. A Concurrent Macro Job can only be
executed from another Concurrent Job.
NOTE: If a Macro Job is interrupted, it will restart at the beginning of the Macro Job,
rather than where the interruption occurred. However, a parameter can be
enabled, S2C438=1, to view/debug a Macro Job during execution. In this case,
the Macro Job would resume from the cursor line of interruption.
Macro Job Creation
To create a new Macro Job (in MANAGEMENT or SAFETY Mode only).
1. From the Main Menu, choose JOB.
2. Choose CREATE NEW JOB.
3. Enter the desired Job Name. (This Job Name is the “custom” instruction title
and should represent its intended function for ease of operator understanding.)
NOTE: Macro Job Names are limited to 8 characters, by default. A Yaskawa security level is required to enable 16 character Macro job name lengths.
4. Enter a descriptive Comment for the Job Header if desired.
5. Select the desired Group Set.
NOTE: Non-Group indicates that this job can contain only non-motion INFORM LIST
instructions. Group Set R1 or other combinations, as available based on the
controller setup, can have motion only for the identified Control Group.
6. Cursor to Job Type, and press SELECT.
7. Cursor to ROBOT MACRO, and press SELECT.
8. Press EXECUTE or ENTER.
The job is now created and can be programmed as any other job. This job can only
have instructions based on the job type. The Control Group in Robot Macros can
have motion as either Command Positions or Position Variables. Robot Macros with
Non-Group cannot have motion.
Macro Job Selection
NOTE: Macro Jobs are not available for viewing or modification in either the
OPERATION or EDITING Modes.
To Select a Macro Job (in MANAGEMENT or SAFETY Mode only).
1. From the Main Menu, choose Select Macro Job. The Macro Job Directory will
be displayed.
2. Cursor to the desired Macro Job name and press SELECT.
SETUP for INFORM LIST Macro Instruction
A Macro Job name must be “set up” to become an instruction available for selection
from the Inform List. For example, Macro jobs named GRP-OPN and GRP-CLS will
become the instructions GRP-OPN and GRP-CLS on the Inform List. If this setup is
not done, the job name does not become available as an instruction for programming.
To perform setup for the Macro Instruction.
1. From the Main Menu, choose SETUP.
2. Choose Macro Inst.
NOTE: ROBOT type Macro jobs must be set up on the MACRO (ROBOT) page;
CONCURRENT type are set up from the MACRO (CONCURRENT) page.
3. Use the Page Key to access the appropriate page.
4. Cursor to the next available MACRO setting, cursor to the EXECUTE Job
column, press SELECT.
Setting Macro Job
5. Cursor to SETTING MACRO JOB and press SELECT.
6. Cursor to the desired Macro Job name and press SELECT.
NOTE: The Macro Setup has the opportunity to set a Suspend Job. This job is a Non-
Group job that runs whenever the Macro Execute job is interrupted by a Hold
or E-Stop.
Programming the Macro Instruction
The Macro instruction must be created on the Inform List prior to programming.
To program the Macro Instruction, perform the following:
1. In an existing job, press the Inform List key.
2. Choose MACRO and press SELECT.
3. Choose Macro Instruction/Job desired, press SELECT and ENTER.
NOTE: Macro Instructions do not have the “IF” construct available.
CAUTION! Macro jobs will restart at the beginning when interrupted. Robot Macro jobs with
motion may not have a clear path from the point of interruption to the first point in
the job.
Macro Instructions with Arguments
Information can be “given” to the Macro with the use of Arguments. These are tags
on the Macro instruction that will be stored in the Macro Job in Local variables only.
NOTE: Local Variables must be set up in the Macro Job Header before the GETARG
instruction can be programmed in the Macro Job and before the argument can
be set up in the Macro Set Up.
Example:
MOVL V=950
CIRCLE radius= 50 speed= 500
MOVL V=950
NOTE: The Macro Job can be programmed using a RET instruction is a Return Value
tag is desired. This allows the transferring of numerical information back to the
parent job via the GETS $RV instruction.
Defining the Argument
To pass the arguments from the job instruction (eg CIRCLE radius= 50 speed= 500)
to the Macro Job, the Macro Instruction must be set-up.
To access the Argument Definition screen.
1. In the MANAGEMENT or SAFETY security level, from the Main Menu, choose
SETUP, MACRO INST.
2. Program the Execute Job.
3. Cursor to MACRO(X) and press SELECT to access the Argument Definition.
4. SELECT on the first column and set the argument to USED.
NOTE: Up to 16 arguments can be set for each Macro Job.
5. Cursor to TYPE and choose the data type to be passed to the Macro Job.
NOTE: Selecting a B, I, D, or R CONSTANT allows a number (only within that
variable type’s range of values) to be programmed for the Macro Argument.
Specification of a Variable type (e.g. B VARIABLE or R POSITION) places
reference to the specific variable file for the Macro Argument.
6. Using the PAGE key, view the screen with DISPLAY and EXPRES’N columns.
NOTE: DISPLAY ON allows the argument to be shown on the Edit Buffer Line.
EXPRES’N places a descriptive comment preceding the value/variable.
7. Change the Display to ON and enter a description for the EXPRES’N.
8. Page to the screen containing the COMMENT1 and COMMENT2 columns.
NOTE: COMMENT1 will be shown on the Detail Edit screen preceding the constant or
variable. COMMENT2 will follow the constant/variable.
9. Enter descriptions in COMMENT1 and COMMENT2 for the Detail Edit screen.
NOTE: COMMENT 1 of up to 16 characters, will be shown in the (Detail Edit)
Argument Setting screen. COMMENT 2 can have up to 8 characters.
10. Choose COMPLETE.
After the Macro instruction set up is complete, the instruction will be available on the
Inform List as MACRO.
Changing the Macro Instruction Setup
In the Macro Inst area, changing COMMENTS, EXPRES’N, or Display ON/OFF will
not affect the operation of the Macro.
Changing Data Type (from one variable type to another), adding or deleting
arguments, or adding or deleting Suspend Jobs will result in an UNMATCH
indication.
The instruction must be Deleted and re-Inserted, or Modified.
Comments
0 comments
Please sign in to leave a comment.