1
Guide for ABB RobotStudio
This guide explains step-by-step the process of setting up a robot cell in RobotStudio that can be controlled
from Matlab
by
Michael Natapon Hansson
Department of Mechanical and Manufacturing Engineering, Aalborg University
January 2016
2
Content
Setting Up and Controlling a Robot in RobotStudio from Matlab ..................................................................... 3
Setting Up RobotStudio Controller to Enable TCP/IP Connection ................................................................. 3
Setting Up a Server in RobotStudio ................................................................................................................ 5
Setting Up a Client in Matlab ....................................................................................................................... 15
Using the Matlab Client to Control a Robot in RobotStudio ........................................................................ 16
Setting Up and Controlling a Gripper in RobotStudio from Matlab ................................................................ 19
Setting up and using a camera in RobotStudio from Matlab ........................................................................... 23
3
Setting Up and Controlling a Robot in RobotStudio from Matlab
This guide will show how to enable and use Matlab to control a robot system in RobotStudio through a
TCP/IP connection. This guide will have its outset in some already developed components for both Matlab
and RobotStudio, which consist of a client class for Matlab and a collection of Rapid modules that together
will serve as a server in RobotStudio.
Setting Up RobotStudio Controller to Enable TCP/IP Connection
The first thing we need to do is to setup a robot controller in RobotStudio to allow a connection through
TCP/IP. When importing a robot and creating a system, go to the “Options” panel.
RobotStudioConnector
Matlab
Cl ass
CommandHandler
ConnectionHandler
FunctionHandler
InitParameters
RobotStudio
Rapid Modules
ServerClient
TCP/ IP Socket
4
Next, go to “Communication” and select “PC-Interface”, which will enable a PC application (e.g. Matlab) to
communicate with a robot controller over an Ethernet network.
After clicking “Close”, you should be able to see that “PC-Interface” is added as part of the system. You are
now able to connect to the controller trough TCP/IP, so just click “Finish”.
5
Setting Up a Server in RobotStudio
As mentioned earlier, we will make use of some already defined modules that contains the functionality
needed to create a server. So go to the “RAPID” tab, click on “Program” and select “Load Module”.
Locate and load the four modules “CommandHandler”, “ConnectionHandler”, “FunctionHandler” and
“InitParameters”. From this point this collection of modules we be referred to as “server modules”.