5-371
Automatic execution of program at power up
5Functions set with parameters
5.11 Automatic execution of program at power up
The following illustrates how to automatically run a robot program when the controller's power is turned on.
However, since the robot starts operating simply by turning the power on, exercise caution upon using this
function.
Related parameters
(1) First, create an ALWAYS program and an operating program.
<Program #2, ALWAYS program>
< Program #1, operating program > (this can be any program)
(2) Set the parameter.
After the setting is complete, turn the controller's power OFF.
(3) Turn the power ON.
In the sample above, after the controller's power is turned on, when the key switch is turned to AUTO (Ext.),
program #1 is executed and the robot starts its operation.
Parameter and value
Description of the operation
SLT*
Exmple) SLT2=2,ALWAYS,REP
Specifies the program name, start condition, and operation status. The point here is the start condition.
ALWENA
0->7
In the ALWAYS program, it is possible to execute multitask-related instructions such as XRun and
XLoad, and also the Servo instruction.
1 ' Auto Start Sample Program
2 '
3 ' Execute Program #1 if the key switch is AUTO (Ext.).
4 ' Stop the program and return the execution line to the beginning of the program if the key switch is not AUTO
(Ext.).
5 '
6 If M_Mode<>3 AND (M_Run(1)=1 OR M_Wai(1)=1) Then GoSub *MTSTOP
7 If M_Mode=3 AND M_Run(1)=0 AND M_Wai(1)=0 Then GoSub *MTSTART
8 If M_Mode=2 Then Hlt ' for DEBUG
9 End
10 '
11 *MTSTART
12 XRun 1,"1"
13 RETURN
14 '
15 *MTSTOP
16 XStp 1
17 XRst 1
18 RETURN
1 'Main Program
2 Servo On
3 M_Out(8)=0
4 Mov P1
5 M_Out(8)=1
6 Mov P2
7 End
P1=(+300.00,-200.00,+200.00,+0.00,+180.00,+0.00)(6,0)
P2=(+300.00,+200.00,+200.00,+0.00,+180.00,+0.00)(6,0)
Parameter and value
Description of the operation
SLT2
SLT2=2,ALWAYS,REP ’Execute program #2 in ALWAYS mode.
ALWENA
0->7
In the ALWAYS program, it is possible to execute multitask-related instructions such as XRun and
XLoad, and also the Servo instruction.