Connect to the robot

Connect to a UR robot

Initialize a TCP communication with a robot. The Connect() method take the hostname (ur-xxx) of the robot or its IP address that you can find in the "About Dialog-Box" in PolyScope.

If this method is called with only the IP as parameter the XML-RPC server is started on port 50000 and the data streaming is enabled on Primary Port.

using UnderAutomation.UniversalRobots;
// Create a new UR instance
var ur = new UR();

The Connect() method can throw a InvalidLicenseException if your trial period is over or if your license key is invalid.

Connection parameters

The Connect() method has optionnal parameters that can be used to set up the connection. If none of the optional parameters are used, the data streaming takes place on the Primary Port, the XML-RPC server starts on port 50000 and the robot is pinged at the connection.

// Initialize a connection to the robot
public void Connect(string ip, bool enableDataStreaming = true, DataStreamingPorts dataStreamingPort = DataStreamingPorts.PrimaryClient, bool enableXmlRpcServer = true, int xmlRpcServerPort = 50000, bool pingRobotBeforeConnect = true, bool enableSSH = true, bool enableSFTP = true, string login = "ur", string password = "easybot")
// Create a new UR instance
var ur = new UR();
ur.Connect("" // IP of the robot
,true // Enable Data Streaming
,DataStreamingPorts.SecondaryClient // Use secondary port for data streaming
,true // Enable XML-RPC
,40000 // Use local port 40000 instead of 50000 to host the XML-RPC server
,false // Do not ping the robot
Members of DataStreamingPorts :
public enum DataStreamingPorts {
// The default port that allow reading data and sending URScript
PrimaryClient = 30001,
// This port can only read data. It is unable to send URScript.
PrimaryClientReadOnly = 30011,
// The secondary port with same features as PrimaryClient
SecondaryClient = 30002,
// A secondary port that can only read data. It is unable to send URScript.
SecondaryClientReadOnly = 30012


The Disconnect() method stops all services including the data streaming and the XML-RPC server.

// Create a new UR instance
var ur = new UR();
// ...
// Stop connection

66 Avenue des Champs-Elysées
75008 Paris

© 2021 UnderAutomation - El SDK (kit de desarrollo de software) de comunicación de UnderAutomation Universal Robots .NET ofrece la posibilidad de crear aplicaciones personalizadas de .NET Core, .NET Framework y .NET Standard que pueden comunicarse con todos los robots UR. Se proporcionan ejemplos listos para usar para Windows, Mac OS y Linux, LabView, Node.js y Python. Utiliza TCP/IP Dashboard Server y XML-RPC para controlar a distancia el robot y la interfaz de cliente para recibir y decodificar el flujo de datos.