RUN
(Statement)
Concurrently runs another program.
RUN <Program name> [(<Argument>[,<Argument>...])][,<RUN option>]
This statement allows the currently executed program to run a program designated in <Program name>. However, the current program cannot run the program itself.
<Argument>
Only values are usable for <Argument>. Even if you specify reference pass, the reference data will automatically be changed to values. But you cannot use local array.
<RUN option>
For <RUN option>, three options are available:
PRIORITY (or P)
Designates the priority of a program. If ignored, the default value of 128 is set. The smaller the value, the higher the level of priority. The setting range is from 102 to 255.
Note: The priority over of the supervisory task cannot be changed.
CYCLE (or C)
Designates an alternate cycle (time of each cycle when a program is run repeatedly). This option is expressed in msec. The setting range is from 1 to 2,147,483,647.
You cannot start any program that includes arguments when using the cycle option.
RESULT [Ver. 2.6 or later]
Does not cause the program being executed to stop even if an internal error occurs during the execution of a RUN command. The error code is stored in the variable specified by RESULT.
-
When a task for which motion is being suspended is run again with a SUSPEND instruction, execute RUN after the motion completely stops. If RUN is executed and the robot is moved again before the motion stop finishes, an error such as a command speed limit over error may occur.
-
If a CYCLE option is used, note that cycle synchronization elapses even during suspension after an instantaneous stop of the robot during instruction execution followed by a restart of the robot.
-
RUN command is not executed in the teaching check mode.
DEFINT Li1 = 1, Li2 =2, Li3 = 3
|
|
RUN samp1 C=1000
|
'Runs samp1 in parallel n (C=1000).
|
RUN samp2(Li1)
|
'Runs samp2 using the Li1 argument in parallel.
|
RUN samp3(Li1,Li2),PRIORITY = 129
|
|
|
'Runs samp3 using the Li1 and Li2 arguments in parallel
'(P = 129).
|
RUN samp4(Li1,Li2),PRIORITY = 150
|
|
|
'Runs samp4 using the Li1 and Li2 arguments in parallel
'(P = 150).
|
RUN samp5(Li1,Li2,Li3), P = 120
|
|
|
'Runs samp5 using the Li1, Li2, and Li3 arguments in parallel
'(P = 120)
|
RUN samp6, RESULT = I1
|
'Run samp6.
'If RUN command fails, store the error code in
'variable I1 and proceed to the next line.
|