4-8 call, 4-9 do, Robot language – Yamaha SRCP User Manual

Page 108

Advertising
background image

8-

10

ROBOT LANGUAGE

8-4 Robot Language Description

8

8-4-8 CALL

Function:

Calls and executes another program.

Format:

CALL <program number>, <number of times>

Example:

CALL 5, 2
Calls program 5 and executes it twice. Program execution then proceeds
to the next step.

Explanation:

When repeating the same operation a number of times, the CALL state-
ment is used as needed to call and execute the subroutine defined as a
separate program.
(1) Program number

The program number is a number used to identify the 100 individual
programs from 0 to 99.

(2) Number of times

This is the number of times that the program is to be repeated. This
can be specified from 1 to 255.

Other:

• The nesting level is 6.
• When the end of the program initiated by the CALL statement is de-

tected, program execution advances to the step following the CALL
statement in the main program.

• An error occurs and program execution stops if the program being

executed is called by the CALL statement.

• Even when the program number is changed by the CALL statement,

resetting it will return to the original program number when program
execution begins.

• An error "stack overflow" might occur if a jump is made to another

program by the JMP or JMPF statement in a program called as a sub-
routine by the CALL statement.

8-4-9 DO

Function:

Controls ON/OFF of general-purpose output or memory output.

Format:

DO <DO or MO number>, <output status>

Example:

DO 3, 1
Turns on DO3.

Explanation:

This command turns the general-purpose output or memory output on
and off.
(1) DO or MO number

Specify one of the general-purpose output numbers from 0 to 4 (5
points) or memory output numbers from 100 to 131 (32 points).

(2) Output status

"1" means "on" and "0" means "off".

Advertising