Você está na página 1de 86

IRC5

R103
Programação
IRC5 Programming Basic
Avançada
IRC5 Programação Avançada

Conteúdo

Objetivos do Curso

Robot Studio Online, Configuração 36


Tool Center Points Avançados 43
Módulos, Rotinas e funções 51
Interrupções e Traps
Multitasks 66
Instrução Search e Error Handler 78
Deslocamento de Programa 91
Zona Global 98
Instruções de Performance 111
© ABB Inc. -2
IRC5 Programação Avançada

Objetivos do Curso
Após completar o curso, o participantes estará apto a:

 Criar e utilizar Módulos, Rotinas Trap e Funções.


 Criar Tool Center Points diferenciados
 Programar Lógicas utilizando Search
 Criar deslocamento de Programa
 Programar Error Handler
 Utilizar interrupções
 Criar zonas globais
 Criar Multitasks
© ABB Inc. -3
IRC5 Programação Avançada

Using Robot Studio Online

Right Click on
Controllers
© ABB Inc. -4
IRC5 Programação Avançada

Add Controller

Add a controller to
communicate with.
© ABB Inc. -5
IRC5 Programação Avançada

Event Viewer

Display current
and past events in
the system.
© ABB Inc. -6
IRC5 Programação Avançada

IRC5 FlexPendant & R.S.O

 The FlexPendant and RobotStudioOnline work together


© ABB Inc. -7
IRC5 Programação Avançada

Using R.S.O.

 Locate your Rapid program.


© ABB Inc. -8
IRC5 Programação Avançada

Using R.S.O.

 Request Write access, remember to grant on the


FlexPendant. (Not required in Auto Mode)
 Press Enable Edit. Remember that R.S.O is an online
editing tool.
© ABB Inc. -9
IRC5 Programação Avançada

RSO Things to Remember

Refer to Instructor demonstration.

Remember the following things:


• You are connected and changing the robot LIVE!

• You must “Request Write Access” and FP must grant the


request before any changes can be made.

• User Authorization can be set to limit access.

• Close window when done making changes.


© ABB Inc. -10
Robot Studio Online IRC5 Programação
Avançada
Configuration
IRC5 Programação Avançada

RSO Configuration

There are five types of


Parameters. Double
clicking on one will open
its contents.
© ABB Inc. -12
IRC5 Programação Avançada

I/O Configuration
© ABB Inc. -13
IRC5 Programação Avançada

Adding I/O Signals

To add an I/O signal:


1. Right click on the robot and get write access
2. Expand the robot in the tree.(press + in front of controller)
3. Expand Configuration
4. Choose I/O window by double clicking
5. Click on signal.
6. Then right click on signal.
7. Choose Add Signal
8. Define the Name, Type of Signal, Assigned to unit, and unit
Mapping.
© ABB Inc. -14
IRC5 Programação Avançada

Motion Configuration
© ABB Inc. -15
IRC5 Programação Avançada

Assign outputs to the programmable buttons

 
1.       Tap the ABB menu.
2.       Tap Control Panel.
3.       Tap ProgKeys.
4.       Select key to program, Key 1-4 in the upper selection list.
5.       Tap the Type menu to select type of action:
          None
          Input
          Output
          System
6.       If Type Input is selected.
          Tap to select one of the digital inputs from the list.
          Tap the Allow in auto menu to select if the function is also
allowed in automatic operating mode.
© ABB Inc. -16
IRC5 Programação Avançada

Exercise 2

1. Setup I/O system.

2. Configure Software Axes limits for axis1.

3. Setup Programmable key 1 to open and close the Gripper


© ABB Inc. -17
Advanced Tool Center Points IRC5 Programação
Avançada
IRC5 Programação Avançada

Tool Coordinate System

 Tool coordinate system

Tool coordinates
Y
Tool0

X Z
 Benefits using Tool:
 Jogging
 Re-orientation

Z
 Easy to change
Y

Base coordinates
© ABB Inc. -19

X
IRC5 Programação Avançada

Coordinate System
 Different examples of tools and TCPs.

TCP
TCP TCP

Good examples of tools with elongators defined.

TOOL0
TCP

Tool0 is always the


ref.point for the other tools
© ABB Inc. -20
IRC5 Programação Avançada

Tool Center Point Methods

 There are three TCP definition methods:


 TCP (Default Orient)
 TCP & Z
 TCP & Z, X
X and Z Elongators can be
defined for a tool to define
the tool’s coordinates.
X - Elongator

Z - Elongator

Fixed point
© ABB Inc. -21
IRC5 Programação Avançada

Tool Coordinates without Elongators

If only the TCP (Default


Orient) method is used this is
the assumed tool
coordinates.

+Z
© ABB Inc. -22
IRC5 Programação Avançada

Tool Coordinates with Elongators

If the TCP & Z or TCP & Z, X


method is used this could be
the defined tool coordinates.

Z
© ABB Inc. -23
IRC5 Programação Avançada

Stationary TCP

A Stationary TCP is a TCP that is not held by the robot.

A Stationary TCP is always


used with a held Work Object.

A Stationary TCP is taught


using a known held TCP. tNozzel

WobjPart
tGripper
© ABB Inc. -24
IRC5 Programação Avançada

Exercise 3

1. Create a TCP for your assigned robot Gripper using the TCP
Z ,X Method. Test.

2. For the Pen either create another Held TCP or if interested in


stationary TCP’s create a TCP for a stationary pen instead of a
held pen. Test. (Hint: To create a stationary pen, tape the pen
to a part holder.)
© ABB Inc. -25
Modules, Routines, and Data IRC5 Programação
Avançada
IRC5 Programação Avançada

Modules

We use modules to divide Program Memory into sections.

This makes it easier to Save and Retrieve program information

There are two types of modules. They are:

1. Program Modules

2. System Module

Remember that there cannot be any two names that are


the same in memory at one time.
© ABB Inc. -27
IRC5 Programação Avançada

System Memory

System Parameters
Operating Application User Memory
System Software
VXWorks RAPID
© ABB Inc. -28

Not to scale. Used for explanation purposes.


IRC5 Programação Avançada

User Memory

Task: T_Rob1 Task: T_Rob2 Task: BackGround1

MainModule MainModule MainModule


Main Main Main

Data Data Data

User (system Module) User (system Module)

Data Data

Base (system Module) Base (system Module)

Data Data

More… More…
© ABB Inc. -29
IRC5 Programação Avançada

Module Types

There are two types of Modules:

Program (.mod)
System (.sys)

A module consists of:

Routines
Data
MainModule
Main rPickUp rDropOff

Data
© ABB Inc. -30
IRC5 Programação Avançada

Module Attributes

A module may have the following attributes:

SYSMODULE
MODULE
NoStepIn module1(SYSMODULE,VIEWONLY)
!Data declarations
ViewOnly
!Routines
ReadOnly !Instructions
ENDMODULE
NoView

Module attributes can only be assigned offline.


© ABB Inc. -31

(Except SYSMODULE)
IRC5 Programação Avançada

Program File Structure


Folder NewProgramName A Backup will Save everything.
NewProgramName.pgf <?xml version="1.0" encoding="ISO-8859-1" ?>
<Program>
<Module>ModuleA.mod</Module>
SAVING PROCEDURE <Module>MainModule.mod</Module>
1. Tap the ABB menu.
2. Tap Program Editor. </Program>
3. Select Robot Task.
4. Tap Tasks and Programs.
MainModule.mod
5. Select a Task if multiple robots. MODULE MainModule
6. Tap File
PROC main()
7. Tap Save Program as.
8. Using the input panel to select storage Rotuine1;
location and type the desired name.
ModuleA.mod
Routine2;
9. Tap OK MODULE ModuleA
ENDPROC
PROC RoutineA1()
MoveL;
PROC Routine1()
MoveL;
MoveL;
ENDPROC
ENDPROC
ENDMODULE

PROC Routine2()
MoveL;
ENDPROC
ENDMODULE
© ABB Inc. -32
IRC5 Programação Avançada

Saving Modules
  A Backup will Save everything.
1.       Tap the ABB menu.
2.       Tap Program Editor.
3.       Select Robot Task.
4.       Tap Modules.
5.       Tap Module to save.
6.       Tap File and Save Module As.
7.       Using the input panel to select storage location and type the
desired name.
8.       Tap OK.
ModuleA.mod
MODULE ModuleA
PROC RoutineA1()
MoveL;
MoveL;
ENDPROC
ENDMODULE
© ABB Inc. -33
IRC5 Programação Avançada

Routines

rStyle1
Main Routine
MoveL p20 . . .
MoveJ p10 . . . rStyle2
.
IF . . . . MoveL p210 . . .
rStyle1 . .
ELSEIF . . . Return .
rStyle2 .
. Return
.
.
Return

P10
DATA: P20
P210

Every program must have a Main routine.


The ProcCall instruction is used to call other routines.
© ABB Inc. -34
IRC5 Programação Avançada

Routines

Routines are used to:


1. ORGANIZE YOUR PROGRAM
2. REPEAT A TASK

Routine types:
1. PROCEDURE = for motion and process.
2. FUNCTION = for mathematical calculations.
3. TRAP = for interrupt instruction handling.
© ABB Inc. -35
IRC5 Programação Avançada

Data

There are two kinds of Data Types:

Atomic (Bool, Num, and String)


Record (Robtarget, Tooldata, Wobjdata, …)

There are three different kinds of data declarations:

Variable
Constant
Persistant
© ABB Inc. -36
IRC5 Programação Avançada

Data Scope

The scope of Data may be defined as:


MODULE module1(SYSMODULE)
LOCAL Var num nCounter:=0;
Global
PROC routine1()
Var num nLocalCounter;
Task !Instructions
EndProc
Local ENDMODULE

The differences between Program Data and Routine data is:


Program Data – Can be seen from anywhere in the program.
Routine Data – Can only be seen from within the current routine.
© ABB Inc. -37
IRC5 Programação Avançada

Data Arrays

nOffsets

3132 3145 4532 1276 8634

3344 22 1276 11 7886

5569 6 332 556 665

8944 456 11 -677 446


© ABB Inc. -38
IRC5 Programação Avançada

Data Arrays

A data ARRAY is a way storing many numbers in


one data location.

An array can be 1, 2, or 3 dimensional.

Program code example:


 
CONST num reg6{5}:=[3132,3145,4532,1276,8634]
 
For i from 1 to 5 do
TPWrite "The current value is "\Num:=reg6{i};

© ABB Inc. -39
IRC5 Programação Avançada

Exercise 4
1. Create a new System Module.
2. Put the tools created in the last exercise in the new Module.
3. Create ONE of the programs described below:
A. Create a program that simulates dispensing. The program should use
either a held or a stationary TCP. Create the following routines: Main, rPickUp,
rDropOff, rDispenseOn, rDispenseOff, rStyle1, rStyle2. Program the Main routine
to execute rPickUp, rStyle1, and rDropOff when input di1_Style1 is on. Program the
Main routine to execute rPickUp, rStyle2, and rDropOff when input di2_Style2 is on.
In the style routines move to the paper, turn on flow, and draw your initials. Put
rPickUp and rDropOff in the new system Module.

B. Create a program that simulates Material Handling. The program


should use tGripper for the TCP. The program should have the following routines:
Main, rFeeder1, rFeeder2, rLathe, rInspect, rConveyor, and rService. Program the
Main routine to execute rfeeder1, rLathe, rInspect, and rConveyor when input
di1_Style1 is on. If di2_Style2 is on have the robot run rFeeder2, rLathe, rInspect,
and rConveyor. Program the robot to take every 3 rd part to rInspect routine and wait
for di5_GoodPart.

(Optional) 4. Add the use of Arrays to your program: (one dimensional arrays with no
more than 8 components.)

A. For the program that simulates dispensing. Create two single


dimensional arrays to be used as offsets. Create a style routine that draws circles
on the paper using the offsets in the arrays.
© ABB Inc. -40

B. For the program that simulates Material Handling. Create two single
dimensional arrays representing pallet configuration offsets. Replace the conveyor
with a pallet that uses the array values for the offsets to fill the pallet.
Interrupts and Traps IRC5 Programação
Avançada
IRC5 Programação Avançada

What is an Interrupt?

Definition of an Interrupt

An event that triggers a temporary jump to a


trap routine.
© ABB Inc. -42
IRC5 Programação Avançada

Interrupt Instructions
INSTRUCTION DESCRIPTION

CONNECT Assigns an interrupt with a specific trap routine.


IDELETE Removes association of interrupt with a specific trap routine.
ISIGNALDI Assigns an interrupt from a digital Input signal.
ISIGNALDO Assigns an interrupt from a digital Output signal.
ITIMER Activates an interrupt AFTER a specific time.
IDISABLE Does not allow interrupts, but stores event triggers in queue
buffer for processing.
IENABLE Allows interrupts again.
Deactivates an interrupt, but does NOT keep a record of the
ISLEEP event trigger for processing.
IWATCH Activates an interrupt again.
© ABB Inc. -43
IRC5 Programação Avançada

Interrupt Instructions
INSTRUCTION DESCRIPTION

IError Orders an interrupt upon an error


IPers Interrupt at change of a Persistent
IVarValue Interrupt at change of a Variable.
ISignalAI Interrupt from an Analog Input.
ISignalAO Interrupt from an Analog Output.
ISignalGI Interrupt from a Group Input change.
ISignalGO Interrupt from a Group Output change.
© ABB Inc. -44
IRC5 Programação Avançada

Trap Routine

Creating a "TRAP" Routine to use with an Interrupt

When creating a new routine Tap the arrow on the


“Type:” line to select the routine type. Then choose Trap.
© ABB Inc. -45
IRC5 Programação Avançada

Interrupt Example
© ABB Inc. -46
IRC5 Programação Avançada

Interrupt Overview

Connect

ATTACHES VARIABLE TRAP ROUTINE


INTERRUPT TO NAME FOR NAME FOR
TRAP ROUTINE INTERRUPT INTERRUPT

intFlowFault with trapFAULT


© ABB Inc. -47
IRC5 Programação Avançada

Interrupt Overview

ATTACHES AN
INPUT WITH A
DIGITAL INTERRUPT
DIGITAL SIGNAL NAME
SIGNAL

Di6_Flowing, 0, intFlowFault
VALUE OF SIGNAL
FOR INTERRUPT TO
TRIGGER TRAP ROUTINE

OPT ARG /Single = ONE OCCURANCE ONLY


No OptArg. = EVERY OCCURANCE
© ABB Inc. -48
IRC5 Programação Avançada

Example Trap Routine

fine
© ABB Inc. -49
IRC5 Programação Avançada

Event Routines
11a
There are several system events that can be used in the
RAPID program language. They are:

COMMAND DESCRIPTION
POWER ON The robot is turned on.
START When the robot is started from the beginning.
RESTART When the robot is started from the position it was stopped.
STOP When program stopped (not cycle stop).
QSTOP When the program is quick stopped (emergency stopped).
RESET When the old program is erased.

Twenty routines can be assigned to each


© ABB Inc. -50

event.
IRC5 Programação Avançada

Setting up an Event
© ABB Inc. -51
IRC5 Programação Avançada

Exercise 5

1. Depending on with program you did in the last exercise do the


following:

A. For the program that simulates dispensing. Add to the routines for
turning flow on and off. Monitor the flow after turning it on. If the flow stops while
drawing have the robot stop and move to a service position and wait for the
operator to press continue. After continue have the robot continue with where it
stopped.

B. For the program that simulates Material Handling. Add to the routines
for gripping and un-gripping. Monitor a part present switch (imaginary, pick an
input). If the part is dropped while running have the robot go to a service routine
and wait for the operator to press continue. After continue have the robot continue
with where it stopped.

2. Add an event routine that:


A. For the program that simulates dispensing. If the program is stopped
while drawing turn the flow off. When restarted start the flow again.

B. For the program that simulates Material Handling. If program is


stopped in mid-cycle turn on the output do6_Alarm. After restart turn off
do6_Alarm.
© ABB Inc. -52
Searching and Error IRC5 Programação
Handling Avançada
IRC5 Programação Avançada

Why use Searching?

Searching is a way to add flexibility to your robot system.

Searching can be used for:


Inspection
Finding part location
© ABB Inc. -54
IRC5 Programação Avançada

Search Instructions

SearchL is for searching along a Linear path.


SearchC is for searching along a Circular path.

Example:
© ABB Inc. -55
IRC5 Programação Avançada

Search Instruction

SearchL \Stop, di_SearchSensor, pFound, pEndSearch, v100, tSensor

STOP SIGNAL FOUND END POINT SPEED TOOL


WHEN TRIGGER POSITION FOR CENTER
PART IS STORAGE SEARCH POINT
FOUND NAME
(POSITION
DATA
TYPE
MUST BE
VARIABLE)
© ABB Inc. -56
IRC5 Programação Avançada

Search Characteristics

pSearchStart pFound STOP pSearchEnd

OVERSHOOT
Position where Travel beyond the End point
search signal was point of signal for “SearchL”
triggered. (robtarget detection. destination.
data type=variable)

MOVEJ pSearchStart ,V1000, fine, tSearchSensor;


USED AS A STARTING REFERENCE FOR SEARCH
© ABB Inc. -57
IRC5 Programação Avançada

Error Handling

All routines can have an Error Handler.


Error handlers are added in routine declarations.
© ABB Inc. -58
IRC5 Programação Avançada

Error Identification

The variable “ERRNO” stores the current error of


the system.
This can be used in the error handler to identify
what error has occurred and to program appropriate
actions.
The data type “Errnum” has a list of all standard
errors. (See following pages)
© ABB Inc. -59
IRC5 Programação Avançada

Errnum Data
Name Cause of error Name Cause of error
ERR_ACC_TOO_LOW Too low acceleration/deceleration specified in ERR_DIVZERO Division by zero
instruction "2or 2 ERR_EXCRTYMAX Maximum number of retries exceeded.
ERR_ALRDYCNT The interrupt variable is already connected to a TRAP ERR_EXECPHR An attempt was made to execute an instruction using a
routine place holder
ERR_ALRDY_MOVING The robot is already moving when executing a , ERR_FILEACC A file is accessed incorrectly
!+,!+instruction ERR_FILEEXIST A file already exists
ERR_AO_LIM ,2 analog signal value outside limit in 0& ERR_FILEOPEN A file cannot be opened
0/K or0, ERR_FILNOTFND File not found
ERR_ARGDUPCND More than one present conditional argument for the ERR_FNCNORET No return value
same parameter ERR_FRAME Unable to calculate new frame
ERR_ARGNAME Argument is expression, not present or of type switch ERR_ILLDIM Incorrect array dimension
when executing ArgName ERR_ILLQUAT Attempt to use illegal orientation (quaternion) valve
ERR_ARGNOTPER Argument is not a persistent reference ERR_ILLRAISE Error number in RAISE out of range
ERR_ARGNOTVAR Argument is not a variable reference ERR_INOMAX No more interrupt numbers available
ERR_AXIS_ACT Axis is not active ERR_IODISABLE Timeout when executing IODisable
ERR_AXIS_IND Axis is not independent ERR_IODN_TIMEOUT Timeout when executing IODNGetAttr or IODNSetAttr
ERR_AXIS_MOVING Axis is moving ERR_IOENABLE Timeout when executing IOEnable
ERR_AXIS_PAR Parameter axis in instruction TestSign and SetCurrRef ERR_IOERROR I/O Error from instruction Save
is wrong. ERR_LOADED The program module is already loaded
ERR_BWDLIMIT Limit StepBwdPath ERR_LOADID_FATAL Only internal use in LoadId
ERR_CALLIO_INTER If an IOEnable or IODisable request is interrupted byERR_LOADID_RETRY Only internal use in LoadId
another request to the same unit ERR_LOADNO_INUSE The load session is in use in StartLoad
ERR_CALLPROC Procedure call error (not procedure) at runtime (late ERR_LOADNO_NOUSE The load session is not in use in CancelLoad
binding) ERR_MAXINTVAL The integer value is too large
ERR_CFG_INTERNAL Not allowed to read internal parameter- # ERR_MODULE Incorrect module name in instruction ,+ and /-
ERR_MSG_PENDING The unit is busy
ERR_CFG_ILLTYPE Type mismatch - #, # ERR_NAME_INVALID If the unit name does not exist or if the unit is not allowed
ERR_CFG_LIMIT Data limit - # to be disabled
ERR_CFG_NOTFND Not found - #, # ERR_NEGARG Negative argument is not allowed
ERR_CNTNOTVAR CONNECT target is not a variable reference ERR_NORUNUNIT If there is no contact with the unit
ERR_CNV_NOT_ACT The conveyor is not activated. ERR_NOTARR Data is not an array
ERR_CNV_CONNECT The ? instruction is already active. ERR_NOTEQDIM The array dimension used when calling the routine does
ERR_CNV_DROPPED The object that the instruction ? was waiting not coincide with its parameters
for has been dropped. ERR_NOTINTVAL Not an integer value
ERR_DEV_MAXTIME Timeout when executing a ReadBin, ReadNum or a ERR_NOTPRES A parameter is used, despite the fact that the corresponding
ReadStr instruction argument was not used at the routine call
© ABB Inc. -60

ERR_DIPLAG_LIM Too big 2 in the instruction 0,connected


to current 02-0#-0>
IRC5 Programação Avançada

More Errnum Data


Name Cause of error
Name Cause of error ERR_TP_DIBREAK A TPRead instruction was interrupted by a digital
ERR_NOTSAVED Module has been changed since it was loaded into the input
system. ERR_TP_DOBREAK A TPRead instruction was interrupted by a digital
ERR_OUTOFBND The array index is outside the permitted limits output
ERR_OVERFLOW Clock overflow ERR_TP_MAXTIME Timeout when executing a TPRead instruction
ERR_PATH Missing destination path in instruction Save ERR_TP_NO_CLIENT No client to interact with when using TPReadFK
ERR_PATHDIST Too long regain distance for ,!+ or ,!+ instruction
instruction ERR_TRUSTLEVEL Not allowed to disable IO unit
ERR_PATH_STOP Stop of the movement because of some process error ERR_UI_INITVALUE Initial value error in function UINumEntry
ERR_PID_MOVESTOP Only internal use in LoadId ERR_UI_MAXMIN Min value is greater then max value in function
ERR_PID_RAISE_PP Error from ParIdRobValid or ParIdPosValid UINumEntry
ERR_PROGSTOP The robot is program stop state when executing a ERR_UI_NOTINT Value is not a integer when specified that an
,!+ or ,!+ instruction integer
ERR_RANYBIN_CHK Check sum error detected at data transfer with instruction should be used when using UINumEntry
ReadAnyBin ERR_UNIT_PAR Parameter Mech_unit in TestSign and SetCurrRef
ERR_RANYBIN_EOF End of file is detected before all bytes are read in is wrong
instruction ReadAnyBin ERR_UNKINO Unknown interrupt number
ERR_RCVDATA An attempt was made to read non numeric data with ERR_UNKPROC Incorrect reference to the load session in
ReadNum instruction WaitLoad
ERR_REFUNKDAT Reference to unknown entire data object ERR_UNLOAD Unload error in instruction UnLoad or WaitLoad
ERR_REFUNKFUN Reference to unknown function ERR_WAITSYNCTASK Time-out from WaitSyncTask
ERR_REFUNKPRC Reference to unknown procedure at linking time or at ERR_WAIT_MAXTIME Timeout when executing a WaitDI or WaitUntil
run time (late binding) instruction
ERR_REFUNKTRP Reference to unknown trap ERR_WHLSEARCH No search stop
ERR_ROBLIMIT Axis outside working area or limits exceeded for at
least one coupled joint
ERR_SC_WRITE Error when sending to external computer
ERR_SIGSUPSEARCH The signal has already a positive value at the beginning
of the search process
ERR_STARTMOVE The robot is in hold state when executing a ,!+
or ,!+ instruction
ERR_SOCK_CLOSED The socket is closed, or is not created
ERR_SOCK_CONNREF The connection was refused by the remote computer
ERR_SOCK_ISCON The socket is already connected
ERR_SOCK_TIMEOUT The connection was not established within the time out
© ABB Inc. -61

time
ERR_STRTOOLNG The string is too long
ERR_SYM_ACCESS Symbol read/write access error
ERR_SYNCMOVEOFF Timeout from SyncMoveOff
ERR_SYNCMOVEON Timeout from SyncMoveOn
IRC5 Programação Avançada

Error Handling Example

Be careful not to use an Else that handles all errors.


© ABB Inc. -62
IRC5 Programação Avançada

Error Handling Instructions


EXIT Terminates program execution. Program cannot be restarted.
1. _________
Program can only be started from the beginning of Main.
RAISE Creates an error in the program causing program execution to
2. _________
jump to the Error Handler of the routine. Also can be used in
the Error Handler to jump to the calling routine’s Error
Handler.
RETRY Restarts program execution at the same instruction that
3. _________
caused the error.
RETURN Finishes execution of a routine.
4. _________
STOP or
5. _________
BREAK Stops program execution.

TRYNEXT Restarts program execution at the next instruction after the


6. __________
instruction that caused the error.
© ABB Inc. -63
IRC5 Programação Avançada

Error Handling Overview


Example of Error Recovery
Main The error can be remedied in the Error Handler
and the program can be automatically restarted
as in the example below.

rSearchPart rSearchPart

SearchL …
ERROR

ERROR
If ERRNO=ERRWHLSEARCH Then

Retry
TryNext
© ABB Inc. -64

Return
Raise
IRC5 Programação Avançada

Exercise 6

1. Create a new routine called rSearch in the new module.


Program the robot to search at a height of about 6 inches over
the length of the pad of paper. Search for the input
di5_GoodPart.

2. If the input is not found the robot should retry the search. After
2 retries the program should stop, reset the counter, and
prompt the operator to fix the problem. When the operator has
corrected the problem the operator should press “continue” for
the program to search again.
© ABB Inc. -65
Program Displacement IRC5 Programação
Avançada
IRC5 Programação Avançada

Program Displacement Instructions

There are three program displacement instructions.


They are:
1. PDispOn
2. PDispOff
3. PDispSet
© ABB Inc. -67
IRC5 Programação Avançada

PdispOn Instruction

SearchL \Stop, di_SearchSensor, pFound, pEndSearch, v100, tSensor;


PdispOn pSearchStart, tSensor;
MoveL P3, v1000, fine, tSensor;
PdispOff;

The amount of program displacement is determined by


the difference between the Current position and
pSearchStart.
P3 (ORIGINAL) P3 (DISPLACED)
pSearchStart pFound STOP pSearchEnd

MOVEL pSearchStart, V100, Fine, tSensor;


USED AS A STARTING REFERENCE FOR SEARCH
© ABB Inc. -68
IRC5 Programação Avançada

PdispOn Optional Argument


SearchL \Stop, di_SearchSensor, pFound, pEndSearch, v100, tSensor;
PdispOn \Exep:=pFound, pSearchStart, tSensor;
MoveL P3, v1000, fine, tSensor;
PdispOff;

The amount of program displacement is determined by


the difference between the pFound and pSearchStart.
P3 (ORIGINAL) P3 (DISPLACED)
pSearchStart pFound STOP pSearchEnd

MOVEL pSearchStart, V100, Fine, tSensor;


USED AS A STARTING REFERENCE FOR SEARCH
© ABB Inc. -69

The \ indicates an OPTIONAL ARGUMENT.


IRC5 Programação Avançada

Program Displacement Rules

The program displacement is automatically


reset upon:

 COLD START-UP
 NEW PROGRAM LOAD
 EXECUTION OF FIRST INSTRUCTION
IN THE PROGRAM
© ABB Inc. -70
IRC5 Programação Avançada

PdispSet Instruction
PdispSet pose1;
The amount of displacement is the values in pose1.
PERS pose pose1 := [[0,0,0],[1,0,0,0]];
[[X,Y,Z],[Q1,Q2,Q3,Q4]]

There are a few ways to change the values of a pose data.


They are:
Manually enter
Assign values
Download values
Some Functions that can be used are:
DefDFrame - Requires 3 original and 3 new robtargets.
DefFrame - Creates a frame from 3 robtargets
© ABB Inc. -71
IRC5 Programação Avançada

Exercise 7

1. Add to your existing programs

A. For the program that simulates dispensing. Add to your search routine.
Have the robot move down from the position where the input comes on and draw a
square on the paper.

B. For the program that simulates Material Handling. Add to your search
routine. Have the robot search for a part on the table. When the part is found have
the robot move down and pick up the part.
© ABB Inc. -72
World Zones IRC5 Programação
Avançada
IRC5 Programação Avançada

World Zones
DEFINITION –
A defined area in the robots work range that is to be monitored.
The following are two examples of how world zones could be used:
To prevent the robot from entering an area in the robot work range.
To set an “AtHome” output when the robot is close to the home position.

Maximum of 10 World Zones


can be used at the same time.
© ABB Inc. -74
IRC5 Programação Avançada

World Zone Shape Instructions


Instructions used to define World Zones:
WZBoxDef [\Inside][\Outside], Shape, Low Point*, High Point*;
WZCylDef [\Inside][\Outside], Shape, Center Point*, Radius, Height;
WZSphDef [\Inside][\Outside], Shape, Center Point*, Radius;
WZHomeJointDef [\Inside][\Outside], Shape, MiddleJointVal, DeltaVal;
WZLimJointDef [\Temp][\Stat], Shape, LowJointVal, HighJointVal;

• \Inside & \Outside = a choice of definition area.


*Low, High, and Center Point are POS data types.
(Define as Constant or Persistent.)
• Joint Values use JointTarget data types.
© ABB Inc. -75
IRC5 Programação Avançada

World Zone Action Instructions


Instructions used to setup World Zone actions:

WZLimSup [\Temp][\Stat], World Zone**, Shape;

WZDOSet [\Temp][\Stat], World Zone**, [\Inside][\Outside],[\Before]Shape, Signal, SetValue;

**World Zone is either a WZtemporary or WZstationary data type.


\Temp = a WorldZone that can be activates and deactivated in a program.
\Stat = a WorldZone that only be activated in a PowerOn event driven routine.

When using \Stat and WZDOSet the output must be defined as “Internal" access.

Instructions used to Activate and Deactivate World Zones:


WZDisable WorldZone; _____________________
Deactivates a Temp. World Zone

Reactivates a Temp. World Zone


WZEnable WorldZone; _____________________
© ABB Inc. -76

Deletes a Temp. World Zone


WZFree WorldZone; _______________________
IRC5 Programação Avançada

Exercise 8

1. Add a cycle counter to the program. Count the number of cycles that
the robot runs. After every 4 cycles have the robot go to a service
position. The robot will wait for the operator to flip the di4_Continue
switch to continue.

2. Create a 50mm radius World Zone around the Service position.


Whenever the robot is in this zone do6_Alarm comes on. This zone
should be activated whenever the robot is powered on.

3. Create a World Zone that will not allow the robot to move unless the
TCP is over the table.
© ABB Inc. -77
Advanced Instructions IRC5 Programação
Avançada
IRC5 Programação Avançada

Performance Instructions
% ACCELERATION LIMIT
% ACCELERATION RAMP
AccSet -AccSet 100,50;
AccSet is used when handling fragile loads. It allows slower acceleration
and deceleration, which results in smoother robot movements. This
instruction can only be used in the Main task or, if in a MultiMove System, in
Motion tasks.
% SET SPEED
VelSet -VelSet 100,5000; MAX mm/sec.

VelSet is used to increase or decrease the programmed velocity of all


subsequent positioning instructions. This instruction is also used to limit
maximum velocity. This instruction can only be used in the Main task or, if in a
MultiMove System, in Motion tasks.

NAME
GripLoad -GripLoad IoPart1;
GripLoad is used to define the payload (Loaddata) which the robot
holds in its gripper. This instruction can only be used in the Main task
or, if in a MultiMove System, in Motion tasks.
© ABB Inc. -79
IRC5 Programação Avançada

Performance Instructions

AXIS
SOFTNESS %
SoftAct -Softact 3,30;
SoftAct is used to activate the so called “soft” servo on any axis
of the robot or external mechanical unit. This instruction can only be used
in the Main task or, if in a MultiMove System, in Motion tasks.

SoftDeact -SoftDeact;
SoftDeact is used to deactivate the so called “soft” servo on all
robot and external axes. This instruction can only be used in the Main
task or, if in a MultiMove System, in Motion tasks.
© ABB Inc. -80
IRC5 Programação Avançada

Advanced I/O Instructions

TriggIO -TriggIO trigg1,10\Dop:=doGun,1;


TriggIO is used to define conditions and actions for setting a digital, a group
of digital, or an analog output signal at a fixed position along the robot’s
movement path. The data defined is used for implementation in one or more
subsequent TriggL, TriggJ, or TriggC instructions.

TriggEquip -TriggEquip trigg2,10,0.1\Dop:=doGun,1;


TriggEquip is used to define conditions and actions for setting a
digital, a group of digital, or an analog output signal at a fixed position along the
robot’s movement path with possibility to do time compensation for the lag in the
external equipment. The data defined is used for implementation in one or more
subsequent TriggL, TriggJ, or TriggC instructions.

TriggInt -Trigg2,5,IntWeld;
TriggInt is used to define conditions and actions for running an interrupt
routine at a position on the robot’s movement path. The data defined is
used for implementation in one or more subsequent TriggL, TriggJ, or
© ABB Inc. -81

TriggC instructions.
IRC5 Programação Avançada

Advanced I/O Instructions

TriggCheckIO -TriggCheckIO checkgrip, 100, airok, EQ, 1, intno1;


TriggCheckIO is used to define conditions for testing the value of a digital, a
group of digital, or an analog input or output signal at a fixed position along the
robot’s movement path. If the condition is fulfilled there will be no specific action,
but if it is not, an interrupt routine will be run after the robot has optionally stopped
on path as fast as possible. The data defined is used for implementation in one or
more subsequent TriggL, TriggJ, or TriggC instructions.

TriggL/TriggJ -TriggJ p1,v500,trigg1,fine,tPen;


TriggL and TriggJ are used to set output signals and/or run interrupt routines at
fixed positions, at the same time as the robot is making a linear or Joint
movement.

TriggC -TriggC p1, p2,v500,trigg2,fine,tPen;


TriggC is used to set output signals and/or run interrupt routines at
fixed positions, at the same time as the robot is moving on a circular path.
© ABB Inc. -82
IRC5 Programação Avançada

Advanced I/O Instructions

TriggIO trigg1,10\Dop:=doGun,1;


TriggJ p1,v500,trigg1,fine,tPen;

Distance or Time The output signal doGun is set


When the TCP is here.
© ABB Inc. -83
IRC5 Programação Avançada

Configuration Instructions
Conf J [\on] | [\off]
ConfJ (Configuration Joint) is used to specify whether or not the robot’s
configuration is to be controlled during joint movement. If it is not controlled, the
robot can sometimes use a different configuration than that which was
programmed.

Conf L [\on] | [\off]


ConfL (Configuration Linear) is used to specify whether or not the robot’s
configuration is to be monitored during linear or circular movement. If it is not
monitored, the configuration at execution time may differ from that at programmed
time. It may also result in unexpected sweeping robot movements when the
motion type is changed to joint movement.
SingArea [\Wrist] | [\off]
SingArea is used to define how the robot is to move in the proximity of singular
points. Singarea is also used to define linear and circular interpolation for
robots with less than six axes.
© ABB Inc. -84
IRC5 Programação Avançada

Exercise 9

1. Create your own new routines to practice with the instructions


in this section that interest you.
© ABB Inc. -85

Você também pode gostar