Why Sockets Are Great for Robot Programming

Is robot programming flexible enough?

What if you want to control your robot in real-time but with offline programming tools?

How can you connect hardware and software elements that don’t work with the robot out of the box?

Programming sockets could be the answer to your problems!

Many great tools can help you speed up and augment your robot programming. Offline programming software, path planning algorithms, CAD/CAM programs, and many many more.

All of these tools can be useful, but there is sometimes a problem…

The tools are not easy to integrate with your robot.

It is hard to seamlessly control the robot using software tools that aren’t natively supported by the manufacturer. In the end, you’re often lucky if you can just automatically generate a robot program with the tools that you can then manually copy to the robot’s controller.

And if you want to use the functionality for real-time or online programming, you can feel stuck.

How Flexible is Robot Programming Really?

Despite recent advancements in robot programming, many robot users find themselves struggling with the inflexibility of most programming options.

They feel tied to the constraints of the robot’s controller. Simple programming options or more advanced functionality seem to be out of their reach.

If their robot manufacturer doesn’t provide a feature, they think they can’t use it.

But, the truth is that programming can be extremely flexible, no matter what robot model you are using. When you use the right software “glue,” you can stick together almost any software tool that you like.

One vital type of programming glue is the programming socket.

How Programming Sockets Can Help You?

Programming sockets is a well-established method to generate two-way communication between any two processes on a network. Programmers use them extensively in network programming and they are extremely flexible.

If your robot can be connected to a network — and almost all of them can — then you can most likely use socket communication.

How Socket Programming Works

The basic functionality of a socket is performed by connecting two programming “nodes”: a client node and a server node. The server “listens” for new information arriving over the network. When the client sends some information, the server receives that information and can use it.

For instance, your robot’s controller might act as the server and will listen for new instructions from the network. Your program sends a new position to the robot. The controller will hear this position and move the robot accordingly.

One great benefit of programming sockets is that they are extremely flexible. It doesn’t matter what type of program is sending the information, what programming language it is written in, or what type of information is being sent.

How Programming Sockets is Useful In Robotics

This flexibility means that you can connect almost any software element together and use it to directly control your robot.

Want to use a motion control algorithm but it isn’t available in your chosen robot language? No problem, just run the algorithm on a computer and send the results to the robot via a socket.

Want to use offline programming tools to control your robot in real-time? No problem, just connect the tool to the robot via a socket.

Want to control an end effector that isn’t natively available by your robot’s controller? No problem, just send the control commands via a socket.

Robot Drivers: A Perfect Example of Sockets in Action

You can see the results of using sockets if you use RoboDK to control your robot in real-time.

RoboDK is most famous as an offline programming and simulation tool. However, you might not know that it also comes with a set of drivers to directly control many robot brands via sockets.

These drivers turn the offline programming environment into a powerful online programming tool. When you move the robot in the simulation, the physical robot will move as well.

This also means you can use all the extra advanced functionality that RoboDK provides in real-time too, including our CAD/CAM plugins, motion control algorithm, collision detection, etc.

How to Control Your Robot Using Programming Sockets

You can learn about the RoboDK drivers by going to our documentation page. This includes detailed guides for using these socket-based drivers for many of the most popular robot brands, including ABB, FANUC, Yaskawa, KUKA, and many more.

The drivers are one of the easiest ways to use socket communication and can be used with both the RoboDK GUI and the API.

At the time of writing, we have just updated our FANUC driver and are always updating them to keep up with the latest changes. By using our drivers, you can avoid having to reinvent the wheel by implementing functionality that we have already solved.

You might not even have to type any lines of code!

However, you always have the option of developing your own socket communication for your robot if that better suits your needs. The flexibility of this programming method means that you can do whatever you like with it.

Where to Go If You Need More Help

If you’d like to get started immediately using the RoboDK drivers for top robot brands, just check out our documentation page for instructions on how to use them with your robot.

If you are looking for guidance on a particular programming problem or help using the drivers, just post a question in the RoboDK forum and you’ll get a useful answer either from us or from someone else in the community.

And if you would like to learn how to get started with socket programming with your favorite programming language, there are plenty of great tutorials online for popular languages including Python, C/C++, Java, and more.

How could socket programming improve your next robot project? Tell us in the comments below or join the discussion on LinkedIn, Twitter, Facebook, Instagram, or in the RoboDK Forum.

Alex Owen-Hill

About Alex Owen-Hill

Alex Owen-Hill is a freelance writer and public speaker who blogs about a large range of topics, including science, presentation skills at CreateClarifyArticulate.com, storytelling and (of course) robotics. He completed a PhD in Telerobotics from Universidad Politecnica de Madrid as part of the PURESAFE project, in collaboration with CERN. As a recovering academic, he maintains a firm foot in the robotics world by blogging about industrial robotics.

View all posts by Alex Owen-Hill

Leave a Reply

Your email address will not be published. Required fields are marked *