This publication contains proprietary information of Kawasaki Robotics (USA), Inc. and
is furnished solely for customer use only. No other uses are authorized or permitted
without the express written permission of Kawasaki Robotics (USA), Inc. The contents
of this manual cannot be reproduced, nor transmitted by any means, e.g., mechanical,
electrical, photocopy, facsimile, or electronic data media, without the express written
permission of Kawasaki Robotics (USA), Inc.
The descriptions and specifications in this manual were in effect when it was submitted
for publishing. Kawasaki Robotics (USA), Inc. reserves the right to change or discontinue specific robot models and associated hardware and software, designs, descriptions, specifications, or perfor mance parameters at any time and without notice, without
incurring any obligation whatsoever.
This manual presents information specific to the robot model listed on the title page of
this document. Before performing maintenance, operation, or programming procedures,
all personnel are recommended to attend an approved Kawasaki Robotics (USA), Inc.
training course.
KAWASAKI ROBOTICS (USA), INC. TRAINING
Training courses covering operation, programming, electr ical maintenance, and mechanical maintenance are available from Kawasaki Robotics (USA), Inc. These courses
are conducted at our training facility in Wixom, Michigan, or on-site at the customer’s
location.
For additional information contact:
Kawasaki Robotics (USA), Inc.
Training and Documentation Dept.
28059 Center Oaks Court
Wixom, Michigan 48393
K
a
a
s
C SERIES CONTROLLER
aw
k
REVISION HISTORY
AS LANGUAGE REFERENCE MANUAL
Revision
Number
-06/ 7/99In itial PD F r e l ea seB F
-19/22/00Revisio n 1 , bas ed on revi s i on 1 o f print copyCB
-2 1/15/01 Revision 2, based on revision 2 of print copy CB
responsibility includes programming and operating Kawasaki industrial robots on a daily
basis. AS Language is a computer control language designed specifically for use with
Kawasaki robot controllers. This text provides information on creating programs, running
programs, and editing programs using AS Language commands. AS Language is relatively easy to learn with many keywords, syntax sequences, and interface commands
being intuitive.
AS Language provides the programmer with the ability to precisely define the task a
robot is to perform. Programming the robot with a computer control language (AS) also
provides the ability to integrate peripheral components into the program. Typical component interfacing with AS Language programs includes: programmable logic controllers
(PLCs), lasers, weld controllers, gray scale vision, and remote sensing systems.
a
s
aw
k
INTRODUCTION
is designed to assist the user whose primary
AS LANGUAGE REFERENCE MANUAL
AS Language programs provide outstanding perfor mance in terms of robot trajectory
control. Program location points can be stored and played back as either joint angles
representing the manipulator configuration (precision points) or geometrically defined
locations in the work envelope (transformations). Transformation locations can also be
defined based on their relative position to one another (compound transformations).
These capabilities allow program locations to be shifted and moved based on parameters and variables identified in the AS Language program.
I-2
November 20, 1998
K
a
I.1 ROBOT CONTROLLER DESIGN SPECIFICATIONS
Control System:32 bit RISC main CPU
Number of Axes:6 standard; 7th optional
Motion Control:Teach mode -Joint
a
aw
k
s
INTRODUCTION
32 bit RISC CPU for multi function panel unit
32 bit RISC servo CPU controller (one per 3 axes)
Software controlled AC servo drive system using pulse width
modulation (PWM) circuitry
Accuracy:Adjustable in increments of 0.0001 mm within the ranges
below:
F-series
Adjustable between 0.1 mm - 5,000 mm
UX/UT-series
Adjustable between 0.5 mm - 5,000 mm
UZ-series
Adjustable between 0.3 mm - 5,000 mm
Z-series
Adjustable between 0.3 mm - 5,000 mm
September 15, 2000
I-3
C SERIES CONTROLLER
K
a
Speed:Proportional speed - percentage of maximum joint or TCP
Data Editing:Step insertion and deletion, and rewriting of auxiliary and
Software Features:Continuous path motion control - CP ON/OFF
a
aw
k
s
INTRODUCTION
speed. Adjustable in increments of 0.0001 up to 100%
(rounding occurs as necessary).
Absolute speed - speed of TCP in mm/s. Adjustable in
increments of 0.0001 mm/s up to maximum robot TCP speed
(rounding occurs as necessary).
positional data.
Time delays
Coordinate modification
Process control programs (3)
Peripheral equipment control
Interrupt signal control
Error interrupt control
Input of real, string, and integer variables
Local variables
Subroutine calls with arguments (maximum stack = 20)
Program weld schedules
Servo shutdown timer
Auto start function
Error occurrence
Automatic
CYCLE_START
Teach mode
HOME1
HOME2
Power ON
RGSO
Ext. program select (RPS) enabled
Ext. error reset
Ext. cycle start
Ext. program
Select start (JUMP)
JUMP_ON
JUMP_OFF
JUMP_ST
Ext. program select start (RPS)
RPS_ON
RPS_ST
Number of RPS code signal
First signal number of RPS code
Program reset
Ext. hold (EXT_IT)
Ext. condition wait (EXT_WAIT)
Ext. slow repeat mode
Floppy disk drive (optional)
Personal computer (optional)
AS LANGUAGE REFERENCE MANUAL
Power Requirements:Standard Spec.:3-phase 200/220 VAC
North Am Spec.:3-phase 400/440/460/480/515/575 VAC
European Spec.:3-phase 380/400/415/440/460/480 VAC
Tolerance:+/- 10%
Frequency:50/60 Hz
Rated Load:10.5 kVA
Ground:less than 100 ohm ground line separated
from welder power ground
Dimensions:Standard Spec.:W x D x H, 460.8mm x 430mm x
1240mm
(inches)(18.1 x 16.9 x 48.8)
North Am. Spec.:W x D x H, 550mm x 500mm x 1150mm
(inches)(21.7 x 19.7 x 45.3)
European Spec.:W x D x H, 550mm x 500mm x 1150mm
(inches)(21.7 x 19.7 x 45.3)
Weight:Standard Spec.:approx. 80 kg (176 lbs)
North Am. Spec.:250 kg (550 lbs)
European Spec.:250 kg (550 lbs)
1.8.1 Program Instructions ........................................................................................ 1-21
a
s
aw
k
SYSTEM OVERVIEW
AS LANGUAGE REFERENCE MANUAL
November 14, 2000
1-1
C SERIES CONTROLLER
K
a
1.0 SYSTEM OVERVIEW
AS Language for the C controller is a software based control system and high-level
language used to interface with the robot controller and control robot motion. The AS
software is permanently stored in the robot controller’s memory and is activated as soon
as controller power is turned on. It continuously generates robot control commands and
can simultaneously interact with a programmer, permitting on-line program generation
and modification. The multi function panel and/or a personal computer is used to access AS Language.
1.1 AS SYSTEM STATUS
The AS system consists of the monitor mode, the editor mode, and the playback mode.
•Monitor Mode: This is the basic mode in the AS system. Monitor commands are
executed in this mode. The editor or playback modes are accessed from this mode.
a
s
aw
k
SYSTEM OVERVIEW
AS LANGUAGE REFERENCE MANUAL
•Editor Mode: This mode enables the user to create a new program or modify an
existing program. Only editor commands are accepted by the system in this mode.
•Playback Mode: The system is in the 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 playback mode. Refer to unit 4, Monitor and Editor Commands for details.
The
AS
system is controlled by the following system switches:
•CHECK.HOLD
This switch is used with the AS Language commands EXECUTE, DO, STEP,
MSTEP and CONTINUE. When the CHECK.HOLD switch is ON these commands
are available only if the HOLD/RUN switch is in the HOLD position. The controller
accepts these commands with the HOLD/RUN switch in the HOLD position but
robot motion is not initiated until the switch is manually placed in the RUN position.
Default setting is OFF.
1-2November 14, 2000
C SERIES CONTROLLER
K
a
•CP
The CP switch is used to enable or disable the continuous path function. When the
switch is ON, the robot makes smooth transitions between motion segments within
the accuracy ranges set. When the switch is OFF, the robot decelerates and stops
at the end of each motion segment regardless of accuracy.
Default setting is ON
a
s
aw
k
SYSTEM OVERVIEW
Robot PathSwitch Setting
AS LANGUAGE REFERENCE MANUAL
OFF
ON
Accuracy Range
Figure 1-1 CP Switch
•CYCLE.STOP
This switch is used in conjunction with an external input signal to stop the motion of
the robot. With the switch ON, when the input signal is received the robot stops and
the cycle start light turns OFF. When the program is started again it starts at the
beginning. If the program is called from another program, the program restarts at
the beginning of the main program. With the switch OFF, when the input signal is
received the robot stops and the cycle start light remains ON. The robot is in a hold
condition and when the program is started again, it continues at the point in the
cycle where it was stopped.
Default setting is OFF.
•OX.PREOUT
This switch affects the timing of output signal generation in block step programs.
When the switch is ON, an output programmed for a given point is turned ON when
the robot begins motion to the point. With the O X. PREOUT switch OFF, an output
programmed for a given point is not turned ON until the robot reaches the accuracy
range of the point. Figure 1-2 shows the effects the OX.PREOUT switch on signal
timing.
Default setting is ON.
November 14, 2000
1-3
K
a
a
aw
k
s
SYSTEM OVERVIEW
Figure 1-2 OX.PREOUT Switch
C SERIES CONTROLLER
AS LANGUAGE REFERENCE MANUAL
•PREFETCH.SIGINS
This switch is used in conjunction with AS Language instructions and has the same
effect on signal timing as the OX.PREOUT switch has with blockstep instructions.
Default setting ON. The AS Language instructions affected are; SWAIT, TWAIT,
SIGNAL, PULSE, DLYSIG, RUNMASK, RESET and BITS.
•QTOOL
This switch allows the user to identify tools to use in block step or AS Language
programming. When the QTOOL switch is ON, nine tools are available for programming and jogging. The tool dimensions are recorded and assigned a tool number
using auxiliary function 48. When the QTOOL switch is ON, the selected tool dimensions are in effect for jogging and linear playback of block step programs.
When the QTOOL switch is OFF, the tool identified with AS Language instructions
is used.
Default setting is ON.
•REP_ONCE (Repeat Once)
When this switch is ON, programs run one time. With the switch OFF, the program
runs continuously.
Default setting is OFF.
1-4November 14, 2000
C SERIES CONTROLLER
K
a
•STP_ONCE (Step Once)
When this switch is ON, the repeat condition function of progressing through a
program one step at a time is active. The step forward key is used to step through a
program. When the switch is OFF, programs run continuously.
Default setting is OFF.
•AFTER.WAIT.TIMER
When this switch is ON, timers begin timing for a specified step when all wait condi-
tions are satisfied. With the switch OFF, timers begin timing when the robot reaches
coincidence of the taught point.
Default setting is OFF.
•AUTOSTART.PC
a
s
aw
k
SYSTEM OVERVIEW
AS LANGUAGE REFERENCE MANUAL
The AUTOSTART.PC, AUTOSTART2.PC, and AUTOSTART3.PC switches automatically start the associated PC program when controller power is turned on.
Default setting is OFF.
•ERRSTART.PC
When this switch is ON and specified errors (assigned dedicated signals) occur, a
PC program is run as soon as the error is detected.
Default setting is OFF.
•MESSAGES
Enables or disables message output (PRINT or TYPE) to the keyboard screen.
Default setting is ON
•RPS (Random Program Selection)
This switch enables or disables the random selection of programs based on binary
status of dedicated inputs.
Default setting is OFF
•SCREEN
This switch enables or disables scrolling of the screen when information is too large
to fit on one screen.
Default setting is ON
November 14, 2000
1-5
C SERIES CONTROLLER
K
a
•DISPIO_01
This switch allows the user to select the type of display for viewing the status of
inputs and outputs. If the switch is ON, 1s and 0s are displayed to identify the
signal state of individual signals. A 1 represents an ON signal, while a 0 represents
an OFF signal. If the switch is off, an ON signal is represented by an O, while an X
represents a OFF signal. Dedicated signals are represented by uppercase Xs and
Os.
Default setting is OFF.
1.2 NOTATIONS AND CONVENTIONS
A mixture of uppercase and lowercase words is used throughout this manual, all key
words are shown in uppercase and all elements freely specified by the user are shown
in lowercase.
a
s
aw
k
SYSTEM OVERVIEW
AS LANGUAGE REFERENCE MANUAL
Abbreviated notations are used as well. For example, the EXECUTE command can be
abbreviated as EX.
At least one space (blank) or tab is necessary as a delimiter between the instruction (or
command) name and its arguments. The excess spaces or tabs are ignored by the
system.
Monitor commands and program instructions are processed by pressing the ENTER
key.
Many instructions or commands have arguments which can be omitted. If there is a
comma following the optional argument, the comma should be retained even if the
argument is omitted. If all successive arguments are omitted, commas may also be
omitted.
In this manual, values are expressed in decimal notations, unless noted otherwise.
Some instructions and commands require several types of arguments. Mathematical
expressions can be used to designate the value as arguments. The acceptable value
may be restricted. The following r ules show how the values are interpreted in various
cases.
•The AS
Code for Infor mation Interchange (ASCII). An ASCII character is specified by prefixing a character with an apostrophe (‘). For example, ddd = ‘A assigns 65 to ddd.
•All numerical expressions evaluated by the system result in a real value.
1-6November 14, 2000
Language follows the conventions established by the American Standard
C SERIES CONTROLLER
K
a
•DISTANCE is used to define the position to which the robot moves. The unit for
distance is millimeters, although units are not required to be entered with values.
Values entered for distances can be positive or negative, with their magnitudes
limited by a number representing the maximum reach of the robot. For example,
> DO DRAW 50,100,-50 moves the robot 50 mm in X, 100 mm in Y, and 50 mm in
the Z Cartesian direction.
•ANGLES in degrees are entered to define and modify orientations the robot as-
sumes at named locations, and to describe angular positions of robot joints. The
values can be positive or negative, with their magnitudes limited by 180 degrees or
360 degrees depending on the context. For example,
> DO DRIVE 2,45,75 moves joint 2 of the robot 45° at 75% of the repeat speed.
a
s
aw
k
SYSTEM OVERVIEW
AS LANGUAGE REFERENCE MANUAL
•JOINT NUMBER is an integer value from one to the number of joints available on
the robot, including a servo-controlled external axes.
•SIGNAL NUMBER is used to identify binary (on/off) signals. The value is an integer
in the range of 1-256 (output signals), 1001-1256 (input signals) depending on the
number of I/O signals available in the controller. Negative signal numbers indicate
an OFF state.
•Whenever an existing program is saved, or renamed, the new name is entered first,
followed by the old name. The above also holds true for the POINT command. For
example:
CommandNew Name=Old Name
SAVERight_Side=Fender3
RENAMEtest=test.tmp
1.3 DISPLAYING WITH THE TERMINAL
The operator can display various types of information in the monitor mode or playback
mode. Directories and listings of programs, locations, variable data, and weld conditions
are displayed by entering specific monitor commands. For additional information, refer
to section 4.2, Program and Data Control Commands.
November 14, 2000
1-7
C SERIES CONTROLLER
K
a
1.4 LOCATION INFORMATION
Locations recorded in the controller’s memory are comprised of values which designate
destinations for robot motion. The values recorded in memory are either Cartesian
coordinates or robot joint angles. A Car tesian coordinate represents a point in the robot
workspace with a tool center point orientation at that point. A location recorded with
joint angles specifies a robot arm configuration at that point. When the robot is directed
to move to a Cartesian location, two actions occur simultaneously: the robot is moved
so the tool center point moves to the specified point, and the tool is rotated to the prescribed orientation. When the robot is directed to move to a location recorded with joint
angles, the processor calculates a motion path based on the encoder values of the
recorded point, then moves the arm until all encoder values match those of the recorded
point. There are two types of location information, transformation locations (Cartesian
coordinates) and precision locations (joint angles).
a
s
aw
k
SYSTEM OVERVIEW
AS LANGUAGE REFERENCE MANUAL
1.4.1 PRECISION LOCATION
A precision location’s value is represented by the exact position of the individual robot
joints in degrees. There are several characteristics of precision locations that should be
considered. These characteristics result from joint angles being recorded.
Advantages of precision locations: Playback precision is achieved and there is no
ambiguity about robot configuration at a location.
Disadvantages of precision locations: The values recorded can be used by any model
of robot, however the tool center point location is different when used by a robot of
different physical size. Precision locations cannot be easily modified to compensate for
location changes in the robot workspace, because a change requires complete knowledge of the relationship between the positions of all robot joints and the locations in the
robot workspace.
1.4.2 TRANSFORMATION LOCATION
A transformation location is represented by defining the location in terms of a Cartesian
(XYZ) reference frame fixed to the base of the robot. The position of the tool center
point is defined with X, Y, and Z coordinates, and the tool orientation is defined by three
angles measured from the coordinate axes.
1-8November 14, 2000
C SERIES CONTROLLER
K
a
Advantages of transfor mation locations: A value defined for use with one robot can be
used with a different robot having a similar work envelope because the value is defined
in terms of workspace coordinates. Transformations are easily modified to change a
location within the robot workspace. A powerful feature of transformation locations is
the ability to define locations as combinations of values. This is called compound or
relative transfor mation. Such values are used to define the location of a part relative to
its fixturing.
Disadvantages of transfor mation locations: Since a transformation location defines the
location of the tool center point in terms of coordinates in the workspace, no information
is provided about the specific robot configuration at the location. Whenever a transformation is used to define the destination of a robot motion, the AS
the transformation location into an equivalent precision location so it knows how to move
the individual joints. This conversion can introduce small location errors. Despite these
disadvantages, transformation locations are generally much more convenient than
precision locations.
Compound transformations are defined by a combination of transformation locations,
used to create a location or locations that are relative to the first transfor mation value, in
the compound transformation (Figure 1-3).
transformation_value+transformation_value....
The last component of the compound transformation value, defines the actual location.
If the transformations are subtracted an inverse value results.
transformation - transformation
This is useful when several locations are defined relative to a reference location.
a
s
aw
k
SYSTEM OVERVIEW
AS LANGUAGE REFERENCE MANUAL
To change the location points defined relative to a reference location, only the transformation location of the reference must be updated. All locations defined relative to the
reference point are automatically changed to reflect the change.
Unlike usual addition or subtraction, the commutative law does not hold true for the
transformation operation. The compound expression “loc.a + loc.b” does not necessarily
equal “loc.b + loc.a” because the turning angles O,A,T are taken into consideration. An
example of this is shown below.
For example, “Plate” is the name of the transformation location representing the location
of a base plate relative to the origin of the base coordinate system of the robot. “Object”
is the relative transformation for the location of an object relative to the location of the
plate. The compound transformation “Plate+Object” defines the location of the object
relative to the origin of the base coordinate system of the robot. If the transformation
location “Pickup” represents the final location relative to “Plate+Object”, the compound
transformation “Plate+Object+Pickup” defines the location of pickup relative to the origin
of the base coordinate system.
a
s
aw
k
SYSTEM OVERVIEW
AS LANGUAGE REFERENCE MANUAL
Figure 1-3 Compound Transformation
As indicated in the example above, the compound transformation is defined by a combination of several transformation values separated by “+”.
November 14, 2000
1-11
C SERIES CONTROLLER
K
a
1.5 NUMERIC INFORMATION
Numeric information is a combination of numerals, variables, operators, and functions
which return numeric values. Numeric expressions are used not only for mathematical
calculations, but also as arguments for monitor commands or program instructions.
Numeric values used in the AS system are divided into the four types described below:
1.5.1 INTEGERS
Integers are values without fractional parts (whole numbers). Values with full precision
ranges are from -16,777,216 to +16,777,216. Values that exceed this range are
rounded to seven significant digits. Integer values are usually entered as decimal numbers, however, it may be more convenient to enter them in binary or hexadecimal notations.
a
s
aw
k
SYSTEM OVERVIEW
AS LANGUAGE REFERENCE MANUAL
1.5.2 REAL NUMBERS
Real numbers have both the integer part and a fractional part which can range from
-3.4E +38 ~ 3.4E +38. Like integers, real values are positive, zero or negative. They
can be represented in scientific notation. Real values are stored with an accuracy of
approximately seven digits, but actual values may have less precision caused by a
calculation error.
1.5.3 LOGICAL VALUES
Logical values have only two states, ON or OFF. These two states are also referred to
as TRUE and FALSE respectively. A value of negative one (-1) is assigned for the TRUE
or ON state and a value of zero (0) is assigned for the FALSE or OFF state.
NOTE
ON, OFF, TRUE, and FALSE are AS Language keywords.
> AA = ONStores a value of -1 in variable AA
> BB = FALSEStores a value of 0 in variable BB
> CC = -TRUEStores a value of 1 in variable CC
1-12November 14, 2000
C SERIES CONTROLLER
K
a
1.5.4 ASCII VALUES
An ASCII value is the numeric value of one ASCII character. An ASCII value is specified
by prefixing the character with an apostrophe (‘).
> X = ‘AStores a value of 65 in variable X
> X = ‘aStores a value of 97 in variable X
1.6 VARIABLE NAMES
Variable names must start with an alphabetic character and can contain only letters,
numbers, periods, and underlines. The letters used in variable names can be entered
either in lowercase or uppercase. The length of a name is limited to fifteen characters.
AS Language
variable names because they cause ambiguity with the AS system keywords, but their
abbreviations can be used. For example, the following names cannot be used:
commands should not be used and in some cases cannot be used as
a
s
aw
k
SYSTEM OVERVIEW
AS LANGUAGE REFERENCE MANUAL
3P(first character is not alphabetic)
part#2(“#” prefix for precision location name)
random(AS keyword)
Precision location names must be preceded by the symbol “#” to differentiate them from
transformation location names. String variables must be preceded by the symbol “$” to
differentiate them from real and transfor mation variables.
pick(transformation or real variable value)
#pick(precision value)
$count(string variable)
A transformation location and precision location may have the same name, however, the
same name may not be used for transformation values and real values. A defined
variable may be used by any program in the system.
Array variables can be used for any type of information. Arrays consist of several values
under the same name and these values are distinguished from each other by their index
value. In order to designate array elements, attach an element number (index) enclosed
by brackets to the array name. For example, “part[7]” indicates the seventh element of
the array “part”. Indexes should be integers within the range 0 to 9999.
Location, real, string, and array are four types of var iables within the AS system. These
four variable types are explained on the following pages.
November 14, 2000
1-13
C SERIES CONTROLLER
K
a
1.6.1 LOCATION VARIABLES
A location variable (precision or transfor mation) is automatically defined when a value is
assigned for the first time. Prior to this, the location name is undefined. If a program
uses an undefined variable, an error occurs. The user defines location variables by
using monitor commands or program instructions. The following are examples of location variable values:
Precision location value: name with joint angles
#weld90.000°145.056°-95.098° 90.000°45.000°0.000°
Transformation location value: name with joint angles and turning angles
a
aw
k
s
SYSTEM OVERVIEW
JT1JT2JT3JT4JT5 JT6
AS LANGUAGE REFERENCE MANUAL
XYZOAT
weld60.000 mm 145.050 mm -95.098 mm 90.000° 45.000°0.000°
1.6.2 REAL VARIABLES
Real variables are defined using the assignment instruction (=). The format for assigning a real variable is:
Variable_name = numeric_value
a = 6
b = 7
c = a + b
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 automatically the first time it is assigned a
value. If a program uses an undefined variable, an error occurs. The numeric value on
the right side may be a constant, a variable, or a numer ic expression. When an assignment instruction is processed, the value on the right side of the assignment instruction is
first computed, then the value is assigned to the variable on the left side.
For example, the assigned value “x=3” assigns the value 3 to the variable “x”. If a vari-
able on the left side has never been used it is defined automatically, and if it has already
been assigned a value, its current value is replaced by a new assigned value. The
above example is read as “assign 3 to x” and not “x is equal to 3”. The following ex-
ample shows this difference: x = x + 1.
1-14November 14, 2000
C SERIES CONTROLLER
K
a
If the example is a general equation, it is read as “x is equal to x plus 1”, which does not
make sense mathematically. It must be read as “assign the value of x plus 1 to x”. In
this case, the sum of the current value of “x” and 1 is calculated. In the next step, that
value is assigned to “x” as a new value. Therefore, the result of the above assignment
instruction is to increase the value of x by 1. In this example, the variable “x” should
have been previously defined.
x = 3
x = x + 1
In the case above, the resulting value of “x” is 4.
1.6.3 CHARACTER STRING VARIABLES
a
s
aw
k
SYSTEM OVERVIEW
AS LANGUAGE REFERENCE MANUAL
The character information referred to in the AS
characters enclosed by quotation marks (“). Since the quotation mar ks indicate the
beginning and end of a character string, they cannot be included in the string. ASCII
control characters (CTRL, CR, LF, etc.) also cannot be included in the string. For example, a command for printing (displaying on the screen) would be entered as:
PRINT “Kawasaki”
Character strings are defined by using the assignment instruction (=). The format for
assigning a character variable is :
$string_variable=string_value
(name of variable)(string expression)
The string variable on the left side may be either a scalar variable (ie., “$name”) or an
array element (ie., “$line [2]”). A variable is defined automatically the first time it is
assigned a value. If a program uses an undefined variable, an error occurs. The character string on the right side may be a constant, a string variable, or a string expression.
When an assignment instruction is processed, the value on the right side is first computed, then the value is assigned to the variable on the left side. If the var iable on the
left side has never been used, it is defined automatically, and if it has already been
used, its current value is replaced by a new assigned value.
system is indicated as a string of ASCII
November 14, 2000
1-15
C SERIES CONTROLLER
K
a
The following is an example of string variable assignment:
In the above example, the string variable $Name is assigned the sum of $First, $Last,
and the character string “Inc.”. The command PRINT or TYPE $Name returns the string
value: Kawasaki Robotics Inc.
1.6.4 Arrays
An array is a group of values that share a single name. Location variables can be scalars or arrays. A location scalar is a single location value. Each value in an array is
called an element of the array. An element of a location array is specified in exactly the
same way as an element of a numeric array by appending an index enclosed in brackets
to the array name. For example, “part[7]” refers to element 7 of the array “part.” Indexes
must be integers in the range of 0 ~ 9999. Three examples of arrays are described
below:
HERE edgeedge[1]=120.456
DECOMPOSE edge[1]=edgeedge[2]=145.670
FOR i=1 to 6edge[3]=-95.432
TYPE “edge[“I1,i,”]=“,/D,edge[i]edge[4]=90.456
ENDedge[5]=45.000
edge[6]=10.018
In the above example, the current location of the robot is defined as “edge”. The DECOMPOSE instruction extracts component values of edge (XYZOAT) consecutively (1
through 6). The program instructions between the FOR and END statements are executed repeatedly and the TYPE instruction displays the component values of edge
individually.
1-16November 14, 2000
C SERIES CONTROLLER
K
a
Example 2:
In the above example, the robot moves 100 mm in the X direction, a calculated amount
(10 * i + 7) mm in the Y direction, and 50 mm in the Z direction, and define the location
as weld[i].
The FOR statement, in this example increments the value of “i” in increments of two, for
example:
a
aw
k
s
SYSTEM OVERVIEW
FOR i = 2 to 6 STEP 2
DRAW 100, 10 * i + 7, 50
HERE weld[i]
END
In the above example, the array is used as a string array. Each move of the robot displays the strings assigned in the main program.
1.7 NUMERICAL EXPRESSION
The numerical expression is a combination of numeric values and variables combined
together with operators. The expressions are completed by the addition of functional
modifiers to the numeric values and variables. All numerical expressions evaluated by
the system result in a real value. 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.
1.7.1 OPERATORS
For describing expressions, ar ithmetic, logical, and binary, operators are provided. All of
these operators combine two values to obtain a single resulting value, except three: the
two operators (NOT and COM) operate on a single value and the operator (-) operates
on one or two values. The operators are described on the following page.
November 14, 2000
1-17
K
a
Arithmetic Operators:+addition
Relational Operator:<less than
a
s
aw
k
SYSTEM OVERVIEW
-subtraction or negation
*multiplication
/division
^power (if a
x=(-2)^2 results in an error
x= -2^2 assigns -4 to x
MODremainder
x=5 MOD 2 assigns the remainder of 5/2 (1
in this case) to x
<=, (=<) less than or equal to
==equal to
<>not equal to
>=, (=>) greater than or equal to
>greater than
C SERIES CONTROLLER
AS LANGUAGE REFERENCE MANUAL
b
, a<0 results in error)
Logical Operator:ANDlogical AND
NOTlogical complement
ORlogical OR
XORexclusive logical OR
The logical operators are used in Boolean operations such as logical OR (0+1=1,
1+1=1, 0+0=0), logical AND (0x1=0, 1x1=1, 0x0=0), and logical XOR (0+1=1, 1+1=0,
0+0=0). The logical operators are not used for calculating numeric values, but for determining the logical state (TRUE or FALSE) of the conditional expression. If a numeric
value is zero (0), it is considered to be FALSE (0). All nonzero values are considered to
be TRUE(-1).
OPERATIONRESULT
0 AND 00 (FALSE)
1 AND 1-1 (TRUE)
1 OR 0-1 (TRUE)
1-18November 14, 2000
C SERIES CONTROLLER
K
a
Binary Operator:BANDBinary AND
The binary logical operators perform logical operations for each respective bit of two
numeric values.
OPERATIONRESULT
5 BOR 37
0101 BOR 00110111
5 BAND 91
0101 BAND 10010001
a
aw
k
s
SYSTEM OVERVIEW
BORBinary OR
BXORBinary XOR
COMBinary Complement
AS LANGUAGE REFERENCE MANUAL
Expressions are evaluated according to a sequence of pr iorities. Parentheses can be
used to group the components of an expression and to control the order in which the
operations are performed. When expressions containing parentheses are evaluated, the
expression within the innermost pair is evaluated first, then the system works toward the
outermost pair. Within parentheses, expressions are evaluated in the following order:
1. Evaluate functions and arrays.
2. Process power operator “ ^ ”.
3. Process unary operators “ - ” (single component).
4. Process multiplication “ * ” and division “ / ” operators from left to right.
5. Calculate remainders (MOD operators) from left to right.
6. Process addition “ + ” and subtraction “ - ” operators from left to right.
7. Process relational operators from left to right.
8. Process COM operators from left to right.
9. Process BAND operators from left to right.
10. Process BOR operators from left to r ight.
11. Process BXOR operators from left to r ight.
12. Process NOT operators from left to right.
13. Process AND operators from left to r ight.
14. Process OR operators from left to r ight.
15. Process XOR operators from left to r ight.
The logical expressions result in a logical value TRUE or FALSE. A logical expression
can be used as a condition in which the execution of a program or program steps is
performed. 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.
November 14, 2000
1-19
C SERIES CONTROLLER
K
a
For example, the following two statements have the same meaning, but the second
statement is easier to understand.
IF x GOTO 10(If the value of x is true, goto label 10 in the program)
IF x <> 0 GOTO 10 (If the value of x is not equal to 0, goto label 10 in the program)
1.8 MONITOR COMMANDS
TEACHlocation variable name
The TEACH command is used in conjunction with the small teach pendant. With the
small teach pendant connected, the TEACH command is entered at the monitor prompt.
The small teach pendant is used to jog the robot to the locations used in the specified
program. When the RECORD key on the teach pendant is pressed, the location is
placed into the system memory with the specified location variable name
0. Each time the RECORD key is pressed the number following the location variable
name is increased by one.
a
s
aw
k
SYSTEM OVERVIEW
AS LANGUAGE REFERENCE MANUAL
followed by a
For example, the command TEACH loc is entered at the monitor prompt, the first time
the RECORD key on the small teach pendant is pressed, a location with the name loc0
is stored in the system memory. The next time the RECORD key of the small teach
pendant is pressed, the location stored in system memory is loc1
The TEACH command allows the programmer to record transfor mation locations without
having to exit the work cell for each new location.
The HERE command stores the current robot location in the specified precision or
transformation variable.
HERE #pallet
The POINT command defines the named location variable using an existing location
variable. Component values may also be entered from the keyboard.
POINT a = b
Assigns component values of location var iable b into location variable a.
POINT #a
.
Displays the current component of location variable #a. If the location variable is not
defined, zeros are displayed.
1-20November 14, 2000
C SERIES CONTROLLER
K
a
1.8.1 PROGRAM INSTRUCTIONS
The commands HERE and POINT may also be used in a program as program instr uctions. For example,
JMOVE loc1
POINT loc2=loc1
DRAW 347.28, ,479.0
HERE loc3
In the above example, the robot moves to loc1. The POINT command then assigns
component values of loc1 to loc2. The DRAW command moves the robot 347.28 mm in
X, and 479 mm in the Z direction. Finally, loc3 is defined by the HERE command.
a
s
aw
k
SYSTEM OVERVIEW
AS LANGUAGE REFERENCE MANUAL
November 14, 2000
1-21
Loading...
+ 398 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.