MELFA V robot programing (1)
MELFA V robot programing (1)
4 MELFA-BASIC V
In this chapter, the functions and the detailed language specification of the programming language "MELFA-
BASIC V" are explained.
6 (6)Confirming that the target position is reached Fine, Mov and Dly
10 4.1.3Program control (1)Unconditional branching, conditional branching, GoTo, If Then Else, Wait, etc
waiting
14 (5)Timer Dly
For the detailed description of each instruction, please refer to Page 162, "4.13 Detailed explanation of com-
mand words".
*Command word
Command word Explanation
Mov The robot moves to the designated position with joint interpolation. It is possible to specify the
interpolation form using the TYPE instruction. An appended statement Wth or WthIf can be
designated
*Statement example
Statement example Explanation
Mov P1 ....................................................... ' Moves to P1.
Mov P1+P2................................................. ' Moves to the position obtained by adding the P1 and P2 coordinate elements. Refer to Page 117.
Mov P1*P2.................................................. ' Moves to the position relatively converted from P1 to P2. Refer to Page 117.
Mov P1,-50 *1)............................................ ' Moves from P1 to a position retracted 50mm in the hand direction.
Mov P1 Wth M_Out(17)=1......................... ' Starts movement toward P1, and simultaneously turns output signal bit 17 ON.
Mov P1 WthIf M_In(20)=1, Skip................. ' If the input signal bit 20 turns ON during movement to P1, the movement to P1 is stopped, and the
program proceeds to the next stop.
Mov P1 Type 1, 0 ........................................ ' Specify either roundabout (or shortcut) when the operation angle of each axis exceeds 180 deg..
(Default value: Long way around)
*Program example
Robot movement Hand *1) Specification of for-
:Robot movement
CAUTION ward/backward movement
:Movement position of the hand
(1)
The statement examples and program examples
P1
are for a vertical 6-axis robot (e.g., RV-6SD).The
hand advance/retrace direction relies on the
(2) 10
0m Z axis direction (+/- direction) of the tool coor-
m
(6) dinate set for each model.
(5) Refer to the tool coordinate system shown in
50mm
*Related functions
Function Explanation page
Designate the movement speed........................................................ Page 98, "(5) Acceleration/deceleration time and speed control"
Designate the acceleration/deceleration time. ................................. Page 98, "(5) Acceleration/deceleration time and speed control"
Confirm that the target position is reached. ...................................... Page 100, "(6) Confirming that the target position is reached"
Continuously move to next position without stopping at target posi-
tion..................................................................................................... Page 97, "(4) Continuous movement"
Move linearly. ................................................................................... Page 94, "(2) Linear interpolation movement"
Move while drawing a circle or arc. ................................................... Page 95, "(3) Circular interpolation movement"
Add a movement command to the process....................................... Page 274, " Wth (With)"
*Command word
Command word Explanation
Mvs The robot moves to the designated position with linear interpolation. It is possible to specify the
interpolation form using the TYPE instruction. An appended statement Wth or WthIf can be
designated.
*Statement example
Statement example Explanation
Mvs P1 ................................................................ ' Moves to P1
Mvs P1+P2.......................................................... ' Moves to the position obtained by adding the P1 and P2 coordinate elements. Refer to Page
117.
Mvs P1*P2........................................................... ' Moves to the position relatively converted from P1 to P2.
Mvs P1, -50 *1).................................................... ' Moves from P1 to a position retracted 50mm in the hand direction.
Mvs ,-50 *1) ......................................................... ' Moves from the current position to a position retracted 50mm in the hand direction.
Mvs P1 Wth M_Out(17)=1................................... ' Starts movement toward P1, and simultaneously turns output signal bit 17 ON.
Mvs P1 WthIf M_In(20)=1, Skip.......................... ' If the input signal bit 20 turns ON during movement to P1, the movement to P1 is stopped, and
the program proceeds to the next stop.
Mvs P1 Type 0, 0................................................. ' Moves to P1 with equivalent rotation
Mvs P1 Type 9, 1................................................. ' Moves to P1 with 3-axis orthogonal interpolation.
*Program example
Robot movement *1) Specification of forward/
Hand :Robot movement
:Movement position
CAUTION backward movement of the
hand
10 The statement examples and program examples
(1) 0m are for a vertical 6-axis robot (e.g., RV-6SD).The
m
hand advance/retrace direction relies on the
(6)
(5)
Z axis direction (+/- direction) of the tool coor-
(4)Turn output dinate set for each model.
50mm
(2) signal bit 17 ON. Refer to the tool coordinate system shown in
(3)
"Confirmation of movement" in the separate
P2
"From Robot unit setup to maintenance", and
P1 designate the correct direction.
Program example
Program Explanation
1 Mvs P1, -50 *1) ' (1) Moves with linear interpolation from P1 to a position retracted 50mm in the hand
direction.
2 Mvs P1 ' (2) Moves to P1 with linear interpolation.
3 Mvs ,-50 *1) ' (3) Moves with linear interpolation from the current position (P1) to a position retracted
50mm in the hand direction.
4 Mvs P2, -100 Wth M_Out(17)=1 *1) (4) Output signal bit 17 is turned on at the same time as the robot starts moving.
5 Mvs P2 (5) Moves with linear interpolation to P2.
6 Mvs , -100 *1) (6) Moves with linear interpolation from the current position (P2) to a position retracted
50mm in the hand direction.
7 End ’Ends the program.
*Related functions
Function Explanation page
Designate the movement speed. .............................................................. Page 98, "(5) Acceleration/deceleration time and speed
control"
Designate the acceleration/deceleration time. ......................................... Page 98, "(5) Acceleration/deceleration time and speed control"
Confirm that the target position is reached. ............................................. Page 100, "(6) Confirming that the target position is reached"
Continuously move to next position without stopping at target position.... Page 97, "(4) Continuous movement"
Move with joint interpolation...................................................................... Page 93, "(1) Joint interpolation movement"
Move while drawing a circle or arc. ........................................................... Page 95, "(3) Circular interpolation movement"
Add a movement command to the process............................................... Page 274, " Wth (With)"
*Command word
Command word Explanation
Mvr Designates the start point, transit point and end point, and moves the robot with circular
interpolation in order of the start point - transit point - end point. It is possible to specify the
interpolation form using the TYPE instruction. An appended statement Wth or WthIf can be
designated.
Mvr2 Designates the start point, end point and reference point, and moves the robot with circular
interpolation from the start point - end point without passing through the reference point. It is
possible to specify the interpolation form using the TYPE instruction. An appended statement Wth
or WthIf can be designated.
Mvr3 Designates the start point, end point and center point, and moves the robot with circular
interpolation from the start point to the end point. The fan angle from the start point to the end
point is 0 deg. < fan angle < 180 deg. It is possible to specify the interpolation form using the
TYPE instruction. An appended statement Wth or WthIf can be designated.
Mvc Designates the start point (end point), transit point 1 and transit point 2, and moves the robot with
circular interpolation in order of the start point - transit point 1 - transit point 2 - end point. An
appended statement Wth or WthIf can be designated.
*Statement example
Statement example Explanation
Mvr P1, P2, P3 ................................................................. ' Moves with circular interpolation between P1 - P2 - P3.
Mvr P1, P2, P3 Wth M_Out (17) = 1................................ ' Circular interpolation between P1 - P2 - P3 starts, and the output signal bit 17 turns ON.
Mvr P1, P2, P3 WthIf M_In (20) = 1, Skip ....................... ' If the input signal bit 20 turns ON during circular interpolation between P1 - P2 - P3,
circular interpolation to P1 is stopped, and the program proceeds to the next step.
Mvr P1, P2, P3 TYPE 0, 1................................................ ' Moves with circular interpolation between P1 - P2 - P3.
Mvr2 P1, P3, P11 ............................................................. ' Circular interpolation is carried out from P1 to P3 in the direction that P11 is not passed.
P11 is the reference point.
Mvr3 P1, P3, P10 ............................................................. ' Moves with circular interpolation from P1 to P3 in the direction with the smallest fan
angle. P10 is the center point.
Mvc P1, P2, P3................................................................. ' Moves with circular movement from P1 - P2 - P3 - P1.
*Program example
Robot movement
Hand :Robot movement
:Movement position
P4 P11
P6 (5)
P1 (2) (Reference P10
point)
P5
(1) P9
Turn output
signal bit
18 ON.
(3)
P3 P8
P7 (Center point)
P2
(4)
Program example
Program Explanation
1 Mvr P1, P2, P3 Wth M_Out(18) = 1 ' (1) Moves between P1 - P2 - P3 as an arc. The robot current position before movement is
separated from the start point, so first the robot will move with linear operation to the start point. (P1)
output signal bit 18 turns ON simultaneously with the start of circular movement.
2 Mvr P3, P4, P5 ' (2) Moves between P3 - P4 - P5 as an arc.
3 Mvr2 P5, P7, P6 ' (3) Moves as an arc over the circumference on which the start point (P5), reference point (P6) and
end point (P7) in the direction that the reference point is not passed between the start point and end
point.
4 Mvr3 P7, P9, P8 ' (4) Moves as an arc from the start point to the end point along the circumference on which the
center point (P8), start point (P7) and end point (P9) are designated.
5 Mvc P9, P10, P11 ' (5) Moves between P9 - P10 - P11 - P9 as an arc. The robot current position before movement is
separated from the start point, so first the robot will move with linear operation to the start point.(1
cycle operation)
6 End ' Ends the program.
*Related functions
Function Explanation page
Designate the movement speed. .................................................................... Page 98, "(5) Acceleration/deceleration time and speed
control"
Designate the acceleration/deceleration time. ............................................... Page 98, "(5) Acceleration/deceleration time and speed
control"
Confirm that the target position is reached. ................................................... Page 100, "(6) Confirming that the target position is reached"
Continuously move to next position without stopping at target position.......... Page 97, "(4) Continuous movement"
Move with joint interpolation............................................................................ Page 93, "(1) Joint interpolation movement"
Move linearly. .................................................................................................. Page 94, "(2) Linear interpolation movement"
Add a movement command to the process. ................................................... Page 274, " Wth (With)"
*Statement example
Statement example Explanation
Cnt 1 ................................................................................. Designates the start of the continuous movement.
CNT 1, 100, 200 ............................................................... Designates the start of the continuous movement, and designates that the start point
neighborhood distance is 100mm, and the end point neighborhood distance is 200mm.
CNT 0 ............................................................................... Designates the end of the continuous movement.
*Program example
Robot movement
Hand :Robot movement
:Movement position CAUTION
The robot moves continuously for less than the smaller distance
of either the proximity distance when moving toward P6 (200 mm) *1) Specification of forward/backward move-
(1) or the proximity distance to the starting point of the path to P1 (100 mm). ment of the hand
The statement examples and program exam-
P1 100mm ples are for a vertical 6-axis robot (e.g., RV-
(5) 6SD).The hand advance/retrace direction
relies on the Z axis direction (+/- direction) of
200mm
CAUTION
100mm
P5
P3 The robot's locus of movement may change
with specified speed.
(3) Especially as for the corner section, short cut
P4 distance may change. Therefore, when
Default value beginning automatic operation, moves at low
speed at first, and you should gather speed
The robot moves continuously for less than the smaller distance of either slowly with being careful of interference with
the proximity distance when moving toward P5 (default value) or the proximity peripheral equipment.
distance to the starting point of the path to P6 (200 mm).
Program example
Program Explanation
1 Mov P1 ' (1) Moves with joint interpolation to P1.
2 Cnt 1 ' Validates continuous movement. (Following movement is continuous movement.)
3 Mvr P2, P3, P4 ' (2) Moves linearly to P2, and continuously moves to P4 with arc movement.
4 Mvs P5 ' After arc movement, moves linearly to P5.
5 Cnt 1, 200, 100 ' (3) Sets the continuous movement's start point neighborhood distance to 200mm,
and the end point neighborhood distance to 100mm.
6 Mvs P6 ' (4) After moving to previous P5, moves in succession linearly to P6.
7 Mvs P1 ' (5) Continuously moves to P1 with linear movement.
8 Cnt 0 ' Invalidates the continuous movement.
9 End ' Ends the program.
*Related functions
Function Explanation page
Designate the movement speed. ........................................................ Page 98, "(5) Acceleration/deceleration time and speed control"
Designate the acceleration/deceleration time. ................................... Page 98, "(5) Acceleration/deceleration time and speed control"
Confirm that the target position is reached. ....................................... Page 100, "(6) Confirming that the target position is reached"
Move with joint interpolation................................................................ Page 93, "(1) Joint interpolation movement"
Move linearly. ...................................................................................... Page 94, "(2) Linear interpolation movement"
Move while drawing a circle or arc. ..................................................... Page 95, "(3) Circular interpolation movement"
Spd Designate the linear and circular interpolation speed with the hand end speed (mm/s).
Oadl This instruction specifies whether the optimum acceleration/deceleration function should be
enabled or disabled.
*Statement example
Statement example Explanation
Accel................................................................................. Sets both the acceleration and deceleration to 100%.
Accel 60, 80...................................................................... Sets the acceleration to 60% and the deceleration to 80%.
(For maximum acceleration/deceleration is 0.2 sec.
acceleration 0.2/0.6=0.33 sec. deceleration 0.2/0.8=0.25 sec. )
Ovrd 50............................................................................. Sets the joint interpolation, linear interpolation and circular interpolation to 50% of the
maximum speed.
JOvrd 70........................................................................... Set the joint interpolation operation to 70% of the maximum speed.
Spd 30 .............................................................................. Sets the linear interpolation and circular interpolation speed to 30mm/s.
Oadl ON ........................................................................... This instruction enables the optimum acceleration/deceleration function.
*Movement speed during joint interpolation
Controller (T/B) setting value x Ovrd command setting value x JOvrd command setting value.
*Movement speed during linear and circular interpolation
Controller (T/B) setting value x Ovrd command setting value x Spd command setting value.
*Program example
Robot movement *1) Specification of forward/
Hand
:Robot movement CAUTION backward movement of the
:Movement position
hand
P1 The statement examples and program examples
(1)....Maximum speed
are for a vertical 6-axis robot (e.g., RV-6SD).The
hand advance/retrace direction relies on the
(6)70%
Z axis direction (+/- direction) of the tool coor-
(2)..........Maximum speed dinate set for each model.
Refer to the tool coordinate system shown in
50mm
Program example
Program Explanation
1 Ovrd 100 ' Sets the movement speed applied on the entire program to the maximum speed.
2 Mvs P1 ' (1) Moves at maximum speed to P1.
3 Mvs P2, -50 *1) ' (2) Moves at maximum speed from P2 to position retracted 50mm in hand direction.
4 Ovrd 50 ' Sets the movement speed applied on the entire program to half of the maximum speed.
5 Mvs P2 ' (3) Moves linearly to P2 with a speed half of the default speed.
6 Spd 120 ' Sets the end speed to 120mm/s. (Since the override is 50%, it actually moves at 60 mm/s.)
7 Ovrd 100 ' Sets the movement speed percentage to 100% to obtain the actual end speed of 120mm/s.
8 Accel 70, 70 ' Sets the acceleration and deceleration to 70% of the maximum speed.
9 Mvs P3 ' (4) Moves linearly to P3 with the end speed 120mm/s.
10 Spd M_NSpd ' Returns the end speed to the default value.
11 JOvrd 70 ' Sets the speed for joint interpolation to 70%.
12 Accel ' Returns both the acceleration and deceleration to the maximum speed.
13 Mvs , -50 *1) ' (5) Moves linearly with the default speed for linear movement from the current position (P3) to a position
retracted 50mm in the hand direction.
14 Mvs P1 ' (6) Moves to P1 at 70% of the maximum speed.
15 End ' Ends the program.
*Related functions
Function Explanation page
Move with joint interpolation............................................................................ Page 93, "(1) Joint interpolation movement"
Move linearly. .................................................................................................. Page 94, "(2) Linear interpolation movement"
Move while drawing a circle or arc. ................................................................. Page 95, "(3) Circular interpolation movement"
Continuously move to next position without stopping at target position.......... Page 97, "(4) Continuous movement"
*Statement example
Statement example Explanation
Fine100 ............................................................................ Sets the positioning finish conditions to 100 pulses.
Mov P1 ............................................................................. Moves with joint interpolation to P1. (The movement completes at the command value
level.)
Dly 0.1 .............................................................................. Positioning after the movement instruction is performed by the timer.
*Program example
Robot movement *1) Specification of forward/
Hand
:Robot movement CAUTION backward movement of the
:Movement position
hand
The statement examples and program examples
P1 (1)
are for a vertical 6-axis robot (e.g., RV-6SD).The
hand advance/retrace direction relies on the
10
(2)
0 m Z axis direction (+/- direction) of the tool coor-
m
(5) (8)
dinate set for each model.
50mm
Program example
Program Explanation
1 Cnt 0 ' The Fine instruction is valid only when the Cnt instruction is OFF.
2 Mvs P1 ' (1) Moves with joint interpolation to P1.
3 Mvs P2, -50 *1) ' (2) Moves with joint interpolation from P2 to position retracted 50mm in hand direction.
4 Fine 50 ' Sets positioning finish pulse to 50.
5 Mvs P2 ' (3) Moves with linear interpolation to P2
(Mvs completes if the positioning complete pulse count is 50 or less.)
6 M_Out(17)=1 ' (4) Turns output signal 17 ON when positioning finish pulse reaches 50 pulses.
7 Fine 1000 ' Sets positioning finish pulse to 1000.
8 Mvs P3, -100 *1) ' (5) Moves linearly from P3 to position retracted 100mm in hand direction.
9 Mvs P3 ' (6) Moves with linear interpolation to P3.
10 Dly 0.1 ' Performs the positioning by the timer.
11 M_Out(17)=0 ' (7) Turns output signal 17 off.
12 Mvs , -100 *1) ' (8) Moves linearly from current position (P3) to position retracted 100mm in hand direction.
13 End ' Ends the program.
*Related functions
Function Explanation page
Move with joint interpolation............................................................................ Page 95, "(3) Circular interpolation movement"
Move linearly. .................................................................................................. Page 94, "(2) Linear interpolation movement"
Continuously move to next position without stopping at target position.......... Page 97, "(4) Continuous movement"
*Statement example
Statement example Explanation
Prec On ............................................................................ Enables the high path accuracy mode.
Prec Off............................................................................. Disables the high path accuracy mode.
*Program example
Robot movement *1) Specification of for-
:Robot movement
CAUTION ward/backward movement
Hand of the hand
:Movement position
*1) The statement examples and program exam-
ples are for a vertical 6-axis robot (e.g., RV-
6SD).The hand advance/retrace direction
(1)
P4 (5) P3 relies on the Z axis direction (+/- direction) of
the tool coordinate set for each model.
(7)
(2) (6) Refer to the tool coordinate system shown in
(4) "Confirmation of movement" in the separate
(3) "From Robot unit setup to maintenance", and
P1 P2
designate the correct direction.
•Program example
Program Explanation
1 Mov P1, -50 *1) ' (1) Moves with joint interpolation from P1 to position retracted 50mm in hand direction.
2 Ovrd 50 ' Sets the movement speed to half of the maximum speed.
3 Mvs P1 ' (2) Moves with linear interpolation to P1.
4 Prec On ' The high path accuracy mode is enabled.
5 Mvs P2 ' (3) Moves the robot from P1 to P2 with high path accuracy.
6 Mvs P3 ' (4) Moves the robot from P2 to P3 with high path accuracy.
7 Mvs P4 ' (5) Moves the robot from P3 to P4 with high path accuracy.
8 Mvs P1 ' (6) Moves the robot from P4 to P1 with high path accuracy.
9 Prec Off ' The high path accuracy mode is ÇÑisableÇÑ.
10 Mvs P1, -50 *1) ' (7) Returns the robot to the position 50 mm behind P1 in the hand direction using linear
interpolation.
11 End ' Ends the program.
The Prec instruction improves the tracking accuracy of the robot's hand tip, but low-
CAUTION ers the acceleration/deceleration of the robot movement, which means that the cycle
time may become longer. The tracking accuracy will be further improved if the Cnt
instruction is not included. However, the hand tip speed cannot be guaranteed in this
case.
Tool Sets the shape of the tool being used, and sets the control point.
*Statement example
Statement example Explanation
HOpen 1........................................................................... Opens hand 1.
HOpen 2........................................................................... Opens hand 2.
HClose 1........................................................................... Closes hand 1.
HClose 2........................................................................... Closes hand 2.
Tool (0, 0, 95, 0, 0, 0) ...................................................... Sets the robot control point to the position 95 mm from the flange plane in the extension
direction.
*Program example
Robot movement *1) Specification of for-
Hand :Robot movement CAUTION ward/backward movement
:Movement position of the hand
The statement examples and program examples
(1) are for a vertical 6-axis robot (e.g., RV-6SD).The
hand advance/retrace direction relies on the
(5) Z axis direction (+/- direction) of the tool coor-
P1 dinate set for each model.
(2) P2 (6)
(4) (8) Refer to the tool coordinate system shown in
Workpiece
"Confirmation of movement" in the separate
"From Robot unit setup to maintenance", and
(3) Grasps (7) Releases designate the correct direction.
workpiece workpiece
•Program example
Program Explanation
1 Tool(0, 0, 95, 0, 0, 0) ’Sets the hand length to 95 mm.
2 Mvs P1, -50 *1) ’(1) Moves with joint interpolation from P1 to position retracted 50mm in hand direction.
3 Ovrd 50 ’Sets the movement speed to half of the maximum speed.
4 Mvs P1 ’(2) Moves with linear interpolation to P1. (Goes to grasp workpiece.)
5 Dly 0.5 ’ Wait for the 0.5 seconds for the completion of arrival to the target position.
6 HClose 1 ’(3) Closes hand 1. (Grasps workpiece.)
7 Dly 0.5 ’Waits 0.5 seconds.
8 Ovrd 100 ’Sets movement speed to maximum speed.
9 Mvs , -50 *1) ’(4) Moves linearly from current position (P1) to position retracted 50mm in hand direction. (Lifts up
workpiece.)
10 Mvs P2, -50 *1) ’(5) Moves with joint interpolation from P2 to position retracted 50mm in hand direction.
11 Ovrd 50 ’Sets movement speed to half of the maximum speed.
12 Mvs P2 ’(6) Moves with linear interpolation to P2. (Goes to place workpiece.)
13 Dly 0.5 ’ Wait for the 0.5 seconds for the completion of arrival to the target position.
14 HOpen 1 ’(7) Opens hand 1. (Releases workpiece.)
15 Dly 0.5 ’Waits 0.5 seconds.
16 Ovrd 100 ’ Sets movement speed to maximum speed.
17 MVS , -50 *1) ’(8) Moves linearly from current position (P2) to position retracted 50mm in hand direction.
(Separates from workpiece.)
18 End ’Ends the program.
*Related functions
Function Explanation page
Appended statement....................................................................................... Page 274, " Wth (With)"
*Statement example
Statement example Explanation
Def Plt 1, P1, P2, P3, P4, 4, 3, 1 ...................................... Defines to operate pallet No. 1 with a start point = P1, end point A = P2, end point B = P3
and diagonal point = P4, a total of 12 work positions (quantity A = 4, quantity B = 3), and
a pallet pattern = 1(Zigzag).
Def Plt 2, P1, P2, P3, , 8, 5, 2........................................... Defines to operate pallet No. 2 with a start point = P1, end point A = P2, and end point B
= P3, a total of 40 work positions (quantity A = 8, quantity B = 5), and a pallet pattern = 2
(Same direction).
Def Plt 3, P1, P2, P3, , 5, 1, 3........................................... Define that pallet No. 3 is an arc pallet having give five work positions on an arc
designated with start point = P1, transit point = P2, end point = P3 (total three points).
(Plt1, 5) ............................................................................. Operate the 5th position on pallet No. 1.
(Plt1, M1) .......................................................................... Operate position in pallet No. 1 indicated with the numeric variable M1.
The relation of the position designation and a pallet pattern is shown below.
6 5 4 4 5 6
1 2 3 1 2 3
CAUTION Please read "*Explanation" below if you use position data whose posture compo-
nents (A, B and C) are approximately +/-180 degrees as the start point, end points A
and B, or the diagonal point.
*Explanation
At a position where a posture component (A, B and C) reaches 180 degrees, the component value can
become either +180 degrees or -180 degrees even if the posture is the same. This is due to internal opera-
tion errors, and there is no consistency in which sign is employed.
If this position is used for the start point, end points A and B or diagonal point of the pallet definition and the
same posture component values include both +180 degrees and -180 degrees, the hand will rotate and
move in unexpected ways because the pallet gird positions are calculated by dividing the distance between
-180 degrees and +180 degrees.
Whether a posture component is +180 degrees or -180 degrees, the posture will be the same. Use the
same sign, either + or -, consistently for position data used to define a pallet.
Note also that similar phenomena can occur if posture components are close to +/-180 degrees (e.g., +179
degrees and -179 degrees) as well, if different signs are used. In this case, add or subtract 360 degrees to/
from the posture components and correct the values such that the sign becomes the same. (For example,
to change the sign of -179 degrees to +, add 360 degrees and correct the value to +181 degrees.)
"•Program example 1" shows an example where the posture components of the end points (P3 and P4) and
diagonal point (P5) are adjusted according to the start point (P2) when the hand direction is the same in all
grid points of a pallet (values of the A, B and C axes are identical) (line numbers 10 to 90). "•Program exam-
ple 2" shows an example where values are corrected to have the same sign as the start point (P2) when the
posture components of a pallet definition position are close to +/-180 degrees and the C-axis values of the
end points (P3 and P4) and diagonal point (P5) are either less than -178 degrees or greater than +178
degrees (line numbers 10 to 100). (+/-178 degrees are set as the threshold values of correction.) Use these
program examples as reference for cases where the pallet precision is not very high and the hand direction
thus must be corrected slightly.
*Program example
Robot movement P1
(workpiece supply position) P4 P5
(End point B) (Diagonal point)
13 14 15
Palletize
10 11 12
*1) Specification of forward/
CAUTION backward movement of the
7 8 9
hand
The statement examples and program examples are for a
5 pcs.
4 5 6
vertical 6-axis robot (e.g., RV-6SD).The hand advance/
retrace direction relies on the Z axis direction (+/- direc-
tion) of the tool coordinate set for each model. 1 2 3
Refer to the tool coordinate system shown in "Confirma-
tion of movement" in the separate "From Robot unit setup 3 pcs.
P2 P3
to maintenance", and designate the correct direction. (Start point) Pallet pattern = 2(same direction) (End point A)
CAUTION The value of the start point of the pallet definition is employed for the structure flag of
grid points (FL1 of position data) calculated by pallet operation (Plt instruction).
For this reason, if position data with different structure flags are used for each point of
the pallet definition, the desired pallet operation cannot be obtained.
Use position data whose structure flag values are all the same for the start point, end
points A and B and the diagonal point of the pallet definition. The value of the start
position of the pallet definition is employed for the multi-rotation flag of grid points
(FL2 of position data) as well. If position data with different multi-rotation flags are
used for each point of the pallet definition, the hand will rotate and move in unex-
pected ways depending on the robot positions the pallet operation goes through and
the type of interpolation instruction (joint interpolation, line interpolation, etc.). In such
cases, use the TYPE argument of the interpolation instruction to set the detour/short
cut operation of the posture properly and ensure that the hand moves as desired.
•Program example 1
The hand direction is the same in all grid points of a pallet (values of the A, B and C axes are identical)
Program Explanation
1 P3.A=P2.A ’Assigns the posture component (A) of P2 to the posture component (A) of P3.
2 P3.B=P2.B ’Assigns the posture component (B) of P2 to the posture component (B) of P3.
3 P3.C=P2.C ’Assigns the posture component (C) of P2 to the posture component (C) of P3.
4 P4.A=P2.A ’Assigns the posture component (A) of P2 to the posture component (A) of P4.
5 P4.B=P2.B ’Assigns the posture component (B) of P2 to the posture component (B) of P4.
6 P4.C=P2.C ’Assigns the posture component (C) of P2 to the posture component (C) of P4.
7 P5.A=P2.A ’Assigns the posture component (A) of P2 to the posture component (A) of P5.
8 P5.B=P2.B ’Assigns the posture component (B) of P2 to the posture component (B) of P5.
9 P5.C=P2.C ’Assigns the posture component (C) of P2 to the posture component (C) of P5.
10 Def Plt 1, P2, P3, P4, P5, 3, 5, 2 ’Defines the pallet. Pallet No. = 1, start point = P2, end point A = P3, end point B = P4,
diagonal point = P5, quantity A = 3, quantity B = 5, pallet pattern = 2 (Same direction).
11 M1=1 ’Substitutes value 1 in numeric variable M1. (M1 is used as a counter.
12 *LOOP ’Designates label LOOP at the jump destination.
13 Mov P1, -50 *1) ’Moves with joint interpolation from P1 to a position retracted 50mm in hand direction.
14 Ovrd 50 ’Sets movement speed to half of the maximum speed.
15 Mvs P1 ’Moves linearly to P1. (Goes to grasp workpiece.)
16 HClose 1 ’Closes hand 1. (Grasps workpiece.)
17 Dly 0.5 ’Waits 0.5 seconds.
18 Ovrd 100 ’Sets movement speed to maximum speed.
19 Mvs , -50 *1) ’Moves linearly from current position (P1) to a position retracted 50mm in hand direction. (Lifts
up workpiece.)
20 P10=(Plt1,M1) ’Operates the position in pallet No. 1 indicated by the numeric variable M1, and substitutes
the results in P10.
21 Mov P10, -50 *1) ’Moves with joint interpolation from P10 to a position retracted 50mm in hand direction.
22 Ovrd 50 ’Sets movement speed to half of the maximum speed.
23 Mvs P10 ’Moves linearly to P10. (Goes to place workpiece.)
24 HOpen 1 ’Opens hand 1. (Places workpiece.)
25 Dly 0.5 ’Waits 0.5 seconds.
26 Ovrd 100 ’Sets movement speed to maximum speed.
27 Mvs , -50 ’Moves linearly from current position (P10) to a position retracted 50mm in hand direction.
(Separates from workpiece.)
28 M1=M1+1 ’Increments numeric variable M1 by 1. (Advances the pallet counter.)
29 If M1<=15 Then *LOOP ’If numeric variable M1 value is less than 15, jumps to label LOOP and repeat process. If
more than 15, goes to next step.
30 End ’Ends the program.
•Program example 2
Correction when posture components are close to +/-180 degrees
Program Explanation
1 If Deg(P2.C)<0 Then GoTo *MINUS ’Checks the sign of the posture component (C) of P2 and, if it is -
(negative), jump to the label MINUS line.
2 If Deg(P3.C)<-178 Then P3.C=P3.C+Rad(+360) ’If the posture component (C) of P3 is close to -180 degrees,
adds 360 degrees to correct it to a positive value.
3 If Deg(P4.C)<-178 Then P4.C=P4.C+Rad(+360) ’If the posture component (C) of P4 is close to -180 degrees,
adds 360 degrees to correct it to a positive value.
4 If Deg(P5.C)<-178 Then P5.C=P5.C+Rad(+360) ’If the posture component (C) of P5 is close to -180 degrees,
adds 360 degrees to correct it to a positive value.
5 GoTo *DEFINE ’Jumps unconditionally to the label DEFINE line.
6 *MINUS ’Specifies the label MINUS line as the jump destination.
7 If Deg(P3.C)<+178 Then P3.C=P3.C-Rad(+360) ’If the posture component (C) of P3 is close to +180 degrees,
adds 360 degrees to correct it to a negative value.
8 If Deg(P4.C)<+178 Then P4.C=P4.C-Rad(+360) ’If the posture component (C) of P4 is close to +180 degrees,
adds 360 degrees to correct it to a negative value.
9 If Deg(P5.C)<+178 Then P5.C=P5.C-Rad(+360) ’If the posture component (C) of P5 is close to +180 degrees,
adds 360 degrees to correct it to a negative value.
10 *DEFINE ’Specifies the label DEFINE line as the jump destination.
11 Def Plt 1, P2, P3, P4, P5, 3, 5, 2 ’Defines the pallet. Pallet No. = 1, start point = P2, end point A =
P3, end point B = P4, diagonal point = P5, quantity A = 3,
quantity B = 5, pallet pattern = 2 (Same direction).
12 M1=1 ’Substitutes value 1 in numeric variable M1. (M1 is used as a
counter.
13 *LOOP ’Designates label LOOP at the jump destination.
14 Mov P1, -50 *1) ’Moves with joint interpolation from P1 to a position retracted
50mm in hand direction.
15 Ovrd 50 ’Sets movement speed to half of the maximum speed.
16 Mvs P1 ’Moves linearly to P1. (Goes to grasp workpiece.)
17 HClose 1 ’Closes hand 1. (Grasps workpiece.)
18 Dly 0.5 ’Waits 0.5 seconds.
19 Ovrd 100 ’Sets movement speed to maximum speed.
20 Mvs , -50 *1) ’Moves linearly from current position (P1) to a position retracted
50mm in hand direction. (Lifts up workpiece.)
21 P10=(Plt1,M1) ’Operates the position in pallet No. 1 indicated by the numeric
variable M1, and substitutes the results in P10.
22 Mov P10, -50 *1) ’Moves with joint interpolation from P10 to a position retracted
50mm in hand direction.
23 Ovrd 50 ’Sets movement speed to half of the maximum speed.
24 Mvs P10 ’Moves linearly to P10. (Goes to place workpiece.)
25 HOpen 1 ’Opens hand 1. (Places workpiece.)
26 Dly 0.5 ’Waits 0.5 seconds.
27 Ovrd 100 ’Sets movement speed to maximum speed.
28 Mvs , -50 ’Moves linearly from current position (P10) to a position retracted
50mm in hand direction. (Separates from workpiece.)
29 M1=M1+1 ’Increments numeric variable M1 by 1. (Advances the pallet
counter.)
30 If M1<=15 Then *LOOP ’If numeric variable M1 value is less than 15, jumps to label
LOOP and repeat process. If more than 15, goes to next step.
31 End ’Ends the program.
Select Jumps according to the designated variable and the designated conditions of that value.
Case The value conditions can be designated randomly.
End Select Multiple types of conditions can be designated per command statement.
Wait Waits for the variable to reach the designated value.
*Statement example
Statement example Explanation
GoTo *FN.................................................... Jumps unconditionally to the label FN step.
ON M1 GoTo *L1, *L2, *L3 ......................... If the numeric variable M1 value is 1, jumps to step *L1, if 2 jumps to step *L2, and if 3 jumps to step
*L3. If the value does not correspond, proceeds to next step.
If M1=1 Then *L1........................................ If the numeric variable M1 value is 1, branches to step *L1. If not, proceeds to the next step.
If M1=1 Then *L2 Else *L2 ......................... If the numeric variable M1 value is 1, branches to step *L1. If not, branches to step *L2.
If M1=1 Then .............................................. If the numerical variable of M1 is 1, the instructions M2 = 1 and M3 = 2 are executed. If the value of M1
M2=1 is different from 1, the instructions M2 = -1 and M3 = -2 are executed.
M3=2
Else
M2=-1
M3=-2
EndIf
Select M1 ................................................... Branches to the Case statement corresponding to the value of numeric variable M1.
Case 10..................................................... If the value is 10, executes only between Case 10 and the next Case 11.
:
Break
Case IS 11................................................. If the value is 11, executes only between Case 11 and the next Case IS <5.
:
Break
Case IS <5 ................................................ If the value is smaller than 5, executes only between Case IS <5 and next Case 6 TO 9.
:
Break
Case 6 TO 9 .............................................. If value is between 6 and 9, executes only between Case 6 TO 9 and next Default.
:
Break
Default ....................................................... If value does not correspond to any of the above, executes only between Default and next End Select.
:
Break Ends the Select Case statement.
End Select ..................................................
Wait M_In(1)=1 Waits for the input signal bit 1 to turn ON.
*Related functions
Function Explanation page
Repetition ........................................................................................... Page 109, "(2) Repetition"
Interrupt.............................................................................................. Page 110, "(3) Interrupt"
Subroutine.......................................................................................... Page 111, "(4) Subroutine"
External signal input........................................................................... Page 113, "(1) Input signals"
(2) Repetition
Multiple command statements can be repeatedly executed according to the designated conditions.
*Command word
Command word Explanation
For Next Repeat between For statement and Next statement until designated conditions are satisfied.
While WEnd Repeat between While statement and WEnd statement while designated conditions are
satisfied.
*Statement example
Statement example Explanation
For M1=1 To 10 ................................................................ Repeat between For statement and Next statement 10 times.
: The initial numeric variable M1 value is 1, and is incremented by one with each
Next repetition.
For M1=0 To 10 Step 2 ..................................................... Repeat between For statement and Next statement 6 times.
: The initial numeric variable M1 value is 0, and is incremented by two with each
Next repetition.
While (M1 >= 1) And (M1 <= 10) ...................................... Repeat between While statement and WEnd statement while the value of the numeric
: variable M1 is 1 or more and less than 10.
WEnd
*Related functions
Function Explanation page
Unconditional branching, branching................................................... Page 108, "(1) Unconditional branching, conditional branching,
waiting"
Interrupt.............................................................................................. Page 110, "(3) Interrupt"
Input signal wait ................................................................................. Page 113, "(1) Input signals"
(3) Interrupt
Once the designated conditions are established, the command statement being executed can be interrupted
and a designated step branched to.
*Command word
Command word Explanation
Def Act Defines the interrupt conditions and process for generating interrupt.
Return If a subroutine is called for the interrupt process, returns to the interrupt source line.
*Statement example
Statement example Explanation
Def Act 1, M_In(10)=1 GoSub *SUB1 .............................. If input signal bit 10 is turned on for interrupt number 1, the subroutine on step *SUB1 is
defined to be called after the robot decelerates and stops. The deceleration time
depends on the Accel and Ovrd instructions.
Def Act 2, M_In(11)=1 GoSub *SUB2, L .......................... If input signal bit 11 is turned on for interrupt number 2, the subroutine on step *SUB2 is
defined to be called after the statement currently being executed is completed.
Def Act 3, M_In(12)=1 GoSub *SUB3, S.......................... If input signal bit 12 is turned on for interrupt number 3, the subroutine on step *SUB3 is
defined to be called after the robot decelerates and stops in the shortest time and
distance possible.
Act 1=1 ............................................................................. Enables the priority No. 1 interrupt.
Act 2=0 ............................................................................. Disables the priority No. 1 interrupt.
Return 0............................................................................ Returns to the step where the interrupt occurred.
Return 1............................................................................ Returns to the step following the step where the interrupt occurred.
*Related functions
Function Explanation page
Unconditional branching, branching................................................... Page 108, "(1) Unconditional branching, conditional branching,
waiting"
Subroutine.......................................................................................... Page 111, "(4) Subroutine"
Communication .................................................................................. Page 114, "4.1.5 Communication"
(4) Subroutine
Subroutine and subprograms can be used.
By using this function, the program can be shared to reduce the No. of steps, and the program can be cre-
ated in a hierarchical structure to make it easy to understand.
*Command word
Command word Explanation
GoSub Calls the subroutine at the designated step or designated label.
On GoSub Calls the subroutine according to the designated variable number. The value conditions follow
the integer value order. (1,2,3,4,.......)
Return Returns to the step following the step called with the GoSub command.
CallP Calls the designated program. The next step in the source program is returned to at the End
statement in the called program. Data can be transferred to the called program as an argument.
FPrm An argument is transferred with the program called with the CallP command.
*Statement example
Statement example Explanation
GoSub ....................................................... Calls the subroutine from step.
On GoSub................................................... Calls the subroutine from label GET.
ON M1 GoSub *L1, *L2, *L3....................... If the numeric variable M1 value is 1, calls the subroutine at step *L1, if 2 calls the subroutine at step
*L2, and if 3 calls the subroutine at step *L3. If the value does not correspond, proceeds to next step.
Return......................................................... Returns to the step following the step called with the GoSub command.
CallP "10" ................................................... Calls the No. 10 program.
CallP "20", M1, P1 ...................................... Transfers the numeric variable M1 and position variable P1 to the No. 20 program, and calls the
program.
FPrm M10, P10 .......................................... Receives the numeric variable transferred with the CallP in M10 of the subprogram, and the position
variable in P10.
*Related functions
Function Explanation page
Interrupt........................................................................................ Page 110, "(3) Interrupt"
Communication ............................................................................ Page 114, "4.1.5 Communication"
Unconditional branching............................................................... Page 108, "(1) Unconditional branching, conditional branching, waiting"
(5) Timer
The program can be delayed by the designated time, and the output signal can be output with pulses at a
designated time width.
*Command word
Command word Explanation
Dly Functions as a designated-time timer.
*Statement example
Statement example Explanation
Dly 0.05 ............................................................................. Waits for only 0.05 seconds.
M_Out(10)=1 Dly 0.5......................................................... Turns on output signal bit 10 for only 0.5 seconds.
*Related functions
Function Explanation page
Pulse signal output............................................................................. Page 113, "(1) Input signals"
(6) Stopping
The program execution can be stopped. The moving robot will decelerate to a stop.
*Command word
Command word Explanation
Hlt This instruction stops the robot and pauses the execution of the program. When the program is
started, it is executed from the next step.
End This instruction defines the end of one cycle of a program. In continuous operation, the program
is executed again from the start step upon the execution of the End instruction. In cycle
operation, the program ends upon the execution of the End instruction when the cycle is
stopped.
*Statement example
Statement example Explanation
Hlt ..................................................................................... Interrupt execution of the program.
If M_In(20)=1 Then Hlt ..................................................... Pauses the program if input signal bit 20 is turned on.
Mov P1 WthIf M_In(18)=1, Hlt.......................................... Pauses the program if input signal bit 18 is turned on while moving toward P1.
End................................................................................... Terminates the program even in the middle of the execution.
*Related functions
Function Explanation page
Appended statement.......................................................................... Page 274, " Wth (With)"
*System variables
M_In, M_Inb, M_Inw, M_DIn
*Statement example
Statement example Explanation
Wait M_In(1)=1 ................................................................. Waits for the input signal bit 1 to turn ON.
M1=M_Inb(20) .................................................................. Substitutes the input signal bit 20 to 27, as an 8-bit state, in numeric variable M1.
M1=M_Inw(5).................................................................... Substitutes the input signal bit 5 to 20, as an 16-bit state, in numeric variable M1.
*Related functions
Function Explanation page
Signal output ................................................................................ Page 113, "(2) Output signals"
Branching with input signal .......................................................... Page 108, "(1) Unconditional branching, conditional branching, waiting"
Interrupting with input signal ........................................................ Page 110, "(3) Interrupt"
*System variables
M_Out, M_Outb, M_Outw, M_DOut
*Statement example
Statement example Explanation
Clr 1 ........................................................................... Clears based on the output reset pattern.
M_Out(1)=1 ............................................................... Turns the output signal bit 1 ON.
M_Outb (8)=0 ............................................................ Turns the 8 bits, from output signal bit 8 to 15, OFF.
M_Outw (20)=0.......................................................... Turns the 16 bits, from output signal bit 20 to 35, OFF.
M_Out(1)=1 Dly 0.5 ................................................... Turns the output signal bit 1 ON for 0.5 seconds. (Pulse output)
M_Outb (10)=&H0F ................................................... Turns the 4 bits, from output signal bit 10 to 13 ON, and turns the four bits from 14 to 17 OFF.
*Related functions
Function Explanation page
Signal input ........................................................................................ Page 113, "(1) Input signals"
Timer .................................................................................................. Page 112, "(5) Timer"
4.1.5 Communication
Data can be exchanged with an external device, such as a personal computer.
Cannot use in CRnQ series.
*Command word
Command word Explanation
Open Opens the communication line.
Close Closes the communication line.
Print# Outputs the data in the AscII format. CR is output as the end code.
Input# Inputs the data in the AscII format. The end code is CR.
Defines the subroutine to be called when an interrupt is generated from the communication line.
On Com GoSub
The interrupt is generated when data is input from an external device.
Com On Enables the interrupt process from the communication line.
Com Off Disables the interrupt process from the communication line. The interrupt will be invalid even if it
occurs.
Com Stop Stops the interrupt process from the communication line. If there is an interrupt, it is saved, and
is executed after enabled.
*Statement example
Statement example Explanation
Open "COM1:" AS #1................................ Opens the communication line COM1 as file No. 1.
Close #1 .................................................... Closes file No. 1.
Close ......................................................... Closes all files that are open.
Print#1,"TEST" .......................................... Outputs the character string "TEST" to file No. 1.
Print#2,"M1=";M1 ...................................... Output the character string "M1=" and then the M1 value to file No. 2.
Output data example: "M1 = 1" + CR (When M1 value is 1)
Print#3,P1.................................................. Outputs the position variable P1 coordinate value to file No. 3.
Output data example: "(123.7, 238.9, 33.1, 19.3, 0, 0)(1, 0)" +CR
(When X = 123.7, Y=238.9, Z=33.1, A=19.3, B=0, C=0, FL1=1, FL2=0)
Print#1,M5,P5............................................ Outputs the numeric variable M5 value and position variable coordinate value to file No. 1.
M5 and P5 are separated with a comma (hexadecimal, 2C).
Output data example: "8, (123.7, 238.9, 33.1, 19.3, 0, 0)(1, 0)"+CR
(When M5=8, P5 X=123.7, Y=238.9, Z=33.1, A=19.3, B=0, C=0, FL1=1, FL2=0)
Input#1,M3 ................................................ Converts the input data into a value, and substitutes it in numeric variable M3.
Input data example: "8" + CR (when value 8 is to be substituted)
Input#1,P10............................................... Converts the input data into a value, and substitutes it in position variable P10.
Input data example: "8, (123.7, 238.9, 33.1, 19.3, 0, 0)(1, 0)"+CR
(P5 will be X= 123.7, Y=238.9, Z=33.1, A=19.3, B=0, C=0, FL1=1, FL2=0)
Input#1,M8,P6........................................... Converts the first data input into a value, and substitutes it in numeric variable M8. Converts the data
following the command into a coordinate value, and substitutes it in position variable P6. M8 and P6 are
separated with a comma (hexadecimal, 2C)
Input data example: "7,(123.7, 238.9, 33.1, 19.3, 0, 0)(1, 0)"+CR
(The data will be M8 = 7, P6 X=123.7, Y=238.9, Z=33.1, A=19.3, B=0, C=0, FL1=1, FL2=0)
On Com(1) GoSub *SUB3......................... Defines to call step *SUB3 subroutine when data is input in communication line COM1.
On Com(2) GoSub *RECV ........................ Defines to call subroutine at label RECV step when data is input in communication line COM2.
Com(1) On................................................. Enables the interrupt from communication line COM1.
Com(2) Off................................................. Disables (prohibits) the interrupt from communication line COM2.
Com(1) Stop .............................................. Stops (holds) the interrupt from communication line COM1.
*Related functions
Function Explanation page
Subroutine........................................................................................................ Page 111, "(4) Subroutine"
Interrupt............................................................................................................ Page 110, "(3) Interrupt"
P100 5mm In this example, the hand is moved relatively within the
robot coordinate system at teaching position P1. The val-
P1
ues of the X and Y coordinates of P2 become the amount
of movement within the robot coordinate system. The rela-
tive calculation is given by addition of the P variables.
If a value is entered for the C-axis coordinate of P2, it is
possible to change the C-axis coordinate of P100. The
Y 10mm resulting value will be the sum of the C-axis coordinate of
Rob ot coord inate system P1 and the C-axis coordinate of P2.
CAUTION)
In the example above, the explanation is made in two dimensions for the sake of simplicity. In actuality, the
calculation is made in three dimensions. In addition, the tool coordinate system changes depending on the
posture.
*Statement example
Statement example Explanation
Mov P1 Wth M_Out(20)=1................................................ Turns output signal bit 20 ON simultaneously with the start of movement to P1.
Mov P1 WITHIF M_In(20)=1, Hlt...................................... Stops if the input signal bit 20 turns ON during movement to P1.
Mov P1 WthIf M_In(19)=1, Skip ....................................... Stops movement to P1 if the input signal bit 19 turns ON during movement to P1, and
then proceeds to the next step.
*Related functions
Function Explanation page
Joint interpolation movement ............................................................. Page 93, "(1) Joint interpolation movement"
Linear interpolation movement........................................................... Page 94, "(2) Linear interpolation movement"
Circular interpolation movement ........................................................ Page 95, "(3) Circular interpolation movement"
Stopping ............................................................................................. Page 112, "(6) Stopping"
The execution of multitask operation is started by activating it from the operation panel or by a dedicated
input signal, or by executing an instruction related to multitask operation.
Program
Program
:::::
XRUN
XLOAD
XRST
XSTP
XCLR
Execution of a program
A program is executed by placing it in an item called a "slot" and running it. For example, when running
one program (when normally selecting and running the program with the controller's operation panel), the
controller system unconditionally places the program selected with the operation panel in slot 1.
1 Execution from a program This method starts parallel operation of the programs from a random
position in the program using a MELFA-BASIC IV command. The pro-
grams to be run in parallel can be designated, and a program running in
parallel can be stopped.
This method is effective when selecting the programs to be run in paral-
lel according to the program flow.
The related commands include the "XLoad (X Load)", "XRun (X Run)",
"XStp (X Stop)", "XRst (X Reset)" and "XClr (X Clear)" commands. Refer
to Page 162, "4.13 Detailed explanation of command words" in this man-
ual for details.
2 Execution from controller In this execution type, depending on the setting of the information of the
operation panel or external "SLT*" parameter, the start operation starts concurrent execution or con-
input/output signal stant concurrent execution, or starts concurrent execution at error occur-
rence. It is necessary to set the "SLT*" parameter in advance.
This method does not rely on the program flow, and is effective for carry-
ing out simultaneous execution with a preset format, or for sequential
execution.
3 Executing automatically It is possible to start constant execution immediately after turning the
when the power is turned controller's power on. If ALWAYS is specified for the start condition of
on the SLT* parameter, the program is executed in constant execution
mode immediately after the controller's power is turned on.
This eliminates the trouble of starting the programs in task slots used for
monitoring input/output signals from the PLC side.
In addition, it is possible to execute a program from within another pro-
gram that controls movement continuously. In this case, set the value of
the "ALWENA" parameter to 1 in order to execute X** instructions such
as XRun and XLoad, the Servo instruction, and the Reset instruction.
Program
selection state Program reset
Start (PSA) XRst
XRST
XRun
XRUN
Cycle stop
Running Waiting
(RUN) (WAI)
Stop
XStp
XSTP
Start
XRun
XRUN
Fig.4-2:Operation state of each slot
*Designation format
Parameter name = 1. program name, 2. operation format, 3. starting conditions, 4. order of priority
Note1) The start operation conducted from the operation panel or by sending the dedicated input signal
START will start the execution of programs of all the task slots whose start conditions are set to
"START" at the same time.
To start the program independently, start in slot units with the dedicated input signal (S1 START to
S32START). In this case, the line No. is preassigned to the same dedicated input/output parameter.
Refer to Page 477, "6.2 Sequencer link I/O function" in this manual for details on the assignment of
the dedicated input/output.
*Setting example
An example of the parameter settings for designating the following items in slot 2 is shown below.
Designation details) Program name: 5
Operation format: Continuous operation
Starting conditions: Always
Order of priority: 10
SLT2=5, REP, ALWAYS, 10
(5) The program that operates the robot is basically executed in slot 1.
The program that describes the robot arm's movement, such as with the Mov commands, is basically set
and executed in slot 1. To run the program in a slot other than slot 1, the robot arm acquisition and release
command (GetM, RelM) must be used. Refer to Page 162, "4.13 Detailed explanation of command words"
in this manual for details on the commands.
(6) How to perform the initialization processing via constantly executed programs
Programs specified in task slots whose start condition is set to ALWAYS are executed continuously (repeat-
edly) if the operation mode is set to REP. Therefore, in order to perform the initialization processing via such
programs, they should be programmed in such a way that the initialization processing is not executed more
than once, for example by setting an initialization complete flag and perform a conditional branch based on
the flag's status. (This consideration is not necessary for task programs whose operation mode is set to
CYC (1 cycle operation) because they are executed only once.)
<Process flow>
<Slot1> <Slot2> <Sensor>
Workpiece pickup P1
Data reception
Sensor start P4
Sensor start
Sensor recognition
Data reception
Above mounting P2
position Data reception
Position data
transmission
Data confirmation
Position data
setting
Workpiece mounting P20
Background execution
P1
P3 :No acceleration/deceleration
P2
P4 : No acceleration/deceleration
Position to move vision
Y
0