RCX Series: EGR7137502 E76
RCX Series: EGR7137502 E76
RCX Series: EGR7137502 E76
EGR7137502
This manual describes robot program commands and related information for using YAMAHA RCX
series robot controllers. Be sure to read this manual carefully as well as related manuals and comply
with their instructions for using the YAMAHA robot controllers safely and correctly.
For details on how to operate YAMAHA robot controllers, refer to the separate controller user's
manual that comes with the YAMAHA robot controller.
* Here, "RCX14x" does not include RCX240 and is used when there is a difference between the
RCX240 and other 4-axis controllers due to differences in software versions.
Safety precautions
Be sure to read before using
Before using the YAMAHA robot controller, be sure to read this manual and related manuals, and
follow their instructions to use the robot controller safely and correctly.
Warning and caution items listed in this manual relate to YAMAHA robot controllers.
When this robot controller is used in a robot controller system, please take appropriate safety
measures as required by the user’s individual system.
This manual classifies safety caution items and operating points into the following levels, along with
symbols for signal words “CAUTION” and “NOTE”.
c CAUTION
"CAUTION" indicates a potentially hazardous situation which, if not avoided, could
result in minor or moderate injury or damage to the equipment or software.
n NOTE
Primarily explains function differences, etc., between software versions.
MEMO
Explains robot operation procedures in a simple and clear manner.
Note that the items classified into “CAUTION” might result in serious injury depending on the
situation or environmental conditions. So always comply with CAUTION instructions since these
are essential to maintain safety.
Keep this manual carefully so that the operator can refer to it when needed. Also make sure that this
manual reaches the end user.
c CAUTION
When the program execution stops before it is complete, the program re-executes the
command that has stopped. Keep this point in mind when re-executing the program,
for example, when using an arch motion with the MOVE command, a relative
movement command such as the MOVEI or DRIVEI command, or a communication
command such as the SEND command.
CONTENTS RCX Series
Programming Manual
2 Characters 1-1
5 Identifiers 1-7
6 Comment 1-7
Chapter 2 Constants
1 Outline 2-1
Chapter 3 Variables
1 Outline 3-1
T-1
CONTENTS RCX Series
Programming Manual
T-2
CONTENTS RCX Series
Programming Manual
Chapter 6 Multi-tasking
1 Outline 6-1
T-3
CONTENTS RCX Series
Programming Manual
17 CURTRQ / CURTRQ2 Acquires the current torque of the specified axis 8-37
18 CUT Terminates another sub task which is currently being executed 8-38
T-4
CONTENTS RCX Series
Programming Manual
30 DRIVEI / DRIVEI2 Moves the specified robot axes in a relative manner 8-58
37 FOR to NEXT Performs loop processing until the variable-specified value is exceeded 8-69
46 JTOXY / JTOXY2 Performs axis unit system conversions (pulse → mm) 8-83
49 LEFTY / LEFTY2 Sets the SCARA robot hand system as a left-hand system 8-86
53 LOCx Specifies/acquires point data or shift data for a specified axis 8-92
T-5
CONTENTS RCX Series
Programming Manual
65 ONLINE Sets the specified communication port to the "online" mode 8-124
69 OUTPOS / OUTPOS2 Specifies/acquires the OUT enable position parameter of the robot 8-128
70 PATH Specifies the main robot axis PATH motion path 8-130
74 PDEF Defines the pallet used to execute pallet movement commands 8-140
75 PMOVE / PMOVE2 Executes a pallet movement command for the robot 8-141
78 PRINT Displays the specified expression value at the programming box 8-148
81 RESET Turns OFF the bits of specified ports, or clears variables 8-151
85 RIGHT$ Extracts a character string from the right end of another character string 8-155
86 RIGHTY / RIGHTY2 Sets the SCARA robot hand system to "Right" 8-156
T-6
CONTENTS RCX Series
Programming Manual
89 SELECT CASE Executes the specified command block in accordance with the 8-159
<expression> value
102 SUSPEND Temporarily stops another task which is being executed 8-174
104 TAN Acquires the tangent value for a specified value 8-176
110 TORQUE / TORQUE2 Specifies/acquires the maximum torque command value which 8-182
can be set for a specified axis
111 TRQSTS / TRQSTS2 Acquires the status when DRIVE statement ends 8-184
112 TRQTIME / TRQTIME2 Sets/acquires the time-out period for the torque limit setting option 8-185
114 WAIT Waits until the conditions of the DI/DO conditional expression are met 8-188
115 WAIT ARM / WAIT ARM2 Waits until the robot axis operation is completed 8-189
118 WHERE / WHERE2 Acquires the arm's current position (pulse coordinates) 8-192
119 WHILE to WEND Repeats an operation for as long as a condition is met 8-193
120 WHRXY / WHRXY2 Acquires the arm's current position in Cartesian coordinates 8-194
121 XYTOJ / XYTOJ2 Converts the main group axes Cartesian coordinate data ("mm") 8-195
to joint coordinate data ("pulse")
T-7
CONTENTS RCX Series
Programming Manual
2 Features 9-1
3 Restrictions 10-3
T-8
CONTENTS RCX Series
Programming Manual
15 DI file 11-33
15.1 All DI information 11-33
15.2 One DI port 11-34
16 DO file 11-35
16.1 All DO information 11-35
16.2 One DO port 11-36
17 MO file 11-37
17.1 All MO information 11-37
17.2 One MO port 11-38
18 LO file 11-39
18.1 All LO information 11-39
18.2 One LO port 11-40
T-9
CONTENTS RCX Series
Programming Manual
19 TO file 11-41
19.1 All TO information 11-41
19.2 One TO port 11-42
20 SI file 11-43
20.1 All SI information 11-43
20.2 One SI port 11-44
21 SO file 11-45
21.1 All SO information 11-45
21.2 One SI port 11-46
T-10
CONTENTS RCX Series
Programming Manual
2 Application 12-8
2.1 Pick and place between 2 points 12-8
2.2 Palletizing 12-10
2.3 Pick and place of stacked parts 12-12
2.4 Parts inspection (Multi-tasking example) 12-14
2.5 Sealing 12-17
2.6 Connection to an external device through RS-232C (example 1) 12-18
2.7 Connection to an external device through RS-232C (example 2) 12-19
T-11
CONTENTS RCX Series
Programming Manual
Chapter 14 IO commands
1 Overview 14-1
T-12
CONTENTS RCX Series
Programming Manual
Chapter 15 Appendix
1 Reserved word list 15-1
Index
T-13
Chapter 1
Writing Programs
2 Characters 3
The characters and symbols used in the YAMAHA robot language are shown below.
Only 1-byte characters can be used.
•• Alphabetic characters 4
A to Z, a to z
•• Numbers
0 to 9
•• Symbols 5
()[]+-*/^=<>&|~_%!#$:;,."'@?
•• katakana (Japanese phonetic characters)
MEMO • Katakana (Japanese phonetic characters) cannot be entered from a programming box. Katakana 6
can be used when communicating with a host computer (if it handles katakana).
• Spaces are also counted as characters (1 space = 1 character).
7
3 Program Basics
Programs are written in a "1 line = 1 command" format, and every line must contain a command.
n NOTE Blank lines (lines with no command) will cause an error when the program is compiled (creation of
••For sub-procedure details, execution objects). The program's final line, in particular, must not be blank.
refer to the "CALL" and
"SUB ~ END SUB" items.
To increase the program's efficiency, processes which are repeated within the program should be
written as subroutines or sub-procedures which can be called from the main routine. Moreover,
same processing items which occurs in multiple programs should be written as common routines
n
within a program named [COMMON], allowing those processing items to be called from multiple
NOTE programs.
••For details regarding user
defined functions, refer to
the "DEF FN" item. User functions can be defined for specific calculations. Defined user functions are easily called,
allowing even complex calculations to be easily performed.
Multi-task programs can also be used to execute multiple command statements simultaneously in a
parallel processing manner.
Using the above functions allows easy creation of programs which perform complex processing.
3 The 4 program names shown below are reserved for system operations, and programs with these
names have a special meaning.
AAA FUNCTION
4 BBB SEQUENCE
CCC _SELECT
DDD COMMON
A) FUNCTION
6 Functions Pressing the USER key in “PROGRAM” mode or “MANUAL” mode allows the
user function to be used. When user functions are used in the "PROGRAM" mode,
commands (MOVE, GOTO, etc.) which are frequently used during program editing can
be entered by function keys. When used in “MANUAL” mode, DO output is available
7 with the function keys without running the program. The FUNCTION program defines
function keys which are used to execute user functions. The desired functions can be
freely assigned to the function keys.
SAMPLE
FOR MANUAL MODE
*M_F1: DO(20)ALTERNATE
DO(20)=~DO(20) DO ( 20 ) ON/OFF highlighting
occurs when the key is pressed.
*M_F2: DO(21)ALTERNATE
DO(21)=~DO(21) DO (21) is highlighted.
:
*M_F6: DO(25)MOMENTARY
DO(25)=1 DO (25) is set to "1" when the key is pressed.
DO(25)=0 DO (25) is set to "0" when the key is released.
*M_F7: MOTION
MOVE P,P1 Movement to Point 1 occurs.
MOVE P,P2 Movement to Point 2 occurs.
:
FOR PROGRAM MODE
*P_F1: MOVE P, [MOVE P,] is written to the
program when the key is pressed.
*P_F6: MOVE L, [MOVE L,] is written to the
program when the key is pressed.
*P_F2: GOTO * [GOTO *] is written to the
program when the key is pressed.
:
Format 1
*P_F <n>: ' <character string>
Values <n> ........................................Denotes the No. of the function key being registered
(n = 1 to 15). 2
<character string>...................The character string which is registered and displayed
for the function key.
MEMO • Although up to 65 characters can be entered for a <character string>, no more than 7 characters 3
are displayed on the Menu.
SAMPLE
*P_F2 MOVE P, Registers "MOVE P," at the
4
[F2] key.
*P_F8 DELAY Registers "DELAY" at the [F8]
key.
5
●● Registering output command function keys used in the MANUAL mode
Format
6
*M_F <n>:' <character string>
<Output statement 1>
<Output statement 2>
7
Values <n>.........................................Denotes the No. of the function key being registered
(n = 1 to 15).
<character string>...................The character string which is displayed for the function
key.
<Input/output statement 1>.....Command statement which is executed when the key
is pressed.
<Input/output statement 2>.....Command statement which is executed when the key
is released
MEMO • Although up to 65 characters can be entered for a <character string>, no more than 7 characters
are displayed on the Menu.
SAMPLE
*M_F2:'MOMENT Displays "MOMENT" at the [F2]
key.
DO(20)=1 DO (20) is turned ON when the
[F2] key is pressed.
DO(20)=0 DO (20) is turned OFF when the
[F2] key is released.
*M_F14 'ALTER Displays "ALTER" at the [F14]
key.
DO(20)=~DO(20) The DO( 20 ) output status is highlighted
when the [F 14 ] key is pressed.
SAMPLE
5 DO(20)=~DI(20)
DO(25)=DI(21) AND DI(22)
MO(26)=DO(26) OR DO(25)
:
6
REFERENCE For details, see Chapter 7 "Sequence function".
Functions This function allows the user to create a program which is always selected and executed 1
when the robot program is reset. Specify a program name of "_SELECT" to use this
function. For example, if multiple programs exist, and there is a need to switch between
the programs by using DI inputs, simply create a program-switching program named "_
SELECT". Even if another program is running, the system always returns to this program 2
when a reset input occurs after that program stops. The various reset types and their
corresponding processing are as follows (also refer to the program example shown
below):
3
1. When a reset is executed from the Programming Box, a query displays, asking if
n NOTE a change to "_SELECT" is desired. If "No" is pressed, a selection screen displays,
••For details regarding the allowing the user to select whether or not a reset is to be executed.
"execution level", refer to
the controller manual.
2. When reset by the HALT command in a program, dedicated DI (reset signal) or 4
online command, the system switches to the "_SELECT" program.
3. The operation which occurs at power ON varies according to the "execution level".
If the execution level has been selected as "execute program reset at power ON", a
reset is executed at power ON, and "_SELECT" is then selected. 5
A program is selected according to the value input from DI3( ).
When DI3( ) is 0, the system repeatedly monitors the DI input.
When DI3( ) is from 1 to 3, the matching program is selected. 6
When DI3( ) is other than the above cases, the system quits the program that is
currently running.
SAMPLE
ON ERROR GOTO *ER1
7
n NOTE *ST:
••U s i n g a n O N E R R O R SELECT CASE DI3( ) Branching occurs based on the DI3 "( )" value.
statement allows running CASE 0
the program in a loop not
ending in an error even
GOTO *ST If "0", a return to "*ST" occurs,
without the program and the processing is repeated.
name specified by a SWI CASE 1
statement.
SWI <PART1> If "1"
••A n e r r o r c o d e i s s u e d
CASE 2
during execution of the
program is input into a SWI <PART2> If "2"
variable ERR. "ERR=&0303" CASE 3
means "Program doesn’t SWI <PART3> If "3"
exist".
CASE ELSE
GOTO *FIN For any other value, a jump to
"*FIN" occurs, and processing ends.
END SELECT
GOTO *ST
*FIN:
HALT
*ER1:
IF ERR=&H0303 THEN *NEXT_L A return is executed if a "no
program exists" error occurs.
ON ERROR GOTO 0 For any other error, processing ends.
*NEXT_L:
RESUME NEXT
REFERENCE For details, refer to the command explanations given in this manual.
4 SAMPLE
Program name: SAMPLE1
DECLARE SUB *DISTANCE(A!,B!,C!)
DECLARE *AREA
5 X!=2.5
Y!=1.2
CALL *DISTANCE(X!,Y!,REF C!)
GOSUB *AREA
6 PRINT C!,Z!
HALT
REFERENCE For details, refer to the command explanations given in this manual.
ignored).
■■ Up to 500 identifiers may be used.
■■ Variable names must not be the same as a reserved word, or the same as a name defined as
a system variable. Moreover, variable name character strings must begin with an alphabetic
character. For label names, however, the "*" mark may be immediately followed by a numeric 4
character.
SAMPLE
LOOP, SUBROUTINE, GET_DATA 5
REFERENCE For details regarding reserved words, see Chapter 15 "1. Reserved word list".
6
6 Comment
Characters which follow REM or an apostrophe mark (" ' ") are processed as a comment. Comment 7
statements are not executed. Moreover, comments may begin at any point in the line.
SAMPLE
REM *** MAIN PROGRAM ***
(Main program)
*** SUBROUTINE ***
(Subroutine)
HALT HALT COMMAND This comment may begin at any
point in the line.
Identifiers 1-7
7 Command Statement Format
1
Format
1 1 Outline........................................................ 2-1
2 2 Numeric constants.................................... 2-1
3 3 Character constants................................. 2-2
1 Outline
1
Constants can be divided into two main categories: "numeric types" and "character types". These
categories are further divided as shown below.
3
Binary constants
&B0 to &B11111111
Hexadecimal constants
&H80000000 to &H7FFFFFFF
Real type Single-precision real numbers
-999,999.9 to +999,999.9 4
Exponential format single-precision real numbers
-1.0*1038 to +1.0*1038
Character
type
Character
string
Alphabetic, numeric, special character, or katakana (Japanese)
character string of 75 bytes or less. 5
2 Numeric constants
6
2.1 Integer constants
111 Decimal constants 7
Integers from –1,073,741,824 to 1,073,741,823 may be used.
222 Binary constants
Unsigned binary numbers of 8 bits or less may be used. The prefix "&B" is attached to the
number to define it as a binary number.
Range: &B0 (decimal: 0) to &B11111111 (decimal: 255)
333 Hexadecimal constants
Signed hexadecimal numbers of 32 bits or less may be used. The prefix "&H" is attached to the
number to define it as a hexadecimal number.
Range: &H80000000 (decimal: -2,147,483,648) to &H7FFFFFFF (decimal: 2,147,483,647)
Outline 2-1
3 Character constants
1
Character type constants are character string data enclosed in quotation marks ("). The character
string must not exceed 75 bytes in length, and it may contain upper-case alphabetic characters,
numerals, special characters, or katakana (Japanese) characters.
2 To include a double quotation mark (") in a string, enter two double quotation marks in succession.
SAMPLE
3 "YAMAHA ROBOT"
"EXAMPLE OF""A""" EXAMPLE OF "A"
PRINT "COMPLETED"
"YAMAHA ROBOT"
4
1 1 Outline........................................................ 3-1
2 2 User Variables & System Variables.......... 3-2
3 3 Variable Names......................................... 3-3
4 4 Variable Types........................................... 3-4
5 5 Array variables.......................................... 3-5
6 6 Value Assignments.................................... 3-5
7 7 Type Conversions...................................... 3-6
8 8 Value Pass-Along & Reference Pass-Along.... 3-6
9 9 System Variables....................................... 3-7
1110Bit Settings................................................ 3-19
11 11 Valid range of variables......................... 3-20
11 12Clearing variables................................... 3-21
1 Outline
1
There are "user variables" which can be freely defined, and "system variables" which have pre-
defined names and functions.
User variables consist of "dynamic variables" and "static variables". "Dynamic variables" are cleared 2
at program editing, compiling, program resets, and program switching. "Static variables" are not
cleared unless the memory is cleared. The names of dynamic variables can be freely defined, and
array variables can also be used.
3
Variables can be used simply by specifying the variable name and type in the program. A
declaration is not necessarily required. However, array variables must be pre-defined by a DIM
statement.
5
User variables
6
Static variables Numeric type Integer variables
Output variables
Point data variables
33301-R7-00
REFERENCE For details regarding the above array, see Chapter 3 "5 Array variables".
Outline 3-1
2 User Variables & System Variables
1
2.1 User Variables
Numeric type variables consist of an "integer type" and a "real type", and these two types have
2 different usable numeric value ranges. Moreover, each of these types has different usable variables
(character string variables, array variables, etc.), and different data ranges, as shown below.
SAMPLE
COUNT Use is permitted
COUNT123 Use is permitted 4
2COUNT Use is not permitted
SAMPLE
COUNT Use is permitted
6
ABS (Reserved word)
FNAME (FN: pre-defined variable)
S91 (Sn: pre-defined variable)
7
REFERENCE For details regarding reserved words, see Chapter 15 "1 Reserved word list".
Static variables are cleared only when initializing is executed by a SYSTEM mode or online
command.
REFERENCE For details regarding the clearing of static variables, see Section "12 Clearing
variables".
4 MEMO • If no type declaration character is attached, the variable is viewed as a real type.
• Variables using the same identifier are recognized to be different from each other by the type of
each variable.
5
• ASP_DEF%............. Integer variable
• ASP_DEF................ Real variable )
→ ASP_DEF% and ASP_DEF are different variables.
SAMPLE 6
A%(1) Integer array variable
DATA!(1,10,3) Single-precision real number array
STRING$(10)
variable (3-dimension array)
Character array variable
7
6 Value Assignments
MEMO • "LET" directly specifies an assignment statement, and it can always be omitted.
Format
Write the value assignment target variable on the left side, and write the assignment value or the
<expression> on the right side. The <expression> may be a constant, a variable, or an arithmetic
expression, etc.
6 Value pass-along
With this method, the variable's value is passed along to the sub-procedure. Even if this value is
changed within the sub-procedure, the content of the call source variable is not changed.
7 A value pass-along occurs when the CALL statement's actual argument specifies a constant, an
expression, a variable, or an array element (array name followed by (<subscript>)).
Reference pass-along
With this method, the variable's reference (address in memory) is passed along to the sub-
procedure. If this value is changed within the sub-procedure, the content of the call source variable
is also changed.
A reference pass-along occurs when the CALL statement's actual argument specifies an entire array
(an array named followed by parenthetical content), or when the actual argument is preceded by
"REF".
X%=5 X%=5
CALL *TEST( X% ) CALL *TEST( REF X% )
PRINT X% PRINT X%
HALT HALT
SUB ROUTINE SUB ROUTINE
SUB *TEST( A% ) SUB *TEST( A% )
A%=A%*10 A%=A%*10
END SUB END SUB
Execution result: the X% value remains as "5". Execution result: the X% value becomes "50".
33302-R7-00
Format
Examples: P0
P110
P[A]
P[START_POINT]
P[A(10)]
Format
Sn or S "["<expression>"]"
2
Values n: Shift number ...................... 0 to 9
Each bracket in quotation marks ("[" "]") must be written. Brackets are not used to
indicate an item that may be omitted.
3
Functions A shift number is expressed with an 'S' followed by a 1-digit number or an expression
surrounded by brackets ("[" <expression> "]").
4 Examples: S1
S[A]
S[BASE]
S[A(10)]
5
MEMO • The "shift coordinate range" for each shift number can be changed from the programming box.
n NOTE
••W H R X Y / W H R X Y 2 a r e
available from following
software version.
RCX14x version 8.64 onwards
RCX22x version 9.11 onwards
Format
Format 1
6 DIm([b, ,b])
Format 2
7 DI(mb, ,mb)
Examples: A%=DI1()
Input status of ports DI(17) to DI(10)
is assigned to variable A%.
A 0 to 255 integer can be assigned to A%.
A%=DI5(7,4,0)
Input status of DI(57), DI(54) and
DI(50) is assigned to variable A%.
(If all above signals are 1(ON), then A%=7.)
A%=DI(27,15,10)
Input status of DI(27), DI(15) and
DI(10) is assigned to variable A%.
(If all above signals except DI(10) are 1 (ON), then A%=6.)
WAIT DI(21)=1
Waits for DI(21) to change to 1(ON).
MEMO • When specifying multiple bits, specify them from left to right in descending order (large to
small).
• A '0' is entered if there is no actual input board.
DOm([b, ,b])
2
Format 2
DO(mb, ,mb)
3
Values m : port number ..................... 0 to 7, 10 to 17, 20 to 27
b : bit definition ..................... 0 to 7
If the bit definition is omitted, bits 0 to 7 are all selected.
4
Examples: A%=DO2()
Output status of DO(27) to DO(20) is
assigned to variable A%.
A%=DO5(7,4,0) 5
Output status of DO(57), DO(54) and
DO(50) is assigned to variable A%.
(If all above signals are 1(ON), then A%=7.)
A%=DO(37,25,20) 6
Output status of DO(37), DO(25) and
DO(20) is assigned to variable A%.
(If all above signals except DO(20) are 1
(ON), then A%=6.) 7
DO3 =B%
Changes to a status in which the DO(37)
to DO(30) output can be indicated by B%.
For example, if B% is "123": If a binary
number is used, "123" will become
"01111011", DO(37) and DO(32) will become
"0", and the other bits will become "1".
DO4(5,4,0)=&B101
DO(45) and DO(40) become "1", and DO(44) becomes "0".
MEMO • When specifying multiple bits, specify them from left to right in descending order (large to
small).
• A '0' is entered if there is no actual input board.
Format 1
MOm([b, ,b])
2
Format 2
MO(mb, ,mb)
3
Values m : port number ..................... 0 to 7, 10 to 17, 20 to27
b : bit definition ..................... 0 to 7
• If the bit definition is omitted, bits 0 to 7 are all selected.
4
Functions Internal output variables which are used only in the controller, can be changed and referenced.
These variables are used for signal communications, etc., with the sequence program.
Ports 0 and 1 are for dedicated internal output variables which can only be referenced
5 (they cannot be changed).
111 Port 0 indicates the status of origin sensors for axes 1 to 8 (in order from bit 0).
Each bit sets to '1' when the origin sensor turns ON, and to '0' when OFF.
6 222 Port 1 indicates the HOLD status of axes 1 to 8 (in order from bit 0).
Each bit sets to '1' when the axis is in HOLD status, and to '0' when not.
Bit 7 6 5 4 3 2 1 0
7 Port 0 Axis 8 Axis 7 Axis 6 Axis 5 Axis 4 Axis 3 Axis 2 Axis 1
Origin sensor statuses 0: OFF / 1: ON
Port 1 Axis 8 Axis 7 Axis 6 Axis 5 Axis 4 Axis 3 Axis 2 Axis 1
Hold status 0: RELEASE / 1: HOLD (Axis 1 is not used)
Examples: A%=MO2 ()
Internal output status of MO(27) to
MO(20) is assigned to variable A%.
A%=MO5(7,4,0)
Internal output status of MO(57), MO(54)
and MO(50) is assigned to variable A%.
(If all above signals are 1 (ON), then A%=7.)
A%=MO(37,25,20)
Internal output status of MO(37), MO(25)
and MO(20) is assigned to variable A%.
(If all above signals except MO(25) are 1 (ON), then A%=5.)
MEMO • When specifying multiple bits, specify them from left to right in descending order (large to small).
LOm([b, ,b])
2
Format 2
LO(mb, ,mb)
3
Values m : port number ..................... 0
b : bit definition ..................... 0 to 7
• If the bit definition is omitted, bits 0 to 7 are all selected.
4
Functions The contents of this variable can be output and referred to as needed.
There is only 1 port, and bits 0 to 7 respectively correspond to axes 1 to 8.
When this bit is ON, movement on the corresponding axis is prohibited.
5
Examples: A%=LO0()
Arm lock status of LO(07) to LO(00) is
assigned to variable A%.
A%=LO0(7,4,0) 6
Arm lock status of LO(07), LO(04) and
LO(00) is assigned to variable A%.
(If all above signals are 1 (ON), then A%=7.)
A%=LO0(06,04,01) 7
Arm lock status of LO(06), LO(04) and
LO(01) is assigned to variable A%.
(If all above signals except LO(01) are 1
(ON), then A%=6.)
MEMO • When specifying multiple bits, specify them from left to right in descending order (large to
small).
• Servo OFF to ON switching is disabled if an arm lock is in effect at even 1 axis.
• When performing JOG movement in the MANUAL mode, axis movement is possible at axes
where an arm lock status is not in effect, even if an arm lock status is in effect at another axis.
• When executing movement commands from the program, etc., the "12.3 XX.Arm lock" error
will occur if an arm lock status is in effect at the axis in question. (XX: arm lock enabled axis.
Example: M1 S1)
Format 1
TOm([b, ,b])
2
Format 2
TO(mb, ,mb)
3
Values m : port number ..................... 0
b : bit definition ..................... 0 to 7
• If the bit definition is omitted, bits 0 to 7 are all selected.
4
Functions The contents of this variable can be changed and referred to as needed.
Timer function can be used only in the sequence program. If this variable is output in a
normal program, it is an internal output.
5
For details regarding sequence program usage examples, refer to the timer usage examples given in
Chapter 7 "4.2 Input/output variables".
6 Examples: A%=TO0()
Status of TO(07) to TO(00) is assigned
to variable A%.
A%=TO0(7,4,0)
7 Status of TO(07), TO(04) and TO(00) is
assigned to variable A%.
(If all above signals are 1 (ON), then A%=7.)
A%=TO(06,04,01)
Status of TO(06), TO(04) and TO(01) is
assigned to variable A%.
(If all above signals except TO(01) are 1
(ON), then A%=6.)
MEMO • When specifying multiple bits, specify them from left to right in descending order (large to
small).
SIm([b, ,b])
2
Format 2
SI(mb, ,mb
3
Values m : port number ..................... 0 to 7, 10 to 17, 20 to 27
b : bit definition ..................... 0 to 7
• If the bit definition is omitted, bits 0 to 7 are all selected.
4
Examples: A%=SI1()
Input status of ports SI(17) to SI(10)
is assigned to variable A%.
A%=SI5(7,4,0) 5
Input status of SI(57), SI(54) and
SI(50) is assigned to variable A%.
(If all above signals are 1(ON), then A%=7.)
A%=SI(27,15,10) 6
Input status of SI(27), SI(15) and
SI(10) is assigned to variable A%.
(If all above signals except SI(10) are 1
(ON), then A%=6.) 7
WAIT SI(21)=1
Waits until SI(21) sets to 1 (ON).
MEMO • When specifying multiple bits, specify them from left to right in descending order (large to
small).
• A '0' is entered if there is no actual serial board.
Format 1
SOm([b, ,b])
2
Format 2
SO(mb, ,mb)
3
Values m : port number ..................... 0 to 7, 10 to 17, 20 to 27
b : bit definition ..................... 0 to 7
• If the bit definition is omitted, bits 0 to 7 are all selected.
4
Examples: A%=SO2()
Output status of SO(27) to SO(20) is
assigned to variable A%.
5 A%=SO5(7,4,0)
Output status of SO(57), SO(54) and
SO(50) is assigned to variable A%.
(If all above signals are 1(ON), then A%=7.)
6 A%=SO(37,25,20)
Output status of SO(37), SO(25) and
SO(20) is assigned to variable A%.
(If all above signals except SO(25) are 1
7 (ON), then A%=5.)
SO3()=B%
Changes to a status in which the DO(37)
to DO(30) output can be indicated by B%.
For example, if B% is "123": If a binary
number is used, "123" will become
"01111011", DO(37) and DO(32) will become
"0", and the other bits will become "1".
SO4(5,4,0)=&B101
DO(45) and DO(40) become "1", and DO(44) becomes "0".
MEMO • When specifying multiple bits, specify them from left to right in descending order (large to
small).
• External output is unavailable if the serial port does not actually exist.
SIW(m)
2
n NOTE Values m : Port No. 2 to 15
••T h e s e r i a l w o r d i n p u t The acquisition range is 0 (&H0000) to 65535 (&HFFFF).
function is available from
software version 8.08
onwards. Examples: A%=SIW(2) 3
The input state from SIW (2) is
assigned to variable A%.
A%=SIW(15)
The input state from SIW (15) is 4
assigned to variable A%.
Format
SID(m)
7
Format
SOW(m)
2
n NOTE Values m : Port No. 2 to 15
••The serial word output The output range is 0 (&H0000) to 65535 (&HFFFF).
function is available from
Note that if a negative value is output, the low-order word information will be output
3 software version 8.08
onwards. after being converted to hexadecimal.
Examples: A%=SOW(2)
The output status from SOW (2) is
4 assigned to variable A%.
SOW(15)=A%
The contents of variable A% are
assigned in SOW (15).
5 If the variable A% value exceeds the output range,
the low-order word information will be assigned.
SOW(15)=-255
The contents of -255 (&HFFFFFF01) are
6 assigned to SOW (15).
-255 is a negative value, so the low-order
word information (&HFF01) will be assigned.
Format
SOD(m)
1. Single bit
2
To specify only 1 of the bits, the target port number and bit number are specified in parentheses.
The port number may also be specified outside the parentheses.
To specify multiple bits at different ports, the port number and the 2-digit bit number must be 7
specified in parentheses and must be separated by commas.
To specify all bits of a single port, use parentheses after the port number. Methods 2 and 3 shown
above can also be used.
MEMO • For details regarding arrays, refer to Chapter 3 "5 Array variables".
• A variable declared at the program level can be referenced from a sub-procedure without
being passed along as a dummy argument, by using the SHARED statement (for details, refer to
Chapter 8 "91 SHARED").
MEMO • Static variable values are not cleared even if the program is edited.
When a "remainder" (MOD) operation involves real numbers, the decimal value is rounded off to 4
the nearest whole number which is then converted to an integer before the calculation is executed.
The result represents the remainder of an integer division operation.
MEMO • When using equivalence relational operators with real variables and real arrays, the desired
result may not be obtained due to the round-off error.
Examples:..............................A=2
B=SQR(A!)
IF A!=B!*B! THEN...
→ In this case, A! will be unequal to B!*B!.
Depending on the logic operation performed, the results generated are either 0 or 1.
2
■■
■■ Logic operations with real numbers convert the values into integers before they are executed.
4
Examples: A%=NOT 13.05 → "-14" is assigned to A% (reversed after being rounded off to 13).
Bit 7 6 5 4 3 2 1 0
5 13 0 0 0 0 1 1 0 1
NOT 13=-14 1 1 1 1 0 0 1 0
Bit 7 6 5 4 3 2 1 0
3 0 0 0 0 0 0 1 1
10 0 0 0 0 1 0 1 0
3 OR 10 = 11 0 0 0 0 1 0 1 1
Bit 7 6 5 4 3 2 1 0
3 0 0 0 0 0 0 1 1
10 0 0 0 0 1 0 1 0
3 OR 10 = 11 0 0 0 0 1 0 0 1
111 When a real number is assigned to an integer, decimal places are rounded off.
7
Examples: A%=125.67 → A%=126
222 When integers and real numbers are involved in the same operation, the result
becomes a real number.
333 When an integer is divided by an integer, the result is an integer with the remainder
discarded.
Examples: "AA"<"AB"
"X&">"X#"
"DESK"<"DESKS"
To set extended X-arm and Y-arm rotation information at the YK500TW model robot, a "-1", "0",
or "1" value must be specified after the hand system flag. Any other value, or no value, will be
processed as "0".
*1: The joint-coordinates-converted pulse data represents each arm's distance (converted to angular
data) from its mechanical origin point.
•• Constant
Decimal integer constant, binary integer constant, hexadecimal integer constant
3 •• Variables
Global integer type, global real number type, input/output type
•• Operators
Relational operators, logic operators
4 •• Operation priority
1. Relational operators
2. NOT, ~
3. AND, &
5 4. OR, |, XOR
1 1 Overview.................................................... 5-1
2 2 Command list for each group.................. 5-2
1 Overview
1
The YAMAHA robot RCX controller can be used to control multiple robots.
The multitask function also enables multiple robots to move asynchronously.
To use this function, settings for two robots or settings for auxiliary axes must be made in the system
prior to shipment. 2
A robot axis is classified into one of the groups below.
■■ Main group (6 axes) + sub-group (2 axes) (when using the YC-LINK option)
■■ Main group (4 axes) + sub-group (4 axes) (when using the YC-LINK option)
■■ Main group (2 axes) + sub-group (2 axes)
■■ Main group (3 axes) + sub-group (3 axes)
(This setting is possible only when using the YC-LINK option and a compatible software version: 4
Ver.8.69 or newer for RCX14x, and Ver.9.16 or newer for RCX22x.)
A main group is composed of one main robot and main auxiliary axes, and a sub group is composed
of one sub robot and sub auxiliary axes. 5
When using one robot without auxiliary axis, settings are made only for the main group robot.
When no settings have been made for main auxiliary axes and sub auxiliary axes, the main group is
composed only of the one main robot, and the sub group is composed only of the one sub robot.
Axes configuration
6
1. For main group only
Main group
Main robot Main auxiliary axis 7
(Number of axes: 1 to 4) (Number of axes: 1 to 4)
Main group
Main robot Main auxiliary axis
(Number of axes: 1 or 2) (Number of axes: 1 or 2)
sub-group
Sub robot Sub auxiliary axis
(Number of axes: 1 or 2) (Number of axes: 1 or 2)
Main group
Main robot Main auxiliary axis
(Number of axes: 1 to 4) (None)
4. When no main additional axes & sub additional axes are set
Main group
Main robot Main auxiliary axis
(Number of axes: 1 or 2) (None)
sub-group
Sub robot Sub auxiliary axis
(Number of axes: 1 or 2) (None)
33501-R7-00
Overview 5-1
2 Command list for each group
1
The special commands and functions for robot movement and coordinate control are shown below.
4
ASPEED AXWEIGHT ASPEED2 AXWEIGHT2
DECEL ORGORD DECEL2 ORGORD2
OUTPOS SPEED OUTPOS2 SPEED2
TOLE WEIGHT TOLE2 WEIGHT2
Point operation JTOXY WHERE JTOXY2 WHERE2
5 XYTOJ WXTOJ2
Parameter reference ACCEL ARCH ACCEL2 ARCH2
AXWEIGHT DECEL AXWEIGHT2 DECEL2
ORGORD OUTPOS ORGORD2 OUTPOS2
TOLE WEIGHT TOLE2 WEIGHT2
6 Status reference ABSRPOS ARMCND ABSRPOS2 ARMCND2
ARMTYPE MCHREF ARMTYPE2 MCHREF2
PATH control PATH PATH END
PATH SET PATH START
7 Torque control DRIVE (with torque limit setting DRIVE2 (with torque limit setting
option) option)
TORQUE TRQSTS TORQUE2 TRQSTS2
TRQTIME CURTRQ TRQTIME2 CURTRQ2
■■ MOVE, MOVEI commands are used at main robot operations, and MOVE2, MOVEI2 commands
are used at sub-robot operations.
■■ An axis specified as an auxiliary axis cannot be moved with the MOVE (MOVE2), MOVEI
(MOVEI2) and PMOVE (PMOVE2) commands. Use the DRIVE (DRIVE2) or DRIVEI (DRIVEI2)
command to move it.
■■ When specifying all axes with the SERVO or SERVO2 command, the servos of all axes in the
main group and sub group can be switched ON or OFF.
MEMO • The restrictions shown below apply to the following software versions: RCX14x…version prior
to Ver.8.64; RCX22x…versions prior to Ver.9.11.
• The MOVE statement's linear and circular interpolations are only possible at Task 1 (main task)
and by direct command.
• The MOVE2 statement can be used only for PTP control. It cannot be used for linear and
circular interpolations.
1 1 Outline........................................................ 6-1
2 2 Task definition............................................ 6-1
3 3 Task status and transition.......................... 6-2
4 4 Multi-task program example................... 6-8
5 5 Sharing the data........................................ 6-8
6 6 Cautionary Items....................................... 6-9
1 Outline
1
The multi-task function performs multiple processing simultaneously in a parallel manner, and can
be used to create programs of higher complexity. Before using the multi-tasking function, read this
section thoroughly and make sure that you fully understand its contents.
Multi-tasking allows executing two or more tasks in parallel. However, this does not mean that 2
multiple tasks are executed simultaneously because the controller has only one CPU to execute the
tasks. In multi-tasking, the CPU time is shared among multiple tasks by assigning a priority to each
task so that they can be executed efficiently.
3
■■ A maximum of 8 tasks (task 1 to task 8) can be executed in one program.
■■ Tasks can be prioritized and executed in their priority order (higher priority tasks are executed first).
■■ The priority level of task 1 is fixed at 32, while the priority of task 2 to task 8 can be set to any
level between 17 and 47. 4
■■ Smaller values have higher priority, and larger values have lower priority
(High priority: 17 ⇔ 47: low priority).
MEMO • In RCX14x software version prior to Ver.8.64, and in RCX22x software versions prior to Ver.9.11, 5
the MOVE statement's linear and circular interpolations are possible only at Task 1 (main task).
2 Task definition 6
A task is a set of instructions within a program which are executed as a single sequence. As
explained below, a task is defined by assigning a label to it.
7
1. Assign a label to the first line of the command block which is to be defined as a task.
2. At the Task 1 (main task) START statement, specify the label which was assigned at step 1
above. Task Nos. are then assigned, and the program starts.
The task definition may call for 2 to 8 subtasks. Task 1 (main task) is automatically defined.
MEMO • Although all tasks are written within a single program, parallel processing occurs at each of the tasks.
SAMPLE
MAIN TASK(TASK1)
START *IOTASK,T2 *IOTASK is started as Task 2
*ST1:
MOVE P,P1,P0
IF DI(20)= 1 THEN
HALT
ENDIF
GOTO *ST
HALT
SUB TASK(TASK2)
*IOTASK: Task 2 begins from here
IF DI(21)=1 THEN
DO(30)=1
ELSE
DO(30)=0
ENDIF
GOTO *IOTASK Task 2 processing ends here
EXIT TASK
Outline 6-1
3 Task status and transition
1
There are 6 types of task status.
CPU assignment
6
Resume Cancel waiting Wait condition
7 Suspend
STOP
Delete Call
NON EXISTEN
33601-R7-00
MEMO • The RESTART, SUSPEND, EXIT TASK, and CUT commands cannot be executed at Task 1.
Task scheduling
4
Priority level
The head of the task with the highest priority
Task 1 is put in RUN status.
5
High
32
Task 1 Task 3 Task 4 Ready queue 1
33
Task 5 Ready queue 2 6
34
Task 2 Ready queue 3
Low
Order in which tasks are put in READY status.
7
33602-R7-00
A RUN status task will be moved to the end of the ready queue if placed in a READY status by any
of the following causes:
1) A WAIT status command was executed.
n NOTE 2) The CPU occupation time exceeds a specified time.
••When the prescribed CPU 3) A task with a higher priority level is put in READY status.
occupation time elapses,
the active command is Ready queue
ended, and processing
moves to the next task.
1 RUN status READY status
However, if there are no
other tasks of the same
or higher priority (same
or higher ready queue), Task 1 Task 3 Task 4
the same task will be
executed again.
2 Moves to the end of the ready queue, and Task 3 is executed.
Execution sequence
33603-R7-00
2 111 When a command causing a wait status is executed, the following transition happens.
■■ Task for which a command causing a wait status is executed → WAIT status
■■ Task at the head of the ready queue with higher priority → RUN status
3 MEMO • For example, when a MOVE statement (a command that establishes a WAIT status)
is executed, the CPU sends a "MOVE" instruction to the driver, and then waits for a
"MOVE COMPLETED" reply from the driver. This is a "waiting for an event" status.
In this case, a WAIT status is established at the task which executed the MOVE command, and that
4 task is moved to the end of the ready queue. A RUN status is then established at the next task.
5
n NOTE 222 When an event waited by the task in the WAIT status occurs, the following status
transition takes place by task scheduling.
••If multiple tasks are in
WAIT status awaiting the ■■ Task in the WAIT status for which the awaited event occurred → READY status
same condition event, or However, if the task put in the READY status was at the head of the ready queue with the
different condition events
occur simultaneously, all highest priority, the following transition takes place.
6 tasks for which the waited
events occur are put in
1) Task that is currently in RUN status → READY status
2) Task at the head of the ready queue with higher priority → RUN status
READY status.
MEMO • In the above MOVE statement example, the task is moved to the end of the ready queue. Then,
7 when a "MOVE COMPLETED" reply is received, this task is placed in READY status.
Event Command
Wait for axis Axis movement MOVE MOVEI MOVE2 MOVEI2
movement to command DRIVE DRIVEI DRIVE2 DRIVEI2
complete PMOVE PMOVE2 SERVO SERVO2
WAIT ARM WAIT ARM2
Parameter ACCEL ACCEL2 ARCH ARCH2
command AXWEIGHT AXWEIGHT2 DECEL DECEL2
OUTPOS OUTPOS2 TOLE TOLE2
ORGORD ORGORD2 WEIGHT WEIGHT2
Robot status CHANGE CHANGE2 SHIFT SHIFT2
change command LEFTY LEFTY2 RIGHTY RIGHTY2
ASPEED ASPEED2 SPEED SPEED2
Wait for time to elapse DELAY, SET (Time should be specified.), WAIT (Time
should be specified.)
Wait for condition to be met WAIT
Wait for data to send or to be received SEND
Wait for print buffer to become empty PRINT
Wait for key input INPUT
MEMO • The tasks are not put in WAIT status if the event has been established before the above
commands are executed.
3
SUSPEND
5
3.5 Restarting tasks (RESTART)
Tasks in the SUSPEND status can be restarted with the RESTART command. However, the RESTART 6
command cannot be used for task 1.
When the RESTART command is executed, the status transition takes place as follows.
■■ Task for which the RESTART command was executed → RUN status 7
■■ Specified task → READY status
RESTART
Tasks can delete themselves by using the EXIT TASK command and set to the NON EXISTEN (no
task registration) status. The EXIT TASK command cannot be used for task 1.
2 When the EXIT TASK command is executed, the status transition takes place as follows.
■■ Task that executed the EXIT TASK command → NON EXISTEN status
Task at the head of the ready queue with higher priority → RUN status
3
■■
EXIT TASK
33606-R7-00
A task can also be deleted and put in the NON EXISTEN (no task registration) status by the other
tasks using the CUT command. The CUT command cannot be used for task 1.
7 When the CUT command is executed, the status transition takes place as follows.
CUT
MEMO • If a SUSPEND command is executed for a WAIT-status task, the commands being executed by
that task are ended.
• None of these commands can be executed for Task 1.
MEMO • When the program is restarted without being reset after the tasks have been stopped by a cause 6
other than 1., then each task is processed from the status in which the task stopped. This holds
true when the power to the controller is turned off and then turned on.
SAMPLE
2 TASK1
START *ST2,T2
START *ST3,T3
*ST1:
3 DO(20) = 1
WAIT MO(20) = 1
MOVE P,P1,P2,Z=0
IF MO(21)=1 THEN *FIN
4 GOTO *ST1
*FIN:
CUT T2
HALT
5 TASK2
*ST2: Task 2 begins here.
IF DI(20) = 1
MO(20) = 1
6 DELAY 100
ELSE
MO(20) = 0
ENDIF
7 GOTO *ST2
EXIT TASK Ends here.
TASK3 Task 3 begins here.
*ST3:
IF DI(21) = 0 THEN *ST3
IF DI(30) = 0 THEN *ST3
IF DI(33) = 0 THEN *ST3
MO(21) = 1
EXIT TASK Ends here.
Point data, shift coordinate definition data, hand definition data, pallet definition data, all global
variables and other variables are shared between all tasks.
Execution of each task can be controlled while using the same variables and data shared with the
other tasks.
MEMO • In this case, however, use sufficient caution when rewriting the variable and data because
improper changes may cause trouble in the task processing.
SAMPLE
4
FLAG1 = 0
*MAIN_TASK:
IF FLAG1=0 THEN 5
FLAG1 = 1
START *TASK2,T2,31 Task 2 (*TASK2) is started at the
priority level of 31.
ENDIF 6
GOTO *MAIN_TASK
'==============
' TASK2
'============== 7
*TASK2:
DRIVE(1,P1)
WAIT ARM(1)
DRIVE(1,P2)
WAIT ARM(1)
FLAG1 = 0
EXIT TASK
HALT
34701-R7-00
34702-R7-00
4
2.2 Compiling
After editing the program, it must be compiled as a sequence program. Compiling is performed in
5 the same way as for robot programs. Press the F5 key on the highest-level screen in "PROGRAM"
mode.
Sequence program
34703-R7-00
A check message appears asking if you want to compile the sequence program. Press the F4 key
to compile the program. To cancel this compiling, press the F5 key. The display changes to the
compiling screen for normal robot programs.
Press the F4 key to compile the sequence program.
Compile the sequence program before compiling the main program.
34704-R7-00
34705-R7-00 4
MEMO • The sequence execution program is erased and the letter "s" disappears in the following cases.
In these cases the sequence function cannot be used in "UTILITY" mode. 5
1. When the sequence program was erased
2. When the sequence program was edited
3. When normal robot program compiling was performed for the sequence program 6
(The same processing occurs even if the mode is changed to AUTO while in the SEQUENCE
program is selected.)
4. Program data was initialized.
5. A "9.39: Sequence object destroyed.
7
When you display the directory after the compiling the sequence program, a letter "s" appears
to the left of the program name "SEQUENCE". This means that the sequence program has been
compiled successfully and is ready for use.
34706-R7-00
When all of the above conditions are met, the sequence program can now be executed. While the
program is running, the letter "s" will appear at the left end of the second line of the screen.
4 Sequence program execution in progress
6
34707-R7-00
7 For details regarding the UTILITY mode setting procedure, refer to the controller manual.
32708-R7-00
Format
3
<output variable> =<expression>
<internal auxiliary output variable>
<arm lock output variable>
<timer output variable>
4
Values <expression> ......................... Any one of the following can be used.
• Parallel input/output variables
• Internal auxiliary output variables 5
• Arm lock output variables
• Timer output variables
• Serial input/output variable
• The logic operation expression shown above 6
4.2 Input/output variables
Each variable must be specified in a 1-bit format 7
Correct examples DO(35)
MO(24)
DI(16)
Incorrect examples DO(37, 24)
DI3(4)
MO3()
Format
Format
A parallel output is specified, or the output status is referenced. Ports 0 and 1 are for referencing
only, and no outputs can occur there.
1 Format
2 These variables are used within the controller and are not output externally. Ports 0 and 1 are for
referencing only, and no outputs can occur there.
Format
There are a total of 8 timer output variables: TO(00) to TO(07). The timer of each variable is
defined by the timer definition statement TIM00 to 07.
7
●● Serial input variables
Format
Indicates a serial input signal status. Only referencing can occur. No settings are possible.
Format
Sets or references a serial output signal status. Ports 0 and 1 are for referencing only, and no
outputs can occur there.
DI(23)
4
1.6sec
2.5sec
TO(02) 5
33701-R7-00
Meaning The timer definition statement sets the timer value of the timer output variable. This
definition statement may be anywhere in the program.
When the timer definition statement is omitted, the timer setting value of the variable is 0.
TIM00 to 07 correspond to the timer output variables TO(00) to (07).
However, since the units are set every 100msec, values less than 99msec are truncated.
Ladder diagram
5
DI(16) DO(35) DO(23)
DO(25) MO(34)
6 ~DI(24)
33702-R7-00
MEMO • NOT cannot be used prior to the first parenthesis " ( " or on the left of an expression. For
example, the following commands cannot be used.
•DO(21)=~(DI(30) | DI(32))
•~DO(30)=DI(22)&DI(27)
• Numeric values cannot be assigned on the right of an expression.
•MO(35)=1
•DO(26)=0
• There is no need to define a "HALT" or "HOLD" statement at the end of the program.
• The I/O and internal auxiliary output variables used in sequence programs are shared with
robot programs, so be careful not to make improper changes when using the same variables
between them.
(1) No. 10
Indicates the Item No. where this robot language is explained in detail.
27 DIM
Declares array variable
Format
MEMO • Array subscripts can be "0 to a specified value", with their total number being the <constant> + 1.
14
• A "9.31: Memory full" error may occur depending on the size of each dimension in an
array.
SAMPLE
DIM A%(10) Defines a integer array
variable A% ( 0 ) to A% ( 10 ).
(Number of elements: 11).
DIM B(2,3,4) Defines a real array variable
15
B (0, 0, 0) to B (2, 3, 4).
(Number of elements: 60).
DIM C%(2,2),D!(10) Defines an integer array C%
(0,0) to C% (2,2) and a real
array D! (0) to D! (10).
(2) Function
Explains the function of the robot language.
(3) Condition
Lists the conditions under which command execution is enabled.
Condition 1: Commands that can be executed by both direct commands and online commands.
Condition 2: In addition to Condition 1, commands that execute task 1 (main task) only.
Condition 3: I n addition to condition 1, commands containing operands that cannot be
executed by direct commands or online commands.
Condition 4: In addition to condition 1, commands which are executed after positioning is completed.
Condition 5: MOVE L and MOVE C can be executed by both direct commands and online
commands, although they are executed after positioning is completed.
The STOPON option cannot be executed by direct commands and online commands.
Condition 6: Commands that cannot be executed by direct commands and online commands.
Regarding robot languages which can be used as both commands and functions, the "execution
enabled" conditions for a "command execution" may differ from those for a "function execution".
In such cases, the respective conditions for the command and function are divided by a slash mark (/).
For example, if condition 4 is applies for a "Command", but there are no conditions for the
"Function", this would be expressed as follows: 4/-
9 (5) Type
Indicates the robot language type as "Command" or "Function".
When a command is used as both a "Command" and "Function", this is expressed as follows:
Command/Function
10
11
12
13
14
15
A
1 ABS Acquires the absolute value of a specified value. - - Functions
9
2 ABSINIT Resets the current position of a specified main group axis. 4 Command Statements
2 ABSINIT2 Resets the current position of a specified sub group axis. 4 Command Statements
3 ABSRPOS Acquires the machine reference of the specified
main group axis. (Valid only for axes where the
- - Functions
10
return-to-origin method is set as "mark method".)
3 ABSRPOS2 Acquires the machine reference of the specified sub - - Functions
group axis. (Valid only for axes where the return-to-
4 ABSRST
origin method is set as "mark method".)
Executes a return-to-origin at the robot absolute 4 Command Statements
11
motor axes.
5 ACCEL Specifies/acquires the acceleration coefficient 4/- Command Statements/
parameter of the main group. Functions
5 ACCEL2 Specifies/acquires the acceleration coefficient 4/- Command Statements/ 12
parameter of the sub group. Functions
6 ARCH Specifies/acquires the arch position parameter of the 4/- Command Statements/
main group. Functions
6 ARCH2 Specifies/acquires the arch position parameter of the
sub group.
4/- Command Statements/
Functions
13
7 ARMCND Acquires the current arm status of the main robot. - - Functions
7 ARMCND2 Acquires the current arm status of the sub robot. - - Functions
8
8
ARMTYPE
ARMTYPE2
Acquires the current "hand system" setting of the main robot.
Acquires the current "hand system" setting of the sub robot.
-
-
-
-
Functions
Functions
14
10 ASPEED Changes the AUTO movement speed of the main group. 4 Command Statements
10 ASPEED2 Changes the AUTO movement speed of the sub group. 4 Command Statements
9 ATN Acquires the arctangent of the specified value. - - Functions 15
9 ATN2 Acquires the arctangent of the specified X-Y - - Functions
coordinates.
11 AXWGHT Specifies/acquires the axis tip weight parameter of 4/- Command Statements/
the main group. Functions
11 AXWGHT2 Specifies/acquires the axis tip weight parameter of 4/- Command Statements/
the sub group. Functions
C
12 CALL Executes (calls) another program. 6 Command Statements
13 CHANGE Switches the main robot hand. 4 Command Statements
13 CHANGE2 Switches the sub robot hand. 4 Command Statements
14 CHGPRI Changes the priority ranking of a specified task. 6 Command Statements
15 CHR$ Acquires a character with the specified character code. - - Functions
16 COS Acquires the cosine value of a specified value. - - Functions
17 CURTRQ Acquires the current torque value of the specified - Functions
main group axis.
17 CURTRQ2 Acquires the current torque value of the specified - Functions
sub group axis.
18 CUT Terminates a task currently being executed or 6 Command Statements
temporarily stopped.
D
19 DATE$ Acquires the date as a "yy/mm/dd" format character string. - - Functions
9
23 DEGRAD Converts a specified value to radians (↔RADDEG). - - Functions
24 DELAY Waits for the specified period (units: ms). 6 Command Statements
27 DIM Declares the array variable name and the number of 6 Command Statements
elements.
26 DIST Acquires the distance between 2 specified points. - - Functions
10 28 DO Outputs a specified value to the DO port. 1 Command Statements
29 DRIVE Moves a specified main group axis to an absolute position. 4 Command Statements
29 DRIVE (With T-option) Executes an absolute movement 4 Command Statements
command for a specified axis.
11 29 DRIVE2 Moves a specified sub group axis to an absolute position. 4 Command Statements
30 DRIVEI Moves a specified main group axis to a relative position. 4 Command Statements
30 DRIVEI2 Moves a specified sub group axis to a relative position. 4 Command Statements
E
12
33 ERL Gives the line No. where an error occurred. - - Functions
33 ERR Gives the error code number of an error which has occurred. - - Functions
34 EXIT FOR Terminates the FOR to NEXT statement loop. 6 Command Statements
13 36 EXIT TASK Terminates its own task which is in progress. 6 Command Statements
F
37 FOR to NEXT Controls repetitive operations. Executes the FOR to NEXT 6 Command Statements
statement repeatedly until a specified value is reached.
14 G
38 GOSUB to Jumps to a subroutine with the label specified by a 6 Command Statements
RETURN GOSUB statement, and executes that subroutine.
39 GOTO Unconditionally jumps to the line specified by a label. 6 Command Statements
15 H
40 HALT Stops the program and performs a reset. 6 Command Statements
41 HAND Defines the main robot hand. 4 Command Statements
41 HAND2 Defines the sub robot hand. 4 Command Statements
42 HOLD Temporarily stops the program. 6 Command Statements
I
43 IF Allows control flow to branch according to conditions. 6 Command Statements
44 INPUT Assigns a value to a variable specified from the 1 Command Statements
programming box.
45 INT Acquires an integer for a specified value by - - Functions
truncating all decimal fractions.
J
46 JTOXY Converts joint coordinate data to main group - - Functions
Cartesian coordinate data. (↔XYTOJ)
46 JTOXY2 Converts joint coordinate data to sub group - - Functions
Cartesian coordinate data. (↔XYTOJ2)
L
48 LEFT$ Extracts a character string comprising a specified - - Functions
number of digits from the left end of a specified
character string.
49 LEFTY Sets the main robot hand system to "Left". 4 Command Statements
P
70 PATH Sets the movement path. 6 Command Statements
71 PATH END Ends the movement path setting. 6 Command Statements
72 PATH SET Starts the movement path setting. 6 Command Statements
9 75 PMOVE2 Executes the sub robot pallet movement command. 4 Command Statements
76 Pn Defines points within a program. 1 Command Statements
77 PPNT Creates point data specified by a pallet definition - - Functions
number and pallet position number.
10 78 PRINT Displays a character string at the programming box screen. 1 Command Statements
R
79 RADDEG Converts a specified value to degrees. (↔DEGRAD) - - Functions
80 REM Expresses a comment statement. 6 Command Statements
11 81 RESET Turns the bit of a specified output port OFF. 1 Command Statements
82 RESTART Restarts another task during a temporary stop. 6 Command Statements
83 RESUME Resumes program execution after error recovery 6 Command Statements
processing.
12 85 RIGHT$ Extracts a character string comprising a specified - - Functions
number of digits from the right end of a specified
character string.
86 RIGHTY Sets the main robot hand system to "Right". 4 Command Statements
13 86
87
RIGHTY2
RSHIFT
Sets the sub robot hand system to "Right".
Shifts a value to the right by the specified number of
4
- -
Command Statements
Functions
bits. (↔LSHIFT)
S
14 88 Sn Defines the shift coordinates within the program. 4 Command Statements
89 SELECT CASE Allows control flow to branch according to conditions. 6 Command Statements
to END SELECT
90 SEND Sends a file. 1 Command Statements
91 SERVO2 Controls the servo ON/OFF of specified sub group 4 Command Statements
axes or all sub group axes.
92 SET Turns the bit at the specified output port ON. 3 In part Command Statements
94 SHIFT Sets the shift coordinates for the main robot by using 4 Command Statements
the shift data specified by a shift variable.
94 SHIFT2 Sets the shift coordinates for the sub robot by using 4 Command Statements
the shift data specified by a shift variable.
95 SIN Acquires the sine value for a specified value. - - Functions
96 SO Outputs a specified value to the SO port. 1 Command Statements
97 SPEED Changes the main group's program movement speed. 4 Command Statements
97 SPEED2 Changes the sub group's program movement speed. 4 Command Statements
98 START Specifies the task number and priority ranking of a 6 Command Statements
specified task, and starts that task.
99 STR$ Converts a specified value to a character string (↔VAL) - - Functions
100 SQR Acquires the square root of a specified value. - - Functions
102 SUSPEND Temporarily stops another task which is being executed. 6 Command Statements
103 SWI Switches the program being executed, performs 2 Command Statements
compiling, then begins execution from the first line.
T
104 TAN Acquires the tangent value for a specified value. - - Functions
9
107 TIMER Acquires the current time in seconds, counting from - - Functions
12:00 midnight.
108 TO Outputs a specified value to the TO port. 1 Command Statements
109 TOLE Specifies/acquires the main group tolerance 4/- Command Statements/
parameter. Functions
109 TOLE2 Specifies/acquires the sub group tolerance 4/- Command Statements/ 10
parameter. Functions
110 TORQUE Specifies/acquires the maximum torque command 4/- Command Statements/
value which can be set for a specified main group axis. Functions
110 TORQUE2 Specifies/acquires the maximum torque command
value which can be set for a specified sub group axis.
4/- Command Statements/
Functions 11
111 TRQSTS Acquires the command end status for the DRIVE - - Functions
command with torque limit option executed at the
main group.
111 TRQSTS2 Acquires the command end status for the DRIVE - - Functions 12
command with torque limit option executed at the
sub group.
112 TRQTIME Specifies/acquires the current limit time-out period at 1/- Command Statements/
the specified main group axis when using a torque Functions
limit option in the DRIVE statement. 13
112 TRQTIME2 Specifies/acquires the current limit time-out period 1/- Command Statements/
at the specified sub group axis when using a torque Functions
limit setting option in the DRIVE statement.
V 14
113 VAL Converts the numeric value of a specified character - - Functions
string to an actual numeric value. (↔STR$)
W
114 WAIT Waits until the conditions of the DI/DO conditional 6 Command Statements 15
expression are met (with time-out).
115 WAIT ARM Waits until the main group robot axis operation is completed. 6 Command Statements
115 WAIT ARM2 Waits until the sub group robot axis operation is completed. 6 Command Statements
116 WEIGHT Specifies/acquires the main robot tip weight 4/- Command Statements/
parameter. Functions
116 WEIGHT2 Specifies/acquires the sub robot tip weight 4/- Command Statements/
parameter. Functions
118 WHERE Reads out the current position of the main group - - Functions
robot arm in joint coordinates (pulses).
118 WHERE2 Reads out the current position of the sub group robot - - Functions
arm in joint coordinates (pulses).
119 WHILE to WEND Controls repeated operations. 6 Command Statements
120 WHRXY Reads out the current position of the main group - - Functions
arm as Cartesian coordinates (mm, degrees).
120 WHRXY2 Reads out the current position of the sub group arm - - Functions
as Cartesian coordinates (mm, degrees).
X
121 XYTOJ Converts the point variable Cartesian coordinate data - - Functions
to the main group's joint coordinate data (↔JTOXY).
121 XYTOJ2 Converts the point variable Cartesian coordinate data - - Functions
to the sub group's joint coordinate data (↔JTOXY2).
122 _SYSFLG Axis status monitoring flag. - - Functions
Arithmetic commands
11 No. Command Function Condition Direct Type
1 ABS Acquires the absolute value of a specified value. - - Functions
2 ABSINIT Resets the current position of a specified main group 4 Command Statements
axis.
12 2 ABSINIT2 Resets the current position of a specified sub group 4 Command Statements
axis.
9 ATN Acquires the arctangent of the specified value. - - Functions
9 ATN2 Acquires the arctangent of the specified X-Y - - Functions
13 coordinates.
16 COS Acquires the cosine value of a specified value. - - Functions
23 DEGRAD Converts a specified value to radians (↔RADDEG). - - Functions
26 DIST Acquires the distance between 2 specified points. - - Functions
14 45 INT Acquires an integer for a specified value by - - Functions
truncating all decimal fractions.
54 LSHIFT Shifts a value to the left by the specified number of - - Functions
bits. (↔RSHIFT)
15 79 RADDEG Converts a specified value to degrees. (↔DEGRAD) - - Functions
87 RSHIFT Shifts a value to the right by the specified number of - - Functions
bits. (↔LSHIFT)
95 SIN Acquires the sine value for a specified value. - - Functions
100 SQR Acquires the square root of a specified value. - - Functions
104 TAN Acquires the tangent value for a specified value. - - Functions
Date / time
61 ORD
specified character string.
Acquires the character code of the first character in - - Functions
10
a specified character string.
85 RIGHT $ Extracts a character string comprising a specified - - Functions
number of digits from the right end of a specified
character string. 11
99 STR $ Converts a specified value to a character string (↔VAL) - - Functions
113 VAL Converts the numeric value of a specified character - - Functions
string to an actual numeric value. (↔STR$)
12
Point, coordinates, shift coordinates
11 89 SELECT CASE
conditions.
Allows control flow to branch according to conditions. 6 Command Statements
to END SELECT
119 WHILE to WEND Controls repeated operations. 6 Command Statements
12 Error control
Task control
8 111 TRQSTS2 Acquires the command end status for the DRIVE - - Functions
command with torque limit option executed at the
sub group.
118 WHERE Reads out the current position of the main group - - Functions
robot arm in joint coordinates (pulses).
9 118 WHERE2 Reads out the current position of the sub group robot - - Functions
arm in joint coordinates (pulses).
120 WHRXY Reads out the current position of the main group - - Functions
arm as Cartesian coordinates (mm, degrees).
10 120 WHRXY2 Reads out the current position of the sub group arm - - Functions
as Cartesian coordinates (mm, degrees).
115 WAIT ARM Waits until the main group robot axis operation is
completed.
11 115 WAIT ARM2 Waits until the sub group robot axis operation is
completed.
6 × Command Statements
Status change
12 No. Command Function Condition Direct Type
5 ACCEL Specifies/acquires the acceleration coefficient 4/- Command Statements/
parameter of the main group. Functions
5 ACCEL2 Specifies/acquires the acceleration coefficient 4/- Command Statements/
13 parameter of the sub group. Functions
6 ARCH Specifies/acquires the arch position parameter of the 4/- Command Statements/
main group. Functions
6 ARCH2 Specifies/acquires the arch position parameter of the 4/- Command Statements/
15 11 AXWGHT
group.
Specifies/acquires the axis tip weight parameter of 4/- Command Statements/
the main group. Functions
11 AXWGHT2 Specifies/acquires the axis tip weight parameter of 4/- Command Statements/
the sub group. Functions
20 DECEL Specifies/acquires the deceleration rate parameter 4/- Command Statements/
of the main group. Functions
20 DECEL2 Specifies/acquires the deceleration rate parameter 4/- Command Statements/
of the sub group. Functions
66 ORGORD Specifies/acquires the axis sequence parameter 4/- Command Statements/
for performing return-to-origin and absolute search Functions
operations in the main group.
66 ORGORD2 Specifies/acquires the axis sequence parameter 4/- Command Statements/
for performing return-to-origin and absolute search Functions
operations in the sub group.
69 OUTPOS Specifies/acquires the OUT enable position 4/- Command Statements/
parameter of the main group. Functions
69 OUTPOS2 Specifies/acquires the OUT enable position 4/- Command Statements/
parameter of the sub group. Functions
74 PDEF Defines the pallet used to execute pallet movement 1 Command Statements
commands.
97 SPEED Changes the main group's program movement 4 Command Statements
speed.
97 SPEED2 Changes the sub group's program movement speed. 4 Command Statements
Path control 10
No. Command Function Condition Direct Type
70 PATH Sets the movement path. 6 Command Statements
71 PATH END Ends the movement path setting. 6 Command Statements
11
72 PATH SET Starts the movement path setting. 6 Command Statements
73 PATH START Starts the PATH motion. 6 Command Statements
Torque control 12
No. Command Function Condition Direct Type
17 CURTRQ Acquires the current torque value of the specified - Functions
13
main group axis.
17 CURTRQ2 Acquires the current torque value of the specified - Functions
sub group axis.
29 DRIVE (With T-option) Executes an absolute movement 4 Command Statements
command for a specified axis.
110 TORQUE Specifies/acquires the maximum torque command 4/- Command Statements/ 14
value which can be set for a specified main group axis. Functions
110 TORQUE2 Specifies/acquires the maximum torque command 4/- Command Statements/
value which can be set for a specified sub group axis. Functions
112 TRQTIME Specifies/acquires the current limit time-out period at 1/- Command Statements/ 15
the specified main group axis when using a torque Functions
limit option in the DRIVE statement.
112 TRQTIME2 Specifies/acquires the current limit time-out period 1/- Command Statements/
at the specified sub group axis when using a torque Functions
limit setting option in the DRIVE statement.
9 Programming box
Communication control
11
No. Command Function Condition Direct Type
65 ONLINE Sets the specified communication port to the "online" 1 Command Statements
mode.
13 Other
Other
15
A
1 ABS Arithmetic function Acquires the absolute value of a specified value.
9
3 ABSRPOS Arithmetic function Acquires the machine reference of the specified main group
axis. (Valid only for axes where the return-to-origin method is set
as "mark method".)
3 ABSRPOS2 Arithmetic function Acquires the machine reference of the specified sub group axis. 10
(Valid only for axes where the return-to-origin method is set as
"mark method".)
5 ACCEL Arithmetic function Acquires the acceleration coefficient parameter of the main group.
5 ACCEL2 Arithmetic function Acquires the acceleration coefficient parameter of the sub group. 11
6 ARCH Arithmetic function Acquires the arch position parameter of the main group.
6 ARCH2 Arithmetic function Acquires the arch position parameter of the sub group.
7 ARMCND Arithmetic function Acquires the current arm status of the main robot.
7 ARMCND2 Arithmetic function Acquires the current arm status of the sub robot. 12
8 ARMTYPE Arithmetic function Acquires the current "hand system" setting of the main robot.
8 ARMTYPE2 Arithmetic function Acquires the current "hand system" setting of the sub robot.
9 ATN Arithmetic function Acquires the arctangent of the specified value.
9 ATN2 Arithmetic function Acquires the arctangent of the specified X-Y coordinates. 13
11 AXWGHT Arithmetic function Acquires the axis tip weight parameter of the main group.
11 AXWGHT2 Arithmetic function Acquires the axis tip weight parameter of the sub group.
C
14
15 CHR$ Character string Acquires a character with the specified character code.
function
16 COS Arithmetic function Acquires the cosine value of a specified value.
17
17
CURTRQ
CURTRQ2
Arithmetic function
Arithmetic function
Acquires the current torque value of the specified main group axis.
Acquires the current torque value of the specified sub group axis.
15
D
19 DATE$ Character string Acquires the date as a "yy/mm/dd" format character string.
function
20 DECEL Arithmetic function Acquires the deceleration rate parameter of the main group.
20 DECEL2 Arithmetic function Acquires the deceleration rate parameter of the sub group.
23 DEGRAD Arithmetic function Converts a specified value to radians (↔RADDEG).
26 DIST Arithmetic function Acquires the distance between 2 specified points.
E
33 ERL Arithmetic function Gives the line No. where an error occurred.
33 ERR Arithmetic function Gives the error code number of an error which has occurred.
I
45 INT Arithmetic function Acquires an integer for a specified value by truncating all
decimal fractions.
J
46 JTOXY Point function Converts joint coordinate data to main group Cartesian
coordinate data. (↔XYTOJ)
8 46 JTOXY2 Point function Converts joint coordinate data to sub group Cartesian coordinate
data. (↔XYTOJ2)
L
48 LEFT$ Character string Extracts a character string comprising a specified number of
9 function digits from the left end of a specified character string.
50 LEN Arithmetic function Acquires the length (number of bytes) of a specified character
string.
53 LOCx Point function Acquires point data or shift data for a specified axis.
10 54 LSHIFT Arithmetic function Shifts a value to the left by the specified number of bits.
(↔RSHIFT)
M
55 MCHREF Arithmetic function Acquires the return-to-origin or absolute-search machine
11 reference for a specified main group axis.
55 MCHREF2 Arithmetic function Acquires the return-to-origin or absolute-search machine
reference for a specified sub group axis.
56 MID$ Character string Extracts a character string of a desired length from a specified
12 function character string.
O
61 ORD Arithmetic function Acquires the character code of the first character in a specified
character string.
13 66 ORGORD Arithmetic function Acquires the axis sequence parameter for performing return-to-
origin and absolute search operations in the main group.
66 ORGORD2 Arithmetic function Acquires the axis sequence parameter for performing return-to-
origin and absolute search operations in the sub group.
14 69 OUTPOS Arithmetic function Acquires the OUT enable position parameter of the main group.
69 OUTPOS2 Arithmetic function Acquires the OUT enable position parameter of the sub group.
P
77 PPNT Point function Creates point data specified by a pallet definition number and
15 pallet position number.
R
79 RADDEG Arithmetic function Converts a specified value to degrees. (↔DEGRAD)
85 RIGHT$ Character string Extracts a character string comprising a specified number of
function digits from the right end of a specified character string.
87 RSHIFT Arithmetic function Shifts a value to the right by the specified number of bits.
(↔LSHIFT)
S
95 SIN Arithmetic function Acquires the sine value for a specified value.
100 SQR Arithmetic function Acquires the square root of a specified value.
99 STR$ Character string Converts a specified value to a character string (↔VAL)
function
T
104 TAN Arithmetic function Acquires the tangent value for a specified value.
105 TCOUNTER Arithmetic function Outputs count-up values at 10ms intervals starting from the
point when the TCOUNTER variable is reset.
106 TIME$ Character string Acquires the current time as an "hh:mm:ss" format character
function string.
107 TIMER Arithmetic function Acquires the current time in seconds, counting from 12:00
midnight.
109 TOLE Arithmetic function Acquires the main group tolerance parameter.
11 120
121
WHRXY2
XYTOJ
Reads out the current position of the sub group arm as Cartesian coordinates (mm, degrees).
Converts the point variable Cartesian coordinate data to the main group's joint
coordinate data (↔JTOXY).
121 XYTOJ2 Converts the point variable Cartesian coordinate data to the sub group's joint
coordinate data (↔JTOXY2).
12 Parameter related functions
9
option executed at the sub group.
112 TRQTIME Acquires the current limit time-out period at the specified main group axis when
using a torque limit option in the DRIVE statement.
112 TRQTIME2 Acquires the current limit time-out period at the specified sub group axis when
using a torque limit setting option in the DRIVE statement.
116 WEIGHT Acquires the main robot tip weight parameter. 10
116 WEIGHT2 Acquires the sub robot tip weight parameter.
Format
ABS (<expression>)
SAMPLE
B A=ABS(-326.55) The absolute value of -362.54
(=362.54) is assigned to
variable A.
C
n NOTE
Format
c CAUTION
Explanation Resets the current position of the axis specified by <axis number>.
If the <expression> is "0", a reset is possible only if the robot is positioned as shown
E
••When the <expression>
is 0, the "17.42: Cannot
in the figure below. To perform multi-turn movement in the same direction, the
reset position" error command statement must be executed after each 360° of movement, and the current F
will occur if the robot's position must be reset.
current position is at a
If the <expression> is "1", a reset occurs regardless of the robot's current coordinates.
position where a reset is
impossible. In this case, the robot's absolute function is disabled.
G
The format 1 operation is identical to a format 2 operation where the <expression> = 0.
H
"Reset possible" range within a mechanical angle of 360° (16384 [pulse] × speed reduction ratio)
33829-R7-00
D MEMO • Following the reset, the current position and target position values become values from which a
distance equivalent to the motor's number-of-turns has been subtracted.
• The reset time per axis is approximately 100ms.
E • If a "Limitless motion INVALID" axis is specified, the "5.37: Specification mismatch" error
message displays, and execution is stopped.
F
●● Restrictions
1. Only the axis of a single-axis rotary type robot can be specified. Linear robot and dual robot
G axes cannot be used.
2. The ABSINIT / ASBSINIT2 statements cannot be used at YC-Link specification axes.
H 3. The ABSINIT / ASBSINIT2 statements cannot be used at electric gripper specification axes.
SAMPLE
G
A=ABSRPOS(4) The machine reference value
for the main group's axis 4 is
assigned to variable A. H
Format
ABSRST
A Explanation This statement executes a direct return-to-origin operation for the robot's absolute
motor axes (absolute reset).
The return-to-origin will fail if the robot stops en route.
B In systems with a two-robot setting, the main robot group return-to-origin occurs first,
followed by the sub robot group return-to-origin.
C
MEMO • This command is valid at axes where the return-to-origin method is set to other than "mark".
• This command cannot be executed if a return-to-origin is incomplete at an axis where the
D return-to-origin method is set as "mark".
• In systems with both absolute motor axes and incremental motor axes, a return-to-origin will
occur only at the absolute motor axes when the ABSRST command is executed.
E • The ORIGIN command must be used to perform a return-to-origin at incremental motor axes.
Moreover, the return-to-origin operations occur in the parameter-specified sequence, and the
F incremental motor axes will not operate.
SAMPLE
G
*ABS_RST:
IF DI(20)=1 THEN ABSRST executed when DI (20) is "1".
H ABSRST
ENDIF
*START:ABSRST Absolute motor return-to-origin occurs.
I
Related commands ORIGIN, ORGORD, ORGORD2, MCHREF, MCHREF2
J
1. ACCEL <expression>
2. ACCEL (<axis number>)=<expression>
A
n NOTE
Format sub group
SAMPLE L
A=50
ACCEL A The acceleration coefficient M
for all axes becomes 50%.
ACCEL(3)=100 Only axis 3 becomes 100%.
CYCLE WITH INCREASING ACCELERATION
FOR A=10 TO 100 STEP 10 The acceleration coefficient
parameter is increased from
10% to 100% in 10% increments.
ACCEL A
MOVE P,P0
MOVE P,P1
NEXT A
A=ACCEL(3) The acceleration coefficient
parameter for the main group's
axis 3 is assigned to variable A.
HALT "END TEST"
1. ARCH <expression>
2. ARCH (<axis number>)=<expression>
A
B
n NOTE
Format
1. ARCH2 <expression>
sub group
E Explanation Changes the parameter's arch position to the value indicated in the <expression>.
In format 1, the change occurs at all the group axes.
In format 2, the change occurs at the arch position parameter for the axis specified in
F <axis number> to the value specified in <expression>.
MEMO • If an axis that is set to "no axis" in the system generation is specified, a "5.37: Specification
G mismatch" error message displays and command execution is stopped.
Functions
H
Format main group
I
ARCH (<axis 1>)
J
Format sub group
M Explanation Acquires the arch position parameter value of the axis specified at <axis number>.
ARMCND
ARMCND2
B
Explanation This function acquires the current arm status of the SCARA robot. The arm status is
C "1" for a left-handed system and "0" for a right-handed system.
This function is enabled only when a SCARA robot is used.
D SAMPLE
A=ARMCND The main robot's current arm
E status is assigned to variable A.
IF A=0 THEN Right-handed system status.
MOVE P, P100, Z=0
F ELSE Left-handed system status.
MOVE P, P200, Z=0
ENDIF
G
ARMTYPE
SAMPLE D
A=ARMTYPE The main robot's arm type
value is assigned. E
IF A=0 THEN The arm type is a right-handed system.
MOVE P,P100,Z=0
ELSE The arm type is a left-handed system. F
MOVE P,P200,Z=0
ENDIF
G
Format
ATN (<expression>)
A
n NOTE
Format
E SAMPLE
A(0)=A*ATN(Y/X) The product of the expression
(Y/X) arctangent value and
F variable A is assigned to
array A (0).
A(0)=ATN(0.5) The 0 . 5 arctangent value is
G assigned to array A (0).
A(0)=ATN2(B,C)-D The difference between the X-Y
H coordinates (B,C) arctangent
value and variable D is
assigned to array A (0).
I A(1)=RADDEG(ATN2(B,C)) The X-Y coordinates (B,C)
arctangent value is converted
to degrees, and is then
J assigned to array A (1).
ASPEED <expression>
A
n NOTE
Format
ASPEED2 <expression>
sub group
A
n NOTE
Format
D Explanation Directly changes the axis tip weight parameter for the group's axis specified by the
<axis number> to the <expression> value.
E This statement is valid in systems with "MULTI" axes and auxiliary axes (the robot
type and auxiliary axes are factory set prior to shipment).
F Functions
K Explanation Acquires the value axis tip weight parameter value for the axis specified by the
<expression>.
This statement is valid in systems with "MULTI" axes and auxiliary axes.
L
SAMPLE
M A=5
B=0
C=AXWGHT(1) Axis tip weight value is
acquired (the current value
is saved to variable C).
AXWGHT(1)=A
DRIVE(1,P0)
AXWGHT(1)=B
DRIVE(1,P1)
AXWGHT(1)=C The axis tip weight value is set again.
HALT
n NOTE Format
••When a value is passed
on to a sub-procedure, CALL <label> [(<actual argument> [, <actual argument> ])]
the original value of the
actual argument will not
be changed even if it
Explanation This statement calls up sub-procedures defined by the SUB to END SUB statements. A
is changed in the sub- The <label> specifies the same name as that defined by the SUB statement.
procedure.
••W h e n a r e f e r e n c e i s 1. When a constant or expression is specified as an actual argument, its value is
B
passed on to a sub-
procedure, the original passed on to the sub-procedure.
value of the actual 2. When a variable or array element is specified as an actual argument, its value C
argument will also be is passed on to the sub-procedure. It will be passed on as a reference if "REF" is
changed if it is changed
in the sub-procedure. added at the head of the actual argument.
••For details, see Chapter 3. When an entire array (array name followed by parentheses) is specified as an D
3 "8 Value Pass-Along & actual argument, it is passed along as a reference.
Reference Pass-Along".
• CALL statements containing one actual argument can be used up to 15 times in succession.
E
MEMO
Note that this number is reduced if commands which use stacks such as an IF statement or
GOSUB statement are used, or depending on the number of arguments in the CALL statement. F
• Always use the END SUB statement to end a sub-procedure which has been called with the
CALL statement. If another statement such as GOTO is used to jump out of the sub- routine, a
"5.12: Stack overflow" error, etc., may occur. G
SAMPLE 1 H
X%=4
Y%=5
CALL *COMPARE ( REF X%, REF Y% ) I
HALT
SUB ROUTINE: COMPARE
J
SUB *COMPARE ( A%, B% )
IF A% < B% THEN
TEMP%=A% K
A%=B%
B%=TEMP%
ENDIF L
END SUB
M
SAMPLE 2
I = 1
CALL *TEST( I )
HALT
SUB ROUTINE: TEST
SUB *TEST
X = X + 1
IF X < 15 THEN
CALL *TEST( X )
ENDIF
END SUB
Related commands SUB, END SUB, CALL, DECLARE, EXIT SUB, SHARED
CALL 8-33
13 CHANGE / CHANGE2
8 Switches the hand
CHANGE Hn
CHANGE2 Hn
B
Values n: The range of hand Nos. which can specified for the main group differs from that for
C the sub group.
main group............ 0 to 3
sub group............... 4 to 7
D
Explanation CHANGE / CHANGE2 are used to switch the robot hand.
E Before hand switching can occur, the hands must be defined at the HAND / HAND2
statements. For details, see section "39 HAND / HAND2".
SAMPLE
F
HAND H1= 0 150.0 0.0
HAND H2= -5000 20.00 0.0
G P1=150.00 300.00 0.00 0.00 0.00 0.00
CHANGE H2 Changes to hand 2.
MOVE P,P1 Moves the hand 2 tip to P1 (1).
H CHANGE H1 Changes to hand 1.
MOVE P,P1 Moves the hand 1 tip to P1 (2).
HALT
I
Format
CHGPRI Tn, p
Explanation Directly changes the priority ranking of the specified task ("n") to "p".
B
The priority ranking of the main task (Task 1) is fixed as 32. Even if a priority ranking
is not specified, "32" is adopted as the priority ranking for this task. C
The smaller the priority number, the higher the priority (high priority: 17 ⇔ low
priority: 47).
When a READY status occurs at a task with higher priority, all tasks with lower D
priority also remain in a READY status.
SAMPLE E
START *SUBTASK,T2,33
*ST: F
MOVE P,P0,P1
IF DI(20) = 1 THEN
CHGPRI T2,32 G
ELSE
CHGPRI T2,33
ENDIF H
GOTO *ST
HALT
SUBTASK ROUTINE I
*SUBTASK:
IF LOCZ(WHERE) > 10000 THEN
J
DO(20) = 1
GOTO *SUBTASK
ENDIF K
DO(20) = 0
GOTO *SUBTASK
EXIT TASK L
CHGPRI 8-35
15 CHR$
8 Acquires a character with the specified character code
Format
CHR$ (<expression>)
Explanation Acquires a character with the specified character code. An error occurs if the
B <expression> value is outside the 0 to 255 range.
SAMPLE
C A$=CHR$(65) "A" is assigned to A$.
Format
COS (<expression>)
G
17 CURTRQ / CURTRQ2
Acquires the current torque of the specified axis
H
COS 8-37
18 CUT
8 Terminates another sub task which is currently being executed
Format
CUT Tn
Explanation Directly terminates another task which is currently being executed or which is
B temporarily stopped.
This statement cannot terminate its own task, nor can it terminate Task 1.
C SAMPLE
TASK1 ROUTINE
D *ST:
MO(20) = 0
START *SUBTASK2,T2
E MOVE P,P0
MOVE P,P1
WAIT MO(20) = 1
F CUT T2
GOTO *ST
HALT
G TASK2 ROUTINE
*SUBTASK2:
H P100=JTOXY(WHERE)
IF LOCZ(P100) >= 100.0 THEN
MO(20) = 1
I ELSE
DELAY 100
ENDIF
J GOTO *SUBTASK2
EXIT TASK
K
Related commands EXIT TASK, CUT, RESTART, START, SUSPEND
Format
DATE$
DATE$ 8-39
20 DECEL / DECEL2
8 Specifies/acquires the deceleration rate parameter
n NOTE
Format
1. DECEL <expression>
main group
••T h e D E C E L / D E C E L 2
statements are only 2. DECEL (<axis number>)=<expression>
A available in software
version 8.15 onwards.
••DECEL2 can be used only Format sub group
if a "sub group" setting
B has been specified in the
1. DECEL2 <expression>
system generation. 2. DECEL2 (<axis number>)=<expression>
F MEMO • If an axis that is set to "no axis" in the system generation is specified, a "5.37: Specification
mismatch" error message displays and command execution is stopped.
• Command statements DECEL/DECEL2 can be used to change the acceleration parameter.
G
Functions
H
Format main group
L Explanation Acquires the deceleration rate parameter value for the axis specified by the <expression>.
SAMPLE
M
A =50
DECEL A
DECEL(3)=100
CYCLE WITH INCREASING DECELERATION
FOR A =10 TO 100 STEP 10
DECEL A
MOVE P ,P0
MOVE P ,P1
NEXT A
A=DECEL(3) The deceleration rate parameter
for the main group's axis 3 is
assigned to variable A.
HALT "END TEST "
Format
Explanation Directly declares that a label or sub-procedure exists in the COMMON program. If a D
sub-procedure is declared, the argument's data type is also checked.
This statement cannot be defined within a sub-procedure.
E
Because the DECLARE statement declares the existence of a label or sub-procedure
within the COMMON program, it cannot be used within the COMMON program
itself. The DECLARE statement is valid throughout the entire program. F
SAMPLE
COMMON program shared label G
Program name: DIST1
================================================
MAIN PROGRAM H
================================================
DECLARE *DISTANCE,*AREA
I
X!=2. 5
Y!=1. 2
GOSUB *DISTANCE J
GOSUB *AREA
HALT
K
Program name: COMMON
================================================
COMMON PROGRAM L
================================================
*DISTANCE:
PRINT SQR(X!^2+Y!^2)
M
RETURN
*AREA:
PRINT X!*Y!
RETURN
DECLARE 8-41
21 DECLEAR
8
SAMPLE
External program shared sub-procedure
Program name: DIST2
======================================================
MAIN PROGRAM
A ======================================================
DECLARE SUB *DISTANCE(X!,Y!,D!)
B DECLARE SUB *AREA(X!,Y!,A!)
CALL *DISTANCE(2. 5,1. 2,REF D!)
PRINT D!
C CALL *AREA(2. 5,1. 2,REF A!)
PRINT A!
HALT
D Program name: COMMON
======================================================
COMMON PROGRAM
E ======================================================
SUB *DISTANCE(X!,Y!,D!)
F D!=SQR(X!^2+Y!^2)
END SUB
SUB *AREA(X!,Y!,A!)
G A!=X!*Y!
END SUB
H
Related commands CALL, EXIT SUB, GOSUB, ON to GOSUB, SUB, END SUB
Format
DEF FN <name> [ % ] [(<dummy argument>, [<dummy argument> ])] = <function definition expression>
!
$ A
Values <name> .................................Function name. Max. of 16 chars., including "FN".
<dummy argument> ..............Numeric or character string variable.
B
Explanation Defines the functions which can be used by the user. Defined functions are called in C
the FN <name> (<variable>) format.
MEMO • The <dummy argument> names are the same as the variable names used in the <function D
definition expression>. The names of these variables are valid only when the <function
definition expression> is evaluated. There may be other variables with the same name in the
program.
E
• When calling a function that uses a <dummy argument>, specify the constant, variable, or
expression type which is the same as the <dummy argument> type. F
• If a variable used in the <function definition expression> is not included in the <dummy
argument> list, the current value of that particular variable is used for the calculation.
• A space must be entered between "DEF" and "FN". If no space is entered, DEFFN will be G
handled as a variable.
• The DEF FN statement cannot be used in sub-procedures.
• Definition by the DEF FN statement must be declared before statements which use functions.
H
SAMPLE I
DEF FNPAI=3.141592
DEF FNASIN(X)=ATN(X/SQR(-X^2+1)) J
Both the <dummy argument>
and <function definition
expression> use "X". K
DEF FN 8-43
23 DEGRAD
8 Angle conversion (angle → radian)
Format
DEGRAD (<expression>)
C SAMPLE
A=COS(DEGRAD(30)) A 30 cosine value is assigned
to variable A.
D
Related commands ATN, COS, RADDEG, SIN, TAN
E
Format
DELAY <expression>
SAMPLE C
DELAY 3500 3,500ms (3.5 secs) wait
DELAY A*10 D
DELAY 8-45
25 DI
8 Acquires the input status from the parallel port
Format
E SAMPLE
A%=DI2() The input status from DI (27)
to DI ( 20 ) is assigned to
F variable A%.
A%=DI5(7,4,0) The DI (57), DI (54), DI (50)
input status is assigned to
G variable A% (when all the above
signals are "1" (ON), A% = 7).
H A%=DI(37,25,20) The DI (37), DI (25), DI (20) input
status is assigned to variable A%
(when all the above signals except
I DI (20) are "1" (ON), A% = 6).
Format
Explanation Acquires the distance (X,Y,Z)between the 2 points specified by <point expression 1>
B
and <point expression 2>. An error occurs if the 2 points specified by each <point
expression> do not have a Cartesian coordinates. C
SAMPLE
A=DIST(P0,P1) The distance between P0 and P1
D
is assigned to variable A.
E
DIST 8-47
27 DIM
8 Declares array variable
Format
A Format
D Explanation Directly declares the name and length (number of elements) of an array variable. A
maximum of 3 dimensions may be used for the array subscripts. Multiple arrays can
MEMO • Array subscripts can be "0 to a specified value", with their total number being the <constant> + 1.
F • A "9.31: Memory full" error may occur depending on the size of each dimension defined in an
array.
G SAMPLE
DIM A%(10) Defines a integer array
H variable A% ( 0 ) to A% ( 10 ).
(Number of elements: 11).
DIM B(2,3,4) Defines a real array variable
I B (0, 0, 0) to B (2, 3, 4).
(Number of elements: 60).
J DIM C%(2,2),D!(10) Defines an integer array C%
(0,0) to C% (2,2) and a real
array D! (0) to D! (10).
K
Format
SAMPLE
F
DO2() = &B10111000 DO (27, 25, 24, 23) are turned
ON, and DO (26 , 22 , 21 , 20 )
are turned OFF. G
DO2(6,5,1) = &B010 DO (25) are turned ON, and DO
(26, 21) are turned OFF.
DO3() = 15 DO (33, 32, 31, 30) are turned H
ON, and DO (37 , 36 , 35 , 34 )
are turned OFF.
DO(37,35,27,20) = A The contents of the 4 lower bits
I
acquired when variable A is
converted to an integer are output J
to DO (37, 35, 27, 20) respectively.
DO 8-49
29 DRIVE / DRIVE2
8 Executes absolute movement of specified axes
E
Explanation Executes absolute movement commands for specified axes within a group.
This command is also used in the same way for the group's auxiliary axes.
F • Movement type: PTP movement of specified axis.
• Point setting method: By direct numeric value input and point definition.
• Options: Speed setting, STOPON conditions setting, torque limit setting, XY setting.
G movement direction setting.
H Movement type
J position range. When two or more axes are specified, they will reach their target positions
simultaneously.
If the next command following the DRIVE / DRIVE2 command is an executable command such
K as a signal output command, that next command will start when the movement axis enters the
OUT position range. In other words, that next command starts before the axis arrives within the
target position tolerance range.
L Example:
Signal output (DO, etc.) Signal is output when axis enters within OUT position range.
M DELAY
DELAY command is executed and standby starts, when axis enters the
OUT position range.
Program stops and is reset when axis enters the OUT position range.
HALT
Therefore, axis movement also stops.
Program temporarily stops when axis enters the OUT position range.
HOLD
Therefore, axis movement also stops.
WAIT WAIT command is executed when axis enters the OUT position range.
DRIVE command
DRIVE(1,P1) DRIVE(1,P1)
A
Target position
DO(20)=1 WAIT ARM
DO(20)=1
B
P1
C
Tolerance
OUT position
DO(20) turns ON DO(20) turns ON
D
DRIVE(1,P1) DRIVE(1,P1)
Target position
HOLD WAIT ARM
HOLD
E
Tolerance F
OUT position
HOLD execution HOLD execution
(program temporarily stops) (program temporarily stops)
G
33819-R7-00
SAMPLE H
DRIVE(1,P0) Axis 1 moves from its current
position to the position
specified by P0. I
J
Point data setting types
K
●● Direct numeric value input
The motor position is specified directly in <expression>.
If the motor position's numeric value is an integer, this is interpreted as a "pulse" units. If the
L
motor position's numeric value is a real number, this is interpreted as a "mm/degrees" units,
and each axis will move from the 0-pulse position to a pulse-converted position. M
However, when using the optional XY setting, movement occurs from the coordinate origin
position.
SAMPLE
DRIVE(1,10000) Main group's axis 1 moves
from its current position to
the 10000 pulses position.
DRIVE2(2,90.00) Sub group's axis 2 moves from its current
position to a position which is 90 in the
plus-direction from the 0-pulse position.
(When axis 2 is a rotating axis.)
D Option types
●● Speed setting
E Format
1. SPEED =<expression>
F 2. S =<expression>
n NOTE
Values <expression>..........................1 to 100 (units: %)
G ••This defines the maximum
speed, and does not
guarantee that all Explanation The program's movement speed is specified as an <expression>.
movement will occur at
H specified speed.
The actual speed is determined as shown below.
• Robot's max. speed (mm/sec, or deg/sec) × automatic movement speed (%) ×
program movement speed (%).
I This option is enabled only for the specified DRIVE/ DRIVE2 statement.
SAMPLE
J DRIVE2(1,10000),S=10 Sub group's axis 1 moves from its current
position to the 10000 pulses position at
10% of the automatic movement speed.
K
Format
L 1. DSPEED =<expression>
2. DS =<expression>
M n NOTE
Values <expression>..........................0.01 to 100.00 (units: %)
••Speed setting (DSPEED)
is available only in the
following software Explanation The axis movement speed is specified in <expression>.
versions:
The actual speed is determined as shown below.
RCX14x Ver. 8.71 onwards,
• Robot's max. speed (mm/sec, or deg/sec) × axis movement speed (%).
RCX22x Ver. 9.18 onwards
This option is enabled only for the specified DRIVE/ DRIVE2 statement.
••SPEED option and DSPEED
• Movement always occurs at the DSPEED <expression> value (%) without being
option cannot be used
together affected by the automatic movement speed value (%).
SAMPLE
DRIVE2(1,10000),DS=0.1 Sub group's axis 1 moves from its current
position to the 10000 pulses position at
0.1% of the robot's maximum speed.
Format
Explanation Stops movement when the conditions specified by the conditional expression A
are met. Because this is a deceleration type stop, there will be some movement
(during deceleration) after the conditions are met.
B
n
If the conditions are already met before movement begins, no movement occurs,
NOTE and the command is terminated.
••This parameter is only This option is enabled only by program execution.
available in the following
software versions: SAMPLE C
RCX14x Ver. 8.63 onwards DRIVE(1,10000),STOPON DI(20)=1
RCX22x Ver. 9.08 onwards Axis 1 moves from its current position toward D
••O n e a r l i e r v e r s i o n the "10000 pulses" position and stops at an
controllers, -1 is "true" and
intermediate point if the "DI (20) = 1" condition
a value other than -1 is
"false" (not changeable). is met. The next step is then executed. E
MEMO • When the conditional expression used to designate the STOPON condition is a numeric F
expression, the conditions for determining a TRUE or FALSE status can be changed at the
controller's "TRUE conditions" in the "Other parameters" mode.
These conditions apply to all the IF, WHILE, WAIT, STOPON, etc., conditional expressions. For
G
details, refer to the controller manual.
c CAUTION
1) -1 (default setting) An expression value of "-1" indicates a TRUE status, and "0" indicates
a FALSE status. A "6.35: Incorrect condition expression" error occurs if
H
••The torque limit setting's
"torque offset setting" is
the expression value is other than "-1" or "0".
available from software 2) not 0 Any expression value other than "0" indicates a TRUE status, and "0" I
version 8.18 onwards. indicates a FALSE status.
••The torque limit setting
cannot be used at ●● Torque limit setting J
axes where YC-Link is
connected, or at axes
Format
where a power gripper
is being used. Attempts 1. T =<torque limit value>
K
to specify this setting
at these axes results in 2. T =(<torque limit value> [,<torque offset value>])
a "5.37 Specification
mismatch" message, and Values <torque limit value>...............1 to 100 (units: %)
L
command execution is <torque offset value>..............-100 to 100
stopped.
••The torque limit setting Explanation Moves the axis while under torque control. M
range differs depending The maximum torque at this time is limited to a value calculated as follows: Rated
on the robot model. torque × <torque limit value> / 100.
Setting a torque limit A <torque offset value> is specified to control the torque at vertical axes, etc.,
higher than the maximum
where a fixed load is constantly applied. When the torque limit value setting is
level may cause robot
malfunctions or failure. omitted, a setting of "0" is adopted (the setting is also "0" in Format 1).
••If the specified torque
Specify the torque offset value with reference to the value which displays at the
limit value is too small, the current command monitor while axis movement is stopped by servo HOLD.
axis movement may not Note, however, that the value displayed at the current command monitor is the
occur. Moreover, vertical maximum torque ratio. As a general guideline, the torque offset value should be set
axes may fall. as approximately 1/3 of the displayed value in order to acquire the rated torque ratio.
MEMO • The current command monitor can be displayed by pressing the [DISPLAY] key at the
programming box. For details, refer to the controller manual.
B n NOTE
• Command END conditions
L
c CAUTION 5. Maximum torque limit is cancelled at the following times regardless of
••In driver versions prior to whether or not a TORQUE statement is used:
Ver.2.17, the maximum • When the controller power is turned ON.
torque instruction is
M enabled at the point • When the servo is turned OFF.
when it is changed by • When a return-to-origin or an absolute reset (except by the mark method) is
the TORQUE / TORQUE2
executed.
statement.
• When parameter data has been changed or initialized.
Format J
XY
K
Explanation Moves multiple specified axes to a position specified by Cartesian coordinates.
All the specified axes arrive at the target position at the same time.
If all axes which can be moved by MOVE / MOVE2 statements have been
L
specified, operation is identical to that which occurs when using MOVE / MOVE2
statements. M
The following restrictions apply to this command:
1. Axes specified by <axis number> must include the axis 1 and 2.
2. This command can be specified at SCARA robots and XY robots.
3. Point settings must be in "mm" or "deg" units (real number setting).
SAMPLE
DRIVE(1,P100),(2,P100),(4,P100),XY
The axis 1, 2 and 4 move from their
current positions to the Cartesian
coordinates position specified by P100.
Format
PLS
MNS
A
n NOTE
Explanation <With a "movement direction setting">
• Movement occurs in the specified direction. A PLS setting always results in
B ••The "movement direction
plus-direction movement, and a MNS setting always results in minus-direction
setting" option is available
in the following software movement.
C versions: • If the target position and the current position are the same, a 1-cycle movement
RCX240 Ver.10.66 onwards
amount occurs in the specified direction, then operation stops.
RCX22x Ver.9.39 onwards
D <Without a "movement direction setting">
• Movement occurs in the direction in which the movement distance is shortest.
E • If the target position and the current position are the same, no movement
occurs.
F • Cautions
1. When using this option, the maximum movement distance per operation is the
G distance equivalent to 1 cycle (360°). If movement which exceeds the 1-cycle
distance is desired, the movement must be divided into 2 or more operations.
H 2. When using this option, the DRIVE statement's soft limit values are as shown
below.
Plus-direction soft limit: 67,000,000 [pulse]
I Minus-direction soft limit: -67,000,000 [pulse]
J • Restrictions
Related commands TORQUE, TORQUE2, TRQTIME, TRQTIME2, TRQSYS, TRQSYS2, CURTRQ, CURTRQ2
E auxiliary axes.
• Movement type : PTP movement of a specified axis
• Point data setting : Direct coordinate data input, point definition
F • Options : Speed setting, STOPON conditions setting
MEMO • When DRIVEI motion to the original target position is interrupted and then restarted, the target
G position for the resumed movement can be selected as the "MOVEI/DRIVEI start position" in the
n NOTE controller's "other parameters". For details, refer to the controller manual.
H ••T h i s p a r a m e t e r i s
available in the following
1) KEEP (default setting) Continues the previous (before interruption) movement. The original
target position remains unchanged.
software version:
2) RESET Relative movement begins anew from the current position. The new
RCX14x Ver. 8.66 onwards
I RCX22x Ver. 9.13 onwards
target position is different from the original one (before interruption).
(Backward compatibility)
••In version prior to those
DRIVEI command
WAIT ARM statement
DRIVEI(1,P1) DRIVEI(1,P1)
A
Target position
DO(20)=1 WAIT ARM
DO(20)=1
B
P1
C
Tolerance
OUT position
DO(20) turns ON DO(20) turns ON
D
DRIVEI(1,P1) DRIVEI(1,P1)
Target position
HOLD WAIT ARM
HOLD
E
Tolerance F
OUT position
HOLD execution HOLD execution
(program temporarily stops)
G
(program temporarily stops)
33820-R7-00
n NOTE
Limitless motion related cautions H
••T h e " l i m i t l e s s m o t i o n "
• When the "limitless motion" parameter is enabled, the DRIVEI / DRIVEI2 statement soft limit
function is available in
the following software check values are as follows: I
versions: Plus-direction soft limit: 67,000,000 [pulse]
RCX240 Ver.10.66 onwards
RCX22x Ver.9.39 onwards
Minus-direction soft limit: -67,000,000 [pulse]
J
•When using the DRIVEI / DRIVEI2 statements, the above values represent the maximum movement
distance per operation.
K
SAMPLE
DRIVEI(1,P0) The axis 1 moves from its L
current position to the
position specified by P0.
M
B SAMPLE
DRIVEI(1,10000) The axis 1 moves from its
current position to the
C "+10000 pulses" position.
DRIVEI(4,90.00) The axis 4 moves from its current
D position to the +90 position
(when axis 4 is a rotating axis).
E
n NOTE
●● Point definition
Point data is specified in <expression>. The axis data specified by the <axis number> is used.
F ••If point data is specified
with both integers and
The motor position is determined in accordance with the point data defined by the point
real numbers in the same expression. If the point expression is in "mm/degrees" units, movement for each axis occurs
statement, all values are from the 0-pulse position to the pulse-converted position.
G handled in "mm/degrees"
units. SAMPLE
DRIVEI(1,P1) The axis 1 moves from its
H current position the distance
specified by P1.
I DRIVEI(4,P90) The axis 4 moves from its
current position the number of
degrees specified by P90 (when
J axis 4 is a rotating axis).
●● Speed setting
Format
1. SPEED=<expression> A
2. S=<expression>
B
n NOTE
Values <expression>..........................1 to 100 (units: %)
C
••This defines the maximum
speed, and does not Explanation The program's movement speed is specified by the <expression>.
guarantee that all The actual speed is as follows:
movement will occur at • Robot's max. speed (mm/sec, or deg/sec) × automatic movement speed (%) × D
specified speed.
program movement speed (%).
This option is enabled only for the specified DRIVEI / DRIVEI2 statement.
E
SAMPLE
DRIVEI(1,10000),S=10 The axis 1 moves from its current F
position to the +10000 pulses position
at 10% of the automatic movement speed.
G
Format
1. DSPEED=<expression> H
2. DS=<expression>
I
n NOTE
Values <expression>..........................0.01 to 100.00 (units: %)
Format
A Explanation Stops movement when the conditions specified by the conditional expression
are met. Because this is a deceleration type stop, there will be some movement
(during deceleration) after the conditions are satisfied.
B If the conditions are already satisfied before movement begins, no movement
occurs, and the command is terminated.
C This option is enabled only by program execution.
MEMO • When the conditional expression used to designate the STOPON condition is a numeric
D expression, the conditions for determining a TRUE or FALSE status can be changed at the
controller's "TRUE conditions" in the "Other parameters" mode. These conditions apply to all
E n NOTE the IF, WHILE, WAIT, STOPON, etc., conditional expressions. For details, refer to the controller
manual.
••This parameter is only
available in the following 1) -1 (default setting) An expression value of "-1" indicates a TRUE status, and "0" indicates
software versions:
F RCX14x Ver. 8.63 onwards
a FALSE status.
A "6.35: Incorrect condition expression" error occurs if the expression
RCX22x Ver. 9.08 onwards
value is other than "-1" or "0".
G ••O n e a r l i e r v e r s i o n
controllers, -1 is "true" and
2) not 0 Any expression value other than "0" indicates a TRUE status, and "0"
a value other than -1 is indicates a FALSE status.
"false" (not changeable).
H
SAMPLE
DRIVEI(1,10000),STOPON DI(20)=1
I Axis 1 moves from its current position toward
the "+10000 pulses" position and stops at an
intermediate point if the "DI (20) = 1" condition
J become satisfied. The next step is then executed.
Format
SAMPLE E
WHILE -1
SELECT CASE DI3() F
CASE 1,2,3
CALL *EXEC(1,10)
CASE 4,5,6,7,8,9,10 G
CALL *EXEC(11,20)
CASE ELSE
CALL *EXEC(21,30) H
END SELECT
WEND
HALT I
Format
Explanation Ends the sub-procedure definition which begins at the SUB statement.
B For details, see section "99 SUB to ENDSUB".
SAMPLE 1
C I=1
CALL *TEST
D PRINT I
HALT
SUB ROUTINE: TEST
E SUB *TEST
I=50
END SUB
F
Related commands CALL, EXIT SUB, SUB to END SUB
G
Format
ERR
ERL
A
Explanation Variables ERR and ERL are used in error processing routines specified by the ON
ERROR GOTO statement.
ERR gives the error code of the error that has occurred, and ERL gives the line number
B
in which the error occurred.
SAMPLE 1 C
IF ERR <> &H604 THEN HALT
IF ERL=20 THEN RESUME NEXT D
Format
EXIT FOR
A Explanation Directly terminates the FOR to NEXT statement loop, then jumps to the command
which follows the NEXT statement.
This statement is valid only between the FOR to NEXT statements.
B
MEMO • The FOR to NEXT statement loop will end when the FOR statement condition is satisfied or
C when the EXIT FOR statement is executed. A "5.12: Stack overflow" error, etc., will occur if
another statement such as GOTO is used to jump out of the loop.
D SAMPLE
*ST:
E WAIT DI(20)=1
FOR A%=101 TO 109
MOVE P,P100,Z=0
F DO(20)=1
MOVE P,P[A%],Z=0
DO(20)=0
G IF DI(20)=0 THEN EXIT FOR
NEXT A%
H GOTO *ST
HALT
Format
EXIT SUB
Explanation The EXIT SUB statement terminates the sub-procedure defined by the SUB to END A
SUB statements, then jumps to the next command in the CALL statement that called
up the sub-procedure.
This statement is valid only within the sub-procedure defined by the SUB to END
B
SUB statements.
C
MEMO • To end the sub-procedure defined by the SUB to END SUB statements, use the END SUB
statement or EXIT SUB statement. A "5.12: Stack overflow" error, etc., will occur if another
statement such as GOTO is used to jump out of the loop.
D
SAMPLE E
MAIN ROUTINE
CALL *SORT2(REF X%,REF Y%)
HALT
F
SUB ROUTINE: SORT
SUB *SORT2(X%, Y%) G
IF X%>=Y% THEN EXIT SUB
TMP%=Y%
Y%=X% H
X%=TMP%
END SUB
I
Related commands CALL, SUB to END SUB, END SUB
J
Format
EXIT TASK
B MEMO • Even if a task that has started as a subtask jumps to another task processing routine with a
statement such as GO TO, that processing routine is then executed as this subtask processing.
C
SAMPLE
TASK1 ROUTINE
D *ST:
MO(20)=0
E START *SUBTASK2,T2
MOVE P,P0,P1
WAIT MO(20)=1
F GOTO *ST
HALT
TASK2 ROUTINE
G *SUBTASK2:
P100=JTOXY(WHERE)
IF LOCZ(P100)>=100.0 THEN
H MO(20)=1
EXIT TASK
I ENDIF
DELAY 100
GOTO *SUBTASK2
J EXIT TASK
Format
Format
A <label>:
RETURN
B
Explanation Jumps to the <label> sub-routine specified by the GOSUB statement.
C A RETURN statement within the sub-routine causes a jump to the next line of the
GOSUB statement.
D MEMO • The GOSUB statement can be used up to 29 times in succession. Note that this number of times
is reduced if commands containing a stack such as an IF statement or CALL statement are used.
• When a jump to a subroutine was made with the GOSUB statement, always use the RETURN
E statement to end the subroutine. If another statement such as GOTO is used to jump out of the
subroutine, an error such as "5.12: Stack overflow" may occur.
F
SAMPLE
G *ST:
MOVE P,P0
GOSUB *CLOSEHAND
H MOVE P,P1
GOSUB *OPENHAND
GOTO *ST
I HALT
SUB ROUTINE
*CLOSEHAND:
J DO(20) = 1
RETURN
K *OPENHAND:
DO(20) = 0
RETURN
L
Related commands RETURN
Format
SAMPLE B
MAIN ROUTINE
*ST:
MOVE P,P0,P1 C
IF DI(20) = 1 THEN
GOTO *FIN D
ENDIF
GOTO *ST
*FIN: E
HALT
GOTO 8-71
40 HALT
8 Stops the program and performs a reset
Format
HALT[ <expression> ]
<character string>
A
Explanation Directly stops the program and resets it. If restarted after a HALT, the program runs
from its beginning.
B
MEMO • If an <expression> or <character string> is written in the statement, the contents of the
In PTP movement specified by movement commands such as MOVE and DRIVE, the next line's
I command is executed when the axis enters the OUT position range.
Therefore, if a HALT command exists immediately after a PTP movement command, that HALT
J command is executed before the axis arrives in the target position tolerance range.
Likewise, in interpolation movement during MOVE/MOVE2 commands, the next command is
executed immediately after movement starts. Therefore, if a HALT command exists immediately
K after the interpolation movement command during MOVE/MOVE2, that HALT command is
executed immediately after movement starts.
In either of the above cases, use the WAIT ARM/WAIT ARM2 command if desiring to execute the
L HALT command after the axis arrives within the target position tolerance range.
HALT command
M
DRIVE(1,P1) DRIVE(1,P1)
Target position
HALT WAIT ARM
HALT
Tolerance
OUT position
HALT execution HALT execution
33821-R7-00
Reference For details regarding "_SELECT", see Chapter 1 "4 Program Names".
Definition statement:
HAND Hn = <1st parameter> <2nd parameter> <3rd parameter> [R]
Selection statement: A
CHANGE Hn
B
Format sub group
Definition statement:
HAND2 Hn = <1st parameter> <2nd parameter> <3rd parameter> [R]
C
Selection statement:
CHANGE2 Hn D
Explanation The HAND / HAND2 statement only defines the hand. To actually change hands, the F
CHANGE / CHANGE2 statement must be used.
For CHANGE / CHANGE2 statement details, see section "12 CHANGE / CHANGE2".
G
MEMO • If a power OFF occurs during execution of the hand definition statement, the "9.7 Hand check-
sum error" may occur.
H
Hand 1 Hand 2
20.00mm
lses
0 pu
-500
m
m
00
0.
m
15
ar
d
2n
d
ar
nd
a
St
33801-R7-00
C
SAMPLE:HAND
D
Y Y
E (150.00, 300.00)
Hand 2
Hand 1
F (150.00, 300.00)
G X
X
H
33802-R7-00
If the R-axis uses a servo motor, the hands that are offset from the R-axis rotating center are selected
(see below).
-90.00 deg.
Hand 1 F
100.00mm Hand 2
33803-R7-00 G
SAMPLE
HAND H1= 0.00 150.0 0.0 R
H
HAND H2= -90.00 100.00 0.0 R
P1= 150.00 300.00 0.00 0.00 0.00 0.00 I
CHANGE H1
MOVE P,P1 Tip of hand 1 moves to P1.
CHANGE H2 J
MOVE P,P1 Tip of hand 2 moves to P1.
HALT
K
SAMPLE:HAND
L
Y Y
M
Hand 1 Hand 2
X X
33804-R7-00
Hands installed on the second arm tip are selected (see below).
A
<1st parameter> ................ Hand "n" X-axis offset amount [mm]
<2nd parameter> . ............. Hand "n" Y-axis offset amount [mm]
B <3rd parameter> ............... Hand "n" Z-axis offset amount [mm]
D
X
Hand 2
E -100.00mm
Hand 1
F 100.00mm
G
Y
33805-R7-00
SAMPLE
H
HAND H1= 0.00 0.00 0.00
HAND H2= 100.0 -100.0 -100.0
I P1= 200.00 250.00 0.00 0.00 0.00 0.00
CHANGE H2
MOVE P,P1 Tip of hand 2 moves to P1.
J CHANGE H1
MOVE P,P1 Tip of hand 1 moves to P1.
HALT
K
L SAMPLE:HAND
X X
Hand 2 Hand 1
Y Y
33806-R7-00
If the R-axis uses a servo motor, the hands that are offset from the R-axis rotating center are selected
(see below).
X E
Hand1
150.00mm 90 deg.
F
Hand2
100.00mm
G
Y
33807-R7-00
H
SAMPLE
HAND H1= 0.00 100.00 0.00 R I
HAND H2= 90.00 150.00 0.00 R
P1= 200.00 250.00 0.00 0.00 0.00 0.00
CHANGE H2 J
MOVE P,P1 Tip of hand 2 moves to P1.
CHANGE H1 K
MOVE P,P1 Tip of hand 1 moves to P1.
HALT
L
SAMPLE:HAND
M
X X
Hand 2 Hand 1
Y Y
33808-R7-00
Format
HOLD[ <expression> ]
<character string>
A
Explanation Temporarily stops the program. When restarted, processing resumes from the next
line after the HOLD statement. If an <expression> or <character string> is written in
B the statement, the contents of the <expression> or <character string> display on the
programming box screen.
C SAMPLE
MAIN ROUTINE
D *ST:
MOVE P,P0,P1
IF DI(20)=1 THEN
E HOLD "PROGRAM STOP"
ENDIF
GOTO *ST
F HALT
G In PTP movement specified by movement commands such as MOVE and DRIVE, the next line's
command is executed when the axis enters the effective OUT position range.
H Therefore, if a HOLD command exists immediately after a PTP movement command, that HOLD
command is executed before the axis arrives in the target position tolerance range.
Likewise, in interpolation movement during MOVE/MOVE2 commands, the next command is
I executed immediately after movement starts. Therefore, if a HOLD command exists immediately
after the interpolation movement command during MOVE/MOVE2, that HOLD command is
L
DRIVE(1,P1) DRIVE(1,P1)
Target position
HOLD WAIT ARM
HOLD
M
Tolerance
OUT position
HOLD execution HOLD execution
33822-R7-00
MEMO • When the conditional expression used to designate the IF statement conditions is a numeric
expression, the conditions for determining a TRUE or FALSE status can be changed at the
n NOTE
controller's "TRUE conditions" in the "Other parameters" mode. These conditions apply to all
the IF, WHILE, WAIT, STOPON, etc., conditional expressions. For details, refer to the controller A
••This parameter is only manual.
available in the following
software versions: 1) -1 (default setting) An expression value of "-1" indicates a TRUE status, and "0" indicates
B
RCX14x Ver. 8.63 onwards a FALSE status.
RCX22x Ver. 9.08 onwards A "6.35 Incorrect condition expression" error occurs if the expression
••O n e a r l i e r v e r s i o n value is other than "-1" or "0". C
controllers, -1 is "true" and 2) not 0 Any expression value other than "0" indicates a TRUE status, and "0"
a value other than -1 is indicates a FALSE status.
"false" (not changeable). D
E
43.1 Simple IF statement
Format F
IF <conditional expression> THEN <label 1> [ELSE <label 2> ]
<command statement 1> <command statement 2> G
Explanation If the condition specified by the <conditional expression> is met, processing jumps H
either to the <label 1> which follows THEN, or to the next line after <command
statement 1> is executed.
If the condition specified by the <conditional expression> is not met, the following I
processing occurs:
1. Processing either jumps to the <label 2> specified after the ELSE statement, or to
J
the next line after <command statement 2> is executed.
2. If nothing is specified after the ELSE statement, no action is taken, and processing
simply jumps to the next line. K
SAMPLE
MAIN ROUTINE L
*ST:
MOVE P,P0,P1
IF DI(20)=1 THEN *L1 If DI (20) is "1", a jump to M
*L1 occurs.
DO(20)=1
DELAY 100
*L1:
IF DI(21)=1 THEN *ST ELSE *FIN
If DI (21) is "1", a jump to
*ST occurs. If other than "1",
a jump to *FIN occurs.
*FIN:
HALT
IF 8-79
43 IF
8
43.2 Block IF statement
n NOTE
Format
Explanation If the condition specified by <conditional expression 1> is met, this statement
D executes the instructions specified in <command block 1>, then jumps to the next
line after ENDIF.
G MEMO • The IF statement can be used up to 48 times in succession. Note that the maximum number of
times is reduced if commands containing a stack such as a GOSUB or CALL statement are used.
H SAMPLE
MAIN ROUTINE
I *ST:
MOVE P,P0,P1
IF DI(21,20)=1 THEN
J DO(20)= 1
DELAY 100
WAIT DI(20)=0
K ELSEIF DI(21,20)=2 THEN
DELAY 100
ELSE
L GOTO *FIN
ENDIF
M GOTO *ST
*FIN:
HALT
Format
1. When two or more variables are specified by separating them with a comma ( , ), C
the specified input data items must also be separated with a comma ( , ).
2. At the <prompt statement>, enter a character string enclosed in quotation marks
(" ") that will appear as a message requiring data input. When a semicolon ( ; ) is D
entered following the prompt statement, a question mark ( ? ) and a space will
appear at the end of the message. When a comma ( , ) is entered, nothing will be
E
displayed following the message.
3. When the <prompt statement> is omitted, only a question mark ( ? ) and a space
will be displayed. F
4. The input data type must match the type of the corresponding variables. When
data is input to a point variable or shift variable, insufficient elements are set to
"0".
G
5. If only the ENTER key is pressed without making any entry, the program interprets
this as a "0" or "null string" input. However, if specifying two or more variables, a H
comma ( , ) must be used to separate them.
6. If the specified variable is a character type and a significant space is to be entered
before and after a comma ( , ), double quotation mark ( " ) or character string, the I
character string must be enclosed in double quotation marks ( " ). Note that in this
case, you must enter two double quotation marks in succession so that they will
J
be identified as a double quotation mark input.
7. Pressing the ESC key skips this command.
K
MEMO • If the variable and the value to be assigned are different types, an "Input again" message displays
and a "waiting for input" status is established. L
• When assigning alphanumeric characters to a character variable, it is not necessary to enclose
the character string in double quotation marks ( " ).
M
SAMPLE
INPUT A
INPUT "INPUT POINT NUMBER";A1
INPUT "INPUT STRING",B$(0),B$(1)
INPUT P100
HALT
INPUT 8-81
45 INT
8 Truncates decimal fractions
Format
INT (<expression>)
A Explanation This function acquires an integer with decimal fractions truncated. The maximum
integer value which does not exceed the <expression> value is acquired.
B SAMPLE
A=INT(A(0))
C B=INT(-1. 233) "-2" is assigned to B.
n NOTE
Format
SAMPLE D
P10=JTOXY(WHERE) Current position data is
converted to Cartesian
coordinate data. E
Format
*<label> :
A Explanation Defines a <label> on a program line. A <label> must always begin with an asterisk
mark (*), and it must be located at the beginning of the line.
Although a colon mark (:) is required at the end of the <label> when defining it, this
B mark is not required when specifying program jump destinations.
E SAMPLE
*ST: *ST label is defined.
F MOVE P,P0
DO(20) = 1
MOVE P,P1
G DO(20) = 0
GOTO *ST Jumps to *ST.
HALT
H
Format
Values <expression>..........................0 to 75 A
Explanation This function extracts a character string with the digits specified by the <expression>
from the left end of the character string specified by <character string expression>.
B
The <expression> value must be between 0 and 75, otherwise an error will occur.
If the <expression> value is 0, then LEFT$ will be a null string (empty character C
string).
If the <expression> value has more characters than the <character string expression>,
LEFT$ will become the same as the <character string expression>. D
SAMPLE E
B$=LEFT$(A$,4) 4 characters from the left end
of A$ are assigned to B$.
F
Related commands MID$, RIGHT$
G
LEFT$ 8-85
49 LEFTY / LEFTY2
8 Sets the SCARA robot hand system as a left-hand system
LEFTY
LEFTY2
B
Explanation This statement specifies left-handed movement to a point specified in Cartesian
C coordinates.
This statement only selects the hand system, and does not move the robot. If
executed while the robot arm is moving, execution waits until movement is complete
D (positioned within tolerance range).
This command is only valid for SCARA robots.
E SAMPLE
RIGHTY
F MOVE P,P1
LEFTY
MOVE P,P1
G RIGHTY
HALT
H SAMPLE:LEFTY/RIGHTY
I P1
(2) (1)
K Right-handed system
Left-handed system
M
SCARA robot
33809-R7-00
Format
Explanation Returns the length (number of bytes) of the <character string expression>. A
SAMPLE
B
B=LEN(A$)
LEN 8-87
51 LET
8 Assigns values to variables
Format
B Explanation Directly executes the specified assignment statement. The right-side value is assigned
to the left side. An assignment statement can also be directly written to the program
C without using a LET statement.
• If the controller power is turned off during execution of a <point assignment statement> or
D MEMO
<shift assignment statement>, a memory-related error such as the "9.2: Point check-sum error"
or the "9.6: Shift check-sum error" may occur.
E
1. Arithmetic assignment statement
F
Format
G [LET] <arithmetic variable> = <expression>
<point element variable>
<shift element variable>
H <parallel output variable>
<internal output variable>
<arm lock output variable>
I <timer output variable>
<serial output variable>
J
Values <expression>..........................Variable, function, numeric value
K
Explanation The <expression> value is assigned to the left-side variable.
L SAMPLE
A!=B!+1
B%(1,2,3)=INT(10.88)
M LOCZ(P0)=A!
LOCX(S1)=100.00
DO2()=&B00101101
MO(21,20)=2
LO(00)=1
TO(01)=0
SO12()=255
Format
LET 8-89
51 LET
8
SAMPLE
P1 =P10 Point 10 is assigned to P1.
P20=P20+P5 Each element of point 20 and
point 5 is summed and assigned
to P20.
A P30=P30-P3 Each element of point 3 is
subtracted from point 30 and
B assigned to P30.
P80=P70*4 Each element of point 70 is
multiplied by 4 and assigned
C to P80.
P60=P5/3 Each element of point 5 is
divided by 3 and assigned to
D P60.
Format
Explanation This statement outputs the specified value to the LO port to either prohibit or allow C
axis movement.
LO(00) to LO(07) respectively correspond to axes 1 to 8. An arm lock ON status
occurs at axes where bits are set, and axis movement is prohibited. Multiple bits must D
be specified in descending order from left to right (large → small).
E
MEMO • This statement is valid at axes where movement is started.
SAMPLE F
LO0()=&B00001010 Prohibits movement at axes 2 and 4.
LO0(2,1)=&B10 Prohibits movement at axis 3. G
LO 8-91
53 LOCx
8 Specifies/acquires point data or shift data for a specified axis
n NOTE
Format
Format
E
SAMPLE
LOCX(P10)=A(1) The X-axis data of P10 is changed
to the array A (1) value. F
LOCY(S1)=B The Y-axis data of S1 is
changed to the B value.
G
A(1)=LOCX(P10) The X-axis data of P 10 is
assigned to array A (1). H
B(2)=LOCX(S1) The X-axis data of S1 is
assigned to array B (2).
I
Related commands Point element variable, shift element variable
LOCx 8-93
54 LSHIFT
8 Left-shifts a bit
Format
A Explanation Shifts the <expression 1> bit value to the left by the amount of <expression 2>.
Spaces left blank by the shift are filled with zeros (0).
B SAMPLE
A=LSHIFT(&B10111011,2) The 2-bit-left-shifted
C &B 10111011 value (&B11101100 )
is assigned to A.
D
Related commands RSHIFT
Format
B Explanation This function extracts a character string of a desired length (number of characters)
from the character string specified by <character string expression>. <expression 1>
C specifies the character where the extraction is to begin, and <expression 2> specifies
the number of characters to be extracted.
An error will occur if the <expression 1> and <expression 2> values violate the
D permissible value ranges.
If <expression 2> is omitted, or if the number of characters to the right of the
E character of <expression 1> is less than the value of <expression 2>, then all
characters to the right of the character specified by <expression 1> will be extracted.
If <expression 1> is longer than the character string, MID$ will be a null string (empty
F character string).
SAMPLE
G
B$=MID$(A$,2,4) The 2nd to 4th characters (up
to the 5th char.) of A$ are
H assigned to B$.
Format
Bit 7 6 5 4 3 2 1 0
G
Port 0 Axis 8 Axis 7 Axis 6 Axis 5 Axis 4 Axis 3 Axis 2 Axis 1
Origin sensor status 0: OFF; 1: ON
Port 1 Axis 8 Axis 7 Axis 6 Axis 5 Axis 4 Axis 3 Axis 2 Axis 1 H
HOLD status 0: No HOLD / 1: HOLD (1 axis is not used)
I
MEMO • For details regarding MO ports "0" and "1", see Chapter 3 "9.7 Internal output variable".
SAMPLE J
MO2()=&B10111000 MO (27, 25, 24, 23) are turned
ON, and MO (26 , 22 , 21 , 20 ) K
are turned OFF.
MO2(6,5,1)=&B010 MO (25) are turned ON, and MO
(26, 21) are turned OFF. L
MO3() = 15 MO (33, 32, 31, 30) are turned
ON, and MO (37 , 36 , 35 , 34 )
are turned OFF. M
MO(37,35,27,20)=A The contents of the 4 lower bits
acquired when variable A is
converted to an integer are output
to MO (37, 35, 27, 20), respectively.
MO 8-97
58 MOVE / MOVE2
8 Performs absolute movement of all robot axes
B
n NOTE
Format
Linear Arch
Options PTP Remarks
I interpolation interpolation
Enabled only for specified
Speed setting (SPEED)
MOVE statement
Enabled only for specified
J Speed setting (VEL)
MOVE statement
Enabled only for specified
Arch motion
MOVE statement
K STOPON condition setting
Enabled only by
execution
program
HALT
Program stops and is reset when axis enters the OUT position range. F
Therefore, axis movement also stops.
Program temporarily stops when axis enters the OUT position range.
HOLD
Therefore, axis movement also stops. G
WAIT WAIT command is executed when axis enters the OUT position range.
The WAIT ARM / WAIT ARM2 statements are used to execute the next command after the H
axis enters the tolerance range.
P1
M
Tolerance
OUT position
DO(20) turns ON DO(20) turns ON
Tolerance
OUT position
HOLD execution HOLD execution
(program temporarily stops) (program temporarily stops)
33823-R7-00
B MEMO • PTP movement is faster than interpolation movement, but when executing continuous
movement to multiple points, a positioning stop occurs at each point.
E begins.
When executing linear or circular interpolation in a continuous manner, the 2 movement paths
are linked by connecting the deceleration and acceleration sections, enabling continuous
F movement without intermediate stops.
All movement axes arrive at the same time.
However, the following execution END condition applies if a STOPON condition has been
G specified:
H Execution END condition: Movement of all specified axes is complete (within the tolerance
range).
In this case, continuous movement for the 2 linked paths is not possible.
I
●● Caution regarding commands which follow a MOVE L / MOVE2 L command:
J If the next command following the MOVE L / MOVE2 L command is an executable command
such as a signal output command, that next command will start immediately after axis
movement begins.
K Example:
Signal output (DO, etc.) Signal is output immediately after movement begins.
L DELAY
DELAY command is executed and standby starts immediately after
movement begins.
Program stops and is reset immediately after movement begins.
HALT
Therefore, axis movement also stops.
M Program temporarily stops immediately after movement begins.
HOLD
Therefore, axis movement also stops.
WAIT WAIT command is executed immediately after movement begins.
The WAIT ARM / WAIT ARM2 statements are used to execute the next command after the
axis enters the tolerance range.
P1
H
Tolerance
MOVE L,P1
HOLD
MOVE L,P1
WAIT ARM
J
Target position
HOLD
K
Tolerance
M
33824-R7-00
SAMPLE
MOVE L,P0,P1 The main robot axis moves from its current
position to the position specified by P0, P1.
SAMPLE:MOVE L
P0 P1
Tolerance range
Current position
33810-R7-00
MOVE command
K
MOVE C,P1,P2 MOVE C,P1,P2
DO(20)=1 WAIT ARM
L Target position DO(20)=1
M P1
Tolerance
DO(20) turns ON
DO(20) turns ON
Tolerance
HOLD execution
(program temporarily stops) HOLD execution
(program temporarily stops)
33825-R7-00
SAMPLE:MOVE C B
P22
C
P23 P21
D
Current position P20 P24
33811-R7-00
E
MEMO • In continuous interpolation operations, too, there are no stops at intermediate points. However, F
the maximum speed is slower than the PTP speed.
• On RCX14x controllers earlier than Ver. 8.64, and RCX22x controllers earlier than Ver. 9.11, G
circular interpolation can be performed by task 1 only.
• Circular interpolation is possible within the following range: radius 1.00mm to 5,000.00mm.
• Circle distortion may occur, depending on the speed, acceleration, and the distance between H
points.
• On robots with an R-axis, the R-axis speed may become too fast and cause an error, depending
on the R-axis movement distance.
I
• If a DELAY statement is executed after a MOVE L / MOVE2 L command, a DELAY timer is
activated after the MOVE L / MOVE2L command is executed. Therefore, if a DELAY is desired J
after reaching the target point, use the WAIT ARM / WAIT ARM2 statement after the MOVE
statement.
The same applies for other commands such as HALT, etc. K
• On "Multi" type robots, the "5.37 : Specification mismatch" error will occur, and circular
interpolation will be disabled.
• If the direction changes at an acute angle during interpolation movement, the acceleration/
L
deceleration speed of the connection section may become too fast, causing an error. In this
case, specify a slower acceleration/deceleration speed at the connection section, or use the M
WAIT ARM command to revise the operation pattern.
1. PTP movement
C
2. Interpolation movement
D OUT position range
Current position Target position
Tolerance range
G
3. WAIT ARM
H Current position
OUT position range
Target position
Tolerance range
J
The next command is executed when
movement arrives in the tolerance range.
K
4. STOPON conditional expression
M
The next command is executed when
movement arrives in the tolerance range2).
1) If a DELAY statement is executed after an interpolation operation, a DELAY timer is activated immediately
after the movement starts. Therefore, if a DELAY is desired after reaching the target point, use the WAIT ARM /
WAIT ARM2 statement after the MOVE / MOVE2 command.
2) A deceleration and stop occurs at an intermediate point if the condition specified by the STOPON conditional
expression is met (for details, see the "STOPON Condition Setting" item).
33812-R7-00
Format
MEMO • At SCARA robots with a hand system flag set in the movement destination's coordinate data, the
specified hand system will have priority over the current arm type or LEFTY/RIGHTY setting.
SAMPLE
MOVE P,10000 10000 1000 1000 0 0
PTP movement occurs from
current position to the
specified position.
C MEMO • At SCARA robots with a hand system flag set in the movement destination's coordinate data, the
specified hand system will have priority over the current arm type or LEFTY/RIGHTY setting.
D
c CAUTION
••When performing a linear SAMPLE
and circular interpolation,
the current position's MOVE P,P1 Moves from the current position
E X-arm and Y-arm rotation to the position specified by P1.
information must be the MOVE P,P20,P0,P100 Moves in sequence from the current position
same as the movement
destination's X-arm to positions specified by P20, P0, P100.
F and Y-arm rotation
infor mation. If the two
are different, an error will
G occur and movement will
be disabled.