Establish a connection between a real ABB robot (or RobotStudio simulation) and a custom (python) node through socket communication.
A RAPID module is used to create a server, while the user node (e.g. Python script) acts as a client. The client-server communication is setup through IP address and port number.
-
Robotstudio simulation (virtual controller) + python node on the same PC:
IP address 127.0.0.1
port 5000 -
Real robot controller + python node:
IP address: 192.168.125.1
port 1025The IP address and port number must match in both Python node and RAPID module in RobotStudio.
- The
srcfolder contains a RAPID module (.txt file) and a Python script - The
envsfolder contains a RobotStudio environment for simulating a GoFa arm with a virtual controller
The current configuration has been tested on:
- Robot: ABB 15000-5-95 GoFa 5kg
- Omnicore controller
- RobotWare version 7.12.0
- Python script executed in Spyder v6
- RobotStudio 2025
Setup all the necessary modules.
- If needed, download and unpack the RobotStudio environment from
envs
In RobotStudio:
- Go to
Controllertab - Expand
RAPIDfrom the dropdown menu on the left - Create a new Program Module and paste the RAPID script (.txt file) from
src - Click
RAPIDandApply
Setup Python node:
- Copy and paste the Python script and be ready to run it
- Make sure you have installed the
socketpython library
In RobotStudio (or FlexPendant for the real controller):
- Set Program Pointer to
mainruotine:- Go to
Controller/RAPIDtab - Expand
TCP_socketmodule - Right-click
mainroutine andSet Program Pointer to Routine
- Go to
- If running a simulation (virtual controller)
- Go to
Simulationtab and pressPlay - The robot will move to a predefined home position and start the socket server
- Go to
- If running on real robot
- Connect to robot controller via MGMT port
- Go to the
Codeapp on the FlexPendant - Make sure Program Pointer is set to
TCP_socket - Press play button
- The robot will move to a predefined home position and start the socket server
Once the RAPID module is running, start the Python node to establish connection.
- Make sure that the IP address and port number match both in the python node and RAPID module
- RobotStudio returns a socket error even if the socket connection is closed by the client node
- To reset the error, set the Program Pointer back to the routine in RobotStudio
Make sure that the trajectory is feasible to follow for the robot:
- There are no parallel consecutive joints
- The robot does not pass through a singular configuration
Make sure that Rapid sockets are not blocked by the Firewall Manager in RobotStudio. To enable Rapid socket:
- Go to
Controller> clickConfiguration>Communication - Select
Firewall Manager - Double click on
RapidSocketsand set all the values toYes - Restart the controller
For questions, suggestions or contributions, feel free to contact:
- Arturo Giacobbe – arturo.giacobbe@polimi.it
If you found this repo useful, please consider mentioning it in your work
@misc{ABB_Gofa_socket_2025,
author = {Arturo Giacobbe},
title = {ABB GoFa socket},
year = 2025,
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/artuurog/ABB_GoFa_socket}},
}