Manual Básico Epson RC 7.4 y SCARA T3 PDF
Manual Básico Epson RC 7.4 y SCARA T3 PDF
1
Orientation
2
Recycling Guide
3
Recycling Guide
Definitions:
Cardboard- means corrugated cardboard and the thin brown cardboard you
find in some product packaging.
4
Product Line Overview
• Controller Specifications:
• Description
• Windows
• Hardware Components
• Robots Supported
5
RC620+ Epson Robot Models
6
Part Names
(1) TP Teach Port either bypass or Teach Pendant (7) USB port for common connection
connection. When the Teach Pendant is not portable drive device to Windows OS
connected, connect TP/OP Bypass Plug environment.
(2) TEACH / AUTO / PROGRAM Indicator LEDs. • Optical drive
(3) TRIGGER button initiates controller status transfer (9) Controller Status 2-Line Display
to MEMORY (10) Power Switch
(4) MEMORY port for common connection portable (11) Power off key lock
drive device to RC620 controller environment. (12)(13) Filtered dual air intake
(5) HDD - LED Disk Access Activity (14) Drive Unit / Manipulator Connection
(6) SHUTDOWN switch may be used to exit Windows Check label (Optional 2 units) -2 -1
when no KB attached. May be used during (15) Controller Unit Serial Number.
abnormal PC shutdown when held for 5 seconds. 7
Part Names
8
Part Names
(18) Connector panel for CPU board, serial ports or (27) MC/SIGNAL connector 1 – Robot signal
USB option. connection. Motor encoders etc.
(19) PCI expansion Frame Grabber and Field Bus (28) Connection Check label 2 (optional manipulator)
Master. (29) Connection Check label 1 - manipulator ID
(20) CPU Board slot (30) MC/SIGNAL connector 2 – Robot signal
(21) LAN-2 General CPU Ethernet Network (option)
connection. (31) M/C POWER connector 2 – Robot motor power
(22) DU OUT - Connect to Drive Unit option. connection (option)
(23) R-IO – Additional future IO function. (32) M/C POWER connector 1 – Robot motor power
(24) EMERGENCY – Emergency / Safe Guard connection.
integration connector. (33) AC IN 200 – 240 VAC Single phase
(25) LAN-1 SPEL+ Ethernet Network connection. (34) Special Slot – Optional Expansion IO, RS232C,
(26) IO – Input / Output integration connector. 24 Field Bus IO Slave, Pulse Generator boards
Inputs, 16 Outputs.
9
RC620+ Partial Specification
10
RC620+ Partial Specification
11
RC620+ Partial Specification
12
System
Block
Diagram
13
Robot Controller RC180 Micro
PowerDrive
15
16
RC180 Specification
17
RC180 Specification
18
RC180 Specification
19
(1) Filter/Air (5) Special (9) Robot (13) Power (17) RC+ (21) TP/OP
Std-1. or Specification Signal Conn. Switch, NON Program Device Port
Option-2 MT Label UL only. Port USB
(2) Stat LED (6) (10) E Stop (14) Power (18) LAN (22) IO Port
Teach/Auto/ Controller Safety Conn. Switch Metal Comm. Port 24 inputs
Program SN Hasp 16 outputs
(3) Segment (7) Robot (11) AC In (15) Cable (19) (23) Battery
Display Motor Conn. 200 – 240V Guide Memory Port Controller
(4) Device (8) Attach to (12) Thumb (16) Options (20) Button (24) Six Axis
Signature Robot Model Screws Dual Units 1 & 2 Memory Port Driver Cage
Label / Serial Num Purpose Trigger 20
RC90
21
Item Specification
RC90 Model
CPU
Robot Controller RC90
32 bits Micro Processor
Controllable axes 4 AC servo motors
Programming
EPSON RC+ 5.0
language and
(a multi-tasking robot language)
Robot control
Ver.5.4.1 or later is recommended.
software
Up to 4 joints simultaneous control
Joint Control
Software AC servo control
Robot manipulator PTP motion: Programmable in the range of
control 1 to 100%
Speed Control
CP motion: Programmable (Actual value
to be manually entered.)
PTP motion: Programmable in the range of
Acceleration/
1 to 100%; Automatic
Deceleration
CP motion: Programmable (Actual value
control
to be manually entered.)
PTP (Point-To-Point control)
Positioning control
CP (Continuous Path control)
Maximum Object Size : 4 MB
Point data area: 1000 points (per file)
Memory
Backup variable area: Max. 100 KB (Includes the
capacity
memory area for the management table.) Approx. 1000
variables (Depends on the size of array variables.)
Remote
Teaching
Direct
method
MDI (Manual Data Input)
22
RC90
Including 8 inputs,
External 8 outputs with
input/output Input: 24 remote function
Standard I/O
signals Output: 16 assigned
(standard) Assignment change
allowed
Communication
interface Ethernet 1 channel
(standard)
23
(9) (4) RC90 (19)
(Left side)
(5) (1)
(6)
(7) (3) (20)
(8)
(2)
(18)
24
RC90 & LS Robot Connection
RC90 Controller
26
Robot Safety
• Whenever you are working with robots or other automation equipment, safety must be
the top priority. In designing the robot cell, consideration should be given to the
following points at installation time:
• Important Note: It is strongly recommended that you install an ESTOP button within
easy reach of your development PC. See the manual that came with your controller for
wiring details.
• It is recommended that the RIA/ANSI 15.06 safety requirements specification be obtained
and used as a guide for design of the cell.
• The power connection for the controller's drive unit should be such that it can be locked
or tagged in the off position to prevent any one from turning on power while someone
else is in the work envelope. This could be simply a plug and receptacle, so the plug can
be removed and tagged or it could be a disconnect box with lock out.
• Use a safety light curtain, floor mat, guard door, or other similar device to stop the robot
if someone enters the work envelope. Guard doors are recommended.
• The emergency stop circuit should remove power from all external components that must
be turned off during an emergency. Do not assume that the robot controller will turn off
all outputs if configured to. For example, if an I/O card is faulty, the controller cannot
turn off a component connected to an output. The emergency stop on the controller is
hardwired to remove motor power from the robot, but not external power supplies.
• Use beacons or lights to indicate that the robot cell is in cycle.
• Use software motion limits to protect the robot from being moved into an obstruction
because of an erroneous translation point. See the Range statement help.
27
Robot Safety
Robot Power
The robot will not operate regardless of the control actions taken by the operator when in the
operation-prohibited status. During operation, when the safeguard circuit opens, the system will switch
to operation-prohibited status.
The robot will operate at low speed and torque in the restricted status (low power). In the unrestricted
status (high power), the robot will operate at the programmed speed and torque.
In the event that the robot should make an unexpected movement, the restricted status (low power)
decreases operating speed allowing the operator to avoid danger. The torque is also decreased to
minimize serious injury to the operator should one be struck by the robot. The maximum values of the
decreased speed and torque are set according to the robot used and cannot be changed by the user.
As a safety precaution the initial power status of the robot will be set to either the restricted (low
power) status or the operation-prohibited status. The system will not change to the unrestricted (high
power) status if the appropriate procedures are not followed.
When the system is in restricted (low power) status or operation-prohibited status, a single failure will
not cause a runaway action that surpasses the assigned speed or torque decrease. This is due to the
multi-protect circuit and mutual monitoring circuit in the control system.
28
Robot Safety
Safe Guard
The robot stops immediately and enters pause status if a closed safeguard is opened,
or if the “safety guard open” state is released. The description below explains how the
safeguard input works.
Safeguard open: Robot stops immediately, motors are turned off, and further
operation is impossible until either the safeguard is closed and the instructions are
executed, or Attend mode is turned ON and the enable circuit is engaged.
29
Robot Safety
Operation Modes
Operation of the robot is possible under the following conditions:
• Teach Mode is ON and enable circuit is engaged. In Teach mode, only the
robot can only be moved at slow speed. The robot will stop if the enable
circuit is disengaged. Refer to the table below. When the safeguard circuit is
open, the robot will stop. If Teach mode is OFF, the motors will be turned
off. If Teach mode is ON, the motors will remain on.
30
Robot Safety
Power Mode Setting
A shift into restricted (low power) status can be done through the
execution of a power status change instruction (Power), regardless of the
safeguard or operation mode. This ensures the safety of the operator and
reduces the possibility of peripheral equipment being destroyed or
damaged as a result of careless operation.
In contrast, when shifting into unrestricted (high power) status, the status
of the safeguard and operation mode have precedence over a power status
change instruction.
The table below shows the relationship between safeguard and power
mode.
The Controller is equipped with a redundant emergency stop input. If the normally
closed emergency stop circuit is broken, the power supplied to all motors will be
shut off (and enter servo-free status) and the robot will be stopped by dynamic
braking.
32
Getting Started
• Discussion:
• Robot Coordinate Systems
• Brake Release Button When Motor Power Off
• Getting Started
• Starting Epson RC+
• TP
• Print Command
• Lab 1 Tutorial from Epson RC+ Robot Control System
Manual
33
SCARA Robots G Series
G series robots have
one Brake Release
Button for both Joint 3
and Joint 4. Do not Z axis Brake Release
forcibly move Joint 3
or Joint 4 manually
without pressing Brake
release button first.
Note: Controller power
must be on for brake
release circuit
operation.
Note that most common SCARA robots, in World Local 0, could never reach point coordinate X = 0, Y = 0 as it
is physically impossible. Exception: Epson RS zero footprint SCARA. 34
SCARA Robots G Series
G series robots have
one Brake Release
Button for both Joint 3
Joint 3, Joint 4 Brake
and Joint 4. Do not
forcibly move Joint 3 Release Button
or Joint 4 manually
without pressing Brake
release button first.
Note: Controller power
must be on for brake
release circuit
operation.
35
SCARA Robots RS4
Note that most common SCARA robots, in World Local 0, could never reach point coordinate X = 0, Y = 0 as it
is physically impossible. Exception: Epson RS zero footprint SCARA. 36
SCARA Robots RS3
Note that most common SCARA robots, in World Local 0, could never reach point coordinate X = 0, Y = 0 as it
is physically impossible. Exception: Epson RS zero footprint SCARA. 37
EZ Modules Robot
E.g. X5 series RU-HMSz A type
-X+
-Z
Z = 0 Position
39
Six Axis Series Robot C3 Shown
+X
This pose, center
of work envelope
is X=0, Y=0
+Y
40
41
Robot Points
• A robot point is a set of coordinates that define a position
in the robot work envelope. Each point on a robot
controlled by SPEL+ has four coordinates: X, Y, Z, and U.
42
Robot Points
43
Robot Points
Please observe the following guidelines
for teaching points:
• Robot operators must receive training that utilizes the same
type of robot. Before teaching, the operator should be
thoroughly familiar with teaching procedures.
• Before teaching, remove all errors and malfunctions.
• Before the robot operator goes inside the safeguard system,
confirm that the robot motors go off when the safeguard is
open and that emergency stop switches are functioning
correctly.
• The robot operator should visually check the robot system and
safeguard system interior to ensure that there are no potential
hazards.
• Design the system in such a way that prevents the overall
robot system from being started up from any location while
the operator is inside the safeguard area.
• If there is a possibility of a dangerous situation arising from
the operation of a device other than the robot, such as an
actuator, take steps to prevent such operation or ensure that
these devices can only be controlled by the teaching operator.
44
Robot Points
.
45
TP1
48
Print Command
• Outputs data to the current display window, including
the Run window, Operator window, Monitor window,
and Macro window.
• First we look at usage in program mode to help support
your first lab. The characters used to make simple print
statement are:
( Keyword )
Print “Hello World”
( “Output Data” )
49
Lab 1
Writing Your First Program
Follow these instructions to create a simple application program so that you
will become more familiar with the EPSON RC+ development environment.
1. Start EPSON RC+
Double-click the EPSON RC+ icon on the desktop.
2. Create a new project
a. Select New from the Project menu.
b. Type in a name for a project. For example, Lab 01.
c. Choose OK to create the new project.
When the new project is created, a program called MAIN.PRG is created.
You will see a window open with the title MAIN.PRG with a cursor flashing
in the upper left corner. Now you are ready to start entering your first
program.
3. Edit the program
Type in the following program lines in the MAIN.PRG edit window. You
can use upper or lower case characters.
Function main
Print "This is my first program."
50
Fend
Lab 1
Writing Your First Program
51
Lab 1
Writing Your First Program
Lab 1
Writing Your First SPEL+ Program
SIX AXIS
5. Teach robot points continued FOR SIX AXIS ROBOT ONLY
Click on the Robot Manager icon from the main tool bar. Click on the Robot
Control Panel toolbar tab. Click on the Motor On button to turn the robot motors
on. You will see the Jog and Teach tab, click on Jog & Teach tab.
• Select Jog Mode – Tool. Press the Teach P0 button to store the current position.
• Jog the robot by pressing the +Z jog button. Hold the button down to continue jogging.
Let go when the robot is about half way out in the work envelope.
• Select Jog Mode – Joint Jog the robot > J5 -90 deg. > J4 + 45deg.
• Now change the current point to P1 by clicking on the right arrow on the Point # slider
until the point number is 1.
• Press the Teach P1 button. You will see a confirmation message to teach the point.
Answer Yes.
• Select Jog Mode – Tool. Press the +X button to jog the robot in the +X direction
approximately 50mm.
• Change the current point to P2 by clicking on the right arrow on the Point # slider until
the point number is 2.
• Press the Teach P2 button. You will see a confirmation message to teach the point.
Answer Yes.
• Leave the jog screen by pressing the Close button. You should see a message box
change verification. Click Yes to save the changes.
Lab 1
Writing Your First Program
6. Modify the program to include robot motion commands
7. Insert three new Jump statements, depending on your
robot type, into the MAIN.PRG program as shown
below:
55
Run Window
56
Run Window
Item Description
Text area This is the area that takes up most of the run
window. Output from your programs is displayed
here. When your program uses an Input statement,
you can type in the requested input from this text
box. You can use the scroll bars to view the entire
text buffer.
If an error occurs while running a program, the error
number, program file name, line number and
function name will be displayed in this text area.
You can double click on the line where the error is
displayed to directly go to the source line that
caused the problem.
Function Select a function to start. Functions are sorted
alphabetically. Use Form after creating custom GUI
Function main is selected by default.
Form Select a Form to start. Forms may be created
through the Epson GUI Builder option. Once the
form is created, it may be selected here.
Low Power When this box is checked, SPEL+ ignores the Power
High command. This allows you to run your
program in low power mode to verify operation
without having to change the program.
57
Run Window
Item Description
Speed Factor Specifies the robot motion speed factor. The speed
factor is a percentage of maximum point to point
speed and linear interpolated speed. For example, if
you program executes Speed 80 and the speed
factor is 50%, the robot will move at speed 40.
Start Starts the function shown in the function drop down
list.
Stop Stops all tasks. If the robot is executing a motion
command when this button is pressed, the robot will
decelerate to a stop.
Pause Pauses all tasks with pause enabled. Activates the
Continue button. If the robot is executing a motion
command when this button is pressed, the robot will
decelerate to a stop.
Continue Continues paused tasks.
CTRL+C Same as Stop button.
58
I/O Monitor (Tools Menu)
The IO Monitor dialog
lets you monitor all
system inputs and
outputs. The inputs are
displayed on the left side
of the dialog and the
outputs on the right.
Labels that have been
defined using the I/O
Label Editor are
displayed next to each
bit.
After the dialog has
been opened, the input
and output status is
constantly updated.
You can also turn
outputs on and off when
there are no programs
running by double
clicking on the output
LEDs.
Toolbar:
59
IO Label Editor
• The I/O label editor lets you define intuitive IO labels for each
project. The labels can be used in your active programs, from
the Monitor window, or in macros.
60
SPEL+ Language Reference
Manual
61
SPEL+ Language Reference
Manual
62
Reset Statement
• Resets the controller into an initialized state.
Syntax
Reset
Description
Reset resets the following items:
• Emergency Stop Status
• Error status
• Output Bits (All Outputs set to Off;) (User definable SW switch to turn
this feature off - see System Configuration > Spel Option Tab)
• Current robot Speed, SpeedR, SpeedS (Initialized to default values)
• Current robot Accel, AccelR, AccelS (Initialized to default values)
• Current robot LimZ parameter (Initialized to 0)
• Current robot Fine (Initialized to default values)
• Current robot Power Low (Low Power Mode set to On)
• Current robot PTPBoost (Initialized to default values)
NOTE
The reset command must be used to reset the controller after errors
occur. Many errors will not allow program execution until a reset
) command is executed either through monitor mode, robot control
panel, or programmatically
63
Motor On Statement
Syntax
Motor On | OffOn energizes all motors | Off de-energizes all
motors
Description
The Motor On command is used to turn Motor Power On and release the
brakes for all axes. Motor Off is used to turn Motor Power Off and set the
brakes.
64
Sfree / Slock
• SFREE: Removes servo power from the specified servo
joint.
• SLOCK: Restores servo power (from "Servo Free"
condition) to the specified servo joint.
> SFree 1, 2
> SLock 1, 2
66
Keyword discussion
Example:
> Pulse
PULSE: 1: 0 pls 2: 0 pls 3: 0 pls 4: 0 pl
68
Wait Command
• Causes the program to Wait for a specified amount
of time or until the specified input condition (using
Sw) is met.
• Examples:
Wait Sw(0) = 1 Waits (suspends) until the
H/W input 0 equals 1 (high)
Wait 60.5 Waits 60.5 seconds and then
continues execution
Wait Sw(0) = 0 And Sw(1) = 1 Waits until both conditions
Sw(0)=0 (low) And
Sw(1)=1 are satisfied
Return Values:
Variable data or the specified character string.
Description:
Print displays variable data or character strings on the
display device.
70
Print Statement
• Print Statement Example
Function test
Real uvar
uvar = 1.123
Print “The value of uvar is: ”, uvar
Fend
71
SW Command
Returns or displays the selected input port status. (i.e.
Discrete User I/O)
• Syntax:
Sw(bitNumber)
• Parameters:
bitNumberInteger expression representing an input port.
• Return Values:
Returns a 1 when the specified input is On and a 0 when the
specified input is Off.
• Description:
Sw provides a status check for the inputs. Sw is most
commonly used to check the status of one of the inputs
which could be connected to a feeder, conveyor, gripper
solenoid, or a host of other devices which works via discrete
I/O. Obviously the input checked with the Sw instruction has
2 states (1 or 0). These indicate whether the device is On or
Off.
NOTE
Multi-statements: A program statement line
) can contain several statements separated by
72
semi-colons.
Comments
• Use comments to add notes to
your programs. An apostrophe
character ' starts a comment.
• Example:
Function Main
' ****** Epson Training ******
' Application Code goes below here..
Print “Hello World”
Fend
73
Editor Colors
74
Project Build Status Window
• When the project
build process
begins, the
Project Build
Status window is
displayed. This
window shows
progress
messages and
error messages
Double clicking
over the error
message takes
you to the line
of code that
generated the
error.
75
Syntax Errors
Error message
in status bar
76
Point Labels
• Points can be referenced by name
• You can assign names to point numbers so you can refer to points by
name in a program. Assign names from the point editor Through
Robot Manager. Names must be unique for each point number when
used in the same point file.
Example:
Function Main ‘Function declaration
Integer I ‘Defines Integer data
For i = 0 To 10 ‘Count loop init block
Jump Pick ‘Pick is point label
On GripDev ‘GripDev is bit label
Jump Place ‘Place is point label
Off GripDev
Next I ‘Count loop end block
Fend ‘Function end declaration
77
Robot Manager
Point Labels & Position Direct Edit
EPSON RC+
provides a
spread sheet
editor for robot
points. You can
select point
files, define
new points, edit
existing points,
add point labels
or cut, copy,
and paste
points.
78
Lab2
79
Projects
80
What is a SPEL program?
• A SPEL+ program is a text file that contains one or
more function definitions. Every program file has a
.PRG extension and resides in the project directory on
the PC.
• A function definition begins with the Function
statement and ends with the Fend statement. All
source statements to be executed by a function must
be included within the body of the function.
• The Function...Fend combination of statements could
be thought of as a container where all the statements
located between the Function and Fend statements
belong to that function. Multiple functions may exist in
one program file.
NOTE
81
What is a EPSON RC+ Project?
An EPSON RC+ project is a collection of
SPEL+ program files, robot point files,
and setup parameters used to run an
application.
82
Project Structure 6.x
Clicking the Project menu, then selecting
edit is your way of adding and removing
project program, include and point files.
Default point file name is: robot1.pts
NOTE The first listed program file is default when executing your project
via Run or Operator Window. This means your execution will start
) sequentially at the first function inside main.prg. All point data will
be retrieved from default point file unless redirected with 83
LoadPoints command.
Project Structure 5.x
Clicking in the Project menu then selecting
edit is your way of adding and removing
project program, include and point files.
Default point file name is: Points.pts
NOTE The first listed program and point file are default when executing
your project via Run or Operator Window. This means your
) execution will start sequentially at the first function inside
main.prg. All point data will be retrieved from the Points.pts file 84
when executing motion commands unless otherwise redirected.
Why do you need projects?
• Projects are a safe and convenient way to
manage your SPEL+ applications. All the
information for each application is kept in one
project. By keeping all of your code, robot
configuration, system variables, and point
definitions in one project, its easy to open a
project and begin running or editing. Also, it's
easy to create new versions of an application and
run older versions.
• Projects make it easier to maintain your
application code with less chance of a program
being lost.
• There are also commands for copying and
renaming projects, making it easy to create new
projects from previous versions and for backing
up projects.
85
Projects Overview
What's in a EPSON RC+ project?
• Each project has its own directory on disk. This keeps
all of the files for each project separate from each
other. The project directories are under the
\EPSONRCxx\Projects directory. Sub directories may
also be created.
The following components make up a project-
• Project file
– A project file contains all of the information that
describes the project. The file is automatically
created by EPSON RC+. The project file does not
require user edits, doing so may cause errors
when you open the project. The project file of
interest has an *sprj extension. The *.sprj file is
the also the VB Guide link file.
• Program source files
– A program source file is an ASCII file that contains
one or more SPEL+ functions. Each function in
SPEL+ can run as a separate task in the robot
controller Program files have the *.PRG extension.
86
Projects Overview
What's in a EPSON RC+ project?
• Point files
– A point file contains a list of robot points. The file
extension is PTS. Each point describes a Cartesian
coordinate in the robot work envelope. Point files
are associated with project robots. Each robot in a
project has its own set of point files. Each point
file contains 1000 place holders.
• Include Files
– Contains project development user defined macros.
An include file that has defined macros substitutes
a symbolic name or set of characters for an
associated fixed numeric or string value.
• Templates
– New project templates are available for first time
users. Templates may created by placing a project
file into the associated Templates folder.
87
Building a project
Compiler: A program that translates text written in a computer language (in our case
SPEL+ lite) into another computer language (Epson RC+ object code) 88
Expand Pick and Place Program
• Discussion:
• Variables
• Lengths
• Integer
• Real
• Double
• Long
• String
• Boolean
• Basic Loop
Structure
89
Variable Data Types
• A variable is a symbolic name that is
used to identify a value.
• A variable declaration statement requires
that the data type of the variable be
specified followed by the symbol that is
to be used to represent that location of
memory.
Example:
Integer cycleCount
String partName$
90
Variable Data Types
• The following table shows the different data types for the SPEL+
language.
91
Variable Data Types
Variable Data
read / write access scope through
your source code may be either:
93
Initial Values
94
If...Then...Else...Endif
Statement
Use an If...Then...Else…ElseIf for single or multiple condition execution
strategy. Nested conditions are supported. (IF condition inside and existing
IF)
Example –
Expression using single line technique
IF SW(0) = 1 THEN PRINT "Input 0 ON" ELSE PRINT "Input 0 OFF"
IF SW(0) = 1 THEN
PRINT "Input 0 ON”
ELSE
PRINT "Input 0 OFF”
ENDIF ‘ ** “end marker” or end of construct syntax > if condition.
95
If...Then...Else...Endif
Statement
Example -
If Motor=Off Then
Motor On
EndIf
NOTE
The “Motor Function” returns the status of motor
) power (0 = Motors off, 1 = Motors on).
96
Basic Loop Structures
For/Next
• For...Next executes a set of statements within a
loop a specified number of times. The beginning
of the loop is the For statement. The end of the
loop is the Next statement. A variable is used to
count the number of times the statements inside
the loop are executed.
97
Basic Loop Structures
For/Next
• Program statements after the For statement
are executed until a Next instruction is
reached. The counter variable is then
incremented by the Step value defined by the
increment parameter. If the Step option is not
used, the counter is incremented by 1.
98
For/Next Example
FOR . . . NEXT
FUNCTION Demo1
INTEGER count
FOR count = 1 To 10
GO P(count)
NEXT count
99
Basic Loop Structures
Do/Loop
100
Basic Loop Structures
Do/Loop
Do….Loop
Function Demo2
Integer A
A=1
Do While A < 10
Jump P1
On 1
Jump P2
Off 1
A=A+1
Loop
Print “ Program cycle finished”
Fend
101
Lab 3
102
Motion Concepts and Usage
• Robot Manager:
– Robot Control
– Jog & Teach
– Points
– Jog Distance
– Teach, Delete
– Point Labeling
– Point File Name
– Jump, Go, Move
• Go Command
• Move Command
• Jump Command
103
Robot Manager - Control Panel
The control panel tab
• Select Robot on
6.x only *
• Motor Off / On
• Power Low / High
• Status – Estop,
Safeguard, Motor &
Power
• Free Joints
(SCARA Robot Only)
• Reset – Resets
errors requiring reset
command.
• Home – Robot
motion to stored
joint position with
joint execution
priority. EPSON RC+ Robot Manager is an active interface to
most common robot motion settings. You may easily
switch control between items by simply selecting the
tab of your choice. 104
Jog and Teach ECP – External
Local, Tool and Arm setting Control Point
Jog Mode
Jog buttons
Current Position
Values
Continuous, Long,
Medium, and
Short jog distance
Righty or Lefty settings.
Hand Orientation The edit button
takes you to the
points tab where
direct coordinate
edits are possible.
Point position
Values
Point files have 1000 editable positions. Editing may be accomplished within
NOTE
the Points dialog. Teach points is done through the Jog & Teach tab. The
) point file extension is *.pts. The pts file is contained inside your project file.
Epson RC+ may have multiple point files. (6.x) Default file name 106
robot1.pts / (5.x) Default file name Points.pts
Points
SCARA Lefty / Righty
110
Motion Commands
Point to point motion
Point to point (PTP) commands robot motion from its
current position directly to a specified point. Motion may
not be in a straight line.
BGo, Executes point to point relative motion, in the
selected local coordinate system as specified by the BGo place
destination point expression. BGo P0
• If a local coordinate system is not specified, relative
motion will occur in local 0 (Base coordinate system).
• Arm orientation attributes specified in the destination
point expression are ignored. The manipulator keeps the
current arm orientation attributes. However, for a 6-Axis
manipulator, the arm orientation attributes are
automatically changed in such a way that joint travel
distance is as small as possible.
112
Motion Commands
Interpolated Motion
Interpolated Motion (IM) motions the robot from its current
position to a specified point. Motion may be in a straight
line, circular or curved.
Move place
Move, executes a linear or straight line move where all axes
compensate to comply for straight line interpolation Move P0
Arc, Circular Interpolation is a type of curved motion where
an arc is defined with 3 points and the arm moves in an Arc Nine,Ten
circular fashion through the 3 points until it finally arrives on
the 3rd point. Circular Interpolated motion is normally used Arc P9,P10
in process applications like dispensing.
Curve, Curve creates data that moves the manipulator arm
along the curve defined by the point series pointList and CvMove “Myfile”
stores the data in a file on the controller. The CVMove
instruction uses the data in the file created by Curve to
move the manipulator in a continuous path type fashion
116
Robot Motion
At some points in the work envelope, the 6-Axis robot can have the same position and
orientation even if the fourth joint or the sixth joint are rotated 360 degrees. To
distinguish these points, the J4Flag and J6Flag point attributes are provided.
To specify the J4Flag, add a forward slash (/) followed by J4F0 (-180 < the forth joint
angle <= 180) or J4F1 (the forth joint angle <= -180 or 180 < the forth joint angle).
To specify the J6Flag, add a forward slash (/) followed by J6F0 (-180 < the sixth joint
angle <= 180), J6F1 (-360 < the sixth joint angle <= -180 or 180 <the sixth joint angle
<= 360), or J6Fn (- 180*(n+1) < the sixth joint angle <= 180*n or 180*n <the sixth
joint angle <= 180*(n+1)).
118
Lab #4
119
DAY 2
120
Tools
• Discussion:
• Tool Coordinate Systems
• How to build tool
• How to use tools in J&T Screen
• TOOL and TLSET Command
121
Tool Coordinate System
Yt0
Yt1
Tool 1 Coordinate System
Xt1
b U in degrees
Xt0
Y a Tool 0 Coordinate System
122
Six Axis Tool Coordinate System
TlSet for 6-Axis robots
The origin of Tool 0 is the flange side of the sixth joint. When all joints are
at the 0 degree position, the Tool 0 coordinate system's X axis is aligned
with the robot coordinate system's Z axis, the Y axis is aligned with the
robot coordinate system's X axis, and the Z axis is perpendicular to the
flange face, and is aligned with the robot coordinate system's Y axis, as
shown in the figure below:
123
Six Axis Tool Coordinate System
TlSet for 6-Axis robots
124
What is a tool offset ?
Robot final joint Robot final joint
mounting surface center of rotation –
Tool 0
Tool Offset XY
Tool Tip
Tool Offset Z
The default tool is known as Tool 0. Tool 0 references the Joint 6 mounting
surface and center of rotation. Tools 1 – 15 are user tools and may have
individual offsets applied. User Tool offset values always represent an
Orthogonal offset using tool 0 as it’s reference position.
125
TLSET
(1) Bring up the Jog and Teach Window. Verify Tool 0 setting.
(10) Go to the
“Robot Manger >
Tools tab. Type
in the X Tool
Value and Y Tool
Value into the
“X” and “Y” text
boxes (for Tool
Number 1 for this
example).
Assign a value of
“0” for “Z” and
“U”. Close the
Robot Manager
dialog – apply
changes.
127
TLSET continued
Select the Tool #
128
TLSET continued
• Tools are not local to a project but rather stay with the robot
controller.
Example:
TlSet 1, XY(100, 0, 0, 0) 'Define tool coordinate
system for Tool 1 (plus ‘100 mm in x direction from hand
coordinate system)
129
Tool Command
• Tool Statement: Selects a tool definition.
TOOL toolNum
Where ToolNum is an integer number from 0-15
representing which of 15 tool definitions to use with the
upcoming motion instructions.
• TOOL selects the tool specified by the tool number
(toolNum). When the tool number is 0, no tool is
selected and all motions are done with respect to the
center of the U-Axis flange. However, when TOOL entry
1 – 15 is selected motion is done with respect to the
end of the tool as defined with the tool definition.
Example:
Tool 1 'Selects Tool 1 as defined by TLSet
130
Command Mode / Point
Manipulation
• Discussion:
• What does the Command window do
• Use Commands in the Monitor
Window:
– Motor On
– Slock
– Sfree
– Reset
– GO, Jump, Move
– On/Off
• Point Manipulation
• P*
• Here, Where
• Plist
• Math on Points
131
Command Mode
• The Command window
emulates an ASCII
terminal that
communicates directly
with the robot
controller. You can
execute SPEL
immediate commands
from this window and
view the results.
132
Command Mode
> SFree 1, 2
> SLock 1, 2
133
Working With Robot Points
• A robot point is a set of coordinates that define a
position in the robot work envelope.
• Each point in SPEL has four coordinates: X, Y, Z
and U. (Six axis robot additionally use V & W)
• X, Y and Z are specified in millimeters.
• U is specified in degrees.
• Points are referenced using the letter P followed by
an integer number or integer variable.
• You can configure one point file (.PTS) per project.
• The default number of points for each point file is
1000.
• A point can be a lefty (/L) or a righty (/R).
134
Working With Robot Points
• Defining points
– You can define points in a program statement, with the
Jog and Teach Tool, or at the Monitor Window.
– In a program statement or at the Monitor window, you
can assign coordinates to a point, or define a point that is
the current robot arm position.
For i = 0 To 10
Go pick
Jump place
Next
135
Teaching Point Arithmetically /
Alteration of points
¾ Moving to offset positions without changing the Teach Point values:
To set an absolute value for a coordinate, use a colon followed by the axis
letter and the value. To add a relative offset to a coordinate, use an axis
letter followed by the offset value or expression in parentheses. If the offset
is negative, then precede the axis letter with the minus sign.
136
Teaching Point Arithmetically /
Alteration of points
¾ Altering Teach Points with new values or offsets:
P33 = P33 / R ‘Sets P33 as righty arm orientation
¾ XY Function:
Returns a point from individual coordinates that can be used in a point
expression.
P10 = XY(60, 30, -50, 45) + P20
137
Teaching Point Arithmetically /
Alteration of points
¾ Here Statement:
Teach a robot point at the current position.
Here P1 ' Same as P1 = P*
Here pick ' Same as pick = P*
¾
Where Statement:
Returns current robot position in Command window.
>Where
¾
Plist:
Displays point data.
> plist 10 - 20
p10=160, 100, 0, 0
p12= 55, 340, 0, 0
p20= 50, 200, -100, -100
>
138
LIMZ
Specifies or displays the maximum Z axis height for the
JUMP command. This command can result in huge cycle
time savings when full Z axis retraction is not required.
Note: LimZ affects SCARA Robot Jump statement only.
Z=0
NOTE
Please also keep in mind to design your workcell such that
) your Z axis gets retracted as much as possible to ensure the
fastest motion velocity. 139
Pallet
• Discussion:
• What defines a pallet
• Using a pallet in a program
140
Pallet
P23 [P24]
10 11 12
4 5 6
1 2 3
P21 P22
141
Pallet
The following example transfers parts from pallet 1 to pallet 2.
Function main
Integer index
Pallet 1, P1, P2, P3, 3, 5 'Define pallet 1
Pallet 2, P12, P13, P11, 5, 3 'Define pallet 2
For index = 1 To 15
Jump Pallet(1, index) ’ Motion to point index on pallet 1
On 1 ’ Gripper ON
Wait 0.5
Jump Pallet(2, index) ’ Motion to point index on pallet 2
Off 1 ‘ Gripper OFF
Wait 0.5
Next
Fend
142
Lab #5
• Start a new project
• Be sure to:
– Label I/O
– Label Points
– Use FOR…NEXT
– Use Variables
– Use Jog and Teach Screen
– Use Monitor Window (Turn on and off I/O)
– Use I/O Monitor
– Use Jump
• Use a For...Next loop to de palletize and stack discs
• Use a For...Next loop to re palletize from stack
143
• Function Explanation
• Function Statement
• Call Statement
• Project Save, Save as
• Copy Project
• Boxes / Planes
• Lab 06
144
Function
A Function procedure is a series of Epson RC+
statements enclosed by the Function and Fend
statements. The Function procedure performs an
operation and then returns control to the calling code.
When it returns control, it may optionally return a
value to the calling code. (This is known as passing
parameters, this will be discussed and demonstrated
under the advanced topics section)
146
Function Statement
continued
ByRef Optional. Specify ByRef when you refer to the variable to be seen by the
calling function. In this case, the argument change in a function can be reflected to the
variable of the calling side.
ByVal Optional. Specify ByVal when you do not want any changes in the value of
the variable to be seen by the calling function. This is default.
varName Required. Name of the variable representing the argument; follows standard
variable naming conventions. If you use an array variable as argument, you should
specify ByRef. eg: Function Myfunc (MyVar As Integer) As Boolean
As typeRequired. You must declare the type of argument.
Return Values..
Value whose data type is specified with the As clause at the end of the function
declaration.
147
Function Statement
continued
Description
The Function statement indicates the beginning of a group of SPEL+ statements. To
indicate where a function ends we use the Fend statement. All statements located
between the Function and Fend statements are considered part of the function.
See Also
Call, Fend, Halt, Quit, Return, Xqt
148
Function Calls
• The Call instruction causes the transfer of program control
to a function (defined in Function...Fend). This means that
the Call instruction causes program execution to leave the
current function and transfer to the function specified by
Call. Program execution then continues in that function
until an Exit Function or Fend instruction is reached.
Control is then passed back to the original calling function
at the next statement after the Call instruction.
The following program file contains two function definitions.
Function Main calls function Func1.
MAIN.PRG
Function Main
Call Func1
Fend
Function Func1
Jump pickpnt
Fend 149
Saving a project
– Toolbar Shortcut:
150
Save As
Saves all files in the
current project to a
new drive and/or
project name. The
current project is
preserved. A copy of
the current project is
saved and opened on
the drive of choice.
Try to avoid using a
floppy drive as the
New Project Drive.
Use the Save As command in the Project Menu to save the current
project under a different name or drive. This command is useful
for making a test version of a project without making changes to
the original project
151
Making copies of projects
152
Boxes / Planes
• Box typically defines a cube shape within the robot work area.
When the robot tool is inside box the current box number bit
will be high. 153
Boxes / Planes
Box is used to set the approach check area. The approach check area is
for checking approaches of the robot end effector in the approach check
area. The position of the end effector is calculated by the current tool.
The approach check area is set on the base coordinate system of the
robot and is between the specified maximum and minimum X, Y, and Z.
When the approach check area is used, the system detects approaches
in any motor power status during the controller is ON.
You can also use InsideBox function to get the result of the approach
check. InsideBox can be used for wait condition of Wait command. You
can provide the check result to the I/O by setting the remote output
setting.
(2) Defines the approach check plane (XP coordinate) by specifying the
origin point, point along the X axis, and point along the Y axis. Uses the
X, Y, Z coordinates and ignores U, V, W coordinates. Calculates the Z
axis in righty and sets the approach checking direction.
Example:
Plane 1, P1, P2, P3
155
Lab #6
• Class Exercise
156
Debugger
• Discussion:
• Break Points
• Step
• Step into
• Step Over
• Resume
• Instant Watch
• Help (GUI)
157
Debugger
NOTE
A breakpoint is a marker, set at specified line of code that
) causes the debugger to suspend execution of the
program upon reaching that line of code. Breakpoints
help verify that a program is executing correctly.
158
Debugger
159
Debugger
Stepping through a program:
There are two commands on the Run
menu that are used for stepping through
code.
161
Debugger
Displaying variables:
• Select Display Variables
from the Run menu to
display the variable display
dialog. This dialog has four
tabs for viewing Global,
Preserved, Module, and
Local variables.
• You can change the value of
a variable by checking the
Edit check box, then type in
the new value in the value
column. Next, click the
Write button to change the
variable. When the Edit box
is checked, the variable
values are not automatically
updated. You can click the
Read button to update all
values.
162
Debugger
163
Help
165
robots.epson.com
Technical
Support Notes
and Hardware
Compatibity List
166
Debugging Lab #6
167
Motion Control and Optimizing
• Discussion:
• Power
High/Low
• Speed
• Accel
• Timers
168
POWER
169
SPEED
170
Acceleration
[Optional Modifiers]
Example is using optional modifiers, if optional modifiers are not used
the required values are used for accel and decel respectively.
171
Timers
• SPEL+ 6.x has 64 timers, TMR(0) - TMR(63)
• SPEL+ 5.x has 16 timers, TMR(0) - TMR(15)
172
Lab #7
173
Optimization
• Discussion:
• Arch Settings (GUI)
• LimZ Settings
• Fine Settings
• Weight Settings (GUI)
174
ARCH Example
10
40 P2
175
ARCH
• Moves the arm from the current position to the
specified destination point using point to point
motion by first moving in a vertical direction up,
then horizontally and then finally vertically
downward to arrive on the final destination
point.
• ARCH arch_num, Z_up, Z_down
• Use the JUMP C modifier to jump in an arch
motion.
179
Lab #8
180
Lab #9
181
Continuous Path
• Discussion:
• Arc
• Move
• CP on/off
• Speeds
• Accels
• Parallel Processing during motion
(i.e., !Dn!)
182
Continuous Path
183
SpeedS
184
Accels
185
Continuous Path
• MOVE Command:
Moves the arm from the current position to
the specified point using linear interpolation
(i.e. moving in a straight line). MOVE
coordinates all 4 axes to start and stop at
the same time.
186
Continuous Path
• ARC command:
187
Continuous Path (CP)
• Sets CP (Continuous Path) motion mode on or off.
• CP motion mode can be used for the Arc, Go, and Move
robot motion instructions. The CP parameter causes the
arm to move to the destination without decelerating.
This is done to allow the user to string a series of motion
instructions together to cause the arm to move along a
continuous path while maintaining a specific speed
throughout all the motion.
Example:
Function CornerArc
Go P100
CP On
Move P101 'Do not stop at P101
Arc P102, P103 'Do not stop at P103
Move P104 'Decelerate to stop at P104
CP Off
Fend
188
Curve
Curve Statement:
Defines the data and points required to move the arm along a
curved path. Many data points can be defined in the path to
improve precision of the path.
Syntax:
Curve fileName, closure, mode, numAxes, pointList
Closure: Specifies whether or not the defined Curve is Closed
or left Open at the end of the curved motion. This parameter
must be set to one of two possible values.
Mode: Specifies whether or not the arm is automatically
interpolated in the tangential direction of the U-Axis. 0 = No;
2 =Yes
numAxes: Integer number between 2-4 which specifies the
number of Axes controlled during the curved motion.
189
Curve
CVmove:
Performs the continuous spline path motion defined
by the Curve instruction.
Syntax:
• CVmove fileName [CP] [searchExpr]
file Name String expression for the path and name of the
file to use for the continuous path motion data. This file
must be previously created by the Curve instruction and
stored on a PC hard disk.
190
Parallel Processing During Motion
Parallel Processing During the Motion:
• Parallel processing commands are attached to motion commands
to allow I/O statements to execute simultaneously with the
beginning of motion travel. This means that I/O can execute
while the arm is moving rather than always waiting for arm travel
to stop and then executing I/O.
• The !Dn! modifier processes input/output statements in parallel
with motion. This command allows you to perform I/O operations
during the motion at predefined distances. “n” is a real number
between 0-100 which represents the position within the move
where the parallel processing statements (which follow the Dn
parameter) should begin. Statements which follow the Dn
parameter will begin execution after n% of the motion travel has
been completed.
For example,
MOVE P1 ! D10; On 5; Wait 0.5; OFF 5 !
Jump P1 ! D80; On 1 !
• When used with the Jump command, %travel does not include the
Z joint vertical motion. To execute statements after the Z joint
rising vertical motion has completed, include D0 (zero) at the
beginning of the statement.
191
Lab #10
192
Lab #10 / Pattern 1
193
Lab #10 / Pattern 1
194
Lab #10 / Pattern 2
195
Lab #10 / Pattern 2
196
Strings / Input & Msg Box
/ Select Case / Advanced
Editing
• Discussion:
• Basic string manipulation – including Chr$
(10 &13)
• Input Box
• Input Statement
• Select…Case
197
Working With Strings
198
Working With Strings
• The following table shows the string commands available in SPEL+ lite.
Keyword Description
Asc Returns the decimal ASCII value of the first character in a string.
Chr$ Converts an ASCII value into a one character string.
FmtStr Formats a numerical or date/time expression.
Hex$ Returns a string containing the hexadecimal value of a number.
InStr Returns the position of a substring within a string.
LCase$ Returns the specified string in lower case characters.
Left$ Returns a substring beginning with the first character of a string.
Len Returns the length (number of characters) of a string.
LTrim$ Returns the specified string with left spaces removed.
Mid$ Returns a substring of a string.
ParseStr Parses a string into an array of tokens.
Right$ Returns a substring from the end of a string.
RTrim$ Returns the specified string with right spaces removed.
Space$ Returns a string containing a specified number of spaces
Str$ Converts a number to a string.
String Declare a string variable in a program.
Trim$ Returns the specified string with left and right spaces removed.
UCase$ Returns the specified string in upper case characters.
Val Converts a string to a number.
199
Chr$
Chr$(number):
• Chr$ returns a character string (1 character) having the ASCII value of
the parameter number (range 1-255 ).
• The following example declares a variable of type String and then
assigns the string "ABC" to it. The Chr$ instruction is used to convert the
numeric ASCII values into the characters "A", "B" and "C". The &H
means the number following is represented in hexadecimal form. (&H41
means Hex 41)
Function Test
String temp$
temp$ = Chr$(&H41) + Chr$(&H42) + Chr$(&H43)
Print "The value of temp = ", temp$
Fend
NOTE
200
Line Input #
Line Input reads data from the display device and assigns the
data to a string variable used in the Line Input instruction. When
the Line Input instruction is ready to receive data from the user, it
causes a "?" prompt to be displayed on the display device. The
input data line after the prompt is then received as the value for
the string variable. After inputting the line of data press the
[ENTER] key.
Function Main
String A$
Line Input #21 A$ 'Read one line input data into RC+ A$
Print A$
Fend
Common input ports:
#21 = data stream RC+ (typically from keyboard)
#24 = data stream TP1 (Teach Pendant)
201
Input Statement
202
Select…Send
Example:
Function Main
Select…Send:
Integer I
Specifies branching formula
and corresponding branch
For I = 0 To 10
instruction sequences. Select I
Case 0
Select formula Off 1;On 2;Jump P1
Case item; statement Case 3
. On 1;Off 2
.
Jump P2;Move P3
Case item; statement
[Default; statement ] Case 7
Send On 4
Default
On 7
Send
Next
Fend
203
Select…Send
• If any one Case item is equal to the Select
formula result, that Case item statement
is executed. After execution, program
control transfers to the command
following Send. (Select End)
• If no Case item is equivalent to the Select
formula result, the Default statement is
executed and program control transfers to
the command following Send.
• If Default is omitted, nothing is executed
and program control transfers to the
command immediately following Send.
• The Select formula may include constants,
variables, variable formulas, and logical
operators that use And, Or and Xor.
• The Case item may include constants and
variables. Case item statements may also
be multi-statements or multiple line
statements.
204
Lab #11
205
Variable Scope
• Discussion:
• Global Variables
• Module Variables
• Local Variables
• Global Preserve Variables
206
Variable Types and Variable
Scope
• There are 3 different scopes for variables in SPEL+ (Local,
Module and Global)
– Local Variables can only be used within the function in
which they were declared
– Module Variables are declared within a specific .PRG file
but prior to any function thus allowing those variables
to be used by all the functions within the .PRG file
– Global Variables are accessible from any function. They
are also accessible from the monitor mode
Global Variables:
208
Global Preserve Variables
• You can preserve global variable values by using the optional
Preserve parameter when you declare global variables.
Example:
209
Multitasking
• Discussion:
• What is it?
• Discuss time slice
• Explain the Task Manager, its features
and its usefulness
• Explain the XQT command in its most
basic form
• Explain the Quit command
210
Multitasking
– For some applications, you may want to
control other equipment besides the
robot, such as a conveyors, pick and
place units, etc. By using multi-tasking,
you can control this other equipment
with their own tasks.
– SPEL+ supports up to (6.x) 32 tasks,
(5.x) 16 tasks running simultaneously.
A task is the same as a function in
SPEL+.
– Use the Xqt statement to start another
function (task) from within a function.
You can optionally specify a task number
in the Xqt statement.
211
Multitasking
One example for starting another task is to run
a conveyor system for the robot work cell.
216
5.x Task Manager
The Task Manager dialog box allows
you to Halt (suspend), resume, and
Quit (abort) tasks.
– When Task Manager is started, you
will see a grid containing status
information for 16 tasks. There are
six items shown for each task: Task
Number, Task Name, Status, line,
Function, & Start time.
– Task Number or Trap
– Name Name of the function
that was started as a
task.
– Status Current task status:
Run, Waiting, Halt,
Pause, Quit, Step.
– Line Currently executing line
number
– Function Function name
– Program Program name
– Start Start time
217
Task Manager
To Halt, Step, and Resume a task:
– Use the mouse to click on the desired
task in the task list. You can click on
any field to select a task. The current
task status must be Run before it can
be halted. The Halt button will become
active after you have selected the task.
– After a task has been halted, the
source code will be displayed and
the next Step will be indicated. You
can either click on the Resume button
to resume execution, or executed Step
Into or Step Over from the Run menu..
To Pause and Continue tasks:
– Pause allows you to "suspend" all tasks
where pause is enabled.
– Click on the Pause button to pause
tasks for which pause is enabled. The
robot will decelerate to a stop
immediately.
– After executing Pause, click on
Continue to resume all suspended
tasks.
• Step into (F11) is a source code level debugging feature. 218
Task Manager
Option Description
Halt Suspends the selected task. This temporarily stops the task so
that it can be started again with the Resume button. Halt can
only be executed when a task is running (status is Run). When
Halt is executed, the Resume button will be enabled. If a
motion command is executing with Halt occurs, the motion will
be completed before the task reaches the Halt state.
Resume After one or more tasks have been suspended with the Halt
button, clicking on Resume will make the halted tasks continue
where they left off.
Quit This stops the selected task permanently. You cannot Resume a
task once you have executed Quit. To restart the task, you must
start it from within a program or from the Run window.
Pause This pauses all tasks that have pause enabled. After pause, you
must use either Continue or Abort All.
Continue This button continues all tasks that were paused with the Pause
button.
Stop This button aborts all tasks.
219
Lab #12
220
DAY 3
221
Additional IO Commands
In Function:
Returns the status of the specified H/W Input port. Each port
contains 8 H/W Input channels.
Syntax: In(portNumber)
where “portNumber” is between 0 - 63 representing one of the
64 input ports. Each port contains 8 input bits making a total of
512 H/W input channels. The return value is an integer value
between 0-255. The returnvalue is 8 bits, with each bit
corresponding to 1 H/W Input channel.
Example:
Assume that the Input channels 1, 5, 15, and 30 are On. All
other H/W Inputs are Off.
> print In(0)
34
> print In(1)
128
> print In(2)
0
> print In(3)
64
222
Additional IO Commands
Binary bit value to decimal equivalent representation
128 64 32 16 8 4 2 1
Port
7 6 5 4 3 2 1 0
0
Port
15 14 13 12 11 10 9 8
1
Port
23 22 21 20 19 18 17 16
2
• If bit 23 was high what would be the value of port 0 & port 2?
223
Additional IO Commands
Out Statement:
Simultaneously sets 8 H/W output bits.
Syntax: Out portNumber, outData
• where “portNumber” is an integer between 0 and 63
representing one of the 64 output groups (each group contains
8 outputs) which make up the standard and expansion H/W
outputs. “outData” is an integer number between 0-255
representing the output bit pattern for the output group
selected by “portNumber”.
Example:
> Out 1,6 'Turns on Outputs 9 & 10
> Out 2,1 'Turns on Output 16
> Out 3,145 'Turns on Outputs 24,28 & 31
Out Function:
Returns the status of one byte (8 bits) of outputs.
Syntax: Out(portNumber)
where “portNumber” is an integer expression between 0 and 63
representing one of the 64 output groups (each group contains
8 outputs) which make up the standard and expansion H/W
outputs.
Example:
Print Out(0) 224
Additional IO Commands
Oport Function:
Returns the state of the specified H/W output.
Syntax: Oport(outnum)
where “outnum” is a number between 0-511 representing
one of the standard or expansion discrete H/W outputs.
Example:
> On 1
> Print Oport(1)
1
> Off 1
> Print Oport(1)
0
>
225
Multitask Control Structures
• Discussion:
• Memory I/O Purpose
• Memory I/O Labeler
• Memory I/O Monitor
• Commands associated with Memory
I/O
226
Memory I/O
• There are 1024 memory I/O. You can think of a
memory I/O as an internal relay in a PLC. Memory I/O
is used like I/O but is not physical hardware. You can
use it to coordinate/handshake/synchronize tasks or
certain events in the code. The MemSw instruction is
used to check the current state of the specified
memory bit. The MemOn instruction turns the memory
bit On, the MemOff instruction turns it Off.
For example,
227
Memory I/O Label Editor
228
Memory I/O Monitor
• The Memory I/O monitor
is very similar to the I/O
monitor. The Memory I/O
Monitor dialog lets you
monitor memory
input/output bits on the
robot controller. The
dialog is organized so that
32 memory I/O points are
displayed on each page.
229
Memory I/O Commands
230
Memory I/O Commands
MemON/MemOFF/MemSW(#):
• MemOn 1 turns ON (sets to 1) the specified bit of the robot memory
I/O. The 1024 memory I/O bits are typically used as status bits for
such things as TRUE/FALSE, FINISHED/NOT FINISHED, etc.. The
MemOn instruction turns the memory bit ON, the MemOff instruction
turns it OFF, and the MemSw instruction is used to check the current
state of the specified memory bit. The WAIT instruction can also be
used with the memory bit to cause the system to wait until a
specified S/W status is set.
Example:
MemOn 1
Wait MemSW (1)
Wait MemSW(done)
231
Memory I/O Commands
MemIn(#):
• MemIn provides the ability to look at the value of 8 S/W
memory I/O channels at the same time.
Example:
var1 = MemIn (0) 'Get 1st 8 S/W I/O values
MemOut:
• MemOut simultaneously sets 8 S/W memory outputs
using the combination of the portnum and outdata
values specified by the user to determine which outputs
will be set. The 1024 S/W memory outputs are broken
into 64 groups of 8.
Example:
MemOut 1,1 'Turns on memory bit 8
232
Lab #13
• Build on lab #12
• Modify program to run first 8 outputs, wait for
memory flag change from main task.
• Then continue through the remaining outputs.
• This labs demonstrate Controlled Multitasking
be sure to include:
– Wait MemSw(#)
– Memory label names
– Verify condition of memory I/O (Mem I/O
Monitor)
233
Advanced Point Manipulation
and Control
• Discussion:
• Import
• C(x), C(y), C(z), C(u)
• Till Command
• Sense Command
• Tw, Js
• Exit
• GUI Run Program Options
234
Importing Files
•Import a file into the
current project. Use this
command to import
programs, points, labels,
etc. from other EPSON RC+
projects.
•Program file names for
importing must have a .PRG
extension. Program files.
•Include file names for
importing must have a .INC
extension. Include files.
•Point file names for
importing should have a
.PTS extension.
•I/O labels should have the
file name IOLABEL.DAT.
•User errors should have
the file name
•Note: If you need to import files from previous versions of USERERRORS.DAT.
EPSON RC+ or from SPEL for Windows 2.0, you must first •Macros should have the
import the project using Project | Import, which converts .MAC extension.
the point files and label files into EPSON RC+ formats. Then
you can use File Import to import the desired files. 235
Project Import
236
TILL Command
Specifies and displays input condition that, when satisfied,
terminates the (JUMP, GO, or MOVE) motion command in
progress by decelerating and stopping the robot arm.
Example:
FUNCTION my_till
TILL SW(1) = 1
JUMP 3 Here –TLZ(20) P1-TLZ(10) P1-TLZ(10)
GO P1 TILL
FEND
TillOn Function Example
Go P0 Till Sw(2) = On
If TillOn Then
Print "Till condition occurred during motion to P0"
EndIf
237
Sense
Input Checked
238
Exit Statement
Exit Statement:
Exits a loop construct or function.
Syntax:
Exit { Do | For | Function }
Example -
For i = 1 To 10
If Sw(1) = On Then
Exit For
EndIf
Jump P(i)
Next i
239
Sense & Till Example
FUNCTION test
JUMP P1 C2 SENSE
IF JS = 1 THEN ‘If the robot stopped above the tray then
WAIT SW(trayPres)=1 ‘wait for tray shuttle into position
ENDIF
GO P1 TILL ‘Completes the motion till
If Tillon then
Print “Part not positioned, terminating operation”
Exit Function
Endif
FEND
240
Example of Multitasking with
Memory I/O and the Sense
Command
This example performs the following -
241
Example of Multitasking with
Memory I/O and the Sense
Command
Function main Function bowlFdr
MemOff partPres
Motor On
Do while MemSw(Cycle)
Sense MemSw(partPres)=0 If Sw(sensor)=0 then
Xqt bowlFdr On Bowl
Do While MemSw(Cycle) End If
Jump Pick Sense Wait Sw(Sensor)=1
Off Bowl
If Js=1 then
MemOn partPres
Wait MemSw(partPres)=1 Wait MemSw(partPres)=0
Go Pick Loop
End If Fend
On Grip
Jump Place!D10;MemOff partPres!
Off Grip
Loop
Fend
242
TW Function
TW Function:
• Returns the status of the WAIT condition.
243
CX, CY, CZ, CU Statements
CX, CY, CZ, CU Statements:
• Sets the coordinate of a point.
Example -
CX(pick) = 25.34 ‘ Sets the X coordinate for point “pick”
244
Lab #14
• Start New Project
• Import point file from Lab 13
• Create simple pick and place program
• Use the hardware sensor to initiate the program,
with specified delay TW
• Use the hardware sensor to monitor for sense
condition
• Analyze Js as If Then condition (Pallet Arrived?)
• If point achieved Then Print message, Else Exit
Function
• Be sure to include:
– If Then Else
– Wait SW()
– If JS then
– If TW
245
GUI Explanation and Usage
• Robot Manager
• Setting up program environment,
and preferences
• Project Properties
• Auto Mode
• Remote
• Macro usage
• Help Manuals
• Discussion:
246
Robot Manager (continued)
Tab Description
Arch Configure the rising Z and
falling Z settings in the Arch
table
247
Robot Manager (continued)
Tab Description
Locals Defines local Coordinate system
within the base coordinate
system. Local wizard helps create
locals for you. 248
Robot Manager (continued)
Tab Description
Tools Manually defines rotational tool
offsets from the center of the
ballscrew spline unit. The tool
wizard also assists the user in tool 249
offset creation.
Robot Manager (continued)
Tab Description
Arms Manually defines a non rotational
offset from the center of the
ballscrew spline unit..
250
Robot Manager (continued)
Tab Description
ECP Defines External control point.
251
Robot Manager (continued)
Tab Description
Boxes Box is used to set the approach check area. The approach check area is
for checking approaches of the robot end effector in the approach check area. The
position of the end effector is calculated by the current tool. The approach check
area is set on the base coordinate system of the robot and is between the
252
specified maximum and minimum X, Y, and Z.
Robot Manager (continued)
Tab Tip
Planes - EPSON RC+ 6.0 has a point and click dialog box for defining the
approach check plane. The simplest method to set the Plane values is by using the
Plane page on the Robot Manager .
253
Robot Manager (continued)
Tab Description
Weight Applies weight and physical offset
parameters for acceleration
optimization.
254
Robot Manager (continued)
Tab Description
Inertia Applies load inertia setting in
parameters for acceleration
optimization. Units are kgm²,
please see your applicable robot
255
manual for specific detail.
Robot Manager (continued)
Tab Description
XYZ Limits Defines soft limits for base
coordinate system 256
Robot Manager (continued)
Tab Description
Range Defines individual joint pulse limits.
Defaults settings are based on
257
robot model selection.
Robot Manager (continued)
Tab Description
Home Config Defines individual joint pulse locations
for home position. HOME order defines
joint motion priority. 258
SystemStart
Configuration
Mode:
Description
Item
Compiler [Default] is the normal setting. When the projects cannot be built
Version by adding keywords, you can select the compatible version to build
the projects. Specify the controller version that operates the
project.
Strict Check the Boolean type strictly.
Compile When Strict Compile is checked, you cannot assign integer values
to Boolean variables. 262
Project Properties
263
Project Properties
265
Project Properties
266
Project Properties
267
Project Properties
269
5.x Remote Settings
The Epson RC+ system can be controlled by external equipment using Remote
Control. The remote equipment can execute several commands, including
Motor On/Off, Start, Pause, Continue, Abort, Select Program ..etc
270
Macros Command (Tools Menu)
271
Task Control and Management
• Discussion:
• XQT, Pause, Quit (How and When to
use)
• Halt, Resume
• Continue, Abort
• Remote Start Setting
• Go To
272
Task Control and Management
273
Associated Multitasking
Commands
The table below shows the program instructions that are used for
multitasking.
– Statement Purpose
274
Task Control and Management
Function Cycle
Integer i
For i = 1 To 5
Jump pick
Function main On vac
Xqt flash 'Start flash function as task 2 Wait .2
Xqt Cycle 'Start Cycle function as task 3 Jump place
Do Off vac
Wait 3 'Execute task 2 for 3 seconds Wait .2
Halt flash 'Suspend the task Next i
Wait 3 Fend
Resume flash ’Resumes the task Function flash
Loop Do
Fend On 1
Wait 0.2
Off 1
Wait 0.2
Loop 275
Fend
Task Control and Management
This example shows tasks terminated by watchdog input.
Function winc1
Function main Do
Xqt winc1 'Start winc1 function
On 1; Wait 0.2
Xqt winc2 'Start winc2 function
Xqt watchdog ‘Start watchdog Off 1; Wait 0.2
Fend Loop
Fend
Function watchdog
Wait sw(1)=1 ‘wait for signal
Function winc2
Quit winc1 'Terminate task winc1
Quit winc2 'Terminate task winc2 Do
Off 1 On 2; Wait 0.5
Off 2 Off 2; Wait 0.5
Fend Loop
Fend
276
Task Control and Management
Function Main
Xqt SubTask1
Xqt SubTask2
Wait 1
Signal 1 (Signal range is 0 to 63)
Fend
Function SubTask1
WaitSig 1
Print ”Signal received in SubTask1"
….
Fend
Function SubTask2
WaitSig 1
Print ”Signal received in SubTask2"
….
277
Fend
Lab #15
278
Trap
• Discussion:
• Traps, all types listed
279
Traps
Defines interrupts and what should happen when
they occur. The interrupt occurs when the input
condition is satisfied. There are several types of
traps. Four traps are user defined and are triggered
by an input condition.
280
Traps
Conditions:
This condition must return a value
of (1) or (0). The following
functions and operators may be
used in the input condition:
281
Traps
• Traps are used to cause program
execution to branch to a label or enable a
function to be called or executed as a
task when a certain event occurs. Four
traps are user defined and are triggered
by an input condition.
282
Trap
Defines interrupts and what should happen when they occur.
With the Trap statement, you can jump to labels or XQT functions
when the event occurs.
Syntax Usage
283
Trap (System Status 6.x)
Parameters
Conditions:
This condition must return a value
of (1) or (0). The following
functions and operators may be
used in the input condition:
286
Trap
• Traps are used to cause program
execution to branch to a label or enable a
function to be called or executed as a
task when a certain event occurs. Four
traps are user defined and are triggered
by an input condition.
287
Trap Example
Function main
' Arm the trap below:
• Here is a simple Trap 1 Sw(1) = On Xqt Sw1Trap
trap example. In
this example, when Do
input 1 turns on, RunCycle
the Sw1Trap Loop
function executes
as a task. Fend
Function Sw1Trap
' Turn on output 1 for 2 seconds
On 1, 2
' Wait for trap condition to clear
Wait Sw(1) = Off ‘Wait until bit is off
' Rearm the trap
Trap 1 Sw(1) = On Xqt Sw1Trap
Fend
288
Lab #16
289
System History
292
Error Handling
Function Main
Example: Integer i, enum
String value$
The following example OnErr GoTo Errhandler
shows a simple error Do
For i = 1 To 10
handling routine. Jump P0
When an error occurs, Next
Jump P1
296
Local / Base
Local Statement
• Defines and displays local coordinate systems.
• Syntax:
Local localNumber, ( pLocal1 : pBase1 ), ( pLocal2 : pBase2 ), [ { L | R } ], [ BaseU ]
• Parameters
• localNumber: The local coordinate system number. A total of 15 local coordinate
systems (of the integer value from 1 to 15) may be defined.
• pLocal1, pLocal2: Point variables with point data in the local coordinate system.
• pBase1, pBase2: Point variables with point data in the base coordinate system.
• L | R: Optional. Align local origin to left (first) or right (second) base points.
• BaseU : Optional. When supplied, U axis coordinates are in the base
coordinate system. When omitted, U axis coordinates are in the local
coordinate system.
297
Local / Base
Description
(1) Local defines a local coordinate system by specifying 2 points, pLocal1 and pLocal2,
contained in it that coincide with two points, pBase1 and pBase2, contained in the base
coordinate system.
Example:
LOCAL 1, (P1:P11), (P2:P12)
P1 and P2 are local coordinate system points. P11 and P12 are base coordinate system
points.
If the distance between the two specified points in the local coordinate system is not
equal to that between the two specified points in the base coordinate system, the XY
plane of the local coordinate system is defined in the position where the midpoint
between the two specified points in the local coordinate system coincides with that
between the two specified points in the base coordinate system.
Similarly, the Z axis of the local coordinate system is defined in the position where the
midpoints coincide with each other.
298
Local Exercise
299
Introduction to Advanced Topics
Functions:
•Functions can pass parameters by value or by reference. Parameters are
passed ByVal by default.
•Functions can return values. When returning values, the function name
is assigned the value that is to be returned.
NOTE
)
By reference: A way of passing the address, rather than the value,
of an argument to a function. This allows the function to access the
actual variable. As a result, the variable’s actual value can be
changed by the function to which it is passed.
By value: A way of passing the value, rather than the address, of a
argument to a function. This allows the function to access a copy
of the variable. As a result, the variable’s actual value can not be
changed by the function to which it is passed.
300
Introduction to Advanced Topics
Discussion Topics:
• MyParam$
• MyReturnVal
301
Introduction to Advanced Topics
Function main
String myParam$
Integer myReturnVal
myParam$=“Hello”
myReturnVal=test1(myParam$)
Print “Return value is”, myReturnVal
Print “myParam$=“, myParam$
myReturnVal=test2(ByRef myParam$)
Print “Return value is”, myReturnVal
Print “myParam$=“, myParam$
Fend
302
Introduction to Advanced Topics
Function test1(comment$ as String) as Boolean
comment$=“Good Bye”
test1=True
Fend
Return value is -1
myParam$= Hello
Return value is 0
myParam$= Good Bye
303
Introduction to Advanced Topics
BTst
Returns the status of 1 bit in a number.
Syntax
BTst (number, bitNum)
Parameters
number Specifies the number for the bit test with an
expression or numeric value.
bitNum Specifies the bit (integer from 0 to 31) to be tested.
Return Values
Returns the bit test results (integer 1 or 0) of the specified
numeric value.
See Also
BSet 304
BClr
Introduction to Advanced Topics
BTst
Function CheckInputStartState
Integer a, b(8)
For a = 0 To 7 ‘------------
b(a) = BTst(In(1), a) ‘Checks input bits 8 thru 15.
Print b(a) ‘
Next ‘------------
If BTst(In(1), 5) And BTst(In(1), 6) And BTst(In(1), 7) = 1 Then
Print "Peripheral Devices Ready, OK to start"
Else
Print "Peripheral Devices Not Ready"
EndIf
Fend
For / Next example, each individual bit state is printed for the selected
port, in this case, In (1). The 8 values return the binary state.
305
Introduction to Advanced Topics
Serial Communications:
OPTIONAL
OpenCom #1
Print #1, "Send"
Line Input #1, response$
CloseCom #1
306
Introduction to Advanced Topics
Using points in a program:
When running programs, the default point file
for each robot is loaded at start up. You can
also define points in the program, or load
them using the LoadPoints statement.
Function main
Integer i
LoadPoints "model1.pts"
For i = 0 To 10
Go pick
Jump place
Next i
307
Introduction to Advanced Topics
Saving and Loading Points:
– Use LoadPoints to load a point file for the
current robot. You can optionally specify
the Merge parameter to combine points in
a file with points that have already been
loaded. You cannot load a point file from
a different robot than is currently active.
– Use SavePoints to save the points for the
current robot. If the point file is not in the
current project, it will be added
automatically.
For i = 1 To 10
P(i) = i, 100, 0, 0
Next i
SavePoints "TEST.PTS"
308
Introduction to Advanced Topics
CurPos Function:
Returns the current position of the specified
robot.
Example -
Function main
Xqt ShowPosition
Do
Jump P0
Jump P1
Loop
Fend
Function ShowPosition
Do
P99 = CurPos
Print CX(P99), CY(P99)
Loop
Fend
309
Introduction to Advanced Topics
Preprocessor Directives:
A preprocessor directive tells the compiler to do
something before compiling the program.
310
Introduction to Advanced Topics
Optional:
GUI Builder
• Allows user to create GUI entirely from RC+ Environment
• Created for simple GUI’s (advanced GUI dev should use VB
Guide)
• Greatly reduces effort to create & debug GUI for EPSON
Robot Systems
• Create and Debug GUI Forms from within RC+ Environment
• Many standard controls provided: button, label, textbox, etc.
• Specialized controls like: video display, variable status, I/O
status
• Automatically display main form at startup
311
Introduction to Advanced Topics
Optional:
Vision Guide
– Easy to use point and click interface
– Wide range of vision tools - correlation,
blob, polar, image filters, lines, points,
frames, Bar Code Reading (6.x only).
– Vision Objects are created, values set,
and the associations between objects
practically eliminates program code
– Point and click, step through procedure for
camera to robot calibration for vision
guided applications
312
Introduction to Advanced Topics
Optional:
Conveyor Tracking (6.x only)
– Multiple conveyors and robots.
– Easy point & click calibration procedure
– May use vision or discreet input signal
314
Introduction to Advanced Topics
Optional:
Fieldbus IO
– Supports EthernetIP, DeviceNet,
Profibus-DP, ProfiNet (5.x) & CC
Link Fieldbus protocols.
– May be configured as:
– 1st CPU master on (6.x) or
– 2nd CPU slave (6.x) & (5.x).
315
Introduction to Advanced Topics
Optional:
PG Motion System
– The PG (Pulse Generator) Motion System
option enables you to create robots that
use third party drives and motors. PG
robots can co-exist with and behave
similar to standard robots in the EPSON
RC+ system. Use PG robots to control
auxiliary equipment such as XY tables,
slides, rotary axes, etc.
316
Thank you for your interest
in EPSON Robot training.
317