RCX3 PGM e V2.09

Download as pdf or txt
Download as pdf or txt
You are on page 1of 486

Original instructions

YAMAHA 4-AXIS/2-AXIS ROBOT CONTROLLER

RCX 3 Series Programming Manual

RCX340/RCX320

EGR9224209

Ver. 2.09 E135


CONTENTS RCX 3 Series
Programming Manual

Introduction

Safety precautions

Chapter 1 Writing Programs


1 The YAMAHA Robot Language 1-1

2 Characters 1-1

3 Program Basics 1-1

4 Program Names 1-2

5 Identifiers 1-4

6 LABEL Statement 1-4

7 Comment 1-5

8 Command Statement Format 1-5

Chapter 2 Constants
1 Outline 2-1

2 Numeric constants 2-1


2.1 Integer constants 2-1
2.2 Real constants 2-1

3 Character constants 2-2

Chapter 3 Variables
1 Outline 3-1

2 User Variables & System Variables 3-2


2.1 User Variables 3-2
2.2 System Variables 3-2

3 Variable Names 3-3


3.1 Dynamic Variable Names 3-3
3.2 Static Variable Names 3-3

T-1
CONTENTS RCX 3 Series
Programming Manual

4 Variable Types 3-4


4.1 Numeric variables 3-4
4.2 Character variables 3-4

5 Array variables 3-5

6 Value Assignments 3-5

7 Type Conversions 3-6

8 Value Pass-Along & Reference Pass-Along 3-6

9 System Variables 3-7


9.1 Point variable 3-7
9.2 Shift variable 3-8
9.3 Parallel input variable 3-8
9.4 Parallel output variable 3-9
9.5 Internal output variable 3-10
9.6 Arm lock output variable 3-11
9.7 Timer output variable 3-12
9.8 Serial input variable 3-13
9.9 Serial output variable 3-14
9.10 Serial word input 3-15
9.11 Serial double word input 3-15
9.12 Serial word output 3-16
9.13 Serial double word output 3-16

10 Bit Settings 3-17

11 Valid range of variables 3-18


11.1 Valid range of dynamic (array) variables 3-18
11.2 Valid range of static variables 3-18

12 Clearing variables 3-19


12.1 Clearing dynamic variables 3-19
12.2 Clearing static variables 3-19

Chapter 4 Expressions and Operations


1 Arithmetic operations 4-1
1.1 Arithmetic operators 4-1
1.2 Relational operators 4-1
1.3 Logic operations 4-2

T-2
CONTENTS RCX 3 Series
Programming Manual

1.4 Priority of arithmetic operation 4-3


1.5 Data format conversion 4-3

2 Character string operations 4-4


2.1 Character string connection 4-4
2.2 Character string comparison 4-4

3 Point data format 4-5

4 DI/DO conditional expressions 4-6

Chapter 5 Multiple Robot Control


1 Overview 5-1

2 Command list with a robot setting 5-2

Chapter 6 Multi-tasking
1 Outline 6-1

2 Task definition method 6-1

3 Task status and transition 6-2


3.1 Starting tasks 6-2
3.2 Task scheduling 6-3
3.3 Condition wait in task 6-4
3.4 Suspending tasks (SUSPEND) 6-5
3.5 Restarting tasks (RESTART) 6-5
3.6 Deleting tasks 6-6
3.7 Stopping tasks 6-7

4 Multi-task program example 6-8

5 Sharing the data 6-9

6 Cautionary Items 6-9

Chapter 7 Sequence function


1 Sequence function 7-1

2 Sequence program specifications 7-1

T-3
CONTENTS RCX 3 Series
Programming Manual

3 Creating a sequence program 7-2


3.1 Programming method 7-2
3.2 Compiling 7-4

4 Executing a sequence program 7-5


4.1 Sequence program STEP execution 7-5

5 Programming a sequence program 7-6


5.1 Assignment statements 7-6
5.2 Input/output variables 7-6
5.3 Timer definition statement 7-8
5.4 Logical operators 7-9
5.5 Priority of logic operations 7-9

Chapter 8 Robot Language


Robot language list 8-1
1 ABS Acquires absolute values 8-7

2 ABSRPOS Acquires the machine reference value (axes: mark method) 8-8

3 ACCEL Specifies/acquires the acceleration coefficient parameter 8-9

4 ARCHP1 / ARCHP2 Specifies/acquires the arch distance parameter 8-10

5 ARMCND Acquires the current arm status 8-12

6 ARMSEL Sets/acquires the current hand system selection 8-13

7 ARMTYP Sets/acquires the hand system selection during program reset 8-14

8 ASPEED Sets/acquires the AUTO movement speed of robot 8-15

9 ATN / ATN2 Acquires the arctangent of the specified value 8-16

10 AXWGHT Sets/acquires the axis tip weight 8-17

11 CALL Calls a sub-procedure 8-18

12 CHANGE Switches the hand data 8-19

13 CHGPRI Changes the priority ranking of task 8-20

14 CHGWRK Switches the work data 8-21

15 CHR$ Acquires a character with the specified character code 8-22

16 CLOSE Closes the specified General Ethernet Port 8-23

17 CONTPLS Specifies/acquires CONT pulse parameter of specified robot. 8-24

18 CORRECTXY Acquires the target position corrected for workpiece gripping position
misalignment. 8-25

19 COS Acquires the cosine value of a specified value 8-26

20 CREWRK Creates the work data from the offset; difference between 2 point data
8-27

T-4
CONTENTS RCX 3 Series
Programming Manual

21 CURTQST Acquires the ratio of the current torque (current) value of axis
against the rated torque (current) value 8-28

22 CURTRQ Acquires the ratio of the current torque (current) value of axis
against the maximum torque (current) value 8-29

23 CUT Terminates another task which is currently being executed 8-30

24 DATE$ Acquires the date 8-31

25 DECEL Specifies/acquires the deceleration ratio parameter 8-32

26 DEF FN Defines functions which can be used by the user 8-33

27 DEGRAD Angle conversion (degree → radian) 8-34

28 DELAY Program execution waits for a specified period of time 8-35

29 DI Acquires the input status from the parallel port 8-36

30 DIM Declares array variable 8-37

31 DIST Acquires the distance between 2 specified points 8-38

32 DO Outputs to parallel port or acquires the output status 8-39

33 DRIVE Executes absolute movement of specified axes 8-41

34 DRIVEI Moves the specified robot axes in a relative manner 8-45

35 END SELECT Ends the SELECT CASE statement 8-50

36 END SUB Ends the sub-procedure definition 8-51

37 ERR / ERL Acquires the error code / error line number 8-52

38 ETHSTS Acquires the Ethernet port status 8-53

39 EXIT FOR Terminates the FOR to NEXT statement loop 8-54

40 EXIT SUB Terminates the sub-procedure defined by the SUB to END SUB
statement 8-55

41 EXIT TASK Terminates its own task which is in progress 8-56

42 FOR to NEXT Performs loop processing until the variable exceeds the specified value
8-57

43 GEPSTS Acquires the General Ethernet Port status 8-58

44 GOSUB to RETURN Jumps to a subroutine 8-59

45 GOTO Executes an unconditional jump to the specified line 8-60

46 HALT Stops the program and performs a reset 8-61

47 HALTALL Stops all programs and performs reset 8-62

48 HAND Defines the hand 8-63

48.1 For SCARA Robots 8-64


48.1.1 <4th parameter> "R" is not specified. 8-64
48.1.2 <4th parameter> "R" is specified. 8-65
48.2 For Cartesian Robots 8-66
48.2.1 <4th parameter> "R" is not specified. 8-66
48.2.2 <4th parameter> "R" is specified. 8-67

T-5
CONTENTS RCX 3 Series
Programming Manual

49 HOLD Temporarily stops the program 8-68

50 HOLDALL Temporality stops all programs 8-69

51 IF Evaluates a conditional expression value,


and executes the command in accordance with the conditions 8-70

51.1 Simple IF statement 8-70


51.2 Block IF statement 8-71
52 INPUT Assigns a value to a variable specified from the programming box 8-72

53 INROFST Specifies/acquires R axis inertia offset for SCARA parameter. 8-74

54 INT Truncates decimal fractions 8-75

55 JTOXY Performs axis unit system conversions (pulse → mm) 8-76

56 LEFT$ Extracts character strings from the left end 8-77

57 LEFTY Sets the SCARA robot hand system as a left-handed system 8-78

58 LEN Acquires a character string length 8-79

59 LET Assigns values to variables 8-80

59.1 Arithmetic assignment statement 8-80


59.2 Character string assignment statement 8-81
59.3 Point assignment statement 8-81
59.4 Shift assignment statement 8-82
60 LO Arm lock output or acquires the output status 8-83

61 LOCx Specifies/acquires point data for a specified axis


or shift coordinate data/work data for a specified element 8-85

62 LSHIFT Left-shifts a bit 8-87

63 MCHREF Acquires the machine reference value


(axes: sensor method / stroke-end method) 8-88

64 MID$ Acquires a character string from a specified position 8-89

65 MO Outputs a specified value to the MO port or acquires the output status


8-90

66 MOTOR Controls the motor power status 8-92

67 MOVE Moves robot to the absolute position 8-93

68 MOVEI Moves robot to the relative position 8-110

69 MOVET Performs relative movement of all robot axes in tool coordinates 8-111

70 MTRDUTY Acquires the motor load factor of the specified axis 8-112

71 OFFLINE Sets a specified communication port to the "offline" mode 8-113

72 ON ERROR GOTO Jumps to a specified label when an error occurs 8-114

73 ON to GOSUB Executes the subroutine specified by the <expression> value 8-115

74 ON to GOTO Jumps to the label specified by the <expression> value 8-116

75 ONLINE Sets the specified communication port to the "online" mode 8-117

T-6
CONTENTS RCX 3 Series
Programming Manual

76 OPEN Opens the specified General Ethernet Port 8-118

77 ORD Acquires a character code 8-119

78 ORGORD Specifies/acquires the robot's return-to-origin sequence 8-120

79 ORIGIN Performs return-to-origin 8-121

80 OUT Turns ON the specified port output 8-122

81 OUTPOS Specifies/acquires the OUT enable position parameter of the robot 8-123

82 PATH Specifies the motion path 8-125

83 PATH END Ends the path setting 8-129

84 PATH SET Starts the path setting 8-130

85 PATH START Starts the PATH motion 8-133

86 PDEF Defines the pallet 8-135

87 PGMTSK Acquires the task number in which a specified program is registered


8-136

88 PGN Acquires the program number from a specified program name 8-137

89 PMOVE Executes a pallet movement command for the robot 8-138

90 Pn Defines points within a program 8-143

91 PPNT Creates pallet point data 8-145

92 PRINT Displays the specified expression value at the programming box 8-146

93 PSHFRC Specifies/acquires the pushing force parameter 8-147

94 PSHJGSP Specifies/acquires the push judge speed parameter 8-148

95 PSHMTD Specifies/acquires a pushing type parameter 8-149

96 PSHRSLT Acquires the status when PUSH statement ends 8-150

97 PSHSPD Specifies/acquires the push speed parameter 8-151

98 PSHTIME Specifies/acquires the push time parameter 8-152

99 PUSH Executes a pushing operation for specified axes 8-153

100 RADDEG Performs a unit conversion (radians → degrees) 8-158

101 REFTSK Acquires the task state 8-159

102 REM Inserts a comment 8-160

103 RESET Turns OFF the bits of specified ports, or clears variables 8-161

104 RESTART Restarts another task during a temporary stop 8-162

105 RESUME Resumes program execution after error recovery processing 8-163

106 RETURN Processing which was branched by GOSUB, is returned to the next line
after GOSUB 8-164

107 RIGHT$ Extracts a character string from the right end of another character string
8-165

108 RIGHTY Sets the SCARA robot hand system as a right-handed system 8-166

T-7
CONTENTS RCX 3 Series
Programming Manual

109 RSHIFT Shifts a bit value to the right 8-167

110 SCRINR Specifies/acquires R axis inertia for SCARA parameter. 8-168

111 SELECT CASE to END SELECT Executes the specified command block in accordance with the
<expression> value 8-169

112 SEND Sends readout file data to the write file 8-170

113 SERVO Controls the servo status 8-172

114 SET Turns the bit at the specified output port ON 8-173

115 SETGEP Sets the General Ethernet Port 8-174

116 SGI Assigns /acquires the value to a specified integer type static variable
8-175

117 SGR Assigns /acquires the value to a specified real type static variable 8-176

118 SHARED Enables sub-procedure referencing without passing on the variable8-177

119 SHIFT Sets the shift coordinates 8-178

120 SI Acquires specified SI status 8-179

121 SID Acquires a specified serial input's double-word information 8-180

122 SIN Acquires the sine value for a specified value 8-181

123 SIW Acquires a specified serial input's word information 8-182

124 Sn Defines the shift coordinates in the program 8-183

125 SO Outputs a specified value to serial port or acquires the output status
8-184

126 SOD Outputs a specified serial output's double-word information or acquires


the output status 8-186

127 SOW Outputs a specified serial output's word information or acquires the
output status 8-187

128 SPEED Changes the program movement speed 8-188

129 SQR Acquires the square root of a specified value 8-189

130 START Starts a new task 8-190

131 STR$ Converts a numeric value to a character string 8-191

132 SUB to END SUB Defines a sub-procedure 8-192

133 SUSPEND Temporarily stops another task which is being executed 8-194

134 SWI Switches the program being executed 8-195

135 TAN Acquires the tangent value for a specified value 8-196

136 TCOUNTER Timer & counter 8-197

137 TIME$ Acquires the current time 8-198

138 TIMER Acquires the current time 8-199

139 TO Outputs a specified value to the TO port or acquires the output status
8-200

140 TOLE Specifies/acquires the tolerance parameter 8-201

T-8
CONTENTS RCX 3 Series
Programming Manual

141 TORQUE Specifies/acquires the maximum torque command value 8-202

142 TSKPGM Acquires the program number which is registered in a specified task
number 8-204

143 VAL Converts character strings to numeric values 8-205

144 WAIT Waits until the conditional expression is met 8-206

145 WAIT ARM Waits until the robot axis operation is completed 8-207

146 WEIGHT Specifies/acquires the tip weight (kg) parameter 8-208

147 WEIGHTG Specifies/acquires the tip weight (g) parameter 8-209

148 WEND Ends the WHILE statement's command block 8-210

149 WHERE Acquires the arm's current position (pulse coordinates) 8-211

150 WHILE to WEND Repeats an operation for as long as a condition is met 8-212

151 WHRXY Acquires the arm's current position in Cartesian coordinates 8-213

152 WRKDEF Defines the work data (creates the work data of the specified number)
8-214

153 XYTOJ Converts the Cartesian coordinate data ("mm")


to joint coordinate data ("pulse") 8-216

Chapter 9 PATH Statements


1 Overview 9-1

2 Features 9-1

3 How to use 9-1

4 Cautions when using this function 9-2

Chapter 10 Data file description


1 Overview 10-1

2 Program file 10-3

3 Point file 10-5

4 Point comment file 10-8

5 Point name file 10-10

6 Parameter file 10-12

7 Shift coordinate definition file 10-16

T-9
CONTENTS RCX 3 Series
Programming Manual

8 Hand definition file 10-18

9 Work definition file 10-20

10 Pallet definition file 10-22

11 General Ethernet port file 10-26

12 Input/output name file 10-28

13 Area check output file 10-32

14 Real time output file 10-34

15 All file 10-38

16 Program directory file 10-40

17 Parameter directory file 10-42

18 Machine reference file 10-43

19 Accumulated data file 10-45

20 System configuration information file 10-46

21 Version information file 10-47

22 Option board file 10-48

23 Self check file 10-49

24 Alarm history file 10-50

25 Remaining memory size file 10-52

26 Variable file 10-53

27 Constant file 10-59

28 Array variable file 10-60

29 DI file 10-62

30 DO file 10-64

T-10
CONTENTS RCX 3 Series
Programming Manual

31 MO file 10-66

32 LO file 10-68

33 TO file 10-70

34 SI file 10-72

35 SO file 10-74

36 SIW file 10-76

37 SOW file 10-78

38 EOF file 10-80

39 Serial port communication file 10-81

40 Ethernet port communication file 10-82

Chapter 11 User program examples


1 Basic operation 11-1
1.1 Directly writing point data in program 11-1
1.2 Using point numbers 11-2
1.3 Using shift coordinates 11-3
1.4 Palletizing 11-4
1.4.1 Calculating point coordinates 11-4
1.4.2 Utilizing pallet movement 11-6
1.5 DI/DO (digital input and output) operation 11-7

2 Application 11-8
2.1 Pick and place between 2 points 11-8
2.2 Palletizing 11-10
2.3 Pick and place of stacked parts 11-12
2.4 Parts inspection (Multi-tasking example) 11-14
2.5 Sealing 11-17
2.6 Connection to an external device through RS-232C (example 1) 11-18
2.7 Connection to an external device through RS-232C (example 2) 11-19

Chapter 12 Online commands


1 Online Command List 12-1

T-11
CONTENTS RCX 3 Series
Programming Manual

2 Operation and setting commands 12-5

3 Reference commands 12-21

4 Operation commands 12-37

5 Data file operation commands 12-41

6 Utility commands 12-51

7 Individual execution of robot language 12-53

8 Control codes 12-55

Chapter 13 Appendix
1 Reserved word list 13-1
Variable name usage examples 13-2

2 Changes from conventional models 13-3


1 Program name 13-3
2 Multiple Robot Control 13-3
3 Multi-tasking 13-4
4 Robot Language 13-4
5 Online commands 13-4
6 Data file 13-4

T-12
Introduction
Our sincere thanks for your purchase of this YAMAHA RCX 3 series robot controller.

This manual describes robot program commands and related information for using YAMAHA RCX 3 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.

Applicable controllers: RCX340, RCX320


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.

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.
Keep this manual carefully so that the operator can refer to it when needed. Also make sure that this manual reaches
the end user.
Chapter 1
Writing Programs

1 1 The YAMAHA Robot Language................. 1-1


2 2 Characters................................................. 1-1
3 3 Program Basics.......................................... 1-1
4 4 Program Names......................................... 1-2
5 5 Identifiers.................................................... 1-4
6 6 LABEL Statement........................................ 1-4
7 7 Comment................................................... 1-5
8 8 Command Statement Format.................. 1-5
1 The YAMAHA Robot Language
1
The YAMAHA robot language was developed by Yamaha Motor Co., Ltd. Robotics Company for simple and efficient
programming to control YAMAHA industrial robots. The YAMAHA robot language is similar to BASIC (Beginner’s
All-purpose Symbolic Instruction Code) and makes even complex robot movements easy to program. This manual
explains how to write robot control programs with the YAMAHA robot language, including actual examples on how 2
its commands are used.

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)

6
• Katakana (Japanese phonetic characters) cannot be entered from a programming box. Katakana can be used
when communicating with a host computer (if it handles katakana).
• Spaces are also counted as characters (1 space = 1 character).

3 Program Basics

Programs are written in a "1 line = 1 command" format, and every line must contain a command. Blank lines (lines
with no command) will cause an error when the program is executed. A line-feed on the program's final line creates a
blank line, so be careful not to do so.

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 within a program named [COMMON], allowing
those processing items to be called from multiple programs.

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.

Reference • For details regarding sub-procedure, refer to "11 CALL" and "127 SUB to END SUB" in Chapter 8.
• For details regarding user defined functions, refer to "24 DEF FN" in Chapter 8.

The YAMAHA Robot Language 1-1


4 Program Names
1
Each program to be created in the robot controller must have its own name.
Programs can be named as desired provided that the following conditions are satisfied:

2 • Program names may contain no more than 32 characters, comprising a combination of alphanumeric characters and
underscores (_).
• Each program must have a unique name (no duplications).

3 The 2 program names shown below are reserved for system operations, and programs with these names have a special
meaning.

A) SEQUENCE
4 B) COMMON

The functions of these programs are explained below.

5 A) SEQUENCE

Functions Unlike standard robot programs, the RCX340/RCX320 Controller allow the execution of high-speed
processing programs (sequence programs) in response to robot inputs and outputs (DI, DO, MO, LO, TO,
6 SI, SO). Specify a program name of "SEQUENCE" to use this function, thus creating a pseudo PLC within
the controller.

When the controller is in the AUTO or MANUAL mode, a SEQUENCE program can be executed in fixed
cycles (regardless of the program execution status) in response to dedicated DI10 (sequence control input)
input signals, with the cycle being determined by the program capacity. For details, refer to "4.6 Sequence
program specifications" in Chapter 7.
This allows sensors, push-button switches, and solenoid valves, etc., to be monitored and operated by
input/output signals.
Moreover, because the sequence programs are written in robot language, they can easily be created
without having to use a new and unfamiliar language.

Sample
DO(20)=~DI(20)
DO(25)=DI(21) AND DI(22)
MO(26)=DO(26) OR DO(25)
:

Reference For details, refer to "4.6 Sequence program specifications" in Chapter 7.

1-2 Chapter 1 Writing Programs


B) COMMON

Functions A separate "COMMON" program can be created to perform the same processing in multiple robot 1
programs. The common processing routine which has been written in the COMMON program can be
called and executed as required from multiple programs. This enables efficient use of the programming
space.
2
The sample COMMON program shown below contains two processing items (obtaining the distance
between 2 points (SUB *DISTANCE), and obtaining the area (*AREA)) which are written as common
routines, and these are called from separate programs (SAMPLE 1 and SAMPLE 2).
When SAMPLE1 or SAMPLE2 is executed, the SUB *DISTANCE (A!,B!,C!) and the *AREA routine are 3
executed.

Sample Description

X!=2.5 Program Name: SAMPLE1


4
Y!=1.2
CALL *DISTANCE(X!,Y!,REF C!)
GOSUB *AREA
PRINT C!,Z! 5
HALT

X!=5.5 Program Name: SAMPLE2


Y!=0.2
CALL *DISTANCE(X!,Y!,REF C!)
6
GOSUB *AREA
PRINT C!,Z!
HALT

SUB *DISTANCE(A!,B!,C!) Program Name: COMMON


C!=SQR(A!^2+B!^2) Common Routine
END SUB
*AREA:
Z!=X!*Y!
RETURN

Reference For details, refer to the command explanations given in this manual.

Program Names 1-3


5 Identifiers
1
"Identifiers" are a combination of characters and numerals used for label names, variable names, and procedure
names. Identifiers can be named as desired provided that the following conditions are satisfied:

2 • Identifiers must consist only of alphanumeric characters and underscores (_). Special symbols cannot be used, and the
identifier must not begin with an underscore (_).
• The identifier length must not exceed 32 characters (all characters beyond the 32th character are ignored).
• The maximum number of usable identifiers varies depending on the length of the identifiers. When all identifier length
3 is 32 characters, the number is at the maximum. Local variables can be used up to 128 (in one program task) and
global variables can be used up to 512.
• 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 "*"
4 mark may be immediately followed by a numeric character.

Sample

LOOP, SUBROUTINE, GET_DATA


5
Reference • Regarding reserved words, refer to Chapter 13 "1. Reserved word list",
• Regarding system variables, refer to Chapter 3 "9 System Variables".
6

6 LABEL Statement
Defines a label on a program line.
Format

*label:

A label must always begin with an asterisk (*), and it must be located at the beginning of the line.
Although a colon (:) is required at the end of the label when defining it, this mark is not required when writing a jump
destination in a program.

• A label must begin with an alphabetic or numeric character.


• Alphanumeric and underscore (_) can be used as the remaining label characters. Special symbols cannot be used.
• The label must not exceed 32 characters (all characters beyond the 32th character are ignored).
Sample Explanation

*ST: ……………… Defines*ST.


MOVE P,P0
DO(20) = 1
MOVE P,P1
DO(20) = 0
GOTO *ST ……………… Jumps to *ST.
HALT

1-4 Chapter 1 Writing Programs


7 Comment
1
Characters which follow REM or an apostrophe (') are processed as a comment. Comment statements are not
executed. Moreover, comments may begin at any point in the line.
Sample Description
2
REM *** MAIN PROGRAM ***
(Main Program)
’*** SUBROUTINE ***
(Subroutine)
HALT ’HALT COMMAND ……… Comments may begin at any point in the line.
3

5
8 Command Statement Format

Format

label: statement operand


6

One robot language command must be written on a single line and arranged in the format shown below:
• The shaded section can be omitted.
• The italic items should be written in the specific format.
• Items surrounded by | | are selectable.
• The label can be omitted. When using a label, it must always be preceded by an asterisk (*), and it must end with a
colon (:) (the colon is unnecessary when a label is written as a branching destination).

For details regarding labels, refer to "6 LABEL Statement" in this Chapter.

• Operands may be unnecessary for some commands.


• Programs are executed in order from top to bottom unless a branching instruction is given.
1 line may contain no more than 255 characters.

Comment 1-5
Chapter 2
Constants

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.
Category Type Details/Range
Numeric Integer Decimal constants
2
type type -2,147,483,648 to 2,147,483,647
Binary constants
&B0 to &B11111111
Hexadecimal constants
3
&H80000000 to &H7FFFFFFF
Real type Single-precision real numbers
-999,999.9 to +999,999.9
Exponential format single-precision real numbers
4
-1.0×1038 to +1.0×1038
Character Character Alphabetic, numeric, special character, or katakana (Japanese) character
type string string of 255 bytes or less.
5
2 Numeric constants
6
2.1 Integer constants
• Decimal constants
Integers from -2,147,483,648 to 2,147,483,647 may be used.
• 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)
• 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)

2.2 Real constants


• Single-precision real numbers
Real numbers from -999999.9 to +999999.9 may be used.
7 digits including integers and decimals. (For example, ".0000001" may be used.)
• Single-precision real numbers in exponent form
Numbers from -1.0×1038 to +1.0×1038 may be used.
Mantissas should be 7 digits or less, including integers and decimals.
Sample
-1. 23456E-12
3. 14E0
1. E5

An integer constant range of –1,073,741,824 to 1,073,741,823 is expressed in signed hexadecimal number


as &H80000000 to &H7FFFFFFF.

Outline 2-1
3 Character constants
1
Character type constants are character string data enclosed in double quotation marks ("). The character string must
not exceed 255 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 Description

3 "YAMAHA ROBOT"
"EXAMPLE OF""A""" ………… Represents EXAMPLE OF "A".
PRINT "COMPLETED"
"YAMAHA ROBOT"

2-2 Chapter 2 Constants


Chapter 3
Variables

1 1Outline................................................................. 3-1
2 2User Variables & System Variables................... 3-2
3 3Variable Names.................................................. 3-3
4 4Variable Types.................................................... 3-4
5 5Array variables................................................... 3-5
6 6Value Assignments............................................. 3-5
7 7Type Conversions............................................... 3-6
8 7Value Pass-Along & Reference Pass-Along..... 3-6
9 7System Variables................................................ 3-7
10 1Bit Settings......................................................... 3-17
11 1Valid range of variables.................................. 3-18
12 1Clearing variables............................................ 3-19
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 at program 2
editing, 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.

Variables can be used simply by specifying the variable name and type in the program. 3
A declaration is not necessarily required. However, array variables must be pre-defined by a DIM statement.

User variables & system variables


4
Dynamic variables Numeric type Integer variables
User variables

5
Real variables (single-precision)

Character type Character string variables

Static variables Numeric type Integer variables

Real variables (single-precision) 6

Input-output variables Input variables


System variables

Output variables
Point variables

Shift variables

33301-R9-00

Reference For details regarding array variables, refer to "5 Array variables" in this Chapter.

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 different usable numeric
2 value ranges. Moreover, each of these types has different usable variables (character string variables, array variables,
etc.), and different data ranges, as shown below.

Category Variable Type Details/Range


3 Dynamic variables Numeric type Integer type variables
-2,147,483,648 to 2,147,483,647
(Signed hexadecimal constants: &H80000000 to &H7FFFFFFF)

4 Real variables (single-precision)


-1.0×1038 to +1.0×1038
Character type Character string variables
Alphabetic, numeric, special character, or katakana (Japanese)
5 character string of 255 bytes or less.
Static variables Numeric type Integer type variables
-2,147,483,648 to 2,147,483,647
Real variables (single-precision)
6 -1.0×1038 to +1.0×1038
Array variables Numeric type Integer array variables
-2,147,483,648 to 2,147,483,647
Real array variables (single-precision)
-1.0×1038 to +1.0×1038
Character type Character string array variables
Alphabetic, numeric, special character, or katakana (Japanese)
character string of 255 bytes or less.

n NOTE
Array variables are dynamic variables.

2.2 System Variables


As shown below, system variables have pre-defined names which cannot be changed.

Category Type Details Specific Examples


Input/output variables Input variables External signal / status inputs DI, SI, SIW, SID

Output variables External signal / status outputs DO, SO, SOW, SOD
Point variables Handles point data Pnnnn
Shift variables Specifies the shift coordinate No. as a Sn
numeric constant or expression

Reference For details, refer to "9 System Variables" in this Chapter.

3-2 Chapter 3 Variables


3 Variable Names
1
3.1 Dynamic Variable Names
Dynamic variables can be named as desired, provided that the following conditions are satisfied:
2
• The name must consist only of alphanumeric characters and underscores (_). Special symbols cannot be used.
• The name must not exceed 32 characters (all characters beyond the 32th character are ignored).
• The name must begin with an alphabetic character.
Sample Description
3
COUNT 3 Use is permitted
COUNT123 3 Use is permitted
2COUNT – Use is NOT permitted 4

• Variable names must not be the same as a reserved word.


• Variable names must not begin with characters used for system variable names (pre-defined variables) and 5
user-defined function. These characters include the following:
FN, DIn, DOn, MOn, LOn, TOn, SIn, SOn, Pn, Sn, Hn ("n" denotes a numeric value)
Sample Description
COUNT 3 Use is permitted
6
ABS – Use is NOT permitted (Reserved word)

FNAME – Use is NOT permitted (FN: user-defined function)

S91 – Use is NOT permitted (Sn: pre-defined variable)

Reference For details regarding reserved words, refer to Chapter 13 "1 Reserved word list".

3.2 Static Variable Names


Static variable names are determined as shown below, and these names cannot be changed.

Variable Type Variable Name


Integer variable SGIn (n: 0 to 31)
Real variable SGRn (n: 0 to 31)

Static variables are cleared only when initializing is executed by online command.

Reference For details regarding clearing of static variables, refer to "12 Clearing variables" in this Chapter.

Variable Names 3-3


4 Variable Types
1
The type of variable is specified by the type declaration character attached at the end of the variable name. However,
because the names of static variables are determined based on their type, no type declaration statement is required.
Type Declaration Character Variable Type Specific Examples
2 $ Character variables STR1$
% Integer variables CONT0%, ACT%(1)
! Real variables CNT1!, CNT1

3
• 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.
4 • ASP_DEF%............. Integer variable
• ASP_DEF................ Real variable )→ ASP_DEF% and ASP_DEF are different variables.

)
• ASP_DEF!............... Real variable
• ASP_DEF................ Real variable
→ ASP_DEF! and ASP_DEF are the same variables.

5
4.1 Numeric variables
6 Integer variables

Integer variables and integer array elements can handle an integer from -2,147,483,648 to 2,147,483,647 (in signed
hexadecimal, this range is expressed as &H80000000 to &H7FFFFFFF).

Sample

R1% = 10
R2%(2) = R1% + 10000

n NOTE
When a real number is assigned to an integer type variable, the decimal value is rounded off to the nearest
whole number. For details, refer to Chapter 4 "1.5 Data format conversion".

Real variables

Real variables and real array elements can handle a real number from –1.0×1038 to 1.0×1038.

Sample

R1! = 10.31
R2!(2)= R1% + 1.98E3

n NOTE
The "!" used in real variables may be omitted .

4.2 Character variables


Character variables and character array elements can handle a character string of up to 255 characters.
Character strings may include alphabetic characters, numbers, symbols and katakana (Japanese phonetic characters).
Sample Description
R1$ = "YAMAHA"
Returns "YAMAHA MOTOR"
R2$(2) = R1$ + "MOTOR"

3-4 Chapter 3 Variables


5 Array variables
1
Both numeric and character type arrays can be used at dynamic variables.
Using an array allows multiple same-type continuous data to be handled together.
Each of the array elements is referenced in accordance with the parenthesized subscript which appears after each
variable name. Subscripts may include integers or expressions in up to 3 dimensions. 2
In order to use an array, Array variables must be declared by DIM statement in advance, and the maximum number of
elements which can be used is the declared subscripts + 1 (0 ~ number of declared subscripts).

3
• All array variables are dynamic variables. (For details regarding dynamic variables, refer to "11 Valid range of
variables" in this Chapter.)
• The length of an array variable that can be declared with the DIM statement depends on the program size. 4
Format

variable name % (expression, expression, expression)


! 5
$

Sample Description
A%(1) Integer array variable 6
DATA!(1,10,3) Single-precision real array variable (3-dimension array)

STRING$(10) Character array variable

6 Value Assignments

An assignment statement (LET) can also be used to assign a value to a variable.

"LET" directly specifies an assignment statement, and it can always be omitted.

Format

LET variable = expression

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.

Reference For details, refer to Chapter 8 "54 LET (Assignment Statement)"

Array variables 3-5


7 Type Conversions
1
When different-type values are assigned to variables, the data type is converted as described below.

• When a real number is assigned to an integer type:


2 The decimal value is rounded off to the nearest whole number.
• When an integer is assigned to a real type:
The integer is assigned as it is, and is handled as a real number.
• When a numeric value is assigned to a character string type:
3 The numeric value is automatically converted to a character string.
• When a character string is assigned to numeric type:
This assignment is not possible, and an error will occur at the program is execution. Use the "VAL" command to convert
the character string to a numeric value, and that value is then assigned.
4

8 Value Pass-Along & Reference Pass-Along


5
A variable can be passed along when a sub-procedure is called by a CALL statement. This pass-along can occur in
either of two ways: as a value pass-along, or as a reference pass-along.

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.
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".

Value pass-along & reference pass-along

Value pass-along Reference pass-along

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

3-6 Chapter 3 Variables


9 System Variables
1
The following system variables are pre-defined, and other variable names must not begin with the characters used for
these system variable names.

Variable Type Format Meaning 2


Point variable Pnnn / P [expression] Specifies a point number
Shift variable Sn / S [expression] Specifies the shift number as a constant or as an
expression
Parallel input variable DI(mb), DIm(b) Parallel input signal status
3
Parallel output variable DO(mb), DOm(b) Parallel output signal setting and status
Internal output variable MO(mb), MOm(b) Controller's internal output signal setting and

4
status
Arm lock output variable LO(mb), LOm(b) Axis-specific movement prohibit
Timer output variable TO(mb), TOm(b) For sequence program's timer function
Serial input variable SI(mb), SIm(b) Serial input signal status
Serial output variable SO(mb), SOm(b) Serial output signal setting and status 5
Serial word input SIW(m) Serial input's word information status
Serial double-word input SID(m) Serial input's double-word information status

Serial word output SOW(m) Serial output's word information status 6


Serial double-word output SOD(m) Serial output's double-word information status

9.1 Point variable


This variable specifies a point data number with a numeric constant or expression.

Format

Pnnnnn or P[expression]

Notation Value Range


n Point number 0 to 9

Functions A point data number is expressed with a "P" followed by a number of 5 digits or less, or an expression
surrounded by brackets ([expression])
Point numbers from 0 to 29999 can be specified with point variables.

Sample

P0
P110
P[A]
P[START_POINT]
P[A(10)]

System Variables 3-7


9.2 Shift variable
1 This variable specifies a shift coordinate number with a numeric constant or expression.
Format

Snn or S[expression]
2
Notation Value Range
n Shift number 0 to 9

Functions A shift number is expressed with an "S" followed by a 2-digit number or an expression surrounded by
3 brackets ([expression]). As a shift number, 0 to 39 can be specified.

Sample

S1
4 S[A]
S[BASE]
S[A(10)]

5
The "shift coordinate range" for each shift number can be changed from the programming box.

6
9.3 Parallel input variable
This variable is used to indicate the status of parallel input signals.
Format 1

DIm(b, ..., b)

Format 2

DI(mb, ..., mb)

Notation Value Range


m port number 0 to 7, 10 to 17, 20 to 27
b bit definition 0 to 7
If the bit definition is omitted in Format 1, bits 0 to 7 are all selected.

Sample Description
Input status of ports DI(17) to DI(10) is assigned to variable A%.
A%=DI1()
0 to 255 integer can be assigned to A%.
Input status of DI(57), DI(54) and DI(50) is assigned to variable
A%=DI5(7,4,0)
A%.(If all above signals are 1(ON), then A%=7.)
Input status of DI(27), DI(15) and DI(10) is assigned to variable
A%=DI(27,15,10)
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).

• When specifying multiple bits, specify them from left to right in descending order (high to low).
• A "0" is input if an input port does not actually exist.

3-8 Chapter 3 Variables


9.4 Parallel output variable
Specifies the parallel output signal or indicates the output status. 1
Format 1

DOm(b, ..., b)
2
Format 2

DO(mb, ..., mb)

Notation Value Range 3


m port number 0 to 7, 10 to 17, 20 to 27
b bit definition 0 to 7
If the bit definition is omitted in Format 1, bits 0 to 7 are all selected.
4
Sample Description
A%=DO2() Output status of DO(27) to DO(20) is assigned to variable A%.
5
Output status of DO(57), DO(54) and DO(50) is assigned to
A%=DO5(7,4,0) variable A%.
(If all above signals are 1(ON), then A%=7.)

Output status of DO(37), DO(25) and DO(20) is assigned to 6


A%=DO(37,25,20) variable A%.
(If all above signals except DO(20) are 1 (ON), then A%=6.)

Changes to a status in which the DO(37) to DO(30) output can


be indicated by B%.

DO3()=B%
Example) B% is "123":
"123" is represented as "01111011" in binary number,
DO(37) and DO(32) is "0", and the other bits is "1".

DO4(5,4,0)=&B101 DO(45) and DO(40) become "1", and DO(44) becomes "0".

• When specifying multiple bits, specify them from left to right in descending order (high to low).
• If an output port does not actually exist, the data is not output externally.

System Variables 3-9


9.5 Internal output variable
1 Specifies the controller's internal output signals and indicates the signal status.

Format 1

MOm(b, ..., b)
2
Format 2

MO(mb, ..., mb)

3 Notation Value Range Notation Value Range


m port number 0 to 7, 10 to 17, 20 to 27, 30 to 37 b bit definition 0 to 7
If the bit definition is omitted in Format 1, bits 0 to 7 are all selected.

4 Functions Internal output variables which are used only in the controller, can set the status and refer.
These variables are used for signal communications, etc., with the sequence program.
Ports 30 to 37 are for dedicated internal output variables which can only be referenced (they cannot be changed).
1. Port 30 indicates the status of origin sensors for axes 1 to 8 (in order from bit 0). Port 1 indicates
5 the status of origin sensors for axes 9 to 16 (in order from bit 0).
Each bit sets to "1" when the origin sensor turns ON, and to "0" when OFF.
2. Port 34 indicates the HOLD status of axes 1 to 8 (in order from bit 0). Port 35 indicates the HOLD
status of axes 9 to 16 (in order from bit 0).
6 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
Port 30 Axis 8 Axis 7 Axis 6 Axis 5 Axis 4 Axis 3 Axis 2 Axis 1
Port 31 Axis 16 Axis 15 Axis 14 Axis 13 Axis 12 Axis 11 Axis 10 Axis 9
Origin sensor status 0: OFF / 1: ON (Axis 1 is not connected)
Port 34 Axis 8 Axis 7 Axis 6 Axis 5 Axis 4 Axis 3 Axis 2 Axis 1
Port 35 Axis 16 Axis 15 Axis 14 Axis 13 Axis 12 Axis 11 Axis 10 Axis 9
Hold status 0: RELEASE / 1: HOLD (Axis 1 is not connected)

• Axes where no origin sensor is connected are always ON.


• Being in HOLD status means that the axis movement is stopped and positioned within the target point
tolerance while the servo is still turned ON.
• When the servo turns OFF, the HOLD status is released.
• Axes not being used are set to "1" (HOLD).
• The status of each axis in order from the smallest axis number used by robot 1 is maintained.
Example) In the case of a configuration where robot 1 has 5 axes and robot 2 has 4 axes, bits 0 to 4 of port
30 indicate the status of axes 1 to 5 of robot 1, bits 5 to 7 of port 30 indicate the status of axes 1 to 3 of robot 2,
and bit 0 of port 31 indicates the status of axis 4 of robot 2.

Sample Description

A%=MO2 () Internal output status of MO(27) to MO(20) is assigned to variable A%.

Internal output status of MO(57), MO(54) and MO(50) is assigned to


A%=MO5(7,4,0)
variable A%. (If all above signals are 1 (ON), then A%=7.)
Internal output status of MO(37), MO(25) and MO(20) is assigned to
A%=MO(37,25,20)
variable A%.(If all above signals except MO(25) are 1 (ON), then A%=5.)

When specifying multiple bits, specify them from left to right in descending order (high to low).

3-10 Chapter 3 Variables


9.6 Arm lock output variable
Specifies axis-specific movement prohibit settings. 1
Format 1

LOm(b, ..., b)
2
Format 2

LO(mb, ..., mb)

Notation Value Range


3
m port number 0, 1
b bit definition 0 to 7
If the bit definition is omitted in Format 1, bits 0 to 7 are all selected. 4
Functions The contents of this variable can be set the status and referred to as needed.
Of Port 0, bits 0 to 7 respectively correspond to axes 1 to 8, and of port 1, bits 0 to respectively correspond
to axes 9 to 16. 5
When this bit is ON, movement on the corresponding axis is prohibited.

Sample Description
A%=LO0() Arm lock status of LO(07) to LO(00) is assigned to variable A%.
6
Arm lock status of LO(07), LO(04) and LO(00) is assigned to
A%=LO0(7,4,0) variable A%.
(If all above signals are 1(ON), then A%=7.)

Arm lock status of LO(06), LO(04) and LO(01) is assigned to


A%=LO(06,04,01) variable A%.
(If all above signals except LO(01) are 1(ON), then A%=6.)

LO1()=&B0010 LO(11) is set to 1(ON),then movement of axis 10 is prohibited.

LO(12) and LO(10) are set to 1(ON),


LO1(2,0)=3
then movements of axes 11 and 9 are prohibited.

• When specifying multiple bits, specify them from left to right in descending order (high to low).
• 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.401 Arm locked" error will occur if
an arm lock status is in effect at the axis in question.
• Arm locks sequentially correspond to axes in order from the axis with the smallest axis number used by
robot 1.
Example) In the case of a configuration where robot 1 has 5 axes and robot 2 has 4 axes, the status of axes
1 to 5 of robot 1 is set by bits 0 to 4 of port 0, the status of axes 1 to 3 of robot 2 is set by bits 5 to 7 of port 0,
and the prohibition of motion of axis 4 of robot 2 is set by bit 0 of port 1.

System Variables 3-11


9.7 Timer output variable
1 This variable is used in the timer function of a sequence program.

Format 1

TOm(b, ..., b)
2
Format 2

TO(mb, ..., mb)

3 Notation Value Range


m port number 0, 1
b bit definition 0 to 7

4 If the bit definition is omitted in Format 1, bits 0 to 7 are all selected.

Functions The contents of this variable can be changed and referred to as needed.
Timer function can be used only in the sequence program.
5 If this variable is output in a normal program, it is an internal output.

Reference For details regarding sequence program usage examples,


refer to the timer usage examples given in "4.2 Input/output variables" in Chapter 7.
6
Sample Description
A%=TO0() Status of TO(07) to TO(00) is assigned to variable A%.

Status of TO(07), TO(04) and TO(00) is assigned to variable A%.


A%=TO0(7,4,0)
(If all above signals are 1 (ON), then A%=7.)

Status of TO(06), TO(04) and TO(01) is assigned to variable A%.


A%=TO(06,04,01)
(If all above signals except TO(01) are 1 (ON), then A%=6.)

When specifying multiple bits, specify them from left to right in descending order (high to low).

3-12 Chapter 3 Variables


9.8 Serial input variable
This variable is used to indicate the status of serial input signals. 1
Format 1

SIm(b, ..., b)
2
Format 2

SI(mb, ..., mb)

Notation Value Range


3
m port number 0 to 7, 10 to 17, 20 to 27
b bit definition 0 to 7
If the bit definition is omitted in Format 1, bits 0 to 7 are all selected. 4
Sample Description

5
Input status of ports SI(17) to SI(10) is assigned to variable
A%=SI1()
A%.

Input status of SI(57), SI(54) and SI(50) is assigned to


A%=SI5(7,4,0) variable A%.

6
(If all above signals are 1(ON), then A%=7.)

Input status of SI(27), SI(15) and SI(10) is assigned to


A%=SI(27,15,10) variable A%.
(If all above signals except SI(10) are 1 (ON), then A%=6.)

WAIT SI(21)=1 Waits until SI(21) sets to 1 (ON).

• When specifying multiple bits, specify them from left to right in descending order (high to law).

• A "0" is input if a serial port does not actually exist.

System Variables 3-13


9.9 Serial output variable
1 This variable is used to define the serial output signals and indicate the output status.

Format 1

SOm(b, ..., b)
2
Format 2

SO(mb, ..., mb)

3 Notation Value Range


m port number 0 to 7, 10 to 17, 20 to 27
b bit definition 0 to 7

4 If the bit definition is omitted in Format 1, bits 0 to 7 are all selected.

Sample Description

5
A%=SO2() Output status of SO(27) to SO(20) is assigned to variable A%.

Output status of SO(57), SO(54) and SO(50) is assigned to


A%=SO5(7,4,0) variable A%.
(If all above signals turn 1(ON), then A%=7.)

6 Output status of SO(37), SO(25) and SO(20) is assigned to


A%=SO(37,25,20) variable A%.
(If all above signals except SO(25) turn 1(ON), then A%=5.)

Changes the output status of SO(37) to SO(30) to one indicated


by B%.
SO3()=B% (If B% is 123, 123 is expressed B01111011 as a binary number,
that means SO(37) and SO(32) turn 0(OFF), the other bits turn
1(ON).)

SO4(5,4,0)=&B101 DO(45) and DO(40) turn 1(ON), DO(44) turns 0(OFF).

• When specifying multiple bits, specify them from left to right in descending order (high to law).
• If a serial port does not actually exist, the data is not output externally.

3-14 Chapter 3 Variables


9.10 Serial word input
This variable indicates the status of the serial input word information. 1
Format

SIW(m)
2
Notation Value Range
m port number 2 to 15*
The acquisition range is 0 (&H0000) to 65,535 (&HFFFF).
*W hen SIOW extension is enabled, the range of port number is extended to 2 -15, 24 - 127. 3
For details, refer to RCX3 user's /operator’s manual "Option board related parameters".

Sample Description
A%=SIW(2) The input status from SIW (2) is assigned to variable A%. 4
A%=SIW(15) The input status from SIW (15) is assigned to variable A%.

5
• The information is handled as unsigned word data.
• "0" is input if a serial port does not actually exist.

6
9.11 Serial double word input
This variable indicates the state of the serial input word information as a double word.

Format

SID(m)

Notation Value Range


m port number 2, 4, 6, 8, 10, 12, 14*
The acquisition range is -2,147,483,648(&H80000000) to 2,147,483,647(&H7FFFFFFF).
*When SIOW extension is enabled, the range of port number is extended to 2, 4, 6 -14, 24, 26, 28 -126.
For details, refer to RCX3 user's /operator’s manual "Option board related parameters".

Sample Description
The input status from SIW (2) , SIW (3) is assigned to
A%=SID(2)
variable A%.

The input status from SIW (14), SIW (15) is assigned to


A%=SID(14)
variable A%.

• The information is handled as signed double word data.


• "0" is input if a serial port does not actually exist.
• The lower port number data is placed at the lower address.
For example, if SIW(2) =&H2345, SIW(3) =&H0001, then SID(2) =&H00012345.

System Variables 3-15


9.12 Serial word output
1 Outputs to the serial output word information or indicates the output status.

Format

SOW(m)
2
Notation Value Range
m port number 2 to 15*
The output range is 0 (&H0000) to 65,535 (&HFFFF).
3 Note that if a negative value is output, the low-order word information will be output after being converted to
hexadecimal.
*W hen SIOW extension is enabled, the range of port number is extended to 2 -15, 24 - 127.
For details, refer to RCX3 user's /operator’s manual "Option board related parameters".
4 Sample Description
A%=SOW(2) The output status of SOW (2) is assigned to variable A%.
The contents of variable A% are assigned in SOW (15).

5 SOW(15)=A% If the variable A% value exceeds the output range,


the low-order word information will be assigned.
The contents of -255 (&HFFFFFF01) are assigned to SOW (15).
SOW(15)=-255 -255 is a negative value, so the low-order word information
(&HFF01) will be assigned.
6
• The information is handled as unsigned word data.
• If a serial port does not actually exist, the data is not output externally.
• If a value exceeding the output range is assigned, the low-order 2-byte information is output.

9.13 Serial double word output


Output the status of serial output word information in a double word, or indicates the output status.

Format

SOD(m)

Notation Value Range


m port number 2, 4, 6, 8, 10, 12, 14*
The output range is -2,147,483,648(&H80000000) to 2,147,483,647(&H7FFFFFFF).
*When SIOW extension is enabled, the range of port number is extended to 2, 4, 6 -14, 24, 26, 28 -126.
For details, refer to RCX3 user's /operator’s manual "Option board related parameters".

Sample Description
A%=SOD(2) The output status of SOD (2) is assigned to variable A%.

SOD(14)=A% The contents of variable A% are assigned in SOD (14).

• The information is handled as signed double word data.


• If a serial port does not actually exist, the data is not output externally.
• The lower port number data is placed at the lower address.
For example, if SOW(2) =&H2345, SOW(3) =&H0001, then SOD(2) =&H00012345.

3-16 Chapter 3 Variables


10 Bit Settings
1
Bits can be specified for input/output variables by any of the following methods.

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.

Programming example: DOm(b)DOm(b) 3


Sample Description
DO(25)
Specifies bit 5 of port 2.
DO2(5)
4

2. Same-port multiple bits


5
To specify multiple bits at the same port, those bit numbers are specified in parentheses (separated by commas)
following the port number.
The port number may also be specified in parentheses.
6
Programming example: DOm(b,b,…,b) DO(mb,mb,…,mb)
Sample Description
DO2(7,5,3)
Specifies DO(27), DO(25), DO(23)
DO(27,25,23)

3. Different-port multiple bits

To specify multiple bits at different ports, 2-digit consisting of the port number and the bit number must be specified in
parentheses and must be separated by commas. Up to 8 bits can be written.

Programming example: DO(mb,mb,…,mb)


Sample Description
DO(37,25,20) Specifies DO(37), DO(25), DO(20).

4. All bits of 1 port

To specify all bits of a single port, use parentheses after the port number. Methods 2 and 3 shown above can also be
used.

Programming example: DOm()


Sample Description
DO2()

DO(27,26,25,24,23,22,21,20) Specifies all the DO(27) to DO(20) bits

DO2(7,6,5,4,3,2,1,0)

Bit Settings 3-17


11 Valid range of variables
1
11.1 Valid range of dynamic (array) variables
Dynamic (array) variables are divided into global variables and local variables, according to their declaration position
2 in the program. Global and local variables have different valid ranges.

Variable Type Explanation


Global variables
3
Variables are declared outside of sub-procedures (outside of program areas
enclosed by a SUB statement and END SUB statement). These variables are
valid throughout the entire program.
Local variables Variables are declared within sub-procedures and are valid only in these sub-
procedures.
4
• 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
5 along as a dummy argument, by using the SHARED statement (for details, refer to Chapter 8 "111 SHARED").

6 11.2 Valid range of static variables


Static variable data is not cleared when a program reset occurs. Moreover, variable data can be changed and
referenced from any program.
The variable names are determined as shown below (they cannot be named as desired).

Variable type Variable name


Integer variable SGIn (n: 0 to 31)
Real variable SGRn (n: 0 to 31)

3-18 Chapter 3 Variables


12 Clearing variables
1
12.1 Clearing dynamic variables
In the cases below, numeric variables are cleared to zero, and character variables are cleared to a null string. The
array is cleared in the same manner. 2
• When a program reset occurs.
• When dedicated input signal DI15 (program reset input) was turned on while the program was stopped in AUTO
mode. 3
• When either of the following is initialized by an initialization operation.
1. Program memory
2. Entire memory
• When any of the following online commands was executed. 4
@RESET, @INIT PGM, @INIT MEM, @INIT ALL
• When the HALTALL statement was executed in the program (HALT statement does not clear dynamic variables).

5
12.2 Clearing static variables
In the cases below, integer variables and real variables are cleared to zero.
6
• When the following is initialized by an initialization operation.
Entire memory
• When any of the following online commands was executed.
@INIT MEM, @INIT ALL

Clearing variables 3-19


Chapter 4
Expressions and Operations

1 1 Arithmetic operations............................... 4-1


2 2 Character string operations..................... 4-4
3 3 Point data format....................................... 4-5
4 4 DI/DO conditional expressions................ 4-6
1 Arithmetic operations
1
1.1 Arithmetic operators
Operators Usage Example Meaning
+ A+B Adds A to B
2
- A-B Subtracts B from A
* A*B Multiplies A by B
/ A/B Divides A by B
3
^ A^B Obtains the B exponent of A (exponent operation)
- -A Reverses the sign of A
MOD A MOD B Obtains the remainder A divided by B

When a "remainder" (MOD) operation involves real numbers, the decimal value is rounded off to the nearest whole 4
number which is then converted to an integer before the calculation is executed. The result represents the remainder
of an integer division operation.

Sample Results 5
A=15 MOD 2 A=1(15/2=7....1)

A=17.34 MOD 5.98 A=2(17/5=3....2)

6
1.2 Relational operators
Relational operators are used to compare 2 values. If the result is "true", a "-1" is obtained. If it is "false", a "0" is
obtained.

Operators Usage Example Meaning


= A=B "-1" if A and B are equal, "0" if not.
<>, >< A<>B "-1" if A and B are unequal, "0" if not.
< A<B "-1" if A is smaller than B, "0" if not.
> A>B "-1" if A is larger than B, "0" if not.
<=, =< A<=B "-1" if A is equal to or smaller than B, "0" if not.
>=, => A>=B "-1" if A is equal to or larger than B, "0" if not.

Sample Results
A=10>5 Since 10 > 5 is "true", A = -1.

When using equivalence relational operators with real variables and real arrays, the desired result may not be
obtained due to the round-off error.
Sample Description

A=2 In this case, A! will be unequal to B!*B!.


B=SQR(A!)
IF A!=B!*B! THEN...

Arithmetic operations 4-1


1.3 Logic operations
1 Logic operators are used to manipulate 1 or 2 values bit by bit. For example, the status of an I/O port can be
manipulated.

• 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.

Operators Functions Meaning


NOT, ~ Logical NOT Reverses the bits.
3 AND, & Logical AND Becomes "1" when both bits are "1".
OR, | Logical OR Becomes "1" when either of the bits is "1".
XOR Exclusive OR Becomes "1" when both bits are different.

4 EQV
Logical equivalence
operator
Becomes "1" when both bits are equal.

Logical implication Becomes "0" when the first bit is "1" and the second bit
IMP
operator is "0".

5
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

6 13 0 0 0 0 1 1 0 1
NOT 13=-14 1 1 1 1 0 0 1 0

Examples: A%=3 AND 10 → "2" is assigned to A%

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 AND 10 = 2 0 0 0 0 0 0 1 0

Examples: A%=3 OR 10 → "11" is assigned to A%

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

Examples: A%=3 XOR 10 → "9" is assigned to A%

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 XOR 10 = 9 0 0 0 0 1 0 0 1

4-2 Chapter 4 Expressions and Operations


1.4 Priority of arithmetic operation
Operations are performed in the following order of priority. When two operations of equal priority appear in the same 1
statement, the operations are executed in order from left to right.

Priority Rank Arithmetic Operation


1 Expressions included in parentheses
2
2 Functions, variables
3 ^ (exponents)
4 Independent "+" and "-" signs (Monomial operators)
3
5 * (Multiplication), / (Division)
6 MOD
7 + (Addition), - (Subtraction)
8 Relational operators 4
9 NOT, ~ (Logical NOT)
10 AND, & (Logical AND)
11 OR, |, XOR (Logical OR, exclusive OR)
12 EQV (Logical equivalence) 5
13 IMP (Logical implication)

1.5 Data format conversion 6


Data format is converted in cases where two values of different formats are involved in the same operation.

When a real number is assigned to an integer, decimal places are rounded off.
Sample Results
A%=125.67 A%=126

When integers and real numbers are involved in the same operation, the result becomes a real number.
Sample Results
A(0)=125 * 0.25 A(0)=31.25

When an integer is divided by an integer, the result is an integer with the remainder
discarded.
Sample Results
A(0)=100/3 A(0)=33

Arithmetic operations 4-3


2 Character string operations
1
2.1 Character string connection
Character strings may be combined by using the "+" sign.
2 Sample Results
A$="YAMAHA"
B$="ROBOT"

3 C$="LANGUAGE"
D$="MOUNTER" YAMAHA ROBOT LANGUAGE
E$=A$+" "+B$+" "+C$ YAMAHA MOUNTER
F$=A$+" "+D$
PRINT E$
4 PRINT F$

2.2 Character string comparison


5
Characters can be compared with the same relational operators as used for numeric values. Character string
comparison can be used to find out the contents of character strings, or to sort character strings into alphabetical
order.
6
• In the case of character strings, the comparison is performed from the beginning of each string, character by character.
• If all characters match in both strings, they are considered to be equal.
• Even if only one character in the string differs from its corresponding character in the other string, then the string with
the larger (higher) character code is treated as the larger string.
• When the character string lengths differ, the longer of the character strings is judged to be the greater value string.

Sample Results
"AA"<"AB"

"X&">"X#" All examples are "true".

"DESK"<"DESKS"

4-4 Chapter 4 Expressions and Operations


3 Point data format
1
There are two types of point data formats: joint coordinate format and Cartesian coordinate format.
Point numbers are in the range of 0 to 29999.

Coordinate Format Data Format Explanation 2


Joint coordinate ± nnnnnnn This is a decimal integer constant of 8 digits
format or less with a plus or minus sign, and can
be specified from –99999999 to 99999999.
Unit: [pulses] 3
Cartesian coordinate ± nnn.nn to ± This is a decimal fraction of a total of 7
format nnnnnnn digits including 3 or less decimal places.
Unit: [mm] or [degrees]

4
n NOTE
• The data format is common for axes 1 to 6 for both the joint coordinate format and the Cartesian
coordinate format.
• Plus (+) signs can be omitted.
• The first arm and the second arm rotation information is not available on any robot model except
the YK-TW series.
5

When setting an extended hand system flag for SCARA robots, set either "1" or "2" at the end of the data.
If a value other than "1" or "2" is set, or if no value is designated, "0" will be set to indicate that no hand system flag is 6
set.

Hand System Data Value


RIGHTY (right-handed system) 1
LEFTY (left-handed system) 2

On the YK-TW series robot, the first arm and the second arm movement range is extended beyond 360 degrees (The
working envelope for both the first arm and second arm is -225° to +225°).
Therefore, attempts to convert Cartesian coordinate data ("mm" units) to joint coordinate data ("pulse" units) will result
in multiple solutions, making the position impossible to determine.
In order to obtain the correct robot position and arm posture when converting to joint coordinates, the first arm and
the second arm rotation information is added after the "mm" units point data's extended hand system flag.
The Cartesian coordinate data ("mm" units) is then converted to joint coordinate data ("pulse" units) according to the
specified the first arm and the second arm rotation information.

To set extended the first arm and the second arm rotation information at the YK-TW series 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".

Arm rotation information Data Value


"mm" → pulse converted angle data x (*1) range: -180° < x <= 180° 0
"mm" → pulse converted angle data x (*1) range: 180° < x <= 540° 1
"mm" → pulse converted angle data x (*1) range: -540° < x <= -180° -1

*1: The joint-coordinates-converted pulse data represents each arm's distance (converted to angular
data) from its mechanical origin point.

Point data format 4-5


4 DI/DO conditional expressions
1
DI/DO conditional expressions may be used to set conditions for WAIT statements and STOPON options in MOVE
statements.
Numeric constants, variables and arithmetic operators that may be used with DI/DO conditional expressions are
2 shown below.

• Constant
Decimal integer constant, binary integer constant, hexadecimal integer constant
3 • Variables
Global integer type, global real type, input/output type
• Operators
Relational operators, logic operators
4 • Operation priority
1. Relational operators
2. NOT, ~
3. AND, &
5 4. OR, |, XOR

Sample Decsription

6
The program waits until either DI31 or DI34
WAIT DI(31)=1 OR DI(34)=1
turns ON.

4-6 Chapter 4 Expressions and Operations


Chapter 5
Multiple Robot Control

1 1 Overview.................................................... 5-1
2 2 Command list with a robot setting........... 5-2
1 Overview
1
RCX340/RCX320 can be used to control multiple robots (up to 4).
The multi-task function also enables multiple robots to move asynchronously.
To use this function, settings for multiple robots or settings for auxiliary axes must be made in the system prior to
shipment. 2
The following settings are possible to the axes of robots.

• Robot 1 (4 axes)
• Robot 1 (1 axis) + robot 2 (1 axis) + robot 3 (1 axis) + robot 4 (1 axis) 3
• Robot 1 (6 axes) + robot 2 (2 axes) (when using the YC-LINK/E option)
• Robot 1 (4 axes) + robot 2 (4 axes) (when using the YC-LINK/E option)
• Robot 1 (2 axes) + robot 2 (2 axes)
• Robot 1 (4 axes) + robot 2 (4 axes) + robot 3 (4 axes) + robot 4 (4 axes) 4
(when a master controller is RCX340 and the YC-LINK/E option is used.)
• Robot 1 (2 axes) + robot 2 (4 axes) + robot 3 (4 axes) + robot 4 (4 axes)
(when a master controller is RCX320 and the YC-LINK/E option is used.)
5
Each robot consists of normal axes and auxiliary axes.
When using one robot without auxiliary axes, the setting is made only to normal axes.
6
Axes configuration

1. For robot 1

Main group
Robot 1 normal axis Robot 1 auxiliary axis
(Number of axes: 1 to 4) (Number of axes: 1 to 4)

2. For robot 1 and robot 2

Robot 1
Robot 1 normal axis Robot 1 auxiliary axis
(Number of axes: 1 or 2) (Number of axes: 1 or 2)

Robot 2
Robot 2 normal axis Robot 2 auxiliary axis
(Number of axes: 1 or 2) (Number of axes: 1 or 2)

3. For 1 robot with no auxiliary axes used

Robot 1
Robot 1 robot Robot 1 auxiliary axis
(Number of axes: 1 to 4) (None)

4. When no auxiliary axes are set to two robots

Robot 1
Robot 1 robot Robot 1 auxiliary axis
(Number of axes: 1 or 2) (None)

Robot 2
Robot 2 robot Robot 2 auxiliary axis
(Number of axes: 1 or 2) (None)

33501-R9-00

Overview 5-1
2 Command list with a robot setting
1
The special commands and functions for robot movements and coordinate control are common for all robots. A robot
can be specified with an option of a command. Main commands are shown below.

2 Operator Command name


Robot movement DRIVE DRIVEI
MOVE MOVEI
MOVET PATH
3 PMOVE SERVO
WAIT ARM
Coordinate control CHANGE CHGWRK
HAND LEFTY
PATH RIGHTY
4 SHIFT WRKDEF
Status change ACCEL ARCHP1
ARCHP2 ARMSEL
ARMTYP ASPEED
5 AXWGHT
DECEL
CONTPLS
INROFST
MSPEED ORGORD
OUTPOS SCRINR
SPEED TOLE
6 WEIGHT WEIGHTG
Point operation CORRECTXY JTOXY
WHERE WHRXY
XYTOJ
Parameter reference ACCEL ARCHP1
ARCHP2 ARMTYP
AXWGHT CONTPLS
DECEL INROFST
ORGORD OUTPOS
SCRINR TOLE
WEIGHT WEIGHTG
Status reference ABSRPOS ARMCND
ARMSEL ARMTYP
CORRECTXY CURTQST
CURTRQ MCHREF
WHERE WHRXY
Torque control CURTRQ TORQUE
TRQSTS TRQTIME

• An axis specified as an auxiliary axis cannot be moved with the MOVE, MOVEI, MOVET and PMOVE commands.
Use the DRIVE or DRIVEI command to move it.

5-2 Chapter 5 Multiple Robot Control


Chapter 6
Multi-tasking

1 1 Outline........................................................ 6-1
2 2 Task definition method.............................. 6-1
3 3 Task status and transition.......................... 6-2
4 4 Multi-task program example................... 6-8
5 5 Sharing the data........................................ 6-9
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-task 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 multiple tasks are 2
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.

• A maximum of 16 tasks (task 1 to task 16) can be executed in one program. 3


• Tasks can be prioritized and executed in their priority order (higher priority tasks are executed first).
• The priority level can be set to any level between 1 and 64.
• Smaller values have higher priority, and larger values have lower priority (High priority: 1 ⇔ 64: low priority).
4

2 Task definition method 5


A task is a set of instructions which are executed as a single sequence. As explained below, a task is defined
by assigning a label to it.

6
• Create one program that describes a command which is to be defined as a task.
• In the START statement of the program that will be a main task, specify the program created at Step 1 above.
Task numbers are then assigned, and the program starts.

Sample Description
’MAIN TASK(TASK1)
START <SUB_PGM>,T2………………………………… <SUB_PGM> is started as Task 2
*ST1:
MOVE P,P1,P0
IF DO(20)= 1 THEN
HALTALL
ENDIF
GOTO *ST
HALTALL
Program name:SUB_TSK2
’SUB TASK(TASK2)
*IOTASK:…………………………………………………………… Task 2 begins 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.
• STOP status A task is present but the task processing is stopped.
• RUN status A task is present and the task processing is being executed by the CPU.
2 • READY status A task is present and ready to be allocated to the CPU for task processing.
• WAIT status A task is present and waiting for an event to begin the task processing.
• SUSPEND status A task is present but suspended while waiting to begin the task processing.
• NON EXISTENT status No tasks exist in the program. (The START command is used to perform a call.)
3
Task state transition
CPU assignment

Wait for CPU assignment

4
Restart Cancel waiting Wait condition

SUSPEND READY WAIT RUN


Suspend
5 Stop Stop Start Stop Stop

STOP

6
Delete Call

NON EXISTENT

Use REFTSK function to acquire the current task status.

Reference For details regarding REFTSK function, refer to Chapter 8 "101 REFTSK".

3.1 Starting tasks


When the START command is executed, a specified program is registered in the task and placed in RUN status. If the
task number (1 to 16) is not specified by the START command, the task with the smallest number among the tasks yet
to be started is automatically specified.

Reference For details regarding the START command, refer to "123 START" in Chapter 8.

• When the LOAD command is executed, a specified program is registered in the task and placed in a STOP
status. For details of the LOAD command, refer to "1. Register task" of "2.1 Program operations" in Chapter 12.
• If another program is already registered in the task number specified by the START command or the LOAD
command, the "6.215: Task running" error will occur.
• When programs are registered in all task numbers and the START command or the LOAD command is executed
without specifying the task number, the "6.263: Too many Tasks" error will occur.
• When the HALTALL command is executed, all tasks terminate and the task enters the NON EXISTENT (no task
registration) status. When the main program is specified, the HALTALL command registers the main program
in the task 1 and stops at the beginning line. When the main program is not specified, the HALTALL command
registers the program that has been executed last (current program) in the task 1 and stops at the beginning line.

Reference For details regarding the main program, refer to "Setting the main program" of operator's manual.

6-2 Chapter 6 Multi-tasking


3.2 Task scheduling
Task scheduling determines the priority to be used in allocating tasks in the READY (execution enabled) status to the CPU 1
and executing them.
When there are two or more tasks which are put in the READY status, ready queues for CPU allocation are used to
determine the priority for executing the tasks. One of these READY status tasks is then selected and executed (RUN status).
2
Only tasks with the same priority ranking are assigned to a given ready queue. Therefore, where several tasks with
differing priority rankings exist, a corresponding number of ready queues are created. Tasks within a given ready
queue are handled on a first come first serve (FCFS) basis. The task where a READY status is first established has
priority. The smaller the number, the higher the task priority level. 3
Task scheduling

Priority level

4
The head of the task with the highest priority
Task 1 is put in RUN status.
High

32
Task 1 Task 3 Task 4 Ready queue 1

33 5
Task 5 Ready queue 2

34
Task 2 Ready queue 3

Low
6
Order in which tasks are put in READY status.

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:
• A WAIT status command was executed.
• The CPU occupation time exceeds a specified time.
• A task with a higher priority level is put in READY status.

Ready queue

1 RUN status READY status

Task 1 Task 3 Task 4

2 Moves to the end of the ready queue, and Task 3 is executed.

Task 1 Task 3 Task 4 Task 1

3 Moves to the end of the ready queue, and Task 4 is executed.

Task 3 Task 4 Task 1 Task 3

Execution sequence

n NOTE
When the prescribed CPU occupation time elapses, the active command is ended, and processing moves to
the next task.
However, if there are no other tasks of the same or higher priority (same or higher ready queue), the same
task will be executed again.

Task status and transition 6-3


3.3 Condition wait in task
1 A task is put in the WAIT status (waiting for an event) when a command causing WAIT status is executed for that task.
At this time, the transition to READY status does not take place until the wait condition is canceled.

When a command causing WAIT status is executed, the following transition happens.
2 • Task for which a command causing WAIT status is executed → WAIT status
• Task at the head of the ready queue with higher priority → RUN status

3 For example, when a MOVE statement (a command that establishes 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 "waiting for an event" status.

4 In this case, WAIT status is established at the task which executed the MOVE command, and that task is moved
to the end of the ready queue. RUN status is then established at the next task.

When an event waited by the task in the WAIT status occurs, the following status transition takes place
by task scheduling.
5 Task in the WAIT status for which the awaited event occurred → READY status
However, if the task put in the READY status was at the head of the ready queue with the highest priority,
the following transition takes place.
• Task that is currently in RUN status → READY status
6 • Task at the head of the ready queue with higher priority → RUN status

In the above MOVE statement example, the task is moved to the end of the ready queue.
Then, when a "MOVE COMPLETED" reply is received, this task is placed in READY status.

n NOTE
If multiple tasks are in WAIT status awaiting the same condition event, or different condition events occur
simultaneously, all tasks for which the waited events occur are put in READY status.

Tasks are put in WAIT status by the following commands.


Event Command
Wait for axis movement Axis movement MOVE MOVEI MOVET DRIVE
to complete command DRIVEI PMOVE PATH MOTOR
SERVO WAIT ARM
Parameter ACCEL ARCHP1 ARCHP2 ARMTYP
command AXWGHT CONTPLS DECEL INROFST
ORGORD OUTPOS SCRINR TOLE
WEIGHT WEIGHTG
Robot status CHANGE SHIFT LEFTY ASPEED
change command MSPEED SPEED
Wait for time to elapse DELAY, SET (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

The tasks are not put in WAIT status if the event has been established before the above commands are executed.

6-4 Chapter 6 Multi-tasking


3.4 Suspending tasks (SUSPEND)
The SUSPEND command temporarily stops tasks other than task 1 and places them in SUSPEND status. 1
When the SUSPEND command is executed, the status transition takes place as follows.

• Task that executed the SUSPEND command → RUN status


• Specified task → SUSPEND status 2
Suspending tasks (SUSPEND)

SUSPEND
3
Task 1 Task 2 Task 3 Task 1 Task 3

RUN READY READY RUN READY


Task 2

The task is placed in a SUSPEND status, SUSPEND


4
and is removed from the ready queue.

5
3.5 Restarting tasks (RESTART)
Tasks in the SUSPEND status can be restarted with the RESTART command.
When the RESTART command is executed, the status transition takes place as follows. 6
• Task for which the RESTART command was executed → RUN status
• Specified task → READY status

Restarting tasks (RESTART)

RESTART

Task 1 Task 3 Task 1 Task 3 Task 2

RUN READY RUN READY READY


Task 2

SUSPEND The task is placed in a READY status,


and is assigned to a ready queue.

Task status and transition 6-5


3.6 Deleting tasks
1 Task self-delete (EXIT TASK)

Tasks can delete themselves and set to the NON EXISTENT (no task registration) status by using the EXIT TASK
command.
2 When the EXIT TASK command is executed, the status transition takes place as follows.

• Task that executed the EXIT TASK command → NON EXISTENT status
• Task at the head of the ready queue with higher priority → RUN status
3
Task self-delete (EXIT TASK)

EXIT TASK

4 Task 2 Task 3 Task 4 Task 3 Task 4

RUN READY READY RUN READY


Task 2

5 The task is placed in a NON EXISTENT status,


and is removed from a ready queue.
NON EXISTENT

6 Other-task delete (CUT)

Tasks can also delete the other tasks and put in the NON EXISTENT (no task registration) status by using the CUT
command.
When the CUT command is executed, the status transition takes place as follows.

• Task that executed the CUT command → RUN


• Specified task → NON EXISTENT

Other-task delete (CUT)

CUT

Task 2 Task 3 Task 4 Task 2 Task 4

RUN READY READY RUN READY


Task 3

The task is placed in a NON EXISTENT status, NON EXISTENT


and is removed from the ready queue.

If a SUSPEND command is executed for a WAIT-status task, the commands being executed by that task are ended.

6-6 Chapter 6 Multi-tasking


3.7 Stopping tasks
All tasks stop if any of the following cases occurs. 1
HALTALL command is executed. (stop & reset)
All programs are reset and task is put in the NON EXISTENT status. When the main program is specified, the HALTALL
command registers the main program in the task 1 and all tasks are put in the STOP status at the beginning line. When 2
the main program is not specified, the HALTALL command registers the program that has been executed last (current
program) in the task 1 and all tasks are put in the STOP status at the beginning line.

HOLDALL command is executed. (temporary stop) 3


All tasks are put in the STOP status. When the program is restarted, the tasks in the STOP status set to the READY or
SUSPEND status.

STOP key on the programming box is pressed or the interlock signal is cut off. 4
Just as in the case where the HOLD command is executed, all tasks are put in the STOP status.
When the program is restarted, the tasks in the STOP status set to the READY status (or, the task is placed
the SUSPEND status after being placed in the READY status).
5
When the emergency stop button on the programming box is pressed or the emergency stop signal is cut off.
All tasks are put in the STOP status. At this point, the power to the robot is shut off and the servo sets to the non-hold
state.
After the canceling emergency stop, when the program is restarted, the tasks in the STOP status are set to the READY 6
or SUSPEND status. However, a servo ON is required in order to restart
the robot power supply.

When the program is restarted without being reset after the tasks have been stopped by a cause 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.

Task status and transition 6-7


4 Multi-task program example
1
Tasks are executed in their scheduled order. An example of a multi-task program is shown below.
Sample Description

2 ’TASK1
START <SUB_TSK2>,T2
TASK1

START <SUB_TSK3>,T3
*ST1:
DO(20) = 1
3 WAIT MO(20) = 1
MOVE P,P1,P2,Z=0
IF MO(21)=1 THEN *FIN
GOTO *ST1
*FIN:
4 CUT T2
HALTALL

Program name:SUB_TSK2
’TASK2 Task 2 begins here.
5 *ST2:
IF DI(20) = 1
MO(20) = 1
DELAY 100

6
ELSE
MO(20) = 0
ENDIF
GOTO *ST2
EXIT TASK Ends here.

Program name:SUB_TSK3
’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.

6-8 Chapter 6 Multi-tasking


5 Sharing the data
1
All global variables, static variables, input/output variables, point data, shift coordinate definition data, hand definition
data, work definition data, and pallet definition data are shared between all tasks.
Execution of each task can be controlled while using the same variables and data shared with the other tasks.
2

In this case, however, use sufficient caution when rewriting the variable and data because improper changes
may cause trouble in the task processing. Take great care when sharing the same variables and data.
3

4
6 Cautionary Items

A freeze may occur if subtasks are continuously started (START command) and ended (EXIT TASK command) by a 5
main task in an alternating manner.
This occurs for the following reason: if the main task and subtask priority levels are the same, a task transition to the
main task occurs during subtask END processing, and an illegal task status then occurs when the main task attempts to
start a subtask. 6
Therefore, in order to properly execute the program, the subtask priority level must be set higher than that of the main
task. This prevents a task transition condition from occurring during execution of the EXIT TASK command.
In the sample program shown below, the priority level of task 1 (main task) is set as 32, and the priority level of task 2
is set as 31 (the lower the value, the higher the priority).

Sample Description

FLAG1 = 0 MAIN_TASK
*MAIN_TASK:
IF FLAG1=0 THEN
FLAG1 = 1
START <SUB_PGM>, T2, 31 <SUB_PGM> is started as task 2 with priority level
ENDIF 31.
GOTO *MAIN_TASK
HALTALL

'=====================
' TASK2 SUB TASK (Program name:SUB_PGM)
'=====================
*TASK2:
DRIVE(1,P1)
WAIT ARM(1)
DRIVE(1,P2)
WAIT ARM(1)
FLAG1 = 0
EXIT TASK

Sharing the data 6-9


Chapter 7
Sequence function

1 1 Sequence function.................................... 7-1


2 2 Sequence program specifications.......... 7-1
3 3 Creating a sequence program................ 7-2
4 4 Executing a sequence program.............. 7-5
5 5 Programming a sequence program....... 7-6
1 Sequence function
7
Besides normal robot programs, the RCX340/RCX320 controller can execute high-speed processing programs (sequence
programs) in response to the robot input/output (DI, DO, MO, LO, TO, SI, SO) signals.

• This function allows to monitor the input/output signals of sensors, push button switches, solenoid valves, etc. and 8
move them. The sequence program starts running simultaneously the controller is turned on.
• The sequence program can be written in the same robot language used for robot programs. (The ladder logic are not
necessary).
• Naming the program "SEQUENCE" makes the controller recognize as sequence program. 9
• For details regarding conditions to execute a sequence program, refer to "3 Executing a sequence program" in this
Chapter.
• General-purpose outputs are not reset by the program reset while the sequence function is running.
10
n NOTE
• While the "DI10" *: sequence control input" is ON, a sequence program runs according to its own cycle,
regardless of robot program starts and stops. * "SI10" instead of "DI10" when an SIO board is inserted.
• The output while a sequence program is running is as follows.
> When a dedicated PIO board is inserted: "DO12: Sequence program running" dedicated signal output
> When an SIO board is inserted: "SO12: Sequence program running" dedicated signal output
11

In the manners shown below, the reset of general-purpose output will be allowed while the sequence program 12
is operating.
• Set a sequence flag value of the controller parameter at "3".
• Select "Output Reset Enable" on the sequence execution flag dialogue in the support software.
13

2 Sequence program specifications

Item Specification
Commands Logical NOT, AND, OR, XOR, EQV, IMP

I/O Same as robot language

Program capacity 8,192 bytes (A maximum of 2,048 variables can be specified.)

Scan time 2 to 8 ms depending on the number of steps (this value changes automatically)

Sequence function 7-1


3 Creating a sequence program
7
3.1 Programming method

8 1 Select [Program Edit] from [Edit] menus on the


"MENU" screen of the programming box.

10

2
11
P r e s s t h e F1 k e y ( N E W ) o n t h e " P R O G R A M
SELECTION" screen.

12

13

3 Enter "SEQUENCE" on the program name entry


screen, and press the [OK] button.

4 Use the cursor keys (s / t) to select "SEQUENCE"


on the "PROGRAM SELECTION" screen, and then
press the F2 key (EDIT).

7-2 Chapter 7 Sequence function


5 "3.220: Program step doesn't exist" message
appears when creating a new program, and
press [Close]. 7
n NOTE
When creating a new program, the alarm occurs since no
program is written. This alarm does not occur when the robot
language exists already in a program. 8

9
6 I n p u t a p ro g r a m o n " P R O G R A M S E L E C T I O N "
screen.
A l t h o u g h u s a b l e c o m m a n d s a re re s t r i c t e d ,
editing method is same as the standard robot 10
program.
Commands which can be input are explained
at "4 Programming a sequence program" in this

11
Chapter.

12

13

Creating a sequence program 7-3


3.2 Compiling
7 Compile and create an executable sequence program.

1 Press the F3 key (SEQ CMP) on the "PROGRAM


SELECTION" screen.

10
2 The confirmation message will appear whether
you execute sequence compile.
Press [OK] to compile the program.
11

12

13

If there is a syntax error in the program, an error message


appears. When the compiling ends without any error, the
display returns to the "PROGRAM SELECTION" screen and
the letter "s" appears in "Flag". This means that the sequence
program has been compiled successfully and is ready for use.

The sequence execution program is erased and the Flag's letter "s" disappears in the following cases. In these cases
the sequence function cannot be used.

1. When the sequence program was erased.


2. When the sequence program was edited.
3. When the program data was initialized.
4. When the "9.729: Sequence object destroyed." alarm occurred.

7-4 Chapter 7 Sequence function


4 Executing a sequence program
7
All the following conditions must be satisfied to execute a sequence program.

• The sequence program has been compiled.


• The sequence program execution flag is enabled. 8
(For details regarding the sequence program execution flag, refer to the operator’s manual.)
• The external sequence control input "DI10"* contact is ON. * "SI10" when an SIO board is inserted.

Sequence program execution in progress


9
Indicated during execution

10

11
4.1 Sequence program STEP execution
The sequence program may be executed line by line while checking one command line at a time. This step execution
can be executed in the same way as normal programs. 12
For details, refer to the operator’s manual.
When the step is executed, satisfying the conditions described in the previous section is not required.

13

Executing a sequence program 7-5


5 Programming a sequence program
7
When programming a sequence program, you may use only assignment statements comprised of input/output
variables and logical operators.

8 5.1 Assignment statements


Format

9 output variable = expression

Notation Description

Any one of the following can be used.


10 • Parallel input/output variables
• Internal output variables
expression • Arm lock output variables
• Timer output variables
• Serial input/output variable
11 • The logic operation expression shown above

5.2 Input/output variables


12
Each variable must be specified in a 1-bit format
Sample Description
DO(35)
13 MO(24) Correct examples
DI(16)
DO(37, 24)
DI3(4) Incorrect examples
MO3()

5.2.1 Input variables

Parallel input variables


Format

DI(mb)

Notation Value Range


m port number 0 to 7, 10 to 17, 20 to 27
b bit definition 0 to 7
These variables show the status of the parallel input signal.

Serial input variables


Format

SI(mb)

Notation Value Range Indicates a serial input signal


m port number 0 to 7, 10 to 17, 20 to 27 status. Only referencing can
b bit definition 0 to 7 occur. No controls are possible.

7-6 Chapter 7 Sequence function


5.2.2 Output variables

Parallel output variables 7


Format
DO(mb)

Notation Value Range 8


m port number 0 to 7, 10 to 17, 20 to 27
b bit definition 0 to 7
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. 9

Internal output variables


Format 10
MO(mb)

Notation Value Range


m port number 0 to 7, 10 to 17, 20 to 27, 30 to 37 11
b bit definition 0 to 7
These variables are used within the controller.
Ports 30 to 37 are for referencing only and ON/OFF cannot be controlled.
12
Arm lock output variables
Format
LO(mb) 13
Notation Value Range
m port number 0,1
b bit definition 0 to 7
These variables are used to prohibit the arm (axis) movement. Movement is prohibited when ON.
• LO(00) to LO(07) corresponds to arm 1 to arm 8
• LO(10) to LO(17) corresponds to arm 9 to arm 16, respectively.

Timer output variables


Format
TO(mb)

Notation Value Range


m port number 0,1
b bit definition 0 to 7
There are a total of 16 timer output variables: TO(00) to TO(17).
The timer of each variable is defined by the timer definition statement TIM00 to 17.

Serial output variables


Format
SO(mb)

Notation Value Range Control or reference serial output signal


m port number 0 to 7, 10 to 17, 20 to 27 status. Port 0 is for referencing only,
b bit definition 0 to 7 and no controls are possible.

Programming a sequence program 7-7


5.3 Timer definition statement
7 Format

TIMmb=time

8 Notation Value Range


time 100 to 2,147,483,647 ms (0 second to 24 days)
m port number 0 to 7, 10 to 17, 20 to 27
b bit definition 0 to 7
9 These variables show the status of the parallel input signal.

Meaning The timer definition statement sets the timer value of the timer output variable.
This definition statement may be anywhere in the program.
10 When the timer definition statement is omitted, the timer setting value of the variable is 0.

TIM00 to 17 correspond to the timer output variables TO(00) to (17).


Although this value can be set by 1 ms unit, it is effected by the scan cycle of sequence program (2 to 8
11 ms), the updated cycle of PIO board (2 to 4 ms), or the update cycle of SIO board (5 ms).

Timer usage example


12 Sample Description

TIM02=2500 …………Timer 02 is set to 2.5 seconds.


TO(02)=DI(23) …………Timer starts when DI(23) switches ON.

13
• When DI(23) is ON, after 2.5 seconds, TO(02) is set ON.
• When DI(23) is OFF, TO(02) is also OFF.
• When DI(23) isn’t ON after 2.5 second or more, TO(02) does not change to ON.

Timer usage example: Timing chart

DI(23)

1.6sec
2.5sec

TO(02)

7-8 Chapter 7 Sequence function


5.4 Logical operators
Operators Functions Meaning
7
NOT, ~ Logical NOT Reverses the bits.
AND, & Logical AND Becomes "1" when both bits are "1".
OR, | Logical OR Becomes "1" when either of the bits is "1".
8
XOR Exclusive OR Becomes "1" when both bits are different.
EQV Logical equivalence operator Becomes "1" when both bits are equal.
IMP Logical implication operator Becomes "0" when the first bit is "1" and the second bit is "0".
9
5.5 Priority of logic operations
Priority Ranking Operation Content
1 Expressions in parentheses 10
2 NOT, ~ (Logical NOT)
3 AND, & (Logical AND)
4
5
OR, | (Logical OR)
XOR (Exclusive OR)
11
6 EQV (Logical equivalence operator)
7 IMP (Logical implication operator)

12
Example with a ladder statement substitution
Sample

DO(23)=DI(16)&DO(35)
MO(34)=DO(25) | ~DI(24) 13
DO(31)=(DI(20) | DO(31))&~DI(21)

Ladder diagram
DI(16) DO(35) DO(23)

DO(25) MO(34)

~DI(24)

DI(20) ~DI(21) DO(31)

DO(31) (Self-hold circuit)

• "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 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.

Programming a sequence program 7-9


Chapter 8
Robot Language

Robot language list.................................................... 8-1


1 ABS......................................................... 8-7
2 ABSRPOS................................................ 8-8
3 ACCEL.................................................... 8-9
4 ARCHP1 / ARCHP2.............................. 8-10
5 ARMCND.............................................. 8-12
6 ARMSEL................................................. 8-13
7 ARMTYP................................................ 8-14
8 ASPEED................................................. 8-15
9 ATN / ATN2........................................... 8-16
10 AXWGHT............................................... 8-17
11 CALL..................................................... 8-18
12 CHANGE............................................... 8-19
13 CHGPRI................................................. 8-20
14 CHGWRK.............................................. 8-21
15 CHR$..................................................... 8-22
16 CLOSE................................................... 8-23
17 CONTPLS............................................... 8-24
18 CORRECTXY......................................... 8-25
19 COS...................................................... 8-26
20 CREWRK................................................ 8-27
21 CURTQST............................................... 8-28
22 CURTRQ................................................ 8-29
23 CUT....................................................... 8-30
24 DATE$.................................................... 8-31
25 DECEL................................................... 8-32
26 DEF FN................................................... 8-33
27 DEGRAD............................................... 8-34
28 DELAY.................................................... 8-35
29 DI.......................................................... 8-36
30 DIM....................................................... 8-37
31 DIST....................................................... 8-38
32 DO........................................................ 8-39
33 DRIVE.................................................... 8-41
34 DRIVEI................................................... 8-45
35 END SELECT........................................... 8-50
36 END SUB................................................ 8-51
37 ERR / ERL............................................... 8-52
38 ETHSTS................................................... 8-53
39 EXIT FOR............................................... 8-54
40 EXIT SUB................................................ 8-55
41 EXIT TASK.............................................. 8-56
42 FOR to NEXT......................................... 8-57
43 GEPSTS.................................................. 8-58
44 GOSUB to RETURN................................ 8-59
45 GOTO................................................... 8-60
46 HALT...................................................... 8-61
47 HALTALL................................................ 8-62
48 HAND.................................................... 8-63
49 HOLD.................................................... 8-68
50 HOLDALL............................................... 8-69
51 IF........................................................... 8-70
52 INPUT..................................................... 8-72
53 INROFST................................................ 8-74
54 INT......................................................... 8-75
55 JTOXY................................................... 8-76
56 LEFT$..................................................... 8-77
57 LEFTY..................................................... 8-78
58 LEN........................................................ 8-79
59 LET......................................................... 8-80
60 LO......................................................... 8-83
61 LOCx..................................................... 8-85
62 LSHIFT.................................................... 8-87
63 MCHREF................................................ 8-88
64 MID$..................................................... 8-89
65 MO........................................................ 8-90
66 MOTOR................................................. 8-92
67 MOVE................................................... 8-93
68 MOVEI................................................ 8-110
69 MOVET................................................ 8-111
70 MTRDUTY............................................. 8-112
71 OFFLINE.............................................. 8-113
72 ON ERROR GOTO............................... 8-114
73 ON to GOSUB..................................... 8-115
74 ON to GOTO...................................... 8-116
75 ONLINE............................................... 8-117
76 OPEN.................................................. 8-118
77 ORD.................................................... 8-119
78 ORGORD............................................ 8-120
79 ORIGIN............................................... 8-121
80 OUT..................................................... 8-122
81 OUTPOS.............................................. 8-123
82 PATH.................................................... 8-125
83 PATH END............................................ 8-129
84 PATH SET.............................................. 8-130
85 PATH START.......................................... 8-133
86 PDEF.................................................... 8-135
87 PGMTSK.............................................. 8-136
88 PGN.................................................... 8-137
89 PMOVE............................................... 8-138
90 Pn........................................................ 8-143
91 PPNT.................................................... 8-145
92 PRINT................................................... 8-146
93 PSHFRC............................................... 8-147
94 PSHJGSP............................................. 8-148
95 PSHMTD.............................................. 8-149
96 PSHRSLT............................................... 8-150
97 PSHSPD............................................... 8-151
98 PSHTIME.............................................. 8-152
99 PUSH................................................... 8-153
100 RADDEG............................................. 8-158
101 REFTSK................................................. 8-159
102 REM..................................................... 8-160
103 RESET................................................... 8-161
104 RESTART............................................... 8-162
105 RESUME............................................... 8-163
106 RETURN................................................ 8-164
107 RIGHT$................................................ 8-165
108 RIGHTY................................................ 8-166
109 RSHIFT................................................. 8-167
110 SCRINR................................................ 8-168
111 SELECT CASE to END SELECT.............. 8-169
112 SEND................................................... 8-170
113 SERVO................................................. 8-172
114 SET....................................................... 8-173
115 SETGEP................................................ 8-174
116 SGI...................................................... 8-175
117 SGR..................................................... 8-176
118 SHARED............................................... 8-177
119 SHIFT................................................... 8-178
120 SI......................................................... 8-179
121 SID....................................................... 8-180
122 SIN...................................................... 8-181
123 SIW...................................................... 8-182
124 Sn........................................................ 8-183
125 SO....................................................... 8-184
126 SOD..................................................... 8-186
127 SOW.................................................... 8-187
128 SPEED.................................................. 8-188
129 SQR..................................................... 8-189
130 START................................................... 8-190
131 STR$..................................................... 8-191
132 SUB to END SUB.................................. 8-192
133 SUSPEND............................................. 8-194
134 SWI...................................................... 8-195
135 TAN..................................................... 8-196
136 TCOUNTER.......................................... 8-197
137 TIME$.................................................. 8-198
138 TIMER.................................................. 8-199
139 TO....................................................... 8-200
140 TOLE.................................................... 8-201
141 TORQUE.............................................. 8-202
142 TSKPGM.............................................. 8-204
143 VAL...................................................... 8-205
144 WAIT.................................................... 8-206
145 WAIT ARM........................................... 8-207
146 WEIGHT............................................... 8-208
147 WEIGHTG............................................ 8-209
148 WEND.................................................. 8-210
149 WHERE................................................. 8-211
150 WHILE to WEND.................................. 8-212
151 WHRXY................................................ 8-213
152 WRKDEF.............................................. 8-214
153 XYTOJ................................................. 8-216
Robot language list
8
The key to reading the following robot language table is explained below.
(1) (2) (3) (4)
|
Name
|
Description
|
Online
|
Type
9
DIM Declares array variable - Command

(1) Name 10
Indicates each robot language (command) name.

(2) Description
Explains the function of the robot language. 11
(3) Online
If "3" is indicated at this item, online commands can be used.
If "-" is indicated at this item, commands containing operands that cannot partially be executed by online command. 12
(4) 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 13
Name Description Online Type

A
ABS Acquires the absolute value of a specified value. 3 Function
Acquires the machine reference value for specified robot
ABSRPOS axes. (Valid only for axes whose return-to-origin method is 3 Function
set as "mark".)
Specifies/acquires the acceleration coefficient parameter of Command /
ACCEL 3
a specified robot. Function
Specifies/acquires the arch distance 1 parameter of a Command /
ARCHP1 3
specified robot. Function
Specifies/acquires the arch distance 2 parameter of a Command /
ARCHP2 3
specified robot. Function
ARMCND Acquires the current arm status of a specified robot. 3 Function
Specifies/acquires the current "hand system" setting of a Command /
ARMSEL 3
specified robot. Function
Specifies/acquires the "hand system" setting of a specified Command /
ARMTYP 3
robot. Function
Specifies/acquires the AUTO movement speed of a Command /
ASPEED 3
specified robot. Function
ATN Acquires the arctangent of the specified value. 3 Function
ATN2 Acquires the arctangent of the specified X-Y coordinates. 3 Function
Specifies/acquires the axis tip weight parameter of a Command /
AXWGHT 3
specified robot. Function

C
CALL Calls a sub-procedure. - Command
CHANGE Switches the hand data of a specified robot. 3 Command
CHGPRI Changes the priority ranking of a specified task. 3 Command
CHGWRK Switches the work data of a specified robot. 3 Command
CHR$ Acquires a character with the specified character code. 3 Function

Robot language list 8-1


Name Description Online Type

8 CLOSE Close the specified General Ethernet Port. 3 Command


Command /
CONTPLS Specifies/acquires CONT pulse parameter of specified robot. 3
Function
Acquires the target position corrected for workpiece gripping
CORRECTXY 3 Function
9
position misalignment.
COS Acquires the cosine value of a specified value. 3 Function
Creates the work data from the offset; difference between 2
CREWRK 3 Function
point data
Acquires the current torque value ratio of a specified axis to
10 CURTQST
the rated torque.
3 Function

Acquires the current torque value of the specified axis of a


CURTRQ 3 Function
specified robot.
Terminates another task currently being executed or
CUT Command
11
3
temporarily stopped.

D
DATE$ Acquires the date as a "yy/mm/dd" format character string. 3 Function
Specifies/acquires the deceleration rate parameter of a Command /
12 DECEL
specified robot.
3
Function
DEF FN Defines the functions that can be used by the user. - Command
DEGRAD Converts a specified value to radians (↔RADDEG). 3 Function
DELAY Waits for the specified period (units: ms). - Command
13 DI Acquires the specified DI status. 3 Function
DIM Declares the array variable name and the number of elements. - Command
DIST Acquires the distance between 2 specified points. 3 Function
Outputs a specified value to the DO port or acquires the DO Command /
DO 3
status. Function
DRIVE Moves a specified axis of a specified robot to an absolute position. 3 Command
DRIVEI Moves a specified axis of a specified robot to a relative position. 3 Command

E
END SELECT Terminates the SELECT CASE statement. - Command
END SUB Terminates the sub-procedure definition. - Command
Acquires the error code number of an error which has
ERR / ERL 3 Function
occurred / the line number where an error occurred.
ETHSTS Acquires the Ethernet port status. 3 Function
EXIT FOR Terminates the FOR to NEXT statement loop. - Command
Terminates the sub-procedure defined by the SUB to END
EXIT SUB - Command
statement.
EXIT TASK Terminates its own task which is in progress. - Command

F
Executes the FOR to NEXT statement repeatedly until a
FOR to NEXT - Command
specified value is exceeded.

G
GEPSTS Acquires the General Ethernet Port status. 3 Function
GOSUB to Jumps to a subroutine with the label specified by GOSUB
- Command
RETURN statement, and executes that subroutine.
GOTO Unconditionally jumps to the line specified by a label. - Command

H
HALT Stops the program and performs a reset. - Command
HALTALL Stops and resets all programs. - Command
HAND Defines the hand of a specified robot. 3 Command

8-2 Chapter 8 Robot Language


Name Description Online Type
HOLD Temporarily stops the program. - Command 8
HOLDALL Temporarily stops all programs. - Command

I
IF Allows control flow to branch according to conditions. Command
9
-
INPUT Assigns a value to a variable specified from the programming box. 3 Command
Command /
INROFST Specifies/acquires R axis inertia offset for SCARA parameter. 3
Function
Acquires an integer for a specified value by truncating all
INT
decimal fractions.
3 Function
10
J
Converts joint coordinate data to Cartesian coordinate data
JTOXY 3 Function
of a specified robot. (↔XYTOJ)

L 11
Extracts a character string comprising a specified number
LEFT$ 3 Function
of digits from the left end of a specified character string.
Sets the hand system of a specified robot to the left-handed
LEFTY
system.
3 Command 12
LEN Acquires the length (byte count) of a specified character string. 3 Function
LET Executes a specified assignment statement. 3 Command
Outputs a specified value to the LO port to enable/disable Command /
LO
axis movement or acquires the LO status.
3
Function 13
Specifies/acquires point data for a specified axis or Command /
LOCx 3
shift/work data for a specified element. Function
LSHIFT Shifts a value to the left by the specified bit count. (↔RSHIFT) 3 Function

M
Acquires the return-to-origin or absolute-search machine
reference value for specified robot axes. (Valid only for axes
MCHREF 3 Function
whose return-to-origin method is set as "sensor" or "stroke-
end".)
Extracts a character string of a desired length from a
MID$ 3 Function
specified character string.
Outputs a specified value to the MO port or acquires the Command /
MO 3
MO status. Function
MOTOR Controls the motor power status. 3 Command
MOVE Performs absolute movement of all axes of a specified robot. 3 Command
MOVEI Performs relative movement of all axes of a specified robot. 3 Command
Performs relative movement of all axes of a specified robot
MOVET 3 Command
when the tool coordinate is selected.
MTRDUTY Acquires the motor load factor of the specified axis. 3 Function

O
OFFLINE Sets a specified communication port to the "offline" mode. 3 Command
This command allows the program to jump to the error
ON ERROR processing routine specified by the label without stopping
- Command
GOTO the program, or it stops the program and displays the error
message.
Jumps to a subroutine with labels specified by a GOSUB
ON to GOSUB statement in accordance with the conditions, and executes - Command
that subroutine.
ON to GOTO Jumps to label-specified lines in accordance with the conditions. - Command
ONLINE Sets the specified communication port to the "online" mode. 3 Command
OPEN Opens the specified General Ethernet Port. 3 Command

Robot language list 8-3


Name Description Online Type

8 ORD
Acquires the character code of the first character in a
specified character string.
3 Function

Specifies/acquires the axis sequence parameter for


Command /
ORGORD performing return-to-origin and an absolute search 3
Function
operation in a specified robot.
9 ORIGIN Performs return-to-origin. 3 Command
Turns ON the bits of the specified output ports and
OUT - Command
terminates the command statement.
Specifies/acquires the "OUT position" parameter of a Command /
OUTPOS
10
3
specified robot. Function

P
PATH Specifies the PATH motion path. - Command
PATH END Ends the path setting for PATH motion. - Command
11 PATH SET Starts the path setting for PATH motion. - Command
PATH START Starts the PATH motion. - Command
PDEF Defines the pallet used to execute pallet movement commands. 3 Command

12
Acquires the task number in which a specified program is
PGMTSK 3 Function
registered.
Acquires the program number from a specified program
PGN 3 Function
name.
PMOVE Executes the pallet movement command of a specified robot. 3 Command
13 Pn Defines points within a program. 3 Command
Creates point data specified by a pallet definition number
PPNT 3 Function
and pallet position number.
PRINT Displays a character string at the programming box screen. - Command
Command /
PSHFRC Specifies/acquires the "Push force" parameter. 3
Function
Specifies/acquires the push judge speed threshold Command /
PSHJGSP 3
parameter. Function
Command /
PSHMTD Specifies/acquires the push method parameter. 3
Function
PSHRSLT Acquires the status at the end of the PUSH statement. 3 Function
Command /
PSHSPD Specifies/acquires the push speed parameter. 3
Function
Command /
PSHTIME Specifies/acquires the push time parameter. 3
Function
PUSH Executes a pushing operation in the axis unit. 3 Command
R
RADDEG Converts a specified value to degrees. (↔DEGRAD) 3 Function
REFTSK Acquires the status of the task. 3 Function
REM Expresses a comment statement. - Command
RESET Turns the bit of a specified output port OFF. 3 Command
RESTART Restarts another task during a temporary stop. 3 Command
RESUME Resumes program execution after error recovery processing. - Command
Returns the processing branching with GOSUB to the next
RETURN - Command
line of GOSUB.
Extracts a character string comprising a specified number
RIGHT$ 3 Function
of digits from the right end of a specified character string.
Sets the hand system of a specified robot to the right-
RIGHTY 3 Command
handed system.
RSHIFT Shifts a value to the right by the specified bit count. (↔LSHIFT) 3 Function

8-4 Chapter 8 Robot Language


Name Description Online Type

S 8
Command /
SCRINR Specifies/acquires R axis inertia for SCARA parameter. 3
Function
SELECT CASE
Allows control flow to branch according to conditions. - Command
to END SELECT
9
SEND Sends a file. 3 Command
Controls the servo ON/OFF of a specified axis or all axes of
SERVO 3 Command
a specified robot.
SET
SETGEP
Turns the bit at the specified output port ON.
Sets the General Ethernet Port.
-
3
Command
Command
10
Assigns the value to a specified integer type static variable / Command /
SGI 3
acquires the value of a specified integer type static variable. Function

11
Assigns the value to a specified real type static variable / Command /
SGR 3
acquires the value of a specified real type static variable. Function
SHARED Enables reference with a sub-procedure without transferring a variable. - Command
Sets the shift coordinate for a specified robot by using the
SHIFT 3 Command
shift coordinate data specified by a shift variable.
SI Acquires a specified SI status. 3 Function 12
Acquires a specified serial input's double-word information
SID 3 Function
status.
SIN Acquires the sine value for a specified value. 3 Function
SIW Acquires a specified serial input's word information status. 3 Function 13
Sn Defines the shift coordinates within the program. 3 Command
Outputs a specified value to the SO port or acquires the SO Command /
SO 3
status. Function
Outputs a specified serial output's double-word information Command /
SOD 3
or acquires the output status. Function
Outputs a specified serial output's word information or Command /
SOW 3
acquires the output status. Function
SPEED Changes the program movement speed of a specified robot. 3 Command
SQR Acquires the square root of a specified value. 3 Function
Specifies the task number and priority ranking of a specified
START 3 Command
program, and starts that program.
STR$ Converts a specified value to a character string (↔VAL). 3 Function
SUB to END SUB Defines a sub-procedure. - Command
SUSPEND Temporarily stops another task which is being executed. - Command
Switches the program being executed, then begins
SWI - Command
execution from the first line.

T
TAN Acquires the tangent value for a specified value. 3 Function
Outputs count-up values at 1ms intervals starting from the
TCOUNTER 3 Function
point when the TCOUNTER variable is reset.
TIME$ Acquires the current time as an "hh:mm:ss" format character string. 3 Function
TIMER Acquires the current time in seconds, counting from midnight. 3 Function
Outputs a specified value to the TO port or acquires the TO Command /
TO 3
status. Function
Specifies/acquires the tolerance parameter of a specified Command /
TOLE 3
robot. Function
Specifies/acquires the maximum torque command value Command /
TORQUE 3
which can be set for a specified axis of a specified robot. Function
Acquires the program number which is registered in a
TSKPGM 3 Function
specified task.

Robot language list 8-5


Name Description Online Type

8 V
Converts the numeric value of a specified character string
VAL 3 Function
to an actual numeric value. (↔STR$)
W
9 WAIT
Waits until the conditions of the DI/DO conditional
- Command
expression are met (with time-out).
WAIT ARM Waits until the axis operation of a specified robot is completed. - Command
Specifies/acquires the tip weight (kg) parameter Command /
10
WEIGHT 3
of a specified robot. Function
Specifies/acquires the tip weight (g) parameter Command /
WEIGHTG 3
of a specified robot. Function
WEND Terminates the command block of the WHILE statement. - Command

11 WHERE
Reads out the current position of the arm of a specified
robot in joint coordinates (pulse).
3 Function

WHILE to WEND Controls repeated operations. - Command


Reads out the current position of the arm of a specified
WHRXY 3 Function
robot as Cartesian coordinates (mm, degrees).
12 WRKDEF
Defines the work data
Command
3
(Creates the work data of the specified number)
X
Converts the point variable Cartesian coordinate data to the
13 XYTOJ
joint coordinate data of a specified robot. (↔JTOXY).
3 Function

8-6 Chapter 8 Robot Language


1 ABS
Acquires absolute values 8

Format

ABS (expression)

A
Explanation Returns a value specified by an <expression> as an absolute value.

B
Sample Description
A=ABS(-362.54)………… The absolute value of -362.54 (=362.54) is assigned to variable A. C

Robot language list 8-7


2 ABSRPOS
8 Acquires the machine reference value (axes: mark method)

Format

ABSRPOS [robot number](axis number)

A
Value Range

B Robot Number 1 to 4 (If not input, robot 1 is specified.)


Axis Number 1 to 6

C
Explanation Acquires the machine reference value (units: %) of axes.
This function is valid only for axes whose return-to-origin method is set as "Mark", not for "Sensor" or
D "Stroke-end".

At axes where return-to-origin method is set to "mark" method, absolute reset is possible when the machine reference
F value is in a 44 to 56% range.

G
Sample Description
A=ABSRPOS(4) ……………
The machine reference value for axis 4 of robot 1 is assigned to
H variable A.

8-8 Chapter 8 Robot Language


3 ACCEL
Specifies/acquires the acceleration coefficient parameter 8

Format

1. ACCEL [robot number] expression


2. ACCEL [robot number] (axis number) = expression
A

Value Range
B
Robot Number 1 to 4 (If not input, robot 1 is specified.)
Axis Number 1 to 6
Expression 1 to 100 (units: %) C

Explanation Changes the acceleration coefficient parameter to the <expression> value.


D
[Format 1] changes all axes of specified robot.
[Format 2] changes the only axis specified by <axis number>. E

G
Functions

Format H
ACCEL [robot number] (axis number)
I
Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.) J
Axis Number 1 to 6

K
Explanation Acquires the acceleration coefficient parameter value of axis.
L
Sample Description
A=50
M
ACCEL A ………
The acceleration coefficient of all axes of robot 1 becomes
ACCEL(3)=100 50%.
………Only axis 3 of robot 1 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 of axis 3 of robot 1
HALT "END TEST" is assigned to variable A.

Robot language list 8-9


4 ARCHP1 / ARCHP2
8 Specifies/acquires the arch distance parameter

Format

1. ARCHP1[robot number] expression


2. ARCHP1[robot number] (axis number) = expression
A
Format

B 1. ARCHP2[robot number] expression


2. ARCHP2[robot number] (axis number) = expression
C

Value Range
D
Robot Number 1 to 4 (If not input, robot 1 is specified.)
Axis Number 1 to 6
E Expression 0 to 99999999 (Unit: pulse)

F Explanation ARCHP1 corresponds to the arch distance 1 parameter; ARCHP2 corresponds to the arch distance 2
parameter, respectively.

G Changes the parameter’s arch distance to the value indicated in the <expression>.
[Format 1] changes all axes of specified robot.
[Format 2] changes the only axis specified by <axis number> to the value indicated in the <expression>.
H

J Functions

Format
K
ARCHP1 [robot number] (axis number)

L Format

ARCHP2 [robot number] (axis number)


M
Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.)
Axis Number 1 to 6

Explanation ARCHP1 corresponds to the arch distance 1 parameter; ARCHP2 corresponds to the arch distance 2
parameter, respectively.
Acquires the arch distance parameter value of the axis specified at <axis number>.

8-10 Chapter 8 Robot Language


ARCHP1 / ARCHP2
8
Sample Description
ARCHP1(3)=10 ………
The arch distance 1 parameter value of the 3rd axis of robot 1
changes to 10 pulses.
ARCHP2(3)=20 ………
The arch distance 2 parameter value of the 3rd axis of robot 1
changes to 20 pulses
. A
.
.
FOR B=1 TO 4 B
SAV(B-1)=ARCHP1(B)
NEXT ………
The arch distance parameters ARCHP1(1) to (4) are assigned to
array variables SAV(0) to (3). C

Robot language list 8-11


5 ARMCND
8 Acquires the current arm status

Format

ARMCND [robot number]

A
Value Range

B Robot Number 1 to 4 (If not input, robot 1 is specified.)

C Explanation This function acquires the current arm status of the SCARA robot.
The robot to acquire an arm status is specified by the <robot number>.
The arm status is "1" for a right-handed system and "2" for a left-handed system.
D This function is enabled only when a SCARA robot is used.

E
Sample Description

F A=ARMCND
IF A=1 THEN
………
The current arm status of robot 1 is assigned to variable A.
………
Right-handed system status.
MOVE P, P100, Z=0

G ELSE
MOVE P, P200, Z=0
………
Left-handed system status.

ENDIF

8-12 Chapter 8 Robot Language


6 ARMSEL
Sets/acquires the current hand system selection 8

Format

ARMSEL [robot number] expression

A
Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.)
B
Expression 1: right hand system, 2: left hand system

C
Explanation This function sets the current hand system selection of the SCARA robot. A robot to set a hand system is
specified by the <robot number>.
This function is enabled only when a SCARA robot is used.
D

Sample Description E
ARMSEL[2] 2 ………
Sets the left-handed system for the hand system selection of
the robot 2.
F

H
Functions

Format I
ARMSEL [robot number]
J
Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.)
K

L
Explanation This function acquires the hand system currently selected for the SCARA robot. The robot to acquire a
hand system is specified by the <robot number>.
The arm type is "1" for a right-handed system, and "2" for a left-handed system. This function is enabled M
only when a SCARA robot is used.

Sample Description
A=ARMSEL ………
The current hand system selection of robot 1 is assigned to the
variable A.
IF A=1 THEN ………
The hand system selection is a right-handed system.
MOVE P,P100,Z=0
ELSE ………
The hand system selection is a left-handed system.
MOVE P,P200,Z=0
ENDIF

Robot language list 8-13


7 ARMTYP
8 Sets/acquires the hand system selection during program reset

Format

ARMTYP [robot number] expression

A
Value Range

B Robot Number 1 to 4 (If not input, robot 1 is specified.)


Expression 1: right hand system, 2: left hand system

C
Explanation This function sets the hand system at program reset of the SCARA robot.
A robot to set a hand system selection is specified by the <robot number>.
D This function is enabled only when a SCARA robot is used.

E Sample Description
ARMTYP[2] 2 ………
Sets the left-handed system for the hand system of the robot 2.

H Functions

Format
I
ARMTYP [robot number]

J
Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.)
K

L Explanation This function provides the hand system at program reset of the SCARA robot.
The robot to acquire a hand system is specified by the <robot number>.
The arm type is "1" for a right-handed system, and "2" for a left-handed system. This function is enabled
M only when a SCARA robot is used.

Sample Description
A=ARMTYP ………
The arm type value of robot 1 is assigned to the variable A.
IF A=1 THEN ………
The arm type is a right-handed system.
MOVE P,P100,Z=0
ELSE ………
The arm type is a left-handed system.
MOVE P,P200,Z=0
ENDIF
HALTALL ………Program reset

8-14 Chapter 8 Robot Language


8 ASPEED
Sets/acquires the AUTO movement speed of robot 8

Format

ASPEED [robot number] expression

Value Range A
Robot Number 1 to 4 (If not input, robot 1 is specified.)
Expression 1 to 100 (units: %)
B
Explanation Changes the automatic movement speed to the <expression> value.
This speed change applies to all axes. C
The operation speed is determined by the product of the automatic movement speed (specified by
programming box operation and by the ASPEED command), and the program movement speed (specified
D
by SPEED command, etc.).
Operation speed = automatic movement speed x program movement speed. E
Example:
Automatic movement speed: 80%
Program movement speed: 50% F
Movement speed = 40% (80% × 50%)

G
n NOTE
This command only defines the maximum speed, and does not guarantee the movement at the specified speed.
• Automatic movement speed: Specified by programming box operation or by the ASPEED command.
• Program movement speed: Specified by SPEED commands or MOVE, DRIVE speed settings. H

I
Functions

Format
J
ASPEED [robot number]

Value Range
K
Robot Number 1 to 4 (If not input, robot 1 is specified.)
L
Explanation Acquires the automatic movement speed value of robot.

M
Sample Description
SPEED 70
ASPEED 100
MOVE P,P0 ………
Movement from the current position to P0 occurs
at 70% speed (= 100 * 70) of the robot 1.
ASPEED 50
MOVE P,P1 ………
Movement from the current position to P1 occurs
at 35% speed (= 50 * 70) of the robot 1.
MOVE P,P2,S=10 ………
Movement from the current position to P2 occurs
at 5% speed (= 50 * 10) of the robot 1.
HALT

Related commands SPEED

Robot language list 8-15


9 ATN / ATN2
8 Acquires the arctangent of the specified value

Format

ATN (expression)

A Format

ATN2 (expression 1, expression 2)


B
Explanation ATN: Acquires the arctangent values of the specified <expression> values. The acquired values are
C radians within the following range: - π / 2 to + π / 2
ATN2: Acquires the arctangent values of the specified <expression 1> and <expression 2> X-Y
coordinates. The acquired values are radians within the following range: - π to + π
D

E Sample Description
A(0)=A*ATN(Y/X) ………
The product of the expression (Y / X) arctangent value and
variable A is assigned to array A (0).
F A(0)=ATN(0.5) ………
The 0.5 arctangent value is assigned to array A (0).
A(0)=ATN2(B,C)-D ………
The difference between the X-Y coordinates (B,C) arctangent
value and variable D is assigned to array A (0).
G A(1)=RADDEG(ATN2(B,C)) ………
The X-Y coordinates (B,C) arctangent value is converted to
degrees, and is then assigned to array A (1).

H
Related commands COS, DEGRAD, RADDEG, SIN, TAN
I

8-16 Chapter 8 Robot Language


10 AXWGHT
Sets/acquires the axis tip weight 8

Format

AXWGHT [robot number] (axis number) = expression

A
Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.) B
Axis Number 1 to 6
Expression Varies according to the specified robot.
C
Explanation Changes the axis tip weight parameter for the specified axis to the <expression> value.
This statement is valid in systems with "MULTI" axes and auxiliary axes (the robot type and auxiliary
D
axes are factory set prior to shipment).
E

F
Functions

Format
G
AXWGHT [robot number] (axis number)
H

Value Range
I
Robot Number 1 to 4 (If not input, robot 1 is specified.)
Axis Number 1 to 6
J
Explanation Acquires the axis tip weight parameter value for the specified axis.
This statement is valid in systems with "MULTI" axes and auxiliary axes.
K

L
Sample Description
A=5
B=0
M
C=AXWGHT(1) ………
A xis tip weight value of the axis 1 of the robot 1 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 of the axis 1 of the robot 1 is set again.
HALT

Related commands WEIGHT, WEIGHTG

Robot language list 8-17


11 CALL
8 Calls a sub-procedure

Format

CALL label (actual argument , actual argument…)

A
Explanation This statement calls up sub-procedures defined by the SUB to END SUB statements.
The <label> specifies the same name as that defined by the SUB statement.
B
1. When a constant or expression is specified as an actual argument, its value is passed on to the sub-
procedure.
C 2. When a variable or array element is specified as an actual argument, its value is passed on to the sub-
procedure. It will be passed on as a reference if "REF" is added at the head of the actual argument.
3. When an entire array (array name followed by parentheses) is specified as an actual argument, it is
D passed along as a reference.

E n NOTE
• When a value is passed on to a sub-procedure, the original value of the actual argument will not be changed
even if it is changed in the sub-procedure.
• When a reference is passed on to a sub-procedure, the original value of the actual argument will also be
F changed if it is changed in the sub-procedure.
• For details , refer to Chapter 3 "8 Value Pass-Along & Reference Pass-Along".

G
• CALL statements can be used up to 120 times in succession. Note that this number is reduced if commands which
H use stacks such as an FOR or GOSUB statement are used, or depending on the use status of identifiers.
• Always use the END SUB or EXT SUB statement to end a sub-procedure which has been called with the CALL
I statement. If another statement such as GOTO is used to jump out of the sub- routine, a "5.212: Stack overflow"
error, etc., may occur.

J
Sample 1 Sample 2

K X%=4
Y%=5
I = 1
CALL *TEST( I )
CALL *COMPARE ( REF X%, REF Y% ) HALT
L HALT
’SUB ROUTINE: COMPARE
’SUB ROUTINE: TEST
SUB *TEST
SUB *COMPARE ( A%, B% ) X = X + 1
M IF A% < B% THEN
TEMP%=A%
IF X < 15 THEN
CALL *TEST( X )
A%=B% ENDIF
B%=TEMP% END SUB
ENDIF
END SUB

Reference For description of sample program, refer to "132 SUB to END SUB" in this Chapter.

Related commands SUB, END SUB, EXIT SUB, SHARED

8-18 Chapter 8 Robot Language


12 CHANGE
Switches the hand data 8

Format

CHANGE [robot number] Hn


OFF
A

Notation Value Range


B
Robot Number 1 to 4 (If not input, robot 1 is specified.)
n Hand Number 0 to 31
C
Explanation CHANGE is used to switch the robot hand data.
If OFF is specified, the hand setting is not enabled.
D

Before switching the hand data, the hands must be defined at the HAND statement, the programming E
box, or the support software.
If the hand data with another robot setting is specified, "6.258: Illegal robot no" error occurs.
F
Reference "HAND"

G
Sample Description
HAND H1= 0 150.000 0.000
H
HAND H2= -5000 20.0000 0.000
P1=150.000 300.000 0.000 0.000 0.000 0.000
I
CHANGE H2 ………
Changes the hand data of the robot 1 to hand 2.
MOVE P,P1 ………
Moves the hand 2 tip of the robot 1 to P1 (1).
CHANGE H1 ………
Changes to hand 1. J
MOVE P,P1 ………
Moves the hand 1 tip to P1 (2).
HALT
K

Robot language list 8-19


13 CHGPRI
8 Changes the priority ranking of task

Format

CHGPRI Tn ,p
<program name>
A
PGm

B
Notation Value Range
C m Program Number 0 to 100
n Task Number 1 to 16

D p Task Priority Ranking 1 to 64

E Explanation Changes the priority ranking of task "n" to "p".


The smaller the priority number, the higher the priority (high priority: 1 to low priority: 64).
When a READY status occurs at a task with higher priority, all tasks with lower priority also remain in
F READY status.

G
Sample Description

H START <SUB _ PGM>,T2,33


*ST:
………Main Program

MOVE P,P0,P1

I IF DI(20) = 1 THEN
CHGPRI T2,32
………
When DI (20)
………The priority
is
of
ON,
Task 2 is No. 32
ELSE ………
When DI (20) is OFF,

J CHGPRI T2,33
ENDIF
………The priority of Task 2 is No. 33

GOTO *ST

K HALTALL
………Program name: SUB _ PGM (Sub task)
’SUBTASK ROUTINE ………From this line, Task 2

L *SUBTASK:
IF LOC3(WHERE) > 10000 THEN
DO(20) = 1

M GOTO *SUBTASK
ENDIF
DO(20) = 0
GOTO *SUBTASK ………Down to this line, Task 2 processing
EXIT TASK ………Ends Task 2 (own task: SUB _ PGM)

Related commands CUT, EXIT TASK, RESTART, SUSPEND, START

8-20 Chapter 8 Robot Language


14 CHGWRK
Switches the work data 8

Format

CHGWRK [robot number] Wn


OFF
A

Notation Value Range


B
Robot Number 1 to 4 (If not input, robot 1 is specified.)
n Work Number 0 to 39
C
Explanation CHGWRK is used to switch the work data of robot.
If OFF is specified, the work setting is not enabled.
D

Before switching the work data, always define the work data using the WRKDEF statement, E
the programming box, or the support software.

Reference "WRKDEF" F
Operation Manual "Work definitions"

G
Sample Description
H
CHANGE H1 ………
Changes the hand data of the robot 1 to hand 1.
MOVE P,P1 ………
Moves the hand 1 tip of the robot 1 to P1.
WRKDEF W1 = 115.000 -50.000 0.000 30.000 I
CHGWRK W1 ………
Changes the work data of the robot 1 to work 1.
MOVE P,P2 ………
Moves the work 1 tip of the robot 1 to P2.
HALT J

K
Related commands CREWRK, WRKDEF
L

Robot language list 8-21


15 CHR$
8 Acquires a character with the specified character code

Format

CHR$ expression

A
Value Range

B Expression 0 to 255

C Explanation Acquires a character with the specified character code. An error occurs if the <expression> value is
outside the 0 to 255 range.

D
Sample Description
E A$=CHR$(65) ………
"A" is assigned to A$.

F
Related commands ORD
G

8-22 Chapter 8 Robot Language


16 CLOSE
Closes the specified General Ethernet Port 8

Format

CLOSE GPm

A
Notation Value Range
m General Ethernet Port number 0 to 7 B

Explanation Closes the communication port of the specified General Ethernet Port. C

Sample Description
D
OPEN GP1 ………
Opens the General Ethernet Port 1.
SEND "123" TO GP1 ………
Sends the character strings "123" from the General Ethernet E
Port 1.
SEND GP1 TO A$ ………
Receives the data from the General Ethernet Port 1 and Saves
the received data in the variable A$. F
CLOSE GP1 ………
Closes the General Ethernet Port 1.

G
Related commands OPEN, SEND, SETGEP, GEPSTS
H

Robot language list 8-23


17 CONTPLS
8 Specifies/acquires CONT pulse parameter of specified robot.

Format

1.CONTPLS [robot number] expression


2.CONTPLS [robot number] (axis number) = expression
A
Value Range

B Robot Number 1 to 4 (If not input, robot 1 is specified.)


Axis Number 1 to 6 (If not input, all axes are specified.)
Expression 0 to 99999999 (unit: pulse)
C
Explanation Changes the CONT pulse parameter value of axis to the value indicated in the <expression>.
[Format 1] changes all axes of specified robot.
D [Format 2] changes only the axis specified by <axis number>.
Reference "MOVE" CONT setting
E

F Functions

Format
G
CONTPLS [robot number] (axis number)

H Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.)
1 to 6 (If not input, all axes are specified.)
I Axis Number

Explanation Acquires the CONT pulse parameter value of specified axis.


J
Sample 1 Description
K
CONTPLS 20000 Changes the CONTPLS parameter for all axes of Robot 1
……
to 20000
L Sample 2 Description
CONTPLS (3) = 20000 ……
Changes the CONTPLS parameter for 3rd axis of Robot 1
M to 20000

Sample 3 Description
A% = CONTPLS(3) ……
Acquires the value of the CONTPLS parameter for 3rd
axis of robot 1,
Assigns it to integer variable A%

8-24 Chapter 8 Robot Language


18 CORRECTXY
Acquires the target position corrected for workpiece gripping position misalignment. 8

Format

CORRECTXY [robot number] (master position of robot tip, master position


of workpiece, position of workpiece, target position before correction)
A
Value Range/Contents
Robot Number 1 to 4 (If not input, robot 1 is specified.)
Master position of robot tip point data (unit: mm)
B
Master position of workpiece point data (unit: mm)
Position of workpiece point data when robot tip is at the master position of robot tip (unit: mm) C
Target position before correction point data (unit: mm)

Explanation Acquires the corrected target position of gripping position misalignment on XY coordinate plane.
D
=> F or the target position, XYR-axes of <Target position before correction> are corrected and acquired.
The axes position except XYR-axes remains the value of <Target position before correction>. E
•T
 each <Master position of robot tip>, <Master position of workpiece> and <Target position before
correction> with gripping a workpiece beforehand.
• This command is available as online command. F

Target position before correction CORRECTXY G


Y Y
Target position
after correction H
Target position

I
before correction

Teaching Correct the target position


with gripping a workpiece so that <position of workpiece> becomes same as
<master position of workpiece>.

Master position
J
of workpiece
Position of workpiece
K
Master position
of robot tip

X X L
c CAUTION
• All of usable point data are "mm" unit.
M
• This command is available only for the robot containing each XYR-axis. If this command is used for other robots,
“2.354 Illegal coordinates for pos. correction" alarm will occur.

Sample Description

P1 = CORRECTXY[1](P2,P3,P4,P5)
…………
The corrected target position is acquired and assigned to P1.
Robot 1, Master position of robot tip P2, Master position of
workpiece P3, Position of workpiece P4, Target position before
correction P5.

Robot language list 8-25


19 COS
8 Acquires the cosine value of a specified value

Format

COS expression

A
Value Contents

B Expression Angle (units: radians)

C Explanation Acquires a cosine value for the <expression> value.

D Sample Description
A(0)=B*COS(C) ………
The product of the C variable's cosine value and variable B is
E assigned to array A (0).
A(1)=COS(DEGRAD(20)) ………
The 20.0° cosine value is assigned to array A (1).

F
Related commands ATN, DEGRAD, RADDEG, SIN, TAN
G

8-26 Chapter 8 Robot Language


20 CREWRK
Creates the work data from the offset; difference between 2 point data 8

Format

CREWRK [robot number] (point of difference, standard point)

A
Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.)
B
Point of Difference point in Cartesian coordinate system
Standard Point point in Cartesian coordinate system (If not input, the current position is specified.)
C
Explanation The work data is made of the offset data; the differential value in the coordinates between the standard
point and one of difference.
D
The current position will be treated as the standard point when it is omitted.
An error occurs unless both the standard point and one of difference are Cartesian coordinate system. E
Reference "WRKDEF"
Operation Manual "Work definitions" F

G
If "pulse" is specified as the unit for the point of difference / standard, "6.205: Coordinate type error" may occur.
H

Sample Description
I
CHANGE H1 ………
Changes the hand data of the robot 1 to hand 1.
MOVE P,P1 ………
Moves the hand 1 tip of the robot 1 to P1.
WRKDEF W1= CREWRK (P3) ………
Defines work 1; the difference between the current position J
and P3 as the offset.
CHGWRK W1 ………
Changes the work data of the robot 1 to work 1.
MOVE P,P2 ………
Moves the work 1 tip of the robot 1 to P2. K
HALT

Related commands CHGWRK, WRKDEF M

Robot language list 8-27


21 CURTQST
8 Acquires the ratio of the current torque (current) value of axis against the rated torque (current) value

Format

CURTQST [robot number] (axis number)

A
Value Range

B Robot Number 1 to 4 (If not input, robot 1 is specified.)


Axis Number 1 to 6

C
Explanation Acquires the percentage (-1000 to 1000 [%]) of the current torque value against the rated torque value
of axis.
D Plus/minus signs indicate the direction.

E Sample Description
A = CURTQST(3) ………
The ratio of the current torque (current) value against the rated
torque (current)value of the axis 3 of robot 1 is assigned to
F variable A.

8-28 Chapter 8 Robot Language


22 CURTRQ
Acquires the ratio of the current torque (current) value of axis against the maximum torque (current) value 8

Format

CURTRQ [robot number] (axis number)

A
Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.) B
Axis Number 1 to 6

C
Explanation Acquires the percentage (-100 to 100 [%]) of the current torque value against the maximum torque
command value of axis .
Plus/minus signs indicate the direction.
D

Sample Description E
A = CURTRQ(3) ………
The ratio of the current torque (current) value against
the maximum torque (current)value of the axis 3 of robot 1 is
assigned to variable A. F

Robot language list 8-29


23 CUT
8 Terminates another task which is currently being executed

Format

CUT Tn
<program name>
A
PGm

B
Notation Value Range
C m Program Number 0 to 100
n Task number 1 to 16

D
Explanation Terminates another task which is currently being executed or which is temporarily stopped.
E A task can be specified by the name or the number of a program in execution.
This statement cannot terminate its own task.

G If a task (program) not active is specified for the execution, an error occurs.

H Sample Description
’TASK1 ROUTINE ………Task 1
I *ST:
MO(20) = 0
START <SUB _ PGM>,T2 ………
Registers SUB _ PGM program in Task No. 2
J MOVE P,P0 and starts it.
MOVE P,P1
WAIT MO(20) = 1
K CUT T2 ………
Forced termination of Task 2 in running.
GOTO *ST
HALTALL
L
’TASK2 ROUTINE ………
Task 2(Program name: SUB _ PGM)
*SUBTASK2:
M P100=JTOXY(WHERE)
IF LOC3(P100) >= 100.0 THEN
MO(20) = 1
ELSE
DELAY 100
ENDIF
GOTO *SUBTASK2
EXIT TASK ………
Ends Task 2 (own task: SUB _ PGM)

Related commands EXIT TASK, RESTART, START, SUSPEND

8-30 Chapter 8 Robot Language


24 DATE$
Acquires the date 8

Format

DATE$

A
Explanation Acquires the date as a "yyyy/mm/dd" format character string.
"yyyy" indicates the year, "mm" indicates the month, and "dd" indicates the day.
B
Date setting is performed from an operation terminal such as a programming box.

Sample Description C
A$=DATE$ ………
Assigns the date into A as a string in yyyy / mm / dd format.
PRINT DATE$ ………Displays dates in yyyy / mm / dd format.
HALT
D

E
Related commands TIME$
F

Robot language list 8-31


25 DECEL
8 Specifies/acquires the deceleration ratio parameter

Format

1. DECEL [robot number] expression


2. DECEL [robot number] (axis number) = expression
A

B Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.)
Axis Number 1 to 6
C Expression 1 to 100 (units: %)

D Explanation Changes the deceleration ratio parameter of axis to the <expression> value.
In format 1, the change occurs at all axes of a specified robot.
E In format 2, the change occurs at the axis specified in <axis number>.

F
The acceleration parameter can be changed by using the ACCEL statement.

G
Functions

H Format

DECEL [robot number] (axis number)


I
Value Range
J Robot Number 1 to 4 (If not input, robot 1 is specified.)
Axis Number 1 to 6

K Explanation Acquires the deceleration ratio parameter value of axis.

L Sample Description
A =50
DECEL A ………
Specifies 50 in the deceleration rate parameter for all axes of
M robot 1.
DECEL(3)=100 ………
Specifies 100 as the deceleration rate parameter for the axis 3 of
robot 1.

’CYCLE WITH INCREASING DECELERATION


FOR A =10 TO 100 STEP 10
DECEL A ………
Specifies the variable A value in the deceleration rate parameter
for all axes of robot 1.
MOVE P ,P0
MOVE P ,P1
NEXT A
A=DECEL(3) ………
The deceleration rate parameter for the axis 3 of robot 1 is
assigned to variable A.
HALT "END TEST"

8-32 Chapter 8 Robot Language


26 DEF FN
Defines functions which can be used by the user 8

Format

DEF FN name (dummy argument, dummy argument…)=function definition expression

A
Value Range / Meaning
name Function name. Max. of 16 characters including "FN". B
Dummy Argument Numeric or character string variable

C
Explanation Defines the functions which can be used by the user. Defined functions are called in the FN <name>
(variable) format.
D

E
• The <dummy argument> names are the same as the variable names used in the <function 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.
F
• 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. The <dummy argument> can be omitted. If <dummy arguments> are G
the same type, the difference of variable names does not affect.
• 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. H
• A space must be entered between "DEF" and "FN". If no space is entered, DEFFN will be 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.
I

J
Sample Description
DEF FNPAI=3.141592
K
DEF FNASIN(X)=ATN(X/SQR(-X^2+1))
. ………
Both the <dummy argument> and <function definition expression>
. use "X". L
.
A=FNASIN(B)*10 ………
"X" is not required for calling.
M

Robot language list 8-33


27 DEGRAD
8 Angle conversion (degree → radian)

Format

DEGRAD (expression)

A
Value Contents

B Expression Angle (units: degrees)

C
Explanation The <expression> value is converted to radians.

E To convert radians to degrees, use RADDEG.

F Sample Description
A=COS(DEGRAD(30)) ………
A cosine value which is converted 30° to radians is
G assigned to variable A.

H Related commands ATN, COS, RADDEG, SIN, TAN

8-34 Chapter 8 Robot Language


28 DELAY
Program execution waits for a specified period of time 8

Format

DELAY expression

A
Value Range
Expression 0 to 3600000 (units: ms) B

Explanation A "program wait" status is established for the period of time specified by the <expression>. C
The minimum wait period is 1ms.

D
Sample Description
DELAY 3500 ………
Waits 3,500 ms (3.5 seconds). E
A-50
DELAY A*10 ………
Waits 500 ms (0,5 seconds). F

Robot language list 8-35


29 DI
8 Acquires the input status from the parallel port

Format

1. LET expression = DIm(b,...,b)


2. LET expression = DI(mb,...,mb)
A
3. LET expression = IO Name

B
Notation Value Range / Meaning
C m Port Number 0 to 7, 10 to 17, 20 to 27
0 to 7 (If omitted, all 8 bits are processed.)
D b bit Definition If multiple bits are specified, they are expressed from the left in descending order
(high to low).

Users can name specific bits of DI and DO as they desire.


E IO Name Note that it can be added and edited on the support software only
(not with a programming box)

F
Explanation Indicates the parallel input signal status.

G "0" will be entered if no input port exists.

H Sample Description
A%=DI2() ………
The input status from DI (27) to DI (20) is assigned to variable A%.
I A%=DI5(7,4,0) ………
The DI (57), DI (54), DI (50) input status is assigned to variable A%
(when all the above signals are "1" (ON), A% = 7).
J
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 DI (20) are "1" (ON), A% = 6).
K
A%=END _ SENSOR ………
The IO Name "END _ SENSOR" input status is assigned to variable A%
(when the "END _ SENSOR" is "1" (ON), A% = 1).
L
Reference Chapter 3 "9.3 Parallel input variable"
M

8-36 Chapter 8 Robot Language


30 DIM
Declares array variable 8

Format

DIM array definition , array definition,…

Format A
name % (constant , constant, constant)
! B
$
C

Notation Value Range


D
Constant Array subscript 0 to 32,767 (positive integer)

E
Explanation 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 be declared in a single line by using comma
( , ) breakpoints to separate the arrays. F

G
• The total number of array elements is <constant> + 1.
• A "9.300: Memory full" error may occur depending on the size of each dimension defined in an array.
H

I
Sample Description
DIM A%(10) ………
Defines a integer array variable A% (0) to A% (10). (Number J
of elements: 11).
DIM B(2,3,4) ………
Defines a real array variable B (0, 0, 0) to B (2, 3, 4).
(Number of elements: 60). K
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).
L

Robot language list 8-37


31 DIST
8 Acquires the distance between 2 specified points

Format

DIST (point expression 1, point expression 2)

A
Value Meaning

B Point Expression 1 Cartesian coordinate system point


Point Expression 2 Cartesian coordinate system point

C
Explanation Acquires the distance (units: mm) between the 2 points (X,Y,Z) specified by <point expression 1> and
<point expression 2>. An error occurs if the 2 points specified by each <point expression> do not have
D Cartesian coordinates.

E
Sample Description

F A=DIST(P0,P1) ………
The distance between P0 and P1 is assigned to variable A.

8-38 Chapter 8 Robot Language


32 DO
Outputs to parallel port or acquires the output status 8

Format
1. LET DOm(b,...,b) = expression
2. LET DO(mb,...,mb) = expression
3. LET IO Name = expression
A

B
Notation Value Range / Meaning
m Port Number 0 to 7, 10 to 17, 20 to 27
0 to 7 (If omitted, all 8 bits are processed.)
C
b Bit Definition (*1) If multiple bits are specified, they are expressed from the left in descending order
(high to low).
D
Integer value (If real number is specified, rounds to an integer.)
Bits beyond the number of bit whom an assignment destination is required are
Expression ignored. (If the port number is specified, the lower 8 bits are valid. if the number E
of bit specified on bit definition is 1 to 8, the lower 1 to 8 bit corresponding to the
bits specified on the left side are valid.)
F
Users can name specific bits of DI and DO as they desire.
IO Name Note that it can be added and edited on the support software only
(not with a programming box)
G

Explanation Outputs the specified value to the DO port. H


No output will occur if a nonexistent DO port is specified.

Reference (*1) Chapter 3 "10 Bit Settings"


I

J
c CAUTION
Outputs to DO0() and DO1() are not possible. These ports are for reference only.

K
Sample Description
DO2() = &B10111000 ………DO (27, 25, 24, 23) are turned ON, and DO (26, 22, 21, 20) are L
turned OFF.
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 ON, and DO (37, 36, 35, 34) are M
turned OFF.
DO(37,35,27,20) = A ………
The contents of the 4 lower bits acquired when variable A
is converted to an integer are output to DO (37, 35, 27, 20)
respectively.
CHUCK = 1 ………
IO name "CHUCK" is turned ON ("1" is output).

Robot language list 8-39


DO
8
Functions

Format
LET expression = DOm (b,...,b)
LET expression = DO (mb,...,mb)
A
LET expression = IO Name

B
Notation Value Range / Meaning
m Port Number 0 to 7, 10 to 17, 20 to 27
C 0 to 7 (If omitted, all 8 bits are processed.)
b bit Definition If multiple bits are specified, they are expressed from the left in descending
order (high to low).
D
Integer value (If real number is specified, rounds to an integer.)
Bits beyond the number of bit whom an assignment destination is required
E Expression are ignored. (If the port number is specified, the lower 8 bits are valid. if
the number of bit specified on bit definition is 1 to 8, the lower 1 to 8 bit
corresponding to the bits specified on the left side are valid.)

F Users can name specific bits of DI and DO as they desire.


IO Name Note that it can be added and edited on the support software only (not with a
programming box)
G
Explanation References the parallel port signal status.
H

I Sample Description
A% = DO2() ………
Output status of DO(27) to DO(20) is assigned to variable A%.

J A% = DO0(6, 5, 1) ………
Output status of DO(06), DO(05) and DO(01) is assigned to
variable A%.(If all above signals are 1(ON), then A%=7.)

K A% = DO(37,35,27,10)………
Output status of D0(37), DO(35) , DO(27) and D0(10) is assigned
to variable A%.
(If all above signals except D0(27) are 1 (ON), then A%=13.)
L
A% = CHUCK ………
Output status of IO name "CHUCK" is assigned to variable A%.
(When "CHUCK" is ON, then A% =1.)
M

Related commands RESET, SET

8-40 Chapter 8 Robot Language


33 DRIVE
Executes absolute movement of specified axes 8

Format

DRIVE [robot number](axis number, expression),(axis number, expression)...,


option, option ...
A

Value Range / Meaning


B
Robot Number 1 to 4 (If not input, robot 1 is specified.)
Axis Number 1 to 6
Expression Motor position (mm, degrees, pulses) or point expression C

Explanation Executes absolute movement command for the specified axis


D
This command is also used in the same way for the auxiliary axes.
E
• Movement type : PTP movement of specified axis.
• Point setting method : Direct numeric value input, point definition.
• Options : Relative Speed setting, absolute Speed setting, F
STOPON conditions setting, CONTON conditions setting, CONT setting,
XY setting.
G

Robot language list 8-41


DRIVE
8
Movement type

● PTP (Point to Point) movement of specified axis:


PTP movement begins after positioning of all axes specified at <axis number> is complete (within the tolerance
A range), and the command terminates when the specified axes enter the OUT position range. When two or more
axes are specified, they will reach their target positions simultaneously.
If the next command following the DRIVE command is an executable command such as a signal output
B
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.
C
Example:

D Signal output (DO, etc.) Signal is output when axis enters within OUT position range.
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. Therefore, axis movement
HALT
E also stops.
All programs in execution stop when axis enters the OUT position range, task 1 is reset, and other
HALTALL
tasks terminate. Therefore, the movement also stops.

F HOLD
Program temporarily stops when axis enters the OUT position range. Therefore, axis movement
also stops.
All programs in execution temporarily stop when axis enters the OUT position range. Therefore,
HOLDALL
G the movement also stops.
WAIT WAIT command is executed when axis enters the OUT position range.

H
The WAIT ARM statement is used to execute the next command after the axis enters the tolerance range.

I DRIVE command

J DRIVE(1,P1)
Target position
DRIVE(1,P1)
DO(20)=1 WAIT ARM
DO(20)=1

K
P1

Tolerance
L DO(20) turns ON
OUT position
DO(20) turns ON

M
DRIVE(1,P1) DRIVE(1,P1)
Target position
HOLD WAIT ARM
HOLD

Tolerance
OUT position
HOLD execution HOLD execution
(program temporarily stops) (program temporarily stops)

Sample Description
DRIVE(1,P0) ………
A xis 1 of robot 1 moves from its current position to the
position specified by P0.

8-42 Chapter 8 Robot Language


DRIVE
8
Point data setting types

● Direct numeric value input


The target position is specified directly in <expression>.
If the numeric value is an integer, this is interpreted as "pulse" units. If the numeric value is a real number, this A
is interpreted as "mm/degrees" units, and each axis will move from the 0-pulse position to a pulse-converted
position.
B
However, when using the optional XY setting, movement occurs from the Cartesian coordinate origin position.

Sample Description C
DRIVE(1,10000) ………
A xis 1 of robot 1 moves from its current position to the
10000 pulses position. D
DRIVE[2](2,90.00) ………
A xis 2 of robot 2 moves from its current position to
a position which is 90° in the plus-direction from the
0-pulse position. E

F
● Point definition
Point data is specified in <expressions>. The axis data specified by the <axis number> is used. If the point
G
expression is in "mm/degrees" units, movement for each axis occurs from the 0-pulse position to the pulse-
converted position. However, when using the optional XY setting, movement occurs from the Cartesian
coordinate origin position. H
n NOTE
If point data is specified with both integers and real numbers in the same statement, all values are handled
I
in "mm/degrees" units.

J
Sample Description
DRIVE(1,P1) ………
A xis 1 of robot 1 moves from its current position to the K
position specified by P1.
DRIVE(4,P90) ………
A xis 4 of robot 1 moves from its current position to the
position specified by P90 (deg.) relative to the 0 pulse position. L
(When axis 4 is a rotating axis.)

Robot language list 8-43


DRIVE
8
Option types

● Relative speed setting


● Absolute Speed setting
A ● STOPON conditions setting Reference "MOVE" statement
● CONTON conditions setting
B ● CONT setting

C ● XY setting
Format

D XY

E 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 statement have been specified, operation is identical to that
F which occurs when using MOVE statement. The following restrictions apply to this command:
1. Axes specified by <axis number> must include the axis 1 and 2.

G 2. This command can be specified at SCARA robots and Cartesian robots with X and Y- axes.
3. Point settings must be in "mm" or "deg." units (real number setting).

H Sample Description
DRIVE(1,P100),(2,P100),(4,P100),XY
I ………
The axis 1, 2 and 4 of robot 1 move from their current positions to
the Cartesian coordinates position specified by P100.

8-44 Chapter 8 Robot Language


34 DRIVEI
Moves the specified robot axes in a relative manner 8

Format

DRIVEI [robot number](axis number, expression),


(axis number, expression)..., option, option
A
Value Range / Meaning
Robot Number 1 to 4 (If not input, robot 1 is specified.)
B
Axis Number 1 to 6
Expression Target position (mm, deg., pulses) or point expression
C
Explanation Executes relative movement, including the auxiliary axes.
• Movement type (*) : PTP movement of a specified axis
D
• Point data setting (*) : Direct coordinate data input, point definition
• Options (*) :R
 elative Speed setting, absolute Speed setting, E
STOPON conditions setting, CONTON conditions setting, CONT setting,

Reference "DRIVE" "MOVE" statement F


(To use Sample program, replace "DRIVE" or "MOVE" in Sample to "DRIVEI".

When DRIVEI motion to the original target position is interrupted and then restarted, the target position
H
for the resumed movement can be selected as the "MOVEI/DRIVEI start position" in the controller's parameters.
Reference user's/ operator's manual.) I
1) KEEP (default)...Continues the previous (before interruption) movement. The original target position remains
unchanged.
2) RESET...Relative movement begins anew from the current position. The target position before interruption is reset. J

Robot language list 8-45


DRIVEI
8
Movement type

● PTP (point-to-point) of specified axis


PTP movement begins after positioning of all axes specified at <axis number> is complete (within the tolerance
A range), and the command terminates when the specified axes enter the OUT position range. When two or more
axes are specified, they will reach their target positions simultaneously.
If the next command following the DRIVEI command is an executable command such as a signal output
B
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.
C
Signal output (DO, etc.) Signal is output when axis enters within OUT position range.
DELAY DELAY command is executed and standby starts, when axis enters the OUT position range.
D Program stops and is reset when axis enters the OUT position range. Therefore, axis movement
HALT
also stops.
All programs in execution stop when axis enters the OUT position range, task 1 is reset, and
E HALTALL
other tasks terminate. Therefore, the movement also stops.
Program temporarily stops when axis enters the OUT position range. Therefore, axis movement
HOLD
also stops.
F All programs in execution temporarily stop when axis enters the OUT position range. Therefore,
HOLDALL
the movement also stops.
WAIT WAIT command is executed when axis enters the OUT position range.
G
The WAIT ARM statement are used to execute the next command after the axis enters the tolerance range.

H
DRIVEI command
WAIT ARM statement
I
DRIVEI(1,P1) DRIVEI(1,P1)
Target position
DO(20)=1 WAIT ARM

J
DO(20)=1

P1

K Tolerance
OUT position
DO(20) turns ON DO(20) turns ON

L
DRIVEI(1,P1) DRIVEI(1,P1)
Target position
M HOLD WAIT ARM
HOLD

Tolerance
OUT position
HOLD execution HOLD execution
(program temporarily stops) (program temporarily stops)

8-46 Chapter 8 Robot Language


DRIVEI
8
Point data setting types

● Direct numeric value input


The target position is specified in <expression>.
If the target position's numeric value is a real number, this is interpreted as a "mm/ deg." units, and each axis will A
move from its current position to a pulse-converted position.

B
Sample Description

C
DRIVEI(1,10000) ………
From its current position, the axis 1 of robot 1 moves a
distance of "+10000 pulses".
DRIVEI(4,90.00) ………
From its current position, the axis 4 of robot 1 moves

D
+90°(when axis 4 is a rotating axis).

● Point definition F
Point data is specified in <expression>. The axis data specified by the <axis number> is used.
From its current position, the axis moves the distance specified by the point in a relative manner.
G
If the point expression is in "mm/ degrees" units, movement for each axis occurs from the 0-pulse position to the
pulse-converted position.
H
n NOTE
If point data is specified with both integers and real numbers in the same statement, all values are handled in
"mm/degrees" units.
I

Sample Description J
DRIVEI(1,P1) ………
The axis 1 of robot 1 moves from its current position the
distance specified by P1. K
DRIVEI(4,P90) ………
The axis 4 of robot 1 moves from its current position the number
of degrees specified by P90 (when axis 4 is a rotating axis).
L

Robot language list 8-47


DRIVEI
8
Option types

● Speed setting
Format
A 1. SPEED = expression
2. S = expression
B
Value Range
Expression 1 to 100 (units: %)
C
Explanation The program's movement speed is specified as an <expression>.
D The actual speed is determined as shown below.
• Robot's max. speed (mm/sec., or deg./sec.) × automatic movement speed (%) × value of expression (%)
E This option is enabled only for the specified DRIVE statement.

F
n NOTE
This defines the maximum speed, and does not guarantee that all movement will occur at specified speed.

Sample Description
G DRIVEI(1,10000),S=10 ………
The axis 1 of robot 1 moves from its current position to
the +10000 pulses position at 10% of the program movement
speed.
H

J Format
1. DSPEED = expression
K 2. DS = expression

Value Range
L Expression 0.01 to 100.00 (units: %)

M Explanation The axis movement speed is specified as an <expression>.


The actual speed is determined as shown below.
• Robot's max. speed (mm/sec., or deg./sec.) × axis movement speed (%)
This option is enabled only for the specified DRIVEI statement.
M
 ovement always occurs at the DSPEED <expression> value (%) without being affected by
the automatic movement speed value (%).

n NOTE
SPEED option and DSPEED option cannot be used together.

Sample Description
DRIVEI(1,10000),DS=0.1 ………
The axis 1 of robot 1 moves from its current position
to the +10000 pulses position at 0.1% of the maximum
speed.

8-48 Chapter 8 Robot Language


DRIVEI
8
● STOPON condition setting
Format

STOPON conditional expression

Explanation Stops movement when the conditions specified by the <conditional expression> are met. A
Because this is a deceleration type stop, there will be some movement (during deceleration) after the

conditions are satisfied.
B
• the <conditional expression> is specified with input/output signals or the variable.
• If the conditions are not satisfied, a robot moves to the target position.
• If the conditions are already satisfied before movement begins, C
the command is terminated without any movement.
• This option is enabled only by program execution.
D
Sample Description
DRIVEI(1,10000),STOPON DI(20)=1 E
………
A xis 1 of robot 1 moves from its current position toward the "+10000
pulses" position and stops at an intermediate point if the "DI (20) =
1" condition become satisfied. The next step is then executed. F

When the conditional expression used to designate the STOPON condition is a numeric expression, expression value
H
other than "0" indicates a TRUE status, and "0" indicates a FALSE status.
I

Robot language list 8-49


35 END SELECT
8 Ends the SELECT CASE statement

Format
SELECT CASE expression

A CASE expression's list 1


command block 1
B CASE expression's list 2
command block 2
C :
CASE ELSE
D command block n
END SELECT
E
Explanation Directly ends the SELECT CASE command block.
F For details, refer to section "SELECT CASE to END SELECT".

G Sample Description

WHILE 1
SELECT CASE DI3(7,6,5,4,3,2,1,0) ………
Executes each command block according to
H CASE &B00000001 the input status of DI3(8 bits)
MOVE P,P1 ………Command block when DI3(0) is ON
CASE &B00000010 ………When DI3(1) is ON
I MOVE P,P2
CASE &B00000011 ………When DI3(0) and DI3(1) is ON
MOVE P,P3
J CASE ELSE ………Case other than the above
MOVE P,P0
END SELECT ………Ends SELECT CASE statement
K WEND

L
Related commands SELECT CASE

8-50 Chapter 8 Robot Language


36 END SUB
Ends the sub-procedure definition 8

Format
SUB label (dummy argument, dummy argument…)
command block
END SUB
A

B
Explanation Ends the sub-procedure definition which begins at the SUB statement.
For details, refer to section "SUB to END SUB".
C
Sample Description
I=1
D
CALL *TEST ………
Calls sub-procedure *TEST
PRINT I
HALT
E
’SUB ROUTINE: TEST (Comment: Subprocedure name is "TEST")
SUB *TEST ………Defines sub-procedure * TEST
I=50
F
END SUB ………Finishes defining sub procedures

G
Related commands CALL, EXIT SUB, SUB to END SUB

Robot language list 8-51


37 ERR / ERL
8 Acquires the error code / error line number

Format
ERR(task number)
ERL(task number)
A

B Value Range
Task Number 1 to 16 (If not input, the task being executed is specified.)

C
Explanation Variables ERR and ERL are used in error processing routines specified by the ON ERROR GOTO
statement.
D ERR gives the error code of the error that has occurred and ERL gives the line number on which the error
has occurred.
E
Sample Description
F
IF ERR(1) <> &H000600CC THEN HALT ………
If "Point doesn't exist" error has occured,
This sample stops and resets the program.
G IF ERL =20 THEN RESUME NEXT ………
If the line on which an error has occurred is 20,
the program jumps to the next line of the error
occurring line and continues the execution.
H

I Related commands ON ERROR GOTO, RESUME

8-52 Chapter 8 Robot Language


38 ETHSTS
Acquires the Ethernet port status 8

Format

ETHSTS

A
Explanation Acquires the Ethernet port status.
The values below are acquired depending on the status.
B
-2 Ethernet port is not opened yet.
-1 LAN cable is not connected.
C
0 The connection is not established.
1 The connection is established.
2 The connection is established / the data is stored in the reception buffer. D

E
Sample Description
A=ETHSTS ………Assigns the Ethernet port status to the variable A.
F

Robot language list 8-53


39 EXIT FOR
8 Terminates the FOR to NEXT statement loop

Format

EXIT FOR

A
Explanation Terminates the FOR to NEXT statement loop, then jumps to the command which follows the NEXT
statement.
B
This statement is valid only between the FOR to NEXT statements.

D The FOR to NEXT statement loop will end when the FOR statement condition is satisfied or when the EXIT FOR
statement is executed. A "5.212: Stack overflow" error, etc., will occur if another statement such as GOTO is used to
jump out of the loop.
E

F Sample Description
*ST:
G WAIT DI(20)=1
FOR A%=101 TO 109
MOVE P,P100,Z=0
H DO(20)=1
MOVE P,P[A%],Z=0
DO(20)=0
I IF DI(20)=0 THEN EXIT FOR ………
If DI(20) = 0 (false), exits between FOR and NEXT.
NEXT A%
GOTO *ST
J HALT

K Related commands FOR, NEXT

8-54 Chapter 8 Robot Language


40 EXIT SUB
Terminates the sub-procedure defined by the SUB to END SUB statement 8

Format

EXIT SUB

A
Explanation  The EXIT SUB statement terminates the sub-procedure defined by the SUB to END SUB statements, then
jumps to the next command in the CALL statement that called up the sub-procedure.
B
This statement is valid only within the sub-procedure defined by the SUB to END SUB statements.

 o end the sub-procedure defined by the SUB to END SUB statements, use the END SUB statement or EXIT SUB
T
D
statement. A "5.212: Stack overflow" error, etc., will occur if another statement such as GOTO is used to jump out of
the loop.
E

Sample Description F
’MAIN ROUTINE
CALL *SORT2(REF X%,REF Y%) ………
Calls sub-procedure *SORT2 G
HALT

’SUB ROUTINE: SORT ………


Defines *SORT2 as a sub-procedure H
SUB *SORT2(X%, Y%)
IF X%>=Y% THEN EXIT SUB ………
If X is Y or more, exits between SUB and END SUB
TMP%=Y% I
Y%=X%
X%=TMP%
END SUB J

Related commands CALL, SUB to END SUB, END SUB


K

Robot language list 8-55


41 EXIT TASK
8 Terminates its own task which is in progress

Format

EXIT TASK

A
Explanation Terminates its own task which is currently being executed.

B
Sample Description
C ’TASK1 ROUTINE
*ST:
MO(20)=0
D START <SUB _ PGM>,T2 ………
Registers SUB _ PGM program in Task No. 2 and
MOVE P,P0,P1 starts it.
WAIT MO(20)=1
E GOTO *ST
HALTALL

F Program name:SUB _ PGM


’TASK2 ROUTINE
*SUBTASK2:
G P100=JTOXY(WHERE)
IF LOCZ(P100)>=100.000 THEN
MO(20)=1
H EXIT TASK ………
Ends Task 2 (own task: SUB _ PGM)
ENDIF
DELAY 100
I GOTO *SUBPTASK2 ………
Jumps to *SUBTASK 2
EXIT TASK ………
Ends Task 2 (own task: SUB _ PGM)

J
Related commands CUT, RESTART, START, SUSPEND, CHGPRI

8-56 Chapter 8 Robot Language


42 FOR to NEXT
Performs loop processing until the variable exceeds the specified value 8

Format
FOR control variable = start value TO end value STEP step
command block
NEXT control variable
A

B
Explanation These statements repeatedly execute commands between the FOR to NEXT statements for the <start
value> to <end value> number of times, while changing the <control variable> value in steps specified
by <STEP>. C
• If <STEP> is omitted, its value becomes "1".
• The <STEP> value may be either positive or negative.
• The <control variable> must be a numeric <simple variable> or <array variable>.
D
• The FOR and NEXT statements are always used as a set.
E
Sample
'CYCLE WITH CYCLE NUMBER OUTPUT TO DISPLAY
FOR A=1 TO 10
F
MOVE P,P0
MOVE P,P1
MOVE P,P2
G
PRINT"CYCLE NUMBER=";A
NEXT A
HALT
H

FOR to NEXT is useful to make the program compact.


I
SAMPLE (Descriptions with FOR to NEXT)

FOR A=1 TO 5 ………


Repeats 5 times between FOR and NEXT.
MOVE P,P[A],A3=0.00 A number of destination point for MOVE changes depending J
NEXT A on a value of a variable.
MOVE P,P10,A3=0.00
DO(20)=1 K

A example without FOR to NEXT; L


though the description is simple, the number of programming line increases in accordance with one of the destination.
SAMPLE (Descriptions without FOR to NEXT)
M
MOVE P,P1,A3=0.00
MOVE P,P2,A3=0.00
MOVE P,P3,A3=0.00
MOVE P,P4,A3=0.00
MOVE P,P5,A3=0.00
MOVE P,P10,A3=0.00
DO(20)=1

While FOR to NEXT is processed, leaving the loop is disabled by GOTO and so on.
In order to leave FOR to NEXT, use EXIT FOR.

Related commands EXIT FOR

Robot language list 8-57


43 GEPSTS
8 Acquires the General Ethernet Port status

Format

GEPSTS(General Ethernet Port number)

A
Value Range

B General Ethernet Port number 1 to 4

C
Explanation Acquires the General Ethernet Port status.
The values below are acquired depending on the status.
D
-2 Specified General Ethernet Port is not opened yet.
E -1 LAN cable is not connected.
0 The connection is not established. (Only server)
1 The connection is established.
F
2 The connection is established / the data is stored in the reception buffer.

G
Sample Description
H OPEN GP1 ………
Opens the port which is specified at the General
Ethernet port 1.

I IF GEPSTS(1) > 0 THEN ………


Confirms if the connection is established.

SEND "ABC" TO GP1 ………


Sends the character string "ABC".

J IF GEPSTS(1)=2 THEN ………


Confirms if the data is stored in the reception
buffer.
SEND GP1 TO RET$ ………
Receives the data and assigns the received to the

K ENDIF
variable RET$.

ENDIF

L CLOSE GP1
HALT
………
Closes the port which is specified at the General
Ethernet port 1.

M Related commands OPEN, CLOSE, SEND, SETGEP

8-58 Chapter 8 Robot Language


44 GOSUB to RETURN
Jumps to a subroutine 8
* GOSUB can also be expressed as "GO SUB".
Format
GOSUB label
: A
label:
: B
RETURN

C
Explanation Jumps to the <label> subroutine specified by the GOSUB statement.
A RETURN statement within the subroutine causes a jump to the next line of the GOSUB statement.
D

• The GOSUB statement can be used up to 120 times in succession. Note that this number of times is reduced if
commands containing a stack such as an FOR statement or CALL statement are used.
F
• When a jump to a subroutine was made with the GOSUB statement, always use the RETURN statement to end
the subroutine. If another statement such as GOTO is used to jump out of the subroutine, an error such as "5.212: G
Stack overflow" may occur.

Sample Description
I
*MAIN:
MOVE P,P1,A3=0.00
GOSUB *SUB _ DO ………
Jumps to the label “* SUB _ DO” J
MOVE P,P2,A3=0.00 ………
Executes from this line after the subroutine *SUB _ DO
HALT has reached RETURN
K
*SUB _ DO: ………
Defines *SUB _ DO as a subroutine label
DO(20)=1
DELAY 500 L
DO(20)=0
RETURN ………
Executes from the next line of the GOSUB statement
M

Related commands RETURN

Robot language list 8-59


45 GOTO
8 Executes an unconditional jump to the specified line

Format

GOTO label * GOTO can also be expressed as "GO TO".

A
Explanation Executes an unconditional jump to the line specified by the <label>.

B
"Label" is the name which is put on a programming line.
C For specifying the programming line, it is necessary to create a label on the line and specify it.

D In order to create/define a label, always begin with * and end with : .


For details, refer to Chapter 1 "6. LABEL Statement".

E
Sample Description

F *TOP: ………
Defines *TOP as a label
MOVE P,P1
DELAY 1000
G MOVE P,P2
DELAY 1000 ………
Jumps to the label *TOP
GOTO *TOP
H

8-60 Chapter 8 Robot Language


46 HALT
Stops the program and performs a reset 8

Format
expression
HALT
character string
A

Explanation Stops the program and resets it. If restarted after a HALT, the program runs from its beginning.
B
If an <expression> or a <character string> is written, the operation result of <expression> or the contents
of <character string> are displayed on the programming box screen, respectively.
C

• Variables are not reset by execution of HALT statement. HALTALL is available to reset variables.
D
• HALT is effective only in the executed task. The programs executed in other tasks continue execution.

E
Sample Description
’MAIN ROUTINE
*ST:
F
MOVE P,P0,P1
IF DI(20) = 1 THEN
GOTO *FIN
………
If DI(20) is ON
………
Jumps to the label *FIN
G
ENDIF
GOTO *ST
*FIN: ………
Defines *FIN as a label
H
HALT "PROGRAM FIN" ………
Stops and resets the program (displayed as “PROGRAM FIN”)

In PTP movement specified by movement commands such as MOVE and DRIVE, the next line's command is executed
I
when the axis enters the OUT position range.
Therefore, if a HALT command exists immediately after a PTP movement command, that HALT command is executed J
before the axis arrives in the target position tolerance range.
Likewise, when specifying CONT options in interpolation movement during MOVE (L or C) command, the next
command is executed immediately after movement starts. Therefore, if a HALT command exists immediately after the
K
interpolation movement command during MOVE (L or C) command with CONT options, a HALT command is executed
immediately after starting movement. L
In either of the above cases, use the WAIT ARM command as shown below if desiring to execute the HALT command
after the axis arrives within the target position tolerance range.
M
HALT command

DRIVE(1,P1) DRIVE(1,P1)
Target position
HALT WAIT ARM
HALT

Tolerance
OUT position
HALT execution HALT execution

33821-R7-00

Robot language list 8-61


47 HALTALL
8 Stops all programs and performs reset

Format
expression
HALTALL
character string
A
Explanation Stops and resets all programs. Dynamic variables, array variables, output variables are also rest.
Output variables (DO/SO/MO/LO/TO/SOW) are reset under the condition as shown below.
B
• IO parameter "DO output at Program reset" is "IO_RESET".
• Sequence program is in execution and the sequence program execution flag is enabled.
C
If a program is restarted after a HALTALL, the program runs from its beginning of the main program or of
the last program executed at task 1.
D If an <expression> or a <character string> is written, the calculation result of <expression> or the
contents of <character string> are displayed on the programming box screen, respectively (if variable is
E written in an <expression>, the previous value before clearing is displayed).

F
• HALTALL stops all the programs which is run in multi tasking.
After the reset, the main program or a current program is registered automatically at the task No.1 and the other
G tasks are cleared.
• Executing HALTALL resets all of general-purpose outputs and variables.
Note that the reset of general-purpose output won't be executed if "DO output at program reset ‹RESCDO›" within
H I/O parameters is set to "1: IO_HOLD".

I
Sample Description

MOVE P,P1
J DELAY 1000
HALTALL ………
Reset is executed after the program.

K In PTP movement specified by movement commands such as MOVE and DRIVE, the next line's command is executed
when the axis enters the OUT position range.
L Therefore, if a HALTALL command exists immediately after a PTP movement command, that HALTALL command is
executed before the axis arrives in the target position tolerance range.
Likewise, when specifying CONT options in interpolation movement during MOVE (L or C) command, the next
M command is executed immediately after movement starts. Therefore, if a HALTALL command exists immediately after
the interpolation movement command during MOVE (L or C) command with CONT options, a HALTALL command is
executed immediately after starting movement.
In either of the above cases, use the WAIT ARM command as shown below if desiring to execute the HALTALL
command after the axis arrives within the target position tolerance range.

DRIVE(1,P1) DRIVE(1,P1)
Target position
HALTALL WAIT ARM
HALTALL

Tolerance
OUT position
HALTALL execution HALTALL execution

8-62 Chapter 8 Robot Language


48 HAND
Defines the hand 8

Format
Definition statement:
HAND[robot number] Hn = 1st parameter 2nd parameter 3rd parameter R
A
Selection statement:
CHANGE[robot number] Hn B

C
Notation Value Range
Robot Number 1 to 4
D
n Hand Number 0 to 31
R Attaching Hand to R-axis
E
Explanation The HAND statement only defines the hand.
To actually change the hands data, use the CHANGE statement. F
For CHANGE statement details, refer to section "CHANGE".
If "R" is specified, the hand that are offset from the R-axis rotating center are selected.
G

H
• If a power OFF occurs during execution of the hand definition statement, the "9.707 Hand data destroyed" error
may occur. I
• If specifying the hand data that was defined by specifying other robots in the CHANGE statement,
"6.258: Illegal robot no" error may occur.
J

Robot language list 8-63


HAND
8
48.1 For SCARA Robots

48.1.1 <4th parameter> "R" is not specified.


Hands installed on the second arm tip are selected (see below).
A
1st parameter Number of offset pulses between the standard second arm position and the virtual second arm
position of hand "n". "+" indicates the counterclockwise direction [pulse].
B
2nd parameter Difference between the hand "n" virtual second arm length and the standard second arm length [mm]
3rd parameter Z-axis offset value for hand "n" [mm]
C Hand 1 Hand 2

20.00mm

D
lses
0 pu
-500
E m
m
00
0.
15

F
m
ar
d
2n
rd
da

G
an
St

33803-R9-00

H Sample Description
HAND H1= 0 150.000 0.0000
I HAND H2= -5000 20.000 0.000
P1= 150.000 300.000 0.000 0.000 0.000 0.000
CHANGE H2 ………
Changes the hand data of robot 1 to hand 2.
J MOVE P,P1 ………
Tip of hand 2 of robot 1 moves to P1.(1)
CHANGE H1 ………
Changes the hand data of robot 1 to hand 1.
MOVE P,P1 ………
Tip of hand 1 of robot 1 moves to P1.(2)
K HALT

L SAMPLE:HAND

(1) Y (2) Y
M
Hand 2 (150.00, 300.00)

Hand 1
(150.00, 300.00)

X X

33802-R7-01

8-64 Chapter 8 Robot Language


HAND
8
48.1.2 <4th parameter> "R" is specified.
The hands that are offset from the R-axis rotating center are selected (see below).

1st parameter When the current position of R-axis is 0.00, this parameter shows the angle of hand "n" from the
X-axis plus direction in a Cartesian coordinate system. ("+"indicates the counterclockwise direction.) A
[degree]
2nd parameter Length of hand "n" [mm] (>0)
B
3rd parameter Z-axis offset amount for hand "n" [mm]
Y
C

Standard 2nd arm 150.00mm D

X E
Hand 1
-90.00 deg.

100.00mm Hand 2
F
33804-R9-00
G
Sample Description
HAND H1= 0.00 150.0 0.0 R
HAND H2= -90.00 100.00 0.0 R H
P1= 150.00 300.00 0.00 0.00 0.00 0.00
CHANGE H1 ………
Changes the hand data of robot 1 to hand 1.
MOVE P,P1 ………
Tip of hand 1 of robot 1 moves to P1.(1) I
CHANGE H2 ………
Changes the hand data of robot 1 to hand 2.
MOVE P,P1 ………
Tip of hand 2 of robot 1 moves to P1.(2)
HALT J

SAMPLE:HAND K

(1) (2)
Y Y L

Hand 1 Hand 2 M
(150.00, 300.00) (150.00, 300.00)

X X

33804-R7-01

Robot language list 8-65


HAND
8
48.2 For Cartesian Robots

48.2.1 <4th parameter> "R" is not specified.


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-R9-00

H Sample Description
HAND H1= 0.000 0.000 0.000
HAND H2= 100.000 -100.000 -100.000
I P1= 200.000 250.000 0.000 0.000 0.000 0.000
CHANGE H2 ………
Changes the hand data of robot 1 to hand 2.
MOVE P,P1 ………
Tip of hand 2 of robot 1 moves to P1.(1)
J CHANGE H1 ………
Changes the hand data of robot 1 to hand 1.
MOVE P,P1 ………
Tip of hand 1 of robot 1 moves to P1.(2)
HALT
K
SAMPLE:HAND
L
(1) (2)
M
X X

Hand 2 Hand 1

(200.00, 250.00) (200.00, 250.00)

Y Y
33806-R7-01

8-66 Chapter 8 Robot Language


HAND
8
48.2.2 <4th parameter> "R" is specified.
The hands that are offset from the R-axis rotating center are selected (see below).

1st parameter When the current position of R-axis is 0.00, this parameter shows the angle of hand "n" from the
X-axis plus direction in a Cartesian coordinate system. ("+"indicates the counterclockwise direction.) A
[degree]
2nd parameter Length of hand "n". [mm] (>0)
B
3rd parameter Z-axis offset amount for hand "n". [mm]

X D
Hand1
E
150.00mm 90 deg.

Hand2
F
100.00mm

Y G
33806-R9-00

Sample Description H
HAND H1= 0.000 100.000 0.000 R
HAND H2= 90.000 150.000 0.000 R
P1= 200.000 250.000 0.000 0.000 0.000 0.000 I
CHANGE H2 ………
Changes the hand data of robot 1 to hand 2.
MOVE P,P1 ………
Tip of hand 2 of robot 1 moves to P1.(1)
CHANGE H1 ………
Changes the hand data of robot 1 to hand 1.
J
MOVE P,P1 ………
Tip of hand 1 of robot 1 moves to P1.(2)
HALT
K

SAMPLE:HAND L

(1) (2) M

X X

Hand 2 Hand 1

(200.00, 250.00) (200.00, 250.00)

Y Y
33808-R7-01

Robot language list 8-67


49 HOLD
8 Temporarily stops the program

Format
expression
HOLD
character string
A

Explanation Temporarily stops the program. When restarted, processing resumes from the next line after the HOLD
B
statement. If an <expression> or <character string> is written in the statement, the contents of the
<expression> or <character string> display on the programming box screen.
C

D HOLD is effective only in the task executed. The programs executed in other tasks continue execution.

E Sample Description
’MAIN ROUTINE
*ST:
F MOVE P,P0,P1
IF DI(20)=1 THEN ………
If DI(20) is ON
HOLD "PROGRAM STOP" ………
Pauses the task program to be executed (displayed as
G ENDIF “PROGRAM STOP”)
GOTO *ST
HALT ………
Stops and resets the program
H

In PTP movement specified by movement commands such as MOVE and DRIVE, the next line's command is executed
I when the axis enters the effective OUT position range.
Therefore, if a HOLD command exists immediately after a PTP movement command, that HOLD command is executed
J before the axis arrives in the target position tolerance range.
Likewise, when specifying CONT options in interpolation movement during MOVE (L or C) command, the next
command is executed immediately after movement starts. Therefore, if a HOLD command exists immediately after
K the interpolation movement command during MOVE (L or C) command with CONT options, a HOLD command is
executed immediately after starting movement.
L In either of the above cases, use the WAIT ARM command as shown below if desiring to execute the HOLD command
after the axis arrives within the target position tolerance range.

M
HOLD command

DRIVE(1,P1) DRIVE(1,P1)
Target position
HOLD WAIT ARM
HOLD

Tolerance
OUT position
HOLD execution HOLD execution

33822-R7-00

8-68 Chapter 8 Robot Language


50 HOLDALL
Temporality stops all programs 8

Format
expression
HOLDALL
character string
A

Explanation Temporality stops all programs. When restarted, the program that has executed HOLDALL is executed
B
from the next line after the statement, and other programs are resumed from the line that has interrupted
execution. If an <expression> or <character sting> is written in the statement, the contents of
<expression> or <character string> displays on the programming box screen. C

Sample Description
D
’MAIN ROUTINE
*ST:
MOVE P,P0,P1 E
IF DI(20)=1 THEN ………
If DI(20) is ON
HOLD "PROGRAM STOP" ………
Pauses all programs (displayed as “PROGRAM STOP”)
ENDIF F
GOTO *ST
HALT ………
Stops and resets the program
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 HOLDALL command exists immediately after a PTP movement command, that HOLDALL command is
executed before the axis arrives in the target position tolerance range.
Likewise, when specifying CONT options in interpolation movement during MOVE (L or C) command, the next
I
command is executed immediately after movement starts. Therefore, if a HOLDALL command exists immediately after
the interpolation movement command during MOVE (L or C) command with CONT options, a HOLDALL command is J
executed immediately after starting movement.
In either of the above cases, use the WAIT ARM command as shown below if desiring to execute the HOLDALL
command after the axis arrives within the target position tolerance range.
K

HOLDALL command L

DRIVE(1,P1) DRIVE(1,P1)
M
Target position
HOLDALL WAIT ARM
HOLDALL

Tolerance
OUT position
HOLDALL execution HOLDALL execution

33702-R9-00

Robot language list 8-69


51 IF
8 Evaluates a conditional expression value, and executes the command in accordance with the conditions

51.1 Simple IF statement


Format
label 1 label 2
A IF conditional expression THEN ELSE
command 1 command 2

B
Value Range (Specifying format)
conditional expression Input/Output signals or variables
C
Explanation This type of IF statement is available to write only when the conditional expression is "true"
D or when the number of <command> executed in the "false" condition is one.

E If the condition specified by the <conditional expression> is met true;


processing jumps either to the <label 1> which follows THEN,
or
F to the next line after <command 1> is executed.

G If the condition specified by the <conditional expression> is not met false;



1. Processing either jumps to the <label 2> specified after the ELSE statement,
or
H to the next line after <command 2> is executed.
2. If nothing is specified after the ELSE statement, no action is taken, and processing simply jumps
to the next line.
I

J When the conditional expression used to designate the IF statement condition is a numeric expression, an expression
value other than "0" indicates a TRUE status, and "0" indicates a FALSE status.

K
Sample Description
L IF DI(20)=1 THEN *MAIN1 ELSE *MAIN2 ………
If DI(20) is ON "True",
: Jumps to label *MAIN1
*MAIN1:
M DO(20)=1 If DI(20) is OFF "false",
: Jumps to label *MAIN2
*MAIN2:
DO(21)=1
:

8-70 Chapter 8 Robot Language


IF
8
51.2 Block IF statement
Format
IF conditional expression 1 THEN
command block 1 A
ELSEIF conditional expression 2 THEN
command block 2 B
ELSE
command block n
C
ENDIF

Value Range (Specifying format) D


conditional expression Input/Output signals or variables

E
Explanation If the condition specified by <conditional expression 1> is met (true), this statement executes the
instructions specified in <command block 1>, then jumps to the next line after ENDIF.
F
When an ELSEIF statement is present and the condition specified by <conditional expression 2> is met
(true), the instructions specified in <command block 2> are executed.
G
If all the conditions specified by the conditional expression are not met (false), <command block n> is
executed. H

I
When the conditional expression used to designate the IF statement condition is a numeric expression, an expression
value other than "0" indicates a TRUE status, and "0" indicates a FALSE status.
J
Sample 1 (Block IF statement 1) Description
K
MOVE P,P1,A3=0.00
IF DI(20)=1 THEN ……When DI(20) is ON, executes “true” command block.
DO(20)=1 ……From this line, “true” command block L
MOVE P,P10,A3=0.00
DO(20)=0 ……Down to this line, “true” command block
ELSE ……When DO(20) is OFF, executes “false” command block. M
DO(21)=1 ……From this line, “false” command block
MOVE P,P11,A3=0.00
DO(21)=0 ……Down to this line, “false” command block
ENDIF ……IF statement end definition
MOVE P,P20,A3=0.00 ……Jumps to this line after executing the IF statement
:

Sample 2 (Block IF statement 2) Description


MOVE P,P1,A3=0.00
IF DI(20)=1 THEN ……When DI(20) is ON, executes “true” command block.
DO(20)=1 ……From this line, “true” command block
MOVE P,P10,A3=0.00 ……Down to this line, “true” command block
ENDIF ……IF statement end definition
DO(20)=0 ……Jumps to this line after executing the IF statement
:

Robot language list 8-71


52 INPUT
8 Assigns a value to a variable specified from the programming box

Format
INPUT prompt statement ; variable , variable ,...
, point variable point variable
A shift variable shift variable

B
Explanation Assigns a value to the variable specified from the programming box.
The input definitions are as follows:
C 1. When two or more variables are specified by separating them with a comma ( , ), the specified input
data items must also be separated with a comma ( , ).
At the <prompt statement>, enter a character string enclosed in double quotation marks ( " ) that will
2. 
D appear as a message requiring data input. When a semicolon ( ; ) is entered following the <prompt
statement>, a question mark ( ? ) and a space will appear at the end of the message.
E When a comma ( , ) is entered, nothing will be displayed following the message.
3. When the <prompt statement> is omitted, only a question mark ( ? ) and a space will be displayed.
4. The input data type must match the type of the corresponding variables. When data is input to a point
F variable or shift variable, insufficient elements are set to "0".
5. If only the ENTER key is pressed without making any entry, the program interprets this as a "0" or "null

G string" input. However, if specifying two or more variables, a 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
H comma ( , ), double quotation mark ( " ) or character string, the 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 be identified as a double quotation mark input.
I
Entry Example Result ; Contents of A$
ABC ABC
J
(space)ABC(space) ABC: space is not entered before and after ABC
" ABC " ABC : spaces are entered before and after ABC
K ABC,XYZ ABC is entered, and XYZ is entered when the next INPUT statement is executed.
"ABC,XYZ" ABC,XYZ
L """ABC""" "ABC"

M 7. Pressing the ESC key skips this command.

• If the variable and the value to be assigned are different types, the specified message displays, and a "waiting for
input" status is established.
• When assigning alphanumeric characters to a character variable, it is not necessary to enclose the character string
in double quotation marks ( " ).
• When using INPUT statement, the value is assigned to the variable from the channel specified in controller
parameter "INPUT/PRINT using channel".

8-72 Chapter 8 Robot Language


INPUT
8
Sample Description
INPUT A ………
Converts the entered character string to a real number and
assigns to variable A!.
INPUT "INPUT POINT NUMBER";A1
………
Displays INPUT POINT NUMBER on a prompt of programming box, etc.
and converts the entered character string to a real number and A
assigns to variable A!.
INPUT "INPUT STRING",B$(0),B$(1)
B
………
Displays INPUT STRING on a prompt of programming box, etc. If
commas are contained in the entered character string, the first
character string is assigned to 0 element of the array variable C
B$ and the second character string is assigned to its 1 element.
INPUT P100 ………
Assigns the entered character string to P100.
HALT D

Robot language list 8-73


53 INROFST
8 Specifies/acquires R axis inertia offset for SCARA parameter.

Format

INROFST [robot number] expression

A
Value Range

B Robot Number 1 to 4 (If not input, robot 1 is specified.)


Value of R axis inertia offset for SCARA parameter
Expression
0 to 9999999 (units: 0.001mm)
C
Explanation Changes the value of "R axis inertia offset for SCARA" parameter of specified robot to the <expression>
D value.

E Sample Description
INROFST 10 ………
Sets "R axis inertia offset for SCARA" parameter of robot 1 to 10.
INROFST[2] 20 ………
Sets "R axis inertia offset for SCARA" parameter of robot 2 to 20.
F

H
Functions
I Format

INROFST [robot number]


J
Value Range
K Robot Number 1 to 4 (If not input, robot 1 is specified.)

L
Explanation This function acquires the value of "R axis inertia offset for SCARA" parameter of specified robot.

M Sample Description
A%=INROFST ………
The "R axis inertia offset for SCARA" parameter of robot 1 is
assigned to the variable A%.
A%=INROFST[2] ………
The "R axis inertia offset for SCARA" parameter of robot 2 is
assigned to the variable A%.

8-74 Chapter 8 Robot Language


54 INT
Truncates decimal fractions 8

Format

INT (expression)

A
Explanation This function acquires an integer value with decimal fractions truncated.
The maximum integer value which does not exceed the <expression> value is acquired..
B
Sample Description
A=INT(A(0)) ………
"-2" is assigned to B. C
B=INT(-1. 233)

Robot language list 8-75


55 JTOXY
8 Performs axis unit system conversions (pulse → mm)

Format

JTOXY [robot number](point expression)

A
Value Range

B Robot Number 1 to 4 (If not input, robot 1 is specified.

C Explanation Converts the joint coordinate data (unit: pulse) specified by the <point expression> into Cartesian
coordinate data (unit: mm, degree) of the robot specified by the <robot number>.

D Sample Description
P10=JTOXY(WHERE) ………
Current position data of robot 1 is converted to Cartesian
E coordinate data and assigned to P10.

F
Related commands XYTOJ

8-76 Chapter 8 Robot Language


56 LEFT$
Extracts character strings from the left end 8

Format

LEFT$ (character string expression, expression)

A
Value Range
Expression 0 to 255 B

Explanation This function extracts a character string with the digits specified by the <expression> from the left end of C
the character string specified by <character string expression>.

• The <expression> value must be between 0 and 255; otherwise an error will occur.
D
• If the <expression> value is 0;
extracted character string will be a null string (empty character string). E
• If the <expression> value has more characters than the <character string expression>;
extracted character string will become the same as the <character string expression>.
F

Sample Description G
B$=LEFT$(A$,4) ………
4 characters from the left end of A$ are assigned to B$.

H
Related commands MID$, RIGHT$
I

Robot language list 8-77


57 LEFTY
8 Sets the SCARA robot hand system as a left-handed system

Format

LEFTY [robot number]

A
Value Range

B Robot Number 1 to 4 (If not input, robot 1 is specified.

C Explanation Specifies the robot as a left-handed system.


This command is only valid for SCARA robots.

D This statement only specifies the hand system, and does not move the robot.

If executed while the robot arm is moving, execution waits until movement is complete (positioned
E within tolerance range).

F
Sample Description
G RIGHTY ………Specifies the hand system of robot 1 as a right-handed system.
MOVE P,P1 ………(1)
LEFTY ………Specifies the hand system of robot 1 as a left-handed system.
H MOVE P,P1 ………(2)
RIGHTY ………Specifies the hand system of robot 1 as a right-handed system.
HALT
I
SAMPLE:LEFTY/RIGHTY
J
P1

K
(2) (1)

M Left-handed system Right-handed system

SCARA robot
33809-R7-00

Related commands RIGHTY

8-78 Chapter 8 Robot Language


58 LEN
Acquires a character string length 8

Format

LEN(character string expression)

A
Explanation Returns the character string length of the <character string expression> as a number of bytes.

B
Sample Description
A$="YAMAHA" C
B$="YAMAHA MOTOR"
C$="YAMAHA CO., LTD."
PRINT LEN(A$) ………Indicates "6".
D
PRINT LEN(B$) ………Indicates "12".
PRINT LEN(C$) ………Indicates "16".
E

Robot language list 8-79


59 LET
8 Assigns values to variables

Format
LET arithmetic assignment statement
character string assignment statement
A point assignment statement
shift assignment statement

B
Explanation 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 without using a LET statement.
C

D If the controller power is turned off during execution of a <point assignment statement> or <shift assignment
statement>, a memory-related error such as the "9.702: Point data destroyed" or the "9.706: Shift data destroyed" may
occur
E

F
59.1 Arithmetic assignment statement

G Format
LET integer variable = expression

H real variable
parallel output variable
internal output variable
I arm lock output variable
timer output variable
J serial output variable
serial word output variable
serial double-word output variable
K
Value Contents
Expression Variables (except character string variables, point data variables, shift variables),
L Function, Numeric value

M Explanation The expression value is assigned to the left-side variable

Sample
A!=B!+1
B%(1,2,3)=INT(10.88)
DO2()=&B00101101
MO(21,20)=2
LO(00)=1
TO(01)=0
SO12()=255

Reference For details of assignment statements and output variables,


refer to "5.1 Assignment statements" "5.2 Input/output variables" in Chapter 7.

8-80 Chapter 8 Robot Language


LET
8
59.2 Character string assignment statement
Format

LET character string variable = character string expression


A
Explanation The <character string expression> value is assigned to the character string variable.
Only the plus (+) arithmetic operator can be used in the <character string expression>.
B
Other arithmetic operators and parentheses cannot be used.
Sample
A$ ="YAMAHA" C
B$ ="ROBOT"
D$ = A$ + "-" + B$
D
Execution result: YAMAHA-ROBOT

The "+" arithmetic operator is used to link character strings..


F

59.3 Point assignment statement G


Format
H
LET point variablee = point expression

Explanation Assigns <point expression> values to point variables.


I
Only 4 arithmetic operators ( +, -, *, / ) can be used in the <point expression>.
Multiplication and division are performed only for constant or variable arithmetic operations. J
• Addition / Subtraction: Addition / subtraction is performed for each element of each axis.
• Multiplication / Division: Multiplication / division by a constant or variable is performed for each
element of each axis.
K
Multiplication results vary according to the point data type.
• For "pulse" units: Assigned after being rounded to an integer. L
• Assigned a real number after being rounded off to two decimal places.

Sample Description M
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.
………
Each element of point 3 is subtracted from point 30 and assigned to
P30=P30-P3 P30.
………
Each element of point 70 is multiplied by 4 and assigned to P80.
P80=P70*4 ………
Each element of point 5 is divided by 3 and assigned to P60.

P60=P5/3

• Permissible examples: P15 * 5, P[E]/A, etc.


• Prohibited examples: P10 * P11, 3/P10, etc.

Robot language list 8-81


LET
8
59.4 Shift assignment statement
Format

LET shift variable = shift expression


A
Explanation Assigns <shift expression> values to <shift variables>.

B
• Available elements in <shift expressions> are only shift elements.
• Available operators in <shift expressions> are only addition and subtraction arithmetic operators.
C *Addition/subtraction is performed for each element of each axis.
• Parentheses are not available.

D
Sample Description
E S1=S0 ………
"shift 0" is assigned to "shift 1".
S2=S1+S0 ………
Each element of "shift 1" and "shift 0" is summed and assigned to
"shift 2".
F

G
• Permissible examples: S1 + S2
• Prohibited examples: S1 + 3
H

8-82 Chapter 8 Robot Language


60 LO
Arm lock output or acquires the output status 8

Format
1. LET LOm (b, ..., b) = expression
2. LET LO (mb, ..., mb) = expression
A

Notation Value Range


B
m Port Number 0, 1
0 to 7 (If omitted, all 8 bits are processed.)
b Bit Definition(*) If multiple bits are specified, they are expressed from the left in descending order (high C
to low).

Integer value (If real number is specified, rounds to an integer.) D


Bits beyond the number of bit whom an assignment destination is required are
Expression ignored. (If the port number is specified, the lower 8 bits are valid. if the number of
bit specified on bit definition is 1 to 8, the lower 1 to 8 bit corresponding to the bits E
specified on the left side are valid.)

F
Explanation This statement outputs the specified value to the LO port to either prohibit or allow axis movement.

G
• LO(00) to LO(07) correspond to axes 1 to 8, LO(10) to LO(17) correspond to axes 9 to 16, respectively.
• An arm lock ON status occurs at axes where bits are set, and axis movement is prohibited.
H
Reference * Chapter 3 "10 Bit Settings"

This statement is valid for axes whose movement is started. J

Sample Description
K
LO0()=&B00001010 ………
Prohibits movement at axes 2 and 4.
LO0(2,1)=&B10 ………
Prohibits movement at axis 3, permits movement at axis 2. L

Robot language list 8-83


LO
8
Functions

Format
1. LET expression = LOm (b, ..., b)
2. LET expression = LO (mb, ..., mb)
A

B Notation Value Range


m Port Number 0, 1
 to 7 (If omitted, all 8 bits are processed.)
0
C b bit Definition If multiple bits are specified, they are expressed from the left in descending order (high
to low).

D Explanation Acquires the output status of the specified LO port.

E • LO(00) to LO(07) correspond to axes 1 to 8, LO(10) to LO(17) correspond to axes 9 to 16, respectively.
• An arm lock ON status occurs at axes where bits are set, and axis movement is prohibited.

F Sample Description
A%= LO0() ………
Output status of ports DO(07) to LO(00) is assigned to
G variable A%.
A%= LO0(6, 5, 1) ………
Output status of LO(06), LO(05) and LO(01) is assigned to
variable A%.
H (If all above signals are 1(ON), then A%=7.)
A%=LO(17,15,00) ………
Output status of L0(17), LO(15) and L0(00) is assigned to
variable A%.
I (If all above signals except L0(15) are 1 (ON), then A%=5.)

J Related commands RESET, SET

8-84 Chapter 8 Robot Language


61 LOCx
Specifies/acquires point data for a specified axis or shift coordinate data/work data for a specified element 8

Format
1. LOCx (point expression) = expression
2. LOCx (shift expression) = expression
3. LOCx (Wn) = expression
A

B
Value Range / Meaning
1 to 6 (axis setting)
F (hand system flag setting) C
Format 1 x
F1 (first arm rotation information)
F2 (second arm rotation information)
D
Format 2 x 1 to 4 (element setting)

Format 3 x 1 to 4 (element setting)


E
n 0 to 39 (work number)

• For Axis or element setting: coordinate value, variables F


• For Hand system flag setting: 0  (no setting),
Expression
1 (right-handed system), 2 (left-handed system)
• For first / second arm rotation information(*1): 0, 1, -1 G
*1: The first arm and the second arm rotation information is only for YK-TW.
For details, refer to Chapter 4 "3. Point data format".
H

Explanation Format 1: C
 hanges the value of the point data specified axis, the hand system flag, and the first arm and
the second arm rotation information.
I
Format 2: Changes the value of a specified element from the shift coordinate data.
Format 3: Changes the value of a specified element from the work data. J
n NOTE
When changing the work data, execution will be in a waiting state until the operation of the target robot enters
K
within the tolerance range.
(For LOCx during conveyor tracking, refer to the separate manual "Tracking System" CTMOVE.)

M
Points where data is to be changed must be registered in advance. An error occurs when attempting to change an
unregistered (no coordinate values / no element data) point, shift coordinate, or work data.

Robot language list 8-85


LOCx
8
Functions

Format
1. LOCx (point expression)
2. LOCx (shift expression)
A
3. LOCx (Wn)

B Value Range
1 to 6 (axis setting)
C Format 1 x
F (hand system flag setting)
F1 (first arm rotation information)
F2 (second arm rotation information)
D Format 2 x 1 to 4 (element setting)

Format 3 x 1 to 4 (element setting)


E
n 0 to 39 (work number)

Expression For Axis or element setting: coordinate value, variables


F
Explanation Format 1: A
 cquires the value of the point data specified axis, the hand system flag, and the first arm and

G the second arm rotation information.


Format 2: Acquires a specified axis element from the shift coordinate data.
Format 3: Acquires a specified axis element from the work data.
H

I
Sample Description
LOC1(P10)=A(1) ………
A xis 1 data of P10 is changed to the array A (1) value.
J LOC2(S1)=B ………
2nd element (Y direction) of S1 is changed to the B value.
LOC3(W1)=C ………
3rd element (Z direction) of W1 is changed to the C value.

K A(1)=LOC1(P10) ………
A xis 1 data of P10 is assigned to array A (1).
B(2)=LOC1(S1) ………
1st element (X direction) of S1 is assigned to array B (2).
C(3)=LOC1(W1) ………
1st element (X direction) of W1 is assigned to array C (3).
L

M Related commands Point variable, Shift variable, Work data

8-86 Chapter 8 Robot Language


62 LSHIFT
Left-shifts a bit 8

Format

LSHIFT (expression 1, expression 2)

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 Description C
A=LSHIFT(&B10111011,2) ………
The 2-bit-left-shifted &B10111011 value (&B11101100) is
assigned to A.
D

Related commands RSHIFT E

Robot language list 8-87


63 MCHREF
8 Acquires the machine reference value (axes: sensor method / stroke-end method)

Format

MCHREF [robot number](axis number)

A
Value Range

B Robot Number 1 to 4 (If not input, robot 1 is specified.)


Axis Number 1 to 6

C
Explanation This function returns the return-to-origin or absolute-search machine reference value (unit: %) of
specified axes.
D This function is valid only for axes whose return-to-origin method is set as "Sensor" or "Stroke-end".

E
Sample Description

F A=MCHREF(1) ………
The machine reference of axis 1 of robot 1 is assigned to
variable A.

8-88 Chapter 8 Robot Language


64 MID$
Acquires a character string from a specified position 8

Format

MID$ (character string expression, expression 1, expression 2)

A
Value Range
Expression 1 1 to 255
B
Expression 2 0 to 255

C
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> specifies the character where the
extraction is to begin, and <expression 2> specifies the number of characters to be extracted.
D

•If the <expression 1> and <expression 2> values violate the permissible value ranges, An error will E
occur
•If <expression 2> is omitted, or if the number of characters to the right of the character of <expression
1> is less than the value of <expression 2>, then all characters to the right of the character specified by F
<expression 1> will be extracted.
•If <expression 1> is longer than the character string, the extracted value will be a null string (empty
G
character string).

H
Sample Description
B$=MID$(A$,2,4) ………
The 2nd to 4th characters (up to the 5th characters) of A$ I
are assigned to B$.

J
Related commands LEFT$, RIGHT$

Robot language list 8-89


65 MO
8 Outputs a specified value to the MO port or acquires the output status

Format
1. LET MOm(b, ..., b) = expression
2. LET MO(mb, ..., mb) = expression
A

B Notation Value Range / Meaning


m Port Number 2 to 7, 10 to 17, 20 to 27, 30 to 37
 to 7 (If omitted, all 8 bits are processed.)
0
C b Bit Definition(*) If multiple bits are specified, they are expressed from the left in descending order (high
to low).

D Integer value (If real number is specified, rounds to an integer.)


Bits beyond the number of bit whom an assignment destination is required are
Expression ignored. (If the port number is specified, the lower 8 bits are valid. if the number of
E bit specified on bit definition is 1 to 8, the lower 1 to 8 bit corresponding to the bits
specified on the left side are valid.

F
Explanation Outputs a specified value to the MO port.

G In order to maintain the origin sensor status and axis HOLD status at each axis, ports "30" to "37" cannot
be used as output ports (these ports are for referencing only). (Ports 32, 33, 36, and 37 are reserved by
the system.)
H Reference * Chapter 3 "10 Bit Settings"

I c CAUTION
Outputs to MO0() and MO1() are not possible.

J
Ports "30", "31", "34", and "35" outputs
Bit 7 6 5 4 3 2 1 0
K Port 30 Axis 8 Axis 7 Axis 6 Axis 5 Axis 4 Axis 3 Axis 2 Axis 1
Port 31 Axis 16 Axis 15 Axis 14 Axis 13 Axis 12 Axis 11 Axis 10 Axis 9
L Origin sensor status 0: ON; 1: OFF (Axis 1 is not connected)
Port 34 Axis 8 Axis 7 Axis 6 Axis 5 Axis 4 Axis 3 Axis 2 Axis 1
Port 35 Axis 16 Axis 15 Axis 14 Axis 13 Axis 12 Axis 11 Axis 10 Axis 9
M HOLD status 0: No HOLD / 1: HOLD (Axis 1 is not connected)

For details regarding MO ports "30" to "37", refer to Chapter 3 "9.5 Internal output variable".

Sample Description
MO2()=&B10111000 ………
MO(27,25,24,23) are turned ON, and MO(26,22,21,20) are turned OFF.
MO2(6,5,1)=&B010 ………
MO(25) are turned ON, and MO (26,21) are turned OFF.
MO3() = 15 ………
MO(33,32,31,30) are turned ON, and MO(37,36,35,34) are turned OFF.
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.

8-90 Chapter 8 Robot Language


MO
8
Functions

Format
1. LET expression = MOm(b, ..., b)
2. LET expression = MO(mb, ..., mb)
A

Notation Value Range


B
m Port Number 2 to 7, 10 to 17, 20 to 27, 30 to 37
 to 7 (If omitted, all 8 bits are processed.)
0
b bit Definition If multiple bits are specified, they are expressed from the left in descending order C
(high to low).

Integer value (If real number is specified, rounds to an integer.) D


Bits beyond the number of bit whom an assignment destination is required are
Expression ignored. (If the port number is specified, the lower 8 bits are valid. if the number of
bit specified on bit definition is 1 to 8, the lower 1 to 8 bit corresponding to the bits E
specified on the left side are valid.)

F
Explanation Acquires the output status of the specified MO port.

G
Sample Description
A%= MO0() ………
Output status of ports MO(07) to MO(00) is assigned to
H
variable A%.
A%= MO0(6, 5, 1) ………
Output status of MO(06), MO(05) and MO(01) is assigned
to variable A%.
I
(If all above signals are 1(ON), then A%=7.)

A%=MO(17,15,00)
………
Output status of M0(17), MO(15) and M0(00) is assigned
to variable A%.
J
(If all above signals except M0(15) are 1 (ON), then
A%=5.)
………
Output status of M0(377), MO(365), MO(255) and M0(123) is
K
A%=MO(377,365,255,123) assigned to variable A%.
(If all above signals except M0(15) are 1 (ON), then
A%=15.)
L

M
Related commands RESET, SET

Robot language list 8-91


66 MOTOR
8 Controls the motor power status

Format
ON
MOTOR OFF
A PWR

B
Explanation This command controls the motor power on/off. The servo on/off of all robots can also be controlled at
the same time.
C
• ON: Turns on the motor power. All robot servos are also turned on at the same time.
• OFF: Turns off the motor power. All robot servos are also turned off at the same time to apply the
D dynamic brake. For the axis with the brake, the brake is applied to lock it.
• PWR: Turns on only the motor power.
E
Sample Description

F MOTOR ON ………
Turns on the motor power and all robot servos.

8-92 Chapter 8 Robot Language


67 MOVE
Moves robot to the absolute position 8

Format

MOVE[robot number ](axis number ,...) PTP , point of destination , option,


P option...
A
L
C
B
Explanation Executes absolute movement of robot (axis).
It is not enabled for axes of other robots or for auxiliary axes. C

Value Range / Type


D
Robot Number 1 to 4 (If not input, robot 1 is specified.)
Axis Number 1 to 6 (Multiple axes specifiabl. If not input, all axes are specified.)
PTP, P, L, C Movement type. PTP/P: PTP, L: Linear interpolation, C: Circular interpolation
E
Robot stopping (target) position.
Specify the following data format: F
Point of
Destination • Direct numeric value (coordinate data) • Point definition (Point number) • Point name*
*F or the method of adding/editing point name,
refer to "Point editing" in RCX 3 Series Operator's Manual. G
 elative Speed setting, Absolute speed setting, Linear speed setting
R
Option
Arch motion setting H
STOPON condition setting, CONTON condition setting, CONT setting,
multiple options
Acceleration setting, Deceleration setting,
specifiable
Plane coordinate setting, Port output setting I

Options PTP
Linear Arch
Remarks
J
interpolation interpolation

Relative speed setting


(SPEED)
3 3 3 Enabled only in specified MOVE statement K
Absolute speed setting
(DSPEED)
3 3 3 Enabled only in specified MOVE statement L
Linear speed setting (VEL) - 3 3 Enabled only in specified MOVE statement

Arch motion 3 - - Enabled only in specified MOVE statement


M
STOPON condition setting 3 3 3 Enabled only when program execution

CONTON condition setting 3 3 3 Enabled only when program execution

CONT setting 3 3 3 Enabled only in specified MOVE statement


Enabled only in specified MOVE statement
Acceleration setting 3 3 3

Deceleration setting 3 3 3 Enabled only in specified MOVE statement

Plane coordinate setting - - 3 Enabled only in specified MOVE statement

Port output setting - 3 3 Enabled only in specified MOVE statement

Robot language list 8-93


MOVE
8
Movement type

● PTP (point-to-point) movement (MOVE P)


Robot moves from the currently stopping position to the specified point position along the shortest path for each
axis. The path is thus not a straight line.
A • Execution START condition: Movement of all specified axes is complete (within the tolerance range*1).
• Execution END condition: All specified axes have entered the OUT position range*2.
When two or more axes are specified, they will reach their target positions simultaneously. The movement path of
B
the axes is not guaranteed.

C
Sample Description

D MOVE P,P0 ………


Robot 1 moves from its current position to the position
specified by P0. (the same occurs for MOVE PTP, P0).
………
Robot 1 moves from its current position to the position
E MOVE P,END _ POINT specified by point name "END _ POINT".

F
• PTP movement is faster than interpolation movement, but when executing continuous movement to multiple
G points, a positioning stop occurs at each point.
• Refer to "Point editing" in RCX 3 Series Operator's Manual for details of adding and editing point names.

H
*1) Axis parameter "Tolerance <TOLE>"
This parameter sets the positioning completion range to the target position when the robot moves.
I When the current position of the robot enters the specified range, this is judged to the positioning completion.

J Target Position

Current Position

K Tolerance Range

Note) Depending on the movement type, the timing of the command completion (the timing when the command on the
L next line is executed) differs from one judged to the positioning completion .

8-94 Chapter 8 Robot Language


MOVE
8
*2) Caution regarding commands which follow the MOVE P command; Axis parameter "OUT position <OUTPOS>"
This parameter sets the execution completion range to the target position when a PTP movement command is
executed.

If the next command following the MOVE P command is an executable command such as a signal output
command, that next command will start when the movement axis enters the OUT position range. In other words, A
that next command starts before the axis arrives within the target position tolerance range.

B
Signal output (DO, etc.) Signal is output when the axis enters within OUT position range.
DELAY DELAY command is executed and standby starts, when the axis enters the OUT position range.

HALT
Program stops and is reset when the axis enters the OUT position range. Therefore, the axis C
movement also stops.
All programs in execution stop when the axis enters the OUT position range, task 1 is reset, and
HALTALL
other tasks terminate. Therefore, the movement also stops. D
Program temporarily stops when the axis enters the OUT position range. Therefore, the axis
HOLD
movement also stops.

HOLDALL
All programs in execution temporarily stop when the axis enters the OUT position range. E
Therefore, the movement also stops.
WAIT WAIT command is executed when the axis enters the OUT position range.

The WAIT ARM statements are used to execute the next command after the axis enters the tolerance range. F

G
The OUT position value is specified by parameter setting. This value can be changed within the program by using
the OUTPOS command.
H

I
MOVE P,P1 MOVE P,P1
Target position
DO(20)=1 WAIT ARM
DO(20)=1 J
P1

Tolerance
K
OUT position
DO(20) turns ON DO(20) turns ON

L
MOVE P,P1 MOVE P,P1
HOLD
Target position
WAIT ARM M
HOLD

Tolerance
OUT position
HOLD execution HOLD execution
(program temporarily stops) (program temporarily stops)

Robot language list 8-95


MOVE
8
● Linear interpolation movement (MOVE L)
Robot follows the linear path made by connecting 2 dots between the currently stopping position and the
specified point position.

• Execution START condition: Movement of all specified axes is complete (within the tolerance range).
A • Execution END condition: Movement of all specified axes has begun (within the tolerance range).
All movement axes arrive at the same time.

B c CAUTION
For the continuous motion specified by several points, CONT setting (continuous motion) is required.
In RCX340/RCX320, the motion of interpolation movement command and END condition are different from
C conventional model. Addition of the CONT setting to the movement command allows to the equivalent
movement and END condition in conventional model.

D
On robots with R-axis, the R-axis speed may become too fast and cause an error, depending on the R-axis movement
E distance.

F Sample Description
MOVE L,P0,P1 ………
The robot 1 moves (linear interpolation movement) from its
G current position to the position specified by P0, P1.

SAMPLE:MOVE L
H
P0 P1

I Tolerance range

J Current position

K Movement command types and the corresponding movement

1. PTP movement
L Current position
OUT position range
Target position
Tolerance range

M
The command ends when the axis
enters the OUT position range, and
the next command is then executed.

2. Interpolation movement
OUT position range
Current position Target position
Tolerance range

The next command is executed when


the axis arrives in the tolerance range.

8-96 Chapter 8 Robot Language


MOVE
8
● Circular interpolation movement (MOVE C)
Robot follows the circular path made by connecting 3 dots between the currently stopping position and the
specified point positions.

In circular interpolation, an arc is generated based on 3 points: the current position, an intermediate position, and
the target position. Therefore, circular interpolation must be specified by an even number of points. A

• Execution START condition: Movement of all specified axes is complete (within the tolerance range).
B
• Execution END condition: Movement of all specified axes has begun.
All movement axes arrive at the same time.
C
c CAUTION
In RCX340/RCX320, the motion of interpolation movement command and END condition are different from
conventional model. Addition of the CONT setting to the movement command allows to the equivalent
movement and END condition in conventional model.
D

Sample Description E
MOVE L,P20 ………
Linear interpolation movement of robot 1 occurs from
the current position to P20.
MOVE C,P21,P22,P23,P20 ………
Circular interpolation movement occurs through points F
P21, P22, P23, P20.
MOVE L,P24 ………
Linear interpolation movement occurs to P24.
G
SAMPLE:MOVE C P22

H
P23 P21

I
Current position P20 P24

J
• Circular interpolation is possible within the following range: radius 0.100mm to 5,000.000mm.
• In order to create a locus of closed circle, connect 2 arcs.
K
• Circle distortion may occur, depending on the speed, acceleration, and the distance between 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.
L

Robot language list 8-97


MOVE
8
Point data setting types

● Direct numeric value input PTP Linear interpolation Circular interpolation


Format

A p1 p2 p3 p4 p5 p6 f f1 f2

Notation Value
B p1 to p6 Space-separated coordinate values for each axis
f Hand system flag (SCARA robot only)
f1 First arm rotation information (YK-TW series only)
C
f2 Second arm rotation information (YK-TW series only)

D Explanation Directly specifies coordinate data by a numeric value. Units for the coordinate is as follows;
• Integer: "pulse" units
E • Real number (with decimal point): "mm/deg." units
• Integers and real numbers (mixed): All coordinate values will be handled in "mm/deg." units.

F The types of movements in which this specification is possible are the PTP movement and the linear
interpolation movement.

G
Notation: f ) SCARA robots with coordinate data in "mm" units --> Hand system flags can be specified. (*1)
To set the hand system flag, set either 1 or 2 at "f".
H If a number other than 1 or 2 is set, or if no number is designated, 0 will be set to indicate that there is
no hand system flag.

I 0
Hand system flag is not set.
Any value other than 1 / 2, or no setting.
f
1 Right-handed system is used to move to a specified position.
J 2 Left-handed system is used to move to a specified position.

K Notation: f1,2) YK-TW series with coordinate data in "mm" units -->
The first and second arm rotation information can be specified. (*1)
L To set the rotation information, set "-1", "0", or "1" at f1 and f2.
Any other value or no setting will be processed as "0".
Indicates arm rotation information where movement to the "0" position has been specified.
M 0
Any value other than -1 / 0 / 1, or no setting.
f1, 2
1 Indicates arm rotation information where movement to the "1" position has been specified.
-1 Indicates arm rotation information where movement to the "-1" position has been specified.

Reference *1: Chapter 4 "3. Point data format"

c CAUTION
•W
 hen performing linear interpolation with a hand system flag specified, be sure that the same hand system is
used at the current position and target position. If the hand system are different, an error will occur and robot
movement will be disabled.
•W
 hen performing a linear interpolation, the current position's first arm and second arm rotation information
must be the same as the movement destination's first arm and second arm rotation information. If the two are
different, an error will occur and movement will be disabled.

8-98 Chapter 8 Robot Language


MOVE
8

 t SCARA robots with a hand system flag set in the movement destination's coordinate data, the specified hand
A
system will have priority over the current arm type or LEFTY/RIGHTY setting.

Sample Description A
MOVE P,10000 10000 1000 1000 0 0
………
PTP movement of robot 1 occurs from current position to the B
specified position.
MOVE P,100.0 100.0 50.0 45.0 0.0 0.0 2
………
PTP movement of robot 1 occurs from current position to the C
specified position with Left-handed system.
MOVE P,-180.0 -430.0 50.0 180.0 0.0 0.0 1 -1 1
D
………
PTP movement of robot 1 occurs from current position to the
specified position (first arm: -180°to 360°, second arm: 180° to 360°)
with right-handed system. E

● Point definition PTP Linear interpolation Circular interpolation G


Format

point expression , point expression... H

Explanation Specifies a <point expression>. Two or more data items can be designated by separating them with
a comma ( , ).
I
Circular interpolation must be specified by an even number of points.
J
c CAUTION
When moving the robot by linear or circular interpolation to a point where a hand system flag is specified, be
sure that the same hand system is used at both the current and target positions. If the hand system are different,
an error will occur and robot movement will be disabled. K

 t SCARA robots with a hand system flag set in the movement destination's coordinate data, the specified hand
A
system will have priority over the current arm type or LEFTY/RIGHTY setting.
M

Sample Description
MOVE P,P1 ………
Robot 1 moves from the current position to the position
specified by P1.
MOVE P,P20,P0,P100 ………
Robot 1 moves in sequence from the current position to
positions specified by P20, P0, P100.

c CAUTION
When performing a linear and circular interpolation, the current position's first arm and second arm rotation
information must be the same as the movement destination's first arm and second arm rotation information. If
the two are different, an error will occur and movement will be disabled.

Robot language list 8-99


MOVE
8
● Point name definition PTP Linear interpolation Circular interpolation
Format

point name , point name...

A Explanation Specifies a <point name>. Two or more data items can be designated by separating them with a comma ( , ).
Circular interpolation must be specified by an even number of points.

B
 t SCARA robots with a hand system flag set in the movement destination's coordinate data, the specified hand
A
C system will have priority over the current arm type or LEFTY/RIGHTY setting

D Sample Description
MOVE P,PICK _ POINT ………
Robot 1 moves from the current position to positions
E specified by the point name "PICK _ POINT".
MOVE C, CIRCLE _ PNT1,CIRCLE _ PNT2

F ………
Robot 1 moves in coordinates specified by the current
position and point name "CIRCLE _ PNT1" and "CIRCLE _ PNT2"
in circular interpolation movement.
G

H Option types

● Relative speed setting (SPEED) PTP Linear interpolation Circular interpolation


I Format
1. SPEED = expression
J 2. S = expression

Value Range
K Expression 1 to 100 (units: %)

L Explanation Specifies the program speed in an <expression>.


Robot max. speed (mm/sec or deg/sec) × automatic movement speed (%) × program movement speed S (%)

M "S" setting superimposes the speed on the current automatic movement speed.
automatic movement speed (%) × program movement speed S (%) = actual speed (%)
100% 50% 50%
50% 50% 25%

n NOTE
This option specifies only the maximum speed and does not guarantee the movement at the specified speed.
• Automatic movement speed: Specified by programming box operation or by the ASPEED command.
• Program movement speed: Specified by SPEED commands or MOVE, DRIVE speed settings.

Sample
Description
(Automatic movement speed: 80%)

MOVE P,P0 ………


PTP movement to P0 (Actual speed is 80%)
MOVE P,P1,S=50 ………PTP movement to P1 (Actual speed is 40%)

8-100 Chapter 8 Robot Language


MOVE
8
● Absolute speed setting (DSPEED) PTP Linear interpolation Circular interpolation
Format
1. DSPEED = expression
2. DS = expression

Value Range A
Expression 0.01 to 100.00 (units: %)
B
Explanation Specifies the ratio to the maximum speed of the robot. (This setting is enabled only for the specified
MOVE statement.) C
Robot max. speed (mm/sec. or deg./sec.) × movement speed DS (%)

Movement always occurs at the DSPEED <expression> value (%)


D
without being affected by the automatic movement speed value (%).
E
n NOTE
SPEED option and DSPEED option cannot be used together.

Sample
Description
F
(Automatic movement speed: 80%)

MOVE P,P0
MOVE P,P1,DS=50
………
PTP movement to P0 (Actual speed is 80%)
………PTP movement to P1 (Actual speed is 40%)
G
MOVE P,P2,DS=0.1 ………PTP movement to P2 (Actual speed is 0.1%)
H

I
● Speed setting (VEL) PTP Linear interpolation Circular interpolation
Format
J
VEL = expression

Value Range K
Expression 0.01 to 100.00 (units: %)

L
Explanation Specifies the maximum composite speed (in "mm/sec." units) of the XYZ axes in an <expression>.
This option is enabled only for the specified MOVE statement.
The setting "VEL=" moves a robot in the specified velocity regardless of automatic movement speed. M

n NOTE
• This option specifies only the maximum resultant speed and does not guarantee movement at the specified
speed.
• Although the values after decimal point can be entered, it is removed when execution and does not affect
the motion.

Sample Description
MOVE L,P10,VEL=100 ………
Robot 1 moves from the current position to the position
specified by P10 at the maximum composite speed of 100 mm/
sec. of the XYZ axis.

Robot language list 8-101


MOVE
8
● Arch motion setting PTP Linear interpolation Circular interpolation
Format

x = expression {expression 1, expression 2}

Value Contents
A
x Specifies an arch axis from A1 to A6

B Expression
Arch position (Specify with Direct numeric value / or / Variable)
Integer value: "pulse" units.
R
 eal number (with decimal point): "mm/deg." units.

C Linear distance from the start (current) position; Arch distance 1


Expression 1 Integer value: "pulse" units.
R
 eal number (with decimal point): "mm/deg." units.
D
Linear distance to the end (target) position; Arch distance 2
Expression 2 Integer value: "pulse" units.
E R
 eal number (with decimal point): "mm/deg." units.

F
•W  hen there is a real value in any of the <expression>, <expression 1>, and <expression 2>, all expressions are
handed as real value.
G • The Value specified in <expression> is based on the robot coordinates. Settings such as hand definition and work
definition are not considered.

H
Explanation 1. The "x" specified axis begins moving toward the position specified by the <expression> ("1" shown in
the Fig. below).
I 2. W
 hen the axis specified by "x" moves the arch distance 1 or more, other axes move to their target
positions ("2" shown in the figure below).
J 3. T
 he axis specified by "x" moves to the target position so that the remaining movement distance
becomes the arch distance 2 when the movement of other axes is completed ("3" shown in the figure
below).
K 4. The command ends when all axis enter the OUT position range.

L This option can be used only for PTP movement.


When the axis specified by "x" is the first arm or second arm of the SCARA robot or the axis 1 or axis 2
of the XY robot, the <expression> and target position value are limited to an integer (pulse units).
M
n NOTE
The axis arch distance parameters can be changed using ARCHP1/ARCHP2 (arch pulse1 and 2 are equivalent to
arch distance 1 and 2. respectively). The smaller the value, the shorter the movement execution time.

Sample Description
MOVE P,P0,A3=0.00 {50.00, 70.00}
………
The A3-axis moves from the current position to the "0.00 mm" position.
After that, other axes move to P0. Finally, the A3-axis moves to P0.

2. Other axes movement


A3=0.00mm
(3rd axis; Z-axis) Arch distance 2
70.00mm
Arch distance 1 3. A3-axis movement
1. A3-axis movement
50.00mm (Z-axis)
(Z-axis)
+ Current position Target position
(Start position) (End position; P0)

8-102 Chapter 8 Robot Language


MOVE
8

When multiple points are specified in PTP movement, the axis in arch motion setting also moves to the target
position.
PTP movement
MOVE P, P10, P11, A3 = 0
A3=0
A
All axes move to P10.
B
P10 P11

C
● STOPON condition setting PTP linear interpolation Circular interpolation
Format
D
STOPON conditional expression
E
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 F
conditions are met.
If the conditions are already met before movement begins, no movement occurs, and the command is
G
terminated.

This option can only be used for PTP movement and linear interpolation movement. H
This option is enabled only when program execution.

c CAUTION
If STOPON condition is simultaneously specified with CONTON and CONT setting, the lower setting will be
I
invalidated as shown below;
STOPON condition setting > CONTON condition setting > CONT setting J

Sample Description
K
MOVE P,P0,STOPON DI(20)=1
MOVE P, P1 L
………
Robot 1 moves from the current position to the position specified

M
by P100. If the "DI (20) = 1" condition is met during movement, a
deceleration and stop occurs.
The next step (PTP movement to P1) is then executed.

Current Position P0

DI(20) ON

P1

 hen the conditional expression used to designate the STOPON condition is a numeric expression, expression value
W
other than "0" indicates a TRUE status, and "0" indicates a FALSE status.

Robot language list 8-103


MOVE
8
● CONTON condition setting (Continuous Motion) PTP linear interpolation Circular interpolation
Format

CONTON conditional expression

A Explanation When the conditions specified by the conditional expression are met, the robot starts deceleration stop
and executes the next command without waiting the movement completion (entering the tolerance
range) of axis.
B
The deceleration movement distance will be generated during the deceleration stop.

C If the next command is a movement command, the 2 movement paths are linked by connecting the
deceleration and acceleration sections, enabling continuous movement without intermediate stops.

D • If the conditions are not met, the robot moves to the specified target position and terminates the command.
• This option is enabled only when a program execution.
E
c CAUTION
If STOPON condition is simultaneously specified with CONTON and CONT setting, the lower setting will be
invalidated as shown below;
F STOPON condition setting > CONTON condition setting > CONT setting

G
Sample Description
MOVE P,P1,CONTON DI(20)=1
H
………
Robot 1 moves from the current position to the position specified by P1.
If the "DI (20) = 1" condition is met during movement,
I the robot starts decelerating and executes the next step.

Difference from STOPON condition setting


J STOPON CONTON

MOVE P, P2 MOVE P, P2
K
When conditions are not met MOVE P, P1 MOVE P, P1
,STOPON DI(20)=1 ,CONTON DI(20)=1
L

M
MOVE P, P2 MOVE P, P2
MOVE P, P1 MOVE P, P1
,STOPON DI(20)=1 ,CONTON DI(20)=1
When conditions are met Starts next command Merged
Establishment of after stopping Establishment of
“DI(20)=1” “DI(20)=1”

 hen < conditional expression > is a numeric expression, expression value other than "0" indicates a TRUE status,
W
and "0" indicates a FALSE status.

8-104 Chapter 8 Robot Language


MOVE
8
● CONT setting (Continuous Motion) PTP Linear interpolation Circular interpolation
Format

CONT

Explanation When movement is executed with CONT setting option, Movable axes will begin to execute the next A
command without waiting the completion their movement (entering the tolerance range). If the next
command is a movement command, the 2 movement paths are linked by connecting the deceleration
B
and acceleration sections, enabling continuous movement without intermediate stops.
This option is enabled only for the specified MOVE statement.
C
c CAUTION
• In RCX340/RCX320, the motion of interpolation movement command and END condition are different from
conventional model. Addition of the CONT setting to the movement command allows to the equivalent
movement and END condition in conventional model.
D
• If STOPON condition is simultaneously specified with CONTON and CONT setting, the lower setting will be
invalidated as shown below;
STOPON condition setting > CONTON condition setting > CONT setting
E

F
n NOTE
The CONT setting can be used to reduce the movement END positioning time. The path to the target point is not guaranteed.

G
Caution regarding MOVE L / MOVE C command with CONT setting:
If the next command following the MOVE L / MOVE C command with CONT setting is an executable command
such as a signal output command, that next command will start immediately after axis movement begins. In other H
words, that next command starts before the axis arrives within the target position tolerance range.

Signal output (DO, etc.) Signal is output immediately after movement along the final path begins. I
DELAY command is executed and standby starts immediately after movement along the final path
DELAY
begins.
Program stops and is reset immediately after movement along the final path begins. Therefore, J
HALT
axis movement also stops.
All programs in execution stop immediately after movement along the final path begins, task 1 is
HALTALL
reset, and other tasks terminate. Therefore, the movement also stops. K
Program temporarily stops immediately after movement along the final path begins. Therefore,
HOLD
axis movement also stops.
All programs in execution temporarily stop immediately after movement along the final path L
HOLDALL
begins. Therefore, the movement also stops.

WAIT WAIT command is executed immediately after movement along the final path begins.
M

MOVE command

MOVE L,P1 MOVE L,P1


DO(20)=1 Final target position CONT
DO(20)=1

P1
Tolerance

DO(20) turns ON DO(20) turns ON

33808-R9-00

Robot language list 8-105


MOVE
8
Sample Description
MOVE P,P10,P11,CONT ………
Robot 1 Moves from the current position to the position
specified by P10, and then moves to P11 without waiting for
the moving axes to arrive in the tolerance range.

A
SAMPLE:MOVE P CONT *1: “CONT pulse range”
OUT position range (*1) if the value is specified in the

B With CONT setting: P10


CONT pulse parameter.

P11

C
Next movement begins after
entering the OUT position range

Current position

D OUT position range


Without CONT setting:
Tolerance range
P10
E P11

Next movement begins after


entering the tolerance range

F
Current position
33814-R7-00

G Sample Description
MOVE L,P10,CONT ………
Robot 1 Moves from the current position to the position
H MOVE L,P11 specified by P10, and then moves (linear interpolation
movement) to P11 without waiting for the moving axes to
arrive in the tolerance range, and completes the movement
I within the tolerance range.

J
The interpolation movement with CONT setting doesn't stop at intermediate points in the continuous movement.

K
SAMPLE:MOVE L CONT
L With CONT setting:
Deceleration zones P10

M P11

Next movement begins after


entering the deceleration zones

Without CONT setting:


Tolerance range P10

P11

Next movement begins after


entering the tolerance range

33810-R9-00

8-106 Chapter 8 Robot Language


MOVE
8
● Acceleration setting PTP Linear interpolation Circular interpolation
Format

ACC = expression

Value Range
A
Expression 1 to 100 (units: %)

B
Explanation Specifies the robot acceleration rate in the <expression>. The actual robot acceleration is determined by
the acceleration coefficient parameter setting.
C
Acceleration coefficient Parameter × Acceleration

This option is enabled only for the specified MOVE statement.


D

Sample Description E
MOVE L,P100,ACC=10 ………
Robot 1 moves at an acceleration rate of 10% from the
current position to the position specified by P100.
F

H
● Deceleration setting PTP Linear interpolation Circular interpolation
Format
I
DEC = expression

Value Range J
Expression 1 to 100 (units: %)
K
Explanation Specifies the robot deceleration rate in an <expression>. The actual robot deceleration is determined by
the acceleration coefficient parameter setting (the setting is specified as a percentage of the acceleration L
setting value (100%).

Acceleration coefficient Parameter × Deceleration M

This option is enabled only for the specified MOVE statement.

Sample Description
MOVE L,P100,DEC=20 ………
Robot 1 moves at a deceleration rate of 20% from the
current position to the position specified by P100.

Robot language list 8-107


MOVE
8
● Coordinate plane setting PTP Linear interpolation Circular interpolation
Format
XY
YZ
A ZX

Value Meaning
B XY XY coordinate plane
YZ YZ coordinate plane
ZX ZX coordinate plane
C
Explanation When circular interpolation is executed by setting coordinates, this option executes circular interpolation
so that the projection on the specified coordinate plane becomes a circle.
D This option can be used for circular interpolation movement and is enabled only for the specified MOVE
statement.
E
n NOTE
• If no coordinate plane is specified, the robot moves along a 3-dimensional circle.
• When a 2-axis robot is used, the robot moves along a circle on the XY plane.
F

G Sample Description
P10 = 100.000 100.000 20.000 0.000 0.000 0.000
P11 = 150.000 100.000 0.000 0.000 0.000 0.000
H P12 = 150.000 150.000 20.000 0.000 0.000 0.000
P13 = 100.000 150.000 40.000 0.000 0.000 0.000

I MOVE P,P10 ………


Robot 1 moves from the current position to the position
specified by P10.
MOVE C,P11,P12
J MOVE C,P13,P10 ………
Moves continuously along a 3-dimensional circle generated at
P10, P11, P12, and P12, P13, P10(1)
MOVE C,P11,P12,XY
K MOVE C,P13,P10,XY ………
Moves continuously along a circle on an XY plane generated at
P10, P11, P12, and P12, P13, P10. Z-axis moves to the position
specified by P12 and P10 (the circle's target position)(2)
L
SAMPLE: MOVE C coordinate plane
M Y+
150 (2)

P12
P13

(1)
Z+

140
P10 120
P11
100 →X+
150
33822-R9-00

8-108 Chapter 8 Robot Language


MOVE
8
● Port output setting PTP Linear interpolation Circular interpolation
Format
DO m(b,...,b)= expression 1 @ expression 2
MO
SO A
Format
DO (mb,...,mb)= expression 1 @ expression 2 B
MO
SO C
Notation Value Range
m Port Number 2 to 7, 10 to 17, 20 to 27 D
 to 7 (If omitted, all 8 bits are processed.)
0
b bit Definition(*) If multiple bits are specified, they are expressed from the left in descending order (high
to low).
E
Expression 1 Value which is output to the specified port (only integers are valid).

Expression 2
Position where the port output occurs. This position can be specified in "mm" units F
down to the 3rd decimal position.

G
Explanation During linear interpolation or circular interpolation movement, this command option outputs the value
of <expression 1> to the specified port when the robot reaches the <expression 2> distance (units: "mm")
from the start position. H
The <expression 2> numeric value represents a circle radius (not arc length)centered on the movement
START point.
I
This command option can only be used with linear or circular interpolation movement, and it can be
specified no more than 2 times per MOVE statement. J
If no hardware port exists, nothing is output.

c CAUTION
Output to ports "0" and "1" is not allowed at DO, MO, and SO.
K

Reference *C
 hapter 3 "10 Bit Settings" L
Sample 1 Description
MOVE P,P0
M
MOVE L,P1,DO2()[email protected]
………
During linear interpolation movement of robot 1 to P1, 105 (&B01101001)
is output to DO2() when the robot reaches a distance of 25.85mm from P0.

Sample 2 Description
A!=10
B!=20
MOVE L,P2,MO(22)=1@A!,MO(22)=0@B!
………
After the robot 1 starts toward P2, MO(22) switches ON when robot 1
leaves a distance of 10mm, and switches OFF when robot 1 leaves a
distance of 20mm.

Related commands MOVEI, MOVET, DRIVE, DRIVEI, WAIT ARM

Robot language list 8-109


68 MOVEI
8 Moves robot to the relative position

Format

MOVEI [robot number ](axis number ,... ) PTP ,point of destination , option,
P option...
A
L

B
Explanation Executes relative position movement of robot (axis).
It is not enabled for axes of other robots or for auxiliary axes.
C
Value Range / Type

D Robot Number 1 to 4 (If not input, robot 1 is specified.)

Axis Number 1 to 6 (Multiple axes specifiable. If not input, all axes are specified.)

E PTP, P, L (*) Movement type. PTP/P: PTP, L: Linear interpolation

Robot stopping (target) position.


F Point of Destination (*) Specify the following data format:
• Direct numeric value • Point definition (Point number)

G Option (*)
 elative Speed setting, Absolute speed setting, Linear speed setting
R
STOPON condition setting, CONTON condition setting, CONT setting,
Acceleration setting, Deceleration setting,
H * Reference "MOVE" statement (To use Sample program, replace "MOVE" in Sample to "MOVEI".)

I Options PTP
Linear
interpolation
Remarks

Relative speed setting (SPEED) 3 3 Enabled only in specified MOVEI statement


J
Absolute speed setting (DSPEED) 3 3 Enabled only in specified MOVEI statement

Linear speed setting (VEL) - 3 Enabled only in specified MOVEI statement


K
STOPON condition setting 3 3 Enabled only when program execution

CONTON condition setting Enabled only when program execution


L
3 3

CONT setting 3 3 Enabled only in specified MOVEI statement

M Acceleration setting 3 3 Enabled only in specified MOVEI statement

Deceleration setting - 3 Enabled only in specified MOVEI statement

If the MOVEI statement is interrupted and then re-executed, the movement target position can be selected at the
"MOVEI/DRIVEI start position" setting in the controller parameter. For details, refer to the user's or operator's manual.
1) KEEP (default setting) Continues the previous (before interruption) movement. The original target position
remains unchanged.
2) RESET Relative movement begins anew from the current position. The new target position is
different from the original one (before interruption). (Backward compatibility)

Related commands MOVE, MOVET, DRIVE, DRIVEI, WAIT ARM

8-110 Chapter 8 Robot Language


69 MOVET
Performs relative movement of all robot axes in tool coordinates 8

Format

MOVET [robot number](axis number,...) PTP , p o i n t of destination ,option,


P option...
A
L

B
Explanation Executes relative position movement of the specified axes in the tool coordinates.
It is not enabled for axes of other robots or for auxiliary axes.
C
Value Range / Type
Robot Number 1 to 4 (If not input, robot 1 is specified.) D
Axis Number 1 to 6 (Multiple axes specifiabl. If not input, all axes are specified.)

PTP, P, L (*) Movement type. PTP/P: PTP, L: Linear interpolation E


Robot stopping (target) position.
Point of
Destination (*) Specify the following data format: F
• Direct numeric value (Coordinate value) • Point definition (Point number)

Option (*)
 elative Speed setting, Absolute speed setting, Linear speed setting
R
STOPON condition setting, CONTON condition setting, CONT setting,
G
Acceleration setting, Deceleration setting,

* Reference "MOVE" statement (To use Sample program, replace "MOVE" in Sample to "MOVET".) H

Options PTP
Linear
interpolation
Remarks I
Relative speed setting (SPEED) 3 3 Enabled only in specified MOVET statement

Absolute speed setting (DSPEED) Enabled only in specified MOVET statement


J
3 3

Linear speed setting (VEL) - 3 Enabled only in specified MOVET statement


K
STOPON condition setting 3 3 Enabled only when program execution

CONTON condition setting 3 3 Enabled only when program execution


L
CONT setting 3 3 Enabled only in specified MOVET statement

Acceleration setting 3 3 Enabled only in specified MOVET statement


M
Deceleration setting - 3 Enabled only in specified MOVET statement

Related commands MOVE, MOVEI, DRIVE, DRIVEI, WAIT ARM

Robot language list 8-111


70 MTRDUTY
8 Acquires the motor load factor of the specified axis

Format

MTRDUTY [robot number](axis number)

A Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.)
B Axis Number 1 to 6

C Explanation Acquires the motor load factor (1 to 100 [%]) of the specified axis.

The motor load factor increases when the current value of the specified axis exceeds the rated current
D value. When the factor reaches 100%, "17.800 Motor overload" error occurs.

E
Sample Description

F A=MTRDUTY(1) ………
The motor load factor of axis 1 of robot 1 is assigned to
variable A.

8-112 Chapter 8 Robot Language


71 OFFLINE
Sets a specified communication port to the "offline" mode 8

Format
OFFLINE ETH
CMU
N

Explanation Changes the communication mode parameter in order to switch the communication mode to OFFLINE.
O
Changes the Ethernet communication mode parameter to OFFLINE ,
ETH
clears the transmission and reception buffers.
P
Changes the RS-232C communication mode parameter to OFFLINE,
CMU
resets the communication error, and clears the transmission and reception buffers.
Changes the Ethernet and RS-232C communication mode parameter to OFFLINE, Q
No setting resets the communication error (RS-232C only), and clears the transmission and
reception buffers.
R

S
Online command is invalid in OFFLINE (mode).

T
Sample
OFFLINE
SEND CMU TO A$ U
SEND CMU TO P10
ONLINE
HALT V

Reference For details of SEND statements, refer to "112 SEND" in this Chapter. W

Related commands ONLINE X

Robot language list 8-113


72 ON ERROR GOTO
8 Jumps to a specified label when an error occurs

Format
1. ON ERROR GOTO label
2. ON ERROR GOTO 0
N

Explanation Even if an error occurs during execution of the robot language, this statement allows the program to
O
jump to the error processing routine specified by the <label>, allowing the program to continue without
being stopped (this is not possible for some serious errors.)
P
• If "0" is specified instead of the <label>, the program stops when an error occurs, and an error message
displays.
Q • If ON ERROR GOTO "0" is executed at any place other than an error processing routine, the ON
ERROR GOTO command is canceled (interruption canceled).
R • The error processing routine can process an error using the RESUME statement and the error output
information (ERR, ERL).

S Error Output Information


ERR Error code number
ERL Line number where error occurred

T
• If a serious error such as "17.800: Motor overload" occurs, the program execution stops.
U • The most recently executed "ON ERROR GOTO <label>" statement is valid.
• If an error occurs during an error processing routine, the program will stop.
V • "ON ERROR GOTO <label>" statements cannot be used within error processing routines.

W Sample Description
ON ERROR GOTO *ER1

X
FOR A = 0 TO 9
P[A+10] = P[A]
NEXT A

Y
*L99: HALT
’ERROR ROUTINE
*ER1:

Z
IF ERR = &H000600CC THEN *NEXT1
………
Checks to see if a "Point doesn't exist" error has occurred.
IF ERR = &H000600CE THEN *NEXT2
………
Checks to see if a "Subscript out of range" error has occurred.
ON ERROR GOTO 0 ………
Displays the error message and stops the program.

*NEXT1: ………
Jumps to the next line after the error line and resumes
RESUME NEXT program execution.

*NEXT2: ………
Jumps to label *L99 and resumes program execution.
RESUME *L99

Related commands RESUME

8-114 Chapter 8 Robot Language


73 ON to GOSUB
Executes the subroutine specified by the <expression> value 8
* GOSUB can also be expressed as "GO SUB".
Format

ON expression GOSUB label 1, label 2...


N
Value Meaning
Expression Expression whose result is 0 or positive integer
O

Explanation The <expression> value determines the program's jump destination. P


An <expression> value of "1" specifies a jump to <label 1>, "2" specifies a jump to <label 2>, etc.
Likewise, (<expression> value "n" specifies a jump to <label n>.)
Q

If the <expression> value is "0" or if the <expression> value exceeds the number of existing labels, no R
jump occurs, and the next command is executed.
After executing a jump destination subroutine, the next command after the ON to GOSUB statement is
executed. S

T
Sample Description
’MAIN ROUTINE
*ST: U
ON DI3() GOSUB *SUB1,*SUB2,*SUB3

GOTO *ST
………
*SUB1 to *SUB3 are executed.
………
Checks to see if a "Point doesn't exist" error has occurred.
V

HALT
’SUB ROUTINE
W
*SUB1:
MOVE P,P10,Z=0
RETURN
X
*SUB2:
DO(30) = 1
RETURN
Y
*SUB3:
DO(30) = 0
RETURN
Z

Related commands GOSUB, RETURN

Robot language list 8-115


74 ON to GOTO
8 Jumps to the label specified by the <expression> value

* GOTO can also be expressed as "GO TO".


Format

ON expression GOTO label 1, label 2...


N
Value Meaning
Expression Expression whose result is 0 or positive integer
O

P Explanation The <expression> value determines the program's jump destination.

An <expression> value of "1" specifies a jump to <label 1>, "2" specifies a jump to <label 2>, etc.
Q Likewise, (<expression> value "n" specifies a jump to <label n>.)

R If the <expression> value is "0" or if the <expression> value exceeds the number of existing labels,
no jump occurs, and the next command is executed.

S
Sample Description
T ’MAIN ROUTINE
*ST:
ON DI3() GOTO *L1,*L2,*L3
U ………
Jumps to *L1 to *L3 in accordance with the DI3() value.
………
Returns to *ST
GOTO *ST
V HALT
’SUB ROUTINE
*L1:
W MOVE P,P10,Z=0
GOTO *ST
*L2:
X DO(30) = 1
GOTO *ST
*L3:
Y DO(30) = 0
GOTO *ST

Z
Related commands GOTO

8-116 Chapter 8 Robot Language


75 ONLINE
Sets the specified communication port to the "online" mode 8

Format
ONLINE ETH
CMU
N

Explanation Changes the communication mode parameter in order to switch the communication mode to ONLINE.
O
Changes the Ethernet communication mode parameter to ONLINE ,
ETH
clears the transmission and reception buffers.
Changes the RS-232C communication mode parameter to ONLINE, P
CMU
resets the communication error, and clears the transmission and reception buffers.

No setting
Changes the Ethernet and RS-232C communication mode parameter to ONLINE,
resets the communication error (RS-232C only), and clears the transmission and
Q
reception buffers.

S
Online command is valid in ONLINE (mode).

T
Sample
OFFLINE
SEND CMU TO A$ U
SEND CMU TO P10
ONLINE
HALT V

Reference For details of SEND statements, refer to "112 SEND" in this Chapter. W

Related commands OFFLINE X

Robot language list 8-117


76 OPEN
8 Opens the specified General Ethernet Port

Format

OPEN GPm

N Notation Value Range


m General Ethernet Port Number 2 to 7, 10 to 17, 20 to 27, 30 to 37
O
Explanation Opens the communication port of the specified General Ethernet Port.
P

Sample Description
Q
OPEN GP1 ………
Opens the General Ethernet Port 1.
SEND "123" TO GP1 ………
Sends the character strings "123" from the General Ethernet Port 1.
R SEND GP1 TO A$ ………
Receives the data from the General Ethernet Port 1
and saves the received data in the variable A$.
CLOSE GP1 ………
Closes the General Ethernet Port 1.
S

T Related commands CLOSE, SEND, SETGEP, GEPSTS

8-118 Chapter 8 Robot Language


77 ORD
Acquires a character code 8

Format

ORD (character string expression)

Explanation Acquires the character code of the first character in a <character string expression>.
O

Sample Description P
A=ORD("B") ………
66 (=&H42) is assigned to A.

Q
Related commands CHR$

Robot language list 8-119


78 ORGORD
8 Specifies/acquires the robot's return-to-origin sequence

Format

ORGORD [robot number] expression

N
Value Range

O Robot Number 1 to 4 (If not input, robot 1 is specified.)


Expression n to nnnnnn (n : 0 to 6)

P
Explanation Sets the axis sequence parameter for return-to-origin and absolute search operation of the robot specified
by the <robot number>.
Q
The 1 to 6 axes are expressed as "1 to 6" values, respectively, and the <expression> value must be 1-digit
R to 6-digit integer.
The same axis cannot be specified twice.
After the specified axes are returned to their origin points in sequence, from left to right, the remaining
S axes return to their origin points simultaneously.
If the <expression> value is "0", all axes will be returned to their origin points simultaneously.

U Functions

Format
V
ORGORD [robot number]

W
Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.)
X

Y Explanation Acquires the axis sequence parameter for return-to-origin and absolute search operation of the robot
specified by the <robot number>.

Z Sample Description
A=3
ORGORD A ………
Return-to-origin is executed first for axis 3 of robot 1.
ORIGIN ………
After the return-to-origin of axis 3 of robot 1 is completed,
return-to-origin is executed for the remaining axes.
MOVE P,P0
A=ORGORD ………
Return-to-origin sequence parameter of robot 1 is assigned to variable A.

HALT

Related commands ORIGIN

8-120 Chapter 8 Robot Language


79 ORIGIN
Performs return-to-origin 8

Format

ORIGIN robot number, motor type

N
Value Range / Meaning

Robot Number
0: all robots O
1 to 4: specified robot only

0: all types P
1: incremental motor only
Motor Type 2: absolute motor only
9: incomplete return-to-origin axis only Q
(If omitted, 0 (all types) is specified.)

R
Explanation This statement performs return-to-origin of a robot, or absolute search for a semi-absolute axis.
S
If the movement is stopped at an intermediate point, "incomplete return-to-origin" status will occur.
If <robot number> is omitted or "0" is specified during multiple robots setting, the return-to-origin and
T
absolute search are first performed for the robot 1 and then for the robots 2 to 4.

U
Sample Description
ORIGIN 0, 1 ………
Performs return-to-origin for incremental motor axes only of all V
robots.

Related commands ORGORD, MCHREF W

Robot language list 8-121


80 OUT
8 Turns ON the specified port output

Format
OUT DOm(b, ..., b) , expression
DO(mb, ..., mb)
N MOm(b, ..., b)
MO(mb, ..., mb)
O SOm(b, ..., b)
SO(mb, ..., mb)
P LO0(b, ..., b)
LO(0b, ..., 0b)
Q TO0(b, ..., b)
TO(0b, ..., 0b)
R
Notation Value Range / Comtent

S m Port Number
2 to 7, 10 to 17, 20 to 27
If no hardware port exists, nothing is output.

0 to 7 (If omitted, all 8 bits are processed.)


T b Bit definition(*) If multiple bits are specified, they are expressed from the left in descending order
(high to low).

U Expression
time
0 to 3600000 (units: ms)

V Explanation This statement turns ON the specified port output and terminates the command. (The program proceeds
to the next line.) Output to that port is then turned OFF after the time specified by the <expression> has
W elapsed. If the operation is stopped temporarily at an intermediate point and then restarted, that port's
output is turned OFF when the remaining <expression> specified time has elapsed.

X If this <expression> is omitted, the specified port's output remains ON.


Up to 16 OUT statements using <expressions> can be executed at the same time. Attempting to execute
Y 17 or more OUT statements will activate error "6.225: No sufficient memory for OUT".

Reference * Chapter 3 "10 Bit Settings"


Z

c CAUTION
Output to ports "0" and "1" are not allowed at DO, and SO.

Sample Description
OUT DO2(),200 ………
Turns DO(27 to 20) ON, then turns them OFF 200 ms later.
………
Turns DO(37, 35, 27, 20) ON.
OUT DO(37,35,27,20)

Related commands DO, MO, SO, TO, LO

8-122 Chapter 8 Robot Language


81 OUTPOS
Specifies/acquires the OUT enable position parameter of the robot 8

Format
1. OUTPOS [robot number] expression
2. OUTPOS [robot number] (axis number) = expression
N
Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.) O
Axist Number 1 to 6 (If not input, all axes are specified.)
Expression 1 to 9999999 (Unit: pulse
P
Explanation Changes the "OUT position" parameter of the specified axis to the value of <expression>.
Q
Format 1: The change is applied to all axes of the specified robot.
Format 2: The change is applied only to the axis specified by <axis number>. R
Reference "MOVE" Axis parameter; "OUT position <OUTPOS>"
S

T
Functions
U
Format

OUTPOS [robot number] (axis number) V

Value Range
W
Robot Number 1 to 4 (If not input, robot 1 is specified.)
Axist Number 1 to 6 (If not input, all axes are specified.)
X
Explanation Acquires the "OUT position" parameter's value for the specified axis.
Y
Sample 1 Description
OUTPOS 2000 ……
Changes the OUTPOS parameter for all axes of Robot 1
Z
to 2000

Sample 2 Description
OUTPOS (3) = 2000 ……
Changes the OUTPOS parameter for 3rd axis of Robot 1
to 2000

Sample 3 Description
A% = OUTPOS(3) ……
Acquires the value of the OUTPOS parameter for 3rd
axis of robot 1, assigns it to integer variable A%

Robot language list 8-123


OUTPOS
8
Sample
’CYCLE WITH DECREASING OUTPOS
DIM SAV(3)
GOSUB *SAVE _ OUTPOS
FOR A=1000 TO 10000 STEP 1000
N GOSUB *CHANGE _ OUTPOS
MOVE P,P0
DO3(0)=1
O MOVE P,P1
DO3(0)=0
NEXT A
P GOSUB *RESTORE _ OUTPOS
HALT
*CHANGE _ OUTPOS:
Q FOR B=1 TO 4
OUTPOS(B)=A
NEXT B
R RETURN
*SAVE _ OUTPOS:
FOR B=1 TO 4
S SAV(B-1)=OUTPOS(B)
NEXT B
RETURN
T *RESTORE _ OUTPOS:
FOR B=1 TO 4
OUTPOS(B)=SAV(B-1)
U NEXT B
RETURN

8-124 Chapter 8 Robot Language


82 PATH
Specifies the motion path 8

Format
PATH [robot number](axis number,...) L point of destination , option,
C option...
N
Value Range / Type
Robot Number 1 to 4 (If not input, robot 1 is specified.) O
Axis Number 1 to 6 (Multiple axes specifiabl. If not input, all axes are specified.)

Movement type.
P
L, C
L: Linear interpolation, C: Circular interpolation

Robot stopping (target) position. Q


Point of
Destination Specify the following data format:
• Direct numeric value (Coordinate value) • Point definition (Point number)
R
Option Speed setting, coordinate plane setting (for circular interpolation only), port output setting

S
Explanation Sets the motion path for the specified axis.
This command can only be executed between the PATH SET and PATH END commands.
T
If execution is attempted elsewhere, an error will occur.

c CAUTION
• Be careful not to set the same position in the coordinates as the start point and the following path points. U
If the position of each point is duplicated, an error might occur.
• When "R" axis only is specified in the coordinate attribute parameter, an error will occur.
• Only the X, Y and Z coordinate values among the specified points are valid for PATH motion. V
Any other coordinates use the coordinate values at the START point of the PATH motion; R-axis can not be
moved to the specified point even if it is used.
W

X
When PATH command is executed on SCARA robots or Cartesian robots with rotation axes,
the R-axis holds the coordinates (angles) at execution start.
Y

Path motion types Z

● Linear interpolation movement


"PATH L…" is set for linear interpolation movement.

● Circular interpolation movement


"PATH C…" is set for circular interpolation movement.

Only the X, Y and Z coordinate values of the specified points are valid for PATH motion. Any other coordinates
use the coordinate values of the PATH motion START point.
The motion path can be connected by repeated PATH commands ("PATH L", "PATH C") to allow movement
without stopping.

Robot language list 8-125


PATH
8
Point data setting types

● Direct numeric value input Linear interpolation Circular interpolation


Format
N
p1 p2 p3 p4 p5 p6 f f1 f2

O Notation Value
p1 to p6 Space-separated coordinate values for each axis

P f Hand system flag (SCARA robot only)


f1 First arm rotation information (YK-TW series only)
f2 Second arm rotation information (YK-TW series only)
Q
Explanation Directly specifies coordinate data by a numeric value. Units for the coordinate is as follows;

R • Integer: "pulse" units


• Real number (with decimal point): "mm/deg." units
• Integers and real numbers (mixed): All coordinate values will be handled in "mm/deg." units.
S With this format, only 1 point can be specified as the movement destination coordinates.
The only type of movement specified by this point data setting is linear interpolation.
The hand system / first and second arm rotation information must be the same throughout the

T movement. They cannot be changed at any point along the path.
Notation: f ) SCARA robots with coordinate data in "mm" units --> Hand system flags can be specified. (*1)
U To set the hand system flag, set either 1 or 2 at "f". If a number other than 1 or 2 is set, or if no number is
designated, 0 will be set to indicate that there is no hand system flag.

V 0
Hand system flag is not set.
Any value other than 1 / 2, or no setting.
f
1 Right-handed system is used to move to a specified position.
W 2 Left-handed system is used to move to a specified position.

X c CAUTION
The hand system used during PATH motion must be the same as the hand system used at the path motion
route's start point. The same applies if the path is to pass through points where hand system flags are set.
Differing hand systems will cause an error and disable motion.
Y
Notation: f1,2)YK-TW series with coordinate data in "mm" units -->
Z The first and second arm rotation information can be specified. (*1)
To set the rotation information, set "-1", "0", or "1" at f1 and f2.
Any other value or no setting will be processed as "0".
Indicates arm rotation information where movement to the "0" position has been specified.
0
Any value other than -1 / 0 / 1, or no setting.
f1, 2
1 Indicates arm rotation information where movement to the "1" position has been specified.
-1 Indicates arm rotation information where movement to the "-1" position has been specified.

c CAUTION
The first arm and second arm rotation information during PATH movement must be the same as the first arm and
second arm rotation information at the PATH movement's START point. If the two are different, an error will occur
and movement will be disabled..

Reference *1: Chapter 4 "3. Point data format"

8-126 Chapter 8 Robot Language


PATH
8

 t SCARA robots with a hand system flag set in the movement destination's coordinate data, the specified hand
A
system will have priority over the current arm type or LEFTY/RIGHTY setting.

Sample Description N
PATH L,10000 10000 1000 1000 0 0
………
Sets the linear interpolation movement path of robot 1 in "pulse" O
units.
IPATH L,150.000 250.000 10.000 30.000 0.000 0.000 1
………
The linear interpolation movement path of robot 1 is set in the P
coordinate values specified by the right-handed system in "mm"
units.
Q

● Point definition Linear interpolation Circular interpolation S


Format

point definition , point definition... T

Explanation Specifies the movement destination as <point expression> value. Two or more data items can be U
designated by separating them with a comma ( , ).
For circular interpolation movement, 2 points must be specified for each arc.
V

 t SCARA robots with a hand system flag set in the movement destination's coordinate data, the specified hand
A W
system will have priority over the current arm type or LEFTY/RIGHTY setting.

X
c CAUTION
• The hand system used during PATH motion must be the same as the hand system used at the path motion
route's start point. The same applies if the path is to pass through points where hand system flags are set. Y
Differing hand systems will cause an error and disable motion.
• The first arm and second arm rotation information during PATH movement must be the same as the first arm
and second arm rotation information at the PATH movement's START point. If the two are different, an error will Z
occur and movement will be disabled.

Sample Description
PATH L,P1,P2,P3
………
Specifies sequential linear interpolation movement of robot 1 from
its current position to the positions specified by P1, P2 and P3
from its current position.
PATH C P5,P6,P7,P8
………
Specifies circular interpolation movement of robot 1 through the
following points: current position, P5, P6, and P6, P7, P8.

Robot language list 8-127


PATH
8
Option types

● Speed setting 1 Linear interpolation Circular interpolation


● Speed setting 2 Linear interpolation Circular interpolation
N
Reference "MOVE" statement (To use Sample program, replace "MOVE" in Sample to "PATH".)

O
● Coordinate plane setting Linear interpolation Circular interpolation
P Format
XY
Q YZ
ZX
R
Reference "MOVE" statement (To use Sample program, replace "MOVE" in Sample to "PATH".)

S
● Port output setting Linear interpolation Circular interpolation
T Format 1
DO m(b, ..., b)= expression 1 @ expression 2

U MO
SO

V Format 2
DO (mb, ... ,mb)= expression 1 @ expression 2
W MO
SO
X Reference "MOVE" statement

Y Sample Description
PATH SET
PATH L,P1,DO(20)=1@10
Z ………
Specifies to output "1" to DO(20) at a 10mm radius position from the
START position during linear interpolation movement of robot 1 from
its current position to P1.
PATH L,P2,DO(21)[email protected]
………
Specifies to output "1" to DO(21) at a 12.5mm radius position from P1
during linear interpolation movement of robot 1 from its current
position to P2.
PATH END
PATH START

Related commands PATH SET, PATH END, PATH START

8-128 Chapter 8 Robot Language


83 PATH END
Ends the path setting 8

Format
PATH [robot number] END

N
Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.)
O
Explanation Ends the path setting of specified robot's PATH motion.
The PATH END command must always be paired with a PATH SET command. The PATH motion path P
end-point is the final point specified by the final PATH command (PATH L, PATH C) which exists
between the PATH SET and PATH END commands.
Attempting to execute a PATH END command when no PATH SET command has been executed will
Q
result in an error.
R
Sample Description
PATH END ………
Ends the path setting of robot 1's PATH motion S

Related commands PATH, PATH SET, PATH START


T
Reference Chapter 9 "PATH Statements"
U

Robot language list 8-129


84 PATH SET
8 Starts the path setting

Format

PATH [point definition] SET point definition

N Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.)

O
Explanation Starts the path setting of specified robot's PATH motion.
Specifies the <point definition> position as the PATH motion start-point. (This only sets the PATH
P motion start point and does not actually begin robot motion.) If the <point definition> value is omitted,
the current robot position is set as the start point.
However, if robot movement is in progress, the target position of that movement becomes the start point.
Q (Example: The OUT position range is wider for the MOVE command which precedes the PATH SET
command, so the robot is still moving when the PATH SET command is executed, etc.)
R The PATH SET command must always be paired with a PATH END.

S
c CAUTION
Be careful not to set the same position in the coordinates as the start point and the following path points.
If the position of each point is duplicated, an error might occur.

T n NOTE
The PATH SET statement is available in software version 1.11 onwards.

U
Point data setting types

● Point definition
V
Format

point expression
W
Explanation The PATH motion's start-point is specified by the <point expression>.
X

Y  t SCARA robots with a hand system flag set in the movement destination's coordinate data, the specified hand
A
system will have priority over the current arm type or LEFTY/RIGHTY setting.

Z
c CAUTION
• The hand system used during PATH motion must be the same as the hand system used at the path motion
route's start point.Differing hand systems will cause an error and disable motion.
• The first arm and second arm rotation information during PATH movement must be the same as the first arm and
second arm rotation information at the PATH movement's START point. If the two are different, an error will occur
and movement will be disabled.

Sample Description
PATH SET P10 ……… The start-point of the PATH motion is set to P10.
PATH SET WHERE ………
The start-point of the PATH motion becomes the current position.

Reference Chapter 9 "PATH Statements"

8-130 Chapter 8 Robot Language


PATH SET
8
● Direct numeric value input
Format

p1 p2 p3 p4 p5 p6 f f1 f2

Notation Value
N
p1 to p6 Space-separated coordinate values for each axis
f Hand system flag (SCARA robot only)
f1 First arm rotation information (YK-TW series only) O
f2 Second arm rotation information (YK-TW series only)
P
Explanation Directly specifies coordinate data by a numeric value. Units for the coordinate is as follows;
• Integer: "pulse" units
• Real number (with decimal point): "mm/deg." units
Q
• Integers and real numbers (mixed): All coordinate values will be handled in "mm/deg." units.
R
Notation: f ) SCARA robots with coordinate data in "mm" units --> Hand system flags can be specified. (*1)
To set the hand system flag, set either 1 or 2 at "f".
If a number other than 1 or 2 is set, or if no number is designated, 0 will be set to indicate that there is S
no hand system flag.

0
Hand system flag is not set. T
Any value other than 1 / 2, or no setting.
f
1 Indicates that a right-handed system is specified for the PATH motion's start-point
2 Indicates that a left-handed system is specified for the PATH motion's start-point.
U

c CAUTION
The hand system used during PATH motion must be the same hand system as that at the PATH motion's start- V
point. An error will occur if the hand systems are different.

W
Notation: f1,2)YK-TW series with coordinate data in "mm" units -->
The first and second arm rotation information can be specified. (*1)
To set the rotation information, set "-1", "0", or "1" at f1 and f2.
X
Any other value or no setting will be processed as "0".

0
Indicates arm rotation information where movement to the "0" position has been specified. Y
Any value other than -1 / 0 / 1, or no setting.
f1, 2
1 Indicates arm rotation information where movement to the "1" position has been specified.
-1 Indicates arm rotation information where movement to the "-1" position has been specified.
Z

c CAUTION
The first arm and second arm rotation information during PATH movement must be the same as the first arm and
second arm rotation information at the PATH movement's START point. If the two are different, an error will occur
and movement will be disabled.

Reference *1: Chapter 4 "3. Point data format"

 t SCARA robots with a hand system flag set in the movement destination's coordinate data, the specified hand
A
system will have priority over the current arm type or LEFTY/RIGHTY setting.

Robot language list 8-131


PATH SET
8
Sample Description
PATH SET 120 250.000 55.2 20.33 0 0
………
The PATH motion's start-point of robot 1 is specified in "mm" units
as follows: 120.000 250.000 55.200 20.330 0.000 0.000.
PATH SET -51200 80521 7045 204410 0 0
N ………
The PATH motion's start-point of robot 1 is specified in "pulse"
units.

O
Related commands PATH, PATH END, PATH START
P

8-132 Chapter 8 Robot Language


85 PATH START
Starts the PATH motion 8

Format

PATH [robot number] START, option, option...

Value Range N
Robot Number 1 to 4 (If not input, robot 1 is specified.)
Option STOPON condition setting, CONTON condition setting, CONT setting
O
Options PTP Remarks

STOPON condition setting 3 Enabled only while program execution P


CONTON condition setting 3 Enabled only while program execution

CONT setting 3 Enabled only in specified PATH START statement Q

Explanation Starts PATH motion of specified robot. R


Before PATH START can be executed, the PATH motion path must be specified by the PATH SET
command, PATH commands (PATH L, PATH C) and the PATH END command. The robot must also be
positioned at the motion path's start-point which was specified by the PATH SET command. S
The robot's PATH motion speed is the automatic movement speed (%) which was in effect when the
PATH START was executed, multiplied by the program movement speed (%) specified by the SPEED T
command or the (SPEED or S) option of the PATH command. A speed specified by the "VEL" option of
the PATH command does not rely on the automatic movement speed.
U
After PATH motion begins, the PATH START command is terminated when the robot reaches the PATH
motion end-point, or when movement is stopped by a stop input, etc. V

Robot language list 8-133


PATH START
8
Option types

● STOPON condition setting


Format
N
STOPON conditional expression

O Sample Description
PATH START,STOPON DI(20)=1

P ………
Robot 1 starts PATH movement, if the "DI (20) = 1" condition is met
during movement, a deceleration and stop occurs, and the next step is
then executed.
Q Reference "MOVE" statement

R ● CONTON condition setting (Continuous motion)


Format

S CONTON conditional expression

Sample Description
T PATH START,CONTON DI(20)=1
………
Robot 1 starts PATH movement, if the "DI (20) = 1" conditions are met

U during movement, robot starts decelerating and executes the next step.

Reference "MOVE" statement

V
● CONT setting (Continuous motion)
Format
W CONT

Sample Description
X PATH START,CONT
MOVE P,P10 ………
PATH motion starts, and movement to P10 begins after the moving
Y axes enter the deceleration zone of final PATH motion.

Reference • "MOVE" statement


Z • Chapter 9 "PATH Statements"

Related commands PATH, PATH SET, PATH END

8-134 Chapter 8 Robot Language


86 PDEF
Defines the pallet 8

Format
PDEF(Pallet definition number) = expression 1, expression 2
, expression 3, point definition
N
Value Range / Meaning
Pallet Definition Number 0 to 39 O
Expression 1 Number of elements (NX) between P[1] and P[2] Total number of elements:
<expression 1> × <expression 2> × P
Expression 2 Number of elements (NY) between P[1] and P[3]
<expression 3> must be 32,767 or
Expression 3 Number of elements (NZ) between P[1] and P[5] less.
Q
The point used for a pallet definition.
Point definition
Continuous 5 points starting with the specified point are used.
R
Explanation Defines the pallets to permit execution of the pallet movement command: changes the contents of
definition for previously defined pallet data. S

After specifying the number of points per axis, the equally-spaced points for each axis are automatically
T
calculated and defined in the sequence shown in the figure below.

• If <expression 3> (Z-axis direction) is omitted, the value becomes "1". U


• The total number of elements defined for a single pallet must not exceed 32,767.

Automatic point calculation


W
22 23 24
NY
19 20 21 X
P[5] 16 17 18
13 14 15
P[3] P[4] Y
NZ 10 11 12
NY 8
7 9
4 5 6 Z
1 2 3
P[1] P[2]
NX
33815-R7-00

Sample Description
PDEF(1)=3,4,2,P3991
………
Pallet definition 1 is defined as 3 x 4 x 2 by using P3991 to P3995.

Related commands PMOVE

Robot language list 8-135


87 PGMTSK
8 Acquires the task number in which a specified program is registered

Format

PGMTSK (program number)

N Value Range
Program Number 1 to 100

O
Explanation Acquires the task number in which the program specified by <program number> is registered.
P

Q
If the program number which is not registered in the task is specified, "3.203: Program doesn't exist" error occurs.

R
Sample Description

S A = PGMTSK(1) ………
Assigns the task number in which the program number 1's
program is registered to variable A.

T Related commands PGN, TSKPGM

8-136 Chapter 8 Robot Language


88 PGN
Acquires the program number from a specified program name 8

Format

PGN ("program name")

Value Range N
Program Name 32 characters or less consisting of alphanumeric characters and underscore ( _ )

O
Explanation Acquires the program number of the program specified by <program name>.
The program name must be enclosed in double quotation marks ( " ). P

Sample Description
Q
A = PGN("PG _ SUB") ………
The program number of PG _ SUB is assigned to variable A.
R
Related commands PGMTSK, TSKPGM

Robot language list 8-137


89 PMOVE
8 Executes a pallet movement command for the robot

Format

PMOVE [robot number] (pallet definition number, pallet position number),


option, option...
N
Value Range / Type

O Robot Number 1 to 4 (If not input, robot 1 is specified.)


Pallet Definition Number 0 to 39
Pallet Position Number 1 to 32767
P Relative speed setting, arch motion setting,
Options
STOPON condition setting, CONTON condition setting, CONT setting

Q Options PTP Remarks


Relative speed setting (SPEED) 3 Enabled only in specified PMOVE statement
Arch motion 3 Enabled only in specified PMOVE statement
R STOPON condition setting 3 Enabled only when program execution
CONTON condition setting 3 Enabled only when program execution
S CONT setting 3 Enabled only in specified PMOVE statement

Explanation Executes "pallet move" command of the specified axes. (The specified pallet numbers must be registered

T in advance.)
It is not enabled for axes of other robots or for auxiliary axes.

U • Movement type: PTP Reference "MOVE" statement


• Pallet definition number: Numeric expression
• Pallet position number: Numeric expression
V
The position numbers for each pallet definition are shown below.
W Position numbers for each pallet definition

X NX*NY*NZ

NY

Y NX*NY*(NZ-1)+1
NX*NY*(NZ-1)+1 NX*NY*(NZ-1)+NZ
NX*NY*(NZ-1)+NZ

P[5]
P[3] P[4]
Z NZ NX*(NY-1)+1 NX*NY

NX+1 NX*2
P[2]
1 2 ... NX
P[1]
NX

 cquires the XYZ axes move to the position determined by calculated values, the R attribute axis moves to the
A
position specified by pallet point data P [1].

Sample Description
PMOVE(1,16) ………
Robot 1 moves from its current position to the position
specified by pallet position number 16 of pallet definition
number 1.

8-138 Chapter 8 Robot Language


PMOVE
8
Movement type

● PTP (point-to-point) movement


PTP movement begins after positioning of all movement axes is complete (within the tolerance range*1),
and the command terminates when the movement axes enter the OUT position range*2.
Although the movement axes reach their target positions simultaneously, their paths are not guaranteed. N

*1) Axis parameter "Tolerance <TOLE>"


O
This parameter sets the positioning completion range to the target position when the robot moves.
When the current position of the robot enters the specified range, this is judged to the positioning completion.
P
*2) Caution regarding commands which follow the MOVE P command; Axis parameter "OUT position <OUTPOS>"
This parameter sets the execution completion range to the target position when a movement command is executed.
Q
If the next command following the PMOVE command is an executable command such as a signal output
command, that next command will start when the movement axis enters the OUT position range. In other words, R
that next command starts before the axis arrives within the target position OUT position range.

Signal output (DO, etc.) Signal is output when the axis enters within OUT position range. S
DELAY DELAY command is executed and standby starts, when the axis enters the OUT position range.

HALT
Program stops and is reset when the axis enters the OUT position range. Therefore, the axis T
movement also stops.
All programs in execution stop when axis enters the OUT position range, task 1 is reset, and other
HALTALL
tasks terminate. Therefore, the movement also stops. U
Program temporarily stops when the axis enters the OUT position range. Therefore, the axis
HOLD
movement also stops.

HOLDALL
All programs in execution temporarily stop when the axis enters the OUT position range. V
Therefore, the movement also stops.

WAIT WAIT command is executed when the axis enters the OUT position range.
W
The WAIT ARM statement is used to execute the next command after the axis enters the tolerance range.

X
PMOVE(0,1) PMOVE(0,1)
Target position
DO(20)=1 WAIT ARM
DO(20)=1 Y
P1
Z
Tolerance
OUT position
DO(20) turns ON DO(20) turns ON

PMOVE(0,1) PMOVE(0,1)
Target position
HOLD WAIT ARM
HOLD

Tolerance
OUT position
HOLD execution HOLD execution
(program temporarily stops) (program temporarily stops)

Robot language list 8-139


PMOVE
8
Option types

● Relative speed setting


Format
1. SPEED = expression
N
2. S = expression

O Value Range
Expression 1 to 100 (units: %)

P
Explanation Specifies the program speed in an <expression>.
Robot max. speed (mm/sec or deg/sec) × automatic movement speed (%) × program movement speed S (%)
Q
"S" setting superimposes the speed on the current automatic movement speed.
R automatic movement speed (%) × program movement speed S (%) = actual speed (%)
100% 50% 50%
50% 50% 25%
S
n NOTE
This option specifies only the maximum speed and does not guarantee the movement at the specified speed.

T • Automatic movement speed: Specified by programming box operation or by the ASPEED command.
• Program movement speed: Specified by SPEED commands or MOVE, DRIVE speed settings.

U Sample
Description
(Automatic movement speed: 80%)
PMOVE(1,3),S=50 ………
Robot 1 moves from its current position to the
V position specified by pallet position number 3 of
pallet definition number 1
at 50% (Actual speed is 40%) of the program speed.
W

8-140 Chapter 8 Robot Language


PMOVE
8
● Arch motion setting
Format

x = expression, x = expression...

Value Range
N
X Specifies the Z,R,A,B axis.
An integer value is processed in "pulse" units.
Expression
A real number (with decimal point) is process in "mm/deg." units. O

Explanation 1. The "x" specified axis begins moving toward the position specified by the <expression> ("1" shown in P
the figure below).
2. When the axis specified by "x" moves the arch distance 1 or more, other axes move to their target
positions ("2" shown in the figure below).
Q
3. The axis specified by "x" moves to the target position so that the remaining movement distance becomes
the arch distance 2 when the movement of other axes is completed ("3" shown in the figure below). R
4. The command ends when all axis enter the OUT position range.

S
The Value specified in <expression> is based on the robot coordinates. Settings such as hand definition and work
definition are not considered.
T

Sample Description
U
PMOVE(1,A),Z=0 ………
First the Z-axis of robot 1 moves from the current position to
the "0 pulse" position. Then the other axes of robot 1 move to the
position specified by pallet position number A of pallet definition V
number 1. Finally the Z-axis of robot 1 moves to the position
specified by pallet position number A.
W
2. Other axes movement
Z=0 X
Arch distance 1
Arch distance 2
1. Z-axis movement 3. Z-axis movement
Y
Current position Target position
Z

Robot language list 8-141


PMOVE
8
● STOPON condition setting
Format

STOPON conditional expression

N Sample Description
PMOVE(A,16),STOPON DI(20)=1 ………
Robot 1 moves to the position specified by pallet
position number 16 of pallet definition number A,
O then decelerates and stops when DI(20) turns ON (the
condition "DI(20) = 1" is met).
PMOVE(A,17) ………PTP movement to 17; Execution of the next step
P
Reference "MOVE" statement

R
● CONT setting (Continuous Motion)
Format
S
CONTON conditional expression

T Sample Description
PMOVE(A,16),CONTON DI(20)=1 ………
While robot 1 moves to the position specified by pallet
U position number 16 / pallet definition number A,
if DI(20) turns ON (the condition "DI(20) = 1" is met),
the robot starts decelerating and executes the next step.
V Reference "MOVE" statement

X
Related commands PDEF

8-142 Chapter 8 Robot Language


90 Pn
Defines points within a program 8

Format

LET Pn = p1 p2 p3 p4 p5 p6 f f1 f2

N
Notation Value Range
n Point number 0 to 29999 O
p1 to p6 Point data According to the format
f Hand system flag 1 or 2 (for SCARA robots only)
f1 First arm rotation information -1, 0, 1 (YK-TW series only) P
f2 Second arm rotation information -1, 0, 1 (YK-TW series only).
Q
Explanation Defines the point data.
R
1: "n" indicates the point number.
2: Input data for "p1" to "p6" must be separated with a space (blank).
3.: If all input data for "p1" to "p6" are integers (no decimal points), the movement units are viewed as S
"pulses". "p1" through "p6" then correspond to axis 1 through axis 6.
4: I f there is even 1 real number (with decimal point) in the input data for "p1" through "p6", the
T
movement units are recognized as "mm".
5: The input data ranges are as follows:
For "pulse" units: -6,144,000 to 6,144,000 range U
For "mm" units: -99,999.99 to 99,999.99 range

n NOTE
If both integers and real numbers are used together (mixed), all coordinate values will be handled in "mm/deg"
V
units.

W
Notation: f ) SCARA robots with coordinate data in "mm" units --> Hand system flags can be specified. (*1)
To set the hand system flag, set either 1 or 2 at "f".
If a number other than 1 or 2 is set, or if no number is designated, 0 will be set to indicate that there is
X
no hand system flag.

0
Hand system flag is not set. Y
Any value other than 1 / 2, or no setting.
f
1 Point setting in Right-handed system
2 Point setting in Left-handed system
Z

Notation: f1,2)YK-TW series with coordinate data in "mm" units -->


The first and second arm rotation information can be specified. (*1)
To set the rotation information, set "-1", "0", or "1" at f1 and f2.
Any other value or no setting will be processed as "0".
"0" is set at arm rotation information.
0
Any value other than -1 / 0 / 1, or no setting.
f1, 2
1 "1" is set at arm rotation information.
-1 "-1" is set at arm rotation information.

Reference *1: Chapter 4 "3. Point data format"

Robot language list 8-143


Pn
8
Sample Description
P1 = 0 0 0 0 0 0 ……
Defines point data P1 to P3
P2 = 100.000 200.000 50.000 0.000 0.000 0.000
P3 = 10.000 0.000 0.000 0.000 0.000 0.000
P10= P2 ……Substitute P2 for P10
N FOR A=10 TO 15
P[A+1]=P[A]+P3
NEXT A
O FOR A=10 TO 16
MOVE P,P1,P[A] ……
PTP movement from the position of P1
NEXT A to the position of P[A]
P HALT

Q n NOTE
• All input values are handled as constants.
• If controller power is turned off during execution of a point definition statement, a memory-related error such as
"9.702: Point data destroyed" may occur.
R

S Related commands Point assignment statement (LET)

8-144 Chapter 8 Robot Language


91 PPNT
Creates pallet point data 8

Format

PPNT(pallet definition number, pallet position number)

N
Explanation Creates the point data specified by the pallet definition number and the pallet position number.

O
Sample Description
P10=PPNT(1,24) ………
Creates, at P10, the point data specified by pallet position P
number 24 of pallet definition number 1.

Q
Related commands PDEF, PMOVE

Robot language list 8-145


92 PRINT
8 Displays the specified expression value at the programming box

Format
PRINT expression , expression... ,
; ;
N
Value Contents

O Expression Character string, numeric value, variable

P Explanation Displays a specified variable on the programming box screen.


Output definitions are as follows:

Q 1: If numbers or character strings are specified in an <expression>, they display as they are. If variables
or arrays are specified, the values assigned to the specified variables or arrays display.
R 2: If no <expression> is specified, only a line-feed occurs.
3: If the data length exceeds the screen width, a line-feed occurs, and the data is displayed on the next
line.
S 4: If a comma ( , ) is used as a display delimiter, a space (blank) is inserted between the displayed items.
5: If a semicolon ( ; ) is used as a display delimiter, the displayed items appear in succession without

T being separated.
6: If the data ends with a delimiter, a line-feed does not occur. When not ended with a display delimiter,
a line-feed occurs with a display delimiter, a line-feed occurs.
U

V • Data communication to the programming box screen occurs in order for the PRINT statement to be displayed
there. Therefore, program execution may be delayed when several PRINT statements are executed consecutively.
• On the programming box, the PRINT statement is displayed on "Message" space in "Automatic Operation (ALL
W TASK)" screen.

X Sample Description
PRINT A ………
Displays the value of variable A.
Y PRINT "A1 =";A1 ………
Displays the value of variable A1 after "A1 =".
PRINT "B(0),B(1) = ";B(0);",";B(1)
PRINT P100 ………
Displays the P100 value.
Z
Related commands INPUT

8-146 Chapter 8 Robot Language


93 PSHFRC
Specifies/acquires the pushing force parameter 8

Format

1. PSHFRC [robot number] expression


2. PSHFRC [robot number] (axis number) = expression
N

Value Range O
Robot Number 1 to 4 (If not input, robot 1 is specified.)
Axis Number 1 to 6
Expression -1000 to 1000 (unit: %)
P

Explanation Changes the "push force" parameter of the specified axis to the value of <expression>.
Q
If the "F" option is omitted in the PUSH statement, the pushing control is executed with the setting of the
pushing thrust parameter. R
Actual pushing thrust is as follows.
• Rated thrust x <expression> / 100 S

[Format 1] Changes parameters of all axes.


T
[Format 2] Changes parameter of the axis specified by the <axis number>.

Sample Description U
PSHFRC (1) = 10 ………
Changes the pushing thrust parameter of axis 1 of robot 1 to
10%.
V

W
Functions
X
Format

PSHFRC [robot number](axis number) Y

Value Range
Z
Robot Number 1 to 4 (If not input, robot 1 is specified.)
Axis Number 1 to 6

Explanation Acquires the value of "push force" parameter of the specified axis.

Sample Description
A=PSHFRC (1) ………
The pushing thrust parameter of axis 1 of robot 1 is assigned to
variable A.

Robot language list 8-147


94 PSHJGSP
8 Specifies/acquires the push judge speed parameter

Format

1. PSHJGSP [robot number] expression


2. PSHJGSP [robot number] (axis number) = expression
N

O Value Range / Meaning


Robot Number 1 to 4 (If not input, robot 1 is specified.)
Axis Number 1 to 6
P Expression 0 (Invalid), 1 to 100 (units: %)

Q Explanation Changes the "push judge speed" parameter of the specified axis to the value of the <expression>.
If the push judge speed parameter is enabled, a pushing operation is detected only when the movement
R speed is below <expression> with the pushing thrust in the PUSH statement at the specified value.

The setting of <expression> can be specified as follows.


S 0: A pushing operation is detected if the pushing thrust reaches the specified value with the threshold
setting invalid.

T 1 to 100: The movement speed in the PUSH statement is 100% to specify thresholds with a rate.

Sample Description
U PSHJGSP (1) = 50 ………
Changes the push judge speed parameter of axis 1 of robot 1
to 50%.

W
Functions
X
Format

Y PSHJGSP [robot number] (axis number)

Z Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.)
Axis Number 1 to 6

Explanation Acquires the value of "push judge speed" parameter of the axis specified by <axis number>.

Sample Description
A=PSHJGSP (1) ………
The pushing detection speed threshold parameter of axis 1 of
robot 1 is assigned to variable A.

8-148 Chapter 8 Robot Language


95 PSHMTD
Specifies/acquires a pushing type parameter 8

Format

1. PSHMTD [robot number] expression


2. PSHMTD [robot number] (axis number) = expression
N

Value Range / Meaning


O
Robot Number 1 to 4 (If not input, robot 1 is specified.)
Axis Number 1 to 6
Expression 0: Totalizing method, 1: Resetting method P

Explanation Changes the "push method" parameter of the specified axis to the value of the <expression>.
Q

The pushing type in the PUSH statement can be specified as follows by the <expression>. R
0: T
 he time for the pushing thrust to reach the specified value is totalized to execute the pushing
control end detection.
1: T
 he pushing control end detection is executed only when the pushing thrust continuously reaches S
the specified value. If the pushing thrust is lower than the specified value, the elapsed time is reset to
0.
T
In format 1, the change occurs at all axes.
In format 2, the change occurs at the parameter of the axis specified by <axis number>. U

Sample Description
V
PSHMTD (1) = 1 ………
Changes the push method parameter of axis 1 of robot 1 to the
resetting method.
W

X
Functions
Y
Format

PSHMTD [robot number] (axis number)


Z

Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.)
Axis Number 1 to 6

Explanation Acquires the value of "push method" parameter of the axis specified by <axis number>.

Sample Description
A=PSHMTD (1) ………
The pushing method parameter of axis 1 of robot 1 is assigned to
variable A.

Robot language list 8-149


96 PSHRSLT
8 Acquires the status when PUSH statement ends

Format

PSHRSLT [robot number] (axis number)

N Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.)
O Axis Number 1 to 6

P Explanation Acquires the end status of PUSH statement executed for the axis.

0: The PUSH statement was ended for a reason other than the arrival of the pushing time.
Q 1: The PUSH statement was ended by the arrival of the pushing time.

R Sample Description
PUSH(3,P1) ………
Moves the axis 3 of robot 1 is under the pushing control to
the position specified with P1.
S IF PSHRSLT(3) = 1 THEN
………
Ended by the arrival of the pushing time.
T GOTO *OK
ELSE ………
Ended for a reason other than the arrival of the pushing
time.
U GOTO *NG
ENDIF

8-150 Chapter 8 Robot Language


97 PSHSPD
Specifies/acquires the push speed parameter 8

Format

1. PSHSPD [robot number] expression


2. PSHSPD [robot number] (axis number) = expression
N
Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.) O
Axis Number 1 to 6
Expression 1 to 100 (units: %)
P
Explanation Changes the "push speed" parameter of the axis to the value of <expression>.
Q
The motion speed in the PUSH statement is as follows.
• Neither "S" nor "DS" is set as an option in the PUSH statement: R
Max. speed of robot (mm/sec. or deg./sec.) x Push speed ratio (%) x Auto. movement speed (%) x Program movement speed (%)

• "S" is set as an option in the PUSH statement: S


Max. speed of robot (mm/sec. or deg./sec.) x Push speed ratio (%) x Auto. movement speed (%) x Program movement speed
specified by S (%)
T
• "DS" is set as an option in the PUSH statement:
Max. speed of robot (mm/sec. or deg./sec.) x Push speed ratio (%) x Movement speed of an axis specified by DS (%) U

Sample Description
V
PSHSPD (1) = 50 ………
Changes the push speed parameter of axis 1 of robot 1 to
50%.
W

X
Functions
Y
Format

PSHSPD [robot number] (axis number)


Z
Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.)
Axis Number 1 to 6

Explanation Acquires the "push speed" parameter value of the axis specified by <axis number>.

Sample Description
A=PSHSPD (1) ………
The push speed parameter of axis 1 of robot 1 is assigned to
variable A.

Robot language list 8-151


98 PSHTIME
8 Specifies/acquires the push time parameter

Format

1. PSHTIME [robot number] expression


2. PSHTIME [robot number] (axis number) = expression
N

O Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.)
Axis Number 1 to 6
P Expression 1 to 32767 (unit: ms)

Q Explanation Changes the "push time" parameter of the specified axis to the value indicated in <expression>.
If the TIM option is omitted in the PUSH statement, the pushing control is executed with the setting of
R the push time parameter.
In format 1, the change occurs at all axes.
In format 2, the change occurs at the axis specified by the <axis number>.
S
Sample Description
T PSHTIME (1) = 1000 ………
Changes the push time parameter of axis 1 of robot 1 to
1000 ms.

V
Functions

W Format

PSHTIME [robot number] (axis number)


X
Value Range
Y Robot Number 1 to 4 (If not input, robot 1 is specified.)
Axis Number 1 to 6

Z
Explanation Acquires the value of "push time" parameter of the axis specified by the <axis number>.

Sample Description
A=PSHTIME (1) ………
The push time parameter of axis 1 of robot 1 is assigned to
variable A.

8-152 Chapter 8 Robot Language


99 PUSH
Executes a pushing operation for specified axes 8

Format

PUSH [robot number](axis number, expression), option, option

Value Range / Meaning N


Robot Number 1 to 4 (If not input, robot 1 is specified.)
Axis Number 1 to 6 O
Expression Motor position (mm, degree, pulse) or point expression

P
Explanation Executes an absolute position movement of the specified axis with controlling the pushing thrust in the
forwarding direction.
Q
• Movement type : Pushing PTP movement of specified axis
• Point data setting : Direct coordinate data input, point definition R
• Options : Pushing thrust setting, pushing time, pushing speed setting,
STOPON condition setting, CONTON condition setting
S

T
Movement type
U
● PTP (point-to-point) of specified axis
PTP movement begins after the operation of the axis specified by the <axis number> is completed (within the
tolerance range), controlling the pushing thrust in the forwarding direction of the axis.
V

The conditions to start the pushing control are as follows. W


• Immediately after the start of movement of an axis by the PUSH statement
•A
 fter the merge operation is completed (when the PUSH statement is specified in the line next to the movement
command with CONT specified)
X

The conditions to terminate the command are as follows. Y


• The axis arrives within the tolerance range of the target position.
 he status where the pushing thrust of the axis reaches <pushing thrust value> elapses the time specified to
•T
<pushing time value>. Z
The end status for the PUSH statement can be confirmed with the PSHRSLT statement.

The conditions to cancel the pushing thrust (to cancel the torque value defined by PUSH statement) are as
follows.
•W
 hen PUSH command finishes and then either of movement commands below is executed. Note that only
finishing PUSH command is not enough to cancel the pushing thrust
1. In push status at PUSH command finish
When the target axis starts to move in the opposite direction of that specified by PUSH
statement
2. The target axis moves to the target position at PUSH command finish (not in push status)
When the target axis starts to move either direction
• When a servo off occurs
• When the power source to the controller is interrupted and restarted

Robot language list 8-153


PUSH
8
If the next command following to the PUSH statement is an executable command such as a signal output
command, the next command will start when the pushing conditions of an axis to be moved are satisfied, or
when an axis arrives within the tolerance range of the target position.

Example:
N Signal output (DO, etc.) Signal is output when the pushing conditions are satisfied or within the tolerance range.
DELAY command is executed and standby starts, when the pushing conditions are satisfied or
DELAY
within the tolerance range.
O Program stops and is reset when the axis enters the OUT position range. Therefore, the axis
HALT
movement also stops.

P HALTALL
When the pushing conditions are satisfied or within the tolerance range, the programs in
execution are all stopped, task 1 is reset, and other tasks are terminated. Therefore, the axis
movement also stops.
Program temporarily stops when the axis enters the OUT position range. Therefore, the axis
Q HOLD
movement also stops.
When the pushing conditions are satisfied or within the tolerance range, the programs in
HOLDALL
execution are all temporarily stopped. Therefore, the axis movement also stops.
R WAIT command is executed, when the pushing conditions are satisfied or within the tolerance
WAIT
range.

S Sample Description
PUSH(1,P0) ………
A xis 1 of robot 1 moves from its current position to the position

T specified by P0.

V Point data setting types

● Direct numeric value input


W The motor position is specified directly in <expression>.
If the motor position's numeric value is an integer, this is interpreted as a "pulse" unit. If the motor position's
numeric value is a real number, this is interpreted as a "mm/degrees" unit, and each axis will move from the
X 0-pulse position to a pulse-converted position.
Sample Description
Y PUSH(1,10000) ………
A xis 1 of robot 1 moves from its current position to the
100000 pulse position.
PUSH[2](2,90.000) ………
A xis 2 of robot 2 moves from its current position to the 90°
Z position (when axis 2 is a rotating axis).

● Point definition
Point data is specified in <expression>. The axis data specified by the <axis number> is used. If the point
expression is in "mm/degrees" units, movement for each axis occurs from the 0-pulse position to the pulse-
converted position.
Sample Description
PUSH(1,P1) ………
A xis 1 of robot 1 moves from its current position to the
position specified by P1.
PUSH[2](2,P90) ………
A xis 2 of robot 2 moves from its current position to the
position specified by P90 (deg.) (when axis 2 is a rotating axis.)

8-154 Chapter 8 Robot Language


PUSH
8
Option types

● Pushing thrust setting


Format
N
F = expression

Value Range O
Expression -1000 to 1000 (units: %)
P
Explanation The pushing thrust in the forwarding direction of an axis is specified as an <expression>.
The actual pushing thrust is determined as shown below.
• Rated thrust x <expression>/100
Q
If <expression> is omitted, pushing thrust value specified with the parameter is used.
R
Sample Description
PUSH(1,10000),F=10
S
………
A xis 1 of robot 1 moves from its current position to the 100000 pulse
position with the pushing thrust at 10% of the rated thrust.
T

V
● Pushing time setting
Format
W
TIM = expression

Value Range X
Expression 1 to 32767 (units: ms)

Y
Explanation The time to keep pushing with the specified pushing thrust is specified as an <expression>.
When the status where the pushing thrust reaches the specified value exceeds <expression>, the PUSH
statement terminates. Z
If this option is omitted, the setting of the parameter is used.

Sample Description
PUSH(1,10000),TIM=5000
………
A xis 1 of robot 1 moves from its current position to the 100000 pulse
position with keeping pushing for 5 seconds.

Robot language list 8-155


PUSH
8
● Pushing speed setting
Format
1. SPEED = expression
2. S = expression
N
Value Range
Expression 1 to 100 (units: %)
O
Explanation The program movement speed is specified in <expression>.
P This option is enabled only for the specified PUSH statement.

The actual speed is determined as shown below.


Q •M
 ax. speed of a robot (mm/s or deg./s) x Push speed (%) x automatic. movement speed (%) x <expression> (%)

R Sample Description
PUSH(1,10000),S=10

S ………
A xis 1 of robot 1 moves from its current position to the 100000 pulse
position with the speed at 10% of the multiplication of the push speed
and the automatic movement speed.

V Format
1. DSPEED = expression

W 2. DS = expression

Value Range
X Expression 0.01 to 100.00 (units: %)

Y Explanation The axis movement speed is specified in <expression>.


This option is enabled only for the specified PUSH statement.
Movement always occurs at the DSPEED <expression> value (%) without being affected by automatic
Z movement speed value (%).

The actual speed is determined as shown below.


• Max.
 speed of a robot (mm/s or deg./s) x Push speed (%) x <expression> (%)

Sample Description
PUSH(1,10000),DS=0.1
………
A xis 1 moves of robot 1 from its current position to the 100000 pulse
position with the speed at 0.1% of the pushing movement speed.

8-156 Chapter 8 Robot Language


PUSH
8
● STOPON conditions setting
Format

STOPON conditional expression

Sample Description
N
PUSH(1,10000),STOPON DI(20) = 1
………
A xis 1 of robot 1 moves from its current position toward the "10000
pulses" position and stops at an intermediate point if the "DI (20) = 1" O
condition is met. The next step is then executed.

Reference "MOVE" statement P

Q
● CONT setting (Continuous Motion)
Format R
CONTON conditional expression
S
Sample Description
PMOVE(1,P1),CONTON DI(20)=1 ………
A xis 1 of robot 1 moves from its current position toward
the "P1" position. When "DI (20) = 1" conditions are met, T
the robot starts deceralating and executed the next step.

Reference "MOVE" statement U

Related commands PSHFRC, PSHTIME, PSHMTD, PSHSPD, PSHRSLT, CURTRQ, CURTQST V

Robot language list 8-157


100 RADDEG
8 Performs a unit conversion (radians → degrees)

Format

RADDEG(expression)

N Value Contents
Expression Angle (units: radians)
O
Explanation Converts the <expression> value to degrees.
P

Sample Description
Q
LOC4(P0)=RADDEG(ATN(B))
………
Converts the variable B arctangent value to degrees, and assigns it to
R 4th-axis data of P0.

S Related commands ATN, COS, DEGRAD, SIN, TAN

8-158 Chapter 8 Robot Language


101 REFTSK
Acquires the task state 8

Format

REFTSK(task number )

Value Range N
Task Number Variable can be specified

Return Value Range


O
-1 : NON EXISTENT
0 : STOP P
Task Status 1 : READY, RUN
2 : WAIT
Q
3 : SUSPEND

R
Explanation Acquires the state of the specified task.
The return value is acquired depending on the status. S

By acquiring the task status on the program using this function,


T
it makes possible to process according to the task status such as task startup.
REFTSK can also be used as an online command.
U

Reference for Each task status: Chapter 6 "Task status and transition"
V
SAMPLE 1: Starting task 2
W
A% = REFTSK(2) ……… Acquires the status of task 2
IF A% = -1 THEN ……… I
f task 2 is unregistered (NON EXISTENT),
START <SUB _ PGM>,T2 makes task 2 start. X
ELSE
‘Processes in case that task 2 is not started
ENDIF
Y
SAMPLE 2: Processing the own task after completing the process of task 2
Z
WAIT REFTSK(2) <= 0 ………Waits until task 2 is stopped (STOP) or
‘The following: unregistered (NON EXISTENT) staus.
processing for own task

Robot language list 8-159


102 REM
8 Inserts a comment

Format
1. REM character string
2. ' character string
N

Explanation All characters which follow REM or an apostrophe (') are handled as a comment.
O
This comment statement is used only to insert comments in the program, and it does not execute any
command. REM or an apostrophe (') can be entered at any point in the line.
P
Sample Description

Q All are comment examples


REM *** MAIN PROGRAM *** ………Comment; *** MAIN PROGRAM ***
’*** SUBROUTINE *** ………
Comment; *** SUBROUTINE ***
R HALT ’HALT COMMAND ………
Comment; HALT COMMAND

8-160 Chapter 8 Robot Language


103 RESET
Turns OFF the bits of specified ports, or clears variables 8

Format 1
RESET DOm(b, ..., b)
DO(mb, ..., mb)
MOm(b, ..., b)
N
MO(mb, ..., mb)
TOn(b, ..., b) O
TO(nb, ..., nb)
LOn(b, ..., b) P
LO(nb, ..., nb)
SOm(b, ..., b) Q
SO(mb, ..., mb)
R
Format 2

RESET TCOUNTER
S

Notation Value Range


T
m Port Number 2 to 7, 10 to 17, 20 to 27
n Port Number 0, 1
0 to 7 (If omitted, all 8 bits are processed.)
U
b Bit definition If multiple bits are specified, they are expressed from the left in descending order
(high to low).
V
Reference Bit definition: Chapter 3 "10 Bit Settings"
W
c CAUTION
Output to ports "0" and "1" is not allowed at DO, MO, and SO.
X

Y
Explanation Format 1: Turns the bits of specified ports OFF.
Format 2: Clears the 1ms counter variables
(1ms counter variables are used to measure the time in 1ms units). Z

Sample Description
RESET DO2() ………
Turns OFF DO(27 to 20).
RESET DO2(6,5,1) ………
Turns OFF DO(26, 25, 21).
RESET (37,35,27,20) ………
Turns OFF DO(37, 35, 27, 20).
RESET TCOUNTER ………
Clears the 1ms counter variables.

Related commands SET, DO, MO, SO, TO, LO

Robot language list 8-161


104 RESTART
8 Restarts another task during a temporary stop

Format

RESTART Tn
<program name>
N
PGm

O Notation Value Range


n Task Number 1 to 16

P m Program Number 1 to 100

Explanation Restarts another task that has been temporarily stopped (SUSPEND status).
Q A task can be specified by the name or the number of a program in execution.
The program name must be enclosed in < > (angle brackets).
R

If a task (program) not temporarily stopped is specified and executed, an error occurs.
S

T Sample Description
Main task
START <SUB _ PGM>,T2 ……Registers program i.e. SUB _ PGM in Task 2 and starts it
U FLAG=1 ……Execution set for exclusive control flag 1
*L0:
IF FLAG=1 AND DI2(0)=1 THEN ……If flag 1 and DI2(0) are ON
V SUSPEND T2 ……Pauses Task 2
FLAG=2 ……
Substitutes 2 for FLAG
(execution set for exclusive control flag 2)
W WAIT DI2(0)=0 ……Waits until DI2(0) turns OFF
ENDIF
IF FLAG=2 AND DI2(0)=1 THEN ……If flag 2 and DI2(0) are ON
X RESTART T2 ……Restarts Task 2
FLAG=1 ……Execution set for exclusive control flag 1
WAIT DI2(1)=0 ……Waits until DI2(1) turns OFF
Y ENDIF
MOVE P,P0
MOVE P,P1
Z GOTO *L0
HALTALL

’SUBTASK ROUTINE Sub Task (Program name: SUB _ PGM)


*SUBTASK:
DO2(0)=1
DELAY 1000
DO2(0)=0
DELAY 1000
GOTO *SUBPGM
EXIT TASK ……Ends the task

Reference "Multi-Task" item in Chapter 6

Related commands CUT, EXIT TASK, START, SUSPEND

8-162 Chapter 8 Robot Language


105 RESUME
Resumes program execution after error recovery processing 8

Format

1. RESUME
2. RESUME NEXT
N
3. RESUME label

O
Explanation Resumes program execution after recovery from an error.
Depending on its location, a program can be resumed in the following 3 ways: P
1. RESUME The program resumes from the command which caused the error.
2. RESUME NEXT The program resumes from the next command after the command which caused the
Q
error.
3. RESUME label The program resumes from the command specified by the <label>. R

S
• The RESUME statement can also be executed in an error processing routine..
• Error recovery processing is not possible for serious errors such as "17.800 : Motor overload".
T
Reference "ON ERROR GOTO"
U
Related commands ON ERROR GOTO
V

Robot language list 8-163


106 RETURN
8 Processing which was branched by GOSUB, is returned to the next line after GOSUB

* GOSUB can also be expressed as "GO SUB".


Format

GOSUB label
N :
label:
O :
RETURN

P
Explanation Ends the subroutine and returns to the next line after the jump source GOSUB statement.
Q
• Jump to a subroutine by a GOSUB statement;
R the subroutine (jump destinations) must end by a RETURN statement.
• Jump from a routine by a GOTO statement; an error such as "5.212: Stack overflow" may occur.

T Sample Description
*ST: ………Main program (label definition)
MOVE P,P0
U GOSUB *CLOSEHAND ………Jumps to Subroutine *CLOSEHAND
MOVE P,P1
GOSUB *OPENHAND ………Jumps to Subroutine *OPENHAND
V GOTO *ST ………Jumps to Main program *ST
HALT
’SUB ROUTINE (Comment) The following is a subroutine
W *CLOSEHAND: ………Subroutine *CLOSEHAND label definition
DO(20) = 1 ………When DO(20) is turned ON
RETURN ………Executs from the next line of GOSUB statement *CLOSEHAND
X *OPENHAND: ………Subroutine *OPENHAND label definition
DO(20) = 0 ………When DO(20) is turned OFF
RETURN ………Executs from the next line of GOSUB statement *OPENHAND
Y
Related commands GOSUB
Z

8-164 Chapter 8 Robot Language


107 RIGHT$
Extracts a character string from the right end of another character string 8

Format

RIGHT$ (character string expression , expression)

Value Range N
Expression 0 to 255
O
Explanation This function extracts a character string with the digits specified by the <expression> from the right end
of the character string specified by <character string expression>. P
• If the <expression> value is out of the range of 0 - 255; an error will occur.
• If the <expression> value is 0; the extracted character string will be a null string (empty character
Q
string).
• If the <expression> value has more characters than the <character string expression>; R
extracted character string will become the same as the <character string expression>.

S
Sample Description
B$=RIGHT$(A$,4) ………
4 characters from the right end of A$ are assigned to B$. T

Related commands LEFT$, MID$ U

Robot language list 8-165


108 RIGHTY
8 Sets the SCARA robot hand system as a right-handed system

Format

RIGHTY [robot number]

N
Value Range

O Robot Number 1 to 4 (If not input, robot 1 is specified.

P Explanation Specifies the robot as a right-handed system.


The robot moves to a point specified in the Cartesian coordinates.

Q •T
 his 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 (positioned within
R tolerance range).
• This command is only valid for SCARA robots.

S
Sample Description
T RIGHTY ………Specifies the hand system of robot 1 as a right-handed
system.
MOVE P,P1 ………(1)
U LEFTY ………Specifies the hand system of robot 1 as a left-handed
system.
MOVE P,P1 ………(2)
V RIGHTY ………Specifies the hand system of robot 1 as a right-handed
system.
HALT
W

X SAMPLE:LEFTY/RIGHTY

P1

Y
(2) (1)

Left-handed system Right-handed system

SCARA robot

Related commands LEFTY

8-166 Chapter 8 Robot Language


109 RSHIFT
Shifts a bit value to the right 8

Format

RSHIFT(expression 1, expression 2)

N
Explanation Shifts the <expression 1> bit value to the right by the amount of <expression 2>.
Spaces left blank by the shift are filled with zeros (0).
O

Sample Description P
A=RSHIFT(&B10111011,2)
………
The 2-bit-right-shifted &B10111011 value (&B00101110) is assigned to A. Q

R
Related commands LSHIFT

Robot language list 8-167


110 SCRINR
8 Specifies/acquires R axis inertia for SCARA parameter.

Format

SCRINR [robot number] expression

N
Value Range

O Robot Number 1 to 4 (If not input, robot 1 is specified.)


Value of R axis inertia for SCARA parameter
Expression
0 to 32767 (units: kgm2 × 10-4)
P
Explanation Changes the value of "R axis inertia for SCARA" parameter of specified robot to the <expression> value.
Q This command is invalid for robots other than the SCARA robot.

R Sample Description
SCRINR 100 ………
Sets "R axis inertia for SCARA" parameter of robot 1 to 100.
SCRINR[2] 200 ………
Sets "R axis inertia for SCARA" parameter of robot 2 to 200.
S

U
Functions
V Format

SCRINR [robot number]


W
Value Range
X Robot Number 1 to 4 (If not input, robot 1 is specified.)

Y
Explanation This function acquires the value of "R axis inertia for SCARA" parameter of specified robot.

Z Sample Description
A% = SCRINR ………
The "R axis inertia for SCARA" parameter of robot 1 is assigned
to the variable A%.
A% = SCRINR[2] ………
The "R axis inertia for SCARA" parameter of robot 2 is assigned
to the variable A%.

8-168 Chapter 8 Robot Language


111 SELECT CASE to END SELECT
Executes the specified command block in accordance with the <expression> value 8

Format
SELECT CASE expression
CASE expression list 1
command block 1 N
CASE expression list 2
command block 2
: O
CASE ELSE
command block n P
END SELECT

Value Range / Meaning (Setting Method) Q


Expression General purpose input signals or Variables
Expression List Decimal value or string. Multiple items are specifiable by separating with comma "," R
Command Block One command should be written within one line

Sample of <expression> S
DI(24,23,22,21,20):
Recognizes the specified I/O for 5 bit in binary and executes the corresponding <command block> in the <expression list>. T
ABC%: Specifies a variable. It executes the <command block> in the <expression list> according to the variable value.

Explanation These statements execute multiple command blocks in accordance with the <expression> value. U

If the <Expression> value matches one of expressions contained in the <expression list>
The specified command block is executed. After executing the command block, the program jumps to
V
the next command which follows the END SELECT statement.
W
If the <expression> value does not match any of the expressions contained in the <expression list>
The command block indicated after the CASE ELSE statement is executed. After executing the command
block, the program jumps to the next command which follows the END SELECT statement.
X

If the <expression> value does not match any of the expressions contained in <expression list> and no Y
CASE ELSE statement exists
The program jumps to the next command following the END SELECT statement.
Z
Sample Description

WHILE 1
SELECT CASE DI3(7,6,5,4,3,2,1,0) ………
Executes each command block according to
CASE &B00000001 the input status of DI3(8 bits)
MOVE P,P1 ………Command block when DI3(0) is ON
CASE &B00000010 ………When DI3(1) is ON
MOVE P,P2
CASE &B00000011 ………When DI3(0) and DI3(1) is ON
MOVE P,P3
CASE ELSE ………Case other than the above
MOVE P,P0
END SELECT ………Ends SELECT CASE statement
WEND

Robot language list 8-169


112 SEND
8 Sends readout file data to the write file

Format

SEND read-out file TO write file

N
Explanation Sends <read-out file> data to the <write file>.

O
• An entire DO, MO, TO, LO, SO, or SOW port (DO(), MO(), etc.), cannot be specified as a write file.
• Some individual files (DOn(), MOn(), etc.) cannot be specified as a write file.
P Reference Chapter 10 "Data file description"
•W
 riting to read-only files (indicated by a "--" in the "Write" column of the table shown below) is not
permitted.
Q • E ven if the read-out/write files are specified correctly, it may not be possible to execute them if there is
a data format mismatch between the files.
R
n NOTE
1. Examples of erroneous writing to a read-only file:
• SEND CMU TO DIR • SEND PNT TO SI()
S
2. Examples of data format mismatches:
• SEND PGM TO PNT • SEND SI() TO SFT
T
Definition Format
Type File Name Read-out Write
All Individual File
U User All file ALL --------------- 3 3
<bbbbbbbb>
PGM
V Program
PGn
3 3

Point PNT Pn 3 3
Point comment PCM PCn 3 3
W Point name PNM PNn 3 3
Parameter /cccccccc/
X PRM #cccccccc# 3 3
\cccccccc\
Shift coordinate definition SFT Sn 3 3
Y Hand definition HND Hn 3 3
Work definition WRKDEF Wn 3 3

Z Pallet definition PLT PLn 3 3

General Ethernet Port GEP GPn 3 3


Input/output name ION iNMn(n) 3 3
Area check output ACO ACn 3 3
Real time output RTO RTn 3 3
Variable, Variable VAR ab...by 3 3
Constant Array variable ARY ab...by(x) 3 3
Constant ---------- "cc...c" 3 -
Status Program directory DIR <<bbbbbbbb>> 3 -
Parameter directory DPM --------------- 3 -
sensor, stroke-end MRF --------------- 3 -
Machine reference
mark ARP --------------- 3 -

8-170 Chapter 8 Robot Language


Definition Format
Type File Name Read-out Write
All Individual File
8
Status Accumulated data ACD --------------- 3 -
System configuration information CFG --------------- 3 -
Version information VER --------------- 3 -
Option board OPT --------------- 3 -
Self check SCK --------------- 3 -
Alarm history LOG --------------- 3 - N
Remaining memory size MEM --------------- 3 -
Device DI port DI() DIn() 3 -
DO port DO() DOn() 3 3 O
MO port MO() MOn() 3 3
TO port TO() TOn() 3 3 P
LO port LO() LOn() 3 3
SI port SI() SIn() 3 -
SO port SO() SOn() 3 3
Q
SIW port SIW() SIWn() 3 -
SOW port SOW() SOWn() 3 3 R
RS-232C CMU --------------- 3 3
Ethernet ETH --------------- 3 3
S
Other File END code EOF --------------- 3 -
3: Permitted -: Not Permitted
n: number a: Alphabetic character b: Alphanumeric character or underscore (_) T
c: Alphanumeric character or special symbol x: Expression (array argument) y: Variable type
i: Input/output type
U

V
The following cautions apply when a restart is performed after a stop occurred during execution of the SEND statement.
1. W
 hen reading from RS-232C / Ethernet (SEND CMU TO XXX, SEND ETH TO XXX):
When the SEND statement is stopped during data reading from the reception buffer, the data acquired up to that W
point is discarded.
2. W
 hen writing to RS-232C / Ethernet (SEND XXX TO CMU, SEND XXX TO ETH):
When the SEND statement is stopped during data writing to the transmission buffer, the data is written from the
X
beginning.
Y

Sample Description
Z
SEND PGM TO CMU ………
Outputs all user programs from the RS-232C port.
………
Outputs the PRG1 program from the RS-232C port.
SEND <PRG1> TO CMU ………
Inputs a point data file from the RS-232C port.
………
Outputs the "T1" character string from the RS-232C port.
SEND CMU TO PNT ………
Inputs character string data to variable A$ from the RS-
232C port.
SEND "T1" TO CMU

SEND CMU TO A$

Reference Chapter 10 "Data file description"

Related commands OPEN, CLOSE, SETGEP, GEPSTS

Robot language list 8-171


113 SERVO
8 Controls the servo status

Format
SERVO [robot number] ON (axis number)
OFF
N FREE

O Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.)
Axis Number 1 to 6 (• Multiple axes not specifiable • If not input, all axes are specified.)
P

Q Explanation This command controls the servo ON/OFF at the specified axes or all axes.

R SERVO
SERVO Motor power Dynamic brake
Electromagnetic
command brake
ON ON ON OFF OFF
S OFF
OFF OFF ON ON
(During all axes servo OFF)

T FREE OFF Continues the previous status OFF OFF

U c CAUTION
• Always check that the Emergency Stop is ON and Servo is OFF when working within the robot movement
range.
• Electromagnetic brake is the brake to prevent the vertical axis from sliding downward. The vertical axis will
V slide downward when the servo is FREE, causing a hazardous situation.

X
• This command is executed after the operation of all axes of the specified robot has been complete (after positioned
within the tolerance).
Y • The motor power is a power supply unit for robot (motor) in the controller.
• The dynamic brake controls the motor by using the electric power which is generated in the motor when the servo
is turned OFF.
Z

Sample Description
SERVO ON ………
Turns servos ON at all axes of robot 1.
SERVO OFF ………
Turns the servo OFF and applies the dynamic brake at all axes of
robot 1. Axes equipped with brakes are all locked by the brake.
………
Turns servos OFF at axis 3 (Z-axis) of robot 1, and releases the
SERVO FREE(3) brake.

8-172 Chapter 8 Robot Language


114 SET
Turns the bit at the specified output port ON 8

Format
SET DOm(b, ..., b) , time
DO(mb, ..., mb)
MOm(b, ..., b)
N
MO(mb, ..., mb)
TOn(b, ..., b) O
TO(nb, ..., nb)
LOn(b, ..., b) P
LO(nb, ..., nb)
SOm(b, ..., b) Q
SO(mb, ..., mb)
R
Notation Value Range
m Port Number 2 to 7, 10 to 17, 20 to 27
S
n Port Number (TO, LO) 0, 1

0 to 7 (If omitted, all 8 bits are processed.)


b Bit definition If multiple bits are specified, they are expressed from the left
T
in descending order (high to low).

Time 10 to 3600000 (units: ms) U

Reference Bit definition: Chapter 3 "10 Bit Settings"


V
c CAUTION
Output to ports "0" and "1" are NOT allowed at DO, MO, and SO.
W

Explanation Turns ON the bits of specified ports.


X

The pulse output time (unit: ms) is specified by the <time> value. Y
The program execution is WAIT status while the output is ON. When the specified time elapses, the
output is turned OFF, and the execution ends.
Z
If no hardware port exists, nothing is output.

Sample Description
SET DO2() ………
Turns OFF DO(27 to 20).
SET DO2(6,5,1),200 ………
DO(26,25,21) switches ON for 200 ms.
SET DO(37,35,27,20) ………
Turns DO(37, 35, 27, 20) ON.

Related commands RESET, DO, MO, SO, TO, LO

Robot language list 8-173


115 SETGEP
8 Sets the General Ethernet Port

Format

SETGEP m, n, "IP address", ppppp, e, t

N Notation Value Range / Meaning


m General Ethernet Port number 0 to 7
O n Mode 0: server, 1: client
IP address 0.0.0.0 to 255.255.255.255

P ppppp Port Number 0 to 65535


e Termination code 0: CRLF, 1: CR
t Port Type 0: TCP
Q
Explanation Sets the specified General Ethernet Port. The General Ethernet Port can open/ close the communication
R port by OPEN/ CLOSE commands.
<IP address> must be enclosed in " " (double quotation marks).
When "0: server" is selected at "n: mode", although <IP address> can be omitted, " " (double quotation
S marks) must be written.

T
When Server mode is selected,

U • IP address: IP address already set on the controller is used to communicate, so IP address setting is unnecessary. (The
IP address set by <IP address> is invalid in this case.)
• Port number: Set a port number which differs from the one on the controller.
V When Client mode is selected,
• IP address and port number: Set the IP address and port number of the connection destination server.

W
Sample Description

X IPADRS$="192.168.0.100"
………
Assigns the IP address(192.168.0.100) of the server to
connect to variable IPADRS$.
Y SETGEP 1, 1, IPADRS$, 100, 0, 0
………
Sets the conditions below on General Ethernet Port 1.

Z • Mode: client
• 
IP address of the server to connect to:
192.168.0.100
• Port number of the server to connect to: 100
• Termination code : CRLF
OPEN GP1 ………
Connects the server specified at General Ethernet Port 1.
………
Sends the character strings "123" from General Ethernet Port
1.
SEND "123" TO GP1 ………
Disconnects from the server specified at General Ethernet
Port 1.
CLOSE GP1

Related commands OPEN, CLOSE, SEND, GEPSTS

8-174 Chapter 8 Robot Language


116 SGI
Assigns /acquires the value to a specified integer type static variable 8

Format

SGIn=xxxxxx

Notation Value Range


N
n Integer Type Static Variable Number 0 to 31
xxxxxx Integer of -2147483648 to 2147483647 O

P
Explanation Assigns xxxxxx to the integer type static variable (SGI) specified by "n". If a real number with decimal
point is specified at xxxxxx, assigns a value with decimal fractions truncated.
Q

Sample Description R
SGI1=300 ………
Assigns 300 to SGI1.

V
Functions

Format
W
SGIn
X
Notation Value Range
n Integer Type Static Variable Number 0 to 31
Y

Explanation Acquires the value of the integer type static variable (SGI) specified by "n". Z

Sample Description
A%=SGI1 ………
Assigns the value of SGI1 to variable A%.

Related commands SGR

Robot language list 8-175


117 SGR
8 Assigns /acquires the value to a specified real type static variable

Format

SGRn=xxxxxx

N Notation Value Range


n Real Type Static Variable Number 0 to 31
O -999999.9 to +999999.9
1. Single-precision Real Numbers Note:7 digits including integers and decimals.
(For example, ".0000001" may be used.)
P xxxxxx
-1.0×1038 to +1.0×1038
2. Single-precision Real Numbers
Q in Exponent Form
Note:Mantissas should be 7 digits or less, including integers
and decimals.

R
Explanation Assigns xxxxxx to the real type static variable (SGR) specified by "n".

S
Sample Description
T SGR1=1320.355 ………
Assigns 1320.355 to SGR1.

V
Functions
W
Format

X SGRn

Notation Value Range


Y n Real Type Static Variable Number 0 to 31

Z Explanation Acquires the value of the real type static variable (SGR) specified by "n".

Sample Description
A!=SGR1 ………
Assigns the value of SGR1 to variable A!.

Related commands SGI

8-176 Chapter 8 Robot Language


118 SHARED
Enables sub-procedure referencing without passing on the variable 8

Format

SHARED variable(), variable()...

N
Explanation This statement allows variables declared with a program level code to be referenced with a sub-
procedure without passing on the variables as dummy arguments.
O
The program level variable used by the sub-procedure is specified by the <variable> value.
A simple variable or an array variable followed by parentheses is specified. If an array is specified, that
entire array is selected P
n NOTE
The program level code is a program written outside the sub-procedure.
Q

R
• Normally, a dummy argument passes along the variable to a sub-procedure, but the SHARED statement allows
referencing to occur without passing along the dummy argument.
• The SHARED statement allows variables to be shared only between a program level code and sub-procedure
S
which are within the same program level
T

Sample Description
U
DIM Y!(10)
X!=2. 5 V
Y!(10)=1. 2
CALL *DISTANCE
CALL *AREA W
HALT
SUB *DISTANCE
SHARED X!,Y!( ) ………
Variable referencing is declared by SHARED. X
PRINT X!^2+Y!(10)^2 ………
The variable is shared.
END SUB
SUB *AREA Y
DIM Y!(10)
PRINT X!*Y!(10) ………
The variable is not shared.
END SUB Z

Related commands SUB, END SUB

Robot language list 8-177


119 SHIFT
8 Sets the shift coordinates

Format
SHIFT [robot number] shift variable
OFF
N
Value Range
O Robot Number 1 to 4 (If not input, robot 1 is specified.)

P Explanation Sets the shift coordinates specified by <shift variable> to the robot specified by <robot number>.
When OFF is specified, the coordinates shift by <shift variable> does not occur.

R • This statement is executed after axis positioning is complete (within the tolerance range).
• When OFF is specified, it is the same as the setting: 0.000 at each X, Y, Z and rotation direction-offset by the <shift
variable>.
S

T
Sample Description

U SHIFT S1 ………
Shifts the coordinate of robot 1 to the "shift 1" coordinate.

MOVE P,P10 ………


Shifts the coordinate of robot 1 to the coordinate specified by

V SHIFT S[A] variable A.

MOVE P,P20

W HALT

X Related commands Shift definition statement, shift assignment statement

8-178 Chapter 8 Robot Language


120 SI
Acquires specified SI status 8

Format
LET expression = SIm(b, ..., b)
LET expression = SI(mb, ..., mb)
N
Notation Value Range
m Port Number 0 to 7, 10 to 17, 20 to 27 O
 to 7 (If omitted, all 8 bits are processed.)
0
b bit Definition If multiple bits are specified, they are expressed from the left in descending
order (high to low). P

Explanation Acquires SI port input status specified by "m".


Q

R
Sample Description
A%=SI2() ………
The input status from SI (27) to SI (20) is assigned to S
variable A%.
A%=SI0(6,5,1) ………
The SI (06), SI (05), SI (01) input status is assigned to
variable A% (when all the above signals are "1" (ON), A% = 7). T
A%=SI(37,35,27,10) ………
The SI (37), SI (35), SI (27) SI(10) input status is assigned
to variable A% (when all the above signals except SI (27)
are "1" (ON), A% = 13). U

Robot language list 8-179


121 SID
8 Acquires a specified serial input's double-word information

Format

LET SID(m)

N Notation Value Range


m port number 2, 4, 6, 8, 10, 12, 14*

O The output (acquisition) range is -2,147,483,648(&H80000000) to 2,147,483,647(&H7FFFFFFF).


*When SIOW extension is enabled, the range of port number is extended to 2, 4, 6 -14, 24, 26, 28 -126.
For details, refer to RCX3 user's /operator’s manual "Option board related parameters".
P
Explanation Acquires the value at the SID port specified by "m".
Q

R
• The information is handled as signed double word data.
S • "0" is input if the specified port does not exist.
• The lower port number data is placed at the lower address.
For example, if SIW(2) =&H2345,SIW(3) =&H0001, then SID(2) =&H00012345.
T
Sample Description
U
A%=SID(2) ………
The input status of SIW(2), SIW(3) is assigned to variable A%.
A%=SID(14) ………
The input status of SIW(14), SIW(15) is assigned to variable A%.
V

Related commands SIW


W

8-180 Chapter 8 Robot Language


122 SIN
Acquires the sine value for a specified value 8

Format

SIN(expression)

Value Contents
N
Expression Angle (units: radians)
O
Explanation This function gives the sine value for the <expression> value.
P

Sample Description
Q
A(0)=SIN(B*2+C) ………
Assigns the expression B*2+C sine value to array A (0).
A(1)=SIN(DEGRAD(30)) ………Assigns a 30.0° sine value to array A (1).
R

Related commands ATN, COS, DEGRAD, RADDEG, TAN


S

Robot language list 8-181


123 SIW
8 Acquires a specified serial input's word information

Format

LET SIW(m)

N Notation Value Range


m port number 2 to 15*

O The output (acquisition) range is 0 (&H0000) to 65,535 (&HFFFF).


*When SIOW extension is enabled, the range of port number is extended to 2 -15, 24 - 127.
For details, refer to RCX3 user's /operator’s manual "Option board related parameters".
P

Q Explanation Acquires the value at the SIW port specified by "m".

S
• The information is handled as unsigned word data
• "0" is input if the specified port does not exist.
T
Sample Description
U A%=SIW(2) ………
The input status of SIW (2) is assigned to variable A%.
A%=SIW(15) ………
The input status of SIW (15) is assigned to variable A%.

V
Related commands SID
W

8-182 Chapter 8 Robot Language


124 Sn
Defines the shift coordinates in the program 8

Format

Sn = x y z r

Value Range
N
n 0 to 39
x, y, z, r -99,999.99 to 99,999.99 O

P
Explanation Defines shift coordinate values in order to shift the coordinates for robot movement. Only "mm" units
can be used for these coordinate values ("pulse" units cannot be used).
Q
1: "n" indicates the shift number.
2: The "x" to "r" input data must be separated with spaces (blanks). R
3: The "x" to "r" input data is recognized as "mm" unit data.
4: "x" to "z" correspond to the Cartesian coordinate system's x, y, z coordinate shift values, and "r"
corresponds to the xy coordinates' rotational shift values. S

n NOTE
• All input values are handled as constants. T
• If the controller power is turned off during execution of a shift coordinate definition statement, a memory-
related error such as "9.706: Shift data destroyed" may occur.

V
Sample Description
S0 = 0.000 0.000 0.000 0.000 …Defines shift coordinates for S0
S1 = 100.000 200.000 50.000 90.000 …Defines shift coordinates for S1 W
P3 = 100.000 0.000 0.000 0.000 0.000 0.000 …Defines P3 point data
SHIFT S0 …Changes the coordinates of Robot 1 to S0
MOVE P,P3 …Moves to P3 in PTP X
SHIFT S1 …Changes the coordinates of Robot 1 to S1
MOVE P,P3 …Moves to P3 in PTP
HALT Y

Z
Related commands Shift assignment statement, SHIFT

Robot language list 8-183


125 SO
8 Outputs a specified value to serial port or acquires the output status

Format
1. LET SOm(b, ..., b) = expression
2. LET SO (mb, ..., mb) = expression
N
Notation Value Range
m Port Number 2 to 7, 10 to 17, 20 to 27
O  to 7 (If omitted, all 8 bits are processed.)
0
b Bit Definition If multiple bits are specified, they are expressed from the left in descending
order (high to low).
P
Integer value (If real number is specified, rounds to an integer.)
Bits beyond the number of bit whom an assignment destination is required are
Q Expression ignored. (If the port number is specified, the lower 8 bits are valid. if the number
of bit specified on bit definition is 1 to 8, the lower 1 to 8 bit corresponding to
the bits specified on the left side are valid.)
R
Explanation Outputs a specified value to the SO port.
Only the <value> data's integer-converted lower bits corresponding to the bits defined at the left side
S can be output. If the port which does not exist is specified, nothing is output.
Reference Bit Definition: Chapter 3 "10 Bit Settings"

T
c CAUTION
Outputs to SO0() and SO1() are not possible.

U Sample Description
SO2()=&B10111000 ………SO (27, 25, 24, 23) are turned ON, and SO (26, 22, 21, 20) are turned OFF.
V SO2(6,5,1)=&B010 ………SO (25) are turned ON, and SO (26, 21) are turned OFF.
SO3()=15 ………
SO (33, 32, 31, 30) are turned ON, and SO (37, 36, 35, 34) are turned OFF.
SO(37,35,27,20)=A ………
The lower 4 bits of integer-converted variable A are output to SO (37, 35,
W 27, 20).

X
Functions
Y
Format
1. LET expression = SOm (b, ..., b)
Z 2. LET expression = SO (mb, ..., mb)

Explanation Indicates SO port output status.

Sample Description
A%= SO2() ………
Output status of ports SO(27) to SO(20) is assigned to variable A%.
A%= SO0(6, 5, 1) ……… Output status of SO(06), SO(05) and SO(01) is assigned to variable A%.
(If all above signals are 1(ON), then A%=7.)
A%= SO(37,35,27,10)………
Output status of S0(37), SO(35) , SO(27) and S0(10) is assigned to
variable A%.(If all above signals except S0(27) are 1 (ON), then A%=13.)

Related commands RESET, SET

8-184 Chapter 8 Robot Language


SO
8
Functions

Format
1. LET SOm (b, ..., b)
2. LET SO (mb, ..., mb)
N
Explanation Indicates SO port output status.

O
Sample Description
A%= SO2() ………
Output status of ports SO(27) to SO(20) is assigned to
variable A%. P
A%= SO0(6, 5, 1) ………
Output status of SO(06), SO(05) and SO(01) is assigned to
variable A%.
(If all above signals are 1(ON), then A%=7.) Q
A%= SO(37,35,27,10) ………
Output status of S0(37), SO(35) , SO(27) and S0(10) is
assigned to variable A%.
(If all above signals except S0(27) are 1 (ON), then R
A%=13.)

Related commands RESET, SET


S

Robot language list 8-185


126 SOD
8 Outputs a specified serial output's double-word information or acquires the output status

Format

LET SOD(m) = expression

N Notation Value Range


m port number 2, 4, 6, 8, 10, 12, 14 (*1)

O Integer value (If real number is specified, rounds to an integer.)


Bits that exceed the number of bits required for the assignment destination are
discarded.
Expression (*2)
P (If the port number is specified, the lower 8 bits are valid.
If the number of bit specified on bit definition is 1 to 8, the lower 1 to 8 bit
corresponding to the bits specified on the left side are valid.)
Q *1) When SIOW extension is enabled, the range of port number is extended to 2, 4, 6 -14, 24, 26, 28 -126.
For details, refer to RCX3 user's /operator’s manual "Option board related parameters".
*2) The output range is -2,147,483,648(&H80000000) to 2,147,483,647(&H7FFFFFFF).
R
Explanation Outputs the value to the SOD port specified by "m".
S

T • The information is handled as signed double word data.


• If a serial port does not actually exist, the information is not output externally
• The lower port number data is placed at the lower address.
U For example, if SOW(2) =&H2345,SOW(3) =&H0001, then SOD(2) =&H00012345.

V
Sample Description
SOD(2)=&H12345678 ………
Outputs &H12345678 to SOD(2).
W SOD(4)=1048575 ………
Outputs 1048575(&HFFFFF) to SOD(4).
SOD(2)=A% ………
Outputs the value of variable A% to SOD(2).

Y
Functions

Z Format

LET expression = SOD(m)

Notation Value Range


m Port Number 2, 4, 6, 8, 10, 12, 14

Explanation Acquires the SOD port output status specified by "m".

Sample Description
A%=SOD(2) ………
The output status of SOD(2) is assigned to variable A%.

Related commands SOW

8-186 Chapter 8 Robot Language


127 SOW
Outputs a specified serial output's word information or acquires the output status 8

Format

LET SOW(m) = expression

Notation Value Range N


m port number 2 to 15*
Integer value (If real number is specified, rounds to an integer.) O
Bits that exceed the number of bits required for the assignment destination are
discarded.
Expression
(If the port number is specified, the lower 8 bits are valid. P
If the number of bit specified on bit definition is 1 to 8, the lower 1 to 8 bit
corresponding to the bits specified on the left side are valid.)
*When SIOW extension is enabled, the range of port number is extended to 2 -15, 24 - 127. Q
For details, refer to RCX3 user's /operator’s manual "Option board related parameters".

R
Explanation Outputs the value to the SOW port specified by "m".

The output range is 0 (&H0000) to 65535 (&HFFFF). S


Note that if a negative value is output, the low-order word information will be output after being
converted to hexadecimal.
T
Example: SOW(2)=-255
The contents of -255 (&HFFFFFF01) are assigned to SOW (2).
-255 is a negative value, so the low-order word information (&HFF01) is assigned. U

• The information is handled as unsigned word data. V


• If a serial port does not actually exist, the information is not output externally.
• If a value exceeding the output range is assigned, the low-order 2-byte information is output.
W
Sample Description
SOW(2)=&H0001 ………
Outputs &H0001 to SOW(2).
SOW(3)=255 ………
Outputs 255(&H00FF) to SOW(3). X
SOW(15)=A% ………
The contents of variable A% are assigned in SOW (15). If the
variable A% value exceeds the output range, the low-order word
information will be assigned. Y

Z
Functions

Format

LET expression = SOW(m)

Explanation Acquires the SOW port output status specified by "m".

Sample Description
A%=SOW(2) ………
The output status of SOW (2) is assigned to variable A%.

Related commands SOD

Robot language list 8-187


128 SPEED
8 Changes the program movement speed

Format

SPEED [robot number] expression

N Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.)
O Expression 1 to 100 (units: %)

P Explanation Changes the program movement speed to the value indicated by <expression>.
This speed change applies to all robot axes and auxiliary axes of the specified robot.

Q The operation speed is determined by multiplying the automatic movement speed (specified from the
programming box and by the ASPEED command), by the program movement speed (specified by SPEED
R command).
Operation speed = automatic movement speed × program movement speed
Example:
S Automatic movement speed ... 80%
Program movement speed ... 50%

T Movement speed = 40% (80% × 50%)

n NOTE
• Automatic movement speed
U Specified by programming box operation or by the ASPEED command
• Program movement speed
Specified by SPEED commands or MOVE, DRIVE speed options.
V

W Sample Description
ASPEED 100 ………
Changes the Automatic movement speed of robot 1 to 100%.
SPEED 70 ………
Changes the Program movement speed of robot 1 to 70%.
X MOVE P,P0 ………
Moves robot 1 from current position to P0 at a speed of 70%
(=100 × 70).
SPEED 50 ………
Changes the Program movement speed of robot 1 to 50%.
Y MOVE P,P1 ………
Moves robot 1 from current position to P1 at a speed of 50%
(=100 × 50).
MOVE P,P2,S=10 ………
Moves robot 1 from current position to P2 at a speed of 10%
Z (=100 × 10).
HALT

Related commands ASPEED

8-188 Chapter 8 Robot Language


129 SQR
Acquires the square root of a specified value 8

Format

SQR(expression)

Value Range N
Expression 0 or positive number.
O
Explanation Gives the square root of the <expression> value. An error occurs if the <expression> value is a negative
number. P

Sample Description
Q
A=SQR(X^2+Y^2) ………
The square root of X^2+Y^2 is assigned to variable A.
R

Robot language list 8-189


130 START
8 Starts a new task

Format

START <program name> ,Tn, p


PGm
N
Notation Value Range
O m Program Number 1 to 100
n Task Number 1 to 16

P p Task priority ranking 1 to 64

Q Explanation Starts task "n" specified by the program with the "p" priority ranking.
The program name must be enclosed in < > (angle brackets).
R
Priority ranking
The smaller the priority number, the higher the priority (high priority: 1 to low priority: 64).
S If a priority ranking is not specified, "32" is adopted as the priority ranking for this task.

T If task number "n" is omitted;


The task with the smallest number among the tasks yet to be started is automatically specified.

U If a higher ranked task is RUNNING;


All tasks with lower priority also remain in READY status.

W Sample Description

START <SUB _ PGM>,T2 …Registers the task program SUB _ PGM in task No. 2 and starts it.
X *ST: …Defines Main program *ST
MOVE P,P0,P1
GOTO *ST
Y HALT
Program name:SUB _ PGM
‘SUBTASK ROUTINE (Comment) Subtask routine
Z *SUBTASK: …Defines Task program *SUBTASK
P100 = WHERE
IF LOC3(P100) > 10000 THEN
DO(20) = 1
ELSE
DO(20) = 0
ENDIF
GOTO *SUBTASK
EXIT TASK …Exits the task program SUB _ PGM

Related commands CUT, EXIT TASK, RESTART, SUSPEND, CHGPRI

8-190 Chapter 8 Robot Language


131 STR$
Converts a numeric value to a character string 8

Format

STR$(expression)

N
Explanation Converts the value specified by the <expression> to a character string. The <expression> specifies an
integer or real value.
O

Sample P
B$=STR$(10.01)

Q
Related commands VAL
R

Robot language list 8-191


132 SUB to END SUB
8 Defines a sub-procedure

Format
SUB label (dummy argument, dummy argument...)
command block
N END SUB

O
Explanation Defines a sub-procedure.
The sub-procedure can be executed by a CALL statement. When the END SUB statement is executed,
P the program jumps to the next command after the CALL statement that was called. Definitions are as
follows.

Q 1: All variables declared within the sub-procedure are local variables, and these are valid only within
the sub-procedure. Local variables are initialized each time the sub-procedure is called up.
R 2: Use a SHARED statement in order to use global variables (program level).
3: Use a <dummy argument> when variables are to be passed on. If two or more dummy arguments are
used, separate them by a comma ( , ).
S 4: A valid <dummy argument> consists of a name of variable and an entire array (array name followed
by parentheses). An error will occur if array elements (a <subscript> following the array name) are

T specified.

U • Sub-procedures cannot be defined within a sub-procedure.


• A label can be defined within a sub-procedure, but it cannot jump (by a GOTO or GOSUB statement) to a label
V outside the sub-procedure.
• Local variables cannot be used with PRINT and SEND statements.

Sample 1 Description
X
A=1
CALL *TEST ………Calls sub-procedure *TEST
Y PRINT A
HALT
’SUB ROUTINE: TEST (Comment: Sub-procedure name is “TEST”)
Z SUB *TEST ………Defines sub-procedure *TEST (NOTE)
A=50

END SUB ………Ends the definition of the sub-procedure


(NOTE) Handled as a different variable than the "A" shown above.

In the above example, the program level variable "A" is unrelated to the variable "A" within the sub-procedure.
Therefore, the value indicated in the 3rd line PRINT statement becomes "1".

8-192 Chapter 8 Robot Language


127 SUB to END SUB
8
Sample 2 Description
X% = 4
Y% = 5
CALL *COMPARE(REF X%, REF Y%) …Calls sub-procedure *COMPARE (pass by reference)
PRINT X%,Y% …
The value of X% is changed to 5 and the value of Y%
Z% = 7 is changed to 4. (Changes value in sub-procedure => N
W% = 2 Changes value of variable)
CALL *COMPARE(REF Z%, REF W%) …Calls sub-procedure *COMPARE (pass by reference)
PRINT Z%,W% …
The value of Z% remains 7 and the value of W% remains 2 O
HALT (
No change in value; Comparison in sub-procedure is
false and command is not executed)
’SUB ROUTINE: COMPARE (Comment: Sub-procedure name is “COMPARE”) P
SUB *COMPARE(A%, B%) …Starts defining sub-procedure *COMPARE
IF A% < B% THEN
TEMP% = A% Q
A% = B%
B% = TEMP%
ENDIF R
END SUB …Finishes defining sub-procedure

In the above example, different variables are passed along as arguments to call the sub-procedure 2 times. T

U
Related commands CALL, EXIT SUB, SHARED
V

Robot language list 8-193


133 SUSPEND
8 Temporarily stops another task which is being executed

Format

SUSPEND Tn
<program name>
N
PGm

O Notation Value Range


n Task Number 1 to 16
P m Program Number 1 to 100

Q Explanation Temporarily stops (suspends) another task which is being executed.

R • A task can be specified by the name or the number of a program in execution.


• This statement can also be used for tasks with a higher priority ranking than this task itself.
• The program name must be enclosed in < > (angle brackets).
S

T If a task (program) not active is specified for the execution, an error occurs.

U
Sample Description

V Main Task
START <SUB _ PGM>,T2 ……Registers SUB _ PGM in Task 2 and starts it
SUSFLG=0 ……Turns OFF SUSFLG
W *L0:
MOVE P,P0
MOVE P,P1 ……Waits until SUSFLG turns ON
X WAIT SUSFLG=1 ……Pauses Task 2
SUSPEND T2 ……Turns OFF SUSFLG
SUSFLG=0
Y GOTO *L0
HALT

Z ’SUBTASK ROUTINE
*SUBTASK:
Sub Task (Program name: SUB _ PGM)

WAIT SUSFLG=0 ……Waits until SUSFLG turns OFF


DO2(0)=1
DELAY 1000
DO2(0)=0
DELAY 1000
SUSFLG=1 ……Turns ON SUSFLG
GOTO *SUBTASK ……Jumps to *SUBTASK
EXIT TASK ……Exits Task 2 (own task: *SUBTASK)

Related commands CUT, EXIT TASK, RESTART, SUSPEND

8-194 Chapter 8 Robot Language


134 SWI
Switches the program being executed 8

Format

SWI <program name>

N
Explanation This statement switches from the current program to the specified program, starting from the first line.

O
• Although the output variable status is not changed when the program is switched,
the dynamic variables and array variables are cleared.
• The program name must be enclosed in < > (angle brackets). P

Q
If the program specified as the switching target does not exist, a "3.203: Program doesn't exist" (code: &H0003
&H00CB) error occurs and operation stops. R

S
Sample Description

MOVE P,P1 T
SWI <TEST2> ………
Switches the execution program to TEST 2.

U
Task No. Program Name Task No. Program Name
3 TEST 1 3 TEST 2
V
Executing
: :
SWI
TEST 2 is executed at Task No. 3. W

Robot language list 8-195


135 TAN
8 Acquires the tangent value for a specified value

Format

TAN(expression)

N Value Contents
Expression Angle (units: radians)
O
Explanation Gives a tangent value for the <expression> value.
P An error will occur if the <expression> value is a negative number.

Q Sample Description
A(0)=B-TAN(C) ………
The difference between the tangent values of variable B
R and variable C is assigned to array A (0).
A(1)=TAN(DEGRAD(20)) ………
The 20.0° tangent value is assigned to array A (1).

S
Related commands ATN, COS, DEGRAD, RADDEG, SIN
T

8-196 Chapter 8 Robot Language


136 TCOUNTER
Timer & counter 8

Format

TCOUNTER

N
Explanation Outputs count-up values at 1ms intervals starting from the point when the TCOUNTER variable is reset.
After counting up to 2,147,483,647, the count is reset to 0.
O

Sample Description P
MOVE P,P0
WAIT ARM
RESET TCOUNTER
Q
MOVE P,P1
WAIT ARM
A = TCOUNTER
R
PRINT TCOUNTER ………
Displays the P0 to P1 movement time until the axis enters the
tolerance range on the programming box.
S

Related commands RESET T

Robot language list 8-197


137 TIME$
8 Acquires the current time

Format

TIME$

N
Explanation Acquires the current time in an hh:mm:ss format character string.
( "hh" is the hour, "mm" is the minutes, and "ss" is the seconds. )
O
The clock can be set in the SYSTEM mode's initial processing.

P
Sample Description

Q A$=TIME$ ………
Assigns the current time to the character type variable A$
as a character string in the format of hh: mm: ss.
PRINT TIME$ ………
Displays the current time on the programming box etc.
R in the format of hh: mm: ss

S Related commands DATE$, TIMER

8-198 Chapter 8 Robot Language


138 TIMER
Acquires the current time 8

Format

TIMER

N
Explanation Acquires the current time in seconds, counting from midnight. This function is used to measure a
program's run time, etc.
O
The clock can be set in the SYSTEM mode's initial processing.

c CAUTION
The time indicated by the internal clock may differ somewhat from the actual time. P

Q
Sample Description
A%=TIMER ………
Assigns the current time to the integer variable A% R
FOR B=1 TO 10 in seconds from midnight
MOVE P,P0
MOVE P,P1 S
NEXT
A%=TIMER-A% ………Assigns current time - A% to the variable A%
PRINT A%/60;":";A% MOD 60 ………“A% ÷ 60: A% ÷ 60” is displayed T
HALT

U
Related commands TIME$
V

Robot language list 8-199


139 TO
8 Outputs a specified value to the TO port or acquires the output status

Format
1. LET TOm(b, ..., b) = expression
2. LET TO (mb, ..., mb) = expression
N
Notation Value Range
m Port Number 0, 1
O
 to 7 (If omitted, all 8 bits are processed.)
0
b bit Definition If multiple bits are specified, they are expressed from the left in descending order
P (high to low).

Integer value (If real number is specified, rounds to an integer.)


Q Bits that exceed the number of bits required for the assignment destination are
discarded.
Expression
(If the port number is specified, the lower 8 bits are valid.
If the number of bit specified on bit definition is 1 to 8, the lower 1 to 8 bit
R corresponding to the bits specified on the left side are valid.)

Explanation Outputs the specified value to the TO port. The output value is the <expression>'s integer-converted
S lower bits corresponding to the bit definition specified at the left side.

T The OFF/ON settings for bits which are being used in a SEQUENCE program have priority while the
SEQUENCE program is running.
Sample
U TO0() = &B00000110

V
Functions

W Format
1. LET expression = TOm (b, ..., b)

X 2. LET expression = TO (mb, ..., mb)

Notation Value Range


Y m Port Number 0, 1
 to 7 (If omitted, all 8 bits are processed.)
0
Z b bit Definition If multiple bits are specified, they are expressed from the left in descending
order (high to low).

Explanation Indicates the parallel port signal status.

Sample Description
A%= TO0() ………
Output status of ports TO(07) to TO(00) is assigned to variable A%.
A%= TO0(6, 5, 1) ………Output status of TO(06), TO(05) and TO(01) is assigned to variable A%.
(If all above signals are 1(ON), then A%=7.)
A%=TO(17, 15, 00) ………
Output status of T0(17), TO(15) and T0(00) is assigned to variable A%.
(If all above signals except T0(15) are 1 (ON), then A%=5.)

Related commands RESET, SET

8-200 Chapter 8 Robot Language


140 TOLE
Specifies/acquires the tolerance parameter 8

Format

1. TOLE [robot number] expression


2. TOLE [robot number] (axis number) = expression
N
Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.) O
Axis Number 1 to 6
Expression Varies according to the motor which has been specified (unit: pulse) P
Explanation Change the "tolerance" parameter of the specified axis to the <expression> value (unit: pulse).
Q
Format 1: The change is applied to all axes of the specified robot.
Format 2: The change is applied to only the axis specified by the <axis number> of the specified robot. R

S
This statement is executed after positioning of the specified axes is complete (within the tolerance range).

T
Functions
U
Format

TOLE [robot number] (axis number) V

Value Range
W
Robot Number 1 to 4 (If not input, robot 1 is specified.)
Axis Number 1 to 6
X
Explanation Acquires the "tolerance" parameter values for the axis specified by <axis number>.
Y

Sample Description Z
’CYCLE WITH DECREASING TOLERANCE
DIM TOLE(5)
FOR A=200 TO 80 STEP -20
GOSUB *CHANGE _ TOLE
MOVE P,P0
MOVE P,P1
NEXT A
C=TOLE(2)HALT ………
The tolerance parameter of axis 2 of robot 1 is assigned to
*CHANGE _ TOLE: variable C.
FOR B=1 TO 4
TOLE(B)=A
NEXT B
RETURN

Robot language list 8-201


141 TORQUE
8 Specifies/acquires the maximum torque command value

Format

TORQUE [robot number](axis number) = expression

N Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.)
O Axis Number 1 to 6
Expression 1 to 100 (units: %)

P
Explanation Changes the maximum torque command value of the specified axis to the <expression> value. The new
value is valid when the next movement command (MOVE or DRIVE statement, etc.) is executed. The
Q parameter value does not change.

R The conditions to cancel a torque limit are as follows.


• The TORQUE command for the same axis is executed.
• The controller power turned off and then on again.
S • The axis polarity parameter is changed or the parameter is initialized.
• The servo is turned off.

T
The maximum torque command value becomes temporarily invalid in execution below.
• Return- to-origin is in execution.
U • The PUSH statement is in execution.
Only the torque value in the moving direction is changed to the value specified by the PUSH statement,
the value in the opposite direction is hold and not changed.
V
After these movements, the value backs to the maximum torque command value when a next movement
W command (MOVE statement, for example) is executed.

X
c CAUTION
• If the specified torque limit is too small, the axis may not move. Never enter within the robot movement range
to avoid danger even though the robot is in stop status. In this case, press the emergency stop button before
proceeding with the operation.

Y • If the specified value is less than the rated torque, an error may not occur even if the robot strikes an obstacle.

Z
• TORQUE statement limits the torque in the both (rotation and opposite) direction of axis.
• PUSH statement limits the torque in its rotation direction only.

8-202 Chapter 8 Robot Language


136 TORQUE
8
Functions

Format

TORQUE [robot number](axis number)

N
Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.)
Axis Number 1 to 6 O

P
Explanation Acquires the maximum torque command value for the axis specified by <axis number>.

Q
Sample Description

TORQUE (1) = 50 ………


Changes the max. torque of axis 1 of robot 1 to 50%. R
………
Moves the axis 1 of robot 1 from its current position to the
DRIVE (1,P1) point specified by P1.
(Changes the max. torque at the same time with the start of S
the movement.)
………
Waits for the completion of an operation of axis 1 of robot 1.
WAIT ARM ………
Returns the max. torque of axis 1 of robot 1 to the original T
value (100%).
TORQUE (1) = 100 ………
Moves the robot 1 from its current position to the point
specified with P0. U
MOVE P,P0 (Returns the max. torque of axis 1 to the original value
(100%) at the same time with the start of a movement.)
V

Related commands CURTRQ, PUSH W

Robot language list 8-203


142 TSKPGM
8 Acquires the program number which is registered in a specified task number

Format

TSKPGM (task number)

N Value Meaning
Task Number Task number which acquires the program number
O
Explanation Acquires the program number which is registered in the task specified by the <task number>.
P

Sample Description
Q
A=TSKPGM(1) ………
Assigns a program number registered in task 1 to variable A.

R
Related commands PGMTSK, PGN

8-204 Chapter 8 Robot Language


143 VAL
Converts character strings to numeric values 8

Format

VAL (character string expression)

N
Explanation Converts the numeric value of the character string specified in the <character string expression> into an
actual numeric value.
O
•The value may be expressed in integer format (binary, decimal, hexadecimal), or real number format
(decimal point format, exponential format). P
•The VAL value becomes "0" if the first character of the character string is "+", "-", "&" or anything other
than a numeric character.
•If there are non-numeric characters or spaces elsewhere in the character string, all subsequent
Q
characters are ignored by this function.
However, for hexadecimal expressions, "A" to "F" are considered numeric characters. R
[Integer] Hexadecimal format: &Hnnnn
Decimal format: nnnn S
Binary format: &Bnnnn

T
[Real number] Decimal point format: nnn.nnn
Exponential format: nnEmm
U

Sample
V
A=VAL("&B100001")

Robot language list 8-205


144 WAIT
8 Waits until the conditional expression is met

Format

WAIT conditional expression , expression

N Value Range/Description
conditional expression Specify with Input/Output signals or variables
O Expression 0 to 2147483647 (units: ms)

P Explanation Waits until the <conditional expression> is met.


Set the time-out period (unit: ms) in the <expression>.

Q •T
 his command will terminate if the time-out period elapses before the WAIT condition is met.
•T
 he minimum wait time is 1ms but changes depending on the execution status of other tasks.
R
c CAUTION
If the time-out setting is omitted, robot will stop without alarm unless you stop the program from the outside (by
an interlock or an emergency stop, etc.) while the conditional expression is not met.
S

T
When the conditional expression is a numeric expression, an expression value other than "0" indicates TRUE status,
and "0" indicates FALSE status.
U

V
Sample Description
WAIT A=10 ………
Wait status continues until variable A becomes 10.
W WAIT DI2( )=&B01010110 ………
Waits until DI(21),(22),(24),(26) are turned on, and
DI(20),(23),(25),(27) is turned off.
WAIT DI2(4,3,2)=&B101 ………
Waits until DI(22) and DI(24) are turned on, and DI(23)
X is turned off.
WAIT DI(31)=1 OR DO(21)=1 ………
Wait status continues until either DI (31) or DO(21)
turns ON.
Y WAIT DI(20)=1,1000 ………
Wait status continues until DI(20) turns ON. If DI(20)
fails to turn ON within 1 second, the command is
terminated.
Z WAIT END _ SENSOR = 1 ………
IO Name* Waits until "END _ SEMSOR" is turned on.
* IO Name: Users can name specific bits of DI and DO as they desire.

IO Name can be added and edited on the support software only (not with a programming box)

Related commands DRIVE, DRIVEI, MOVE, MOVEI, MOVET

8-206 Chapter 8 Robot Language


145 WAIT ARM
Waits until the robot axis operation is completed 8

Format

WAIT ARM [robot number] (axis number)

Value Range
N
Robot Number 1 to 4 (If not input, robot 1 is specified.)
Axis Number 1 to 6 (• Multiple axes not specifiable • If not input, all axes are specified.) O

Explanation Establishes "wait" status until the axis movement is completed (is positioned within the tolerance range). P

Sample Description
Q
WAIT ARM ………
Waits for the movement completion of robot 1.
WAIT ARM[2](2) ………
Waits for the movement completion of axis 2 of robot 2. R

S
Related commands DRIVE, DRIVEI, MOVE, MOVEI, MOVET, PMOVE

Robot language list 8-207


146 WEIGHT
8 Specifies/acquires the tip weight (kg) parameter

Format

WEIGHT [robot number] expression

N Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.)
O Expression The range varies according to the robot which has been specified.

P Explanation Changes the "tip weight (kg)" parameter of the robot to the <expression> value.
This change does not apply to auxiliary axes.

R
Functions

S Format

WEIGHT [robot number]


T
Value Range

U Robot Number 1 to 4 (If not input, robot 1 is specified.)

Explanation Acquires the "tip weight (kg)" parameter value of the robot specified by <robot number>.
V

W Sample Description
A=5

X
B=2
C=WEIGHT ………
The tip weight(kg) parameter of robot 1 is assigned to variable C.
WEIGHT A ………
The tip weight(kg) parameter of robot 1 is changed to value (5) of

Y
variable A.
MOVE P,P0
WEIGHT B ………
The tip weight(kg) parameter of robot 1 is changed to value (2) of

Z
variable B.
MOVE P,P1
WEIGHT C ………
The tip weight(kg) parameter of robot 1 is replaced to the origin
value (the value of variable C).
D=WEIGHT ………
The tip weight(kg) parameter of robot 1 is assigned to variable D.
HALT

If both of Tip weight parameters; <WEIGHT> and <WEIGHTG> are set, a total value will be set.

Related commands WEIGHTG

8-208 Chapter 8 Robot Language


147 WEIGHTG
Specifies/acquires the tip weight (g) parameter 8

Format

WEIGHTG [robot number] expression

Value Range
N
Robot Number 1 to 4 (If not input, robot 1 is specified.)
Expression The range varies according to the robot which has been specified. O

Explanation Changes the "tip weight (g)" parameter of the robot to the <expression> value. P
This change does not apply to auxiliary axes.

R
Functions
S
Format

WEIGHTG [robot number] T

Value Range
U
Robot Number 1 to 4 (If not input, robot 1 is specified.)

Explanation Acquires the "tip weight (g)" parameter value of the robot specified by <robot number>.
V

W
Sample Description
A=5
B=2
X
C=WEIGHTG ………
The tip weight(g) parameter of robot 1 is assigned to variable C.
WEIGHTG A ………
The tip weight(g) parameter of robot 1 is changed to value (5) of
variable A.
Y
MOVE P,P0
WEIGHTG B ………
The tip weight(g) parameter of robot 1 is changed to value (2) of
variable B.
Z
MOVE P,P1
WEIGHTG C ………
The tip weight(g) parameter of robot 1 is replaced to the origin value
(the value of variable C).
D=WEIGHTG ………
The tip weight(g) parameter of robot 1 is assigned to variable D.
HALT

If both of Tip weight parameters; <WEIGHT> and <WEIGHTG> are set, a total value will be set.

Related commands WEIGHT

Robot language list 8-209


148 WEND
8 Ends the WHILE statement's command block

Format
WHILE conditional expression
command block
N WEND

O
Explanation Ends the command block which begins with the WHILE statement. A WEND statement must always be
paired with a WHILE statement.
P Jumping out of the WHILE to WEND loop is possible by using the GOTO statement, etc.

Q Sample Description
A=0
R WHILE DI3(0)=0 ………Repeats between WHILE and WEND while DI3(0) is OFF
A=A+1
MOVE P,P0
S MOVE P,P1
PRINT "COUNTER=";A
WEND ………Ends the command block of WHILE statement
T HALT

U Related commands WHILE

8-210 Chapter 8 Robot Language


149 WHERE
Acquires the arm's current position (pulse coordinates) 8

Format

WHERE [robot number]

Value Range
N
Robot Number 1 to 4 (If not input, robot 1 is specified.)
O
Explanation Acquires the arm’s current position in the joint coordinates.
P

Sample Description
Q
P10=WHERE ………
The current position's pulse coordinate value of robot 1 is
assigned to P10.
R

Related commands WHRXY


S

Robot language list 8-211


150 WHILE to WEND
8 Repeats an operation for as long as a condition is met

Format

WHILE conditional expression


command block
N
WEND

O
Explanation Executes the command block between the WHILE and WEND statements when the condition specified
P by the <conditional expression> is met, and then returns to the WHILE statement to repeat the same
operation.
When the <conditional expression> condition is no longer met (becomes false), the program jumps to
Q the next command after the WEND statement.
If the <conditional expression> condition is not met from the beginning (false), the command block
R between the WHILE and WEND statements is not executed, and a jump occurs to the next statement
after the WEND statement.
Jumping out of the WHILE to WEND loop is possible by using the GOTO statement, etc.
S

T When the conditional expression is a numeric expression, an expression value other than "0" indicates TRUE status,
and "0" indicates FALSE status.

Sample 1 Description
V
A=0
WHILE DI3(0)=0 ………Repeats between WHILE and WEND while DI3(0) is OFF
W A=A+1
MOVE P,P0
MOVE P,P1
X PRINT "COUNTER=";A
WEND ………Ends the command block of WHILE statement
HALT
Y
Sample 2 Description
Z A=0
WHILE -1 ………
Becomes an endless loop because the conditional expression is always
TRUE (other than 0).
A=A+1
MOVE P,P0
IF DI3(0)=1 THEN *END
MOVE P,P1
PRINT "COUNTER=";A
IF DI3(0)=1 THEN *END
WEND ………Ends the command block of WHILE statement
*END
HALT

8-212 Chapter 8 Robot Language


151 WHRXY
Acquires the arm's current position in Cartesian coordinates 8

Format

WHRXY [robot number]

Value Range
N
Robot Number 1 to 4 (If not input, robot 1 is specified.)
O
Explanation Acquires the arm’s current position in the Cartesian coordinates.
P

For YK-TW robot, the first and the second arm rotation information is also acquired. Q

R
Sample 1 Description
P10=WHRXY ………
The current position Cartesian coordinate value of robot 1 is
assigned to P10.
S

T
Sample 2 Description
LOC3(P10)=LOC3(WHRXY) ………
The current position data of the third axis is assigned to
the third axis at P10 in the cartesian coordinate system. U

V
Related commands WHERE

Robot language list 8-213


152 WRKDEF
8 Defines the work data (creates the work data of the specified number)

Format

Statement for Definition:


WRKDEF Wn = 
X-coordinate Offset Y-coordinate Offset
N
Z-coordinate Offset R-coordinate Offset
Statement for Selection:
O
CHGWRK [robot number]

P Notation Value Range Unit


Robot Number 1 to 4 (If not input, robot 1 is specified.)
Q n Work Number 0 to 39
X-coordinate Offset mm
R Y-coordinate Offset Numeric value consisting of an integer portion of up to 4 digits mm
Z-coordinate Offset and having 3 or less places below the decimal point mm

S R-coordinate Offset degree

T Explanation WRKDEF statement defines the work data.

Note that this command executes the definition only.


U Use the CHGWRK statement to actually switch the work data.

Reference "CHGWRK"
V Operation Manual "Work definitions"

X "9.708: Work data destroyed" error may occur if the power of controller is turned off during the execution of WRKDEF.

Y
● Parameter Value
X-coordinate Offset : The offset amount from the robot tip (the tool tip; in use of the hand data) of the work "n" on
Z X-coordinates is specified in real number.
Y-coordinate Offset : The offset amount from the robot tip (the tool tip; in use of the hand data) of the work "n" on
Y-coordinates is specified in real number.
Z-coordinate Offset : The offset amount from the robot tip (the tool tip; in use of the hand data) of the work "n" on
Z-coordinates is specified in real number.
R-coordinate Offset : The angle of + X direction and the work "n" in the Cartesian coordinates is specified in real number
when the current position of the robot tip (the tool tip; in use of the hand data) is "0.000" on
R-coordinates.
Enter positive value in counterclockwise.

Related commands CHGWRK, CREWRK

8-214 Chapter 8 Robot Language


WRKDEF
8
Sample Description

CHANGE H1 ………
Changes the hand data of the robot 1 to hand 1.
MOVE P,P1 ………
Moves the hand 1 tip of the robot 1 to P1.
WRKDEF W1 = 115.000 -50.000 0.000 30.000
CHGWRK W1
MOVE P,P2
………
Changes the work data of the robot 1 to work 1.
………
Moves the work 1 tip of the robot 1 to P2.
N
HALT
O

SAMPLE: WRKDEF
P

Robot language list 8-215


153 XYTOJ
8 Converts the Cartesian coordinate data ("mm") to joint coordinate data ("pulse")

Format

XYTOJ [robot number] (point expression)

N Value Range
Robot Number 1 to 4 (If not input, robot 1 is specified.)
O
Explanation This function converts the Cartesian coordinate data (unit: mm, deg.) of <point expression>
P to the joint coordinate data (unit: pulse).
The data is converted based on the shift (offset) format that is already set; standard coordinates, shift
coordinates and hand definition.
Q
• On SCARA robots, the converted result differs depending on whether right-handed or left-handed is
R specified.
• On the YK-TW series, the result varies, depending on the first arm and the second arm rotation
information settings.
S • To convert joint coordinate data to Cartesian coordinate data, use the JTOXY statement.

T
Sample Description
P10=XYTOJ(P10) ………
P10 is converted to joint coordinate data of robot 1.
U

8-216 Chapter 8 Robot Language


Chapter 9
PATH Statements

1 1 Overview.................................................... 9-1
2 2 Features...................................................... 9-1
3 3 How to use................................................. 9-1
4 4 Cautions when using this function........... 9-2
1 Overview
8
This function moves the robot at a specified speed along a path composed of linear and circular segments. Because
speed fluctuations during movement are minimal, the PATH function is ideal for applications such as sealing, etc.

2 Features
10
• Moves the robot at a constant speed along the entire movement path (except during acceleration from a stop, and
during deceleration just prior to the operation end).
• Permits easy point teaching because the robot speed is not affected by the point teaching positions' level of precision.
• Permits movement speed changes for the entire movement path, or speed changes for only one portion of the path 11
(using the speed option).
• Using the DO option permits signal outputs to a specified port at any desired position during movement.

12

3 How to use
13
The following robot language commands must be used as a set in order to use the PATH function.

• PATH SET Starts path setting.


• PATH (PATH L, PATCH C) Specifies the path to be used.
• PATH END Ends path setting.
• PATH START Starts actual movement along the path.

As shown below, the motion path is specified between the PATH SET and PATH END statements.
Simply specifying a path, however, does not begin robot motion.
Robot motion only occurs when the PATH START statement is executed after the path setting procedure has been
completed.

Sample Description

MOVE P,P0,Z=0 …………Start of robot 1's path setting


PATH SET
PATH L,P1,DO(20)[email protected]
PATH L,P2
:
:
:
PATH C,P12,P13
PATH L,P14,DO(20)[email protected]
PATH END …………End of robot 1's path setting
MOVE P,P1,Z=0
:
:
:
MOVE P,P0,Z=0
PATH START …………Executiong Path motion of robot 1
HALT

Overview 9-1
4 Cautions when using this function
8
• Paths may comprise no more than 1000 points (total) linear and circular segments. 1 point forms 1 linear segment by
PATH L command and 2 points form 1 circular segment by PATH C command.

9 Number of points specified by PATH L +


Number of points specified by PATH C

≦ 1000

• The robot must be positioned at the path start point when PATH motion is executed (by PATH START statement).
10 • At points where circular and linear segments connect, the motion direction of the two connecting segments should be
a close match (as close as possible). An excessive difference in their motion directions could cause vibration and robot
errors.

11 Circular and linear segment connection point:


if there is a large difference between the motion directions of the connecting segments

Good example Poor example

12

13 • Where a linear segment connects to another linear segment, the motion path passes to the inner side of the connection
point. Moreover, as shown in fig. (1) below, the faster the speed, the further to the inner side the path becomes. To
prevent significant speed-related path shifts, add more points as shown in fig. (2). Note also, that in some cases, the
speed may have to be reduced in order to prevent errors from occurring.
Linear segments connection point: Prevents a deviation
Low speed Increase the number
High speed of points

(1) (2)

• If an error occurs due the robot's inability to move at the specified speed:
• Robot acceleration/deceleration occurs if the speed setting is changed when PATH motion begins, stops, or at some
point along the path. At such times, an error may occur before motion begins if the distance between points is too
short for the specified speed to be reached. In such cases, a slower speed must be specified. If the error still occurs
after the speed is lowered, adjust the PATH points to increase the length of the linear or circular segments which
contain acceleration or deceleration zones.
• The hand system used during PATH motion must be the same as the hand system used at the path's start point. The
same applies if the path is to pass through points where hand flags are set. Differing hand systems will cause an error
and disable motion.
• The first arm and second arm rotation information during PATH movement must be the same as the first arm and
second arm rotation information at the PATH movement's START point. If the two are different, an error will occur
and movement will be disabled.
• If the robot is stopped by a stop signal, etc., during PATH motion, this is interpreted as an execution termination, and
the remaining path motion will not be completed even if a restart is executed.
• Only the X, Y and Z coordinate values among the specified points are valid for PATH motion.
Any other coordinates use the coordinate values at the START point of the PATH motion; R-axis can not be moved to
the specified point even if it is used.

9-2 Chapter 9 PATH Statements


Chapter 10
Data file description

1 Overview...................................................... 10-1
2 Program file.................................................. 10-3
3 Point file........................................................ 10-5
4 Point comment file...................................... 10-8
5 Point name file........................................... 10-10
6 Parameter file............................................ 10-12
7 Shift coordinate definition file................... 10-16
8 Hand definition file.................................... 10-18
9 Work definition file..................................... 10-20
10 Pallet definition file.................................... 10-22
11 General Ethernet port file.......................... 10-26
12 Input/output name file.............................. 10-28
13 Area check output file.............................. 10-32
14 Real time output file.................................. 10-34
15 All file.......................................................... 10-38
16 Program directory file............................... 10-40
17 Parameter directory file............................ 10-42
18 Machine reference file............................. 10-43
19 Accumulated data file.............................. 10-45
20 System configuration information file...... 10-46
21 Version information file............................. 10-47
22 Option board file....................................... 10-48
23 Self check file............................................ 10-49
24 Alarm history file........................................ 10-50
25 Remaining memory size file..................... 10-52
26 Variable file................................................ 10-53
27 Constant file............................................... 10-59
28 Array variable file...................................... 10-60
29 DI file........................................................... 10-62
30 DO file......................................................... 10-64
31 MO file........................................................ 10-66
32 LO file.......................................................... 10-68
33 TO file.......................................................... 10-70
34 SI file............................................................ 10-72
35 SO file.......................................................... 10-74
36 SIW file........................................................ 10-76
37 SOW file...................................................... 10-78
38 EOF file........................................................ 10-80
39 Serial port communication file................. 10-81
40 Ethernet port communication file............ 10-82
1 Overview
7
1.1 Data file types
This section explains data files used with a SEND statement and READ/WRITE online commands.
Definition Format Read-
8
Type File Name Write
All Individual File out

User All file ALL --------------- 3 3

9
<bbbbbbbb>
Program PGM 3 3
PGn
Point PNT Pn 3 3
Point comment PCM PCn 3 3
Point name PNM PNn 3 3
/cccccccc/
Parameter PRM #cccccccc#
\cccccccc\
3 3
10
Shift coordinate definition SFT Sn 3 3
Hand definition HND Hn 3 3
Work definition WRKDEF Wn 3 3

Pallet definition PLT PLn 3 3


11
General Ethernet Port GEP GPn 3 3
Input/output name ION iNMn(n) 3 3
Area check output ACO ACn 3 3
Real time output RTO RTn 3 3
Variable,
Variable
Array variable
VAR
ARY
ab...by
ab...by(x)
3
3
3
3
12
Constant
Constant ---------- “cc...c” 3 -
Program directory DIR <<bbbbbbbb>> 3 -
Status
Parameter directory DPM --------------- 3 -

13
sensor, stroke-end MRF --------------- 3 -
Machine reference
mark ARP --------------- 3 -
Accumulated data ACD --------------- 3 -
System configuration information CFG --------------- 3 -
Version information VER --------------- 3 -
Option board OPT --------------- 3 -
Self check SCK --------------- 3 -
Alarm history LOG --------------- 3 -
Remaining memory size MEM --------------- 3 -
Device DI port DI() DIn() 3 -
DO port DO() DOn() 3 3
MO port MO() MOn() 3 3
TO port TO() TOn() 3 3
LO port LO() LOn() 3 3
SI port SI() SIn() 3 -
SO port SO() SOn() 3 3
SIW port SIW() SIWn() 3 -
SOW port SOW() SOWn() 3 3
RS-232C CMU --------------- 3 3
Ethernet ETH --------------- 3 3
Other File END code EOF --------------- 3 -

n: Number a: Alphabetic character b: Alphanumeric character or underscore (_)


c: Alphanumeric character or special symbol x: Expression (array argument) y: Variable type
i: Input/output type
3: Permitted -: Not Permitted

Overview 10-1
Overview
7
1.2 Cautions
Observe the following cautions when handling data files.
8
• Only one-byte characters can be used.
• All data is handled as character strings conforming to ASCII character codes.
• Only upper-case alphabetic characters may be used in command statements (lower case characters are prohibited).
9 • Line lengths must not exceed 255 characters.
• A [cr/lf] data format designation indicates CR code (0Dh) + LF code (0Ah).
• The terms "reading out" and "writing" used in this manual indicate the following data flow;
Reading out: Controller → external communication device
10 Writing: External communication device → controller

11

12

13

10-2 Chapter 10 Data file description


2 Program file
7
2.1 All programs

8
Read-out 3 When used as a read-out file, all programs currently stored are read out.
Write 3 Write files are registered at the controller under the program name indicated at the "NAME = program name" line.

Format

PGM
9
Meaning • Expresses all programs.
• If there is a specification of a program number in the case of a write file, the new program overwrites.
• If the program number is omitted in the case of a write file, the assignment is made to the smallest
free number. 10
If there are programs with the same name and with different program numbers, the older program is
deleted.
Data Format

NAME = program name [cr/lf]


11
PGN=mmm[cr/lf]
aaaaa ...aaaaaaaaaaaaaa[cr/lf]
:
aaaaa ...aaaaaaaaaaaaaa[cr/lf] 12
:
NAME = program name [cr/lf]
PGN=mmm[cr/lf]

13
aaaaa ...aaaaaaaaaaaaaa[cr/lf]
:
aaaaa ...aaaaaaaaaaaaaa[cr/lf]
[cr/lf]

Notation Value Range


a Character code 0 to 7, 10 to 17, 20 to 27

mmm Program number 1 to 100

• Program names are shown with 32 characters or less consisting of alphanumeric characters and _ (underscore).
• A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND PGM TO CMU ……


Outputs all programs from the communication port.
SEND CMU TO PGM ……Inputs all programs from the communication port.

Response:
RUN [cr/lf]
NAME=TEST[cr/lf]
PGN=1[cr/lf]
PGN=1
A=1[cr/lf]
RESET DO2()[cr/lf]
:
HALT[cr/lf]
[cr/lf]
END [cr/lf]

Program file 10-3


Program file
7
2.2 Each program

8
Read-out 3
Write 3

Format

1.<program name>
9 2.PGmmm

Meaning • Expresses a specified program.


• "mmm" represents a number from 1 to 100.
10 • Program names are shown with 32 characters or less consisting of alphanumeric characters
and _ (underscore), and must be enclosed in < > (angle brackets).
• If a program name is omitted and written as <> in format 1, the current program is specified.
• In the case of write file, an error occurs if the specified program name (<program name>) differs
11 from one on the data (NAME=program name).
Data Format
NAME=program name[cr/lf]
PGN=mmm
12 aaaaa ...aaaaaaaaaaaaaa[cr/lf]
:
aaaaa ...aaaaaaaaaaaaaa[cr/lf]
[cr/lf]

13 Notation Value Range


a Character code 0 to 7, 10 to 17, 20 to 27

mmm Program number 1 to 100


32 characters or less
Program name
consisting of alphanumeric characters and _ (underscore)

• At program writing operations, be sure to specify the program name after NAME=.
Program writing cannot occur if the program name is not specified.
• When there is a program number with the different program, the older one will be overwritten.
• When there is no program number specified, the smallest free number will be specified automatically.
• Writing into the currently selected program is not possible.
• When a sequence program is being executed, writing into the program name "SEQUENCE" is not possible.

• A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description
SEND <TEST1> TO CMU ……
Outputs program TEST1 from the communication port.
SEND CMU TO <TEST1> ……
Inputs program TEST1 from the communication port.
Response:
RUN [cr/lf]
NAME=TEST1[cr/lf]
PGN=1[cr/lf]
A=1[cr/lf]
RESET DO2()[cr/lf]
:
HALT[cr/lf]
[cr/lf]

10-4 Chapter 10 Data file description


3 Point file
7
3.1 All points

8
Read-out 3 When used as a read-out file, all points currently stored are read out.
Write 3 When used as a write file, writing is performed with a point number.

Format

PNT
9
Meaning Expresses all point data.
Data Format

Pmmmm= fxxxxxx fyyyyyy fzzzzzz frrrrrr faaaaaa fbbbbbb t xr yr [cr/lf] 10


Pmmmm= fxxxxxx fyyyyyy fzzzzzz frrrrrr faaaaaa fbbbbbb t xr yr [cr/lf]
:
Pmmmm= fxxxxxx fyyyyyy fzzzzzz frrrrrr faaaaaa fbbbbbb t xr yr [cr/lf]
Pmmmm= fxxxxxx fyyyyyy fzzzzzz frrrrrr faaaaaa fbbbbbb t xr yr [cr/lf]
[cr/lf] 11

n NOTE
• Integer point data is recognized in "pulse" units, and real number point data is recognized in "mm" units.
• When a dot is included, this is treated as point data in "mm" units.
• Each piece of data is separated by one or more spaces.
12
Notation Value Range / Meaning

13
mmmm Point number 0 to 29999
f Coordinate sign + / - / space
xxxxxx/../bbbbbb Numeric value of 8 digits or less
Extended hand system flag setting for SCARA
t 1: RIGHT / 2:LEFT
robots

0: T
 he "mm → pulse" converted pulse data x (*1) range
–180.00° < x < = 180.00°.
The first arm rotation information for YK-TW 1: T
 he "mm → pulse" converted pulse data x (*1) range
xr
series robot 180.00° < x < = 540.00°.
-1: T
 he "mm → pulse" converted pulse data x (*1) range
–540.00° < x < = -180.00°.

0: T
 he "mm → pulse" converted pulse data x (*1) range
–180.00° < y < = 180.00°.
The second arm rotation information for YK-TW 1: T
 he "mm → pulse" converted pulse data x (*1) range
yr
series robot 180.00° < y < = 540.00°.
-1: T
 he "mm → pulse" converted pulse data x (*1) range
–540.00° < y < = -180.00°.

*1: T
 he joint-coordinates-converted pulse data represents each arm's distance (converted to angular data)
from its mechanical origin point.

• Hand system flags are valid only for SCARA robots, with the coordinate data specified in "mm" units.
• If a number other than "1" or "2" is specified for a hand system flag, or if no number is specified, this is interpreted as
"0" setting (no hand system flag).
• The first arm and the second arm rotation information settings are available only on the YK-TW series robot model
where a "mm"-unit coordinate system has been set.
• The first arm and the second arm rotation information is processed as "0" if a numeral other than 0, 1, -1 has been
specified, or if no numeral has been specified.

Point file 10-5


Point file
7
A line containing only [cr/lf] is added at the end of the file to indicate the end of the file.
Sample Description

8 SEND PNT TO CMU …………Outputs all points from the communication port.

Response:
RUN [cr/lf]

9 P0
P1
=
=
1
426.200
2
-160.770
3
0.001
4
337.210
5
0.000
6 [cr/lf]
0.000 0 1 0 [cr/lf]
P2 = -27.570 -377.840 0.360 193.220 0.000 0.000 0 -1 0 [cr/lf]
:
P29999= -251.660 -419.510 0.000 -127.790 0.000 0.000 2 -1 -1 [cr/lf]
10 [cr/lf]
END [cr/lf]

11

12

13

10-6 Chapter 10 Data file description


Point file
7
3.2 One point data

8
Read-out 3
Write 3

Format

Pmmmm
9
Meaning Expresses a specified point data.

Data Format

Pmmmm= fxxxxxx fyyyyyy fzzzzzz frrrrrr faaaaaa fbbbbbb t xr yr [cr/lf] 10

n NOTE
• Integer point data is recognized in "pulse" units, and real number point data is recognized in "mm" units.
• When a dot is included, this is treated as point data in "mm" units.
• Each piece of data is separated by one or more spaces.
11
Notation Value Range / Meaning
mmmm Point number 0 to 29999
f Coordinate sign + / - / space 12
xxxxxx/../ Numeric value
bbbbbb of 8 digits or less
Extended hand system flag setting
t 1: RIGHT / 2:LEFT
for SCARA robots

0: T
 he "mm → pulse" converted pulse data x (*1) range –180.00° < x < = 180.00°.
13
The first arm rotation information
xr 1: T
 he "mm → pulse" converted pulse data x (*1) range 180.00° < x < = 540.00°.
for YK-TW series robot
-1: T
 he "mm → pulse" converted pulse data x (*1) range –540.00° < x < = -180.00°.

The second arm rotation 0: T


 he "mm → pulse" converted pulse data y (*1) range –180.00° < x < = 180.00°.
yr information 1: T
 he "mm → pulse" converted pulse data y (*1) range 180.00° < x < = 540.00°.
for YK-TW series robot -1: T
 he "mm → pulse" converted pulse data y (*1) range –540.00° < x < = -180.00°.

*1: The joint-coordinates-converted pulse data represents each arm's distance (converted to angular data)
from its mechanical origin point.

• Hand system flags are valid only for SCARA robots, with the coordinate data specified in "mm" units.
• If a number other than "1" or "2" is specified for a hand system flag, or if no number is specified, this is interpreted as
"0" setting (no hand system flag).
• The first arm and the second arm rotation information settings are available only on the YK500TW robot model where
a "mm" units coordinate system has been set.
• The first arm and the second arm rotation information is processed as "0" if a numeral other than 0, 1, -1 has been
specified, or if no numeral has been specified.
• A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND P100 TO CMU ………


Outputs the specified point data from the communication port.
SEND CMU TO P100 ………Inputs the specified point data from the communication port.
Response:
RUN [cr/lf]
P100= 1.000 2.000 3.000 4.000 5.000 6.000 0 1 0 [cr/lf]
END [cr/lf]

Point file 10-7


4 Point comment file
7
4.1 All point comments

8
Read-out 3 When used as a read-out file, all point comments currently stored are read out.
Write 3 When used as a write file, writing is performed with a point comment number.

Format

9 PCM

Meaning Expresses all point comments.

10 Data Format

PCmmmm= sssssssssssssss[cr/lf]
PCmmmm= sssssssssssssss[cr/lf]

11 :
PCmmmm= sssssssssssssss[cr/lf]
PCmmmm= sssssssssssssss[cr/lf]
[cr/lf]

12
Notation Value Range
mmmm Point comment number 0 to 29999

13 ss...ss Comment data


This value can be up to 16 one-byte characters.
If comment data exceeds 16 characters,
then the 17th character onward will be deleted.

A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND PCM TO CMU ………………………Outputs all point comments from the communication port.
SEND CMU TO PCM ………………………Inputs all point comments from the communication port.

Response:
RUN [cr/lf]
PC1 = ORIGIN POS[cr/lf]
PC3 = WAIT POS[cr/lf]
:
PC3999 = WORK100[cr/lf]
[cr/lf]
END [cr/lf]

10-8 Chapter 10 Data file description


Point comment file
7
4.2 One point comment

8
Read-out 3
Write 3

Format

PCmmmm
9
Meaning Expresses a specified point comment.

10
Data Format

PCmmmm= sssssssssssssss[cr/lf]

Notation Value Range 11


mmmm Point comment number 0 to 29999

This value can be up to 16 one-byte characters.


ss...ss Comment data If comment data exceeds 16 characters,
then the 17th character onward will be deleted.
12

Sample Description
13
SEND PC1 TO CMU ………………… Outputs the specified point comment from the communication port.
SEND CMU TO PC1 ………………… Inputs the specified point comment from communication port.

Response:
RUN [cr/lf]
PC1 = ORIGIN POS[cr/lf]
END [cr/lf]

Point comment file 10-9


5 Point name file
7
5.1 All point names

8
Read-out 3 When used as a read-out file, all point names currently stored are read out.
Write 3 When used as a write file, writing is performed with a point name number.

Format

PNM
9
Meaning Expresses all point names.

10 Data Format

PNmmmm= assssssss [cr/lf]


PNmmmm= assssssss [cr/lf]

11
:
PNmmmm= assssssss [cr/lf]
PNmmmm= assssssss [cr/lf]
[cr/lf]

12
Notation Value Range
mmmm Point comment number 0 to 29999
Name data Use only one-byte alphabetic character.

13
a
(the first character) Otherwise, "4.202: Input format error" occurs.
Use one-byte alphanumeric characters and _ (underscore). Otherwise, "4.202:
Name data (the second character Input format error" occurs.
ss...ss
onward) If name data exceeds 16 characters, then the 17th character onward will be
deleted.

Name data must not be duplicate. If name data were duplicate, delete the name data with the earlier point name
number and save the name data to newly specified point name number.

A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND PNM TO CMU ………………………………………… Outputs all point names from the communication port.
SEND CMU TO PNM ………………………………………… Inputs all point names from the communication port.

Response:
RUN [cr/lf]
PN1=ORIGIN_POS [cr/lf]
PN3=WAIT_POS [cr/lf]
:
PN 3999=WORK 100 [cr/lf]
[cr/lf]
END [cr/lf]

10-10 Chapter 10 Data file description


Point name file
7
5.2 One point name

8
Read-out 3
Write 3

Format

PNmmmm
9
Meaning Expresses a specified point name.

Data Format
10
PNmmmm= asssssssssssssss [cr/lf]

Notation
mmmm
Value
Point comment number
Range
0 to 29999
11
Name data Use only one-byte alphabetic character.
a
(the first character) Otherwise, "4.202: Input format error" occurs.

12
Use one-byte alphanumeric characters and _ (underscore). Otherwise, "4.202:
Name data (the second character Input format error" occurs.
ss...ss
onward) If name data exceeds 16 characters, then the 17th character onward will be
deleted.

13
Sample Description

SEND PN1 TO CMU ……………………… Outputs the specified point name from the communication port.
SEND CMU TO PN1 ……………………… Inputs the specified point name from the communication port.

Response:
RUN [cr/lf]
PN1=ORIGIN_POS [cr/lf]
END [cr/lf]

Point name file 10-11


6 Parameter file
7
6.1 All parameters

8
Read-out 3 When used as a read-out file, all parameters currently stored are read out.
Write 3 When used as a write file, only the parameters specified by labels are written.

Format

PRM
9
Meaning Expresses all parameters.

10
Data Format

/parameter label/ [cr/lf]


RC=xxxxxx [cr/lf]
11 /parameter label/ [cr/lf]
R?=xxxxxx[cr/lf]
/parameter label/ [cr/lf]
R?A=xxxxxx,xxxxxx,xxxxxx,xxxxxx,xxxxxx,xxxxxx [cr/lf]

12
\parameter label\ [cr/lf]
C?=xxxxxx [cr/lf]
\parameter label\ [cr/lf]
R?=xxxxxx[cr/lf]
\parameter label\ [cr/lf]

13 R?A=xxxxxx,xxxxxx,xxxxxx,xxxxxx,xxxxxx,xxxxxx [cr/lf]
#parameter label# [cr/lf]
R?=xxxxxx[cr/lf]
#parameter label# [cr/lf]
R?A=xxxxxx,xxxxxx,xxxxxx,xxxxxx,xxxxxx,xxxxxx [cr/lf]
/parameter label/ [cr/lf]
C?O=xxxxxx,xxxxxx,xxxxxx,xxxxxx [cr/lf]
:
[cr/lf]

Notation Value Remarks


RC Entire controller
R? Robot setting
? Robot number
C? Controller setting
? Controller number
A Axis parameter Each data is separated by a comma.

O Option board parameter Each data is separated by a comma.

• Parameter labels are shown with 8 alphabetic characters.


• A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.

10-12 Chapter 10 Data file description


Parameter file
7

• When writing parameter data, be sure that the servo is off.


• Parameters are already compatible with upper versions. However, parameters might not always be compatible 8
with lower versions (upward compatibility).
• When you attempt to load a parameter file of new version into a controller of an earlier version, "10.214:
Undefined parameter found" error may occur. In this case, you may load the parameter by setting the "PRM
SKIP" parameter to "VALID".
• As parameters whose labels are enclosed in "\" are controller configuration parameters, take care when editing
9
them.
• As parameters whose labels are enclosed in "#" affect robot control, take care when editing them.

10
• "\" symbols may be displayed as "¥" depending on the computer environment.

Sample Description

SEND PRM TO CMU ………………………………………… Outputs all parameters 11


from the communication port.
SEND CMU TO PRM ………………………………………… Inputs all parameters
from the communication port.

Response: 12
RUN [cr/lf]
‘ V1.22,R0191-V1.000-V1.09,R0015/V1.09,R0015 [cr/lf]
‘ Gripper,V0.32/Gripper,V0.32///[cr/lf]
‘ PRM(0)[cr/lf]
\CNTTYP\[cr/lf]
13
C1=340[cr/lf]
\YCEADR\[cr/lf]
C1=0[cr/lf]
\DRVASGN\[cr/lf]
R1A=101,102,103,104,0,0[cr/lf]
R2A=0,0,0,0,0,0[cr/lf]
R3A=0,0,0,0,0,0[cr/lf]
R4A=0,0,0,0,0,0[cr/lf]
\RBTNUM\[cr/lf]
R1=2203[cr/lf]
:
[cr/lf]
END [cr/lf]

Parameter file 10-13


Parameter file
7
6.2 One parameter

8
Read-out 3 When used as a read-out file, only the parameter specified by a label is read out.
Write 3 When used as a write file, only the parameter specified by a label is written.

Format

/parameter label/, \parameter label\, #parameter label#


9
Meaning Parameter labels are shown with 8 alphabetic characters.

10 Data Format 1

/parameter label/ [cr/lf]


RC= xxxxxx [cr/lf]
[cr/lf]
11
Data Format 2

/parameter label/ [cr/lf]

12 R?= xxxxxx [cr/lf]


[cr/lf]

Data Format 3

13 /parameter label/ [cr/lf]


R?A=xxxxxx,xxxxxx,xxxxxx,xxxxxx,xxxxxx,xxxxxx [cr/lf]
[cr/lf]]

Data Format 4

\parameter label\ [cr/lf]


C?=xxxxxx [cr/lf]
[cr/lf]

Data Format 5

\parameter label\ [cr/lf]


R?=xxxxxx[cr/lf]
[cr/lf]

Data Format 6

\parameter label\ [cr/lf]


R?A=xxxxxx,xxxxxx,xxxxxx,xxxxxx,xxxxxx,xxxxxx [cr/lf]
[cr/lf]

Data Format 7

#parameter label# [cr/lf]


R?=xxxxxx[cr/lf]
[cr/lf]

10-14 Chapter 10 Data file description


Parameter file
7
Data Format 8

#parameter label# [cr/lf]


R?A=xxxxxx,xxxxxx,xxxxxx,xxxxxx,xxxxxx,xxxxxx [cr/lf]
[cr/lf]
8

Data Format 9

/parameter label/ [cr/lf] 9


C?O=xxxxxx,xxxxxx,xxxxxx,xxxxxx [cr/lf]
[cr/lf]

Notation Value Remarks 10


RC Entire controller
R? Robot setting
? Robot number
C?
?
Controller setting
Controller number
11
A Axis parameter Each data is separated by a comma.

O Option board parameter Each data is separated by a comma.

12
• Parameter labels are shown with 8 alphabetic characters.
• A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.

13
• When writing parameter data, be sure that the servo is off.
• Parameters are already compatible with upper versions. However, parameters might not always be compatible
with lower versions (upward compatibility).
• When you attempt to load a parameter file of new version into a controller of an earlier version, "10.214:
Undefined parameter found" error may occur. In this case, you may load the parameter by setting the "PRM
SKIP" to "VALID". (For detail, refer to the operator’s manual.
• As parameters whose labels are enclosed in "\" are controller configuration parameters, take care when editing
them.
• As parameters whose labels are enclosed in "#" affect robot control, take care when editing them.
• "\" symbols may be displayed as "¥" depending on the computer environment.

Sample Description

SEND /ACCEL / TO CMU ………………………… Outputs the acceleration parameter from


the communication port.
SEND CMU TO /ACCEL / ………………………… Inputs the acceleration parameter from
the communication port.

Response:
RUN [cr/lf]
/ACCEL / [cr/lf]
R1A=100, 100, 100, 100 [cr/lf]
[cr/lf]
END [cr/lf]

Parameter file 10-15


7 Shift coordinate definition file
7
7.1 All shift coordinate data

8
Read-out 3 When used as a read-out file, all shift coordinate data currently stored are read out.
Write 3 When used as a write file, writing is performed with a shift number.

Format

SFT
9
Meaning Expresses all shift coordinate data.

10
Data Format

Sm = fxxxxxx fyyyyyy fzzzzzz frrrrrr [cr/lf]


SPm = fxxxxxx fyyyyyy fzzzzzz frrrrrr [cr/lf]
SMm = fxxxxxx fyyyyyy fzzzzzz frrrrrr [cr/lf]

11
:
Sm = fxxxxxx fyyyyyy fzzzzzz frrrrrr [cr/lf]
SPm = fxxxxxx fyyyyyy fzzzzzz frrrrrr [cr/lf]
SMm = fxxxxxx fyyyyyy fzzzzzz frrrrrr [cr/lf]
[cr/lf]

12
Notation Value Range
m Shift number 0 to 39

f Coordinate sign + / - / space


13
xxxxxx/yyyyyy/../rrrrrr Represent a numeric value of 7 digits or less, having 3 or less places below the decimal point.

• The SPm and SMm inputs are optional in writing files.


SPm: shift coordinate range plus-side
SMm: shift coordinate range minus-side
• A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.

Sample Description

SEND SFT TO CMU ………………… Outputs all coordinate shift data from the communication port.
SEND CMU TO SFT ………………… Inputs all shift coordinate data from the communication port.

Response:
RUN [cr/lf]
S0 = 0.000 0.000 0.000 0.000 [cr/lf]
SP0= 0.000 0.000 0.000 0.000 [cr/lf]
SM0= 0.000 0.000 0.000 0.000 [cr/lf]
S1 = 1.000 1.000 1.000 1.000 [cr/lf]
:
SM39= 9.000 9.000 9.000 9.000 [cr/lf]
[cr/lf]
END [cr/lf]

10-16 Chapter 10 Data file description


Shift coordinate definition file
7
7.2 One shift definition

8
Read-out 3
Write 3

Format

Sm
9
Meaning Expresses a specified shift definition.

10
Data Format

Sm = fxxxxxx fyyyyyy fzzzzzz frrrrrr[cr/lf]

Notation Value Range 11


m Shift number 0 to 39

f Coordinate sign + / - / space

xxxxxx/yyyyyy/../rrrrrr Represent a numeric value of 7 digits or less, having 3 or less places below the decimal point.
12

13
A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND S0 TO CMU ………………………… Outputs the specified shift coordinate data from
the communication port.
SEND CMU TO S0 ………………………… Inputs the specified shift coordinate data from
the communication port.

Response:
RUN [cr/lf]
S0 = 0.000 0.000 0.000 0.000[cr/lf]
SP0= 0.000 0.000 0.000 0.000[cr/lf]
SM0= 0.000 0.000 0.000 0.000[cr/lf]
[cr/lf]
END [cr/lf]

Shift coordinate definition file 10-17


8 Hand definition file
7
8.1 All hand data

8
Read-out 3 When used as a read-out file, all hand data currently stored are read out.
Write 3 When used as a write file, writing is performed with a hand number.

Format

HND
9
Meaning Expresses all hand data.

10
Data Format

Hm = n,fxxxxxx, fyyyyyy, fzzzzzz ,{R}[cr/lf]


:
Hm = n,fxxxxxx, fyyyyyy, fzzzzzz ,{R}[cr/lf]

11
[cr/lf]

Notation Value Range

12
m Hand number 0 to 31

n Robot number 1 to 4

f Coordinate sign + / - / space

{R} Whether a hand is attached to the R-axis.

13 Represent a real numeric value of 7 digits or less, having 3 or less places below the decimal point, or an
xxxxxx/yyyyyy/zzzzzz integer of 7 digits or less.
(This numeric format depends on the robot type setting and hand definition type.)

A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND HND TO CMU …………… Outputs all hand data from the communication port.
SEND CMU TO HND …………… Intputs all hand data from the communication port.

Response:
RUN [cr/lf]
H0 = 1, 0.000, 0.000, 0.000 [cr/lf]
H1 = 1, 1.000, 1.000, 1.000 [cr/lf]
H2 = 2, 2.000, 2.000, 2.000 [cr/lf]
H3 = 2, 3.000, 3.000, 3.000 [cr/lf]
H4 = 3, 4.000, 4.000, 4.000 [cr/lf]
H5 = 3, 5.000, 5.000, 5.000 [cr/lf]
H6 = 4, 6.000, 6.000, 6.000 [cr/lf]
H7 = 4, 7.000, 7.000, 7.000 [cr/lf]
[cr/lf]
END [cr/lf]

10-18 Chapter 10 Data file description


Hand definition file
7
8.2 One hand definition

8
Read-out 3
Write 3

Format

Hm
9
Meaning Expresses a specified hand definition.

10
Data Format

Hm = n,fxxxxxx, fyyyyyy, fzzzzzz ,{R}[cr/lf]

Notation Value Range 11


m Hand number 0 to 31

n Robot number 1 to 4

{R}
Coordinate sign

Whether a hand is attached to the R-axis.


+ / - / space
12
Represent a real numeric value of 7 digits or less, having 3 or less places below the decimal point, or an
xxxxxx/yyyyyy/zzzzzz integer of 7 digits or less.
(This numeric format depends on the robot type setting and hand definition type.)
13

Sample Description

SEND H3 TO CMU ……… Outputs the specified hand definition data from the communication port.
SEND CMU TO H3 ……… Inputs the specified hand definition data from communication port.

Response:
RUN [cr/lf]
H3=2, 3.000, 3.000, 3.000, R [cr/lf]
END [cr/lf]

Hand definition file 10-19


9 Work definition file
7
9.1 All work data

8
Read-out 3 When used as a read-out file, all work data currently stored are read out.
Write 3 When used as a write file, writing is performed with a work number.

Format

WRKDEF
9
Meaning Expresses all work data.

10 Data Format

Wm = fxxxx.xxx fyyyy.yyy fzzzz.zzz frrrr.rrr [cr/lf]


:

11 Wm = fxxxx.xxx fyyyy.yyy fzzzz.zzz frrrr.rrr [cr/lf]


[cr/lf]

Notation Value Range


12 m Work number 0 to 39

f Coordinate sign + / - / space


Numeric value consisting of an integer portion of up to 4 digits and having 3 or less places below the
xxxx.xxx/yyyyy.yy decimal point
13 zzzz.zzz/rrrr.rrr [Unit] x xxx.xxx/yyyyy.yy/zzzz.zzz: mm
rrrr.rrr: degree

A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND WRKDEF TO CMU ……………………… Outputs all work data from the communication port.
SEND CMU TO WRKDEF………………………… Intputs all work data from the communication port.

Response:
RUN [cr/lf]
W0 = 0.000, 0.000, 0.000, 0.000 [cr/lf]
W1 = 1.000, 1.000, 1.000, 1.000 [cr/lf]
W2 = 2.000, 2.000, 2.000, 2.000 [cr/lf]
W3 = 3.000, 3.000, 3.000, 3.000 [cr/lf]
W4 = 4.000, 4.000, 4.000, 4.000 [cr/lf]
W5 = 5.000, 5.000, 5.000, 5.000 [cr/lf]
[cr/lf]
END [cr/lf]

10-20 Chapter 10 Data file description


Work definition file
7
9.2 One work definition

8
Read-out 3
Write 3

Format

Wm
9
Meaning Expresses a specified work definition.

Data Format
10
Wm = fxxxx.xxx fyyyy.yyy fzzzz.zzz frrrr.rrr [cr/lf]

11
Notation Value Range
m Work number 0 to 39

12
f Coordinate sign + / - / space
Numeric value consisting of an integer portion of up to 4 digits and having 3 or less places below the
xxxx.xxx/yyyyy.yy decimal point
zzzz.zzz/rrrr.rrr [Unit] xxxx.xxx/yyyyy.yy/zzzz.zzz: mm
rrrr.rrr: degree

13
Sample Description

SEND W3 TO CMU …………… Outputs the specified work data from the communication port.
SEND CMU TO W3 …………… Inputs the specified work data from communication port.

Response:
RUN [cr/lf]
W3= 3.000, 3.000, 3.000, 3.000 [cr/lf]
END [cr/lf]

Work definition file 10-21


10 Pallet definition file
7
10.1 All pallet definitions

8
Read-out 3 When used as a read-out file, all pallet definitions currently stored are read out.
Write 3 When used as a write file, writing is performed with a pallet number.

Format

PLT
9
Meaning Expresses all pallet definitions.

Data Format
10 PLm [cr/lf]
PLN = XY [cr/lf]
NX = nnn [cr/lf]
NY = nnn [cr/lf]

11 NZ = nnn [cr/lf]
PLP = ppppp [cr/lf]
P[1] = fxxxxxx fyyyyyy fzzzzzz frrrrrr faaaaaa fbbbbbb t xr yr[cr/lf]
:
P[5] = fxxxxxx fyyyyyy fzzzzzz frrrrrr faaaaaa fbbbbbb t xr yr[cr/lf]
12 PLm [cr/lf]
:
[cr/lf]

13 Notation Value Range / Meaning


m Pallet number 0 to 39
XY Coordinate plane setting XY Coordinate plane
nnn Number of points for each axis Positive integer
ppppp Point number for pallet definition Continuous 5 points starting with the specified point are used.
f Coordinate sign + / - / space
xxxxxx/
Numeric value
yyyyyy/../
of 8 digits or less (*2)
bbbbbb
Extended hand system flag setting
t 1: RIGHT / 2:LEFT
for SCARA robots

0: T
 he "mm → pulse" converted pulse data x (*1) range –180.00° < x < = 180.00°.
The first arm rotation information
xr 1: T
 he "mm → pulse" converted pulse data x (*1) range 180.00° < x < = 540.00°.
for YK-TW series robot
-1: T
 he "mm → pulse" converted pulse data x (*1) range –540.00° < x < = -180.00°.

The second arm rotation 0: T


 he "mm → pulse" converted pulse data y (*1) range –180.00° < x < = 180.00°.
yr information 1: T
 he "mm → pulse" converted pulse data y (*1) range 180.00° < x < = 540.00°.
for YK-TW series robot -1: T
 he "mm → pulse" converted pulse data y (*1) range –540.00° < x < = -180.00°.

*1: The joint-coordinates-converted pulse data represents each arm's distance (converted to angular data)
from its mechanical origin point.
*2: Integers indicate point data in "pulse" units, and real numbers in "mm" units.
When a dot is included, this is treated as point data in "mm" units.
Each piece of data is separated by one or more spaces.

10-22 Chapter 10 Data file description


Pallet definition file
7
• Hand system flags are enabled only when specifying the coordinate data in "mm" units for SCARA robots.
• Hand system flags and the first arm and the second arm rotation information are ignored during movement where
pallet definitions are used.
• If a number other than 1 or 2 is set, or if no number is designated, then 0 will be set to indicate that there is no hand 8
system flag.
• The first arm and the second arm rotation information settings are available only on the YK-TW series robot model
where a "mm" units coordinate system has been set.
• If a value other than "0", "1", "-1" is specified at the first arm and the second arm rotation information, or if no value is 9
specified, this will be processed as "0".
• A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.

Sample Description
10
SEND PLT TO CMU ………………………… Outputs all pallet definitions from the communication port.
SEND CMU TO PLT ………………………… Inputs all pallet definitions from the communication port.

Response:
11
RUN [cr/lf]
PL0[cr/lf]
PLN=XY[cr/lf]
NX = 3 [cr/lf] 12
NY = 4 [cr/lf]
NZ = 2 [cr/lf]
PLP= 3996[cr/lf]

13
P[1]= 0.000 0.000 0.000 0.000 0.000 0.000 [cr/lf]
P[2]= 100.000 0.000 0.000 0.000 0.000 0.000 [cr/lf]
P[3]= 0.000 100.000 0.000 0.000 0.000 0.000 [cr/lf]
P[4]= 100.000 100.000 0.000 0.000 0.000 0.000 [cr/lf]
P[5]= 0.000 0.000 50.000 0.000 0.000 0.000 [cr/lf]
PL1[cr/lf]
PLN= XY[cr/lf]
NX = 3[cr/lf]
NY = 4[cr/lf]
NZ = 2[cr/lf]
PLP= 3991[cr/lf]
P[1]= 0.000 0.000 0.000 0.000 0.000 0.000 [cr/lf]
P[2]= 100.000 100.000 0.000 0.000 0.000 0.000 [cr/lf]
P[3]= 0.000 200.000 0.000 0.000 0.000 0.000 [cr/lf]
P[4]= 100.000 200.000 0.000 0.000 0.000 0.000 [cr/lf]
P[5]= 0.000 0.000 100.000 0.000 0.000 0.000 [cr/lf]
[cr/lf]
END [cr/lf]

Pallet definition file 10-23


Pallet definition file
7
10.2 One pallet definition

8
Read-out 3
Write 3

Format

PLm
9
Meaning Expresses a specified pallet definition.

Data Format
10 PLm [cr/lf]
PLN = XY [cr/lf]
PLP = ppppp [cr/lf]
NX = nnn [cr/lf]

11 NY
NZ
= nnn [cr/lf]
= nnn [cr/lf]
P[1] = fxxxxxx fyyyyyy fzzzzzz frrrrrr faaaaaa fbbbbbb t xr yr[cr/lf]
:
P[5] = fxxxxxx fyyyyyy fzzzzzz frrrrrr faaaaaa fbbbbbb t xr yr[cr/lf]
12 [cr/lf]

Notation Value Range / Meaning


m Pallet number 0 to 39
13 XY Coordinate plane setting XY Coordinate plane
nnn Number of points for each axis Positive integer
ppppp Point number for pallet definition Continuous 5 points starting with the specified point are used.
f Coordinate sign + / - / space
xxxxxx/
Numeric value
yyyyyy/../
of 8 digits or less (*2)
bbbbbb
Extended hand system flag setting
t 1: RIGHT / 2:LEFT
for SCARA robots

0: T
 he "mm → pulse" converted pulse data x (*1) range –180.00° < x < = 180.00°.
The first arm rotation information
xr 1: T
 he "mm → pulse" converted pulse data x (*1) range 180.00° < x < = 540.00°.
for YK-TW series robot
-1: T
 he "mm → pulse" converted pulse data x (*1) range –540.00° < x < = -180.00°.

The second arm rotation 0: T


 he "mm → pulse" converted pulse data y (*1) range –180.00° < x < = 180.00°.
yr information 1: T
 he "mm → pulse" converted pulse data y (*1) range 180.00° < x < = 540.00°.
for YK-TW series robot -1: T
 he "mm → pulse" converted pulse data y (*1) range –540.00° < x < = -180.00°.

*1: The joint-coordinates-converted pulse data represents each arm's distance (converted to angular data)
from its mechanical origin point.
*2: Integers indicate point data in "pulse" units, and real numbers in "mm" units.
When a dot is included, this is treated as point data in "mm" units.
Each piece of data is separated by one or more spaces.

10-24 Chapter 10 Data file description


Pallet definition file
7
• Hand system flags are enabled only when specifying the coordinate data in "mm" units for SCARA robots.
• Hand system flags and the first arm and the second arm rotation information are ignored during movement where
pallet definitions are used.
• If a number other than 1 or 2 is set, or if no number is designated, then 0 will be set to indicate that there is no hand 8
system flag.
• The first arm and the second arm rotation information settings are available only on the YK-TW series robot model
where a "mm" units coordinate system has been set.
• If a value other than "0", "1", "-1" is specified at the first arm and the second arm rotation information, or if no value is 9
specified, this will be processed as "0".
• A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.

Sample Description
10
SEND PL2 TO CMU ………… Outputs the specified pallet definition from the communication port as
shown below.
SEND CMU TO PL2 ………… Inputs the specified pallet definition from the communication port as
shown below.
11
Response:
RUN [cr/lf]
PL2[cr/lf] 12
PLN=XY[cr/lf]
NX= 3[cr/lf]
NY= 3[cr/lf]

13
NZ= 2[cr/lf]
PLP= 3986[cr/lf]
P[1]= 100.000 100.000 50.000 90.000 0.000 0.000 [cr/lf]
P[2]= 200.000 100.000 50.000 90.000 0.000 0.000 [cr/lf]
P[3]= 100.000 200.000 50.000 90.000 0.000 0.000 [cr/lf]
P[4]= 200.000 200.000 50.000 90.000 0.000 0.000 [cr/lf]
P[5]= 100.000 10.000 100.000 90.000 0.000 0.000 [cr/lf]
[cr/lf]
END [cr/lf]

Pallet definition file 10-25


11 General Ethernet port file
7
Read-out 3 When used as a read-out file, all general Ethernet port definitions are read out.
Write 3 When used as a write file, writing is performed with a general Ethernet port number.

8 Format

GEP

Meaning Expresses all general Ethernet port definitions.


9
Data Format

GPm [cr/lf]
MODE=n [cr/lf]
10 IPADRS= aaa.aaa.aaa.aaa [cr/lf]
PORT=ppppp [cr/lf]
EOL=e [cr/lf]
TYPE=t [cr/lf]

11
:
TYPE=t [cr/lf]
[cr/lf]

12 Notation Value Range / Meaning


m General Ethernet port number 0 to 7

n Mode 0: Server / 1: Client

13
aaa IP address 0 to 255

ppppp Port number 0 to 65535

e Termination character code 0: CRLF / 1: CR

t Port type 0: TCP

When Client mode is selected in the write file,


• IP address and port number: Set the IP address and port number of the connection destination server.
When Server mode is selected in the write file,
• IP address: IP address already set on the controller is used to communicate, so IP address setting is unnecessary.
• Port number: Set a port number which differs from the one on the controller.

10-26 Chapter 10 Data file description


General Ethernet port definition file
7
A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND GEP TO CMU …………………… Outputs all files of the general Ethernet port from 8
the communication port.
SEND CMU TO GEP …………………… Inputs all files of the general Ethernet port from
the communication port.

Response: 9
RUN [cr/lf]
GP0 [cr/lf]
MODE=1 [cr/lf]
IPADRS=192.168.0.1 [cr/lf]
PORT=100 [cr/lf]
10
EOL=0 [cr/lf]
TYPE=0 [cr/lf]
GP1 [cr/lf]
MODE=1 [cr/lf] 11
IPADRS=192.168.0.100 [cr/lf]
PORT=200 [cr/lf]
EOL=0 [cr/lf]

12
TYPE=0 [cr/lf]
[cr/lf]
END [cr/lf]

13

General Ethernet port file 10-27


12 Input/output name file
7
12.1 All input/output name data

8
Read-out 3 When used as a read-out file, all input/output data currently stored are read out.
Write 3 When used as a write file, writing is performed with a input/output number.

Format

ION
9
Meaning Expresses all input/output name data.

Data Format
10 ioNMpp(b)=assssssssssssssss [cr/lf]
ioNMpp(b)=assssssssssssssss [cr/lf]
:
ioNMpp(b)=assssssssssssssss [cr/lf]

11 ioNMpp(b)=assssssssssssssss
[cr/lf]
[cr/lf]

Notation Value Range

12
io Input/output type DI / DO / SI / SO

pp Port number 2 to 7 / 10 to 15

b Bit number 0 to 7
Name data Use only one-byte alphabetic character.
a

13
(the first character) Otherwise, "4.202: Input format error" occurs.
Use one-byte alphanumeric characters and _ (underscore). Otherwise, "4.202:
Name data (the second character Input format error" occurs.
ss...ss
onward) If name data exceeds 16 characters, then the 17th character onward will be
deleted.

A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND ION TO CMU ……………………… Outputs all input/output name data


from the communication port.
SEND CMU TO ION ……………………… Inputs all input/output name data
from the communication port.

Response:
RUN [cr/lf]
DONM2(0)=DO_PORT2_0 [cr/lf]
DONM2(1)=DO_PORT2_1 [cr/lf]
:
SINM15(6)=SI_PORT15_6 [cr/lf]
SINM15(7)=SI_PORT15_7 [cr/lf]
[cr/lf]
END [cr/lf]

Name data must not be duplicate. When duplicate name data is saved, delete the name data with the earlier
point number and save the name data to the point number which is specified as the new destination to save to.

10-28 Chapter 10 Data file description


Input/output name file
7
12.2 One input/output type

8
Read-out 3
3
Write
Restricted*

Format

ioNM() 9

Meaning Expresses a specified input/output type.


10
Data Format

ioNMpp(b)=asssssssssssssss [cr/lf]
:
11
ioNMpp(b)=asssssssssssssss [cr/lf]
[cr/lf]

12
Notation Value Range
io Input/output type DI / DO / SI / SO
2 to 7 / 10 to 15
pp Port number *Readable input/output type and Port number 13
DI: Up to Port14 / DO: Up to Port 10 / SI, SO: Up to Port 15
b Bit number 0 to 7
Name data Use only one-byte alphabetic character.
a
(the first character) Otherwise, "4.202: Input format error" occurs.
Use one-byte alphanumeric characters and _ (underscore). Otherwise, "4.202:
Name data (the second character Input format error" occurs.
ss...ss
onward) If name data exceeds 16 characters, then the 17th character onward will be
deleted.

A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND DONM() TO CMU ………………… Outputs the specified input/output name data from
the communication port.

Response:
RUN [cr/lf]
DONM2(0)=DO_PORT2_0 [cr/lf]
DONM2(1)=DO_PORT2_1 [cr/lf]
:
DONM10(6)=DO_PORT10_6 [cr/lf]
DONM10(7)=DO_PORT10_7 [cr/lf]
[cr/lf]
END [cr/lf]

Input/output name file 10-29


Input/output name file
7
12.3 One input/output port

8
Read-out 3
3
Write
Restricted*

Format

9 ioNMpp()

Meaning Expresses a specified input/output type and port number.


10
Data Format

11 ioNMpp(b)=asssssssssssssss [cr/lf]
:
ioNMpp(b)=asssssssssssssss [cr/lf]
[cr/lf]

12
Notation Value Range
io Input/output type DI / DO / SI / SO

13 pp Port number
2 to 7 / 10 to 15
*Readable input/output type and Port number
DI: Up to Port14 / DO: Up to Port 10 / SI, SO: Up to Port 15
b Bit number 0 to 7
Name data Use only one-byte alphabetic character.
a
(the first character) Otherwise, "4.202: Input format error" occurs.
Use one-byte alphanumeric characters and _ (underscore). Otherwise, "4.202:
Name data (the second character Input format error" occurs.
ss...ss
onward) If name data exceeds 16 characters, then the 17th character onward will be
deleted.

A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND DONM2() TO CMU ……………… Outputs the specified input/output name data from
the communication port.

Response:
RUN [cr/lf]
DONM2(0)=DO_PORT2_0 [cr/lf]
DONM2(1)=DO_PORT2_1 [cr/lf]
:
DONM10(6)=DO_PORT10_6 [cr/lf]
DONM10(7)=DO_PORT10_7 [cr/lf]
[cr/lf]
END [cr/lf]

10-30 Chapter 10 Data file description


Input/output name file
7
12.4 One input/output bit

8
Read-out 3
3
Write
Restricted*

Format

ioNMpp(b) 9

Meaning Expresses a specified input/output type and bit number.


10
Data Format

ioNMpp(b)=asssssssssssssss [cr/lf]
[cr/lf]
11

Notation
io
Value
Input/output type
Range
DI / DO / SI / SO
12
2 to 7 / 10 to 15
pp Port number *Readable input/output type and Port number
DI: Up to Port14 / DO: Up to Port 10 / SI, SO: Up to Port 15
b Bit number 0 to 7 13
Name data Use only one-byte alphabetic character.
a
(the first character) Otherwise, "4.202: Input format error" occurs.
Use one-byte alphanumeric characters and _ (underscore). Otherwise, "4.202:
Name data (the second character Input format error" occurs.
ss...ss
onward) If name data exceeds 16 characters, then the 17th character onward will be
deleted.

Sample Description

SEND DONM2(0) TO CMU ………… Outputs the specified input/output name data from
the communication port.

Response:
RUN [cr/lf]
DONM2(0)=DO_PORT2_0 [cr/lf]
END [cr/lf]

Input/output name file 10-31


13 Area check output file
7
13.1 All area check output data

8
Read-out 3 When used as a read-out file, all area check output data currently stored are read out.
Write 3 When used as a write file, writing is performed with an area check output number.

Format

ACO
9
Meaning Expresses all area check output data.

10
Data Format

ACm=r,p1,p2,t,n,l [cr/lf]

11
ACm=r,p1,p2,t,n,l [cr/lf]
:
ACm=r,p1,p2,t,n,l [cr/lf]
ACm=r,p1,p2,t,n,l [cr/lf]
[cr/lf]

12
Notation Value Range / Meaning
m Area check output number 0 to 31
13 r Robot number 0 to 4 (0: Invalid)

p1 Comparison point number 1 0 to 29999

p2 Comparison point number 2 0 to 29999

t Port type 0: DO/SO 1: DO 2: SO 3: MO

n Port number 20 to 277

l Logic 0: OFF / 1: ON

A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND ACO TO CMU ………………………… Outputs all area check output data from the communication port.
SEND CMU TO ACO ………………………… Inputs all area check output data from the communication port.

Response:
RUN [cr/lf]
AC0=1,0,1,0,20,0 [cr/lf]
AC1=2,100,110,0,50,0 [cr/lf]
:
AC30=1,20,21,0,20,0 [cr/lf]
AC31=1,50,51,0,100,0 [cr/lf]
[cr/lf]
END[cr/lf]

10-32 Chapter 10 Data file description


Area check output file
7
13.2 One area check output definition

8
Read-out 3
Write 3 When used as a write file, writing is performed with an area check output number.

Format

ACm
9
Meaning Expresses a specified area check output definition.

10
Data Format

ACm=r,p1,p2,t,n,l [cr/lf]

11
Notation Value Range / Meaning

12
m Area check output number 0 to 31

r Robot number 0 to 4 (0: Invalid)

p1 Comparison point number 1 0 to 29999

p2 Comparison point number 2 0 to 29999

n
Port type

Port number
0: DO/SO 1: DO 2: SO 3: MO

20 to 277
13
l Logic 0: OFF / 1: ON

Sample Description

SEND AC0 TO CMU ………………………… Outputs specified area check output data from
the communication port.
SEND CMU TO AC0 ………………………… Inputs specified area check output data from
the communication port.

Response:
RUN [cr/lf]
AC0=1,0,1,0,20,0 [cr/lf]
END[cr/lf]

file 10-33
14 Real time output file
7
14.1 All real time output setting

8
Read-out 3 When used as a read-out file, all real time output setting currently stored are read out.
Write 3 When used as a write file, writing is performed with an real time output number.

Format

RTO
9
Meaning Expresses all real time output setting.

10
Data Format

RTm = n, o, p [cr/lf]

11
:
RTm = n, o, p [cr/lf]
[cr/lf]

12 Notation Value Range / Meaning


m Port number for Real time output 24 to 127

n Output item string

13
o Option 1 Reference "14.3 Real time output setting list"

p Option 2

A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND RTO TO CMU ………………………… Outputs all real time output data from the communication port.

Response:
RUN [cr/lf]
RT24=UCURPLS,1,1[cr/lf]
RT25=LCURPLS,1,1[cr/lf]
:
RT127=LPWRONCNT[cr/lf]
[cr/lf]
END [cr/lf]

10-34 Chapter 10 Data file description


Real time output file
7
14.2 One real time output setting

8
Read-out 3
Write 3

Format

RTm
9
Meaning Expresses a specified real time output setting.

10
Data Format

RTm = n, o, p [cr/lf]

11
[cr/lf]

Notation Value Range / Meaning


m Port number for Real time output 24 to 127

n Output item string 12


o Option 1 Reference "14.3 Real time output setting list"

p Option 2

13
Sample Description

SEND RT24 TO ETH …………………… Outputs the specified real time output data from
the communication port.

Response:
RUN [cr/lf]
RT24=UCURPLS,1,1[cr/lf]
[cr/lf]
END [cr/lf]

file 10-35
14.3 Real time output setting list
7 Option 1 (o) Option 2 (p)
Output item (n) Meaning Unit Data type
Target Range Target Range
UCURPLS Current Pulse (upper) pulse high order LONG Robot 1 to 4 Axis 1 to 6
LCURPLS Current Pulse (lower) pulse low order LONG Robot 1 to 4 Axis 1 to 6

8 UREFPLS Reference Pulse (upper) pulse high order LONG Robot 1 to 4 Axis 1 to 6
LREFPLS Reference Pulse (lower) pulse low order LONG Robot 1 to 4 Axis 1 to 6
UCURVEL Current Speed (upper) pulse/10ms high order LONG Robot 1 to 4 Axis 1 to 6
LCURVEL Current Speed (lower) pulse/10ms low order LONG Robot 1 to 4 Axis 1 to 6

9 UREFVEL
LREFVEL
Reference Speed (upper)
Reference Speed (lower)
pulse/10ms
pulse/10ms
high order LONG
low order LONG
Robot
Robot
1 to 4
1 to 4
Axis
Axis
1 to 6
1 to 6
FDBCUR Feedback Current 0.01Arms SHORT Robot 1 to 4 Axis 1 to 6
REFCUR Reference Current 0.01Arms SHORT Robot 1 to 4 Axis 1 to 6
INPOS Tolerance – USHORT Robot 1 to 4 Axis 1 to 6
10 OUTPOS Out Valid Position – USHORT Robot 1 to 4 Axis 1 to 6
MTRDUTY Motor Duty % USHORT Robot 1 to 4 Axis 1 to 6
DRVDUTY Driver Duty % USHORT Robot 1 to 4 Axis 1 to 6
DRVMOD Driver Mode (1) – USHORT Robot 1 to 4 Axis 1 to 6

11 GRPPLS
UGRPOS
Gripper Current Pulse
Gripper Current Position (upper)
pulse
0.00001mm
LONG
high order LONG
Gripper
Gripper
1 to 4
1 to 4




LGRPOS Gripper Current Position (lower) 0.00001mm low order LONG Gripper 1 to 4 – –
GRPSTS Gripper Status (2) – USHORT Gripper 1 to 4 – –

12
USGI SGI (upper) – high order LONG SGI 0 to 31 – –
LSGI SGI (lower) – low order LONG SGI 0 to 31 – –
USGR SGR (upper) 0.001 high order LONG SGR 0 to 31 – –
LSGR SGR (lower) 0.001 low order LONG SGR 0 to 31 – –
TEMP Temperature ℃ USHORT – – – –

13 TASK Taks Number – USHORT – – – –


STEP Step Number – USHORT Task 1 to 16 – –
TSKSTS Task Status (3) – USHORT Task 1 to 16 – –
ALRMGRP Alarm Group – USHORT – – – –
ALRMCTG Alarm Category – USHORT – – – –
UCCORPOS Current Cartesian Coordinates Position (upper) 0.001mm or deg high order LONG Robot 1 to 4 Axis 1 to 6
LCCORPOS Current Cartesian Coordinates Position (lower) 0.001mm or deg low order LONG Robot 1 to 4 Axis 1 to 6
UCCORSPD Current Cartesian Coordinates Speed (upper) mm/s high order LONG Robot 1 to 4 Axis 1 to 6
LCCORSPD Current Cartesian Coordinates Speed (lower) mm/s low order LONG Robot 1 to 4 Axis 1 to 6
UMOVDIS Moving Distance (upper) m or 1000 deg high order ULONG Robot 1 to 4 Axis 1 to 6
LMOVDIS Moving Distance (lower) m or 1000 deg low order ULONG Robot 1 to 4 Axis 1 to 6
UPWRONCNT Power On Count (upper) Times high order ULONG – – – –
LPWRONCNT Power On Count (lower) Times low order ULONG – – – –
UMTRONCNT Motor Power On Count (upper) Times high order ULONG – – – –
LMTRONCNT Motor Power On Count (lower) Times low order ULONG – – – –
USRVONCNT Servo On Count (upper) Times high order ULONG Robot 1 to 4 Axis 1 to 6
LSRVONCNT Servo On Count (lower) Times low order ULONG Robot 1 to 4 Axis 1 to 6
USRVONTIM Servo On Time (upper) s high order ULONG Robot 1 to 4 Axis 1 to 6
LSRVONTIM Servo On Time (lower) s low order ULONG Robot 1 to 4 Axis 1 to 6
UOPRTIM Operating Time (upper) s high order ULONG – – – –
LOPRTIM Operating Time (lower) s low order ULONG – – – –

Accumulated motor data (Servo ON Count, Servo ON Time, Moving Distance), accumulated controller data (Power ON Count, Motor Power
ON Count, Operating Time) are initialized at the first boot in Ver.1.73 of RCX3 controller host CPU. Thereafter, the value is retained and
accumulated even if the power is turned off. The Motor and the Controller Accumulated Data can be reset by remote commands, respectively.
Reference Remote I/O manual

10-36 Chapter 10 Data file description


The table below shows the allocation of values for each state.

(1) DRVMOD (Driver Mode) 7


Driver mode Value (*)

Servo HOLD 0x0030

Servo OFF 0x0031 8


Servo FREE 0x0032

0x0033

in Operation 0x0034

0x0035 9
Return-to-Origin Operation 0x0036

Servo BRAKING 0x0037

Analysis Mode 0x0038

Speed control Mode 0x0039 10


0x0050
Severe Alarm
0x0051

Magnetic pole estimation 0x0052

* Values are in hexadecimal notation.


11

(2) GRPSTS (Gripper Status)

Bit Signal Name


Value 12
0 1
7 Servo Status OFF ON

6 Origin (Home return) Status Uncompleted Completed

5 Unused – – 13
4 READY signal in Preparation Normal

3 ZON signal Out of range Within range

2 HOLD signal Open Gripping

1 INPOS signal Out of range Within range

0 BUSY signal Completed in Operation

(3) TSKSTS (Task Status)

Task status Value (*)

Unregistered 0x0000

RUN 0x0002

WAIT 0x0004

SUSPEND 0x0008

STOP 0x0010

* Values are in hexadecimal notation.

file 10-37
15 All file
7
15.1 All file

8
Read-out 3
Write 3

Format

ALL
9
Meaning Expresses the minimum number of data files required to operate the robot system.

10 n NOTE
For details of each file, refer to that file's explanation.

11
Data Format
[PGM] ……………………………………………………………………………………………………………………………… All program format

12
NAME=< program name>
PGN=mmm
aaaa .... aaaaaaaa [cr/lf]
:
aaaa .... aaaaaaaa [cr/lf]

13 [cr/lf]

[PNT] ……………………………………………………………………………………………………………………………… All point format

Pmmmm=fxxxxxx fyyyyyy fzzzzzz faaaaaa fbbbbbb t [cr/lf]


:
Pmmmm=fxxxxxx fyyyyyy fzzzzzz faaaaaa fbbbbbb t [cr/lf]
[cr/lf]

[PCM] ……………………………………………………………………………………………………………………………… All point comment format

PCmmmm= ssssssssssssssss [cr/lf]


:
PCmmmm= ssssssssssssssss [cr/lf]
[cr/lf]

[PNM] ……………………………………………………………………………………………………………………………… All point name format

PNmmmm= asssssssssssssss [cr/lf]


:
PNmmmm= asssssssssssssss [cr/lf]
[cr/lf]

[PRM] ……………………………………………………………………………………………………………………………… All parameter format

/parameter label/ [cr/lf]


RC=xxxxxx [cr/lf]
:
#parameter label# [cr/lf]
R?=xxxxxx [cr/lf]
[cr/lf]

[SFT] ……………………………………………………………………………………………………………………………… All shift format

10-38 Chapter 10 Data file description


Data Format
Sm= fxxxxxx fyyyyyy fzzzzzz frrrrrr [cr/lf]
:
7
SMm= fxxxxxx fyyyyyy fzzzzzz frrrrrr [cr/lf]
[cr/lf]

[HND] ……………………………………………………………………………………………………………………………… All hand format 8


Hm= n, fxxxxxx, fyyyyyy, fzzzzzz ,{R} [cr/lf]
:
Hm= n, fxxxxxx, fyyyyyy, fzzzzzz ,{R} [cr/lf]
[cr/lf]
9
[PLT] ……………………………………………………………………………………………………………………………… All pallet format
PLm [cr/lf]
:
P[5]= fxxxxxx fyyyyyy fzzzzzz frrrrrr faaaaaa fbbbbbb t [cr/lf] 10
[cr/lf]

[GEP] …………………………………………………………………………………………… All general Ethernet port format

MODE=n [cr/lf]
:
11
TYPE=t [cr/lf]
[cr/lf]

[ION] …………………………………………………………………………………………… All input/output name format 12


ioNMpp(b)=asssssssssssssss [cr/lf]
:
ioNMpp(b)=asssssssssssssss [cr/lf]
[cr/lf]
13
[ACO] …………………………………………………………………………………………… All area check output format

ACm=r,p1,p2,t,n,l [cr/lf]
:
ACm=r,p1,p2,t,n,l [cr/lf]
[cr/lf]

[END] ……………………………………………………………………………………………………………………………… All file end

• In readout files, only items whose data is saved in the controller is readout.
• In writing files, [xxx] determines the data file's format, and this format is saved at the controller.
Example: [HND]…All text data up the next [xxx] is saved at the controller as "all hand" format data.

Sample Description

SEND ALL TO CMU ………… Outputs all files of the entire system from the communication port.

SEND CMU TO ALL ………… Inputs all files of the entire system from the communication port.

All file 10-39


16 Program directory file
7
16.1 Entire program directory

8
Read-out 3 When used as a read-out file, information on entire program directory is read out.
Write - This file cannot be used as a write file.

Format

DIR
9
Meaning Expresses entire program directory.

10
Data Format

nnn, yy/mm/dd, hh:mm, bbbbbbb, llll, xx, ff, sssss…sssssssss [cr/lf]

11
:
nnn, yy/mm/dd, hh:mm, bbbbbbb, llll, xx, ff, sssss…sssssssss [cr/lf]
[cr/lf]

12 Notation Value Range / Meaning


nnn Program number 0 to 100

yy/mm/dd Date of update

hh:mm Time of update


13 bbbbbb Byte size of program (7 digits)
RW: Readable/writable
xx File attribute RO: Not writable (read only)
H: Hidden file
m: Main program
ff Flag c: Current program
s: Sequence program
32 characters or less consisting of alphanumeric characters and _
sss...ssssss Program name
(underscore).

A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND DIR TO CMU ……………… Outputs information on all program directory


from the communication port.

Response:
RUN [cr/lf]
1, 15/01/10,10:14,100,24,RW,m,SAMPLE1 [cr/lf]
2, 15/01/18,18:00,50,18,RO,,SAMPLE2 [cr/lf]
3, 15/02/11,20:15,200,58,RW,c,SAMPLE3 [cr/lf]
4, 15/02/11,19:03,28,15,H,,SAMPLE4 [cr/lf]
10, 15/03/02, 20:21,592,288,RW,,SAMPLE10 [cr/lf]
24, 15/01/18,13:19,10,3,RW,,SAMPLE24 [cr/lf]
[cr/lf]
END [cr/lf]

10-40 Chapter 10 Data file description


Program directory file
7
16.2 One program directory

8
Read-out 3
Write -

Format

<<program name>>
9
Meaning • Expresses information on one program.
• The program name is enclosed in << >> (double brackets).
10
Data Format

nnn, yy/mm/dd, hh:mm, bbbbbbb, llll, xx, ff, sssss…sssssssss [cr/lf]


11

Notation Value Range / Meaning


nnn Program number 0 to 100 12
yy/mm/dd Date of update

hh:mm Time of update

bbbbbb Byte size of program (7 digits)


RW: Readable/writable 13
xx File attribute RO: Not writable (read only)
H: Hidden file
m: Main program
ff Flag c: Current program
s: Sequence program
32 characters or less consisting of alphanumeric characters and _
sss...ssssss Program name
(underscore).

Sample Description

SEND <<SAMPLE1>> TO CMU …………… Outputs information on the specified program from
the communication port.

Response:
RUN [cr/lf]
1, 15/01/10,10:14,100,24,RW,m,SAMPLE1 [cr/lf]
END [cr/lf]

Program directory file 10-41


17 Parameter directory file
7
17.1 Entire parameter directory

8
Read-out 3 When used as a read-out file, information on entire parameter directory is read out.
Write - This file cannot be used as a write file.

Format

DPM
9
Meaning Expresses entire parameter directory.

Data Format
10 \mmmmmmmm\ a m n1 n2 n3 … n10 n11 n12 uuuuuu [cr/lf]
/mmmmmmmm/ a m n1 n2 n3 … n10 n11 n12 uuuuuu [cr/lf]
#mmmmmmmm# a m n1 n2 n3 … n10 n11 n12 uuuuuu [cr/lf]
[cr/lf]
11
Notation Value Range / Meaning
mmmmmmmm Parameter label 8 characters or less having some symbols
12 a Attribute

m Input method (*) 0: Direct input / 1 to 12: Selective input

n Input range (*) n1: Minimum value / n2: Maximum value

13
uuuuuu Units
* m: 0 ………….. n: n1 (Minimum value) / n2 (Maximum value)
m: 1 to 12 …… n: Enumerate all options input at "m" (Ex) "m" and "n" when "m" is 4: 4 0 1 2 3

• As parameters whose labels are enclosed in "\" are controller configuration parameters, take care when editing them.
• As parameters whose labels are enclosed in "#" affect robot control, take care when editing them.
• "\" symbols may be displayed as "¥" depending on the computer environment.

A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND DPM TO CMU ……………… Outputs information on all parameter directory from the
communication port.

Response:
RUN [cr/lf]
‘PRM(0) [cr/lf]
\CNTTYP\ 16460 0 0 2147493647 [cr/lf]
\YCEADR\ 16396 0 0 99 [cr/lf]
\DRVASGN\ 16398 0 0 9906 [cr/lf]
:
/ARMTYP/ 0 3 0 1 2 [cr/lf]
#CPVMAX# 16 0 1 32767 mm/s [cr/lf]
:
/IOORGOUT/ 2052 0 0 27 [cr/lf]
/IOSRVOUT/ 2052 0 0 27 [cr/lf]
/GRPORGIN/ 2052 0 0 27 [cr/lf]
[cr/lf]
END [cr/lf]

10-42 Chapter 10 Data file description


18 Machine reference file
7
18.1 Machine reference (axes: sensor method, stroke-end method)

8
Read-out 3
Write -

Format

MRF
9
Meaning Expresses all machine reference values of axes whose return-to-origin method is set as "Sensor" or
"Stroke-end".
10
Data Format

RnA=mmm,mmm,mmm,mmm,mmm,mmm [cr/lf]

11
:
RnA= mmm,mmm,mmm,mmm,mmm,mmm [cr/lf]
[cr/lf]

Notation Value Range 12


n Robot number 1 to 4

mmm Machine reference value 0 to 100

13
This file reads out the machine reference values of the axes set to the robots.
Example: W
 hen the 1st through 6th axes of the robot 1 and 1st and 3rd axes of the robot 2 are connected,
the data is shown as follows.
R1A = mmm, mmm, mmm, mmm, mmm, mmm
R2A = mmm, mmm

A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND MRF TO CMU ………………… Outputs all machine reference data from the communication port.

Response:
RUN[cr/lf]
R1A=53,47,58,25,55,59 [cr/lf]
:
R4A=52,58,41,38,61,50 [cr/lf]
[cr/lf]
END[cr/lf]

Machine reference file 10-43


Machine reference file
7
18.2 Machine reference (axes: mark method)

8
Read-out 3
Write -

Format

ARP
9
Meaning Expresses all machine reference values of axes whose return-to-origin method is set as "Mark".

10 Data Format

RnA=mmm,mmm,mmm,mmm,mmm,mmm [cr/lf]
:
RnA= mmm,mmm,mmm,mmm,mmm,mmm [cr/lf]
11 [cr/lf]

Notation Value Range


n Robot number 1 to 4

12 mmm Machine reference value 0 to 100

13 This file reads out the machine reference values of the axes set to the robots.
Example: W
 hen the 1st through 6th axes of the robot 1 and 1st and 3rd axes of the robot 2 are connected,
the data is shown as follows.
R1A = mmm, mmm, mmm, mmm, mmm, mmm
R2A = mmm, mmm

A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND ARP TO CMU ……………… Outputs all machine reference data from the communication port.

Response:
RUN[cr/lf]
R1A=53,47,58,25,55,59 [cr/lf]
:
R4A=52,58,41,38,61,50 [cr/lf]
[cr/lf]
END[cr/lf]

10-44 Chapter 10 Data file description


19 Accumulated data file
7
Read-out 3
Write -

Format 8
ACD

Meaning Expresses all accumulated data. The accumulated data is the accumulated value such as the number of
times the controller power is turned on, the number of times the motor servo is turned on, the distance 9
traveled and so on since the controller was first turned on.
For details, refer to "14.3 Real time output setting list" in this chapter and "Real time output" in Remote I / O Manual.

10
Data Format

/PWRONCNT/[cr/lf]
RC=xxxxxxxxxx[cr/lf]
/MPWRONCNT/[cr/lf]

11
RC=xxxxxxxxxx[cr/lf]
/OPTIME/[cr/lf]
RC=xxxxxxxxxx[cr/lf]
/SRVONCNT/[cr/lf]
R?A=xxxxxxxxxx,xxxxxxxxxx,xxxxxxxxxxx,xxxxxxxxxxx,xxxxxxxxxx,xxxxxxxxxx[cr/lf]
/SRVONTIME/[cr/lf]
R?A=xxxxxxxxxx,xxxxxxxxxx,xxxxxxxxxxx,xxxxxxxxxxx,xxxxxxxxxx,xxxxxxxxxx[cr/lf]
12
/DISTTRVLD/[cr/lf]
R?A=xxxxxxxxxx,xxxxxxxxxx,xxxxxxxxxxx,xxxxxxxxxxx,xxxxxxxxxx,xxxxxxxxxx[cr/lf]
[cr/lf]
13
Notation Value Range / Meaning
RC Entire controller

R? Specifying robot

? Robot number 1 to 4

A All axes

xxxxxxxxxx Numerical value 0 ≤ xxxxxxxxxx ≤ 4294967295

A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND ACD TO CMU ……… Outputs all accumulated data from the communication port.

Response:
RUN [cr/lf]
/PWRONCNT/[cr/lf] ………… Count of times the controller power is turned on
RC=1[cr/lf]
/MPWRONCNT/[cr/lf] ………… Count of times the controller motor power is turned on
RC=0[cr/lf]
/OPTIME/[cr/lf] ………… Total operating time of the controller
RC=2500[cr/lf]
/SRVONCNT/[cr/lf] ………… Count of times of Servo ON for all axes of Robot 1
R1A=0,0,0,0[cr/lf]
/SRVONTIME/[cr/lf] ………… Total servo ON time for all axes of Robot 1
R1A=0,0,0,0[cr/lf]
/DISTTRVLD/[cr/lf] ………… Total travel distance of all axes of robot 1
R1A=0,0,0,0[cr/lf]
[cr/lf]
END [cr/lf]

file 10-45
20 System configuration information file
7
Read-out 3
Write -

8 Format

CFG

Meaning Expresses all system configuration information.


9
Data Format

Cm:nnnn, s, b, kkkkk, ff-ff-ff-ff-ff-ff [cr/lf]

10 Cm:nnnn, s, b, kkkkk, ff-ff-ff-ff-ff-ff [cr/lf]


:
Rr:aaaa,hhhhhh [cr/lf]
Rr:aaaa,hhhhhh [cr/lf]
[cr/lf]
11
Notation Value Range / Meaning
m Controller number 1 onward
12 nnn Controller ID number

s Specification G: CE / L: Normal

b Brake power I: Internal / E: External

13
kkkkkk Memory size

ff MAC address

r Robot number 1 to 4

aaaa Robot ID number

hhhhhh Connected axis number

A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND CFG TO CMU …………………………… Outputs all the system configuration file from
the communication port.

Response:
RUN [cr/lf]
C1:340,L,I,2.1MB,00-04-C6-FF-83-12[cr/lf]
R1:MULTI,1234[cr/lf]
[cr/lf]
END [cr/lf]

10-46 Chapter 10 Data file description


21 Version information file
7
Read-out 3
Write -

Format 8
VER

Meaning Expresses version information.


9
Data Format

Cm:cv, cr-mv-dv1, dr1/dv2, dr2 [cr/lf]


:
Cm:cv, cr-mv-dv1, dr1/dv2, dr2 [cr/lf]
10
[cr/lf]

Notation Value Range 11


m Controller number 1 onward

cv Host version

cr Host revision (Rxxxx)

mv PLD version (Vx.xx)


12
dv? Driver version (Vx.xx) ?: 1,2

dr? Driver revision (Rxxx) ?: 1,2

13
A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND VER TO CMU …………………………… Outputs all files of the version information from
the communication port.

Response:
RUN [cr/lf]
C1:V1.22,R0191-V1.000-V1.09,R0015/V1.09,R0015 [cr/lf]
C2:V1.22,R0191-V1.000-V1.09,R0015/V1.09,R0015 [cr/lf]
C3:V1.22,R0191-V1.000-V1.09,R0015/V1.09,R0015 [cr/lf]
C4:V1.22,R0191-V1.000-V1.09,R0015/V1.09,R0015 [cr/lf]
[cr/lf]
END [cr/lf]

file 10-47
22 Option board file
7
Read-out 3
Write -

8 Format

OPT

Meaning Expresses all option boards.


9
Data Format

CmOn:aaaaaa,Vb.bb [cr/lf]

10 CmOn:aaaaaa,Vb.bb [cr/lf]
:
CmOn:aaaaaa,Vb.bb [cr/lf]
CmOn:aaaaaa,Vb.bb [cr/lf]
[cr/lf]
11
Notation Value Range
m Controller number 1 onward
12 n
Option board number
Slot number: 1 to 4
inside the controller
aaaaaa Option board name

b.bb Option board version

13
A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND OPT TO CMU …………………………… Outputs all files of the option boards from
the communication port.

Response:
RUN [cr/lf]
C1O1:Gripper,V0.32 [cr/lf]
C1O2:Gripper,V0.32 [cr/lf]
[cr/lf]
END [cr/lf]

10-48 Chapter 10 Data file description


23 Self check file
7
Read-out 3
Write -

Format 8
SCK

Meaning Expresses self check file.


9
Data Format

gg.bbb:mmmm [cr/lf]
gg.bbb:mmmm
:
[cr/lf]
10
gg.bbb:mmmm [cr/lf]
gg.bbb:mmmm [cr/lf]
[cr/lf]
11

Notation Value Meaning


gg

bbb
Alarm group number

Alarm classification number


12
RC: Entire controller
R?: Robot (?: Robot number)

13
C?: Controller (?: Controller number)
A?: Axis (?: Axis number)
mmmm Alarm occurrence location M?: Driver (?: Driver number)
R?: Option board (?: Option board number inside the controller)
T?: Task (?: Task number)
ETH: Ethernet
CMU: RS-232C

A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND SCK TO CMU ………………………………… Outputs all files of the self check information from
the communication port.

Response:
RUN [cr/lf]
12.600:C1M1 [cr/lf]
12.600:C1M2 [cr/lf]
12.600:C1M3 [cr/lf]
12.600:C1M4 [cr/lf]
[cr/lf]
END [cr/lf]

file 10-49
24 Alarm history file
7
Read-out 3
Write -

8 Format

LOG

Meaning Expresses all alarm history.


9
Data Format

nnn:yy/mm/dd, hh:mm:ss, gg.bbb : aaaa,c, eee : ffff,

10
iiiii, jjjjjjjj, kkkkkkkk, llllllll, oooooooo, pppppppp,
pppppppp, pppppppp, pppppppp, pppppppp, pppppppp, q [cr/lf]
nnn:yy/mm/dd, hh:mm:ss, gg.bbb : aaaa,c, eee : ffff,
iiiii, jjjjjjjj, kkkkkkkk, llllllll, oooooooo, pppppppp,
pppppppp, pppppppp, pppppppp, pppppppp, pppppppp, q [cr/lf]

11
:
nnn:yy/mm/dd, hh:mm:ss, gg.bbb : aaaa,c, eee : ffff,
iiiii, jjjjjjjj, kkkkkkkk, llllllll, oooooooo, pppppppp,
pppppppp, pppppppp, pppppppp, pppppppp, pppppppp, q [cr/lf]
[cr/lf]

12

13

10-50 Chapter 10 Data file description


Alarm history file
7
Notation Value Range / Meaning
nnn Alarm history number 1 to 500

yy/mm/dd Date of alarm occurrence


8
hh:mm:ss Time of alarm occurrence

gg Alarm group number

9
bbb Alarm classification number

RC: Entire controller


R?: Robot (?: Robot number)
C?: Controller (?: Controller number)
A?: Axis (?: Axis number)
aaaa Alarm occurrence location M?: Driver (?: Driver number) 10
R?: Option board (?: Option board number inside the controller)
T?: Task (?: Task number)
ETH: Ethernet
CMU: RS-232C

I: Illegal
11
M: Manual mode
c Operation mode
A: Automatic mode (with programming box)
O: Automatic mode (with other devices)

eee Program number 12


ffff Program execution line

iiiii Point number

jjjjjjjj Parallel input Port 0 to 3 (hexadecimal)


13
kkkkkkkk Parallel output Port 0 to 3 (hexadecimal)

llllllll Serial input Port 0 to 3 (hexadecimal)

oooooooo Serial output Port 0 to 3 (hexadecimal)

pppppppp Alarm occurrence location A1 to A6

q Hand system 0: NONE / 1: RIGHT / 2: LEFT

A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND LOG TO CMU………… Outputs all files of the alarm history from the communication port.

Response:
RUN [cr/lf]
1:15/03/30,08:23:05,1.100:RC,O,:,0,00000000,00000012,00000000,00000112,,,,,,, [cr/lf]
2:15/03/30,08:23:05,5.288: RC,O,:,0,00000000,00000010,00000000,00000110,,,,,,, [cr/lf]
:
500:15/03/18,10:23:04,5.228:T01,O,17:3,,00000000,00000010,00000000,00000110,40119,100000,99996,39375,0,0,0 [cr/lf]
[cr/lf]
END [cr/lf]

file 10-51
25 Remaining memory size file
7
Read-out 3
Write -

8 Format

MEM

Meaning Expresses remaining memory size


9
Data Format

PGM+PNT AREA=mmmmmmm/nnnnnnnn[cr/lf]

10 VAR AREA=xxxxx/yyyyy[cr/lf]
[cr/lf]

Notation Value
11 mmmmmmm Remaining memory size of program and point area

nnnnnnn Total memory size of program and point area

xxxxx Remaining memory size of variable area

12
yyyyy Total memory size of variable area

A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description
13 SEND MEM TO CMU …………………………… Outputs all files of the remaining memory size from
the communication port.

Response:
RUN [cr/lf]
PGM+PNT AREA=2088547 / 2100000 [cr/lf]
VAR AREA=23220 / 24000 [cr/lf]
[cr/lf]
END [cr/lf]

10-52 Chapter 10 Data file description


26 Variable file
7
26.1 Dynamic variables

26.1.1 All dynamic variables 8


Read-out 3 When used as a read-out file, all dynamic variables currently stored are read out.
Write 3 When used as a write file, a specified dynamic variable is written.

Format 9
VAR

Meaning Expresses all dynamic variables.


10
Data Format

variable name t = xxxxxx [cr/lf]


variable name t = xxxxxx [cr/lf]
: 11
variable name t = xxxxxx [cr/lf]
[cr/lf]

Notation Value Range / Meaning 12


Variable Global variable Variable name is shown with 32 characters or less
name defined in the program consisting of alphanumeric characters and _ (underscore).

t Type of variable !: Real number / %: Integer / $: Character string

Integer type: Integer of -2147483647 to 2147483647 13


xxxxxx Value of variable Real type: Real number of 7 digits or less including decimal fractions
Character type: Character string of 255 characters or less

A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND VAR TO CMU …………………………… Outputs all global variables from the communication port.
SEND CMU TO VAR …………………………… Inputs all global variables from the communication port.

Response:
RUN [cr/lf]
A%=150 [cr/lf]
B!=1.0234E1 [cr/lf]
C1$=“SAMPLE1” [cr/lf]
C2$=“SAMPLE2” [cr/lf]
[cr/lf]
END [cr/lf]C1$="CNS_1"[cr/lf]
C2$="CNS_2"[cr/lf]
[cr/lf]
END [cr/lf]

Variable file 10-53


Variable file
7
26.1.2 One dynamic variable

8
Read-out 3
Write 3

Format

9 variable name t

Meaning Expresses one dynamic variable.

Data Format
10 xxxxxx [cr/lf]

11 Notation Value Range / Meaning


Variable Global variable Variable name is shown with 32 characters or less
name defined in the program consisting of alphanumeric characters and _ (underscore).

t Type of variable !: Real number / %: Integer / $: Character string

12 Integer type: Integer of -2147483647 to 2147483647


xxxxxx Value of variable Real type: Real number of 7 digits or less including decimal fractions
Character type: Character string of 255 characters or less

13
Dynamic global variables are registered during program execution.
Variables cannot be referred to unless they are registered.

Sample 1 Description

SEND A% TO CMU [cr/lf] ……………… Outputs the specified variable A% from the communication
port.

Response:
150 [cr/lf]

Sample 2 Description

SEND CMU TO A% [cr/lf] ………… Inputs the specified variable A% from the communication port.

Response:
300 [cr/lf] ……………………………………… Data input to the controller.
OK [cr/lf] ……………………………………… Result output from the controller.

10-54 Chapter 10 Data file description


Variable file
7
26.2 Static variables

26.2.1 Integer type static variables (SGI)


8
26.2.1.1 All integer type static variables
Read-out 3 When used as a read-out file, all integer type static variables currently stored are read out.
Write 3 When used as a write file, a specified integer type static variable is written. 9
Format

SGI
10
Meaning Expresses all integer static variables.

Data Format 11
SGIn=xxxxxx [cr/lf]
SGIn=xxxxxx [cr/lf]
:
SGIn=xxxxxx [cr/lf] 12
[cr/lf]

Notation Value Range 13


n Integer type static variable number 0 to 31

xxxxxx Integer -2147483647 to 2147483647

A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND SGI TO CMU ……………… Outputs all integer type static variables from the communication
port.
SEND CMU TO SGI ……………… Inputs all integer type static variables from the communication
port.

Response:
RUN [cr/lf]
SGR0=0 [cr/lf]
SGR1=0 [cr/lf]
:
SGR31=0 [cr/lf]
[cr/lf]
END [cr/lf]

Variable file 10-55


Variable file
7
26.2.1.2 One integer type static variables

8
Read-out 3
Write 3

Format

SGIn
9
Meaning Expresses a specified integer type static variable.

10 Data Format

xxxxxx [cr/lf]

11
Notation Value Range
n Integer type static variable number 0 to 31

12 xxxxxx Integer -2147483647 to 2147483647

Sample Description

13 SEND SGI1 TO CMU ……………… Outputs the specified integer type static variables (SGI1)
from the communication port.
SEND CMU TO SGI1 ……………… Inputs the specified integer type static variables (SGI1)
from the communication port.

Response:
RUN [cr/lf]
0 [cr/lf]
END [cr/lf]

10-56 Chapter 10 Data file description


Variable file
7
26.2.2 Real type static variables (SGR)

26.2.2.1 All real type static variables


8
Read-out 3 When used as a read-out file, all real type static variables currently stored are read out.
Write 3 When used as a write file, a specified real type static variable is written.

Format 9
SGR

Meaning Expresses all real type static variables. 10


Data Format

SGRn=xxxxxx [cr/lf]
SGRn=xxxxxx [cr/lf]
11
:
SGRn=xxxxxx [cr/lf]
[cr/lf]
12
Notation Value Range
n Real type static variable number 0 to 31

xxxxxx Real number 7 digits or less including decimal fractions


13

A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND SGR TO CMU ……………… Outputs all real type static variables from the communication
port.
SEND CMU TO SGR ……………… Inputs all real type static variables from the communication
port.

Response:
RUN [cr/lf]
SGI0=0 [cr/lf]
SGI1=0 [cr/lf]
:
SGI31=0 [cr/lf]
[cr/lf]
END [cr/lf]

Variable file 10-57


Variable file
7
26.2.2.2 One real type static variables

8
Read-out 3
Write 3

Format

SGRn
9
Meaning Expresses a specified real type static variable.

10 Data Format

xxxxxx [cr/lf]

11
Notation Value Range
n Real type static variable number 0 to 31

12 xxxxxx Real number 7 digits or less including decimal fractions

Sample Description

13
SEND SGR1 TO CMU ……………………… Outputs the specified real type static variables (SGR1)
from the communication port.
SEND CMU TO SGR1 ……………………… Inputs the specified real type static variables (SGR1)
from the communication port.

Response:
RUN [cr/lf]
0 [cr/lf]
END [cr/lf]

10-58 Chapter 10 Data file description


27 Constant file
7
27.1 One character string

8
Read-out 3 When used as a read-out file, the specified character string is read out.
Write - This file cannot be used as a write file.

Format

"character string"
9
Meaning Expresses a specified character string.

Data Format 10
sssss...ssssss[cr/lf]

11
Notation Value Range
sssss...ssssss Character string 255 characters or less

12
Output of " symbol (double quotation) is shown with successive " symbol.
Sample Description

13
SEND """YAMAHA ROBOT""" TO CMU ……………………… Outputs the specified character string
from the communication port.

Response:
"YAMAHA ROBOT"[cr/lf]

Constant file 10-59


28 Array variable file
7
28.1 All array variables

8
Read-out 3 When used as a read-out file, all array variables are read out.
Write 3 When used as a write file, a specified array variable is written.

Format

ARY
9
Meaning Expresses all array variables.

Data Format
10 variable name t(l{,m{,n}}) = xxxxxx [cr/lf]
variable name t(l{,m{,n}}) = xxxxxx [cr/lf]
:
variable name t(l{,m{,n}}) = xxxxxx [cr/lf]

11
[cr/lf]

Notation Value Range / Meaning


Variable Global variable Variable name is shown with 32 characters or less

12
name defined in the DIM statement consisting of alphanumeric characters and _ (underscore).

t Type of variable !: Real number / %: Integer / $: Character string

l, m, n Array arguments

13
Integer type: Integer of -2147483647 to 2147483647
xxxxxx Value of variable Real type: Real number of 7 digits or less including decimal fractions
Character type: Character string of 255 characters or less

A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description
SEND ARY TO CMU ……………… Outputs all global array variables from the communication port.
SEND CMU TO ARY ……………… Inputs all global array variables from the communication port.

Response:
RUN [cr/lf]
A!(0)=0 [cr/lf]
A!(1)=1.E2 [cr/lf]
A!(2)=2.E2 [cr/lf]
B%(0,0)=0 [cr/lf]
B%(0,1)=1111 [cr/lf]
B%(1,0)=2222 [cr/lf]
B%(1,0)=3333 [cr/lf]
C$(0,0,0)= “ARY1” [cr/lf]
C$(0,0,1)= “ARY2” [cr/lf]
C$(0,1,0)= “ARY3” [cr/lf]
C$(0,1,1)= “ARY4” [cr/lf]
C$(1,0,0)= “ARY5” [cr/lf]
C$(1,0,1)= “ARY6” [cr/lf]
C$(1,1,0)= “ARY7” [cr/lf]
C$(1,1,1)= “ARY8” [cr/lf]
[cr/lf]
END [cr/lf]

10-60 Chapter 10 Data file description


Array variable file
7
28.2 One array variable

8
Read-out 3
Write 3

Format

variable name t(l {,m {,n }})


9
Meaning Expresses one array variable.

Data Format 10
xxxxxx [cr/lf]

11
Notation Value Range / Meaning
Variable Global variable Variable name is shown with 32 characters or less
name defined in the DIM statement consisting of alphanumeric characters and _ (underscore).

t Type of variable !: Real number / %: Integer / $: Character string


12
l, m, n Array arguments

Integer type: Integer of -2147483647 to 2147483647


xxxxxx Value of variable Real type: Real number of 7 digits or less including decimal fractions
Character type: Character string of 255 characters or less
13

Array variables defined by the DIM statement are registered during compiling. Array variables cannot be referred
to unless they are registered.

Sample 1 Description

SEND C1$(2) TO CMU ……… Outputs the specified array variable C1$(2) from the
communication port.

Response:
YAMAHA ROBOT [cr/lf]

Sample 2 Description

SEND CMU TO C1$(2) ……… Inputs the specified array variable C1$(2) from the
communication port.

Response:
OK [cr/lf]

Array variable file 10-61


29 DI file
7
29.1 All DI information

8
Read-out 3 When used as a read-out file, all DI information is read out.
Write - This file cannot be used as a write file.

Format

DI()
9
Meaning Expresses all DI (parallel input variable) information.

10 Data Format

DI0()=&Bnnnnnnnn [cr/lf]
DI1()=&Bnnnnnnnn [cr/lf]

11
:
DI27()=&Bnnnnnnnn [cr/lf]
[cr/lf]

12 Notation Value Range


Port status "0" or "1" (total of 8 digits)
n
(Binary counting) Corresponds to m7, m6, …,m0, reading from the left ("m": port No.).

13
A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description
SEND DI() TO CMU ……………… Outputs all DI information from the communication port.

Response:
DI0()=&B10001001[cr/lf]
DI1()=&B00000010[cr/lf]
DI2()=&B00000000[cr/lf]
:
DI7()=&B00000000[cr/lf]
DI10()=&B00000000[cr/lf]
DI11()=&B00000000[cr/lf]
DI12()=&B00000000[cr/lf]
:
DI17()=&B00000000[cr/lf]
DI20()=&B00000000[cr/lf]
:
DI26()=&B00000000[cr/lf]
DI27()=&B00000000[cr/lf]
[cr/lf]
END [cr/lf]

10-62 Chapter 10 Data file description


DI file
7
29.2 One DI port

8
Read-out 3 When used as a read-out file, the specified DI port status is read out.
Write - This file cannot be used as a write file.

Format

DIm()
9
Meaning Expresses the status of one DI port.

Data Format 10
DIm()=&Bnnnnnnnn[cr/lf]

11
Notation Value Range
m Port number 0 to 7 / 10 to 17 / 20 to 27

n
Port status
(Binary counting)
"0" or "1" (total of 8 digits)
Corresponds to m7, m6, …,m0, reading from the left ("m": port No.).
12

Sample Description

SEND DI5() TO CMU …………… Outputs the DI5 port status from the communication port.
13
Response:
RUN [cr/lf]
DI15()=&B00000000 [cr/lf]
END [cr/lf]

DI file 10-63
30 DO file
7
30.1 All DO information

8
Read-out 3 When used as a read-out file, all DO information is read out.
3 When used as a write file, the value is written to the specified DO port.
Write
Restricted* *Writing to DO0() and DO1() is prohibited.

Format

9 DO()

Meaning Expresses all DO (parallel output variable) information.

10 Data Format

DO0()=&Bnnnnnnnn [cr/lf]
DO1()=&Bnnnnnnnn [cr/lf]

11
:
DO27()=&Bnnnnnnnn [cr/lf]
[cr/lf]

12 Notation Value Range


Port status "0" or "1" (total of 8 digits)
n
(Binary counting) Corresponds to m7, m6, …,m0, reading from the left ("m": port No.).

13
A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND DO() TO CMU …………… Outputs all DO information from the communication port.

Response:
RUN [cr/lf]
DO0()=&B10001001[cr/lf]
DO1()=&B00000010[cr/lf]
DO2()=&B00000000[cr/lf]
:
DO7()=&B00000000[cr/lf]
DO10()=&B00000000[cr/lf]
DO11()=&B00000000[cr/lf]
DO12()=&B00000000[cr/lf]
:
DO17()=&B00000000[cr/lf]
DO20()=&B00000000[cr/lf]
:
DO26()=&B00000000[cr/lf]
DO27()=&B00000000[cr/lf]
[cr/lf]
END [cr/lf]

10-64 Chapter 10 Data file description


DO file
7
30.2 One DO port

8
Read-out 3 When used as a read-out file, the specified DO port status is read out.
3 When used as a write file, the value is written to the specified DO port.
Write
Restricted* *Writing to DO0() and DO1() is prohibited.

Format

DOm() 9

Meaning Expresses the status of one DO port.


10
Writing to DO0() and DO1() is prohibited. Only referencing is permitted.

11
Readout file
Data Format

DOm()=&Bnnnnnnnn[cr/lf]
12
Write file
Data Format

&Bnnnnnnnn[cr/lf] or k[cr/lf]
13

Notation Value Range


m Port number 0 to 7 / 10 to 17 / 20 to 27

Port status "0" or "1" (total of 8 digits)


n
(Binary counting) Corresponds to m7, m6, …,m0, reading from the left ("m": port No.).

Port status
k Integer from 0 to 255
(Decimal counting)

Sample 1 Description

SEND DO5() TO CMU …………… Outputs the DO5 port status from the communication port.

Response:
RUN [cr/lf]
DO5()=&B00000000[cr/lf]
END [cr/lf]

Sample 2 Description

SEND CMU TO DO5() …………… Inputs the DO5 port status from the communication port.

&B00000111

Response:
OK [cr/lf]

DO file 10-65
31 MO file
7
31.1 All MO information

8
Read-out 3 When used as a read-out file, all MO information is read out.
3 When used as a write file, the value is written to the specified MO port.
Write
Restricted* *Writing to MO30() and DO37() is prohibited.

Format

9 MO()

Meaning Expresses all MO (internal output variable) information.

10 Data Format

MO0()=&Bnnnnnnnn [cr/lf]
MO1()=&Bnnnnnnnn [cr/lf]

11
:
MO37()=&Bnnnnnnnn [cr/lf]
[cr/lf]

12 Notation Value Range


Port status "0" or "1" (total of 8 digits)
n
(Binary counting) Corresponds to m7, m6, …,m0, reading from the left ("m": port No.).

13
A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND MO() TO CMU …………… Outputs all MO information from the communication port.

Response:
RUN [cr/lf]
MO0()=&B10001001 [cr/lf]
MO1()=&B00000010 [cr/lf]
MO2()=&B00000000 [cr/lf]
:
MO7()=&B00000000 [cr/lf]
MO10()=&B00000000 [cr/lf]
MO11()=&B00000000 [cr/lf]
MO12()=&B00000000 [cr/lf]
:
MO17()=&B00000000 [cr/lf]
MO20()=&B00000000 [cr/lf]
:
MO27()=&B00000000 [cr/lf]
MO30()=&B00000000 [cr/lf]
:
MO36()=&B00000000 [cr/lf]
MO37()=&B00000000 [cr/lf]
[cr/lf]
END [cr/lf]

10-66 Chapter 10 Data file description


MO file
7
31.2 One MO port

8
Read-out 3 When used as a read-out file, the specified MO port status is read out.
3 When used as a write file, the value is written to the specified MO port.
Write
Restricted* *Writing to MO30() to MO37() is prohibited.

Format

MOm() 9
Meaning Expresses the status of one MO port.

10
Writing to MO30() to MO37() is prohibited. Only referencing is permitted.

Readout file 11
Data Format

MOm()=&Bnnnnnnnn[cr/lf]

12
Write file
Data Format

13
&Bnnnnnnnn[cr/lf] or k[cr/lf]

Notation Value Range


m Port number 0 to 7 / 10 to 17 / 20 to 27 / 30 to 37

Port status "0" or "1" (total of 8 digits)


n
(Binary counting) Corresponds to m7, m6, …,m0, reading from the left ("m": port No.).

Port status
k Integer from 0 to 255
(Decimal counting)

Sample 1 Description

SEND MO5() TO CMU …………… Outputs the MO5 port status from the communication port.
Response:
RUN [cr/lf]
MO5()=&B00000000[cr/lf]
END [cr/lf]

Sample 2 Description

SEND CMU TO MO5() …………… Inputs the MO5 port status from the communication port.
&B00000111

Response:
OK [cr/lf]

MO file 10-67
32 LO file
7
32.1 All LO information

8
Read-out 3 When used as a read-out file, all LO information is read out.
Write 3 When used as a write file, the value is written to the specified LO port.

Format

LO()
9
Meaning Expresses all LO (internal output variable) information.

Data Format
10 LO0()=&Bnnnnnnnn [cr/lf]
LO1()=&Bnnnnnnnn [cr/lf]
[cr/lf]

11 Notation Value Range


Port status "0" or "1" (total of 8 digits)
n
(Binary counting) Corresponds to m7, m6, …,m0, reading from the left ("m": port No.).

12
A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

13 SEND LO() TO CMU …………………………………… Outputs all LO status from the communication port.

Response:
RUN [cr/lf]
LO0()=&B10001001 [cr/lf]
LO1()=&B00100100 [cr/lf]
[cr/lf]
END [cr/lf]

10-68 Chapter 10 Data file description


LO file
7
32.2 One LO port

8
Read-out 3 When used as a read-out file, the specified LO port status is read out.
Write 3 When used as a write file, the value is written to the specified LO port.

Format

LOm()
9
Meaning Expresses the status of one LO port.

Readout file
Data Format 10
LOm()=&Bnnnnnnnn[cr/lf]

Write file 11
Data Format

&Bnnnnnnnn[cr/lf] or k[cr/lf]

12
Notation Value Range
m Port number 0, 1

n
Port status
(Binary counting)
"0" or "1" (total of 8 digits)
Corresponds to m7, m6, …,m0, reading from the left ("m": port No.).
13
Port status
k Integer from 0 to 255
(Decimal counting)

Sample 1 Description

SEND LO0() TO CMU …………… Outputs the LO0 port status from the communication port.

Response:
RUN [cr/lf]
LO0()=&B00000000[cr/lf]
END [cr/lf]

Sample 2 Description

SEND CMU TO LO0() …………… Inputs the LO0 port status from the communication port.
&B00000111

Response:
OK [cr/lf]

LO file 10-69
33 TO file
7
33.1 All TO information

8
Read-out 3 When used as a read-out file, all TO information is read out.
Write 3 When used as a write file, the value is written to the specified TO port.

Format

TO()
9
Meaning Expresses all TO (timer output variable) information.

Data Format
10 TO0()=&Bnnnnnnnn [cr/lf]
TO1()=&Bnnnnnnnn [cr/lf]
[cr/lf]

11
Notation Value Range
Port status "0" or "1" (total of 8 digits)
n
(Binary counting) Corresponds to m7, m6, …,m0, reading from the left ("m": port No.).
12
A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description
13 SEND TO() TO CMU …………………………………… Outputs all TO status from the communication port.
SEND CMU TO TO() …………………………………… Inputs all TO status from the communication port.

Response:
RUN [cr/lf]
TO0()=&B10001001 [cr/lf]
TO1()=&B10001001 [cr/lf]
[cr/lf]
END [cr/lf]

10-70 Chapter 10 Data file description


TO file
7
33.2 One TO port

8
Read-out 3 When used as a read-out file, the specified TO port status is read out.
Write 3 When used as a write file, the value is written to the specified TO port.

Format

TOm()
9
Meaning Expresses the status of one TO port.

Readout file
Data Format 10
TOm()=&Bnnnnnnnn[cr/lf]

Write file 11
Data Format

&Bnnnnnnnn[cr/lf] or k[cr/lf]

12
Notation Value Range
m Port number 0, 1

n
Port status "0" or "1" (total of 8 digits) 13
(Binary counting) Corresponds to m7, m6, …,m0, reading from the left ("m": port No.).

Port status
k Integer from 0 to 255
(Decimal counting)

Sample 1 Description

SEND TO0() TO CMU …………… Outputs the TO0 port status from the communication port.

Response:
RUN [cr/lf]
TO0()=&B00000000[cr/lf]
END [cr/lf]

Sample 2 Description

SEND CMU TO TO0() …………… Inputs the TO0 port status from the communication port.
&B00000111

Response:
OK [cr/lf]

TO file 10-71
34 SI file
7
34.1 All SI information

8
Read-out 3 When used as a read-out file, all SI information is read out.
Write - This file cannot be used as a write file.

Format

SI()
9
Meaning Expresses all SI (serial input variable) information.

Data Format
10 SI0()=&Bnnnnnnnn [cr/lf]
SI1()=&Bnnnnnnnn [cr/lf]
:
SI27()=&Bnnnnnnnn [cr/lf]
11 [cr/lf]

Notation Value Range


12 n
Port status "0" or "1" (total of 8 digits)
(Binary counting) Corresponds to m7, m6, …,m0, reading from the left ("m": port No.).

13
A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND SI() TO CMU …………………………………… Outputs all SI status from the communication port.

Response:
RUN [cr/lf]
SI0()=&B10001001[cr/lf]
SI1()=&B00000010[cr/lf]
SI2()=&B00000000[cr/lf]
:
SI7()=&B00000000[cr/lf]
SI10()=&B00000000[cr/lf]
SI11()=&B00000000[cr/lf]
SI12()=&B00000000[cr/lf]
:
SI17()=&B00000000[cr/lf]
SI20()=&B00000000[cr/lf]
:
SI26()=&B00000000[cr/lf]
SI27()=&B00000000[cr/lf]
[cr/lf]
END [cr/lf]

10-72 Chapter 10 Data file description


SI file
7
34.2 One SI port

8
Read-out 3 When used as a read-out file, the specified SI port status is read out.
Write - This file cannot be used as a write file.

Format

SIm()
9
Meaning Expresses the status of one SI port.

Data Format

SIm()=&Bnnnnnnnn[cr/lf]
10

Notation Value Range


11
m Port number 0 to 7/ 10 to 17/ 20 to 27

Port status "0" or "1" (total of 8 digits)


n
(Binary counting) Corresponds to m7, m6, …,m0, reading from the left ("m": port No.).

12
Sample Description

SEND SI5() TO CMU …………………… Outputs the SI5 port status from the communication port.
13
Response:
RUN [cr/lf]
SI5()=&B00000000 [cr/lf]
END [cr/lf]

SI file 10-73
35 SO file
7
35.1 All SO information

8
Read-out 3 When used as a read-out file, all SO information is read out.
3 When used as a write file, the value is written to the specified SO port.
Write
Restricted* *Writing to SO0() and SO1() is prohibited.

Format

9 SO()

Meaning Expresses all SO (serial output variable) information.

10 Data Format

SO0()=&Bnnnnnnnn [cr/lf]
SO1()=&Bnnnnnnnn [cr/lf]

11
:
SO27()=&Bnnnnnnnn [cr/lf]
[cr/lf]

12 Notation Value Range


Port status "0" or "1" (total of 8 digits)
n
(Binary counting) Corresponds to m7, m6, …,m0, reading from the left ("m": port No.).

13
A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND SO() TO CMU …………………………………… Outputs all SO status from the communication port.

Response:
RUN [cr/lf]
SO0()=&B10001001[cr/lf]
SO1()=&B00000010[cr/lf]
SO2()=&B00000000[cr/lf]
:
SO7()=&B00000000[cr/lf]
SO10()=&B00000000[cr/lf]
SO11()=&B00000000[cr/lf]
SO12()=&B00000000[cr/lf]
:
SO17()=&B00000000[cr/lf]
SO20()=&B00000000[cr/lf]
:
SO26()=&B00000000[cr/lf]
SO27()=&B00000000[cr/lf]
[cr/lf]
END [cr/lf]

10-74 Chapter 10 Data file description


SO file
7
35.2 One SO port

8
Read-out 3 When used as a read-out file, the specified SO port status is read out.
3 When used as a write file, the value is written to the specified SO port.
Write
Restricted* *Writing to SO0() and SO1() is prohibited.

Format

SOm() 9

Meaning Expresses the status of one SO port.


10

Writing to SO0() and SO1() is prohibited. Only referencing is permitted.

11
Readout file
Data Format

SOm()=&Bnnnnnnnn[cr/lf]
12
Write file
Data Format

SOm()=&Bnnnnnnnn[cr/lf]
13

Notation Value Range


m Port number 0 to 7 / 10 to 17 / 20 to 27

Port status "0" or "1" (total of 8 digits)


n
(Binary counting) Corresponds to m7, m6, …,m0, reading from the left ("m": port No.).

Port status
k Integer from 0 to 255
(Decimal counting)

Sample 1 Description

SEND SO5() TO CMU ………………………… Outputs the SO5 port status from the communication port.
Response:
RUN [cr/lf]
SO5()=&B00000000[cr/lf]
END [cr/lf]

Sample 2 Description

SEND CMU TO SO5() ………………………… Inputs the SO5 port status from the communication port.
&B00000111

Response:
OK [cr/lf]

SO file 10-75
36 SIW file
7
36.1 All SIW data

8
Read-out 3 When used as a read-out file, all SIW information is read out in hexadecimal digit.
Write - This file cannot be used as a write file.

Format

SIW()
9
Meaning Expresses all SIW (serial word input) data.

Data Format *
10 SIW(0)=&Hnnnn [cr/lf]
SIW(1)=&Hnnnn [cr/lf]
:
SIW(15)=&Hnnnn [cr/lf]
11 [cr/lf]

Notation Value Range


12 n
Port status
0 to 9 and A to F: 4 digits (hexadecimal)
(Hexadecimal counting)

13 A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample * Description

SEND SIW() TO CMU ………………………………… Outputs all SIW data from the communication port.

Response:
RUN [cr/lf]
SIW(0)=&H1001[cr/lf]
SIW(1)=&H0010[cr/lf]
SIW(2)=&H0000[cr/lf]
:
SIW(15)=&H0000[cr/lf]
[cr/lf]
END [cr/lf]

*When SIOW extension is enabled, SIW(24) - SIW(127) are also read-out.


For details, refer to RCX3 user's /operator’s manual "Option board related parameters".

10-76 Chapter 10 Data file description


SIW file
7
36.2 One SIW data

8
Read-out 3 When used as a read-out file, the specified SIW status is read out in hexadecimal digit.
Write - This file cannot be used as a write file.

Format

SIW(m)
9
Meaning Expresses one SIW status.

Data Format 10
SIW(m)=&Hnnnn [cr/lf]

Notation Value Range


11
m Port number 2 to 15 *

Port status

12
n 0 to 9 and A to F: 4 digits (hexadecimal)
(Hexadecimal counting)

*When SIOW extension is enabled, the range of port number is extended to 2 -15, 24 - 127.
For details, refer to RCX3 user's /operator’s manual "Option board related parameters".

Sample Description
13
SEND SIW(5) TO CMU ………………………………………………… Outputs SIW(5) from the communication port.

Response:
RUN [cr/lf]
SIW(5)=&H1001[cr/lf]
END [cr/lf]

SIW file 10-77


37 SOW file
7
37.1 All SOW

8
Read-out 3 When used as a read-out file, all SOW information is read out in hexadecimal digit.
3 When used as a write file, the value is written to the specified SOW port
Write
Restricted*1 *1) Writing to SOW(0) and SOW(1) is prohibited.

Format

9 SOW()

Meaning Expresses all SOW (serial word output) data.


10
Data Format *2

SOW(0)=&Hnnnn [cr/lf]

11
SOW(1)=&Hnnnn [cr/lf]
:
SOW(15)=&Hnnnn [cr/lf]
[cr/lf]

12
Notation Value Range
Port status
n 0 to 9 and A to F: 4 digits (hexadecimal)
(Hexadecimal counting)

13

A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample *2 Description

SEND SOW() TO CMU …………………………………… Outputs all SOW data from the communication port.

Response:
RUN [cr/lf]
SOW(0)=&H1001[cr/lf]
SOW(1)=&H0010[cr/lf]
SOW(2)=&H0000[cr/lf]
:
SOW(15)=&H0000[cr/lf]
[cr/lf]
END [cr/lf]

*2) When SIOW extension is enabled, SIW(24) - SIW(127) are also read-out.
For details, refer to RCX3 user's /operator’s manual "Option board related parameters".

10-78 Chapter 10 Data file description


SOW file
7
37.2 One SOW data

8
When used as a read-out file, the specified SOW port status is read out
Read-out 3
in hexadecimal digit.
3 When used as a write file, the value is written to the specified SOW port.
Write
Restricted *1 *1) Writing to SOW(0) and SOW(1) is prohibited.

Format
9
SOW(m)

Meaning Expresses one SOW status. 10

Readout file
Data Format 11
SOW(m)=&Hnnnn [cr/lf]

Write file 12
Data Format

&Hnnnn

13
Notation Value Range
m Port number 2 to 15 *2

Port status
n 0 to 9 and A to F: 4 digits (hexadecimal)
(Hexadecimal counting)

*When SIOW extension is enabled, the range of port number is extended to 2 -15, 24 - 127.
For details, refer to RCX3 user's /operator’s manual "Option board related parameters".

A line containing only [cr/lf] is added at the end of the file, indicating the end of the file.
Sample Description

SEND SOW(5) TO CMU ………………………………………………… Outputs SOW(5) from the communication port.

Response:
RUN [cr/lf]
SOW(5)=&H1001[cr/lf]
END [cr/lf]

SOW file 10-79


38 EOF file
7
Read-out 3 When used as a read-out file, ^Z (=1Ah) is read out.
Write - This file cannot be used as a write file.

8 Format

EOF

9 Meaning T
 his file is a special file consisting only of a ^Z (=1Ah) code.
When transmitting data to an external device through the communication port,
the EOF data can be used to add a ^Z code at the end of file.

10 Data Format

^Z (=1Ah)

11 Sample Description

SEND PGM TO CMU


SEND EOF TO CMU ………………………… Outputs EOF data from the communication port.

12 NAME=TEST1[cr/lf]
A=1[cr/lf]
:
HALT[cr/lf]
13 [cr/lf]
^Z

A "^Z" code may be required at the end of the transmitted file, depending on the specifications of the receiving
device and application.

10-80 Chapter 10 Data file description


39 Serial port communication file
7
Read-out 3
Write 3

Format 8
CMU

9
Meaning • Expresses the serial communication port.
• Depends on the various data formats.

Sample Description
10
SEND PNT TO CMU ………………………… Outputs all point data from the communication port.
SEND CMU TO PNT ………………………… Inputs all point data from the communication port.

11

12

13

Serial port communication file 10-81


40 Ethernet port communication file
7
Read-out 3
Write 3

8 Format

ETH

9 Meaning • Expresses the Ethernet port.


• Depends on the various data formats.

Sample Description
10
SEND PNT TO ETH ………………………………………………………… Outputs all point data from the Ethernet port.
SEND ETH TO PNT ………………………………………………………… Inputs all point data from the Ethernet port.

11

12

13

10-82 Chapter 10 Data file description


Chapter 11
User program examples

1 1 Basic operation....................................... 11-1


2 2 Application.............................................. 11-8
1 Basic operation
7
1.1 Directly writing point data in program
• Overview
The robot arm can be moved by PTP (point-to-point) motion by directly specifying point data in the program. 8
Processing flow

START
9

300.000 300.000 50.000 90.000 0.000 0.000 PTP movement


300.000
200.000
100.000
200.000
0.000
10.000
0.000
-90.000
0.000
0.000
0.000
0.000
PTP movement
PTP movement
10

STOP
33C01-R7-00
11
Sample

12
MOVE P, 300.000 300.000 50.000 90.000 0.000 0.000
MOVE P, 300.000 100.000 0.000 0.000 0.000 0.000
MOVE P, 200.000 200.000 10.000 -90.000 0.000 0.000
HALT

13

Basic operation 11-1


1.2 Using point numbers
7 • Overview
Coordinate data can be specified by using point numbers in a program. Coordinate data should be entered beforehand
from the programming box or the support software, for example as shown below.
Reference For details, refer to the operator's manual or the RCX-Studio software manual
8
Point Data
P0= 0.000 0.000 0.000 0.000 0.000 0.000

9
P1= 100.000 0.000 150.000 30.000 0.000 0.000
P2= 0.000 100.000 50.000 0.000 0.000 0.000
P3= 300.000 300.000 0.000 0.000 0.000 0.000
P4= 300.000 100.000 100.000 90.000 0.000 0.000
P5= 200.000 200.000 0.000 0.000 0.000 0.000

10
Processing flow

11 START

PTP movement to P0
PTP movement to P1

12 PTP movement to P2
PTP movement to P3
PTP movement to P4
PTP movement to P5

13 STOP

33C02-R7-00

Sample 1
MOVE P,P0
MOVE P,P1
MOVE P,P2
MOVE P,P3
MOVE P,P4
MOVE P,P5
HALT

Sample 2
FOR J=0 TO 5
MOVE P,P[J]
NEXT J
HALT

Although the same operation is executed by both SAMPLE 1 and SAMPLE 2, the program can be shortened by using
point numbers and the FOR statement.

11-2 Chapter 11 User program examples


1.3 Using shift coordinates
• Overview 7
In the example shown below, after PTP movement from P3 to P5, the coordinate system is shifted +140mm along the
X-axis and -100mm along the Y-axis, and the robot then moves from P3 to P5 again. The shift coordinate data is set in
S1 and P3, P4, P5 are set as described in the previous section ("1.2 Using point numbers").
8
Shift Data
S0= 0.000 0.000 0.000 0.000

9
S1= 140.000 -100.000 0.000 0.000

Shift Coordinate
10
Y+

P3

X: 140mm shift, Y: -100mm shift


11
P5

Shift Coordinate
S0
Shift Coordinate
P4
12
S1
X+
0
100
13
140

33C03-R7-00

Sample Description

SHIFT S0 ………………………………………… Shift 0.


FOR J=3 TO 5 ………………………………… Repeated movement from P3 to P5.
MOVE P, P[J]
NEXT J
SHIFT S1 …………………………………………… Changed to "shift 1".
FOR K=3 TO 5…………………………………… Repeated movement occurs in the same manner from P3 to P5.
MOVE P,P[K]
NEXT K
HALT

Basic operation 11-3


1.4 Palletizing
7 1.4.1 Calculating point coordinates
• Overview
Repetitive movement between a fixed work supply position P0 and each of the equally spaced points on a pallet can
8 be performed with the following program.
In the drawing below, points N1 to N20 are on Cartesian coordinates, consisting of 5 points positioned at a 50mm
pitch in the X-axis direction and 4 points at a 25mm pitch in the Y-axis direction. The robot arm moves from point to
point in the order of P0-N1-P0-N2...N5-P0-N6-P0... while repeatedly moving back and forth between point P0 and
9 each pallet.

Point Data

10
Work supply position:
P0= 0.000 0.000 0.000 0.000 0.000 0.000
X-axis pitch:
P10= 50.000 0.000 0.000 0.000 0.000 0.000
Y-axis pitch:

11 P20=
N1 position:
0.000 25.000 0.000 0.000 0.000 0.000

P1 = 100.000 50.000 0.000 0.000 0.000 0.000

12 Calculating point coordinates

Y+

N16 N17 N18 N19 N20

13
N11 N12 N13 N14 N15

N6 N7 N8 N9 N10

25 X+
N1 N2 N3 N4 N5

50 P0
33C04-R7-00

Processing flow

START

P200=P1 P1 coordinates are input at P200.


P100=P1 P1 coordinates are input at P100.

Movement to P0 Movement to supply position.


Repeat 5 times Movement to P100 Movement to P100
P100=P100+P10 P100 is shifted by the pitch amount
in the X-direction.
Repeat 4 times

P200=P200+P20 Movement to P200


P100=P200 P200 is shifted by the pitch amount
in the Y-direction.

STOP
31C05-R7-00

11-4 Chapter 11 User program examples


Sample
P100=P1
P200=P1
7
FOR J=1 TO 4
FOR K=1 TO 5
MOVE P,P0
MOVE P,P100 8
P100=P100+P10
NEXT K
P200=P200+P20

NEXT J
P100=P200
9
HALT

10

11

12

13

Basic operation 11-5


1.4.2 Utilizing pallet movement
7 • Overview
Repetitive movement between a fixed work supply position P0 and each of the equally spaced points on a pallet can
be performed with the following program. In the drawing below, points N1 to N24 are on Cartesian coordinates,
consisting of 3 points positioned at a 50mm pitch in the X-axis direction, 4 points at a 50mm pitch in the Y-axis
8 direction, and 2 points at 100mm pitch in the Z-axis direction. The robot arm moves from point to point in the order
of P0-N1-P0-N2...-N5-P0-N6... while repeatedly moving back and forth between point P0 and each pallet.

Point Data
9 Work supply position:
P0= 0.000 0.000 200.000 0.000 0.000 0.000
Pallet definition:
PL0
10 NX= 3
NY= 4
NZ= 2
PLP=3996 (P3996 to P4000 are used)

11
P[1]= 100.000 50.000 200.000 0.000 0.000 0.000
P[2]= 200.000 50.000 200.000 0.000 0.000 0.000
P[3]= 100.000 200.000 200.000 0.000 0.000 0.000
P[4]= 200.000 200.000 200.000 0.000 0.000 0.000
P[5]= 100.000 50.000 100.000 0.000 0.000 0.000

12
Utilizing pallet movement N24

13 P4000 N16

N13 N14 N15


P3998 P3999
NZ N11 N12
NY

N4 N5

N1 N2 N3
P0
P3996 P3997
NX

33C06-R9-00

Processing flow
START

Movement to P0 Movement to supply position (P0).


Repeat 24 times
Pallet movement Repeated for points N1 to N24.

STOP

33C07-R7-00

Sample Description

FOR I=1 TO 24 ……………………………………………………………… Repeated for I = 1 to 24.


MOVE P,P0,Z=0.000 ………………………………… Movement of robot 1 to supply position.
PMOVE (0,I),Z=0.000 …………………………… Movement of robot 1 to pallet point.
NEXT I
MOVE P,P0,Z=0.000
HALT

11-6 Chapter 11 User program examples


1.5 DI/DO (digital input and output) operation
• Overview 7
The following example shows input/ output signal operations through the general-purpose input/ output device.

Processing flow
8
START

Wait until DI2( ) is all at "0".


Set all of DO2 ( ) to "1".
Wait until DI20 to DI27 become "0".
DO20 to DO27 become "1".
9
Wait 1 second.
Wait until DI2 (0) is at "1". Wait until DI20 becomes "1".

N=1 "1" is assigned to "N". 10

Y
DI2 (1)="1"?

Set DO2 (7, 6, 1, 0) to "1".


11
N Wait 2 seconds
Set all of DO2 ( ) to "0".
Y
N>20

END
12
N

Set all of DO2 ( ) to “0”.


Wait 0.5 seconds • DO processing ends if DI2(1) is "1".
N=N+1 • Repeated until N=20 if DI2(1) is "0".
13
33C08-R7-00

Sample Description

WAIT DI2()=0 ………………………………………………………………… Waits until DI20 to DI27 become "0".


DO2()=&B11111111 ……………………………………………………… DO20 to DO27 become "1".
DELAY 1000
WAIT DI2(0)=1 ……………………………………………………………… Waits until DI20 becomes "1".
N=1
*LOOP1:
IF DI2(1)=1 THEN *PROGEND ……………………………… Jumps to *PROGEND if DI21 = 1.
IF N>20 THEN *ALLEND …………………………………………… Ended in N > 20 (jumps to *ALLEND).
DO2()=0 ……………………………………………………………………………… DO20 to DO27 become "0".
DELAY 500
N=N+1
GOTO *LOOP1 …………………………………………………………………… Loop is repeated.
’END ROUTINE
*PROGEND: ………………………………………………………………………… End processing.
DO2(7,6,1,0)=&B1111 ……………………………………………… Sets DO27, 26, 21, 20 to "1".
DELAY 2000 ……………………………………………………………………… Waits 2 seconds.
DO2()=0 ……………………………………………………………………………… Sets DO20 to "0".
*ALLEND:
HALT

Basic operation 11-7


2 Application
7
2.1 Pick and place between 2 points
• Overview
8 The following is an example for picking up a part at point A and placing it at point B.

Pick and place between 2 points

9 Z
0

P3 30mm P4

10 50mm

P1 P2

11 Point A Point B

33C09-R7-00

• Precondition
12 1. Set the robot movement path.
• Movement path: P3→P1→P3→P4→P2→P4
• Locate P3 and P4 respectively at a position 50mm above P1 and P2 and set the P1 and P2 positions by teaching.
2. I/O signal
13 DO (20) Chuck (gripper) open/close 0: open, 1: close
A 0.1 second wait time is set during chuck open and close.

When calculating to find P3 and P4


Sample Description

P3=P1 ……………………………………………………… P1 coordinates are assigned to P3.


P4=P2 ……………………………………………………… P2 coordinates are assigned to P4.
LOC3(P3)=LOC3(P3)-50.000 …… Axis 3 data of P3 is shifted 50mm in upper direction.
LOC3(P4)=LOC3(P4)-50.000 …… Axis 3 data of P4 is shifted 50mm in upper direction.
MOVE P,P3
GOSUB *OPEN
MOVE P,P1
GOSUB *CLOSE
MOVE P,P3
MOVE P,P4
MOVE P,P2
GOSUB *OPEN
MOVE P,P4
HALT
*OPEN: ……………………………………………………………………… Chuck OPEN routine.
DO2(0)=0
DELAY 100
RETURN
*CLOSE: …………………………………………………………………… Chuck CLOSE routine.
DO2(0)=1
DELAY 100
RETURN

11-8 Chapter 11 User program examples


When using arch motion
Sample Description
7
P4=P2 ………………………………………………………… P2 coordinates are assigned to P4.
LOC3(P4)=LOC3(P4)-50.000 ……… Axis 3 data of P4 is shifted 50mm in upper direction.
GOSUB *OPEN

8
MOVE P,P1,A3=30.000 …………………… Arch motion at A3 = 30mm.
GOSUB *CLOSE
MOVE P,P2,A3=30.000 …………………… Arch motion at A3 = 30mm.
GOSUB *OPEN
MOVE P,P4
HALT
*OPEN: ………………………………………………………………………… Chuck OPEN routine.
9
DO2(0)=0
DELAY 100
RETURN
*CLOSE: ……………………………………………………………………… Chuck CLOSE routine. 10
DO2(0)=1
DELAY 100
RETURN

11

12

13

Application 11-9
2.2 Palletizing
7 • Overview
The following is an example for picking up parts supplied from the parts feeder and placing them on a pallet on the
conveyor. The pallet is ejected when full.

8 Palletizing

9 0

50mm

10
P1: Pallet reference position

P1 P0

11 Robot

P0: Part supply position

12
Parts feeder

13 33C10-R7-00

• Precondition
1. I/O signal
DI (30) Component detection sensor 1: Parts are supplied
DI (31) Pallet sensor 1: Pallet is loaded

DO (30) Robot hand open/close 0: Open / 1: Close


DO (31) Pallet eject 1: Eject
Robot hand open/close time is 0.1 seconds and pallet eject time is 0.5 seconds.

2. The points below should be input beforehand as point data.


P0 Part supply position
P1 Pallet reference position
P10 X direction pitch
P11 Y direction pitch

3. Vertical movement is performed to a position Z=50mm above the pallet and parts feeder.

11-10 Chapter 11 User program examples


When point is calculated
Sample Description
7
WHILE -1 …………………………………………………………… All repeated (-1 is always TRUE).
FOR A=0 TO 2
FOR B=0 TO 2

8
WAIT DI(31)=1 ……………………… Wait until a pallet "present" status occurs.
WAIT DI(30)=1 ……………………… Wait until the supplied component "present" status occurs.
DO(30)=0 …………………………………… Robot hand OPENS.
DELAY 100
MOVE P,P0,A3=50.000 ……… Movement of robot 1 to supply position.
DO(30)=1 ……………………………………
DELAY 100
Robot hand CLOSES.
9
P100=P1+P10*B+P11*A ……… Next point is calculated.
MOVE P,P100,A3=50.000 … Movement of robot 1 to calculated point.
DO(30)=0 …………………………………… Robot hand OPENS.
DELAY 100 10
NEXT
NEXT
DRIVE (3,0) …………………………………………… Only 3 axis of robot 1 moves to 0.

11
DO(31)=1 …………………………………………………… Pallet is ejected.
DELAY 500
DO(31)=0
WEND ……………………………………………………………………… Loop is repeated.
HALT

12

When using the palletizing function


Sample Description 13
*Precondition:
define at pallet "0".…………………………… All repeated.
WHILE -1
FOR A=1 TO 9
WAIT DI(31)=1 …………………………… Wait until a pallet "present" status occurs.
WAIT DI(30)=1 …………………………… Wait until the supplied component "present" status occurs.
DO(30)=0 ………………………………………… Robot hand OPENS.
DELAY 100
MOVE P,P0,A3=50.000 …………… Movement of robot 1 to supply position.
DO(30)=1 ………………………………………… Robot hand CLOSES.
DELAY 100
PMOVE(0,A),A3=50.000 ………… Movement of robot 1 to pallet point.
DO(30)=0 ………………………………………… Robot hand OPENS.
DELAY 100
NEXT
DRIVE(3,0) ……………………………………………… Only 3 axis of robot 1 moves to 0.
DO(31)=1 …………………………………………………… Pallet is ejected.
DELAY 500
DO(31)=0
WEND ……………………………………………………………………… Loop is repeated.
HALT

Application 11-11
2.3 Pick and place of stacked parts
7 • Overview
The following is an example for picking up parts stacked in a maximum of 6 layers and 3 blocks and placing them on
the conveyor.
The number of parts per block may differ from others.
8 Parts are detected with a sensor installed on the robot hand.

Pick and place of stacked parts

9 Z=0.0

10
P5 P1 P2 P3
Conveyor
Block 1 Block 2 Block 3
33C11-R7-00

11
• Precondition
1. I/O signal
DI (30) Component detection sensor 1: Parts are supplied
12 DI (31) Robot hand open/close 0: Open / 1: Close
Robot hand open/close time is 0.1 seconds.

2. The points below should be input beforehand as point data.


13 P1 Bottom of block 1
P2 Bottom of block 2
P3 Bottom of block 3
P5 Position on conveyor

3. Movement proceeds at maximum speeds but slows down when in proximity to the part.

Processing flow

High speed
P4=WHERE
Set the current position
P4=WHERE
into point data (P4)

Set the speed at maximum


P5 P1
Load the part onto
conveyor position (P5)

Slow Move to position (P4)


High speed
during parts detection
P4=WHERE

Slow down

Move to P1
P5 P1

33C12-R7-00

4. Use a STOPON condition in the MOVE statement for sensor detection during movement.

11-12 Chapter 11 User program examples


Point Data
FOR A=1 TO 3
SPEED 100
7
GOSUB *OPEN
P6=P[A]
LOC3(P6)=0.000
MOVE P,P6,A3=0.000 8
WHILE -1
SPEED 20
MOVE P,P[A],STOPON DI3(0)=1

’SENSOR ON
IF DI3(0)=0 THEN *L1
9
P4=JTOXY(WHERE)
GOSUB *CLOSE
SPEED 100
MOVE P,P5,A3=0.000
GOSUB *OPEN
10
MOVE P,P4,A3=0.000
WEND
*L1: ’SENSOR OFF
NEXT A 11
SPEED 100
DRIVE (3,0)
HALT

12
*OPEN:
DO3(0)=0
DELAY 100
RETURN
*CLOSE:
DO3(0)=1
DELAY 100
13
RETURN

Application 11-13
2.4 Parts inspection (Multi-tasking example)
7 • Overview
One robot is used to inspect two different parts and sort them according to the OK/NG results judged by a testing
device.
The robot picks up the part at point A and moves it to the testing device at point B. The testing device checks the part
8 and sends it to point C if OK or to point D if NG.
The part at point A’ is picked up and moved to the testing device at point B' in the same way. The testing device
checks the part and sends it to point C’ if OK or to point D’ if NG.
It is assumed that 10 to 15 seconds are required for the testing device to issue the OK/NG results.
9
Parts inspection (Multi-tasking example)

Part supply 1 Testing device 1 Part 1 OK Part 1 NG

10
P1 P2 P3 P4
A B C D

11
A’ B’ C’ D’

P11 P12 P13 P14

12
Part supply 2 Testing device 2 Part 2 OK Part 2 NG
33C13-R7-00

• Precondition
13 1. I/O signal

I/O signal 7 6 5 4 3 2 1 0
DO2
Testing device 1 start (0.1 second) 1: Start *1
Robot chuck open/close 0: Open / 1: Close *2

7 6 5 4 3 2 1 0
DO3
Testing device 2 start (0.1 second) 1: Start *1

7 6 5 4 3 2 1 0
DI2
Testing device 1 test completed *3
Testing device 1 OK/NG signal
Part supply 1
Part 1 OK
Part 1 NG

7 6 5 4 3 2 1 0
DI3
Testing device 2 test completed *3
Testing device 2 OK/NG signal
Part supply 2
Part 2 OK
Part 2 NG
33C14-R7-00

0.1 seconds
*1: As the start signal, supply a 0.1 second pulse signal to the testing device. ON
*2: Chuck open and close time is 0.1 seconds. OFF

*3: Each time a test is finished, the test completion signal and OK/NG signal are sent from the testing device.

After testing, the test completion signal turns ON (=1), and the OK/ NG signal turns ON (=1) when the result is OK and

turns OFF (=0) when NG.

11-14 Chapter 11 User program examples


2. The main task (task 1) is used to test part 1 and the subtask (task 2) is used to test part 2.
3. An exclusive control flag is used to allow other tasks to run while waiting for the test completion signal
from the testing device. 7
FLAG1 0: Task 1 standby (Task 2 execution enabled)
1: Executing Task 1 (Task 2 execution disabled)
FLAG2 0: Task 2 standby (Task 1 execution enabled)
1: Executing Task 2 (Task 1 execution disabled) 8
4. Flow chart Note that Task 2 (subtask) runs in the same flow.

Processing flow 9
START

10
Exclusive control flag reset FLAG1=0 FLAG2=0

Subtask start

N
Part 1 supplied?

Y
11
Y
Task 2 busy?

N
Exclusive control flag set

Chuck open
FLAG1=1
12
Move to parts supply position P1

Chuck close

Move to testing device 1 13


Chuck open

Move upward 10000 pulses

Exclusive control flag reset FLAG1=0

Testing device 1 start

N
Test completed?

Y
Task 2 busy?

N
Exclusive control flag set FLAG1=1

Move to testing device 1

Chuck close

N
Part OK?
Y
Y

Y Y
OK parts? NG parts?

N
Move to OK parts position N

Move to NG parts position


Chuck open

Move upward 10000 pulses

Exclusive control flag reset FLAG1=0

33C15-R7-00

Application 11-15
Sample

7 <Maintask> <Subtask>
FLAG1=0 Program name:SUB_PGM
FLAG2=0
UPPOS=0.000

8
START <SUB_PGM>,T2 …… Subtask Start=======================>
*L1: *S1:
WAIT DI2(2)=1 …… Part supply standby WAIT DI3(2)=1
WAIT FLAG2=0 …… Other tasks waiting for standby status WAIT FLAG1=0
FLAG1=1 …… Exclusive control flag set FLAG2=1

9 GOSUB *OPEN
MOVE P,P1,Z=UPPOS
……
……
Chuck open
Move to part supply position
GOSUB *OPEN
MOVE P,P11,Z=UPPOS
GOSUB *CLOSE …… Chuck close GOSUB *CLOSE
MOVE P,P2,Z=UPPOS …… Move to testing device MOVE P,P12,Z=UPPOS
GOSUB *OPEN …… Chuck open GOSUB *OPEN
10 DRIVEI (3,-10000) …… Move axis 3 upward 10,000 pulses DRIVEI (3,-10000)
FLAG1=0 …… Exclusive control flag reset FLAG2=0
DO2(0)=1 …… Testing device start DO3(0)=1
DELAY 100 DELAY 100

11
DO2(0)=0 DO3(0)=0
WAIT DI2(0)=1 …… Test completion standby WAIT DI3(0)=1
WAIT FLAG2=0 …… Task completion standby WAIT FLAG1=0
FLAG1=1 …… Exclusive control flag set FLAG2=1
MOVE P,P2,Z=UPPOS …… Move to testing device MOVE P,P12,Z=UPPOS

12 GOSUB *CLOSE
IF DI2(1)=1 THEN
……
……
Chuck close
Test
GOSUB *CLOSE
IF DI3(1)=1 THEN
'GOOD 'GOOD
WAIT DI4(2)=0 …… Part movement standby WAIT DI3(3)=0
MOVE P,P3,Z=UPPOS …… Move to OK parts position MOVE P,P13,Z=UPPOS
13 ELSE ELSE
'NG 'NG
WAIT DI2(4)=0 …… Part movement standby WAIT DI3(4)=0
MOVE P,P4,Z=UPPOS …… Move to NG parts position MOVE P,P14,Z=UPPOS
ENDIF ENDIF
GOSUB *OPEN …… Chuck open GOSUB *OPEN
DRIVEI (3,-10000) …… Move axis 3 upward 10,000 pulses DRIVEI (3,-10000)
FLAG1=0 …… Exclusive control flag reset FLAG2=0
GOTO *L1 GOTO *S1

<common routine>
Program name:COMMON
*OPEN:
DO2(1)=0
DELAY 100
RETURN
*CLOSE:
DO2(1)=1
DELAY 100
RETURN

11-16 Chapter 11 User program examples


2.5 Sealing
• Overview 7
The following is an example for sealing a part.

Sealing
8
P5 P4
P3

9
P2

20mm
P6 P7
P0 P1
10
10mm

33C11-R9-00

• Precondition
1. I/O signal 11
DO (20) Valve open/close 1: Open / 0: Close

2. Positions of P0 to P7 are set by teaching.


Sample Description 12
MOVE P,P0,Z=0
SPEED 40
PATH SET ……Starts setting path
PATH L,P1,DO(20)[email protected] ……Starts sealing at the point of 10mm 13
PATH L,P2 Setting
PATH C,P3,P4 the motion path
PATH L,P5 (Robot doesn't move)
PATH L,P6,S=30
PATH L,P7,DO(20)[email protected] ……Ends sealing at the point of 20mm
PATH END ……Ends setting path
PATH START ……Executes Path motion
(Robot 1 starts moving from P0 and
stops at P7).
HALT

Application 11-17
2.6 Connection to an external device through RS-232C (example 1)
7 • Overview
Point data can be written in a program by using an external device connected to the controller via the RS-232C port.

• Precondition
8 1. Input to the external device from the controller
SDATA/X/Y [cr/lf]

n NOTE

9
[cr/lf] indicates CR code (=0Dh) + LF code (=0Ah).

2. Output to the controller from the external device


10 Point Data

P10= 156.420 243.910 0.000 0.000 0.000 0.000 [cr/lf]

11 Sample Description

’INIT
VCMD$="SDATA/X/Y" …………………………………………………………………… A request for the position to move

12 P0=0.000 0.000 0.000 0.000 0.000 0.000… An initial position


’MAIN ROUTINE
MOVE P, P0 …………………………………………………………………………… Moves to the initial position.
*ST:
SEND VCMD$ TO CMU ………………………………………………………… Sends the command.
13 SEND CMU TO P10 …………………………………………………………………Receives the destination point.
MOVE P, P10 ………………………………………………………………………… Moves to the reception position.
GOTO *ST

• "SEND xxx TO CMU" outputs the contents specified by "xxx" through the RS-232C.
• "SEND CMU TO xxx" sends data into the files specified by "xxx" through the RS-232C.

11-18 Chapter 11 User program examples


2.7 Connection to an external device through RS-232C (example 2)
• Overview 7
Point data can be created from the desired character strings and written in a program by using an external device
connected to the controller via the RS-232C port.

• Precondition 8
1. Input to the external device from the controller
SDATA/X/Y [cr/lf]

2. Output to the controller from the external device 9


X=156.420, Y=243.910 [cr/lf]

n NOTE
[cr/lf] indicates CR code (=0Dh) + LF code (=0Ah).
10

• "SEND xxx TO CMU" outputs the contents specified by "xxx" through the RS-232C.
• "SEND CMU TO xxx" sends data into the files specified by "xxx" through the RS-232C.
11
• The LEN ( ) function obtains the length of the character string.
• The MID$ ( ) function obtains the specified character string from among the character strings.

12
• The VAL ( ) function obtains the value from the character string.

Sample Description

'INIT
13
VCMD$="SDATA/X/Y" ……………………………………………………………………… A request for the position to move
P0= 0.000 0.000 0.000 0.000 0.000 0.000 … An initial position
P11=100.000 100.000 0.000 0.000 0.000 0.000 … A reception position
'MAIN ROUTINE
MOVE P,P0 …………………………………………………………………………………………… Moves to the initial position.

*ST:
SEND VCMD$ TO CMU ……………………………………………………………………… Sends the command.
SEND CMU TO VIN$ ………………………………………………………………………… Receives the Response:
"X=156.420,Y=243.910".
FOR I%=1 TO LEN(VIN$)-2
IF MID$(VIN$,I%,2)="X=" THEN EXIT FOR ……… If "X=", then exits from the roop.
NEXT I%
LOC1(P11)=VAL(MID$(VIN$,I%+2)) …………………………………… Converts "X=" downward to the numeric
value and assigns to axis 1 of P11.
FOR I%=1 TO LEN(VIN$)-2
IF MID$(VIN$,I%,2)="Y=" THEN EXIT FOR ……… If "Y=", then exits from the roop.
NEXT I%
LOC2(P11)=VAL(MID$(VIN$,I%+2)) …………………………………… Converts "Y=" downward to numeric
value and assigns to axis 2 of P11.
MOVE P,P11 ………………………………………………………………………………………… Moves to the reception position.
GOTO *ST

Application 11-19
Sample

7 ’INT
VCMD$="SDATA/X/Y"
VIN$=""
VX$=""
VY$=""
8 P0= 0.000 0.000 0.000 0.000 0.000 0.000
P11= 100.000 100.000 0.000 0.000 0.000 0.000
’MAIN ROUTINE
MOVE P, P0

9 *ST:
SEND VCMD$ TO CMU
SEND CMU TO VIN$
I=1
VMAX=LEN(VIN$)
10 *LOOP:
IF I>VMAX THEN GOTO *E_LOOP
C$=MID$(VIN$,I ,1)
IF C$="X" THEN
I=I+2
11 J=I
*X_LOOP:
C$=MID$(VIN$, J, 1)
IF C$="," THEN

12
*X1_LP:
L=J-I
VX$=MID$(VIN$, I, L)
I=J+1
GOTO *LOOP

13 ENDIF
J=J+1
IF J>VMAX THEN GOTO *X1_LP
GOTO *X_LOOP
ENDIF
IF C$="Y" THEN
I=I+2
J=I
*Y_LOOP:
C$=MID$(VIN$, J, 1)
IF C$=","THEN
*Y1_LP:
L=J-I
VY$=MID$(VIN$, I, L)
I=J+1
GOTO *LOOP
ENDIF
J=J+1
IF J>VMAX THEN GOTO *Y1_LP
GOTO *Y_LOOP
END IF
I=I+1
GOTO *LOOP
*E_LOOP:
WX=VAL(VX$)
WY=VAL(VY$)
LOC1(P11)=WX
LOC2(P11)=WY
MOVE P, P11
GOTO *ST
HALT

11-20 Chapter 11 User program examples


Chapter 12
Online commands

1 Online Command List................................. 12-1


2 Operation and setting commands............ 12-5
3 Reference commands.............................. 12-21
4 Operation commands.............................. 12-37
5 Data file operation commands................ 12-41
6 Utility commands....................................... 12-51
7 Individual execution of robot language.12-53
8 Control codes............................................ 12-55
1 Online Command List
7
Online commands can be used to operate the controller via an RS-232C interface or via an Ethernet.
This Chapter explains the online commands which can be used. For details regarding the RS-232C and Ethernet
connection methods, refer to the user's manual.
8
1.1 About termination codes
During data transmission, the controller adds the following codes to the end of a line of transmission data.
9
RS-232C
• CR (0Dh) and LF (0Ah) are added to the end of the line when the "Termination code" parameter of communication
parameters is set to "CRLF".
• CR (0Dh) is added to the end of the line when the "Termination code" parameter of communication parameters is set 10
to "CR".

Ethernet
CR (0Dh) and LF (0Ah) are added to the end of the line. 11

When data is received, then the data up to CR (0Dh) is treated as one line regardless of the "Termination code"
parameter setting, so LF (0Ah) is ignored. 12
The termination code is expressed as [cr/lf] in the detailed description of each online command stated in "2 Operation
and setting commands" onwards in this Chapter.

1.2 Key operation 13


(*) Conditions: 1. Always executable.
2. Not executable during inputs from the programming box.
3. Not executable during inputs from the programming box, and while the program is running.
4. Not executable during inputs from the programming box, while the program is running, and when
specific restrictions apply.

Operation type Command Option Condition


<program name >
,Tn , p
Register program in the task LOAD PGm 2 (*)
(m: 1-100, n : 1-16, p : 1-64 )
Tn
Program Reset program RESET <program name >
Execute program RUN PGm 2
Stop program STOP
(m: 1-100, n: 1-16)
Tn
Program Execute one line STEP <program name >
Skip one line SKIP 2
PGm
Execute to next line NEXT
(m: 1-100, n: 1-16)
Tn
Program Execute before specified line RUNTO <program name > ,k
2
Skip before specified line SKIPTO PGm
(m: 1-100, n: 1-16, k: 1-9999)
<program name >
(n , n, n, …), k
PGm
Set break point BREAK 0 2
0
(m: 1-100, n: 1-9999, k : 0 / 1 )

Online Command List 12-1


Operation type Command Option Condition

7 Change manual movement speed MSPEED


[robot number ] k
(robot number: 1-4, k: 1-100)
2

[robot number ] k, f
Move to absolute reset position ABSADJ 3
(robot number: 1-4, k: 1-6, f: 0/1)

8 Absolute reset MRKSET


[robot number ] k
3
(robot number: 1-4, k: 1-6)

[robot number ] k
Return-to-origin ORGRTN 3
(robot number: 1-4, k: 1-6)
9 [robot number ] k
Change inching movement amount IDIST 2
(robot number: 1-4, k: 1-10000)
INCH
[robot number ] km
Manual movement (inching) INCHXY 3
10 INCHT
(robot number: 1-4, k: 1-6, m: +/-)

JOG
[robot number ] km
Manual movement (jog) JOGXY 3
(robot number: 1-4, k: 1-6, m: +/-)
JOGT
TEACH [robot number ] m
11 Point data teaching
TCHXY (robot number: 1-4, m: 0-29999)
2

12 1.3 Utility
Operation type Command Option Condition
<program name1 >
TO <program name2 >
13 Copy program PGm
(m : 1-100) 2
COPY Pm-Pn TO Pk (*Refer to
Copy points "m - n" to point "k" previous page)
(m : 0-29999, n : 0-29999, k : 0-29999)
PCm-PCn TO PCk
Copy point comments "m - n" to point comment "k"
(m : 0-29999, n : 0-29999, k : 0-29999)
<program name >
Delete program PGm
(m : 1-100)
Pm-Pn
Delete points "m - n"
(m : 0-29999, n : 0-29999)
PCm-PCn
Delete point comments "m - n"
(m : 0-29999, n : 0-29999)
ERA PNm-PNn 2
Delete point names "m - n"
(m : 0-29999, n : 0-29999)
PLm
Delete pallet "m"
(m : 0-39)
GPm
Delete general Ethernet port "m"
(m : 0-15)
RTm-RTn
Delete real time output "m - n"
(m : 24-127, n : 24-127)
Rename "program 1" to "program 2" REN <program 1> TO <program 2> 2
<program name >
,k
Check program syntax SYNCHK PGm 2
(m : 1-100, k : 1-100)
Compile sequence program SEQCMPL 2
<program name >
TO s
Change program attribute ATTR PGm 2
(m : 1-100, s: RW / RO / H )
m
Setting main program MAINPG 2
( m : 1-100)

12-2 Chapter 12 Online commands


Operation type Command Option Condition

7
Initialize data Program PGM
Point PNT
Point comment PCM
Point name PNM
Shift coordinate SFT
Hand HND
Work WRKDEF 8
Pallet INIT PLT 3
General Ethernet port GEP
Input/output name ION
Area check output ACO
Real time output
All data except parameters
RTO
MEM
9
Parameter PRM
All data (MEM+PRM) ALL
CMU
INIT 3
10
Initialize data Communication parameter
ETH
Initialize data Alarm history INIT LOG 3
SET d
CAN
Setting Input data INPUT CLR 2

Buffer clear Output message MSGCLR


(d: input data)
2
11
k , pppppppp
Change access level ACCESS (k: 0/1, p: alphanumeric characters of 8 2
characters or less)

12
Setting password SETPW 2
k
Setting Sequence execution flag SEQUENCE 2
(k: 0 / 1 / 3)
Reset alarm ALMRST 2
yy / mm / dd
Check or set date DATE 2
(yy: 00-99, mm: 01-12, dd: 00-31)
Check or set time TIME
hh : mm : ss
2
13
(hh: 00-23, mm: 00-59, ss: 00-59)

1.4 Data handling


Operation type Command Option Condition
Acquiring ? ACCESS k , pppppppp 1
status Access level (k: 0/1, p: alphanumeric characters of 8
characters or less)
Alarm status ALM
<program name >
BREAK
Break point status PGm
(m : 1-100)
Last (Current) point number reference CURPNT
Emergency stop status EMG
HAND [robot number ]
Selected hand status
(robot number: 1-4)
HND [hand number ]
Hand data
(hand number: 0-31)
IDIST [robot number ]
Inching movement amount status
(robot number: 1-4)
Input data INPUT
ETH
Online/offline status LINEMODE
CMU
Main program number MAINPG
Remaining memory capacity MEM
Mode status MODE

Online Command List 12-3


Operation type Command Option Condition

7 Motor power status


Output message
MOTOR
MSG
MSPEED [robot number ]
Manual movement speed
(robot number: 1-4)
ORIGIN [robot number ]
8 Return-to-origin status
(robot number: 1-4)
RBTWRK [robot number ]
Work status
(robot number: 1-4)
Sequence program compilation status SEQCMPSTS

9 Sequence program execution status SEQUENCE


SERVO [robot number ]
Servo status
(robot number: 1-4)
SHIFT [robot number ]
Selected shift status

10
(robot number: 1-4)
Acquire task in RUN or SUSPEND status TASKS
TSKECD Tk
Task end condition
(k : 1-16)
TSKMON Tk
11
Task operation status
(k : 1-16)
Version information VER
WRKDEF [work number ]
Work data
(work number: 0-39)

12 Numerical data
Character string data
numerical expression
character string expression
Point data point expression
Shift coordinate data shift expression

13
Read-out data READ read-out file 2
Write data WRITE write file 2

1.5 Robot language independent execution


The Robot languages executable independently are the commands/functions with "3" at "Online" column in Chapter 8
"robot language table".

1.6 Control code


Operation type Command Option Condition
Execution language interruption ^C(=03H) 1

Conditions: 1. Always executable.


2. Not executable during inputs from the programming box.
3. Not executable during inputs from the programming box, and while the program is running.
4. Not executable during inputs from the programming box, while the program is running,
and when specific restrictions apply.

12-4 Chapter 12 Online commands


2 Operation and setting commands
7
2.1 Program operations

2.1.1 Register task


8
Command Format

<program name>
@LOAD ,Tn, p [cr/lf]
PGm
9
Response Format

OK[cr/lf]
10
Notation Value Range
m Program number 1 to 100

n Task number 1 to 16 11
p Task priority ranking 1 to 64

Meaning Registers the specified program into "task n" with "priority p". 12
The registered program enters the STOP status.

[When "task number n" is omitted] The task with the smallest number of those that have not been started is specified
automatically. 13
[When "task priority p" is omitted] "32" is specified.

[Task priority ranking] The smaller value, the higher priority. The larger value, the lower priority (high 1 to low 64).
When the task with a high task priority is in the RUNNING status, the task with a low task
priority still remains in the READY status.

Sample Description
Command @LOAD <PG_MAIN>, T1[cr/lf] …… Registers the program to task 1.

Response OK[cr/lf]

Online Command List 12-5


2.1.2 Reset program
7
Command Format 1

@RESET[cr/lf]

8 Command Format 2

Tn
@RESET <program name> [cr/lf]
PGm
9
Response Format

OK[cr/lf]
10
Notation Value Range
n Task number 1 to 16
11 m Program number 1 to 100

Meaning Resets the program.


12 [Command Format 1] Resets all programs.
When restarting the program, the main program or the program that has been
executed last in task 1 is executed from its beginning.
[Command Format 2] Resets only the specified program.
13 When restarting the program that has been reset, this program is executed from its
beginning.

Sample 1 Description
Command @RESET[cr/lf]…………………………………… Resets all programs.

Response OK[cr/lf]

Sample 2 Description
Command @RESET T3[cr/lf] ……………………… Resets only the program that is executed in T3.

Response OK[cr/lf]

12-6 Chapter 12 Online commands


2.1.3 Program execution
Command Format 1
7
@RUN[cr/lf]

Command Format 2
8
Tn
@RUN <program name> [cr/lf]
PGm
9
Response Format

OK[cr/lf]

10
Notation Value Range
n Task number 1 to 16

11
m Program number 1 to 100

Meaning Executes the current program.


[Command Format 1] Executes all programs in the STOP status.
[Command Format 2] Executes only the specified program in the STOP status. 12

13
Sample 1 Description
Command @RUN[cr/lf]………………………… Executes all programs in the STOP status.

Response OK[cr/lf]

Sample 2 Description
@RUN T3[cr/lf]………………… Executes only the program in the STOP status that is
Command
registered in T3.

Response OK[cr/lf]

Online Command List 12-7


2.1.4 Stop program
7 Command Format 1

@STOP[cr/lf]

8 Command Format 2

Tn
@STOP <program name> [cr/lf]
PGm
9
Notation Value Range
n Task number 1 to 16
10 m Program number 1 to 100

Meaning Stops the program.


11 [Command Format 1] Stops all programs.
[Command Format 2] Stops only the specified program.

12 Sample 1 Description
Command @STOP[cr/lf]……………………… Stops all programs.

Response OK[cr/lf]

13 Sample 2 Description
Command @STOP T3[cr/lf]……………… Stops only the program that is executed in T3.

Response OK[cr/lf]

12-8 Chapter 12 Online commands


2.1.5 Execute one program line
Command Format
7
Tn
@STEP <program name> [cr/lf]
PGm
8
Response Format

OK[cr/lf]
9
Notation Value Range
n Task number 1 to 16

m Program number 1 to 100


10

Meaning Executes one line of the specified program.


When executing one line of the GOSUB statement or CALL statement, the program operation enters the 11
subroutine or sub-procedure.

Sample Description
12
Command @STEP T3[cr/lf]………… Executes one line of the program that is executed in T3.

Response OK[cr/lf]

13

Online Command List 12-9


2.1.6 Execute program to the next line
7 Command Format

Tn
@NEXT <program name> [cr/lf]
8 PGm

Response Format

OK[cr/lf]
9 Notation Value Range
n Task number 1 to 16

m Program number 1 to 100

10 Meaning Executes the specified program to the next line.


Executing @NEXT on the line in the GOSUB or in the CALL statement make the program execute and
return through the sub-procedure processing, then stop at the next line.

11
This is a same processing as setting the breakpoint on the next line in the program currently suspended and
executing the program (@RUN).

12 @STEP stops the program at the beginning line of the sub-procedure called by GOSUB or CALL statement.

Sample Description
Executes the program in execution at T3
13 Command @NEXT T3[cr/lf]………………………………………
until the next line.

Response OK[cr/lf]

2.1.7 Execute program to line before specified line


Command Format

Tn
RUNTO <program name> k[cr/lf]
PGm

Response Format

OK[cr/lf]

Notation Value Range


n Task number 1 to 16

m Program number 1 to 100

k Specified line number 1 to 9999

Meaning Executes the specified program to the line before the specified line.

Sample Description
Executes the program that is executed by T3
Command @RUNTO T3, 15[cr/lf]…………………………
to the 14th line and stops at the 15th line.

Response OK[cr/lf]

12-10 Chapter 12 Online commands


2.1.8 Skip one program line
Command Format
7
Tn
@SKIP <program name> [cr/lf]
PGm
8
Response Format

OK[cr/lf]
9
Notation Value Range
n Task number 1 to 16

m Program number 1 to 100

10
Meaning Skips one line of the specified program.
When skipping one line of the GOSUB statement or CALL statement, all subroutines or sub-procedures are
skipped.

Sample Description
11
Skips one line of the program
Command @SKIP T3[cr/lf]………………………………………
that is executed by T3.

Response OK[cr/lf] 12

13
2.1.9 Skip program to line before specified line
Command Format

Tn
@SKIPTO <program name> k[cr/lf]
PGm

Response Format

OK[cr/lf]

Notation Value Range


n Task number 1 to 16

m Program number 1 to 100

k Specified line number 1 to 9999

Meaning Skips the specified program to the line before the specified line.

Sample Description
@SKIPTO T3, 15[cr/lf]………………………… Skips the program that is executed by T3 to
Command
the 14th line and stops at the 15th line.

Response OK[cr/lf]

Online Command List 12-11


2.1.10 Set break point
7 Command Format 1

<program name>
@BREAK (n,n,n,...), k[cr/lf]
PGm
8 Command Format 2

<program name>
@BREAK 0[cr/lf]
PGm
9 Command Format 3

@BREAK 0[cr/lf]

10 Response Format

OK[cr/lf]

11 Notation Value Range / Meaning


m Program number 1 to 100

n Specified line number 1 to 9999

12 k Set/Cancel 0: Set / 1: Cancel

Meaning Sets a break point to pause the program during program execution.
[Command Format 1] Sets or cancels a break point in the specified line of the specified program.
13 Multiple lines can also be specified.
[Command Format 2] Cancels all break points set in the specified program.
[Command Format 3] Cancels all break points.

Sample Description
Sets a break point at the first and
Command @BREAK PG3(1, 3), 1[cr/lf]…………………………
third lines of PG3.

Response OK[cr/lf]

12-12 Chapter 12 Online commands


2.1.11 Check program syntax
Command Format
7
<program name>
@SYNCHK ,k[cr/lf]
PGm
8
Response Format

RUN [cr/lf]
nnnn:gg.bbb [cr/lf]
nnnn:gg.bbb [cr/lf] 9
:
nnnn:gg.bbb [cr/lf]
nnnn:gg.bbb [cr/lf]
END [cr/lf] 10
Notation Value Range

11
m Program number 1 to 100

k Maximum number of error 1 to 100

nnnn Line number where error occurred 1 to 9999

gg Alarm group number

bbb Alarm classification number


12
Meaning Checks syntax of the program specified by <program name> or program number.
If there are syntax errors in the specified program, line number where error occurred,
alarm group number and alarm classification number are output. 13
Reference For details regarding alarm group number and alarm classification number,
refer to the user's manual or the operator’s manual.

Sample Description
@SYNCHK PG1, 100[cr/lf]………………………… Sets a Maximum number of error at 100
Command
and checks syntax of the program 1.

RUN[cr/lf]
1:5.239 [cr/lf] ………………………… Detects syntax errors
2:5.239 [cr/lf] "5.239: Illegal identifier"
Response 3:5.239 [cr/lf] at 1th, 2nd, 3rd and 8th lines.
8:5.239 [cr/lf]
6:5.222 [cr/lf] ………………………… Detects syntax error "5.222:IF without
END [cr/lf] ENDIF" at 6th line.

Online Command List 12-13


2.1.12 Set main program
7 Command Format

@MAINPG[cr/lf]

8 Response Format

OK[cr/lf]

9 Notation Value Range


m Program number 1 to 100

Meaning Specifies the program which is always selected when all programs are reset. When "0" is specified at the
main program number or program specified at the main program number doesn't exist, the program that
10 has been executed last (current program) in the task 1 is selected after resetting all programs.

n NOTE
"Main program" corresponds conventional function "_SELECT" of RCX240, etc.

11
Sample Description
Command @MAINPG 1[cr/lf]…………… Sets program number 1 at the main program.

12 Response OK[cr/lf]

13
2.1.13 Compile sequence program
Command Format

@EQCMPL[cr/lf]

Response Format

RUN[cr/lf]
END[cr/lf]

Meaning Compiles the sequence program.


When the program named "SEQUENCE" doesn't exist or syntax errors exist in the program,
an error message appears.
The execution program is created after successful termination of compiling and the letter "s" appears
in Flag.
Reference Chapter 7 "Sequence function"

Sample Description
Command @SEQCMPL[cr/lf]…………………………………………………… Compiles the sequence program.

RUN[cr/lf]
Response
END[cr/lf]

12-14 Chapter 12 Online commands


2.2 MANUAL mode operation

2.2.1 Change the MANUAL mode speed


7
Command Format

@MSPEED [robot number] k[cr/lf] 8


Response Format

9
OK[cr/lf]

Notation Value Range


robot number 1 to 4 (If not input, robot 1 is specified.)

k Manual movement speed 1 to 100 10


Meaning Changes the manual mode movement speed of the robot specified by the <robot number>.

Sample 11
Command @MAINPG 50[cr/lf]

Response OK[cr/lf]
12

2.2.2 Point data teaching


13
Command Format

@TEACH [robot number] mmmmm[cr/lf]

@TCHXY [robot number] mmmmm[cr/lf]

Response Format

OK[cr/lf]

Notation Value Range


robot number 1 to 4 (If not input, robot 1 is specified.)

mmmmm Point number for registering point data 0 to 29999

Meaning Registers the current robot position as point data for the specified point number. If point data is already
registered in the specified point number, then that point data will be overwritten.

The unit of the point data may vary depending on the command.
TEACH "pulse" units
TCHXY "mm" units

Sample

Command @TEACH[2] 100[cr/lf]

Response OK[cr/lf]

Online Command List 12-15


2.2.3 Change inching movement amount
7 Command Format

@IDIST [robot number] mmmmm[cr/lf]

8 Response Format

OK[cr/lf]

9 Notation Value Range


robot number 1 to 4 (If not input, robot 1 is specified.)

mmmmm Inching movement amount 1 to 10000

10 Meaning Changes the inching movement amount of the robot specified by the <robot number>.

The unit of the movement amount may vary depending on the command.
INCH "pulse" units: 1 to 10000 pulse
11 INCHXY "mm" units: 0.001 to 10.000mm
INCHXT "mm" units: 0.001 to 10.000mm

12 Sample

Command @IDIST[2] 100[cr/lf]

Response OK[cr/lf]

13

12-16 Chapter 12 Online commands


2.3 Alarm reset
Command Format
7
@ALMRST[cr/lf]

Response Format 8
RUN[cr/lf]
END[cr/lf]

9
Meaning Resets the alarm.
However, this command cannot be used for the alarms which require the restart of system.
In this case, turn off the controller and turn it on again.
10
Sample

Command @ALMRST[cr/lf]

RUN[cr/lf]
11
Response
OK[cr/lf]

12
2.4 Clearing output message buffer
Command Format 13
@MSGCLR[cr/lf]

Response Format

OK[cr/lf]

Values Clears the output message buffer of the controller. After the messages have been output by the PRINT
statement, etc., the messages remaining in the buffer are cleared.

Sample

Command @MSGCLR[cr/lf]

Response OK[cr/lf]

Online Command List 12-17


2.5 Setting input data
7 Command Format

SET d
@INPUT CAN [cr/lf]
8 CLR

Response Format

OK[cr/lf]
9

Notation Value Meaning

10 Value that is matched to the type of the variable specified by the


d Input data INPUT statement.
(Character string is enclosed by " ")

11 Meaning Sets the input data for responding to a data request by INPUT statement of robot program.
The controller parameter "INPUT/PRINT using channel" should be set a current communication channel
(CMU, ETH or iVY).

12 SET: Sets the data which is input to the variable when INPUT statement is executed.
CAN: Cancels the data request by INPUT statement.
CLR: Clears the data specified @INPUT SET downward.

13
Sample Description

<Online command> <Robot program>


@INPUT SET 10[cr/lf]
@INPUT SET 5[cr/lf]

OK[cr/lf] INPUT A%[cr/lf]


@?MSG[cr/lf] PRINT A%[cr/lf]
10[cr/lf]
OK[cr/lf]

<Online command> <Robot program>


@INPUT SET 10[cr/lf]
OK[cr/lf]
@INPUT CLR[cr/lf]
OK[cr/lf]
@INPUT SET 5[cr/lf]
OK[cr/lf] INPUT A%[cr/lf]
@?MSG[cr/lf] PRINT A%[cr/lf]
5[cr/lf]
OK[cr/lf]

12-18 Chapter 12 Online commands


2.6 Changing access level
Command Format
7
@ACCESS k , pppppppp [cr/lf]

Response Format 8
OK[cr/lf]

9
Notation Value Range / Meaning
k Access level 0: Maintainer level, 1: Operator level

10
pppppppp Password Alphanumeric characters of 8 characters or less

Meaning Changes access level. If password is omitted, sets without password.


When changes access level to the maintainer level and entered password is incorrect,
"6.235: Password error" will occur. 11
Reference User's Manual or Operator's Manual

12
Sample Description

Command @ACCESS 0,password[cr/lf]……


Sets "password" as password,
and changes the level to "maintainer level".
13
Response OK[cr/lf]

Online Command List 12-19


2.7 Changing password
7 Command Format

@SETPW[cr/lf]

8 Response Format

READY[cr/lf]
pppppppp[cr/lf]
kkkkkkkk[cr/lf]
9 nnnnnnnn[cr/lf]
[cr/lf] ……………………………… line-feed
OK[cr/lf]

10
Notation Value Range
old password
pppppppp Alphanumeric characters of 8 characters or less
(current password)

11 kkkkkkkk new password Alphanumeric characters of 8 characters or less

new password
nnnnnnnn Alphanumeric characters of 8 characters or less
(confirmation)

12
Meaning Changes the password for the access level changing to the maintainer level.
• The current password is input for the old password, and the revised password is input for the
new password and for the new password of confirmation.
13 In the next line of the new password (confirmation), inserts line feeds only.
•W
 hen input password as the old password is different from the current password or new password
and new password (confirmation) are not same, "6.235: Password error" will occur.

Reference User's Manual or Operator's Manual

Sample Description
Command @SETPW[cr/lf]

READY[cr/lf]
oldpass[cr/lf] …………………… Inputs "oldpass" as old password.
newpass[cr/lf] …………………… Inputs "newpass" as new password.
Response
newpass[cr/lf] …………………… Inputs "newpass" as new password (confirmation).
[cr/lf] ……………………………………… line-feed
ok[cr/lf]

12-20 Chapter 12 Online commands


3 Reference commands
7
3.1 Acquiring return-to-origin status
Command Format 1
8
@?ORIGIN[cr/lf]

Response Format 1

x[cr/lf]
9
OK[cr/lf]

Command Format 2 10
@?ORIGIN robot number[cr/lf]

Response Format 2 11
x y{,y{,{...}}}[cr/lf]
OK[cr/lf]

12
Notation Value Range / Meaning
robot number 1 to 4 (If not input, robot 1 is specified.)

x Robot return-to-origin status 0: Incomplete, 1: Complete


13
Shows the status of the axis 1, axis 2, …, axis 6 from the left.
y Axis return-to-origin status 0: Incomplete, 1: Complete
(Omitted when the axis is not connected.)

Meaning Acquires return-to-origin status.


[Command Format 1] Acquires the return-to-origin status of all robots.
[Command Format 2] Acquires the status of the specified robot.

Sample Description

Command @?ORIGIN 2[cr/lf]

0 1,1,0,1[cr/lf]………………………………………… Axis 3 of the robot 2 is


Response
OK[cr/lf] in the return-to-origin incomplete status.

Reference commands 12-21


3.2 Acquiring servo status
7 Command Format

@?SERVO[robot number][cr/lf]

8 Response Format

x y,y,y,y,y,y[cr/lf]
OK[cr/lf]

9
Notation Value Range / Meaning
robot number 1 to 4 (If not input, robot 1 is specified.)

x Robot servo status 0: Servo off status, 1: Servo on status

10 Shows the status of the axis 1, axis 2, …, axis 6 from the left.

0: Mechanical brake on + dynamic brake on status


y Axis servo status 1: Servo on status
2: Mechanical brake off + dynamic brake off status

11
(Omitted when the axis is not connected.)

Meaning Acquires the servo status.

Sample Description
12 Command @?SERVO[3][cr/lf]

0 0,1,0,0[cr/lf]……………………… Only the axis 2 of robot 3 is in the


Response
OK[cr/lf] servo on status.

13

3.3 Acquire motor power status


Command Format

@?MOTOR[cr/lf]

Response Format

x[cr/lf]
OK[cr/lf]

Notation Value Range / Meaning


0: Motor power off status
x Motor power status 1: Motor power on status
2: Motor power on + all robot servo on status

Meaning Acquires the motor power status.

Sample

Command @?MOTOR[cr/lf]

2[cr/lf]
Response
OK[cr/lf]

12-22 Chapter 12 Online commands


3.4 Acquiring access level
Command Format 1
7
@?ACCESS[cr/lf]

Response Format 1 8
k[cr/lf]
OK[cr/lf]

9
Notation Value Range / Meaning
k Access level 0: Maintainer level, 1: Operator level

Meaning Acquires the access level. 10


Reference User's Manual or Operator's Manual

Sample 11
Command @?ACCESS[cr/lf]

1[cr/lf]
Response
12
OK[cr/lf]

3.5 Acquiring break point status


13
Command Format

<program name>
@?BREAK [cr/lf]
PGm

Response Format

n{,n{,{...}}}[cr/lf]
OK[cr/lf]

Notation Value Range


Line number
n 1 to 9999
on which break point "n" is set

32 characters or less
Program name Program name to delete
consisting of alphanumeric characters and _ (underscore).

m Program number 1 to 100

Meaning Acquires the break point status.

Sample

Command @?BREAK <TEST>[cr/lf]

12,35[cr/lf]
Response
OK[cr/lf]

Reference commands 12-23


3.6 Acquiring mode status
7 Command Format

@?MODE[cr/lf]

8 Response Format

k[cr/lf]
OK[cr/lf]

9
Notation Value Range / Meaning

0: MANUAL mode
1: AUTO mode (Control source: Programming box)

10
k Mode status
2: AUTO mode (Control source release)
-1: Restricted mode

Meaning Acquires the controller mode status.


11
Sample

Command @?MODE[cr/lf]

12 Response
1[cr/lf]
OK[cr/lf]

13 3.7 Acquiring communication port status


Command Format

ETH
@?LINEMODE [cr/lf]
CMU

Response Format

k[cr/lf]
OK[cr/lf]

Notation Value Range / Meaning


k Communication port status 0: OFFLINE, 1: ONLINE

Meaning Acquires the specified communication port status.


ONLINE / OFFLINE commands allow to change a specified communication port to the "online" / "offline"
mode, respectively.

Sample

Command @?LINEMODE ETH [cr/lf]

1[cr/lf]
Response
OK[cr/lf]

12-24 Chapter 12 Online commands


3.8 Acquiring main program number
Command Format
7
@?MAINPG[cr/lf]

Response Format 8
m[cr/lf]
OK[cr/lf]

Notation Value Range


9
0 to 100
m Program number
(If not registered in the main program, 0 is returned.)

Meaning Acquires the program number which is registered in the main program. 10
Sample

Command @?MAINPG[cr/lf]
11
1[cr/lf]
Response
OK[cr/lf]

3.9 Acquiring sequence program execution status 12


Command Format

@?SEQUENCE[cr/lf]
13
Response Format
1,s[cr/lf]
OK[cr/lf]

3,s[cr/lf]
OK[cr/lf]

0[cr/lf]
OK[cr/lf]

Notation Value Range / Meaning


1: Program execution is in progress.
s Execution status of sequence program
0: Program execution is stopped.

Meaning Acquires the sequence program execution status.


Response output means as follows:
1: Enabled
3: Enabled and output is cleared at emergency stop
0: Disabled

Sample

Command @?SEQUENCE[cr/lf]

0[cr/lf]
Response
OK[cr/lf]

Reference commands 12-25


3.10 Acquiring sequence compilation status
7 Command Format

@?SEQCMPSTS[cr/lf]

8 Response Format
x[cr/lf]
OK[cr/lf]

9 Notation Value Range / Meaning

x sequence program status being compiled 0: Incomplete, 1: Complete

10 Meaning Acquires the sequence program compilation status.

Sample Description

Command
11
@?SEQCMPSTS[cr/lf] …… Acquires the compilation status of the sequence program.

1[cr/lf] ……………………………… The sequence program is compiled.


Response
OK[cr/lf]

12

3.11 Acquiring the version information


13
Command Format

@?VER[cr/lf]

Response Format

cv,cr-mv-dv1,dr1/dv2,dr2[cr/lf]

Notation Value
cv Host version number

cr Host revision number (Rxxxx)

mv PLO version number (Vx.xx)

dv? (?: 1, 2) Driver version number (Vx.xx)

dr? (?: 1, 2) Driver revision number (Rxxxx)

Meaning Acquires the version information.

Sample

Command @?VER[cr/lf]

V8.02,R1021-V5.10-V1.01,R0001/V1.01,R0001[cr/lf]
Response
OK[cr/lf]

12-26 Chapter 12 Online commands


3.12 Acquiring the tasks in RUN or SUSPEND status
Command Format
7
@?TASKS[cr/lf]

Response Format 8
n{,n{,{...}}}[cr/lf]
OK[cr/lf]

9
Notation Value Range

n Task number 1 to 16 (Task currently run or suspended)

10
Meaning Acquires the tasks in RUN or SUSPEND status.

Sample

Command @?TASKS[cr/lf] 11
1,3,4,6[cr/lf]
Response
OK[cr/lf]

12

3.13 Acquiring the tasks operation status 13


Command Format

@?TSKMON Tk[cr/lf]

Response Format
m,n,f,p[cr/lf]
OK [cr/lf]

Notation Value Range / Meaning


k Task number 1 to 16

m Execution program number 1 to 100

n Task execution line number 1 to 9999

f Each task status R: RUN, U: SUSPEND, S: STOP, W: WAIT

p Priority level of each task 1 to 64

Meaning Acquires the status of specified task.

Sample

Command @?TSKMON T3[cr/lf]

5,11,R,32[cr/lf]
Response
OK[cr/lf]

Reference commands 12-27


3.14 Acquiring the task end condition
7 Command Format

@?TSKECD Tk[cr/lf]

8 Response Format

gg.bbb[cr/lf]
OK[cr/lf]

9 Notation Value Range


k Task number 1 to 16

gg Alarm group number of the task end condition

bbb Alarm classification number of the task end condition


10
Meaning Acquires the specified task end condition.

Reference For details about alarm group number and classification number of the task end condition,
11 refer to the user’s or the operator’s manual.

When the specified task ends by error, acquires this alarm number.

12
Sample Description

Command @?TSKECD T1[cr/lf]……Acquires the end condition of task 1.

13 Response
1.5[cr/lf]……………………… The end condition of task 1 is 1.5: Program ended
OK[cr/lf] by "HALT".

3.15 Acquiring the shift status


Command Format

@?SHIFT[robot number][cr/lf]

Response Format

m[cr/lf]
OK[cr/lf]

Notation Value Range / Meaning


1 to 4
robot number
(If not input, robot 1 is specified.)

0 to 39
m Shift number selected for the specified robot
Shift not selected: -1

Meaning Acquires the shift status of the robot specified by the <robot number>.

Sample

Command @?SHIFT[cr/lf]

1[cr/lf]
Response
OK[cr/lf]

12-28 Chapter 12 Online commands


3.16 Acquiring the hand data
Command Format
7
@?HND[hand number][cr/lf]

Response Format
8
m[cr/lf]
OK[cr/lf]

Notation Value Range / Meaning


9
hand number 0 to 31

m Hand data

Meaning Acquires the hand data specified by the <hand number>. 10


Sample

Command @?HND[0][cr/lf] …… Acquires the data of hand 0.


11
1,0,0.000,60.000[cr/lf]
Response
OK[cr/lf]

12
3.17 Acquiring the hand status
Command Format 13
@?HAND[robot number][cr/lf]

Response Format

m[cr/lf]
OK[cr/lf]

Notation Value Range / Meaning


1 to 4
robot number
(If not input, robot 1 is specified.)

0 to 31
m Hand number selected for the specified robot
Hand not selected: -1

Meaning Acquires the hand status of the robot specified by the <robot number>.

Sample

Command @?HAND[cr/lf]

1[cr/lf]
Response
OK[cr/lf]

Reference commands 12-29


3.18 Acquiring the work data
7 Command Format

@?WRKDEF[work number][cr/lf]

8 Response Format

m[cr/lf]
OK[cr/lf]

9 Notation Value Range / Meaning


work number 0 to 39

m work data

10 Meaning Acquires the work data specified by the <work number>.

Sample Description

Command
11
@?WRKDEF[0][cr/lf] …… Acquires the data of work 0.

0.000 0.000 0.000 0.000[cr/lf]


Response
OK[cr/lf]

12

13 3.19 Acquiring the work status


Command Format

@?RBTWRK[robot number][cr/lf]

Response Format

m[cr/lf]
OK[cr/lf]

Notation Value Range / Meaning


1 to 4
robot number
(If not input, robot 1 is specified.)

0 to 39
m Work number selected for the specified robot
Work not selected: -1

Meaning Acquires the work status of the robot specified by the <robot number>.

Sample

Command @?RBTWRK[cr/lf]

1[cr/lf]
Response
OK[cr/lf]

12-30 Chapter 12 Online commands


3.20 Acquiring the remaining memory capacity
Command Format
7
@?MEM[cr/lf]

Response Format
8
k/m[cr/lf]

Notation Value 9
k Remaining source area (unit: bytes)

m Remaining global identifier area (unit: bytes)

Meaning Acquires the remaining memory capacity. 10


Sample

Command @?MEM[cr/lf]
11
102543/1342[cr/lf]
Response
OK[cr/lf]

12
3.21 Acquiring the alarm status
Command Format

@?ALM[cr/lf]
13
Response Format

gg.bbb[cr/lf]
OK[cr/lf]

Notation Value
gg Alarm group number

bbb Alarm classification number

Meaning Acquires the alarm which occurs in the controller.


Reference For details regarding the alarm group number and alarm classification number,
refer to the user's or operator's manual.

The requirable alarms are number 400 or more of alarm classification number. If multiple alarms occur,
the alarm with larger alarm classification number (more serious alarm) is acquired.

Sample

Command @?ALM[cr/lf]

12.600[cr/lf]
Response
OK[cr/lf]

Reference commands 12-31


3.22 Acquiring the emergency stop status
7 Command Format

@?EMG[cr/lf]

8 Response Format

k[cr/lf]
OK[cr/lf]

9 Notation Value Range / Meaning


k Emergency stop status 0: normal operation, 1: emergency stop

Meaning Acquires the emergency stop status by checking the internal emergency stop flag.
10
Sample

Command @?EMG[cr/lf]

11 Response
1[cr/lf]
OK[cr/lf]

12 3.23 Acquiring the manual movement speed


Command Format

13 @?MSPEED[robot number][cr/lf]

Response Format

k[cr/lf]
OK[cr/lf]

Notation Value Range


1 to 4
robot number
(If not input, robot 1 is specified.)
k manual movement speed 1 to 100 (unit: %)

Meaning Acquires the value of the manual movement speed specified by <Robot number>.

Sample

Command @?MSPEED[cr/lf]

50[cr/lf]
Response
OK[cr/lf]

12-32 Chapter 12 Online commands


3.24 Acquiring the inching movement amount
Command Format
7
@?IDIST[robot number][cr/lf]

Response Format
8
mmmmm[cr/lf]
OK[cr/lf]

Notation Value Range 9


1 to 4
robot number
(If not input, robot 1 is specified.)
mmmmm Inching movement amount 1 to 10000

10
Meaning Acquires the inching movement amount specified by <Robot number>.

Sample

Command @?IDIST[2][cr/lf] 11
100[cr/lf]
Response
OK[cr/lf]

12
3.25 Acquiring the last reference point number (current point number)
Command Format 13
@?CURPNT[cr/lf]

Response Format

k[cr/lf]
OK[cr/lf]

Notation Value Range


k Current point number 0 to 29999

Meaning Acquires the point number which is referred last. The current point number (the point number of last
reference) is renewed by operations which uses the point data (point edit, for example).

The current point number is renewed by following operations: the point reference and the point setting
movement by remote commands, the trace movement or teaching by programming box or RCX-Studio Pro, etc.

Sample

Command @?CURPNT[cr/lf]

100[cr/lf]
Response
OK[cr/lf]

Reference commands 12-33


3.26 Acquiring the output message
7 Command Format

@?MSG[cr/lf]

8 Response Format

sssss …… ssssss[cr/lf]
OK[cr/lf]

9 Notation Value
s Message character string

Meaning Acquires one line of message which is input from the output message buffer of the controller
10 by the PRINT statement, etc.

Sample Description

11 Command @?MSG[cr/lf]

MESSAGE[cr/lf]……………………… PRINT "MESSAGE" is executed in a program.


Response
OK[cr/lf]

12
• For executing this command, it is required that the "INPUT/PRINT using channel" parameter is set at the port
to execute command.
13 • When the output message buffer is empty, only "OK" is output as the response.

3.27 Acquiring the input data


Command Format

@?INPUT[cr/lf]

Response Format

d[cr/lf]
OK[cr/lf]

Notation Value
d Input data

Meaning Acquires the input data by the INPUT statement.

Sample

Command @?INPUT[cr/lf]

INPUT_SAMPLE[cr/lf]
Response
OK[cr/lf]

12-34 Chapter 12 Online commands


3.28 Acquiring various values

3.28.1 Acquiring the value of a numerical expression


7
Command Format

@?numerical expression[cr/lf] 8
Response Format

numerical value[cr/lf]
OK[cr/lf] 9
Meaning Acquires the value of the specified numerical expression.
The numerical expression's value format is "decimal" or "real number".
10
Sample 1

Command @?SQR(100*5)[cr/lf]

Response
2.236067E01[cr/lf] 11
OK[cr/lf]

Sample 2

Command @?LOC1(WHERE)[cr/lf] 12
102054[cr/lf]
Response
OK[cr/lf]

13

3.28.2 Acquiring the value of a character string expression


Command Format

@?character string expression[cr/lf]

Response Format

character string[cr/lf]
OK[cr/lf]

Meaning Acquires the value (character string) of the specified character string expression.

Sample: The case of A$="ABC" and B$="DEF".

Command @?A$+B$+"123"[cr/lf]

ABCDEF123[cr/lf]
Response
OK[cr/lf]

Reference commands 12-35


3.28.3 Acquiring the value of a point expression
7 Command Format

@?point expression[cr/lf]

8 Response Format

point data[cr/lf]
OK[cr/lf]

9 Meaning Acquires the value (point data) of the specified point expression.

Sample

10
Command @?P1+WHRXY[cr/lf]

10.410 -1.600 52.150 3.000 0.000 0.000 0 0 0[cr/lf]


Response
OK[cr/lf]

11

3.28.4 Acquiring the value of a shift expression


12
Command Format

@?shift expression[cr/lf]

13 Response Format

shift data[cr/lf]
OK[cr/lf]

Meaning Acquires the value (shift coordinate data) of the specified shift expression.

Sample

Command @?s1[cr/lf]

25.000 12.600 10.000 0.000[cr/lf]


Response
OK[cr/lf]

12-36 Chapter 12 Online commands


4 Operation commands
7
4.1 Absolute reset
Command Format
8
@ABSADJ[robot number] k,f[cr/lf]
@MRKSET[robot number] k[cr/lf]

9
Response Format

RUN[cr/lf] ……………………… At movement start


END[cr/lf] ……………………… At movement end

Notation Value Range / Meaning 10


robot number 1 to 4 (If not input, robot 1 is specified.)

k Axis number 1 to 6

f Movement direction 0: + direction, 1: – direction

11
Meaning Performs the absolute reset operation of the specified axis of the robot specified by <robot number>.
This command is available only to axes whose return-to-origin method is set as "Mark".
ABSADJ: Moves the specified robot axis to an absolute reset position. 12
MRKSET: Performs absolute reset on the specified robot axis.

13
Sample Description

Command @ABSADJ 1,0[cr/lf]

RUN[cr/lf]……………………… Movement start


Response
END[cr/lf]……………………… Movement end

Operation commands 12-37


4.2 Return-to-origin operation
7 Command Format

@ORGRTN[robot number] k[cr/lf]

8 Response Format

RUN[cr/lf] ……………………… At movement start


END[cr/lf] ……………………… At movement end

9 Notation Value Range


robot number 1 to 4 (If not input, robot 1 is specified.)

k Axis number 1 to 6

10 Meaning Performs the return-to-origin operation of the specified axis of the robot specified by <robot number>.
For the axis with the semi-absolute specifications, when the return-to-origin is executed, the absolute
search operation is performed.

11 Sample Description

Command @ORGRTN 1[cr/lf]

12
RUN[cr/lf]……………………… Movement start
Response
END[cr/lf]……………………… Movement end

13

12-38 Chapter 12 Online commands


4.3 Manual movement: inching
Command Format
7
@INCH[robot number] km[cr/lf]
@INCHXY[robot number] km[cr/lf]
@INCHT[robot number] km[cr/lf]
8
Response Format

RUN[cr/lf] ……………………… At movement start


END[cr/lf] ……………………… At movement end 9
Notation Value Range
robot number 1 to 4 (If not input, robot 1 is specified.)

k Axis number 1 to 6 10
m Movement direction +, –

Meaning Manually moves (inching motion) the specified axis of the robot specified by the <robot number>.
The robot performs the same motion as when moved manually in inching motion with the programming 11
box's jog keys (moves a fixed distance each time a jog key is pressed).

The unit of the movement amount and operation type by command are shown below.
INCH: "pulse" units. Only the specified axis moves. 12
INCHXY: "mm" units. According to the robot configuration, the arm tip of the robot moves
in the direction of the Cartesian coordinate system.
INCHT: "mm" units. According to the robot configuration, the hand attached to the arm tip of
the robot moves. 13
Sample Description

Command @INCH 1+[cr/lf]

RUN[cr/lf]……………………… Movement start


Response
END[cr/lf]……………………… Movement end

Operation commands 12-39


4.4 Manual movement: jog
7 Command Format

@JOG[robot number] km[cr/lf]


@JOGXY[robot number] km[cr/lf]
8 @JOGT[robot number] km[cr/lf]

Response Format

RUN[cr/lf] ……………………… At movement start


9 END[cr/lf] ……………………… At movement end

Notation Value Range


robot number 1 to 4 (If not input, robot 1 is specified.)

10 k Axis number 1 to 6

m Movement direction +, –

Meaning Manually moves (jog motion) the specified axis of the robot specified by the <robot number>.
11 The robot performs the same motion as when holding down the programming box's jog keys in manual
mode.

To continue the operation, it is necessary for the JOG command to input the execution continue process
12 (^V(=16H)) by the online command at intervals of 200ms. If not input, the error stop occurs.

Additionally, after the movement has started, the robot stops when any of the statues shown below arises.
• When software limit was reached.
13 • When stop signal was turned off.
• When STOP key on the programming box was pressed.
• When an online command (^C (=03H)) to interrupt execution was input.

The unit of the movement amount and operation type by command are shown below.
JOG : "pulse" units.
Only the specified axis moves.
JOGXY: "mm" units.
According to the robot configuration, the arm tip of the robot moves in the direction of
the Cartesian coordinate system.
JOGT: "mm" units.
According to the robot configuration, the hand attached to the arm tip of the robot
moves.

Sample Description

Command @JOG 1+[cr/lf]

RUN[cr/lf]……………………… Movement start


Response
END[cr/lf]……………………… Movement end

12-40 Chapter 12 Online commands


5 Data file operation commands
7
5.1 Copy operations

5.1.1 Copying a program


8
Command Format

<program name 1>


@COPY TO <program name 2> [cr/lf]
PGn
9
Response Format

RUN[cr/lf] ……………………… At prosess start


END[cr/lf] ……………………… At prosess end
10
Notation Value Range
Program name 1 Program name in copy source 32 characters or less consisting of
Program name 2 Program name in copy destination alphanumeric characters and underscore
11
n Program number 1 to 100

Meaning Copies the program specified by <program name 1> or program number to <program name 2>.

Sample Description
12
Command @COPY <TEST1> TO <TEST2>[cr/lf]

RUN[cr/lf]……………………… Process start


Response
END[cr/lf]……………………… Process end 13

5.1.2 Copying point data


Command Format

@COPY Pmmmmm-Pnnnnn TO Pkkkkk[cr/lf]

Response Format

RUN[cr/lf] ……………………… At prosess start


END[cr/lf] ……………………… At prosess end

Notation Value Range


mmmmm Top point number in copy source

nnnnn Last point number in copy source 0 to 29999

kkkkk Top point number in copy destination

Meaning Copies the point data between Pmmmmm and Pnnnnn to Pkkkkk.

Sample Description

Command @COPY P101-P200 TO P1101[cr/lf]

RUN[cr/lf]……………………… Process start


Response
END[cr/lf]……………………… Process end

Data file operation commands 12-41


5.1.3 Copying point comments
7 Command Format

@COPY PCmmmmm-PCnnnnn TO PCkkkkk[cr/lf]

8 Response Format

RUN[cr/lf] ……………………… At prosess start


END[cr/lf] ……………………… At prosess end

9 Notation Value Range


mmmmm Top point comment number in copy source

nnnnn Last point comment number in copy source 0 to 29999

kkkkk Top point comment number in copy destination


10
Meaning Copies the point comments between PCmmmmm and PCnnnnn to PCkkkkk.

11 Sample Description

Command @COPY PC101-PC200 TO PC1101[cr/lf]

RUN[cr/lf]……………………… Process start


Response
END[cr/lf]……………………… Process end
12

13 5.2 Erase

5.2.1 Erasing a program


Command Format

<program name>
@ERA [cr/lf]
PGn

Response Format

RUN[cr/lf] ……………………… At prosess start


END[cr/lf] ……………………… At prosess end

Notation Value Range


32 characters or less consisting of
Program name Program name to be erased
alphanumeric characters and underscore
n Program number 1 to 100

Meaning Erases the designated program.

Sample Description

Command @ERA <TEST1>[cr/lf]

RUN[cr/lf]……………………… Process start


Response
END[cr/lf]……………………… Process end

12-42 Chapter 12 Online commands


5.2.2 Erasing point data Command format
Command Format
7
@ERA Pmmmmm-Pnnnnn[cr/lf]

Response Format
8
RUN[cr/lf] ……………………… At prosess start
END[cr/lf] ……………………… At prosess end

Notation Value Range 9


mmmmm Top point number to be erased
0 to 29999
nnnnn Last point number to be erased

10
Meaning Erases the point data between Pmmmmm and Pnnnnn.

Sample Description

Command @ERA P101-P200[cr/lf]


11
RUN[cr/lf]……………………… Process start
Response
END[cr/lf]……………………… Process end

12

13
5.2.3 Erasing point comments
Command Format

@ERA PCmmmmm-PCnnnnn[cr/lf]

Response Format

RUN[cr/lf] ……………………… At prosess start


END[cr/lf] ……………………… At prosess end

Notation Value Range


mmmmm Top point comment number to be erased
0 to 29999
nnnnn Last point comment number to be erased

Meaning Erases the point comments between PCmmmmm and PCnnnnn.

Sample Description

Command @ERA PC101-PC200[cr/lf]

RUN[cr/lf]……………………… Process start


Response
END[cr/lf]……………………… Process end

Data file operation commands 12-43


5.2.4 Erasing point name
7 Command Format

@ERA PNmmmmm-PNnnnnn[cr/lf]

8 Response Format

RUN[cr/lf] ……………………… At prosess start


END[cr/lf] ……………………… At prosess end

9 Notation Value Range


mmmmm Top point name number to be erased
0 to 29999
nnnnn Last point name number to be erased

10 Meaning Erases the point names between PNmmmmm and PNnnnnn.

Sample Description

11 Command @ERA PC101-PC200[cr/lf]

RUN[cr/lf]……………………… Process start


Response
END[cr/lf]……………………… Process end

12

13 5.2.5 Erasing pallet data


Command Format

@ERA PLm[cr/lf]

Response Format

RUN[cr/lf] ……………………… At prosess start


END[cr/lf] ……………………… At prosess end

Notation Value Range


m Pallet number to be erased 0 to 39

Meaning Erases the PLm pallet data.

Sample Description

Command @ERA PL1[cr/lf]

RUN[cr/lf]……………………… Process start


Response
END[cr/lf]……………………… Process end

12-44 Chapter 12 Online commands


5.2.6 Erasing general-purpose Ethernet port
Command Format
7
@ERA GPm[cr/lf]

Response Format
8
RUN[cr/lf] ……………………… At prosess start
END[cr/lf] ……………………… At prosess end

Notation Value Range


9
m General-purpose Ethernet port number to be erased 0 to 15

Meaning Erases the general-purpose Ethernet port of "GPm". 10

Sample Description

Command @ERA GP5[cr/lf]


11
RUN[cr/lf]……………………… Process start
Response
END[cr/lf]……………………… Process end

12

5.2.7 Erasing real time output


13
Command Format

@ERA RTmmm-RTnnn[cr/lf]

Response Format

RUN[cr/lf] ……………………… At prosess start


END[cr/lf] ……………………… At prosess end

Notation Value Range


mmm Top real time output number to be erased
24 to 127
nnn Last real time output number to be erased

Meaning Erases the real time output setteng between RTmmm and RTnnn.

Sample Description

Command @ERA RT24-RT80[cr/lf]

RUN[cr/lf]……………………… Process start


Response
END[cr/lf]……………………… Process end

Data file operation commands 12-45


5.3 Rename program
7 Command Format

<program name 1>


@REN TO <program name 2> [cr/lf]
PGn
8 Response Format

RUN[cr/lf] ……………………… At prosess start


END[cr/lf] ……………………… At prosess end
9
Notation Value Range
Program name 1 Program name before renaming 32 characters or less consisting of
Program name 2 Program name after renaming alphanumeric characters and underscore

10 n Program number 1 to 100

Meaning Changes the name of the specified program.

11 Sample Description

Command @REN <TEST1> TO <TEST2>[cr/lf]

RUN[cr/lf ……………………… Process start


Response
12 END[cr/lf]……………………… Process end

13 5.4 Changing the program attribute


Command Format

<program name>
@ATTR TO s[cr/lf]
PGn

Response Format

OK[cr/lf]

Notation Value Range / Meaning


32 characters or less consisting of alphanumeric characters
Program name Program name to change the attribute
and _ (underscore)
RW: Readable/writable
s Attribute RO: Not writable (read only)
H: Hidden
n Program number 1 to 100

Meaning Changes the attribute of the program specified by the <program name> or program number.

Sample

Command @ATTR <TEST1> TO RO[cr/lf]

Response OK[cr/lf]

12-46 Chapter 12 Online commands


5.5 Initialization process

5.5.1 Initializing the memory area


7
Command Format

@INIT memory area[cr/lf] 8


Response Format

RUN[cr/lf] ……………………… At prosess start


END[cr/lf] ……………………… At prosess end 9
Notation Value Meaning

10
PGM Initializes the program area.

PNT Initializes the point data area.

SFT Initializes the shift data area.

HND Initializes the hand data area.

WRKDEF Initializes the work data area.


11
PLT Initializes the pallet data area.

PCM Initializes the point comment area.

Memory area PNM Initializes the point name area.

ION Initializes the input/output name area. 12


ACO Initializes the area check output setting area.

RTO Initializes the real time output setting area.

GEP Initializes the general-purpose Ethernet port setting area.

MEM Initializes the above areas (PGM ... all data up to GEP). 13
PRM Initializes the parameter area.

ALL Initializes all areas (MEM+PRM).

Meaning Initializes the memory area.


To Initialize, specify any memory area among "Value" above.

Sample Description

Command @INIT PGM[cr/lf]

RUN[cr/lf]……………………… Process start


Response
END[cr/lf]……………………… Process end

Data file operation commands 12-47


5.5.2 Initializing the communication port
7 Command Format

@INIT communication port[cr/lf]

8 Response Format

RUN[cr/lf] ……………………… At prosess start


END[cr/lf] ……………………… At prosess end

9 Notation Value Meaning


CMU Initializes the RS-232C port
Communication port
ETH Initializes the Ethernet port

10 Meaning Initializes the communication port.


To Initialize, specify any port between "Value" above.

Reference For information about the communication port initial settings,


11 refer to the user's or operator's manual.

Sample Description

Command @INIT CMU[cr/lf]

12 RUN[cr/lf]……………………… Process start


Response
END[cr/lf]……………………… Process end

13
5.5.3 Initializing the alarm history
Command Format

@INIT LOG[cr/lf]

Response Format

RUN[cr/lf] ……………………… At prosess start


END[cr/lf] ……………………… At prosess end

Meaning Initializes the alarm history.

Sample Description

Command @INIT LOG[cr/lf]

RUN[cr/lf]……………………… Process start


Response
END[cr/lf]……………………… Process end

12-48 Chapter 12 Online commands


5.6 Data readout processing
Command Format
7
@READ read-out file[cr/lf]

Response Format
8
BEGIN[cr/lf] ……………………… At prosess start
(Data output: The contents may vary depending on the read-out file.)
END[cr/lf] …………………………… At prosess end
9
Meaning Reads out the data from the designated file.
•O
 nline commands that are input through the RS-232C port have the same meaning as the following command.
SEND <read-out file> TO CMU
• Commands via Ethernet have the same meaning as the following command. 10
SEND <read-out file> TO ETH
Reference Chapter 10 "Data file description"

Type Read-out file name


All
Definition format
Individual file
11
All file ALL --------
Program PGM <bb…b>>
Point data PNT Pn
Point comment PCM PCn
Point name
Parameter
PNM
PRM
PNn
/cccccccc/
12
Shift definition SFT Sn
User memory
Hand definition HND Hn
Work definition WRKDEF Wn
Pallet definition PLT PLn
General Ethernet port
Input/output name
GEP
ION
GPn
iNMn(n) 13
Area check output ACO ACn
Real time output RTO RTn
Variable VAR ab...by
Variable, constant Array variable ARY ab...by(x)
Constant -------- "cc...c"
Program directory DIR <<bb…b>>
Parameter directory DPM --------
Machine reference (sensor or stroke-end) MRF --------
Machine reference (mark) ARP --------
Accumulated data ACD --------
System configuration information CFG --------
Status Controller CNT --------
Robot RBT --------
Driver DRV --------
Option board OPT --------
Self check SCK --------
Alarm history LOG --------
Remaining memory size MEM --------
DI port DI() DIn()
DO port DO() DOn()
MO port MO() MOn()
TO port TO() TOn()
Device LO port LO() LOn()
SI port SI() SIn()
SO port SO() SOn()
SIW port SIW() SIWn()
SOW port SOW() SOWn()
Others File end code EOF --------
a: Alphabetic character b: Alphanumeric character or underscore ( _ ) c: Alphanumeric character or symbol
i: I/O type n: Number x: Expression (Array argument) y: variable type

Sample Description
@READ PGM[cr/lf]……………………… Reads out all programs.
Command @READ P100[cr/lf]…………………… Reads out the point 100.
@READ DINM2(0)[cr/lf]………… Reads out the input/output name of DI2(0).

Data file operation commands 12-49


5.7 Data write processing
7 Command Format

@WRITE write file[cr/lf]

8 Response Format

READY[cr/lf] ……………………… Input request display


OK [cr/lf] ……………………… After input is completed

9 Meaning Writes the data in the designated file.


•O
 nline commands that are input through the RS-232C port have the same meaning as the following command.
SEND CMU TO <write file>
• Commands via Ethernet have the same meaning as the following command.
10 SEND ETH TO <write file>
Reference Chapter 10 "Data file description"

11
• At the DO, MO, TO, LO, SO, SOW ports, an entire port (DO(), MO(), etc.) cannot be designated as a WRITE file.
• Some separate files (DOn(), MOn(), etc.) cannot be designated as a WRITE file. For details, refer to Chapter 10
"Data file description".
12

Definition format
Type Write file name
13 User memory All file
All
ALL
Separate file
--------
Program PGM <bb…b>>
Point data PNT Pn
Point comment PCM PCn
Point name PNM PNn
Parameter PRM /cccccccc/
Shift definition SFT Sn
Hand definition HND Hn
Work definition WRKDEF Wn
Pallet definition PLT PLn
General Ethernet port GEP GPn
Input/output name ION iNMn(n)
Area check output ACO ACn
Real time output RTO RTn
Variable, constant Variable VAR ab...by
Array variable ARY ab...by(x)
Device DO port -------- DOn()
MO port -------- MOn()
TO port -------- TOn()
LO port -------- LOn()
SO port -------- SOn()
SOW port -------- SOWn()
a: Alphabetic character b: Alphanumeric character or underscore ( _ ) c: Alphanumeric character or symbol
i: I/O type n: Number x: Expression (Array argument) y: variable type

Sample Description
@WRITE PRM[cr/lf]………………… Writes all parameters.
Command @WRITE P100[cr/lf]……………… Writes the point 100.
@WRITE DINM2(0)[cr/lf]……… Writes the input/output name of DI2(0).

12-50 Chapter 12 Online commands


6 Utility commands
7
6.1 Setting the sequence program execution flag
Command Format

@SEQUENCE k[cr/lf]
8
Response Format

OK[cr/lf]
9
Notation Value Range / Meaning
k Execution flag 0: disable, 1: enable, 3: enable (DO reset)

Meaning Sets the sequence program execution flag. 10


Sample Description

Command @SEQUENCE 1[cr/lf]

Response OK[cr/lf] 11
6.2 Setting the date
Command Format 12
@DATE yy/mm/dd[cr/lf]

Response Format

OK[cr/lf] 13
Notation Value Range
yy/mm/dd Date to be set year, month, day

yy Lower 2 digits of the year 00 to 99

mm Month 01 to 12

dd Day 01 to 31

Meaning Sets a date in the controller.

n NOTE
To change only the year or month, the slash ( / ) following it can be omitted.
Example:
• To set the year to 2016, enter 16[cr/lf]. • To set the month to June, enter /06[cr/lf].

• The currently set values are used for the omitted items.
• If only [cr/lf] is transmitted, then the date remains unchanged.
• If an improbable date is entered, then "5.202: Data error" occurs.

Sample 1 : To change only the day,

Command //15[cr/lf] ………………… Day is set to 15th.

Sample 2 Description

Command @DATE 16/01/14[cr/lf]

Response OK[cr/lf]

Utility commands 12-51


6.3 Setting the time
7 Command Format

@TIME hh:mm:ss[cr/lf]

8 Response Format

OK[cr/lf]

Notation Value Range


9 hh:mm:ss Current time

hh Hour 00 to 23

mm Minute 00 to 59

10
ss Second 00 to 59

Meaning Sets the time of the controller.

11
• The currently set values are used for the omitted items.
• If only [cr/lf] is transmitted, then the time remains unchanged.
• If an improbable time is entered, then "5.202: Data error" occurs.
12

13
Sample 1: To change only the minute,

Command :20:[cr/lf]………………………Minute is set to 20.

Sample 2

Command @TIME 10:21:35[cr/lf]

Response OK[cr/lf]

12-52 Chapter 12 Online commands


7 Individual execution of robot language
7
7.1 Command

8
Command Format

@robot language[cr/lf]

Response Format 1 9
OK[cr/lf] or NG=gg.bbb[cr/lf]

Response Format 2
10
RUN[cr/lf] or NG=gg.bbb[cr/lf] ……………………… At process start
END[cr/lf] or NG=gg.bbb[cr/lf] ……………………… At process end

11
Notation Value Range
OK, END Command ended correctly

NG An error occurred

RUN Command starts correctly 12


gg Alarm group number 0 to 99

bbb Alarm classification number 0 to 999

13
Meaning Robot language commands can be executed.
• Only independently executable commands are executed.
• Command format depends on each command to be executed.

Sample 1

Command @SET DO(20) [cr/lf]

Response OK[cr/lf]

Sample 2 Description

Command @MOVE P,P100,S=20[cr/lf]

RUN[cr/lf] …………………………… Process start


Response
END[cr/lf] …………………………… Process end

Individual execution of robot language 12-53


7.2 Function
7
Command Format

@?robot language[cr/lf]
8
Response Format

X[cr/lf]
9 OK[cr/lf]

Notation Value Range


10 X Return value

OK, END Command ended correctly

NG An error occurred

11
gg Alarm group number 0 to 99

bbb Alarm classification number 0 to 999

Meaning Robot language Functions can be executed.


12 • Only independently executable functions are executed.
• Function format depends on each function to be executed.

13
Sample Description

Command @?REFTSK(1)[cr/lf] …………………………………………… Acquires the status of Task 1.

0[cr/lf] ………………………………………………………………… Task 1 is in STOP staus.


Response
OK[cr/lf]

12-54 Chapter 12 Online commands


8 Control codes
7
Command Format

^C (=03H)
8
Response Format

NG=1.8

9
Meaning Interrupts execution of the current command.

10
Sample Description
@MOVE P,P100,S=20[cr/lf]
Command
^C

Response NG=1.8[cr/lf] 11

12

13

Control codes 12-55


Chapter 13
Appendix

1 1Reserved word list...................................... 13-1


2 2Changes from conventional models....... 13-3
1 Reserved word list
7
The words shown below are reserved for robot language and cannot be used as identifiers (variables, etc.).

A D HOLDALL MRKSET
ABS DATE I MSG 8
ABSADJ DBP IDIST MSGCLR
ABSRPOS DECEL IF MSPEED
ACCEL DEF IMP MTRDUTY
ACCESS
ACD
DEGRAD
DELAY
INCH
INCHT
N
NAME
9
ACO DI INCHXY NEXT
ALL DIM INIT NOT
ALM
ALMRST
DIR
DIST
INPUT
INROFST
O
OFFLINE
10
AND DO INT ON
ARCHP1 DPM ION ONLINE
ARCHP2
ARM
DRIVE
DRIVEI
J
JOG
OPEN
OPT
11
ARMCND DRV JOGT OR
ARMSEL E JOGXY ORD
ARMTYP
ARP
ELSE
ELSEIF
JTOXY
L
ORGORD
ORGRTN
12
ARY EMG LEFT ORIGIN
ASPEED END LEFTY OUT
ATN ENDIF LEN OUTPOS
ATN2 EOF LET P 13
ATTR EQV LINEMODE P
AXWGHT ERA LO PATH
B ERL LOAD PCM
BIN ERR LOC1 PDEF
BREAK ERROR LOC2 PGM
C ETH LOC3 PGMTSK
CALL ETHSTS LOC4 PGN
CASE EXIT LOC5 PLT
CFG EXITTASK LOC6 PMOVE
CHANGE F LOCF PNM
CHGPRI FN LOG PNT
CHGWRK FOR LSHIFT PPNT
CHR G M PRINT
CLOSE GEP MAINPG PRM
CMU GEPSTS MCHREF PSHFRC
CNT GO MEM PSHJGSP
CORRECTXY GOSUB MID PSHMTD
CONTPLS GOTO MO PSHRSLT
COPY H MOD PSHSPD
COS HALT MODE PSHTIME
CREWRK HALTALL MOTOR PUSH
CURPNT HAND MOVE R
CURTQST HEX MOVEI RADDEG
CURTRQ HND MOVET RBT
CUT HOLD MRF RBTWRK

Reserved word list 13-1


READ SFT TASKS WHILE

7 REF
REM
SGI
SGR
TCHXY
TCOUNTER
WHRXY
WHRXYEX
REN SHARED TEACH WRITE
RESET SHIFT THEN WRKDEF

8 RESTART
RESUME
SI
SID
TIME
TIMER
X
XOR
RETURN SIN TO XYTOJ
RIGHT SIW TOLE

9 RIGHTY
RSHIFT
SKIP
SKIPTO
TORQUE
TSKECD
RTO SO TSKMON
RUN SOD TSKPGM

10
RUNTO SOW V
S SPEED VAL
S SQR VAR
SCK START VER
SCRINR STEP VMCDEF
11 SELECT STOP VMCPNO
SEND STR VMCORRECT
SEQCMPL SUB VMCSTS
SEQCMPSTS SUSPEND W
12 SEQUENCE SWI WAIT
SERVO SYNCHK WEIGHT
SET T WEIGHTG
SETGEP TAG WEND
13 SETPW TAN WHERE

Since the following names are used as system variable names, they cannot be used at the beginning of other
variable names

ACn GPn PNn SOn


DIn Hn SGIn SONMn
DINMn LOn SGRn TOn
DOn MOn SIn
DONMn PCn SINMn
FN Pn Sn n: numeric value

Variable name usage examples


■ Although keywords which are reserved as robot language words cannot be used as they are, they can be used
as variable names if alphanumeric characters are added to them.

Example: "ABS" cannot be used, but "ABS1" or "ABSX" can be used.

■ Keywords reserved as system variables cannot be used at the beginning of other variable names, even if
alphanumeric characters are added to them.

Example: "FN" cannot be used. "FNA" and "FN123" also cannot be used.

13-2 Chapter 13 Appendix


Conventional models: RCX240, 240S, RCX141, RCX142, RCX40, RCX221, RCX222

2 Changes from conventional models


7
1 Program name
For RCX340/RCX320, the following two program names which have been special for conventional models (RCX240,
etc.) don't have a special meaning. 8
A) FUNCTION
B) _SELECT
9
A) FUNCTION
In conventional models (RCX240, etc.), "FUNCTION" has been a special program for registering a user function.
RCX340/RCX320 doesn't have a user function, thus it doesn't have a special meaning.
10
B) _SELECT
In conventional models (RCX240, etc.), the "_SELECT" program has been selected and executed every time robot
programs were reset.
In RCX340/RCX320, the program specified at the main program number (or the program executed last if there is no 11
specified program there) is selected and executed when robot programs are reset.
For details regarding the main program, refer to "12. Set main program" in "2.1 Program operations" in Chapter 12.

12
2 Multiple Robot Control
In conventional models (RCX240, etc.), robot has consisted of a main group (one main robot, main auxiliary axes) and
a sub group (one sub robot, sub auxiliary axes). 13
In RCX340/RCX320, robot consists of robot 1 to 4 (normal axes, auxiliary axes).
Due to this change, commands for each group have changed to ones for each robot.
For details regarding the command for each robot, refer to "2. Command list with a robot setting" in Chapter 5 of this
manual for RCX340/RCX320, and regarding the command for each group, refer to "Command list for each group” of
the programming manual for conventional models (RCX240, etc.), respectively.

Command to each robot group by conventional controller (RCX240, etc.)


Sample Description

MOVE P, P1 …………………………… Axes of a main group move to the position specified at P1.

MOVE2 P, P5 ………………………… Axes of a sub group move to the position specified at P5.

Command to specified robot by RCX340/RCX320


Sample Description

MOVE P, P1 …………………………… Axes of the robot 1 move to the position specified at P1.

MOVE[2] P, P5 ……………………… Axes of the robot 2 move to the position specified at P5.

Robot number can be omitted in the commands with a robot setting. When omitted, robot 1 is specified.

Changes from conventional models 13-3


3 Multi-tasking
7 The differences between RCX340/RCX320 and conventional models (RCX240, etc.) are shown below.
Conventional models RCX340/RCX320
Maximum number of task 8 16

8
Priority 17 to 47 1 to 63
Task definition During the program In another program

Task is assigned in Task 1 automatically Task is assigned in a specified task number


Starting tasks
and placed in RUN status and placed in RUN status

9 Command execution for Task 1


Not executable Executable
(restart, etc.)

Reference For details regarding the multi-tasking, refer to Chapter 6 "Multi-tasking" in this manual
10 or in a programming manual for conventional models (RCX240, etc.).

4 Robot Language
11
The following robot languages are not supported in RCX340/RCX320.
ABSINIT ABSINIT2 ABSRST ABSRPOS2
ACCEL2 ARMCND2 ARMTYP2 ASPEED2
12 AXWGHT2 CHANGE2 CURTRQ2 DECEL2
DECLARE DRIVE2 DRIVEI2 HAND2
JTOXY2 LEFTY2 MCHREF2 MOVE2
MOVEI2 ORGORD2 OUTPOS2 PMOVE2
13 RIGHTY2 SERVO2 SHIFT2 SPEED2
TOLE2 TORQUE2 TRQSTS TRQSTS2
TRQTIME TRQTIME2 WAIT ARM2 WEIGHT2
WHERE2 WHRXY2 XYTOJ2 _SYSFLG

Reference For details regarding the robot Languages above,


refer to the programming manual for conventional models (RCX240, etc.).

5 Online commands
The following online commands are not supported in RCX340/RCX320.
AUTO EMGRST EXELV MANUAL
? ARM ? CONFIG ? EXELVL ? OPSLOT
? SELFCHK ? WHRXYEX

Reference For details regarding the online commands above,


refer to the programming manual for conventional models (RCX240, etc.).

6 Data file
• "Alarm history file" replaced "Error message history file" and "Error message history details file" of conventional
models.
• In RCX340/RCX320, the point number ranges from 0 to 29999 (0 to 9999: Conventional models).

Reference Chapter 10 "Data file description"

13-4 Chapter 13 Appendix


Revision record

Version Issue date Description


Ver. 1.00 Apr. 2014 First edition

Ver. 1.10 Aug. 2014 Clerical error corrections, etc.

Ver. 1.20 Mar. 2016 Chapter 7 "Sequence function" was added. "PATH control" and "Torque
control" were added to robot language in Chapter 8. Chapter 9 "PATH
Statements" was added. "2.5 Sealing" was added in Chapter 11. "2 Changes
from conventional models" was added in Chapter 13.

Ver. 1.21 Feb. 2017 Contact information was changed.

Ver. 1.31 Mar. 2017 Conditions of PUSH statement were changed in Chapter 8. Descriptions on "
I/O name" were added in Chapter 10.

Ver. 1.33 Mar. 2018 Descriptions of current value were added to CURTQST/CURTRQ/MTRDUTY
statements, descriptions of online/offline modes were added to OFFLINE/
ONLINE statements in Chapter 8.

Ver. 1.37 Nov. 2018 Commands for work definition were added.

Ver. 1.38 Aug. 2019 WEIGHTG statement was added.

Ver. 2.00 Oct. 2019 Controller "RCX320" was added.

Ver. 2.03 Apr. 2020 Added the functions (real time output/SIOW area extension) and commands
(CONTPLS/CORRECTXY/SCRINR/INROFST).

Ver. 2.06 Feb. 2021 Added the function (Task status acquisition REFTSK) and the online
commands (HND/WRKDEF).

Ver. 2.07 Oct. 2021 Added the work data as the usable target of LOCx (Ch. 8).

Ver. 2.09 Apr. 2022 Added ACD (Data file/ Online command) and SEQCMPSTS (Online
command). Added the descriptions of sample programs to Ch. 8

Programming Manual

RCX 3 Series
4-axis/2-axis Robot Controller

Apr. 2022
Ver. 2.09

YAMAHA MOTOR CO., LTD. Robotics Operations


All rights reserved. No part of this publication may be reproduced in
any form without the permission of YAMAHA MOTOR CO., LTD.
Information furnished by YAMAHA in this manual is believed to be
reliable. However, no responsibility is assumed for possible
inaccuracies or omissions. If you find any part unclear in this manual,
please contact your distributor.
Robotics Operations
127 Toyooka, Kita-ku, Hamamatsu, Shizuoka, 433-8103, Japan
https://global.yamaha-motor.com/business/robot/ YAMAHA MOTOR CO., LTD.

You might also like