IRC5 Expert Programming
IRC5 Expert Programming
IRC5 Expert Programming
Expert
Programming
IRC5 Programming Basic
IRC5 Expert Programming
Your Name
My Company
My Boss
123 456-7890
Your Name Printed here S. S.# Job Title YN Your Name here
© ABB Inc. -3
IRC5 Expert Programming
Start Date
ABB TRAINING COURSE
Month Day Year
1. 1.
2. 2.
3. 3.
4. 4.
5. 5.
6. 6.
7. 7.
© ABB Inc. -4
8. 8.
9. 9.
10. 10.
IRC5 Expert Programming
Course Objectives
Course Objectives
Upon completion of this course the student will be able to
successfully:
Course Objectives
Course Objectives
Upon completion of this course the student will be able to
successfully:
Creating and Manipulate Data and Arrays.
Course Objectives
Course Objectives
Upon completion of this course the student will be able to
successfully:
Advanced Rapid.
Introduction
Safety Review
Custom Instructions
ROUTINES appear to the user as if they were regular
You can make ______________
instructions.
The screen below shows how to add _______________
PARAMETERS to your
ROUTINES
_______________.
© ABB Inc. -13
IRC5 Expert Programming
Custom Instructions
PROC rStyle1()
Cut_Hole p10, 15, v300, tNozzel;
Cut_Hole p20, 25, v200, tNozzel;
Cut_Hole p30, 10, v200, tNozzel;
ENDPROC
PROC rWaterON()
Set do5_FlowOn;
ENDPROC
PROC rWaterOFF()
Reset do5_FlowOn;
ENDPROC
© ABB Inc. -15
ENDMODULE
IRC5 Expert Programming
Exercise 1
1. Create a routine/instruction that could be used to cut holes in carpeting. The
instruction should look similar to a Move instruction with the addition of a radius
parameter. (Use the RelTool Function)
2. Add the new routine/instruction to the top of the Most Common 1 Pick List..
3. This exercise should simulate carpet cutting with a waterjet cutter. Create two 6
point TCP’s named “tGripper” and “tNozzel”. For tNozzel use the pen holder for our
purposes. Create the following new routines Main, rStyle1, rPickUp, rDropOff,
rWaterOn, and rWaterOff. When selected from the teach pendant, the robot should
pickup the pen and run rStyle1. rStyle1 routine will move to the table and draw three
different sized circles using the new instruction. When the robot gets to the part the
rWaterOn routine should be used to ensure that the water pressure is high enough
(wait for input di5_GoodPart). Turn on output do5_FlowOn to start the waterjet. Wait
for input di6_Flowing to check that the water is flowing. At the end of the cut the
robot should turn the waterjet off with the rWaterOff routine. At the end of the
program the robot should put the pen back.
Extra:
1. Add fault handling to your program. If the robot waits for more than 3 seconds
for input di5_GoodPart or di6_Flowing to come on the robot should go to a
service position and wait for the operator to press continue on the teach
© ABB Inc. -17
pendant.
Custom Functions IRC5 Expert Programming
IRC5 Expert Programming
Custom Functions
ROUTINES appear to the user as if they were regular
You can make ______________
Functions.
The screen below shows how to add _______________
PARAMETERS to your
ROUTINES
_______________.
© ABB Inc. -19
IRC5 Expert Programming
ENDFUNC
© ABB Inc. -21
IRC5 Expert Programming
Exercise 2
1. Create a function that returns the distance between two robtargets. This
function is similar to “Distance” function but your function uses robotarget
data instead of pos data.
2. Add to the existing program. Create a timed interrupt that checks the robot
position every 5 seconds. Use the new function to calculate the distance from
where the robot is currently and the Home position. (Definition of Home =
where the robot sits between cycles.) If the distance is greater than or equal to
10mm turn off the do8_AtHome output. If the distance is less than 10mm turn
the do8_AtHome output ON. This interrupt should be activated as soon as the
robot program is started. (Use the Start Event)
Extra:
1. Create a function that can be used in a decision making instruction to get a
number of the function key that has been pressed by the operator after a
prompt.
© ABB Inc. -22
World Zones IRC5 Expert Programming
IRC5 Expert Programming
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.
When using \Stat and WZDOSet the output must be defined as “Internal" access.
Exercise 3
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.
3. Create a World Zone that will not allow the robot to move unless the
TCP is over the table.
© ABB Inc. -27
Manipulating Data and IRC5 Expert Programming
Arrays
IRC5 Expert Programming
Data
Variable
Constant
Persistant
© ABB Inc. -29
IRC5 Expert Programming
Global or Local?
ENDMODULE
Alias
An __________ type of data is the same type as another data but
given a different name. (Example: Num data and Counter data)
VAR robtarget p15 := [ [600, 500, 225.3], [1, 0, 0, 0], [1, 1, 0, 0],
[ 11, 12.3, 9E9, 9E9, 9E9, 9E9] ];
< dataobject of robtarget >
< trans of pos >
< x of num >,< y of num >,< z of num >,
< rot of orient >
< q1 of num >,< q2 of num >,< q3 of num >,< q4 of num >
< robconf of confdata >
< cf1 of num >,< cf4 of num >,< cf6 of num >,< cfx of num >
< extax of extjoint >
< eax_a of num >,< eax_b of num >,< eax_c of num >,…
Data Arrays
nOffsets
Data Arrays
Exercise 4
1. Create a System Module with the "NoStepIn attribute. Move the rWater_ON,
rWater_OFF, Cut_Hole, and your function routines to this module. Step
through the program. Can you tell a difference? If not, delete the attribute
and step through again.
2. Create a new Alias data type named "Cycle_Num". Use this new data
type for the cycle counter counting the number of cycles through rStyle1
routine.
3. Create a new routine named rStyle2. In this routine, use two single dimensional
arrays to get X and Y offset values for cutting 15mm holes. Use a starting
position on the table top and use the Offset function for this exercise. Use the
following values:
X Y
0 0
44 106
150 150
256 106
300 0
256 -106
© ABB Inc. -36
Loads
Arm Load
PayLoad
Tool Load
When setting up a robot define the Arm Load first then define the
Tool Load followed by the Pay Load.
© ABB Inc. -39
IRC5 Expert Programming
ARM LOADS
Arm Load load must be defined before using LoadID.
The _____________
© ABB Inc. -40
IRC5 Expert Programming
ARM LOADS
r1_load_1 r1_load_3
r1_load_2
© ABB Inc. -41
IRC5 Expert Programming
LoadID
Before using Load Identification (LoadID) make sure the following
conditions are met:
Running LoadID
© ABB Inc. -43
Tool Load
The angle that axis 6 is to move while performing the test should be
+90 or -90 degrees. This will give the best results. If the tooling is
unable to make this amount of rotation choose other. A minimum of
30 degrees must be specified.
At the end of the procedure the following information is given:
Mass (kg)=
Centrer of Gravity(mm) X=
Centrer of Gravity(mm) Y=
Centrer of Gravity(mm) Z=
Measurement Accuracy = (Should be greater than 80%)
(If not than run again)
© ABB Inc. -44
IRC5 Expert Programming
After defining the Tool Load define the PayLoad of each Part that the
robot carries. Then add the GripLoad instructions to the program.
PROC rPickUp()
MoveJ pAbovePick, v1000, z50, tGripper;
MoveL pAtPick, v1000, fine, tGripper;
Set do9_Grip;
GripLoad loadPart1;
MoveL pAbovePick, v1000, fine, tGripper;
ENDPROC
PROC rDropOff()
MoveJ pOverDrop, v1000, z50, tGripper;
MoveL pAtDrop, v1000, fine, tGripper;
Reset do9_Grip;
GripLoad load0;
MoveL pOverDrop, v1000, z50, tGripper;
ENDPROC
© ABB Inc. -45
IRC5 Expert Programming
Motion Supervision can be set active, de-active and tuned in System Parameters.
© ABB Inc. -47
IRC5 Expert Programming
1
Tune Value can be from ________(for more sensitivity)
300
to __________(for less sensitivity).
© ABB Inc. -48
IRC5 Expert Programming
Motion Supervision
GripLoad
To activate a Payload use the ______________ instruction and a Load
data.
Below are the system outputs that can be used with Motion Supervision.
© ABB Inc. -49
IRC5 Expert Programming
Exercise 5
MultiTasking Option
© ABB Inc. -52
IRC5 Expert Programming
Multi-Tasking
20
There can be ________ tasks in the system.
Normal Program
Background tasks are programmed like ________________.
Tasks
Automatic loading of Modules (Not Needed)
© ABB Inc. -53
IRC5 Expert Programming
Multi-Tasking Parameters
IRC5 Expert Programming
Multi-Tasking Parameters
Name of task to load module into.
Task : _________________________________________________
Path to find file.
File : _____________________ (Release: = “3HAC…” directory)
(Home: = Active system directory)
Built-in or Loaded
Storage : _______________________________________________
0 = English
TextResource : __________________________________________
No or Yes
Shared : ________________________________________________
© ABB Inc. -55
IRC5 Expert Programming
TestAndSet Function
TestAndSet can be used together with a normal data object of the type bool, as a binary
semaphore, to retrieve exclusive right to specific RAPID code areas or system resources.
The function could be used both between different program tasks and different execution
levels (TRAP or Event Routines) within the same program task.
Example of resources that can need protection from access at the same time:
•Use of some RAPID routines with function problems when executed in parallel.
•Use of the FlexPendant - Operator Log
MAIN program task:
PERS bool tproutine_inuse := FALSE;
...WaitUntil TestAndSet(tproutine_inuse);
TPWrite "First line from MAIN";
TPWrite "Second line from MAIN";
TPWrite "Third line from MAIN";
tproutine_inuse := FALSE;
...WaitUntil TestAndSet(tproutine_inuse);
TPWrite "First line from BACK1";
TPWrite" Second line from BACK1";
© ABB Inc. -56
...flag := TaskRunMec( );
If current task controls any mechanical unit flag will be TRUE, otherwise FALSE.
TaskRunRob is used to check if the program task controls some robot (mechanical unit
with TCP).
...flag := TaskRunRob( );
If current task controls some robot, flag will be set to TRUE, otherwise FALSE.
© ABB Inc. -57
IRC5 Expert Programming
WaitTestAndSet Function
WaitTestAndSet instruction waits for a specified bool persistent variable value to become
FALSE. When the variable value becomes FALSE, the instruction will set value to TRUE and
continue the execution. The persistent variable can be used as a binary semaphore for
synchronization and mutual exclusion.
This instruction has the same underlying functionality as the TestAndSet function, but the
WaitTestAndSet is waiting as long as the bool is FALSE while the TestAndSet instruction
terminates immediately.
Example of resources that can need protection from access at the same time:
•Use of some RAPID routines with function problems when executed in parallel.
•Use of the FlexPendant - Operator Log
TPWrite "Second line from MAIN"; TPWrite "Second line from BACK1";
TPWrite "Third line from MAIN"; TPWrite "Third line from BACK1";
tproutine_inuse := FALSE; tproutine_inuse := FALSE;
IRC5 Expert Programming
Multi-Tasking Example
An Example of an Interrupt driven Background Task may look like this:
MODULE ABB
VAR intnum intGasFlowFault:=0;
VAR intnum intGeneralFault:=0;
TRAP TrapFault
<SMT>
ENDTRAP
PROC main()
CONNECT intGasFlowFault WITH TrapFault;
ISignalDI\Single,di1GasFlow,1,intGasFlowFault;
CONNECT intGeneralFault WITH TrapFault;
ISignalDI\Single,di2GeneralFault,1,intGeneralFault;
.
.
.
WHILE TRUE DO
WaitTime 2;
ENDWHILE
RETURN;
ENDPROC
© ABB Inc. -59
ENDMODULE
IRC5 Expert Programming
Exercise 6
1. Create a background task that monitors input di4_Continue. When Input
di4_Continue is on then output do1_StyleAck1 and do2_StyleAck2 should
come on and vise versa. Set up and test.
2. Create another background task that monitors the robot position. If the
robot's faceplate is less than 500mm from the robot base X direction then
set output do3_StyleAck4 and write to the screen indicating that the robot
is close to the base. Setup task. Do Not Use World Zones for this
exercise.
3. Move the home position to with in 500mm of the base X direction. Run the
main task as well as the background task. Does do3_StyleAck4 come on
when the robot is home? Does this work when jogging the robot?
4. Create a background task that allows the operator to shift individual style
routines in the X, Y, or Z directions. This should happen when the operator
presses P1.
© ABB Inc. -60
Network Drive and Up/Down IRC5 Expert Programming
Loading
IRC5 Expert Programming
Load
The __________ UnLoad
and _____________ instructions are used to Open and
Close a program modules during program execution.
Save, StartLoad, WaitLoad, and CancelLoad are other instructions.
Example:
MODULE LoadMODFlp
CONST string stNames{4}:=["Part1.mod","Part2.mod","Part3.mod","Part4.mod"];
CONST string routineSTR:="rPart";
PROC main()
For i from 1 to 4 DO
Load "flp1:"\File:=stNames{i}; This is a "Late Binding". It is
%routineSTR%; needed here because if a regular
WaitTime 2; Procedure Call was used here a
reference error would be
UnLoad "flp1:"\File:=stNames{i}; generated when the unload
ENDFOR instruction is executed.
TPErase;
ENDPROC
ENDMODULE
© ABB Inc. -62
IRC5 Expert Programming
Static or Dynamic?
© ABB Inc. -63
IRC5 Expert Programming
Open…
Select a Program or a Module.
Physical Channels :
lan1
Name __________
lan
Connector_______
Transmission Protocols:
TCPIP1
Name__________________
TCPIP
Type___________________
lan1
Physical Channel_________
Application Protocols:
lan
Name _________________________ PC:
Local Path __________________
NFS or FTP
Type __________________________ /c/
Server Path _________________
0
User Name _________________
TCPIP1
Transmission Protocols____________
xxx.xxx.xxx.xxx
Server Address______________ 0
Password __________________
No or Yes
Trusted ____________________ 500
Max file size ________________
300
Memory Partition Size _________
© ABB Inc. -68
IRC5 Expert Programming
Now give the robot access to the backups directory on the C: drive.
Click on the export location "/c/backups".
Press "ACCESS" and Add the "pc:" to the access list. Press OK.
© ABB Inc. -71
IRC5 Expert Programming
Exercise 7
1. Create 3 additional part style routines for your program. Name them
"rStyle3", "rStyle4", and "rStyle5".
3. Modify the Main routine so that the part style is selected from the teach
pendant. Then the corresponding module and routine should be down
loaded into the robot from the memory stick and run that style. Now try
using the computer hard drive instead of the memory stick.
© ABB Inc. -73
Serial Communications IRC5 Expert Programming
IRC5 Expert Programming
Serial Communications
Com1 – RS232
____________________
Program Examples:
Serial Communications
Exercise 8
1. Add to your existing program. Have the robot wait for an input from the
computer to tell the robot how many parts to produce. (Use Hyperterminal for
the entry device)
© ABB Inc. -79
3D Frame Displacement IRC5 Expert Programming
IRC5 Expert Programming
3D Frame Displacement
Often we use a vision system to Displace the positions that the robot
moves to.
3D Frame Displacement
Pose
_____________ data.
PDispSet
To activate the displacement information use the ____________
instruction.
© ABB Inc. -82
IRC5 Expert Programming
3D Frame Displacement
We can also use a sensor on the end of the robot arm to search for the
position of the part.
© ABB Inc. -83
IRC5 Expert Programming
3D Frame Displacement
Exercise 9
1. Add to the existing program. Have the robot wait for an input from the
computer for an amount of displacement to apply to the program.
2. Now redo the same section of the program only have the robot search for
the position of the table and displace the program accordingly.
© ABB Inc. -85
Advanced Rapid IRC5 Expert Programming
IRC5 Expert Programming
The Configuration tool is used to set up the communications with the robots.
Remember to save when setup is done. The file is used by OPC Server.
© ABB Inc. -90
IRC5 Expert Programming
Exercise 11
Grants
Grants
© ABB Inc. -98
IRC5 Expert Programming
Grants
© ABB Inc. -99
IRC5 Expert Programming
Users Groups
Service
Peter
Backup
****
Restore
UAS
Sys adm
Sys adm
Admin
Backup UAS Grants
Restore Sys adm
© ABB Inc. -101
IRC5 Expert Programming
UAS Administration
Exercise 10
1. Create User’s and User Groups for all members of the class.
2. Change the default user to have no access.
3. Log in as each user and test accessibility.
4. Use the “back door” to get full accessibility.
© ABB Inc. -108