UnderAutomation
질문이요?

[email protected]

문의하기
UnderAutomation
⌘Q
This page is only available in English.

Connect to the robot

Several connection options allow you to choose which services you want to use through this SDK.

  • Configure the robot
  • IP adresses
  • Enable services
  • Inbound connection
  • Remote mode
  • Firewall and antivirus
  • Connect
  • Disconnect
  • Try it with the Windows example

Configure the robot

IP adresses

Your robot must be accessible via the network from your PC. You must therefore set consistent IP addresses and have the same subnet mask.

To change the IP address in Polyscope, go to the menu at the top right / Settings / System / Network.

Enable services

For each protocol you intend to use (RTDE, Dashboard, Primary, ...), it is necessary to activate it in the settings for security reasons.

Go to the menu at the top right / Settings / Security / Services.

enable remote protocols

Inbound connection

In the menu at the top right / Settings / Security / General, you should not have any restrictions on incoming connections, at least none that prevent access to the TCP ports of the protocols used by the SDK.

inbound connection

Remote mode

To enable command sending (Dashboard command, script sending via Primary Interface, RTDE writing), you must switch to remote mode using the icon at the top right of Polyscope.

To activate this button, you must enable remote mode in the settings.

switch remote

Enable remote control

Firewall and antivirus

It is common for your PC's antivirus and firewall protections to restrict connections to these protocols specific to Universal Robots. If the connection fails, you can temporarily disable your protections to test the connection, if possible.

You can then add the exception to your firewall configuration. The TCP ports used are described in the Services menu of the Polyscope security settings.

Connect

After creating an instance UR of your cobot, you need to call the Connect method to initiate communication with the robot.

This method takes as parameter a ConnectParameters object which describes the functionalities to be activated and the parameters of each feature.

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

Please refer to the specific page for each protocol to understand the parameters.

using UnderAutomation.UniversalRobots;
using UnderAutomation.UniversalRobots.Rtde;
public class Connect
{
static void Main(string[] args)
{
// Create a new robot instance
var robot = new UR();
// Create parameters and enable all services you need
var parameters = new ConnectParameters("192.168.0.1");
// Enable Primary Interface
parameters.PrimaryInterface.Enable = true;
// Select exchanged data
parameters.Rtde.Enable = true;
parameters.Rtde.Frequency = 500; // Hz
parameters.Rtde.InputSetup.Add(RtdeInputData.InputDoubleRegisters, 42);
parameters.Rtde.InputSetup.Add(RtdeInputData.StandardAnalogOutput0);
parameters.Rtde.OutputSetup.Add(RtdeOutputData.ActualTcpPose);
parameters.Rtde.OutputSetup.Add(RtdeOutputData.ActualTcpSpeed);
parameters.Rtde.OutputSetup.Add(RtdeOutputData.ActualTcpForce);
parameters.Rtde.OutputSetup.Add(RtdeOutputData.ActualCurrent);
parameters.Rtde.OutputSetup.Add(RtdeOutputData.InputIntRegisters, 0);
// Enable Dashboard commands
parameters.Dashboard.Enable = true;
// XML-RPC server on port 50000
parameters.XmlRpc.Enable = true;
parameters.XmlRpc.Port = 50000;
// Socket server on port 50001
parameters.SocketCommunication.Enable = true;
parameters.SocketCommunication.Port = 50001;
// Enable SSH commands and files
parameters.Ssh.EnableSsh = true;
parameters.Ssh.EnableSftp = true;
parameters.Ssh.Username = "ur";
parameters.Ssh.Password = "easybot";
// Connect to the robot
robot.Connect(parameters);
//...
// Work with library
//...
robot.Disconnect();
}
}
Class
ConnectParameters
C#Python

Contains parameters to connect to the robot

MemberTypeDescription
ConnectParameters()
Constructor
ConnectParameters(string)
Constructor
Dashboard
Property
DashboardConnectParameters
IP
Property
string
InterpreterMode
Property
InterpreterModeConnectParameters
PingBeforeConnecting
Property
bool
PrimaryInterface
Property
PrimaryInterfaceConnectParameters
Rtde
Property
RtdeConnectParameters
SocketCommunication
Property
SocketCommunicationConnectParameters
Ssh
Property
SshConnectParameters
XmlRpc
Property
XmlRpcConnectParameters

Disconnect

The Disconnect() method stops all services.

Try it with the Windows example

Visit the Download page to get the latest desktop example.


Universal Robots, Fanuc, Yaskawa, ABB 또는 Staubli 로봇을 .NET, Python, LabVIEW 또는 Matlab 애플리케이션에 쉽게 통합

UnderAutomation
문의하기Legal

© All rights reserved.