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();
ur.Connect("192.168.0.1");

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("192.168.0.1" // 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
}

Disconnect

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

// Create a new UR instance
var ur = new UR();
ur.Connect("192.168.0.1");
// ...
// Stop connection
ur.Disconnect();
Logo

UnderAutomation
66 Avenue des Champs-Elysées
75008 Paris
FRANCE

© 2021 UnderAutomation - UnderAutomation Universal Robots .NET Communication SDK (Software Development Kit) offre la possibilité de créer des applications personnalisées .NET Core, .NET Framework et .NET Standard qui peuvent communiquer avec tous les robots UR. Des exemples prêts à l'emploi pour Windows, Mac OS et Linux, LabView, Node.js et Python sont fournis. Ce SDK utilise le serveur de Dashboard Server TCP/IP et XML-RPC pour contrôler le robot à distance et le protocole Client Interface pour recevoir et décoder le flux de données.