kawasaki Robot AS Reference Manual

Kawasaki Robot Controller D Series
AS Language
Reference Manual
902091017DEB
Kind of Manual
Standard Manual □Option Manual □Manual for Specific User □Detailed Manual
24 December, 2002
ROBOT DIVISION
Recognition Recognition Examination Checked Produce
Kawasaki Robot Controller D Series
AS Language
Reference Manual
Optical
File
Tanaka
Delivery to : Number of sheets
Manuf. Section □KMS □ KRI □KRUK □KRG □KMSK □Others( ) 417 Pages
Kawasaki Heavy Industries, Ltd.
902091017DEB
D Series Controller Kawasaki Robot AS language Reference Manual
PREF ACE
This manual describes the AS* language used in the Kawasaki Robot Controller D series. The objective for this manual is to provide detailed information on the outline of the AS system, basic usages, data types, robot trajectory control and all the commands/instruction to allow effective usage of the AS system. The robot operation procedures are not included here, so refer to the Operation Manual for that information. This manual should be read with careful review of the related manuals listed below. Once the contents of all the manuals are thoroughly read and understood the robot can be used.
1. Safety Manual
2. Installation and Connection Manual for Arm
3. Installation and Connection Manual for Controller
4. External I/O Manual (for connecting with peripheral devices)
5. Inspection and Maintenance Manual
The contents of this manual are described on condition that installation and connection of the robot are done in accordance with the above listed manuals.
The explanations in this manual include information on optional functions, but depending on the specification of each unit, not every optional function detailed here may be included with the robot. Should any unexplained questions or problems arise during robot operation, please contact Kawasaki Machine Systems. Refer to the contact information listed on the rear cover of this manual for the nearest Kawasaki Machine Systems of fice.
NOTE* AS is pronounced [az] This manual does not constitute a guarantee of the systems in which the robot is utilized. Accordingly, Kawasaki is not responsible for any accidents, damages, and/or problems relating to industrial property rights as a result of using the system.
1. It is recommended that all personnel assigned for activation of operation, teaching,
maintenance or inspection of the robot attend the necessary education/training course(s) prepared by Kawasaki, before assuming their responsibilities.
2. Kawasaki reserves the rights to change, revise, or update this manual without prior notice.
3. This manual may not, in whole or in part, be reprinted or copied without the prior written
consent of Kawasaki.
4. Store this manual with care and keep it available for use at any time. In the event the manual
is lost or damaged severely , contact your Kawasaki agent.
5. Though this manual was prepared to be as thorough and accurate as possible, the authors
apologize should any information be found incomplete or erroneous.
All rights reserved. Copyright © 2002 by Kawasaki Heavy Industries Ltd.
i
D Series Controller Kawasaki Robot AS language Reference Manual
SYMBOLS
The items that require special attention in this manual are des ignated with th e following sym bols.
Ensure proper and safe operation of the robot and prevent physical injury or property damage by complying with the safety matters given within the boxes with these symbols.
Failure to comply with indicated matters can result in imminent injury or death.
Failure to comply with indicated matters may possibly lead to injury or death.
Failure to comply with indicated matters may lead to physical injury and/or mechanical damage.
DANGER
WARNING
CAUTION
Denotes precautions regarding robot specification, handling, teaching, operation and maintenance.
[ NOTE ]
ii
D Series Controller Kawasaki Robot AS Language Reference Manual
CONTENTS
Preface··············································································································································i
1.0 Overall of AS····························································································1-1
1.1 System Overview ······················································································1-2
1.2 Characteristics of the AS System································································1-3
1.3 AS System Configuration···········································································1-4
2.0 AS System ································································································2-1
2.1 AS System Status ······················································································2-2
2.2 AS System Switches··················································································2-3
2.3 AS System Setup·······················································································2-5
2.4 Input and Output Operations ······································································2-6
2.5 Installing Terminal Software ······································································2-8
2.6 Operations from Personal Computer···························································2-9
3.0 Information Expressions in AS Language ···················································3-1
3.1 Notation and Conventions··········································································3-2
3.2 Pose Information, Numeric Information, and Character Information ············3-4
3.3 Variables ································································································3-10
3.4 Variable Names·······················································································3-12
3.5 Defining Pose Variables ·········································································· 3-13
3.6 Defining Real Variables···········································································3-19
3.7 Defining String Variables ········································································ 3-20
3.8 Numeric Experssions ··············································································· 3-21
3.9 String Expressions ··················································································· 3-24
4.0 AS Program·······························································································4-1
4.1 Types of AS Programs···············································································4-2
4.2 Creating and Editing Programs ···································································4-4
4.3 Executing Programs ···················································································4-9
4.4 Program Flow·························································································· 4-12
4.5 Robot Motion·························································································· 4-14
5.0 Monitor Commands ···················································································5-1
5.1 Editor Commands······················································································5-2
5.2 Program and Data Control Commands ······················································ 5-15 iii
D Series Controller Kawasaki Robot AS Language Reference Manual
5.3 Program and Data Storage Commands ······················································ 5-27
5.4 Program Control Commands ···································································· 5-36
5.5 Pose Information Commands····································································5-45
5.6 System Control Commands ······································································ 5-50
5.7 Binary Signal Commands·········································································5-86
5.8 Message Display Commands ····································································5-98
6.0 Program Instructions··················································································6-1
6.1 Motion Instructions ···················································································6-2
6.2 Speed and Accuracy Control Instructions·················································· 6-15
6.3 Clamp Control Instructions ······································································6-23
6.4 Configuration Instructions········································································ 6-30
6.5 Program Control Instructions ··································································· 6-33
6.6 Program Structure Instructions································································· 6-46
6.7 Binary Signal Insturctions········································································ 6-56
6.8 Message Control Instructions ···································································6-74
6.9 Pose Information Instructions ··································································· 6-81
6.10 Program and Data Control Instructions····················································· 6-92
7.0 AS System Switches ··················································································7-1
8.0 Operators ··································································································8-1
8.1 Arithmetic Operators ·················································································8-2
8.2 Relational Operators··················································································8-3
8.3 Logical Operators ······················································································8-4
8.4 Binary Operators ·······················································································8-6
8.5 Transformation Value Operators ·································································8-7
8.6 String Operators ························································································8-9
9.0 Functions ··································································································9-1
9.1 Real Value Functions ·················································································9-2
9.2 Pose Value Functions···············································································9-20
9.3 Mathematical Functions ···········································································9-36
9.4 String Functions ······················································································9-39
10.0 Process Control Programs ········································································10-1
11.0 Sample Programs ····················································································· 11-1
11.1 Initial Settings for Programs·····································································11-2 iv
D Series Controller Kawasaki Robot AS Language Reference Manual
11.2 Palletizing ······························································································· 11-3
11.3 External Interlocking················································································ 11-5
11.4 Tool Transformation·················································································11-8
11.5 Relative Poses························································································11-11
11.6 Using Relative Poses with FRAME Functions·········································· 11-14
11.7 Setting Robot Configuration ···································································11-16
Appendix 1 Error Codes····················································································A-1 Appendix 2 AS Language List········································································· A-19 Appendix 3 ASCII Code ·················································································A-33 Appendix 4 Signal Limitation··········································································A-36 Appendix 5 Euler’s O,A,T Angles ···································································A-37
v
D Series Controller Kawasaki Robot AS Language Reference Manual
vi
D Series Controller 1. Overview of the AS System Kawasaki Robot AS Language Reference Manual
1.0 OVERVIEW OF AS
The Kawasaki robots are controlled by a software-based system called AS. This chapter describes the overall view of the AS system.
1.1 System Overview
1.2 Characteristics of the AS System
1.3 AS System Configuration
1-1
D Series Controller 1. Overview of the AS System Kawasaki Robot AS Language Reference Manual
1.1 OVERVIEW OF THE AS SYSTEM
In the AS system, you can place commands or execute programs using AS language. The AS system is written in the nonvolatile memory in the robot control unit. When the control power is turned on, the AS system starts and waits for a command to be input.
The AS system controls the robot according to the given commands and programs. It can also execute several types of functions while a program is running. Some of the functions that can be used while a program is running are: displaying the system status or the robot pose (location), saving data in external memory devices, and writing/editing programs.
1-2
D Series Controller 1. Overview of the AS System Kawasaki Robot AS Language Reference Manual
1.2 CHARACTERISTICS OF THE AS SYSTEM
In the AS system, the robots are controlled and operated based on a program that describes the necessary tasks and which is made prior to the operation. (Teaching Playback Method)
AS language can be divided into two types: monitor commands and program instructions.
Monitor commands: Used to write, edit, and execute programs. They are entered after
the prompt (>) shown on the screen, and are immediately executed. Some of the monitor commands are used within the program s to work as program instructions.
Program instructions: Used to direct the movements of the robot, to monitor or to control
external signals, etc. in programs. A program is a collection of program instructions.
In this manual, a monitor command is referred to as a command, a program instruction as an instruction.
AS is unique in the following ways:
1. The robot can be moved along a continuous path trajectory.CP motion: Continuous
Path motion
2. Two coordinate systems, base coordinates and tool coordinates, are provided, for more
precise control of the robot’s movements.
3. The coordinates can be shifted or rotated corresponding to the pose changes of the work.
4. When teaching locations or repeating executions, the robot can be moved along a linear
path while keeping the tool posture.
5. Programs can be named freely and saved without limits in numbers.
6. Each operation unit can be defined as a program and these programs can be combined to
make a complex one. (Subroutine)
7. By monitoring signals, programs can be interrupted and branched to a different program
suspending current motions when an external signal is input. (Interruption )
8. A Process Control program (PC program) can be executed simultaneously with a robot
control program.
9. Programs and pose (location) data can be displayed on terminals and saved in devices
such as the PC card.
10. Programming can be done using a personal computer loaded with the terminal softwa re
(KRterm or KCwin32) provided by Kawasaki. Off-line programming
1-3
D Series Controller 1. Overview of the AS System Kawasaki Robot AS Language Reference Manual
1.3 AS SYSTEM CONFIGURATION
Kawasaki Robot controller D series is composed of the following components:
Kawasaki
Robot
D series
Controller
Teach pendant
Personal
Computer
Peripheral Controller
By connecting a personal computer loaded with the terminal software KRterm or KCwin32 to a D series controller, the following operations can be done:
Writing AS commands Saving and loading to and from the personal computer
Personal computer
D series controller
KRterm or KCwin32 Terminal software
Controller
Enters AS commands Creates AS programs Saves/loads programs
Daily operations
[ NOTE ]
Monitor software for PC operates with 95/98/Me/2000/XP. Please prepare the appropriate OS.
1-4
Teach Pendant
Teach Pendant Personal computer
Selects program Displays program names and
steps
Manually controls the robot Monitors signals Sets repeating conditions Teaches pose (location) data Teaches auxiliary data (block
teaching)
D Series Controller 2. AS System Kawasaki Robot AS Language Reference Manual
2.0 AS SYSTEM
This chapter describes the AS system status, AS system switches and the system setup.
2.1 AS System Status
2.2 AS System Switches
2.3 AS System Setup
2.4 Input and Output Operations
2.5 Installing Terminal Software
2.6 Operations from Personal Computer
2-1
D Series Controller 2. AS System Kawasaki Robot AS Language Reference Manual
2.1 AS SYSTEM STATUS
The AS system consists of the following three modes:
1. Monitor Mode
This is the basic mode in the AS system. Monitor commands are executed in this mode. Editor or Playback Mode is accessed from this mode.
2. Editor Mode
This mode enables you to create a new program or modify an existing one. Only editor commands are executed by the system in this mode.
3. Playback Mode
The system is in Playback Mode during program execution. Computations for robot motion control are performed and commands entered from the terminal are processed during unoccupied CPU time. Some monitor commands cannot be executed in this mode.
2-2
D Series Controller 2. AS System Kawasaki Robot AS Language Reference Manual
2.2 AS SYSTEM SWITCHES
The following system switches can be set in the AS System using the monitor command SWITCH. The status and the conditions set for each switch can be checked or changed from the terminal.
1. CHECK.HOLD
Determines whether or not to respond to the EXECUTE, DO, STEP, MSTEP, and CONTINUE commands when the HOLD/RUN switch is in the HOLD position.
2. CP
Enables or disables continuous path movement. When this switch is ON, the robot makes smooth transitions between motion segments. When it is OFF, the robot decelerates and stops at the end of each motion segment.
3. CYCLE.STOP
Determines whether to keep ON or to turn OFF CYCLE START when an external hold signal is input to stop the motion of the robot.
4. MESSAGES
Enables or disables message output to the terminal in response to the PRINT or TYPE command.
5. OX.PREOUT
Sets the timing for OX signal output in block instructions, allowing for earlier signal output at the memory change instead of at the accuracy setting.
6. PREFETCH.SIGINS
Sets the timing for signal output in AS language programs, and has the same effect on signal timing as OX.PREOUT.
7. QTOOL
When in TEACH mode, determines whether or not to change the tool transformation according to the tool number taught in block instructions.
8. REP ONCE (Repeat Once)
When this switch is ON, the program runs one time. When it is OFF, the program runs continuously.
2-3
D Series Controller 2. AS System Kawasaki Robot AS Language Reference Manual
9. RPS (Random Program Selection)
Enables or disables the selection of programs based on the binary status of external signals.
10. SCREEN
Enables or disables the scrolling of the screen when the information is too large to fit in one screen.
11. STP ONCE
Sets whether the program is performed one step at a time or continuously.
Refer to 5.6 Monitor Command SWITCH, ON, OFF for further information on how to set the system switches.
2-4
D Series Controller 2. AS System Kawasaki Robot AS Language Reference Manual
2.3 AS SYSTEM SETUP
The following system settings can be changed depending on the need, using the monitor commands.
1. Zeroing (ZZERO command)
ZZERO command is used to set the encoder value to correspond to a robot’s known mechanical position. When replacing the servo motor or performing maintenance on an encoder, the encoder value will need adjustment using this command. (This command is for maintenance purposes only.)
2. Clamp setting (HSETCLAMP command)
This setting is made prior to shipment from the factory. The settings, single/double and output spec (ON when closed /OFF when closed), can be changed using HSETCLAMP command. However, the change will only affect the software, so be sure to check if it is consistent with the hardware.
3. Maximum number of input and output signals (ZSIGSPEC command)
ZSIGSPEC command sets the maximum number of input and output signals that can be used. It is set prior to shipment from the factory. (This is a default setting that function as a software error check, thus be sure it is consistent with the hardware.)
4. Software Dedicated Signals (DEFSIG command)
In addition to the Hardware dedicated signals, there are I/O signals in the software that can be used as dedicated signals (Software dedicated signals). The signals in the table be low can be used as Software dedicated signals. Note that since the number of I/O signals in the software is the sum of Software dedicated signals and General purpose signals, the number of General purpose signal decreases as more Software dedicated signals are used.
Software Dedicated Input Signal Software Dedicated Output Signal EXT. MOTOR ON MOTOR_ON EXT. ERROR RESET ERROR EXT. CYCLE START AUTOMATIC EXT. PROGRAM RESET CYCLE START
Ext. prog. select (JUMP_ON, JUMP_OFF RPS_ON, RPSxx)
EXT_IT POWER ON EXT. SLOW REPEAT MODE RGSO
Ext. prog. select (JMP_ST, RPS_ST)
TEACH MODE HOME1, HOME2
2-5
D Series Controller 2. AS System Kawasaki Robot AS Language Reference Manual
2.4 INPUT/OUTPUT CONTROL
2.4.1 TERMINAL CONTROL
Data and commands input at a terminal are first received by the system buffer. Then they are read by the monitor or program and echoed or displayed on the terminal screen. The maximum number of characters that can be input at a terminal is 128, and additional characters input are ignored.
Output of data to a terminal can be controlled using the PRINT and TYPE instructions. 8 bits are displayed on the terminal screen. Unless format is specified using specification code “/S” with the PRINT/TYPE instruction, data are displayed with a new line starting after each command. (See 6.8 Message Control Instructions for detailed information.)
Terminal input and output can be controlled using the below commands. These are called the terminal control commands. The Ctrl (Control Key) is pressed with each alphabetical character (the character may be either lower or upper case letters). Unlike other AS commands, there is no need to press the ENTER key after these command.
Commands Functions
Ctrl + S
Stops the scrolling of the display terminal. Ctrl + Q Resumes the data output stopped by Ctrl + S . Ctrl + C Ctrl + H
Ctrl + M
Ctrl + L
Cancels the last input line.
Deletes the last input character. (Backspace)
Ends the input of the current line.
Displays the content of the line entered previously on the
current input line. It can be used up to seven times. (Last)
Displays the content of the line input after the line displayed Ctrl + N
using Ctrl + L. This operation can be used only after
Ctrl + L is used more than once. (Next)
Backspace
Deletes the last input character.
Input TAB (Ctrl + I or TAB) as space (blank).
2-6
D Series Controller 2. AS System Kawasaki Robot AS Language Reference Manual
2.4.2 EXTERNAL MEMORY DEVICES
The commands below are used to save programs, variables and pose information in the robot memory, PC card, floppy disk, or computer hard disk.
1. Initializes memory. (CARD_FORMAT, FD_FORMAT)
2. Displays the contents. (CARD_FDIR, FD_FDIR)
3. Saves the data on the robot memory to the disk files. (SAVE*, CARD_SAVE, FD_SAVE)
4. Loads the data on the disk file to the robot memory. (LOAD, CARD_LOAD, FD_LOAD)
5. Deletes the disk files. (DELETE, CARD_FDEL, FD_FDEL)
Commands with CARD_ refer to PC cards and FD_ refers to floppy disks.
Note* SAVE command may be used only when the computer is connected.
See also 5.2 Program and Data Control Commands, 5.3 Program and Data Storage Commands
2-7
D Series Controller 2. AS System Kawasaki Robot AS Language Reference Manual
2.5 INSTALLING TERMINAL SOFTWARE
The robot can be controlled from a personal computer using the AS language. To do so, load KCwin32 or KRterm terminal software on to a PC and connect the PC to a D series controller. KCwin32 and KRterm may be installed on computers running Windows 95/98/Me/2000/XP.
Connecting the computer and the controller using the RS-232C cable enables a single computer to control a single robot. An Ethernet connection enables multiple com puters to control m ultiple robots. Terminal software KCwin and KCwin32 can also be used by connecting to the RS-232C port.
Follow the below procedure to install the terminal software on to the PC.
1. Install the software to your hard disk
Copy the following files in the KRterm floppy disk on any directory of your computer hard disk.
KRTERM.EXE KRTERMJ.HLP (Japanese version help file) KRTERME.HLP (English version help file)
KRTERM.INI
2. It is recommended that you make a shortcut on the desktop or in the start menu for easier
startup of the KRterm software.
2-8
D Series Controller 2. AS System
232C
Kawasaki Robot AS Language Reference Manual
2.6 OPERATIONS FROM PERSONAL COMPUTER
2.6.1 SYSTEM STARTUP
2.6.1.1 CONNECTING TO RS-232C PORT
1. Connect the personal computer with the controller using the RS-232C cable. Make sure the CONTROL POWER on the controller and the computer power are both turn off.
RS-
PC with built-in RS-232C port
2. Turn on the computer, and start the terminal software (KRterm or KCwin32, diagrams below
are from KRterm).
3. When the software opens, select the type of connection to use. Select from the menu bar,
[Communication (C)] [Connect Parameter (O)].
4. Click the “Serial” tab, check the contents and if it is OK, click <OK>.
2-9
D Series Controller 2. AS System Kawasaki Robot AS Language Reference Manual
5. Turn ON the CONTROL POWER on the controller.
(See “Operation Manual” 3.1 Power ON Procedure).
6. The initial screen of KRterm followed by a prompt “>” will appear on the display.
When the CONTROL POWER is turned ON before connecting the PC and the controller, only the prompt “>” will appear and not the initial screen. However, KRterm works the same.
2-10
D Series Controller 2. AS System Kawasaki Robot AS Language Reference Manual
2.6.1.2 CONNECTING ROBOTS USING THE ETHERNET
1. Connecting the cables.
Connect the ETHERNET connector on your personal computer and the connector on optional 1 KN daughter board on 1 KA board in the controller using a LAN cable.
Inside of the controller
ETHERNET connector on personal computer
1KA board
1KN daughter board
2. Following steps 2 and 3 above, start KRterm and the robot.
Front view of the controller
3. Set the robot’s IP address.
(1) Choose from the menu bar [Communication] [Connect Parameter (O)].
2-11
D Series Controller 2. AS System Kawasaki Robot AS Language Reference Manual
(2) Enter the IP address and name of the robot you want to connect to the network, and click
<ADD>.
4. To connect with the robot, follow the procedures below.
(1) The robot recently connected is displayed at the top of the drop-down menu when
[Communication(C)] is selected from the menu bar. Click the robot name to select the robot.
(2) Choose from the menu bar [Communication(C)] [Connect.History(C)] to display the list of
recently used robots. Select the robot to connect from the list.
2-12
D Series Controller 2. AS System Kawasaki Robot AS Language Reference Manual
(3) Choose from the menu bar [Communication(C)] [Select Connect(E)] if the desired robot
does not appear in the above ways..
Choose the desired robot and click <CONNECT>.
If the connection is established, robot information such as its name followed by a prompt “>” appears on the KRterm screen. AS commands can be input once the prompt appears.
2.6.2 UPLOADING AND DOWNLOADING DATA
(1) SAVE command
To save the data on the computer, use the SAVE command (See 5.3 SAVE command).
Example >SAVE test.pg This saves the data in the same directory as
>SAVE test.pg¥My Documents This saves the data in the sp ecified f ile.
(2) LOAD command
To load data from the computer to the robot memory, use the LOAD command.
Example >LOAD data01.as
2-13
the KRterm in the computer hard disk.
D Series Controller 2. AS System Kawasaki Robot AS Language Reference Manual
2.6.3 SYSTEM SHUTDOWN
1. When the robot is connected, choose from the menu bar [Communication(C)]
[Disconnect(D)] to disconnect the robot.
2. Turn off the robot controller. See “ Operation Manual” 3.2 POWER OFF procedure).
(1) Turn the HOLD/RUN switch to HOLD. (2) Turn OFF the motor power by pressing the EMERGENCY STOP button. (3) Turn OFF the CONTROL POWER.
3. Shut down KRterm.
(1) Choose from the menu bar [FILE(F)] [END(X)].
2Click <YES>.
4. Shut down the computer.
5. If there is no need to keep the computer connected to the controller, disconnect the cable.
Make sure the controller and the computer power are both turned off before disconnecting.
2-14
D Series Controller 2. AS System Kawasaki Robot AS Language Reference Manual
2-15
D Series Controller 2. AS System Kawasaki Robot AS Language Reference Manual
2.6.4 USEFUL FUNCTIONS OF KRTERM
2.6.4.1 CREATING LOGFILES
The contents displayed on the KRterm screen can be saved as a log file. This is useful when making printout of the robot operation procedures.
1. Start logging.
(1) Choose from the menu bar [FILE(F)] [OPEN LOG FILE(O)].
(2) Select the folder to save the log file, and name th e file.
(3) The message [Logging Now] appears on the title bar. The contents on the display are
recorded until the log file is closed.
The contents on the display are recorded while this message is shown.
2-16
D Series Controller 2. AS System Kawasaki Robot AS Language Reference Manual
2. End log
Once logging starts, all the contents on the KRterm display will be recorded until the log file is closed.
To close the log file and end log, choose from the menu bar [FILE(F)] [CLOSE LOG FILE(C)].
2-17
D Series Controller 2. AS System Kawasaki Robot AS Language Reference Manual
2.6.4.2 MACRO FUNCTIONS
Macro functions are provided in the KRterm and KCwin32 system. If a task needs to be executed repeatedly, recording the series of instructions/commands for that task inside a macro can be very useful and increase efficiency.
To record a macro, choose from the menu bar [FILE (F)] [MACRO (M)] and enter the file name to save that macro. To run a macro, use the SEND command on the KRterm screen.
See Help in KRterm or KCwin32 for more details.
2-18
D Series Controller 2. AS System Kawasaki Robot AS Language Reference Manual
MEMO
2-19
D Series Controller 3. Information Expressions in AS Language Kawasaki Robot AS Language Reference Manual
3.0 INFORMATION EXPRESSIONS IN AS LANGUAGE
This chapter describes the types of information and variables used in AS language.
3.1 Notation and Conventions
3.2 Pose Information, Numeric Information and Character Information
3.3 Variables
3.4 Variable Names
3.5 Defining Pose Variables
3.6 Defining Real Variables
3.7 Defining String Variables
3.8 Numeric Expressions
3.9 String Expressions
3-1
D Series Controller 3. Information Expressions in AS Language Kawasaki Robot AS Language Reference Manual
3.1 NOTATION AND CONVENTIONS
1. Uppercase and lowercase letters
For easier understanding, the following rules apply to the usage of upper and the lowercase letters in this manual. All AS keywords (commands, instructions, etc) are shown in uppercase. Variables and any other items that can be specified are shown in lowercase. However, both can be used when entering at an AS terminal.
2. Keys and switches
The keys on the teach pendant or the computer keyboard and the swit ches on the controller are expressed in this manual with their names surrounded by a
.
Example RUN/HOLD, Backspace
3. Abbreviations
Keywords can be abbreviated. For example, EXECUTE command can be abbreviated as EX. See Appendix 2 AS Language List.
4. Space, Tab
At least one blank space or tab is necessary as a delimiter between the command (or instruction) and the parameter*. Also, a space or tab is necessary between those parameters not divided by commas or other delimiters. Excess spaces or tabs are ignored by the system.
NOTE* A parameter is necessary data to complete commands or other functions. For
example, in the SPEED command, parameter data is needed for specifying the robot speed. When the command or function uses several parameters, a comma or a space separates each parameter.
Example SPEED 50
5. ENTER key
Monitor commands and program instructions are processed by pressing the ENTER key. In this manual, the ENTER key is shown as ↵.
6. Omitted Parameters
Many monitor commands and program instructions have param eters that can be om itted. If there is a comma after these optional parameters, the comma should be retained even if the parameter is omitted. If all successive parameters are om itted, comma m ay also be om itted.
7. Numeric values
Values are expressed in decimal notations, unless noted otherwise. Mathematical
3-2
D Series Controller 3. Information Expressions in AS Language Kawasaki Robot AS Language Reference Manual
expressions can be used to designate these values as arguments. However, note that acceptable values are restricted. The following rules show how the values are interpreted in various cases.
1 Distance
Used to define the length the robot moves between two points. The unit for distance is millimeter (mm); the unit is omitted when entering. The input values can be either negative or positive.
2 Angles
Defines and modifies the robot’s posture at the specified pose (location), and describes the rotation amount of the robot joints. The values can be negative or positive, with the maximum angles limited to 180 degrees or 360 degrees, depending on the commands used.
3 Scalar variables
Unless noted otherwise, these variables define real values. The values for the variables can range from −3.4E+38 to 3.4E+38 (−3.4×10
38
~ 3.4+1038). When it exceeds ±999999, it is
expressed as xE+y (x is the mantissa, y is an exponent).
4 Joint number
Expresses the joints of the robot in integer from 1 to the number of joints available (standard type has 6 joints). The joints are numbered in order starting from the base joint. (Usually
expressed JT1, JT2 ....).
5 Signal number
Identifies binary (ON/OFF) signals. The values are given as integers and take the following ranges.
Standard range Maximum range External output signal 1 − 32 1 − 96 External input signal 1001 1032 1001 1096 Internal signal 2001 2256 2001 2256
Negative signal numbers indicate OFF state.
8. Keywords
Generally, variable names can be freely assigned within the AS system. However, keywords defining commands, instructions, etc. in the AS system are reserved, and cannot be used to name pose data, variables, etc.
3-3
D Series Controller 3. Information Expressions in AS Language Kawasaki Robot AS Language Reference Manual
3.2 POSE INFORMATION, NUMERIC INFORMATION, CHARACTER INFORMATION
There are three types of information in the AS system: pose* information, numeric information, and character information.
NOTE* “Pose” was formerly called “location”, but in accordance with the intern ational
standards (the ISO), in this manual, it is referred to as pose to express both the position and the posture of the robot in one word.
3.2.1 POSE INFORMATION
Pose information, also known as positional information, is used to specify the position and posture of the robot in the given work area. The robot’s position and posture refers to the position and posture of the tool center point (TCP) of the robot. The position and posture together is called the pose (location) of a robot.
The pose is determined by where the robot is and which way it is facing, therefore, when a robot is instructed to move, these two things are done at the same time:
1. Robot’s TCP moves to the specified position.
2. Robot’s tool coordinates rotate to the specified posture.
The pose data is described by a set of joint displacement values or by transformation value:
1. Joint displacement values
This pose information is given by a set of angular or linear displacement values from each of the robot axes. Using encoder values, rotational axes produce angular displacement described in degrees, and linear axes produce linear displacement described in millimeters.
Example The joints are expressed in order from JT1,…JT6, and the displacement value of
each joint is shown beneath the joint number.
JT1 JT2 JT3 JT4 JT5 JT6
#pose = 0.00, 33.00, -15.00, 0, -40, 30
2. Transformation value
Describes a pose of coordinates in relation with reference coordinates. Unless specified otherwise, it refers to the transformation values of the tool coordinates relative to the base coordinates of a robot. The position is given by the XYZ values on the base coordinates, the
3-4
D Series Controller 3. Information Expressions in AS Language
N
N
x
Kawasaki Robot AS Language Reference Manual
posture by Euler’s OAT angles*. Some of the commonly used transformation values are: the tool transformation value, describing the pose of the tool coordinates relative to the null tool coordinates, and work based transformation values, describing the pose of the tool coordinates relative to the work coordinates. NOTE* See Appendix 5 Euler’s O,A,T Angles.
Example X Y Z O A T pose = 0, 1434, 300, 0, 0, 0
If the robot has more than six axes, the value of the extra axis is shown with the transformation values.
Example X Y Z O A T JT7 pose = 0, 1434, 300, 0, 0, 0 1000
ull tool coordinates *
Transformation values
Base coordinates
z
b1
y
x
b1
Base transformation values
x
b
b1
z
b
ull base coordinates**
NOTE
* Null tool coordinates have their origin at the center of the robot’s tool mounting
Tool transformation values
z
t
x
t
y
t
Work transformation values
y
b
z
t1
t1
Tool coordinates
Work-based
y
t1
transformation values
z
w
y
w
x
w
Work coordinates
flange surface, and they are described by the tool transformation values (0,0,0,0,0,0).
NOTE**
Null base coordinates are set as the robot’s default value, and are described by the
base transformation values (0,0,0,0,0,0).
3-5
D Series Controller 3. Information Expressions in AS Language Kawasaki Robot AS Language Reference Manual
The joint displacement values and the transformation values have advantag es and disadvantages. Use them to suit your need.
Joint displacement values Transformation values
Advantage
Disadvantage
Suggested
usage
· Playback precision is achieved and there is no ambiguity about robot configuration at a pose
· TCP changes when the tool is changed (null tool coordinates remain the same)
· Cannot use relative coordinates (e.g. work coordinates, etc.)
· Setting the starting pose of a program
· Setting the robot configuration at or just before a pose described by transformation values
· Use for other common poses
· The tool coordinates origin used in repeat mode does not change even if the tool is changed. (The null tool coordinates shift)
· Can use relative coordinates (e.g. work coordinates)
· Convenient for processing as the data are shown in XYZOAT values
· Coordinates will change according to base or tool transformation values, so a full understanding is needed of the effect of any change for safe usage
· Robot configuration may change if it is not set before repeating movements
· Describing relative coordinates such as work coordinates
· Describing a pose that is to be changed using numeric values with functions such as SHIFT
· Describing a pose that is to be changed by sensor information
1. Unlike at a pose defined by joint displacement values, where the robot configuration is se t
uniquely, when a pose is defined by transformation values, the robot may take different configurations with respect to that pose. It is because transformation values only set the XYZOAT values of the tool coordinates of the robot and do not define the axis value of each joint. Therefore, before starting the robot in repeat mode, be sure to fix the robot’s configuration using configuration commands (LEFTY, etc.) or by recording the joint displacement values.
2. Since transformation values are described by the base coordinates, if the base coordinates
are shifted using the BASE command/instruction, the robot’ s TCP will a lso be shifted the same amount. This is one of the advantages of using the transformation values, but pay attention to the effect that changing the base coordinates will have on transformed points. Failure to do so may cause accidents such as interference with peripheral devices.
Take the same caution when using the TOOL command/instruction.
[ NOTE ]
3-6
D Series Controller 3. Information Expressions in AS Language Kawasaki Robot AS Language Reference Manual
3.2.2 NUMERIC INFORMATION
In the AS system, numeric values and expressions can be used as numeric information. A numeric expression is a value expressed by using numerals and variables combined with operators and functions. Numeric expressions are used not only for mathematical calculations, but also as parameters for monitor commands and program instructions.
For example in the DRIVE command, three parameters: joint number, degree, and speed, are specified. The parameters can be expressed either in numeric values or in expressions as in the following example:
DRIVE 3,45,75 Moves joint number 3 by 45° at the speed of 75%
DRIVE joint, (start+30)/2, 75 When specified joint=2, start=30 then joint 2 moves by
+30° at 75% speed
Numeric values used in AS system are divided into the three types:
1. Real numbers Real numbers can have both integers and fractions. It can be a positive or a negative value between 3.4 E+38 and 3.4 E+38(3.4×1038 and 3.4×1038) or zero. Real numbers can be represented in scientific notations. The symbol E divides between the mantissa and the exponent. The exponent may either be negative (power of 1/10) or positive (power of 10).
Example 8.5E3 8.5∗103 (+ in the exponent is omitted)
6.64 6.64∗100 (E, 0 is omitted)
9E-5 9.010
377 37710
-5
0
(decimal point is omitted)
(decimal point, E, 0 are omitted)
Note that the first seven digits are valid, but the number of valid digits might lessen through calculation procedures.
Real values without fractional parts (whole numbers) are called integers. The range is from16,777,216 to +16,777,215 and for those exceeding this limit, the first seven digits are valid. Integer values are usually entered in decimal numbers although there are times when it is convenient expressed in binary or hexadecimal notation. ^B states that the number entered is in binary notation. ^H states that the number entered is in hexadecimal notation.
3-7
D Series Controller 3. Information Expressions in AS Language Kawasaki Robot AS Language Reference Manual
Example
^H1000 (−4096 in decimal)
^B101 (5 in decimal)
^HC1 (193 in decimal )
−^B1000 (8 in decimal)
2. Logical values Logical values have only two states, ON and OFF, or TRUE and FALSE. A value of 1.0 is assigned for the TRUE or ON state, and a value of 0 (or 0.0) is assigned for FALSE or OFF state. ON, OFF, TRUE and FALSE are all reserved as AS language.
Logical true = TRUE, ON, 1.0 Logical false= FALSE, OFF, 0.0
3. ASCII values Shows the numeric value of one ASCII character. The character is prefixed with an apostrophe (’) to differentiate from other values. .
’A ’1 ’v ’%
3-8
D Series Controller 3. Information Expressions in AS Language Kawasaki Robot AS Language Reference Manual
3.2.3 CHARACTER INFORMATION
Character information referred to in the AS system is indic ated as a s tring of ASCII characters enclosed in quotation marks (“”). Since the quotation marks indicate the beginning and the end of the string, they cannot be used as a part of the string. Also, the ASCII Control characters (CTRL, CR, LF, etc.) cannot be included in the string.
Example
>PRINT “KAWASAKI”
command character string
3-9
D Series Controller 3. Information Expressions in AS Language Kawasaki Robot AS Language Reference Manual
3.3 VARIABLES
In the AS system, names can be assigned to pose information, numeric information, and character information. These names are called variables, and the variables can be divided into two types: global variables and local variables. Unless otherwise noted, global variables are referred to as variables.
3.3.1 VARIABLES (GLOBAL VARIABLES)
Variables for pose information, numeric information, and character information are called pose variable, real variable*, string variable, respectively. Several values can be grouped and be defined under one name using the array variable.
NOTE* Since most numeric values used in AS are real numbers, numeric variables are
referred to as real number variables or real variables. However, note that integers, logical values and ASCII values are all expressed using real number values. Therefore, a real variable may refer to any of these values.
Once a variable is defined, it is saved with that value in the memory. Therefore, it can be used in any program.
3.3.2 LOCAL VARIABLES
In contrast with the global variables above, local variables are redefined each time the program is executed, and are not saved in the memory. A variable with a “.” (period) at the beginning of its name is considered a local variable.
Local variables are useful in cases when several programs use the same variable name wherein the value of the variable changes every time the program is run. Local variables can also be used as a parameter of a subroutine. (See also 4.4.2 Subroutine with Parameters.)
3-10
D Series Controller 3. Information Expressions in AS Language Kawasaki Robot AS Language Reference Manual
NOTE
1. Local variables cannot be defined using monitor commands.
2. Since local variables are not saved in the memory, the va lue of a local v ariable .po se
cannot be displayed using the below command.
>POINT. pose
To see the current value of the local variable, set its value to a global v ariab le in the
program where the local variable is defined, and then use the POINT command.
POINT a=.pose Execute the program that defines the local
variable before using the POINT command.
>POINT a
X[mm] Y[mm] Z[mm] O[deg] A[deg] T[deg] xxxxxxx xxxxxxx xxxxxxx xxxxxxx xxxxxxx xxxxxxx
Change?If not hit RETURN key
3-11
D Series Controller 3. Information Expressions in AS Language Kawasaki Robot AS Language Reference Manual
3.4 VARIABLE NAMES
Variable names must start with an alphabetic character and can contain only letters, numbers, periods, and underscores. The letters can be entered either in uppercase or lowercase (it will appear in lowercase on the display screen). The length of the variable is limited to fifteen characters. Only the first fifteen characters will be valid with longer names. The following are some examples of names that cannot be used:
3p・・・・・・・・・・・・・・・・・・・・the first letter is not an alphabet part#2・・・・・・・・・・・・・・・・”#”is prefix for joint displacement variable name an d cannot be
used in middle of a variable name
random・・・・・・・・・・・・・・・keyword
1. Variables describing joint displacement values are p receded by the sym bol “#” to differentiate them from transformation values. Character string variables are preceded by “$” to differentiate them from real variables.
pick (transformation value) #pick (joint displacement value) count (real variable) $count (string variable)
2. All variables can be used as array variables. Arrays consist of several values under the same
name and these values are distinguished from each other by their index value. Each value in the array is called an array element. To specify an array element, attach an element index values enclosed in brackets. For example, “part [7]” indicates the seventh element of the array “part”. For the indexes, use integers within the range 0 to 9999. For three-dimensional arrays use syntax similar to this: part [7, 1,1]=1.
3. When a variable is defined, that variable can be used in various programs. Therefore, be
careful not to make unnecessary changes to variables that are used in different programs.
NOTE
3-12
D Series Controller 3. Information Expressions in AS Language Kawasaki Robot AS Language Reference Manual
3.5 DEFINING POSE VARIABLES
Variables that describe pose information are called pose variables. A pose variable is defined only when a value is assigned to it. It remains undefined until a value is assigned, and if a program using an undefined variable is executed, an error occurs.
Pose variables are useful in the following ways:
1. The same pose data can be used repeatedly without having to teach the pose every time.
2. A defined pose variable may be used in different programs.
3. A defined pose variable can be used or changed to define a different pose.
4. Calculated values can be used as pose information instead of time consuming process of
teaching poses to the robot using the teach pendant.
5. Pose variables can be named freely, so programs can be made more legible.
Pose variables are defined as follows.
3.5.1 DEFINING BY MONITOR COMMANDS
1. HERE command stores the robot’s current pose data under the specified name.
Example 1 Using joint displacement values
Start the variable name with # to differentiate it fro m transformation values. Following the command, the joint displacement values of the cu rrent pose will appear:
> HERE #pose ↵
JT1 JT2 JT3 JT4 JT5 JT6 xxxxxxx xxxxxxx xxxxxxx xxxxxxx xxxxxxx xxxxxxx Change (if not, hit RETURN only) ↵
>
Example 2 Using transformation values
Following the command, the transformation values of the current pose will appear:
>HERE pose ↵
xxxxxxx xxxxxxx xxxxxxx xxxxxxx xxxxxxx xxxxxxx
>
X[mm] Y[mm] Z[mm] O[deg] A[deg] T[deg]
Change(if not, hit RETURN only)
3-13
D Series Controller 3. Information Expressions in AS Language Kawasaki Robot AS Language Reference Manual
2. POINT command is used to define a pose using another defined pose variable or, to define it
by the data entered from the terminal.
Example 1
Using joint displacement values
(1) Defining a new, undefined variable
>POINT #pose ↵
JT1 JT2 JT3 JT4 JT5 JT6
0.000 0.000 0.000 0.000 0.000 0.000
Change (if not, hit RETURN only) >
Enter the new values by separating each value with a comma:
xxx, xxx, xxx, xxx, xxx, xxx
(2) Changing the value of a defined variable
>POINT #pose ↵
JT1 JT2 JT3 JT4 JT5 JT6
10.000 20.000 30.000 40.000 50.000 40.000
Change (if not, hit RETURN only) ↵
Enter the value to be changed:
30, , , ,20, ;changes the value of JT1 and JT 5 to 30 and 20
(3) Substitute the value of a defined variable
>POINT pose_1=pose_2 ↵
JT1 JT2 JT3 JT4 JT5 JT6
10.000 20.000 30.000 40.000 50.000 40.000
Change (if not, hit RETURN only) ↵
The value to be defined as pose_1 (the recent value of pose_2) appears. Hit ↵
to set the values as they are, or change them in the same order as in (2) above.
Example 2
Using transformation values
Follow the same procedures as above, only the variable name should not start
with #.
3.5.2 DEFINING BY PROGRAM INSTRUCTIONS
1. HERE instruction stores the robot’s current pose under the specified name.
HERE pose
3-14
D Series Controller 3. Information Expressions in AS Language
t
t
Kawasaki Robot AS Language Reference Manual
2. POINT instruction substitutes a pose variable with the values from a previously defined pose.
POINT pose_1=pose_2
alues of “pose _1” are substituted with the values of the defined variable “pose_2”. An error
V
will occur if “pose _2” is not defined.
NOTE
When a pose variable name starting with a # is used, the variable describes joint displacement values (i.e. #pick, #start).
When a pose variable has no prefix and starts with any alphabetical character, the variable describes transformation values (i.e. pick, start).
3.5.3 USING COMPOUND TRANSFORMATION VALUES
The transformation values between two coordinates can be expressed as a combination of transformation values between two or more transitional coordinates. This is called compound transformation values or relative transformation values.
For example, say that “plate” is the name of the variable for the transf ormation valu es relative to the base coordinates describing the coordinates at the plate. Then, if the pose of an object relative to the pose of plate is defined as “object”, the compound transformation values of the object relative to the robot base coordinates can be described as “plate+object”.
In the example below, even if the pose of the plate changes, only the transformation values for the plate will need revising and the rest can be used as is.
plate
objec
plate+objec
Pickup point
pickup
plate+object+pickup
Origin of base
coordinates
3-15
D Series Controller 3. Information Expressions in AS Language
Kawasaki Robot AS Language Reference Manual
The compound transformation values can be defined using any command or instruction used to define pose variables. (It is easiest to use the HERE command.)
First, use the teach pendant to jog the robot tool to the pose that is to be named “plate”. Then, enter as below to define that pose as plate. >HERE plate
Next, jog the robot tool to the pose to be named “object” and enter:
>HERE plate + object
The transformation value “object” now defines the current pose relative to plate* (If “plate” is not defined at this point, “object” will not be defined and an error will o ccur).
NOTE * What appears on the screen after entering the HERE command is the transformation
values of the pose for the rightmost variable (i.e. “object” in this case). It is not the values for “plate + value”. To see the values for “plate +o bject”, use the W HERE command when the robot is at that pose.
Finally, move the robot hand to the pose where it picks up the object and enter: >HERE plate + object + pickup
This last command defines “pickup” relative to the transformation values “object”.
As shown above, compound transformation values are defined by a combination of several transformation values separated by “+”. Do not include any spaces in between the “+” and the
transformation values. Using this method, you can combine as many transformation values as needed.
If the robot is to pick up the object at the pose specified as “pickup” defined relative to “object”, the program will be written as follows:
JMOVE plate+object+pickup
or LMOVE plate+object+pickup
3-16
D Series Controller 3. Information Expressions in AS Language Kawasaki Robot AS Language Reference Manual
NOTE
1. Do not change the order in which the relative transform ation is expressed. For
example, if the transformation variable “b” is defined relative ly to transformation variable “a”, “a+b” results as expected, but “b+a” may not.
2. The pose data “object” and “pickup” from th e example above are defined in relation
to other pose data. Therefore, do not use commands such as “JMOVE object”, “LMOVE pickup” unless you are certain of its purpose and its effect on the program.
When using compound transformations repeatedly, use the POINT command to lessen the time to calculate the compound transformation values. For example, to approach the pose “pickup” and then to move to that pose, you might enter:
JAPPRO plate + object + pickup, 100 approach 100mm above “pickup” JMOVE plate + object + pickup move in linear motion to “pickup”
Instead, if you enter as below, this will save calculation time:
POINT x = plate + object + pickup calculate the target pose JAPPRO x, 100 approach 100mm above the target LMOVE x
move in linear motion to the target
These two programs result in the same motion, but the latter calculates the compound transformation only once, so the execution time is shorter when the POINT command is used. In such simple examples, the difference will be minor, but in more com plex programs, it m ay make a big difference and improve overall cycle time.
3-17
D Series Controller 3. Information Expressions in AS Language Kawasaki Robot AS Language Reference Manual
NOTE
For robots with 7 joints, note the following:
1. When using POINT command, note the value of JT7. For example, in
POINT p=p1+p2
The value of JT7 assigned to “p” will be the value of JT7 at “p2”. The value of the rightmost variable on the right side of the expression is assigned to the variable on the left side of “=”.
2. When assigning a specific value to JT7, add “/7” to the end of the POINT command.
For example,
POINT/7 p = TRANS(,,,,,,value)
assigns “value” to the value of JT7 for the variable “p”.
3-18
D Series Controller 3. Information Expressions in AS Language Kawasaki Robot AS Language Reference Manual
3.6 DEFINING REAL VARIABLES
Real variables are defined by using the assignment instruction (=). The format for assigning a real variable is:
Real_variable_ name = numeric_value
Example a=10.5
count=i*2+8
Z[2]=Z[1]+5.2
The variable on the left side may be either a scalar variable (i.e., count) or an array element (i.e., x[2]). A variable is defined only when a value is assigned to it. It remains undefined until a value is assigned, and if a program using an undefined variable is executed, an error occurs.
The numeric value on the right side may be a constant, a variable or a numeric expression. When the assignment instruction is processed, the value on the right side of the assignment instruction is computed first, and then the value is assigned to the var iable on the lef t side.
If the variable on the left side of the instruction is a new one and has never been assigned a value before, the value on the right is assigned to that variable automatically. If the left side variable is already defined, the new value will replace the current value.
For example, the instruction “x=3” assigns the value 3 to the variable “x”. It is read, “assign 3 to x” and not “x is equal to 3”. The following example illustrates the processing order clearly:
x= x+1.
If this example is a math equation, it is read “x is equal to x plus 1”, which does not make sense. As an assignment instruction, it is read, “assign the value of x plus 1 to x”. In this case, the sum of the current value “x” and 1 is calculated and then the resulting value is assigned to “x” as a new value. Such an equation requires that x be defined in advance, as below:
x=3 x=x+1
In this case, the resulting value of “x” is 4.
3-19
D Series Controller 3. Information Expressions in AS Language Kawasaki Robot AS Language Reference Manual
3.7 DEFINING CHARACTER STRING VARIABLES
Character string variables are defined by using the assignment instruction (=). The format for assigning a character variable is:
$string_variable=string_value
Example $a1=$a2
$error mess[2]="time over"
The string variable on the left can be a variable (i.e., $name), or an array element (i.e., $line[2]). A variable is defined only when a value is assigned to it. It remains undefined until a value is assigned, and if a program using an undefined variable is executed, an error occurs.
The character string on the right side may be a string constant, a string variable or a string expression. When an assignment instruction is processed, the value o n the righ t side is computed first, and then the value is assigned to the variable on the left side.
$name = "KAWASKI HEAVY INDUSTRIES LTD."
In the above instruction, the string enclosed in “” will be assigned to the variable “$name”. If the variable on the left side of the instruction has never been used before, this string will be assigned automatically. If the left side variable is already defined, this instruction replaces the current string with the new string on the right side.
3-20
D Series Controller 3. Information Expressions in AS Language Kawasaki Robot AS Language Reference Manual
3.8 NUMERIC EXPRESSIONS
Numeric expressions may consist of numerals, variables, specific functions or other numeric expressions combined together with operators. All numeric expressions evaluated by the system result in a real number value. Numeric expressions can be used anywhere in place of numeric values. They can be used as parameters in monitor commands and program instructions, or as array indexes.
The interpretation of the value depends on the context in which the expression appears. For example, an expression specified for an array index is interpreted as yielding an integer value. An expression specified for a logical value is interpreted as false when it is evaluated as 0, and true if it is other than 0.
3.8.1 OPERATORS
For describing expressions, arithmetic, logical, and binary operators are provided. All the operators combine two values to obtain a single resulting value. Exceptions: the two operators (NOT and COM) operate on a single value and the operator () operates on one or two values. The operators are described below.
Arithmetic Operators
Relational Operators
Logical Operators
Binary Operators
+
* / ^ MOD
< <=, =< == <> >=, => >
AND NOT OR XOR
BAND BOR BXOR COM
Addition Subtraction or negation Multiplication Division Power Remainder
Less than Less than or equal to Equal Not equal to Greater than or equal to Greater than
Logical AND Logical complement Logical OR Exclusive logical OR
Binary AND Binary OR Binary XOR Complement
3-21
D Series Controller 3. Information Expressions in AS Language Kawasaki Robot AS Language Reference Manual
1. Relational operator “==”is a operator to check if the two values are equal, and different
from the assignment indicator “=“.
2. Binary operator BOR performs OR operation for the respective binary bit of two numeric values.In this example the value is expressed in binary notation, but this operation may be used with any notation. ^B101000 BOR ^B100001 ^B101001 This result is different from what you can get in OR operation.
^B101000 OR ^B100001 -1(TRUE) In this case, ^B101000 and ^B100001 are interpreted as logical values, and since neither is 0 (FALSE), the expression is evaluated as TRUE.
NOTE
3.8.2 ORDER OF OPERATIONS
Expressions are evaluated according to a sequence of priorities. The priority is listed below, from 1 to 14. Note that the order of operations can be controlled using parentheses to group the components of an expression. When expressions containing parentheses are evaluated, the expression within the innermost pair of parentheses is evaluated firs t, and then the system works toward the outer most pair.
1. Evaluate functions and arrays
2. Process relational operators concerning character strings (See 3.7 String Expressions)
3. Process power operator “^”
4. Process unary operators “-“(negation), NOT, COM
5. Process multiplication “*” and division”/” from lef t to right
6. Calculate remainder (MOD operation) from left to right
7. Process addition”+” and subtraction”-“ from left to right
8. Process relational operators from left to right
9. Process BAND operators from left to right
10. Process BOR operators from left to right
11. Process BXOR operators from left to right
12. Process AND operators from left to right
13. Process OR operators from left to right
14. Process XOR operators from left to right
3-22
D Series Controller 3. Information Expressions in AS Language Kawasaki Robot AS Language Reference Manual
3.8.3 LOGICAL EXPRESSIONS
Logical expressions result in logical value TRUE or FALSE. A logical expression can be used in a program as a condition to determine the next operation in a program. In the following example, a simple logical expression, “x>y”, is used in a subroutine to determine which of the two variables to assign to variable “max”.
IF x>y GOTO 10 max=y GOTO 20 10 max=x 20 RETURN
When evaluating logical expressions, the value zero is considered FALSE and all nonzero values are considered TRUE. Therefore, all real values or real value expressions can be used as a logical value.
For example, the following two statements have the same meanings, but the second statement is easier to understand.
IF x GOTO 10 IF x<>0 GOTO 10
3-23
D Series Controller 3. Information Expressions in AS Language Kawasaki Robot AS Language Reference Manual
3.9 STRING EXPRESSIONS
String expressions consist of character strings, string variables, specific functions or other string expressions combined together with operators. The following operators are used with the string expressions.
String operator + Combine
Relational operators
< <=, =< == <> >=, => >
Less than Less than or equal to Equal to Not equal to Greater than or equal to Greater than
The result of using the string operator will be a string, and that of relational operators will be a real value.
When using relational operators with character strings, the strings are compared character for character from the first character string. If all the charac ters are the s ame, the two string s is considered equal, but if there is even one difference, the string with the character having higher character code is evaluated as the greater string. If one of the strings is shorter, the shorter one is evaluated less. In relational operations with strings, spaces and tabs are regarded as a character.
"AA" < "AB" "BASIC" == "BASIC" "PEN." > "PEN" "DESK" < "DESKS"
NOTE
Uppercase and lowercase letters in string expressions are regarded as different characters.
3-24
D Series Controller 4. AS Program Kawasaki Robot AS Language Reference Manual
4.0 AS PROGRAM
This chapter explains about AS programs. It explains how to create and execute programs, and about the robot motions. For better understanding, actually operate the actual system or PC-ROSET* as you read this chapter.
NOTE* PC-ROSET is a personal computer robot simulator compatible with the AS system.
4.1 Types of AS Programs
4.2 Creating and Editing Programs
4.3 Executing Programs
4.4 Program Flow
4.5 Robot Motion
4-1
D Series Controller 4. AS Program Kawasaki Robot AS Language Reference Manual
4.1 TYPES OF AS PROGRAM
A program is a series of instructions telling the robot how to move, output signals, do calculations etc. per a set process. A program name consists of no more than 15 characters starting with an alphabetical character, and can contain only letters, numbers, and periods. You can create as many programs as the memory can store. Programs are usually created using the AS system editor mode, but you may also use a separate computer loaded with KRterm or KCwin32 terminal software or PC-ROSET and later load it to the robot memory.
4.1.1 ROBOT CONTROL PROGRAM
Robot control programs are programs that control the robot movements. You may use all the program instructions including robot motion instructions to create this program.
4.1.2 PC PROGRAM (PROCESS CONTROL PROGRAM)
PC or process control programs are programs executed simultaneously with the robot control programs. PC programs are commonly used to control or monitor external devices by monitoring external I/O signals. The PC program and the robot control program can communicate with each other by using common variables or internal signals.
PC programs and robot control programs use instructions in common. Therefore, in some cases, a PC program can be executed as a robot control program although PC programs cannot be used in motion instruction. Instructions that cause robot motion, except for the BRAKE instruction. Also, BASE and TOOL functions are not available for PC programs.
4-2
D Series Controller 4. AS Program Kawasaki Robot AS Language Reference Manual
4.1.3 AUTOSTART
A PC program can be set to start automatically when the control power is turned on.
1. Turn ON the system switch AUTOSTART.PC (or AUTOSTART2.PC –
AUTOSTART5.PC).
2. Create the program you want to start automatically and name it AUTOSTART.PC (or
AUTOSTART2.PC – AUTOSTART5.PC).
Some monitor commands can be executed in programs by using program instruction MC; e.g. MC CONTINUE, etc. (See 6.9 MC program instruction.)
This is a sample autostart program. In this example, the robot monitors MOTOR POWER, and executes program pg1 when the power is turned ON. For easier understanding safety checks are ignored here, but in actual usage, be sure to include safety check procedures.
autostart.pc( )
1 WAIT SWITCH (POWER
) ;waits for the MOTOR POWER ON
2 WAIT SIG(27) ;checks if the robot is at home position* 3 MC EXECUTE pg1 ;Executes pg1(robot motion program)
NOTE * Set home position and assign the dedicated signal HOME1 to signal 27, before
executing this program.
4-3
D Series Controller 4. AS Program Kawasaki Robot AS Language Reference Manual
4.2 CREATING AND EDITING PROGRAMS
In this section, a simple program is made to instruct the robot to perform a task. A program is a list of procedures that the robot will be made to do. When executing a program through the AS system, program steps (lines) are processed in order from top to bottom and the operations defined in each step are carried out by the robot.
4.2.1 AS PROGRAM FORMAT
Each line (step) of an AS language program is expressed in the following format.
step number label program instruction ;comment
1. Step number
2.
A step number is automatically assigned to each line of a program. Steps are numbered consecutively beginning with 1 and are automatically renumbered whenever lines are inserted or deleted.
3. Label
Labels are used in a program to branch the program. A label can be either an integer from 1 to 9999 or a string of up to 15 alphanumeric characters, period or underscore (starting with alphabetical character), followed by a colon (:). Labels are inserted at the beginning of a program line, right after the step number. Labels can be used as a branch destination from anywhere within the program.
4. Comment
A semicolon (;) indicates that all information to the right of th e sem icolon is a comment. Comments are not processed as program instructions when the program is executed, and are only used for explaining the program contents. You can make a program line with only a comment and no label or instruction. Blank lines can also be made to improve program legibility. (A blank line consists of at least one space or tab after the semicolon.)
4.2.2 EDITOR COMMANDS
The following editor commands are used to create and edit programs. (Highlighted parameters can be omitted.)
4-4
D Series Controller 4. AS Program Kawasaki Robot AS Language Reference Manual
EDIT program name, step Starts editor mode. Program instructions Replaces the current steps with a new instruction. ENTER key( ) Goes to the next step without changing the current step.
D step count Deletes program steps. E Exits editor mode, and returns to monitor mode. F character string Searches characters and displays that line. (Find) I Inserts a new step. L Displays the previous step. (Last) M /existing characters
/new _characters O Places the cursor on current step for editing. (One line)
P step count Displays specified number of program steps. (Print) R character string Replaces characters within a step. S step number Selects program step. (Step)
XD Cuts the selected step or steps and stores in clipboard. XY Copies the selected step or steps and stores in clipboard. XP Pastes the content of clipboard. XQ Pastes the content of the clipboard in the reverse order.
Replaces the existing characters with new characters.
(Modify)
XS Shows the contents of the clipboard. T Teaches while in editor mode (option).
4-5
D Series Controller 4. AS Program
program
K
d
KOK
Kawasaki Robot AS Language Reference Manual
4.2.3 PROGRAMMING PROCEDURE
Programming is done as shown in the following steps:
Preparing for programming: Plan/confirm the robot operation steps,
Create program (EDIT command) / Teach pose (TEACH/HERE command)
Modify
Repeat cycle: confirm the mode/switches, specify speed
Gradually increase speed
NO
confirm mode and switches, start Edit mode
Is the program/pose correct?
O
EXECUTE comman
Is the program /pose correct?
O
Is it at the specified speed?
Regular repeat cycles
Teach pose
Pose N.G. Program N.G.
Program/pose N.G.
Modify program/pose data
4.2.4 CREATING PROGRAMS
In an AS program, two things have to be taught to the robot:
1. Work conditions for the robot
2. Path (pose) to be followed by the robot tool
Here is a sample program. The robot will perform the task shown on the next page: pick up a part fed in by the supply shoot (conveyor), and place it in the box.
First define all the motions required to complete th e task :
1. Check if the hand is open.
2. Move to a pose 50mm above the part (#part) on the supply shoot.
3. Move straight down to the part (#part).
4. Close the hand and grab the part.
5. Move straight up 150mm above the supply shoot.
6. Move to a position 200mm above the box (#box).
7. Move the part down into the box.
4-6
D Series Controller 4. AS Program
p
(8.)
Kawasaki Robot AS Language Reference Manual
8. Open the hand and release the part.
9. Move back up to a position 180mm above the box.
The variables #part, #box which express position and posture are called pose (location) data in the AS system. Define the pose variable names as shown in Chapter 3 before executing the program.
2.(1.)
3.
5.
6.
7.
9.
(4.)
art
# box
# part
AS Editor is used to create and edit programs. To create a program named “demo”, enter “EDIT demo ↵”. The screen should appear as follows:
> EDIT demo .PROGRAM demo 1 ?
Now, AS is waiting for the first step to be entered. Enter “OPENI
after “1?”
> EDIT demo
.PROGRAM demo 1 ? OPENI
2 ?
Next enter “JAPPRO #part, 50 ↵”for the second step.
4-7
D Series Controller 4. AS Program
Kawasaki Robot AS Language Reference Manual
> EDIT demo
.PROGRAM demo 1 ? OPENI
2 ? JAPPRO #part, 50 3 ?
Enter the rest of the program in the same manner. Correct any mistakes when entering the steps by pressing Backspace before pressing ↵.
If the ↵ key is hit at the end of an erroneous step, error message appears and that step is rejected. In this case, enter the step again. When the entire program has been entered, the screen should appear as follows:
>EDIT demo
.PROGRAM 1 ? OPENI 2 ? JAPPRO #part,50 3 ? LMOVE #part 4 ? CLOSEI 5 ? LDEPART 150 6 ? JAPPRO #box,200 7 ? LMOVE #box 8 ? OPENI 9 ? LDEPART 180
10 ? E
>
The last step “E ↵” is not a command for the robot but a command to exit the Editor mode (see also the table in 4.2.1). The program is now complete. When the program is executed, the AS system follows the steps in order, from step 1 to step 9.
See 11. Sample Programs for further information on how to create programs.
4-8
D Series Controller 4. AS Program
Kawasaki Robot AS Language Reference Manual
4.3 PROGRAM EXECUTION
The robot control programs and the PC programs are executed in different ways.
4.3.1 EXECUTING ROBOT CONTROL PROGRAMS
To execute a program, turn the TEACH/REPEAT switch to REPEAT position. Next, ensure the TEACH LOCK switch on the teach pendant is in the OFF position. Then, turn ON the MOTOR POWER and turn the HOLD/RUN switch to RUN position.
1. Running program via EXECUTE command
First, set the monitor speed. The robot will move at this speed when the program is executed.
The speed should be set under 30%, with the initial setting at 10%. > SPEED 10
To start execution, use the EXECUTE command. Type as below: > EXECUTE demo
The robot should then perform the selected task. If it does not move as expected, turn the HOLD/RUN switch to HOLD. The robot will decelerate and stop. In case of emergency, press the EMERGENCY STOP button on the controller panel or on the teach pendant. The brakes are applied and the robot stops immediately.
If the robot moves correctly at 10% speed, gradually raise the speed. > SPEED 30
> EXECUTE demo
The robot operates at 30% speed.
> SPEED 80
> EXECUTE demo ↵ The robot operates at 80% speed.
After the EXECUTE command has been issued at least once, the CYCLE START button on the controller panel can be used to execute programs.
To execute the program more than once, enter the num ber of repetitions after the program name: > EXECUTE demo,5 ↵ Executes 5 times.
> EXECUTE demo,1
Runs the program continuously.
4-9
D Series Controller 4. AS Program
Kawasaki Robot AS Language Reference Manual
2. Running program via PRIME command Set the monitor speed in the same way as with the EXECUTE command, and execute PRIME
command. >PRIME demo
Robot is now ready to execute the program. Pressing CYCLE START on the operation panel begins execution. Execution can also be started using the CONTINUE command.
3. Running program via STEP command or CHECK key
It is possible to check the motion and the contents of a program by executing the program step by step. Use either the STEP monitor command or the CHECK key* on the teach pendant.
*
Note
When using the CHECK key, the program execution pauses at the end of each motion
instruction.
During execution of the robot control program, some monitor commands are disabled. Likewise, the EXECUTE command cannot be entered twice during execution.
4.3.2 STOPPING PROGRAMS
There are several ways to stop a program in progress. The following three are described in order from most to least urgent.
1. Press the EMERGENCY STOP button either on the controller panel or on the teach pendant.
Breaks are applied and robot stops immediately. Unless there is an emergency, use methods 2 and 3.
2. Turn the HOLD/RUN switch in the operation panel to HOLD. The robot slows down and
stops.
3. Entering the ABORT command stops the program execution after the robot completes the
current step (motion instruction).
> ABORT
HOLD command can also be used to stop execution.
> HOLD
4.3.3 RESUMING ROBOT CONTROL PROGRAMS
Depending on how the program was stopped, there are several methods to resume the program.
4-10
D Series Controller 4. AS Program Kawasaki Robot AS Language Reference Manual
1. When the robot was stopped with the EMERGENCY STOP button, release the lock of the
EMERGENCY STOP, and press the MOTOR POWER to turn ON the motor power. Robot starts moving when you press the CYCLE START.
2. When the HOLD/RUN switch was used to stop the robot, turn the switch to the RUN
position to resume.
3. To resume after the ABORT or HOLD command or when program execution was suspended
by an error, use the CONTINUE command. When restarting after an error, the error should be reset before resuming the program.
> CONTINUE
4.3.4 EXECUTING PC PROGRAMS
PC programs are executed by PCEXECUTE monitor command or by a program instruction that is executed from within a robot control program. PCABORT command can be used to stop execution of the PC program at any time. PCEND command ends the execution of the program after the current cycle is completed.
PCCONTINUE command resumes execution of a program suspended by either PCABORT or because of an error. When restarting after an error, the e rror should be reset before resuming the program.
4-11
D Series Controller 4. AS Program Kawasaki Robot AS Language Reference Manual
4.4 PROGRAM EXECUTION FLOW
The program instructions are regularly executed in order from top to bottom of the program.
This consecutive flow is changed when there is an instruction such as GOTO or IF....GOTO. A
CALL instruction calls up and executes a different program, but this does not change the order of the flow; when a RETURN instruction is executed, the processing return s to the caller p rogram and resumes from where it has left.
The WAIT instruction stops the program from proceeding to th e next step until the specified condition is met. The PAUSE and HALT instructions stop the programs at the step where these instructions are used.
The STOP instruction may not stop the execution in some cases. If the specified execution cycles are remaining, execution continues with the first step in the main program. (Even if the STOP instruction is executed in a subroutine, the execution returns to th e beginning of the main program.) If there are no cycles remaining, the execution stops at the step where the instruction is used.
4.4.1 SUBROUTINE
A main program can be temporarily suspended and a different program, called the subroutine, can be called up and executed. By using the subroutine, you can make the program into a modular structure that is easier to understand.
4.4.2 SUBROUTINE WITH PARAMETERS
Parameters can be used with subroutines for more convenience. For example, when a calculation that uses different input data is done repetitively, create a subroutine to do the calculation. Use the CALL instruction to branch to the subroutine, and use the input data as parameters in the calculation. (See examples 1,2 below)
Up to 25 parameters can be set using real variables, pose variables or string variables. The variable type must be the same in the main program and the subroutine. When assigning a parameter name to transformation values put a “&” in front of the parameter variable name in order to differentiate from the real number variables. Also, use local variables in the CALL destination (subroutine).
4-12
D Series Controller 4. AS Program Kawasaki Robot AS Language Reference Manual
Example The value of real number variable “c” is the sum of input data “a” and “b”.
main()
1 a=1 2 b=2 3 CALL calc(a,b,c) 4 TYPE c calc(.aa,.bb,.cc) 1 .cc=.aa+.bb
Example 2 The value of transformation value “c” is the sum of transformation values “a”
and “b”.
position()
1 point a = trans(10) 2 point b = trans(0,20) 3 CALL add(&a,&b,&c) 4 point d = c add(.&aa,.&bb,.&cc) 1 point .cc=.aa+.bb
NOTE
To set parameters in the subroutine, as in example 1 above, enter “
EDIT calc, 0” then the
following appears in the display:
0.() 0?
Enter (.aa,.bb,.cc) after the ?.
4.4.3 ASYNCHRONOUS PROCESS (INTERRUPTION)
Under certain conditions, like when there is an error or when a specific external signal is input, program execution may be interrupted and another program will be exe cuted. This occurs independently from the flow of execution of the main program and is called asynchronous processing (interruption). As soon as the specified signal (e.g. an external signal or an error) is detected, the interruption occurs regardless of the execution of the main program. This process is activated using the ON (or ONI) ...CALL instruction.
4-13
D Series Controller 4. AS Program Kawasaki Robot AS Language Reference Manual
4.5 ROBOT MOTION
4.5.1 TIMING OF ROBOT MOTION AND PROGRAM STEP EXECUTION
In the AS system, the timing of program execution and of the robot motion can be changed by setting the system switches. For example, the timing of step execution changes as following when PREFETCH.SIGINS switch is turned ON (enable early processing of signal I/O commands) or OFF (disable early processing of signal I/O commands
JMOVE part1 SIGNAL 1 JMOVE part2 SIGNAL 2
PREFETCH.SIGINS ON PREFETCH.SIGINS OFF
part.1 part.2
part.1 part.2
SIG 1 SIG 2
SIG 1 SIG 2
When PREFETCH.SIGINS is ON, the external signal 1 (SIGNAL 1) is output as soon as the robot starts moving toward part1. When the program reaches the second JMOVE in struction, it waits until the robot reaches part1 before performing that instruction. As soon as the robot reaches part 1, it starts for part 2, and at the same time, external signal 2 (SIGNAL 2) is output.
When PREFETCH.SIGINS is OFF, the signals are output after the robot reaches the destination of the motion instructions and the axis coincide.
The sample below demonstrates how the program steps are executed in AS system when PREFETCH.SIGINS is ON.
4-14
D Series Controller 4. AS Program Kawasaki Robot AS Language Reference Manual
1 JMOVE #b 2 SIGNAL 1 3 a=2 4 LMOVE #c 5 SIGNAL 2 6 SPEED 50 7 LMOVE #d 8 SIGNAL 3
Signal 1 output
#a
Signal 3 output
Signal 2 output
#b
#c
Speed 50%
#d
after #c.
If the above program is executed when the robot is at #a, the steps proceed in the following order:
1. At #a, the robot plans the motion for JMOVE #b and starts moving toward #b.
2. As soon as the motion starts, the next step, SIGNAL 1, is executed, i.e., signal 1 is turned on
right after the robot departs #a.
3. The execution proceeds to step 4, plans LMOVE #c and waits for the robot to reach #b.
4. As soon as the robot reaches #b, the robot starts moving toward #c. The execution proceeds
to step 7 (plans motion for LMOVE #d), and waits for the robot to reach #c.
[ NOTE ]
When PREFETCH.SIGINS is ON, the program processes the next step until it has to wait for the robot to reach the specified pose. However, the timing is affected by other settings and command/ instructions such as WAIT instruction or the CP switch. WAIT instruction suspends the processing of steps until the given condition is satisfied. When the CP switch is OFF, the program processes all the steps before the step that includes a motion instruction, and stops there before proceeding. Keep in note the settings of the systems switch and instructions when programming.
As demonstrated here, it is important to note that the timing in which the AS system processes the program and the robot moves are affected by the system switch settings and some certain program instructions. Pay careful attention to the output timing of signals during programming.
For details on each system switch, refer to 7.0 AS System Switch or the Operation Manual.
4-15
D Series Controller 4. AS Program Kawasaki Robot AS Language Reference Manual
4.5.2 CONTINUOUS PATH (CP) MOTION
This example shows the execution of one motion instruction.
Current pose ・pick
JMOVE pick
STOP
Speed
Time
When executing a motion instruction like the one above, the robot accelerates smoothly up to the current speed setting as it moves towards the pose “pick”. As the robot approaches “pick”, it gradually decelerates until it stops at the pose. Series of motions such as this, carried out by one motion instruction, is called a “motion segment”.
In the case for the figure below, if the CP system switch is ON, the robot first accelerates to reach the specified speed, but does not decelerate when it approaches pos.1. Instead, it makes a
smooth transition to the motion toward pos.2. When the robot approaches pos.2, it gradually decelerates and stops at that point. This motion consists of two motion instructions, and is thus structured by two motion segments.
JMOVE pos.1 JMOVE pos.2 STOP
(v)
Speed
(t) time
Motion like this, where the robot performs a series of motions making a smooth transition between the motion segments without stopping at each destination, is called CP (Continuous Path) motion. Turning OFF the CP system switch disables the CP function. If the CP switch is turned OFF, the robot will decelerate and stop at the end of each motion segment. (See 5.6 SWITCH and ON/OFF command, 6.9 ON/OFF instruction on how to set the CP switch).
CP motions can be used in both linear motions and joint interpolated motions or in a com bination of them. For example, CP motions can be used throughout all of the following steps: linear motion (e.g. LDEPART) joint interpolated motion (e.g. JAPPRO) line ar motion (e.g. LMOVE).
4-16
D Series Controller 4. AS Program Kawasaki Robot AS Language Reference Manual
4.5.3 BREAKS IN CP MOTIONS
Some instructions can suspend the execution of a program until the robot actually reaches the destination pose. This is called the break in CP motions. These instructions are useful when the robot should be stationary while certain operations are performed (e.g. closing the hand). See the example below.
Current pose pos.1 JMOVE pos.1 BREAK SIGNAL1 SIG1
The JMOVE instruction starts moving the robot toward pos.1. Next, the BREAK instruction is executed. This instruction suspends the execution of the program until the m ovement towards pos.1 is completed. In this way, the external signal is not output until the robot comes to a stop.
The following instructions suspend program execution until the robot movement is completed. However, be careful not to use these instructions when the robot should be moving.
BASE BREAK BRAKE CLOSEI HALT OPENI PAUSE RELAXI TOOL ABOVE BELOW DWRIST UWRIST LEFTY RIGHTY
In addition to the above, the ONI instruction also interrupts the program execution, but note that the break set by the ONI instruction may occur at any place of the motion segment.
4-17
D Series Controller 4. AS Program Kawasaki Robot AS Language Reference Manual
4.5.4 RELATION BETWEEN CP SWITC H AND ACCURACY, ACCEL, AND DECEL INSTRUCTIONS
·ACCURACY instructionSets the robot’s positioning accuracy at the end of each motion segment.
(When the robot enters the range set by this instruction, it considers that it has reached the destination, and starts the movement for the next destination.)
[ NOTE ]
1. The robot decelerates and stops if an instruction is not given before the execution of the
current motion is completed. Some of the reasons that cause such situation are:
(1) The WAIT instruction is executed but the c onditions to res um e the program are not set
before robot movement is completed.
(2) Program steps before the next motion instruction are not completed before the current m otion
finishes.
2. When moving in CP motion, it requires a certain amount of time to calculate the transition
between the motion segments. Therefore, if the distance between the two positions is too short, the calculation may not be finished before reaching the second position, thus causing the robot to stop in between the motion segments. To avoid this, it is necessary to slow down the speed. If the speed is not to be changed, do not define the poses unnecessarily close together.
·ACCEL instruction………Sets acceleration of the robot at the beginning of a movement.
·DECEL instruction………Sets deceleration of the robot at the end of a movement.
·CP Switch……………… Enables or disables CP motion.
4.5.4.1 CP ON …ST ANDARD MOTION TYPE
For example the robot takes the motions below with the CP switch ON: A →B→C.
As soon as the current pose values for the robot enters the accuracy range (i.e. robot reaches point D), superposing begins of the values of the current motion path with the motion command values for the next path. The robot will shift movement continuously toward the next path according to
4-18
D Series Controller 4. AS Program
(t)
y
Kawasaki Robot AS Language Reference Manual
these command values.
ACCURACY
B
Trajectory per instruction
Actual trajector (deviation due to delay)
D
Speed(v)
command value
A
C
A
E
Robot reaches D
C (B)
Time (t)
The greater the range specified by ACCURACY, the earlier the superposing will begin. However, acceleration on next path does not begin before the point where the robot starts to decelerate (point E), therefore it can be said that the ACCURACY effect is saturated at a certain value, i.e. there is no effect in setting the accuracy value greater than the distance between point B and E. (See the diagram below.)
Speed()
A
E
(B)
C
Time (t)
Even if command value reaches the accuracy point at this time, acceleration for next path will not start until decel eration begins at p oint E.
If the acceleration and the deceleration values a re set sm aller, the supe rposing begins earlier and the robot will move in a trajectory with larger radius, but the total time it takes to reach C does no t differ significantly.
Speed(v)
E
ACCURACY
Time
C(B) A
4-19
D Series Controller 4. AS Program
)
Kawasaki Robot AS Language Reference Manual
Even if the deceleration is decreased and the acceleration for the next path is increased, the compound speed will not exceed the specified maximum speed, since the superposing does not begin until the robot reaches point F (the point where acceleration starts). In other words, the time taken to complete deceleration and acceleration is the sam e (point B).
Speed (v)
A
E
F
(B)
C
Time (t
4.5.4.2 CP ON … MOTION TYPE 2
In Motion type 2, the concept of accuracy and velocity in linear motion and circu lar m otion is different from that of Standard motion type. Standard motion type and Motion type 2 can use the same programs without modifications, but the actual motion path and motion speed will change.
1. Accuracy setting
(1) Accuracy in joint interpolated motion
The motion path of the robot corresponding to the accuracy setting is shown in the figure below. In this example the accuracy values at point B are 1 mm, 100 mm, and 200 mm. In the same way as Standard motion, the robot starts to shortcut before reaching point B, but does not necessarily start turning at the point where it enters the accuracy range. How close the robot approaches point B before turning is determined by the angle of each axis calculated proportionally to the accuracy value. By setting the accuracy value larger, the robot can shortcut the shorter distance of either the remaining distance of the current path or half the distance of the next path from B to C.
Joint interpolated motion
Maximum setting: half the distance of next path
4-20
D Series Controller 4. AS Program
n
Kawasaki Robot AS Language Reference Manual
(2) Accuracy in linear and circular interpolated motion
The motion trajectory of the robot corresponding to the accuracy setting is as shown in the figure below. In this example the accuracy values at point B are 1 mm, 100 mm, and 200 mm. The robot starts turning at the point where it enters the accuracy range. The robot follows a circular trajectory within the radius of accuracy range.
Linear interpolated
Linear Interpolated
motio
By setting the accuracy range larger, the robot can shortcut the shorter distance of either the remaining distance of the current path or half
Circular arc
the distance of the next path from B to C. The accuracy value can be set up to the value equal to half the
Maximum setting: half the distance of next path
distance of the second path.
By shortcutting, the cycle time can be shortened. However, when the following conditions are set, the processing of the accuracy setting will be the same as in Standard motion:
· When a waiting instruction (TWAIT, SWAIT, etc.) is executed at point B
· When a work/tool is changed at point B.
· When the interpolation mode for the next point is changed to joint interpol ation
· When the motion mode is changed at point B (ordinary mode motion based on the fixed tool coordinates)
· When the processing branches due to conditions set by instruction such as IF
2. Speed setting (1) Speed in joint interpolated motion
The same as in Standard motion type.
4-21
D Series Controller 4. AS Program
S
ified
Kawasaki Robot AS Language Reference Manual
(2) Speed in linear and circular interpolated motion
In Motion type 2, if the accuracy value is set larger and the configuration of the robot does not change between two defined poses, the specified speed is attained even if the distance between the two poses is small.
However, when the following conditions are set, the process will be the same as the accuracy in joint interpolated motion:
· When a waiting instruction (TWAIT, SWAIT, etc.) is executed at point B
· When a work/tool in changed at point B
· When the interpolation mode for the next point is changed to joint interpol ation
· When the motion mode is changed at point B from ordinary mode (work is fixed and tool moves) to fixed tool dimensions
· When the processing branches due to conditions set by instruction such as IF
When attempting to execute a program where the robot posture changes greatly within a short distance, the time it takes to change the posture will exceed the time it takes to move that distance at the specified speed. In this case, the joint movements are given priority, thus the motion will not reach the specified speed.
pec
speed
Motion type 2
Standard motion type
[ NOTE ]
3. Speed in circular interpolation
In Motion type 2 the maximum speed is autom atically set accord ing to the robot’s cap acity to carry out proper circular interpolated motion.
In Motion type 2, the robot follows a circular trajector y within the accuracy range circle. The maximum speed of this trajectory is also set by the robot’s capacity.
4-22
D Series Controller 4. AS Program Kawasaki Robot AS Language Reference Manual
4.5.4.3 CP OFF
When the CP switch is OFF, there is no superposing of motions. The acceleration for the second path starts after the first motion segment is completed and the current valu e enters the ACCURACY* range.
NOTE* For example, for FS10, the default value is 1 mm.
Speed(v)
A
The point where the current value enters the accuracy range of point B
C
Time(t)
When the CP switch is OFF, the motion for the second path begins only when the deceleration speed of the first motion reaches zero, even if the accuracy range is set larger than the end of the first path.
Speed(v)
Current value enters the accuracy range
CA B
Time(t)
4.5.5 MOTION ALONG SPECIFIED PATH
Linear interpolated and joint interpolated m otions are standard functions on all the robots. However, occasionally it is necessary to move the robot along a specified or calculated path. The AS system can run calculations while the robot is moving, making possible complex motions. This feature is called “Motion along a specified path”.
4-23
D Series Controller 4. AS Program Kawasaki Robot AS Language Reference Manual
The system enables the motions via a program loop that performs a series of continuous calculations of short-distance motions performed while motion instructions are executed. Such a program loop is possible because AS can perform non-motion instructions while the robot is moving. The calculated motion segments are connected smoothly using the CP function.
The following is an example of a program for motion along a specified path. The robot tool will follow the path defined by a series of pose data specified by the array variable “path”.
FOR index=0 TO 10 LMOVE path[index] END
path[0] to path[10] is to be defined by manual teaching pose or by calculation.
4.5.6 SETTING LOAD DATA
By setting the load data for the robot’s current motion, the optimal acceleration and deceleration for the load are determined automatically. Set the correct load data according to the robot’s current motion.
CAUTION
Always set the correct load mass and center of gravity location. Incorrect data may weaken or shorten the longevity of parts or cause overload / deviation errors. For detailed information see WEIGHT command / instruction.
The load data can be set automatically by using the auxiliary function 0406 Auto Load Measurement. See the Operation Manual for details.
4-24
D Series Controller 5. Monitor Commands Kawasaki Robot AS Language Reference Manual
5.0 MONITOR COMMANDS
This chapter groups the monitor commands in the following categories, and describes each command in detail. A monitor command consists of a keyword expressing the command and parameter(s) following that key word, as shown in the example below.
5.1 Editor Commands
5.2 Program and Data Control Commands
5.3 Program and Data Storage Commands
5.4 Program Control Commands
5.5 Pose Information Commands
5.6 System Control Commands
5.7 Binary Signal Commands
5.8 Message Display Commands
EXAMPLE
Keyword Parameter
EDIT program name, step number
Parameters marked with can be omitted.
Always enter a space between the keyword and the parameter.
represents the Enter key in the examples.
5-1
D Series Controller 5. Monitor Commands Kawasaki Robot AS Language Reference Manual
5.1 EDITOR COMMANDS
EDIT
Starts program editor.
C
S P L I D F M R O E XD XY
Finishes editing current program and changes to another program (Change).
Selects program step to display (Step). Displays specified number of program steps (Print). Selects the previous step (Last). Inserts a new step (Insert). Deletes program steps (Delete). Searches for characters (Find). Replaces characters (Modify). Replaces characters (Replace). Places the cursor on the current step (One line). Exits editor (Exit). Cuts and stores the selected step or steps in clipboard. Copies and stores the selected step or steps in clipboard.
XP XQ XS T
Pastes content of the clipboard. Pastes content of the clipboard in the reverse order. Shows the contents of the clipboard. Teaches motion instructions while in editor mode. (Option)
5-2
D Series Controller 5. Monitor Commands Kawasaki Robot AS Language Reference Manual
EDIT program name , step number
Function
Enters the editor mode that enables program creation and editing.
Parameter
1. Program name Selects a program for editing. If a program name is not specified, then the last program edited or held (or stopped by an error) is opened for editing. If the entered program does not exist, a new program is created.
2. Step number Selects the step number to start editing. If no step is specified, editing starts at the last step edited. If an error occurred during the last program executed, the step where the error occurred is selected.
[ NOTE ]
A program cannot be edited during execution.
A program cannot be executed or deleted while it is being edited. If a program calls a program that is being edited, an error occurs, and the execution of that program is stopped.
5-3
D Series Controller 5. Monitor Commands Kawasaki Robot AS Language Reference Manual
C program name , step number
Function
Changes the program currently selected in editor mode.
Parameter
1. Program name Selects the program to be edited.
2. Step number Selects the step number to start editing. If no step is specified, the first step is selected.
S step number
Function
Selects and displays the specified step for editing. (Step)
Parameter
Step number If no step is specified, the first step is selected. If the step number is greater than the number of steps in the program, a new step following the last step in the program is selected.
5-4
D Series Controller 5. Monitor Commands Kawasaki Robot AS Language Reference Manual
P step count
Function
Displays the number of steps specified starting with the current step.
Parameter
Step count Sets the number of steps to display. If the number of steps is not specified, only the current step is displayed.
Explanation
Displays only the specified number of steps. The last step on the list is ready for editing.
L
Function
Displays the previous (last) step for editing. ([Current step number] 1=[step number of the step to be displayed])
5-5
D Series Controller 5. Monitor Commands Kawasaki Robot AS Language Reference Manual
I
Function
Inserts lines before the current step.
Explanation
The steps after the inserted line are renumbered. To exit insert mode, press the Enter key. All lines written before exiting the insert mode are inserted in the program.
Example
CLOSEI command is inserted between steps 3 and 4.
1?OPENI 2?JAPPRO #PART, 500 3?LMOVE #PART 4?LDEPART 1000
5? S 4
4 LDEPART 1000 4? I 4I CLOSEI ;Type in the instructions for the inserted line. 5I
;Press enter to finish inserting the lines.
5 LDEPART 1000 ;Step 4 is now renumbered as step 5. 5?
;Display step 4 to insert a line before it.
;Type the I command.
[ NOTE ]
To insert blank line, press Spacebar or TAB , then Enter while in the insert mode.
5-6
D Series Controller 5. Monitor Commands Kawasaki Robot AS Language Reference Manual
D step count
Function
Deletes the specified number of steps including the current step.
Parameter
Step count Specifies number of steps to delete beginning with the current step. If no number is specified, only the current step is deleted.
Explanations
Deletes only the specified number of steps beginning with the current step. Once deleted, all remaining steps are renumbered and automatically moved up and displayed.
[ NOTE ]
If the number of steps specified is greater than the number of steps in the program, all the steps after the current step are deleted.
F character string
Function
Searches (finds) the current program for the specified string from the current step to the last, and displays the first step that includes the string.
Parameter
Character string Specifies the string of characters to be searched.
Example
Searches for character string “abc” in steps after the current step and displays the step containing that string.
1?F abc ↵ 3 JMOVE abc
3?
5-7
D Series Controller 5. Monitor Commands Kawasaki Robot AS Language Reference Manual
M /existing characters/new characters
Function
Modifies the characters in the current step.
Parameter
1. Existing characters Specifies which characters are overwritten in the current step.
2. New characters Specifies the characters that replace the existing characters.
Example
Modifies step 4 by replacing the pose variable abc with def.
4 JMOVE abc
4?M/abc/def 4 JMOVE def
4?
5-8
D Series Controller 5. Monitor Commands Kawasaki Robot AS Language Reference Manual
R character string
Function
Replaces existing characters in the current step with the specified characters.
Parameter
Character string Specifies the new characters that replace the existing characters.
Explanation
The procedure for using the R command is as follows:
1. Using the Spacebar, move the cursor under the first character to replace.
2. Press the R key and then the Spacebar.
3. Enter the new replacement character(s). Note that the characters entered do not replace characters above the cursor but those two spaces to the left, starting above the R. (See example below)
4.Press Enter.
Once Enter key is pressed, the AS system checks if the line is correct. If there is an error, the entry is ignored.
Example
The speed is changed from 20 to 35 using the R command.
1 SPEED 20 ALWAYS
1? R 35 1 SPEED 35 ALWAYS
1?
5-9
D Series Controller 5. Monitor Commands Kawasaki Robot AS Language Reference Manual
O
Function
Places the cursor on the current step for editing. (“O” for “oneline”, not zero).
Example
The pose variable abc is changed to def using the O command. The cursor is moved using the or key.
3 JMOVE abc 3?O ↵
3 JMOVE abc BackSpace ; 3 JMOVE def ↵ ; Enter “def”
3 JMOVE def 3?
delete “abc” using Backspace
[ NOTE ]
This command cannot be used with the teach pendant.
E
Function
Exits from the editor mode and returns to monitor mode.
5-10
D Series Controller 5. Monitor Commands Kawasaki Robot AS Language Reference Manual
XD step count
Function
Cuts the specified number of steps from a program and stores them in the paste buffer.
Parameter
Step count Specifies number of steps to cut and store in the paste buffer beginning with the curr ent step. Up to ten steps can be cut. If not specified, only the curren t step is cut.
Explanation
Cuts the specified number of steps and stores them in the paste buffer.
The XY command copies and does not cut the steps, but the XD command cuts the steps. The remaining steps in the program are renumbered accordingly.
XY step count
Function
Copies the specified number of lines and stores in the paste buffer.
Parameter
Step count Specifies number of steps to copy and store in the paste buffer. Up to ten steps can be copied. If the number is not specified, only the current step is copied.
Explanations
Copies the specified number of steps including the current step and stores them in the paste buffer.
The XD command cuts the steps, but XY command copies the steps. The program remains the same and step count does not change after the XY command is used.
5-11
D Series Controller 5. Monitor Commands Kawasaki Robot AS Language Reference Manual
XP
Function
Inserts the contents of the paste buffer before the current step.
Explanation
Use the XD or XY command prior to this command to store the desired contents in the paste buffer.
XQ
Function
Inserts the contents of the paste buffer before the current step with the contents being inserted in reverse order.
Explanation
Inserts the contents of the paste buffer in reverse order as it would be inserted using XP command.
5-12
D Series Controller 5. Monitor Commands Kawasaki Robot AS Language Reference Manual
XS
Function
Displays the contents of the paste buffer.
Explanation
Displays the current contents of the paste buffer. If the paste buffer is empty, nothing will be displayed.
T variable name
Option
Function
Enables teaching of motion instructions (JMOVE, LMOVE, etc.) using the teach pendant while in editor mode.
Parameter
Variable name Specifies pose variable name of destination to be taught, expressed in transformation values or joint displacement values. Read as an array variable if specified in the form of A[ ], it will be taken variable. In this case, variables cannot be used in the element numbers. If omitted, the current joint displacement values are taught as constants (pose constant).
Explanation
Enter this command while in editor mode. When executed, teach pendant displays a specialized teaching screen. Motions taught here are recorded as instructions in the program, and are written on the step where the T command is entered. When more than one step is taught, the variable is renamed by incrementing the last number in the variable name. See Operation Manual for more details.
Example
With parameter
2 JAPPRO #a 3? T pos <Teach using TP. Press Cancel to return to AS>
(3 steps are taught here)
3 JMOVE pos0 4 JMOVE pos1
5 LMOVE pos2
.
.
.
5-13
D Series Controller 5. Monitor Commands Kawasaki Robot AS Language Reference Manual
Without parameter
2 JAPPRO #a 3? T <Teach joint values using TP. Press Cancel to end>
(2 steps are taught here)
3 JMOVE #[0,10,20,0,0,0] 4 JMOVE #[10,10,20,0,0,0]
.
.
.
WARNING
Teach pendant must be connected to the controller to use this command. Also, the robot has to be in Teach mode, and TEACH LOCK ON.
5-14
D Series Controller 5. Monitor Commands Kawasaki Robot AS Language Reference Guide
5.2 PROGRAM AND DATA CONTROL COMMANDS
CARD_FDIR* Lists names of the programs and variables in PC card. LIST LIST/P LIST/L LIST/R LIST/S DELETE DELETE/P DELETE/L DELETE/R DELETE/S CARD_FDEL
CARD_VERIFY RENAME
Displays all program steps and variable values. Displays all program steps. Displays all pose variables and their values. Displays all real variables and their values. Displays all string variables and their data. Deletes programs and variables in robot memory. Deletes programs in robot memory. Deletes pose variables in robot memory. Deletes real variables in robot memory. Deletes string variables in robot memory. Deletes programs and variables in PC card.
Turns ON/OFF the verifying function in PC card drive operation. Changes the name of a program.
XFER COPY
Copies steps from one program to another. Copies programs.
CARD_COPY* Copies programs in PC card. TRACE SETTRACE RESTRACE LSTRACE
Turns ON/OFF the TRACE Function. (Option) Reserves memory for logging. (Option) Releases memory reserved with SETTRACE. (Option) Displays the logging data. (Option)
NOTE* These commands are used to control PC card memories, but the same commands
work for floppy disk if CARD_ is changed to FD_. See the explanations for each command for further information.
5-15
D Series Controller 5. Monitor Commands Kawasaki Robot AS Language Reference Guide
CARD_FDIR
FD_FDIR
Function
Displays the name of programs or variables. CARD_ FDIR refers to data on the PC card, and FD_ FDIR refers to data on the floppy disk.
Explanation
By using the CARD_FDIR and FD_FDIR commands, all the subroutines and variables used in the programs are displayed.
Example
>FD_FDIR
Displays the names all programs, subroutines and
variables on the floppy disk.
>CARD_FDIR Displays the names of all the programs, subroutines
and variables on the PC.
When the switch SCREEN is ON, the display does not scroll and stops at the end of the screen. To continue display, press Spacebar. To end the display, press Enter.
[ NOTE ]
Program and variable names with or displayed at the beginning of the name means that the contents of that program or variable are not yet defined.
5-16
D Series Controller 5. Monitor Commands Kawasaki Robot AS Language Reference Guide
LIST program name, .........
LIST/P program name, .........
LIST/L pose (location) variable, .........
LIST/R real variable, .........
LIST/S string variable, .........
Function
Displays the specified program and data.
Parameters
Program name (/P), pose variable (/L), real variable (/R), string variable (/S) Specifies the type of data to display. If not specified, all the data in memory is displayed. If an array variable is selected, all the elements of that array variable are displayed on the screen.
Explanation
The LIST command displays all the program names, their subroutines and variables. On the other hand, LIST/P command displays only the contents of the main program.
Example
>LIST
Displays the contents of all programs, including the variables and their
values.
>LIST/L
>LIST/R
>LIST test
Displays all the pose (location) variables and their values.
Displays all the real variables and their values.
Displays the contents of all programs that start with “test”, their
subroutines and variables.
When the SCREEN switch is ON, the display does not scroll and stops when the screen is full. To continue the display, press Spacebar. To quit the display, press Enter.
5-17
D Series Controller 5. Monitor Commands Kawasaki Robot AS Language Reference Guide
DELETE program name, .........
DELETE/P program name, .........
DELETE/L pose variable, .........
DELETE/R real variable [array elements] , .........
DELETE/S string variable [array elements] , .........
Function
Deletes the specified data from the memory.
Parameters
Program name (/P), pose variable (/L), real variable (/R), string variable (/S) Specifies the type of data to delete.
Explanation
DELETE command deletes the specified program completely; i.e. the main program itself and, if used in the program, the following data are also deleted. (However, data used in other programs are not deleted).
· All subroutines called by the program or by subroutines within that program.
· All pose variables used in the program and in the subroutines in that program.
· All real variables used in the program and in the subroutines in that program.
· All string variables used in the program and in the subroutines in that program.
DELETE/P command, unlike the DELETE command, deletes only the program itself, and not the subroutines and variables used by that program.
If the array elements are not specified with the DELETE/R and DELETE/S command, all the elements in that array variable are deleted. If the element(s) are specified, only the specified element(s) are deleted.
Example
>DELETE test
Deletes the program “test”, and all the subroutines and variables
used in them.
>DELETE/P pg11,pg12
Deletes the programs “PG11” and “PG12”. (The subroutines and
the variables are not deleted.)
>DELETE/R a
>DELETE/R a[10]
Deletes all the elements of the array variable “a”.
Deletes the 10
th
element of array variable “a”.
5-18
D Series Controller 5. Monitor Commands Kawasaki Robot AS Language Reference Guide
CARD_FDEL file name, .........
FD_FDEL file name, .........
Function
Deletes the specified data from the memory.
Parameters
File name Specifies the name of the file to delete.
Explanation
CARD_FDEL and FD_FDEL commands delete the programs in the specified file comple tely; i.e. the main program itself AND, if used in the program, the following data are also deleted. (However, data used in other programs are not deleted).
· All subroutines called by the program or by subroutines within that program.
· All pose variables used in the program and in the subroutines in that program.
· All real variables used in the program and in the subroutines in that program.
· All string variables used in the program and in the subroutines in that program.
CARD_VERIFY mode
FD_VERIFY mode
Function
Turns ON/OFF the verify function in the driver board operation when data is written on the PC card (CARD_VERIFY), or floppy disk (FD_VERIFY).
Parameters
Mode
0: Turns OFF the verify function. 1: Turns ON the verify function. 2: Returns if the current setting of the verify function is ON or OFF.
If omitted, 2 is assumed.
5-19
D Series Controller 5. Monitor Commands Kawasaki Robot AS Language Reference Guide
RENAME new program nameexisting program name
CARD_RENAME new program nameexisting program name
FD_RENAME new program nameexisting program name
Function
Changes the name of a program currently held in memory. RENAME changes the name of programs in robot memory, CARD_RENAME those in PC card, and FD_RENAME, floppy disk.
Parameters
1. New program name Sets new name for the program.
2. Existing program name Specifies the current name of the program.
Explanation
If the new program name already exists, the RENAME command results in an error.
Example
>FD_ RENAME test=test.tmp
Changes the name of the program in floppy disk, from
“test.tmp” to “test”.
5-20
D Series Controller 5. Monitor Commands Kawasaki Robot AS Language Reference Guide
XFER destination program name, step number1 =
source program name, step number2, step count
Function
Copies and transfers steps from one program to another program.
Parameters
1. Destination program name Sets the program for receiving the copied data. If the program name does not exist, the data is transferred to a new program with that name.
2. Step number 1 Sets the step number before which the copied data is inserted. If no step is specified, the data is inserted at the end of the specified program.
3. Source program name Sets the name of the program from where the data is copied.
4. Step number 2 Sets the step number in the source program where the data is copied. If no number is specified, the data is copied starting from the top of the program.
5. Step count Sets the number of steps to copy from the source program, starting from the step number set above (parameter: step number 2). If no step count is specified, all remaining steps in the program are copied.
Explanation
Copies from the specified program a specified number of steps, and inserts the data before the specified step in the destination program.
[NOTE]
If the destination program is being displayed using the STATUS or PCSTATUS commands, or if it is being edited (EDIT command), XFER command cannot be used.
5-21
Loading...