0% found this document useful (1 vote)
1K views318 pages

Manual Básico Epson RC 7.4 y SCARA T3 PDF

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
1K views318 pages

Manual Básico Epson RC 7.4 y SCARA T3 PDF

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 318

EPSON RC+

Programming and Operations


Training Class Handouts
SPEL+ Language

SPEL+ Language JULY 2012


DAY 1 AM

SPEL+ Language JULY, 2012

©2012 EPSON AMERICA INC All rights reserved

1
Orientation

• Customers Names, Companies ,Customers Applications


• Building Layout , Bathrooms, Break Room
• Document Handouts
• Pens, Pads, Books
• Class hours
• Customer Applications
• Roster
• Emergency Exits and Recycle Policy

2
Recycling Guide

Epson West maintains our registration to the ISO 14001


Environmental Management System Standard and one of the
requirements of this Standard is that we set environmental
objectives and targets concerning our most significant
environmental aspects of this facility. One of the most significant
aspects of this facility is our packaging and paper use, which has an
environmental impact on landfills. Because of this, one of our
objectives is to reduce solid waste by recycling.

We recycle the following items at this facility:

™ Cardboard ™ Wood Pallets


™ Paper Cups ™ Metal Pallets
™ Mixed Paper ™Aluminum Cans
™ Plastic Bottles ™Glass Bottles
™ Ink Cartridges ™Stretch Wrap
™ Plastic Strapping

3
Recycling Guide

Definitions:

Mixed Paper- colored paper, carbon-less multi-part paper, Paper ream


covers, chip-board (thin white cardboard) and any paper that has a finish or
gloss on it.

Chipboard (thin cardboard)- commonly found packaging our ink cartridges.


If you rip it, and the inside is white, not brown or gray, this type of
chipboard gets recycled with the mixed paper. If it’s brown or gray, then it
gets recycled with cardboard.

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

(16) Model & Control Unit Serial no. Mfg. data


and other information.
(17) MT – Custom Manipulator Setting

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

• “Low Cost, High Performance”


Controller

• PLC Slave (RC180 is driven by PLC)


– DeviceNet, Profibus DP, Profinet, CC-Link,
Ethernet IP or Internal discreet IO.
– Remote Execution Possible from Ethernet
(LAN) or Serial (RS232C) port.

• Stand Alone (No PC required at runtime)


– Programmed by RC+ but then can run on
it’s own with OP1 or as Remote Device.
– Can connect RC+ “while running”

ƒ Programming environment EPSON RC+ • Driven by PC


5.x - SPEL+ Language – VB Guide is supported (Microsoft .NET
component)
ƒ PC to RC180 communication links –
USB or Ethernet (LAN)

ƒ Simulation Package Included !


14
RC180
System Example

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)

RS-232C port 1 port

Input: 24 per board Addition of


Expansion I/O
Output: 16 per board 2 boards allowed

RS-232C : 2ch per Addition of


Options board 2 boards allowed
(Max. 2 slots) Communication Fieldbus I/O: 1ch per
interface board.
Addition of
PROFIBUS-DP
1 board allowed
DeviceNet
CC-Link

23
(9) (4) RC90 (19)

(Left side)
(5) (1)
(6)
(7) (3) (20)
(8)
(2)
(18)

(20) (10) (11) (12) (13) (14) (15) (16) (17)

1. Power Switch 8. Connection Check Label 15. Memory Trigger


2. AC in 9. MC Power (Motor power) 16. LAN
3. LED 10. MC Signal (Position) 17. IO Connector
4. Fan Filter 11. Emergency / Safety 18. RS232C
5. Signature label 12. Teach Pendant (TP2) 19. Option Slots (2)
6. MT Label 13. PC Connection 20. Cable Clamp x 2
7. Controller S/N 14. Memory (Controller Status) 21. Battery (inside chassis)

24
RC90 & LS Robot Connection

LS3 series Manipulator


(LS3-401S)

RC90 Controller

M/C Power Cable

M/C Signal Cable


25
Robot Safety Precautions
• Always be aware of the robot
• Using the E-Stop
• Never approach robot envelope when in motion
• Always use (activate) E-Stop when entering work envelope
• When Servos are energized, know the point of control, and power
setting

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 status of robot power is explained below in terms of restriction to operation:

Operation-prohibited status: Robot cannot be operated.


Restricted (low power) status: Robot can operate at low speed and low torque.
Unrestricted (high power) status : Robot can operate without restriction.

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

There is a safeguard input circuit in the


EMERGENCY connector on controllers
that connect with the safety device
WARNING interlock switch. In order to protect
people working with the robot be sure that
the interlock switch is connected and
working properly.

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 closed: Robot can automatically operate in unrestricted (high power)


status.

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:

• The safeguard circuit is closed.

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

Condition Teach Mode Off Teach Mode On


Robot can move under
Safeguard Closed program control at any
Robot can only move at
speed.
slow speed when 3 position
Robot will come to a enable switch (dead-man) is
controlled stop if moving. engaged.
Safeguard Open Motors are turned off.
Robot motion can not be
initiated.

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.

Additionally, when the operation mode is switched or reset, the system


automatically returns to restricted (low power) status.

The table below shows the relationship between safeguard and power
mode.

Safeguard Power Mode Explanantion


Status Low High
Cannot operate
All robot operation All robot operation
Open is prohibited is prohibited
robot when
safeguard is open.
Restricted (low Unrestricted (high Can shift to high
Closed power) status for power) status for power status in this
specified robot specified robot case only.
31
Robot Safety
Emergency Stop

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.

The path that the robot will follow


from the time the emergency stop
switch is pressed until the device
stops, as well as the stop position
itself, cannot be positively
determined. In many cases, the
stop position will not exceed the
target position for the operation
CAUTION prior the emergency stop.
Depending on the robot’s payload
condition and operation speed,
overruns are inevitable. Taking this
into consideration,
be sure that peripheral equipment
layout includes adequate
clearance.

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.

This point, center of the


Theta 1 is coordinate X=0,Y=0

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

RS series robots have


one Brake Release
Button for Joint 3. Do
not forcibly move Joint
3 manually without
pressing Brake release
button first. Note:
Controller power must
be on for brake release
circuit operation.

Z axis Brake Release Button

This point, center of the


Theta 1 is coordinate X=0,Y=0

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

This point, center of the


Theta 1 is coordinate X=0,Y=0

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

Axis Brake Release Button

EZ Modules have one


Brake Release Button
for applicable joint Origin
with optional brake. +Y
Do not forcibly move
Joint with optional
brake manually +X
without pressing Brake
release button first.
Note: Controller power
must be on for brake
release circuit
38
operation.
Six Axis Series Robot C3 Shown

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

• The X, Y, and Z coordinates of a point are specified in


millimeters.

• The Z coordinate value can be zero or negative. (SCARA)


• The U coordinate specifies the position of the wrist axis in
degrees.
• Points are referenced using the letter P followed by an
integer number or integer variable or by a label defined in
the point file editor or jog and teach dialog

• Pro Six only


• The Z coordinate value may be positive or negative
(ProSix)
• The U, V & W values specifies the position of the wrist axis
in degrees for ProSix robots.

42
Robot Points

Teaching Robot Points


If possible, teaching should be performed with no personnel
inside the safeguarded area.
Teach mode can be used to allow the robot to be jogged or
moved at slow speed when the safeguard is open. Before going
inside the safeguarded area, robot operators that need to move
the robot under servo control must switch Teach mode to ON
by using the mode selector switch of the optional device.
Operators then carry the optional device while inside the
safeguarded area. As a result, the operation mode cannot be
changed from outside the safeguarded system while somebody
is inside the safeguarded area.
Teach Mode OFF (Auto)
The robot cannot be jogged under power with the safeguard
circuit open and the motors will be turned off. However, the
robot can be moved by hand to a position with the safeguard
circuit open and the position can then be taught.
Teach Mode ON (Teach)
The robot can be jogged or moved at slow speed as long as
the three-position enable (dead man) switch is engaged.

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
.

New Point Verification


Always verify reprogrammed teach coordinate
locations in low power before returning the
system to full (High Power) production velocity.
NOTE
When verifying the robot system operation, always
) prepare for failures with initial settings or wiring. If
the Manipulator functions unusually with modified
settings press a predetermined switch immediately
to stop the Manipulator to help prevent obstruction
contact.
If low power verification is not possible, it is
suggested to run verification with no end of arm,
tooling, fixtures and parts. Ensure no obstructions
within the robot design or application
extended/restricted work envelope could possibly
cause bodily harm and or physical damage upon
automatic motion execution to corrupt or
incorrectly trained point location data.

45
TP1

(1) Teach / Auto Key switch (6) Enable Switch


(2) Emergency Switch (7) Handle
(3) Display
(4) Operation Panel
(5) Connection Cable 46
TP1

•For further information please refer to the RC620 Controller Manual 47


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” )

This example shows use in Command Mode.

We will talk more about this command as


class progresses

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

4. Run the program


Press F5 to run the program. (F5 is the hot key for the Start selection of the
Run menu). You will see the Project Build Status window showing the build
operation.
Your program is compiled and loaded into memory. If there are no errors
during build, the Run window will appear.
Press the Start button on the Run window to run the program.
You should see the following displayed on the run window:
-> main started as Task 1
This is my first program.
-> All Tasks Stopped
Now let's teach some robot points and modify the program to move the robot.

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:

Function main ‘For SCARA


Print "This is my first program."
Jump P1 ‘SCARA ONLY
Jump P2 ‘SCARA ONLY
Jump P0 ‘SCARA ONLY
Fend
Function main ‘For Six Axis
Jump 3 Here –TLZ(25) , P1 –TLZ(25), P1 ‘Six Axis
Jump 3 Here –TLZ(25) , P2 –TLZ(25), P2 ‘Six Axis
Jump 3 Here –TLZ(25) , P0 –TLZ(25), P1 ‘Six Axis
Fend
Lab 1
Writing Your First Program
Run the program by
pressing F5 or click
the icon, then
click on the Start
button on the Run
window. The robot
should jump to each of
the points you taught.

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.

Motor On command initializes the following items:

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)

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

SFree Sets Some System Items back to Their Initial State:


SFree, for safety purposes, initializes parameters concerning the
robot arm speed (Speed and SpeedS) ( acceleration (Accel and
AccelS) and the LimZ parameter.
***Not a valid Six Axis robot command***
65
Brake Off / On
> Brake On, 1
> Brake Off, 1

66
Keyword discussion

Certain commands in our programming environment may be used


as Statements and Functions. When using a command as a
statement, typically the user or developer is executing Controller
/Robot action. A simple example would be the use of Motor On.
When the Motor On statement is executed (eg: >Motor On) motors
become energized. When Motor (without the On or Off syntax) is
executed as a function, we as the user or developer wish to query
motor state On or Off. (eg: >Print Motor)
67
Pulse Function

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

Wait MemSw(1) = 1 Or Sw(1) = 1 Waits for either condition


MemSw(1)=1 Or Sw(1)=1
are satisfied
Wait 1; On 1 Wait one second, then turn
output bit 1 On
NOTE
Multi-statements: A program statement (a line of code)
) can contain several statements separated by semi-
colons.
69
Print Statement
• Outputs data to the current display window,
including the Run window, Operator window,
Command window, and Macro window.
Syntax
Print [expression [ , expression... ] [ , ]
Parameters
expressionOptional. A number or string expression.,
(comma)Optional. If a comma is provided at the end of the
statement, then a CRLF will not be added.

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

The following example puts the coordinate value in


the variable uvar the value is then printed to the
current display window.

Function test
Real uvar
uvar = 1.123
Print “The value of uvar is: ”, uvar
Fend

Run or Operator Window Display:


The value of uvar is: 1.123

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

• Comments are Green


• Syntax errors are Red
• SPEL+ Keywords are
Blue

Syntax Completion SmartSense

A syntax error indicates that code in the


NOTE

) program violates the syntax (i.e., grammatical


rules) of Spel+.

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

If the caret (cursor)


is placed on the line
with the error, then
a brief message will
be displayed on the
status bar. For
example, in the
program shown
below, the message
is displayed on the
status bar.

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

• Modify “Your First SPEL+ Program” to include


on, and off commands for I/O

• Use the IO Monitor to verify I/O operation

• Use the I/O Label editor to give names to all I/O

• Label the robot points

• Include the Wait Statement with a time delay

• Modify the program to include Comments

79
Projects

• Explain basic function structure


(Function/Fend)
• Project overview
• File Types
• Directory, sub directory structure
• Building a project
• Compile
• Re compile

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

) A function is a self-contained unit of the program that


performs a specific task

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

• Before you can run any of the code in your application,


you must build the project.

• To build your application project -


– Select Build from the Project Menu or click on the
Build button on the toolbar.
Or
– Select Rebuild from the Project Menu. This will
rebuild the entire project.
Or
– Select Run from the Run Menu or click on the Run
button on the toolbar. The project will be built
before the Run window appears.
Or
– Select Operator Window from the Run Menu. The
project will be built before the Operator window
appears.
NOTE
The project Build compiles each program’s Spel+ source code into object code and then
) links (joins) all object files together The Build command does the minimum amount of
work required to bring the project up to date in the robot controller. Rebuild will compile
the entire 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$

• You can declare different types of data in


your program. All variables must be
declared.

90
Variable Data Types
• The following table shows the different data types for the SPEL+
language.

Data Type Size Range


• Boolean 1 byte TRUE or FALSE
• Byte 1 byte -128 to +127
• Integer 2 bytes -32768 to +32767
• Long 4 bytes -2147483648 to
+2147483647
• Real 4 bytes -3.40E+38 to 3.40E+38
• Double 8 bytes -1.79E+308 to 1.79E+308
• String 256 characters ASCII and Extended ASCII

NOTE When a variable is declared in a program


) statement, the compiler is told to reserve a specific
amount of computer memory.

91
Variable Data Types

• Variable names should not match or mimic any


SPEL+ command.
• Variable names may be up to 24 characters in length.
Data correspondence
EPSON RC+ C/C++
Boolean short
Byte short
Short short
Integer short
Long int
Real float
Double double
String char [256] * Null
included
92
Variable Data Types

Variable Data
read / write access scope through
your source code may be either:

• Global • Module • Local


(Entire project) (Program wide) (Function Only)

93
Initial Values

• All variables are initialized when first used


except for Global Preserve variables.
Strings are set to empty, and all other
variables are set to zero.

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"

or the same expression using multi line technique:

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.

• The first numeric expression is the initial value of


the counter. This value may be positive or
negative as long as the final variable and Step
increment correspond correctly.

• The second numeric expression is the final value of


the counter. This is the value which once reached
causes the For...Next loop to terminate and control
of the program is passed on to the next instruction
following the Next instruction.

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.

• The counter variable is then compared with


the final value. If the counter is less than or
equal to the final value, the statements
following the For instruction are executed
again. If the counter variable is greater than
the final value, execution branches outside of
the For...Next loop and continues with the
instruction immediately following the Next
instruction.

98
For/Next Example

FOR . . . NEXT

FUNCTION Demo1
INTEGER count
FOR count = 1 To 10
GO P(count)
NEXT count

FOR count = 10 To 1 STEP -1


GO P(count)
NEXT count
FEND

99
Basic Loop Structures
Do/Loop

• Specifies a While condition. If satisfied, statements


are executed between Do and Loop, The While
condition is checked once again. Executing
Do….Loop statements and rechecking the While
condition continues as long as the While or Until
condition is satisfied. If no condition is specified
the do…loop will cycle indefinitely

• If the While condition is not satisfied, program


control transfers to the command following Loop.
For a While condition that is not satisfied at the first
check, the statements inside of the Do….Loop
statements are never executed.

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

• Add Variable to program (Integer)

• Modify program to include Wait SW( # )

• Modify program to include For Next loop

• Print Variable count through loop

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.

Motion Teach takes Current 105


Commands Position data and
stores current values
Point Number selection Point file
& Name editing selection
Points
Coordinate data
editing

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

Lefty arm orientation Righty arm orientation


107
Points
RS3 Lefty / Righty

Lefty arm orientation Righty arm orientation


108
Points
SIX AXIS Orientations

Righty Hand Lefty Hand Above Elbow Below Elbow

No Flip Wrist Flip Wrist 109


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.
Go place
GO, executes simultaneous four axes PTP motion, with
deceleration and stop at a specified position. Go P0
JUMP, Directs PTP movement of gate shape to target
position. In, gate motion, 3rd axis rises from current
position to Z coordinates highest position(Z = 0),
Jump pick
travels horizontally to above target position while Jump p1
rotating to 4th axis angle, 3rd axis goes down to
target.
PASS, Pass moves the robot arm near but not through Pass place
the specified point series.
Pass P0, P1, P6..

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.

TGo, Executes point to point relative motion in the TGo pick


current Tool coordinate system.
• Arm orientation attributes specified in the destination TGo p1
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
111
distance is as small as possible.
Motion Commands
Joint Motion Commands
PULSE, executes simultaneous four axes PTP motion Pulse 0,0,0,0
using the specified pulse values of axes, with
deceleration and stop at specified pulse value. Pulse 0, 12432,0,0
JTRAN, The JTran command can be used to move one
joint of the robot to position specified in degrees or
millimeters, depending on the joint type. The speed JTran 1, 20
and acceleration are the same as for point to point
motion commands.
PTRAN, Use PTran to move one joint a specified
number of pulses from the current position. PTran 1, 2000

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

The process of estimating outcomes between sampled data


points is called interpolation; the process of estimating the
outcomes outside the range covered by existing data is known
as extrapolation. 113
Motion Commands
Interpolated Motion
Interpolated Motion (IM) motions the robot from its current
position to a specified point. Motion, for the following
commands, will be linear.
BMove, Executes linear interpolated relative motion, in the
selected local coordinate system that is specified in the
BMove place
destination point expression. BMove 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.

TMove, Executes linear interpolated relative motion in the


TMove place
current Tool coordinate system. TMove P0
• 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. 114
Robot Motion
Jump3
3D gate motion. Jump3 is a combination of two CP motions and one PTP motion.
Syntax
(1) Jump3 depart, approach, destination [CarchNumber] [searchExpr] [!...!]
Parameters
depart The departure point above the current position using a point expression.
approach The approach point above the destination position a point expression
Destination The target destination of the motion using a point expression.
archNumber [Optional]. The arch number (archNumber) specifies which Arch Table
entry to use for the Arch type motion caused by the Jump instruction. archNumber must
always be proceeded by the letter C. (Valid entries are C0-C7.)
searchExpr [Optional]. A Sense, Till or Find expression.
Sense | Till | Find; Sense Sw(expr) = {On | Off}; Till Sw(expr) = {On | Off};
Find Sw(expr) = {On | Off}
!...! [Optional]. Parallel Processing statements can be added to the Jump instruction to
cause I/O and other commands to execute during motion.
115
Robot Motion

Jump3 Statement Example:


' 6 axis robot motion which works like Jump of SCARA robot
Jump3 P*-Z(100), P3-Z(100), P3
' Depart and approach use Z tool coordinates
Jump3 P*-TLZ(100), P3-TLZ(100), P3
' Depart uses base (World Coord.) Z and approach uses tool Z
Jump3 P*+Z(100), P3-TLZ(100), P3

116
Robot Motion

Jump3CP is a combination of three CP motions.


Example:
' 6 axis robot motion which works like Jump of SCARA robot
Jump3CP P*:Z(100), P3:Z(100), P3
' Depart and approach use Z tool coordinates
Jump3CP P*-TLZ(100), P3-TLZ(100), P3
' Depart uses base Z and approach uses tool Z
Jump3CP P*+Z(100), P3-TLZ(100), P3
117
Robot Orientation (Six Axis and RSx robots)
J4Flag & J6Flag

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

• Start a new Project


• Teach 2 points
• Give point names
• Go between points
• Move between points
• Jump between point

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

Robot World Coordinate System


Local 0
X

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

Tool 0 coordinate systems are defined for ceiling and


wall mounted robots as shown in the figures below.

124
What is a tool offset ?
Robot final joint Robot final joint
mounting surface center of rotation –
Tool 0

Tool Offset XY

End of Arm Tooling

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.

(2) Jog the U axis to 0 degrees or set to 0 degrees.


The U coordinate can be forced to 0 degrees by teaching an arbitrary point
and then typing in 0 degrees and clicking set.
(3) Jog the tool to the target point using Base mode.
(4) At the target location, record the X and Y coordinates.
(5) Jog the U axis 180 degrees (to +180 or -180).
This can be done by simply rotating the U axis 180 degrees by changing the
coarse jogging value to 180. Click the U+ or U- jog key only one time.
(6) Jog the robot to the target point to re-align the tool..
(7) Record the new X and Y coordinates.
(8) To calculate the tool offsets, subtract the following:
X in step 7 - X in step 4 = delta X
Y in step 7 - Y in step 4 = delta Y ( * -1 for six axis robot)
(9) X Tool Value = delta X / 2
Y Tool Value = delta Y/ 2 126
TLSET continued

(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 #

(11) Test the newly built tool by


going to the Robot Manager
> Jog and Teach screen.
Select the appropriate tool
(Tool 1 for this example).
Select a “Jog Distance” of 10
degrees. Click the U+ or U-
Jog key. The robot should
now rotate about the newly
defined tool as opposed to
rotating about the Z axis
center line. The Tool center
should remain relatively
stationary. The tool can
swing out during the
incremental jog but must
return to the same starting
point. If the robot does not
rotate about the new tool
then check steps 8 and 9 list
above.

128
TLSET continued

• TLSet Statement: Defines a tool coordinate system. In other


words, TLSET specifies tool coordinate system origin and
rotation angle in relation to the tool 0 coordinate system.
Syntax:
TLSET tool number, x position, y position, z position,
rotation angle

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

• To open the Monitor


window
– Select Monitor
from the Tools
menu
Or
– Click on the
button on the
toolbar.

132
Command Mode

• 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

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.

P1 = XY(200, 100, -25, 0) ' Assign coordinates


P10 = Here ' Assign a point to current position

• Referencing points 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 (see Editing Points) or the Jog and Teach
Tool. Names must be unique for each point number when
used in the same point file.

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:

JUMP P11 :X(30) ‘Uses 30 for the value of X

JUMP P25 +U(90) ‘Adds 90 degrees to U

Go P1 -TLZ(20) ‘Go to P1 with a z offset of -20mm

Go P1 -X(20) +Y(50) :Z(-25)‘Go to P1 with relative offsets for X


and Y and an absolute Z value

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

P21 = P20 :Z(-10) ‘Sets P21 to P20 with Z at -10 mm

P1 = P1 +Z(10) ‘Sets P1 10 mm higher in Z


P2 = P2 :U(180) ‘Sets U to 180

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

Example: LIMZ -50

Z=0

Z = -50 Jump command is not


possible if robot position or
Z = -100 target position is above the
specified LimZ

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

7 8 9 JUMP PALLET (2,9)

4 5 6

1 2 3
P21 P22

PALLET 2 P21, P22, P23, [P24], 3, 4

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)

Each time the procedure is called, its statements run,


starting with the first executable statement after the
Function statement and ending with the first Fend or
Exit statement encountered. The Main function will
execute when the Start button is pressed.
145
Function Statement
Function...Fend

A function is a group of program statements which includes a Function statement as


the first statement and an Fend statement as the last statement.
Syntax..
Function funcName [(argList)] [As type]
statements..

Fend
Parameters..
funcName The name which is given to the specific group of statements bound
between the Function and Fend instructions. The function name must contain
alphanumeric characters and may be up to 64 characters in length. Underscores are
also allowed.
argList Optional. List of variables representing arguments that are passed to the
Function procedure when it is called. Multiple variables are separated by commas.

146
Function Statement
continued

Function funcName [ {ByRef | ByVal} ] varName [( )] As type

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.

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.

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

– Use the Save command from the Project


menu selection to save all currently
open program and point files in the
current project that need to be saved.
This menu selection is grayed out if
nothing needs to be saved.

– 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

• Use the Copy Project


command in the Project
Menu to copy all of the
files in the current
project to another disk
drive or directory. You
can also save the project
under a different name.
This command is useful
for making backups or for
transferring a project to
media so that it can be
loaded on another
machine.

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.

Configure the Box 1 from Robot 1 position


• Box 1, 1, 100, 200, 0, 100, 0, 100
• Lower limit of axes X, Y, Z is (100,0,0) and upper limit is
(200,100,100)
• Box surface coordinates are not included as inside condition. 154
Boxes / Planes
Plane is used to set the approach check plane. The approach check
plane is for checking whether the robot end effector is in one of the two
areas divided by the specified approach check plane. The position of the
end effector is calculated by the current tool. The approach check plane
is set using the XY plane of the base coordinate system. The approach
check plane detects the end effector (InsidePlane) when it approaches
the area on the + Z side of the approach check plane.
• When the approach check plane is used, the system detects
approaches in any motor power status when controller is ON.

(1) Specifies a coordinate system to create the approach check plane


using the point data representing the translation and rotation based on
the base coordinate system, and sets the approach check plane.
Example:
Plane 1, XY(x, y, z, u, v, w)
Plane 1, P1

(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

• Open Sample Project

• Run sample project after robot type


verification.

156
Debugger

• Discussion:
• Break Points
• Step
• Step into
• Step Over
• Resume
• Instant Watch
• Help (GUI)

157
Debugger

EPSON RC+ supports source level debugging to help find


run-time logic errors in programs that compile and link
successfully but do not produce expected results. You can
set breakpoints and step through your source code. You can
also suspend a task using the Task Manager Halt command
and then step through the code.

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

Setting and clearing


breakpoints:

– Open the program


where you want to set
a breakpoint, then click
on the gray margin on
the line where you
want to stop. Click on
the Breakpoint again to
clear a breakpoint, or
select Clear All
Breakpoints from the
Run menu.

159
Debugger
Stepping through a program:
There are two commands on the Run
menu that are used for stepping through
code.

– Step Into - steps through each line


and also steps into functions when a
step is executed on a Call statement.

– Step Over - steps through each line of


code similar to Step Into but is unique
when a call statement is executed. All
lines of code within the current call are
executed without halt. This helpful for
lines of code you wish not to halt on
such has feed device or grip action
control.
160
Debugger
Displaying variables:
To view variable values,
you can do one of the
following:
When a task is halted by
halt or breakpoint, you
can view the value for a
variable by moving the
mouse cursor over the
variable name. The
value will be displayed
in a tool tip type
window above the
variable name.

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

– Use the Resume


shortcut or select Run
| Resume to resume
one or more halted
tasks. This command
is available only when
one or more tasks is in
halt mode.

163
Help

• To open the help system search dialog


go to the Help menu or simply click on
any keyword and press F1.
164
Help
HTML based help has example code which may be copied
and used in code creation.

165
robots.epson.com

Technical
Support Notes
and Hardware
Compatibity List

166
Debugging Lab #6

• Use debugger tools, apply them in


Lab #6
• Break Points
• Step
• Step into
• Step Over
• Resume
• Walk
• Call Stack

167
Motion Control and Optimizing

• Discussion:
• Power
High/Low
• Speed
• Accel
• Timers

168
POWER

¾ POWER LOW (default):


Motor power is limited to 30%, acceleration/deceleration
is limited to 10%, and the speed is limited to 5%.
POWER HIGH:
¾
Full motor power, full acceleration / deceleration and full
speed is achievable
Syntax:

Power [ { High | Low } ]

169
SPEED

¾ SPEED, specifies or displays the arm speed for use


with PTP instructions. A value of 1 - 100 %.
Syntax: Speed [ percent [ ,ZupSpeed, Zdnspeed ]]
Example: Speed 20, 30, 30
Example is using optional modifiers. If optional
modifiers are not used, the required value is used for
ZupSpeed and Zdnspeed.

170
Acceleration

ACCEL, specifies or displays the acceleration and deceleration rates for


use with PTP instructions. Values are from 1 - 100%
Syntax: ACCEL accel, decel [Zupaccel, Zupdecel, Zdnaccel, Zdndecel]
Example: Accel 100, 100, 100, 100, 100, 50

[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)

• Use TMRESET to reset the timers


• TMR( ) Example:
TMRESET 1 'Resets and starts Timer 1
FOR A = 1 TO 10 'Performs operation 10 times
JUMP PA ‘A is Real Data Type
NEXT A
PRINT TMR(1) ’Displays cycle time

172
Lab #7

• Add variable for Cycle time

• Implement Speed, accel, and power statements


in Lab #6

• Save Lab #6 as Lab #7 and incorporate


accelerated motion commands and timers.
Rerun as Lab #7

• Print Cycle Time

173
Optimization

• Discussion:
• Arch Settings (GUI)
• LimZ Settings
• Fine Settings
• Weight Settings (GUI)

174
ARCH Example

10

40 P2

ARCH 1, 40, 10 ‘ defines Arch profile

JUMP PALLET ( 1,a) C1 ‘Applies Arch to Jump Pallet


P1
JUMP Droppnt C1 ‘ Applies Arch to Jump Statement

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.

ARCH Default Values:

ARCH_num Z_up Z_down


0 30 30
1 40 40
2 50 50
3 60 60
4 70 70
5 80 80
6 90 90
176
FINE
• Specifies and displays the positioning precision for
target points
• 0-65535 – is valid range
• The positioning completion check begins after the
CPU in the drive unit has completed sending the target
position pulse to the servo system. Due to servo delay,
the robot will not yet have reached the target position.
This check continues to be executed every few
milliseconds until each joint has arrived within the
specified range setting. Positioning is considered
complete when all axes have arrived within the
specified ranges. Once positioning is complete program
control is passed to the next command.
• Fine is most precise at value 320 (G series)

If a G series robot’s precision is published at +/-.020mm


and your application repeatability requirement is +/-
.080mm, the formula would be: (.080 / .020) * 320 =
1240
177
Weight
Weight Statement:
The Weight statement specifies
that payload and end of arm
tooling offset distance.
Example:
Weight 5 ‘payload=5kg
Weight tab:
The Weight setting can also be
configured from the Robot
Parameters dialog in the Project
menu.
NOTE
1. If the payload exceeds the robot’s
) rated payload specification then the
acceleration/deceleration and speed will
automatically be compensated. Please
refer to the applicable Robot Manual for
payload charts.
2. Do not exceed the maximum
allowable U axis moment of inertia and
center of gravity eccentricity
specifications. 178
Inertia
Use the Inertia statement to specify the
total moment of inertia for the load on
Joint #4. This allows the system to more
accurately compensate acceleration,
deceleration, and servo gains for joint #4.
You can also specify the distance from the
center of Joint #4 to the center of gravity
on the end of arm tooling and part using
the eccentricity parameter.
Statement Line:
Inertia [ loadInertia [ , eccentricity ]]

NOTE 1. If the payload exceeds the robot’s

) rated payload specification then the


acceleration/deceleration and speed will
automatically be compensated. Please
refer to the applicable Robot Manual for
payload charts.
2. Do not exceed the maximum
allowable U axis moment of inertia and
center of gravity eccentricity
specifications.

179
Lab #8

• Building on previous project Implement and


time:
• Arch Improvements
• Fine Improvements
• LIMZ (non Variable) and then (variable)
• Change Weight to see how cycle time is
affected

180
Lab #9

• Build on lab #8 (Save As Lab #9).


• Re teach points with SFREE in J&T Screen
• Use Tool 1 to pick and Tool 0 to place
• Be sure to :
– Use tool offset
– Use variables
– Use For Next loop
– Use Sfree to teach pallet (SCARA ONLY)
– Maintain fixed U angle on stack location
– Pick and Place to pallet with Absolute :U
– Print Cycle Time

Please select Run Window Low Power check


box before pressing start.

181
Continuous Path

• Discussion:
• Arc
• Move
• CP on/off
• Speeds
• Accels
• Parallel Processing during motion
(i.e., !Dn!)

182
Continuous Path

• There are four primary “Continuous Path”


motion commands -
ARC
MOVE
CP
CURVE
• To set velocity (speed) for continuous path
motion commands, use the SpeedS command.
To set acceleration and deceleration, use the
AccelS command.

183
SpeedS

¾ SPEEDS, Specifies or displays the arm speed


for use with the Continuous Path motion
commands, such as Move and Arc. Values are
1 to 2000 mm per sec
Syntax: SpeedS [ mmPerSec ]

184
Accels

¾ ACCELS, Sets the acceleration and deceleration


rates for the Straight Line and Continuous Path
robot motion instructions. (I.E. Move and Arc.)This
is a single value between 1 - 25000 mm/sec*sec
Syntax: AccelS [ accel [, decel ] ]

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:

The ARC command is used to move the arm in a


circular type motion from the current position to
the end position by way of a midpoint position.
The system automatically calculates a curve
based on the 3 points and then moves along that
curve until the point defined by the end point is
reached.

ARC midpoint, endpoint


Example:
ARC P1, P2

If the arm orientation changes (from Right


Handed to Left Handed or vice-versa) during the
circular interpolation move, an error will occur.

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

• When CP is enabled, Arc, Go, and Move instructions


allow execution of the next statement when deceleration
starts.

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.

Example: Curve "MyFile", C, 0, 4, P1, P2, ON 2, P(3:10)

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.

CP Optional. Specifies continuous path motion after the


last point.

searchExpr Optional. A Till or Find expression.


Till | Find
Till Sw(expr) = {On | Off}
Find Sw(expr) = {On | Off}

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

• Start a new project


• Create a basic continuous path routine to
demonstrate dispensing
• Use 2 programs one for each path ( 2
pattern handout )
• Use parallel processing to simulate turning
on the dispense head
• Use run window to test patterns separately

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

• A string in SPEL+ is a set of ASCII characters with a


maximum length of 256.
• You must declare string variables in your programs
with the String data type.
• All string variable names must end with a dollar
sign ($) suffix.

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.

The example below shows the use of Line Input.

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

• Build on Lab #10


• The objective of this lab is to create a “Product
Selection Program”
• 2 products and an “Exit” should be selectable
from a line Input statement
• When selected, the program will use a
Select…Case to call a separate function for the
specific pattern .
• Use a Do… Loop around the Select…Case to
determine whether the “Exit” menu item was
selected.

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

Local Variables: Module Variables:


Function test Integer IntVar1, IntVar2
Integer IVar1, IVar2 Real MyRealVar
Real RealVar String MyDataStr$
String DataStr$ Integer MyArray(10)
Integer Array(10)
. Function main
. MyDataStr$ = “abc,def”
Fend …
Fend
207
Variable Scope

Global Variables:

Program 1: Main.prg Program 2:Loadpart.prg

Global Integer g_count Function loadpart


Function main For I = 1 To g_count
g_count = 30 Jump P(I)
Call loadpart ...
... Next I
Fend Fend

208
Global Preserve Variables
• You can preserve global variable values by using the optional
Preserve parameter when you declare global variables.

Example:

Global Preserve Long g_PartsCount

You can preserve global variable values by using the optional


Preserve parameter when you declare global variables.

Preserved variables are stored in the controller's SRAM.

If the data type of a preserved variable is changed, or the


number of dimensions is changed, then the variable will be
cleared

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.

Program: MAINTASK.PRG Program: CONVTASK.PRG

Function Main Function Conveyor


‘ Start the conveyor task Do
Select 1
Xqt Conveyor
Case Sw(10) = 1
Do
Off convCtrl
‘ ...Motion
Case Sw(11) = 0
... On convCtrl
Loop Send
Fend Wait .01
Loop
Fend
212
Multitasking
• Why multitask?
– Whenever there is a case of asynchronous
processing (that is, a sequence of code
that can run independent of whatever
happens in the foreground).
• Multitasking is a technique for sharing a
single processor among multiple threads of
execution. Epson RC+ will "timeslice" the
multitasks - that is, give one thread a little
time of the CPU, then switch to another
thread in a “round robin” scheduling
fashion.
213
Multitasking
• XQT Statement
– XQT launches a function on its
own execution task
independently processing lines
of code in parallel with it’s
originating and any other
active tasks. Only one task can
control robot motion for all
practical purposes this should
usually be the primary task.
214
Quit Statement
Terminates execution of a specified
task or all tasks.
Quit { taskName | taskNumber | All }

This example shows two tasks that are


terminated after 10 seconds.

Function main Function winc1


Xqt winc1 'Start winc1 function Do
Xqt winc2 'Start winc2 function On 1; Wait 0.2
Wait 10 Off 1; Wait 0.2
Quit winc1 'Terminate task winc1 Loop
Quit winc2 'Terminate task winc2 Fend
Fend
Function winc2
Do
On 2; Wait 0.5
Off 2; Wait 0.5
Loop
Fend
215
6.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

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

• Start a new project


• Using a background task, sequentially
turn on/off 8 outputs
• In the main task simply “Jump”
between two points

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 bits 2, 4 and 6 were high what would be the value of port 0 ?

• If bits 8, 11 and 14 were high what would be the value of port 1?

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

MemOn 1 ‘turns on memory bit 1

MemOff cycDone ‘turn off the memory bit


‘defined in the I/O label editor
‘called "cycDone".

227
Memory I/O Label Editor

• The I/O label editor


lets you define names
for inputs, outputs,
and memory I/O for
each project.

• The label can be up to


sixteen alphanumeric
characters

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.

• After the dialog has been


opened, the status for the
currently selected tab is
constantly updated.

• You can also turn memory


bits on and off when
programs are running by
double clicking on the
LEDs.

229
Memory I/O Commands

Memory I/O has the same types of I/O control


commands as the physical hardware I/O.

– MemOn BitNumber or Label


– MemOff BitNumber or Label
– MemOut PortNumber, State
– MemSw( BitNumber or Label )
– MemIn ( PortNumber )

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)

• Memory IO is maintained during Estop, Reset and Epson RC+ 6.0


restart. Memory IO is not maintained when system power is turned
off.

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

Project Import provides the utility for converting


SPEL for Windows, and previous ESPON RC+ versions
into the latest Epson RC+ file format.

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

• Use SENSE to specify an input condition to be monitored


during JUMP.
• If the SENSE condition is TRUE, the arm will stop above
the target position.
• Use JS ( Jump Sense) to check whether or not the SENSE
condition was satisfied.

Input Checked

End of Motion for


JS = 1

End of Motion for


JS =0

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

SENSE SW(trayPres) = 0 ‘stop above target if tray is not present


TILL SW(PartInPosition) = 0 ‘Terminates motion if part position fails

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

OFF 1; WAIT 0.2 ‘Release placement

FEND

240
Example of Multitasking with
Memory I/O and the Sense
Command
This example performs the following -

• The background task controls a bowl feeder. The


bowl feeder turns on until a part has arrived at the
end of the in-line.
• Once a part is present, the robot is signaled to pick it
up.
• After the part has been picked, the robot will signal
the bowl feeder task to continue circulating parts.
• If a part is not present at the end of the in-line after
the robot has placed the previous part then the robot
will return to bowl feeder and wait above the in-line
until a part is present.

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.

• Returns 0 if the WAIT condition has been satisfied.

• Returns 1 if the time interval has elapsed.


Example -

WAIT SW(1) = 1,4 ‘Wait up to 4 sec for input 1 to turn on


IF TW = 1 THEN
Print “Timed Out!”
ENDIF

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”

CX, CY, CZ, CU Functions:


• Extracts the Axis coordinate value from a Point.
Example-
Function cxtest
Real x
x = CX(pick)
Print "The X Axis Coordinate of point 'pick' is", x
Fend

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:

Program- This mode lets you to develop your


projects. This is the default startup
mode.
Auto- This mode starts the system and
displays the Operator Window.
Use the Password button to change the start 259
mode password.
Project Properties

General version, description and


note user fields.
260
Project Properties

Select the source files you wish to leave


on controller. The default setting is
main.prg stored only. 261
Project Properties

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

Configure Operator Window properties.

263
Project Properties

Program Selections: For each program, you can edit the


Caption and select if you want that program to be Enabled
for the Operator Window.
264
Project Properties

Configure Operator options.

265
Project Properties

Configure IO monitor properties.

266
Project Properties

Smart Camera Project Numbers

267
Project Properties

GUI Builder Start Up and Custom


Help File designator.
268
6.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

There are two steps required for


remote control:
1. Configure Remote Control
inputs and outputs using the
Remote Control tab through
Setup | System Configuration.
Bits 0 thru 7 are set to remote
as standard.
2. Set the control device to
remote.
When the control device is
remote, then robot commands and
task commands can be issued by
the remote device.

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

There are two steps required for


remote control:
1. Configure Remote Control
inputs and outputs using the
Remote Control tab through
Setup | Controller. Bits 0 thru
7 are set to remote as
standard.
2. Set the control device to
remote.
When the control device is
remote, then robot commands and
task commands can be issued by
the remote device.

270
Macros Command (Tools Menu)

You can create SPEL+


command macros using the
Macro Editor. Macros consist
of one or more SPEL
statements. A macro
statement may use global
variables, I/O labels, and
point labels. You can assign
a macro to each of the Alt
function keys.

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

Xqt Statement Revisited:


Initiates execution of a task from within
another task. Xqt starts the specified function
and returns immediately.

273
Associated Multitasking
Commands
The table below shows the program instructions that are used for
multitasking.
– Statement Purpose

– Halt Temporarily suspends execution of a task.


– Resume Resumes a task that has been halted.
– Quit Stops a task or all tasks.
– Signal Sends a signal to one or more tasks that are
waiting for the signal using WaitSig.
– WaitSig Waits for a signal from another task.
– Pause Pause all tasks that are configured to pause.
– Cont Continue all tasks that are in the pause state.
– MyTask Returns the task number of the current
program.

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

• Open Lab #12 and Save As Lab #15


• Configure 4 inputs as Remote Signals Start,
Pause, Abort and Reset
• Start the main task with Remote Start input
• Main task will XQT background task
• Use I/O monitor to verify program operation
• This lab should include:
– Remote operation
– XQT
– Task Manager GUI
– I/O Monitor GUI
– Signal Synchronization

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.

TRAP trapnum, inputcondition XQT {funcname}

TRAP trapnum, inputcondition GoTo {Label}

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:

Functions: Ctr, MemIn, MemSw, In,


InW, Oport, Out, OutW, Sw

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.

• Note that traps must be re-armed before


they will fire again. To re-arm a trap,
execute a Trap statement at the end of
the trap function.

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.

Trap statement has 2 types as below:


5.x only & 6.x
- 4 Traps that interrupts by the user defined input status

6.x for additional system trap functionality


- 7 Traps that interrupts by the system status .

Syntax Usage

To set a system status trap please use software version 6.x :


• Trap {Emergency | Error | Pause | SGOpen | SGClose | Abort | Finish } Xqt funcname

To clear a system status trap setting: (XQT is not specified)


• Trap {Number | Emergency | Error | Pause | SGOpen | SGClose | Abort | Finish }
NOTE

) – Version 5.x only supports Trap {Number}

283
Trap (System Status 6.x)
Parameters

• Emergency In the emergency stop status, executes the specified


function.
• Error In the error status, executes the specified function.
• Pause In the pause status, executes the specified function.
• SGOpen When safeguard is open, executes the specified function.
• SGClose When safeguard is closed, executes the specified
function.
• Abort All tasks except the background tasks stops (such as when
a statement corresponding to the Abort All is executed or Pause
button is pressed) by the user or system, executes the specified
function.
• Finish All tasks except the background tasks are completed,
executes the specified function. It cannot be executed in the
condition which executes the Trap Abort.
• funcname Function of interrupt processing task for which Xqt is
executed when the system status is completed. Functions with
argument cannot be specified.
) Note: Trap *** Call function of EPSON RC+4.x or before is
NOTE

replaced to Trap *** Xqt in EPSON RC+ 6.0. (System Status)


284
Trap (User Defined Trigger)
• Trap trapNumber, IOcondition GoTo {label} | Xqt
Parameters
trapNumber Integer number from 1-4 representing which of 4 Trap
numbers to use. (SPEL supports up to 4 active Trap interrupts at
the same time.)
iocondition Input status specified as a trigger [Event] comparative
operator ( =, <>, >=, >, <, <=) [Integer expression] The
following functions and variables can be used in the Event:
Functions : Sw, In, InW, Oport, Out, OutW, MemSw, MemIn,
MemInW, Ctr, GetRobotInsideBox, GetRobotInsidePlane
Variables : Byte, Integer, Long global preserve variable, Global
variable, module variable In addition, using the following
operators you can specify multiple event conditions.
Operator : And, Or, Xor
Example : Trap 1, Sw(5) = On Goto TrapGTOhandler:
Trap 2, Sw(5) = On And Sw(6) = Off Xqt TrapFunc2
Label: The Goto label (MyGoto:) where program execution is to be
transferred when the GoTo instruction isused with Trap and the
Trap condition is satisfied.
funcName The function that is executed when Xqt when the Trap
condition is satisfied.The function with argument cannot be
specified. 285
Traps

Conditions:
This condition must return a value
of (1) or (0). The following
functions and operators may be
used in the input condition:

Functions: Ctr, MemIn, MemSw, In,


InW, Oport, Out, OutW, Sw

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.

• Note that traps must be re-armed before


they will fire again. To re-arm a trap,
execute a Trap statement at the end of
the trap function.

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

• Using Lab #15, incorporate TRAP Sw


• Make a New Function that will be
Called from the Trap
• Inside the function Print to screen “
Trap Active”

289
System History

View all events and errors


captured by RC+ 290
Controller Tools

Controller Backup, Status &


Reset to origin State (Reboots Controller)
291
Error Handling
Statement Purpose
When an error
OnErr Use the OnErr statement to define the
occurs in a SPEL+ location of the error handling routine.
function, you can Err Use Err to retrieve the number for the
cause execution to current error status. Use this in the
be transferred to an error handling routine to determine which
error has occurred.
error handling Error Generate a user defined error which can
routine for be caught by an error handler.
processing the error. Era Use Era to retrieve the axis number for
The routine must be which the error occurred. This is normally
used in the error handling routine.
inside a function
Erl Use Erl to retrieve the line number in
definition. Error which the error occurred. This is normally
handlers are local for used in the error handling routine.
the function, not the Ert Use Ert to retrieve the task number in
task. The following which the error occurred. This is normally
used in the error handling routine.
table shows the ErrMsg$ Use ErrMsg$ to retrieve the error
program instructions message associated with a specified error
that are used for number.
error handling. EResume Resumes execution after an error-
handling routine is finished.

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

program execution Loop


goes to the Exit Function '** Avert unintentional error
‘** execution.
ErrHandler label, ' *** Error handler ***
Errhandler:
where the error enum = Err(1)
handler starts. The Do
Print "Error #", enum, " occurred"
error number is Print "Continue (Y or N)"
displayed and the Line Input #21, value$
Select Ucase$(value$)
operator is asked to
continue or not. If Case "Y"
EResume Next
the operator enters Default
"N" then the program Print "Quit All“
Print “Y was not selected”
executes the Restart Quit All
statement to start the Send
Loop
program from the top. Fend
293
Lab #17

• Start a New Project to motion between 2 points


• Increment the Z axis Up until an error occurs
• Using OnError Goto an error handler and
correct the Z position variable
• Use EResume after correcting Z offset. Print the
error message, error number, Current Z
position between motion commands.
• This lab should include:
– Err(tasknum) ‘<<Mytask may be used
– Errmsg$(Err(Ert))
– Ert ‘<< Returns current task number
– Select / Send
– Do / While / Loop
– Call Function
– Print CZ(Here)
294
User Error Editor (Tools Menu)
• The User Error Editor defines
user errors that can be caught by
an error handler.
• If a user error is caught in an
error handler, then the ErrMsg$
function will return the error
message defined in the editor.
• The user defined label can be
used as a constant in place of the
error #.
• User error numbers are fixed
from 8000 to 8999.
• Labels can be up to 16 characters
OnErr Goto ErrHandler
in length.
... • It is recommended that you use
On Vacuum the ER_ prefix for each error
label and use all caps for the
Wait Sw(PartGripped), 1 label. This makes it easy to see
If Tw=1 then error label in the Spel+ code.
• The Import command from the
Error ER_GripError1 File menu can be used to import
EndIf user errors from other projects.
295
Lab #18

• Using Lab #17, incorporate a user


defined Error #8000
• Use Project Save As
• Use TW and timeout on an input
• Goto an Error Handler and print
display your user error “Low Air Press
Warn”
• Place a comment in front of the Onerr
statement line. Run the same
program and let Epson capture and
log User Error.

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

• Open Robot Manager


• Select Locals Tab
• Select Local Wizard
• Local Number 1
• Points Used: 3-Origin, X, Y
• Alignment X if available
• Follow Wizard prompts to create Local
• Select Jog & Teach Tab
• Mode: World | Local: 1
• Jog X, Y, Z; Note Coordinate directions
and current position data.

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

Function test2(Byref comment$ as String) as Boolean


comment$=“Good Bye”
test2=False
Fend

Run Window Screen Output:

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.

If / Endif conditions bits 13, 14 & 15 indicating ready or not.

305
Introduction to Advanced Topics
Serial Communications:
OPTIONAL

SPEL+ supports standard Windows RS-232C


ports.

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.

Constant Name Usage


#define Defines a macro.
#ifdef ... #endif Conditional compile.
#ifndef ... #endif Conditional compile.
#include Include a file.

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

OCR (6.x only)


– Create custom characters through
integrated wizard
– Point and click interface
– Integrated results through Vision Guide
313
Introduction to Advanced Topics
Optional:
VB Guide
Create custom GUI’s
– Easily share information between Spel+ programs and
.NET programming languages.
– Drag and Drop video display when using Vision Guide
– Harness the power of higher level languages
– RC+ supported .NET Library file
– Epson RC+ debugger works from within .Net

– The EPSON RC+ VB Guide Option enables you to use


Microsoft Visual Basic .NET or any other language that
supports .NET technology to run your robotic
applications. This gives you the power to create
sophisticated user interfaces, use databases, and use
third party products designed for use with VB.

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.

©2012 EPSON AMERICA INC All rights reserved

317

You might also like