---
title: "Routing: one protocol per method, chosen at the connection"
description: "How UnderAutomation.Robotics chooses the protocol of each method on a Fanuc, Yaskawa, Universal Robots, ABB or Stäubli controller, with nothing to install. Route explorer, robot.Routing, C# and Python examples."
---

# Routing: one protocol per method, chosen at the connection

A robot controller has several interfaces: a web server, an FTP server, a protocol for the signals, another for the moves. For each method of the common API, UnderAutomation.Robotics chooses the interface, called a route, that answers on your Fanuc, Yaskawa, Universal Robots, ABB or Stäubli controller, and tells you which one it chose and why.

![At Connect, each method takes the first route of its list whose protocol answered. A method with no usable route is not available.](/robotics/documentation/diagrams/route-choice.svg)

## How a route is chosen

Each method has a list of routes for each brand, in a default order. A route is a protocol of the controller, sometimes in a given mode: on Fanuc, the routes `Cgtp` and `CgtpKcl` use the same web server.

At `Connect`, the library tests the protocols of the brand one by one and keeps open the ones that give a route to a method. Each method then takes the first route of its list whose protocol answered. A controller without the SNPX option still reads its state on Fanuc: the method takes the next route of its list. The protocols opened by the test that no method needs are closed.

Three rules follow:

- The route is chosen once, at `Connect`. When a call fails, the library does not try another route. Change the settings and connect again.
- Some routes take control of the robot, for example RMI on Fanuc and Interpreter Mode on Universal Robots. The library never opens them by itself: you enable them in the connection parameters of the brand. They are marked (manual) below.
- A method that has no route on a brand throws `FeatureNotSupportedException`. A method whose routes all failed or are off throws `RouteUnavailableException`. `IsAvailable` of each service returns false in both cases. One exception: on ABB, without the RAPID module, `IsAvailable` returns true for the moves and the call throws `RouteUnavailableException`. See [Errors](/robotics/documentation/errors).

You can change the order: prefer a protocol for every method, set the routes of a group or of one method, or forbid a protocol. See [Routing settings](/robotics/documentation/routing-settings).

## Route explorer

Choose a brand, then switch off the protocols and options that your controller does not have. For each method, the explorer shows the route used, the next route of its list, or "Not available". The routes marked (manual) start switched off: the library opens them only when you enable them. Without JavaScript, the table gives the routes of every brand in the default order.

The explorer is generated from the route data of the library.

Routes of each method in the default order. The first route is used, the next ones are fallbacks. (manual) marks a route that you enable yourself.

| Method | Fanuc | Yaskawa | Universal Robots | ABB | Stäubli |
| --- | --- | --- | --- | --- | --- |
| Info.Read | CGTP (Cgtp), FTP | High Speed Ethernet Server | Dashboard Server | Robot Web Services | SOAP |
| Info.ReadGroups | CGTP (Cgtp), FTP | High Speed Ethernet Server | Dashboard Server | Robot Web Services | SOAP |
| State.Read | SNPX, FTP | High Speed Ethernet Server, Ethernet Server | Dashboard Server, Primary Interface (Primary) | Robot Web Services | Not available |
| State.ServoOn | CGTP (CgtpKcl), Telnet, SNPX, RMI (manual) | High Speed Ethernet Server, Ethernet Server | Dashboard Server, REST API, Primary Interface (Primary) | Robot Web Services | SOAP |
| State.ServoOff | Not available | High Speed Ethernet Server, Ethernet Server | Dashboard Server, REST API, Primary Interface (Primary) | Robot Web Services | SOAP |
| Program.List | CGTP (Cgtp), FTP | High Speed Ethernet Server, Ethernet Server, FTP | SFTP | Robot Web Services | SOAP, Files |
| Program.Select | CGTP (Cgtp) | High Speed Ethernet Server, Ethernet Server | Dashboard Server, REST API | Robot Web Services | SOAP |
| Program.Start | CGTP (Cgtp), CGTP (CgtpKcl), Telnet | High Speed Ethernet Server, Ethernet Server | Dashboard Server, REST API | Robot Web Services | SOAP |
| Program.Pause | CGTP (Cgtp), CGTP (CgtpKcl), Telnet | High Speed Ethernet Server, Ethernet Server | Dashboard Server, REST API | Robot Web Services | SOAP |
| Program.Resume | CGTP (CgtpKcl), Telnet | High Speed Ethernet Server, Ethernet Server | Dashboard Server, REST API | Robot Web Services | SOAP |
| Program.Stop | CGTP (Cgtp), CGTP (CgtpKcl), Telnet | Not available | Dashboard Server, REST API | Robot Web Services | SOAP |
| Program.ReadExecution | SNPX, CGTP (CgtpKcl), Telnet, FTP | High Speed Ethernet Server, Ethernet Server | Dashboard Server, REST API | Robot Web Services | SOAP |
| Program.Hold | CGTP (CgtpKcl), Telnet | High Speed Ethernet Server, Ethernet Server | Not available | Not available | Not available |
| Program.SetCycleMode | Not available | High Speed Ethernet Server, Ethernet Server | Not available | Robot Web Services | Not available |
| Program.SelectAtLine | CGTP (Cgtp) | High Speed Ethernet Server, Ethernet Server | Not available | Robot Web Services | Not available |
| Program.StartAtLine | CGTP (Cgtp) | High Speed Ethernet Server, Ethernet Server | Not available | Robot Web Services | Not available |
| Program.StopTask | CGTP (Cgtp), CGTP (CgtpKcl), Telnet | Not available | Not available | Not available | SOAP |
| Program.Position.Read | FTP, CGTP (Cgtp) | FTP, High Speed Ethernet Server | Not available | Robot Web Services | Not available |
| Program.Position.Write | CGTP (Cgtp) | Not available | Not available | Robot Web Services | Not available |
| Program.Position.SetToCurrent | CGTP (Cgtp) | Not available | Not available | Robot Web Services | Not available |
| Debug.AddBreakpoint | CGTP (CgtpKcl), Telnet | Not available | Primary Interface (Primary) | Robot Web Services | Not available |
| Debug.RemoveBreakpoint | CGTP (CgtpKcl), Telnet | Not available | Primary Interface (Primary) | Not available | Not available |
| Debug.ReadBreakpoints | CGTP (CgtpKcl), Telnet | Not available | Not available | Robot Web Services | Not available |
| Debug.SetStepMode | CGTP (CgtpKcl), Telnet | High Speed Ethernet Server, Ethernet Server | Primary Interface (Primary) | Robot Web Services | Not available |
| Debug.Continue | CGTP (CgtpKcl), Telnet | High Speed Ethernet Server, Ethernet Server | Primary Interface (Primary) | Robot Web Services | Not available |
| Debug.SetTaskStepMode | CGTP (CgtpKcl), Telnet | Not available | Not available | Not available | Not available |
| Debug.ContinueTask | CGTP (CgtpKcl), Telnet | Not available | Not available | Not available | Not available |
| Variable.Read | CGTP (Cgtp), SNPX | High Speed Ethernet Server, Ethernet Server | Dashboard Server, Primary Interface (Primary) | Robot Web Services | Not available |
| Variable.WriteInteger | CGTP (Cgtp), SNPX | High Speed Ethernet Server, Ethernet Server | Interpreter Mode (manual) | Robot Web Services | Not available |
| Variable.WriteReal | CGTP (Cgtp), SNPX | High Speed Ethernet Server, Ethernet Server | Interpreter Mode (manual) | Robot Web Services | Not available |
| Variable.WriteString | CGTP (Cgtp), SNPX | High Speed Ethernet Server, Ethernet Server | Interpreter Mode (manual) | Robot Web Services | Not available |
| Variable.WriteBoolean | CGTP (Cgtp), SNPX | High Speed Ethernet Server, Ethernet Server | Interpreter Mode (manual) | Robot Web Services | Not available |
| Variable.ReadPosition | CGTP (Cgtp), SNPX | Not available | Not available | Robot Web Services | Not available |
| Variable.WritePosition | CGTP (Cgtp), SNPX | Not available | Not available | Robot Web Services | Not available |
| Variable.ReadComment | CGTP (Cgtp), SNPX | High Speed Ethernet Server | Not available | Not available | Not available |
| Variable.WriteComment | CGTP (Cgtp), SNPX | High Speed Ethernet Server | Not available | Not available | Not available |
| Variable.List | CGTP (Cgtp) | High Speed Ethernet Server | Primary Interface (Primary) | Robot Web Services | Not available |
| Variable.ReadMany | CGTP (Cgtp), SNPX | High Speed Ethernet Server, Ethernet Server | Not available | Not available | Not available |
| Io.Read | SNPX, CGTP (Cgtp) | High Speed Ethernet Server, Ethernet Server | RTDE, Primary Interface (Primary) | Robot Web Services | SOAP |
| Io.WriteBoolean | SNPX, CGTP (Cgtp), CGTP (CgtpKcl), Telnet | High Speed Ethernet Server, Ethernet Server | Primary Interface (Script), Interpreter Mode (manual) | Robot Web Services | SOAP |
| Io.WriteNumber | SNPX, CGTP (Cgtp), CGTP (CgtpKcl), Telnet | High Speed Ethernet Server, Ethernet Server | Primary Interface (Script), Interpreter Mode (manual) | Robot Web Services | SOAP |
| Io.ReadComment | CGTP (Cgtp), SNPX | High Speed Ethernet Server | Not available | Not available | Not available |
| Io.WriteComment | CGTP (Cgtp), SNPX | High Speed Ethernet Server | Not available | Not available | Not available |
| Io.List | CGTP (Cgtp) | High Speed Ethernet Server | Not available | Robot Web Services | SOAP |
| Io.ReadMany | SNPX, CGTP (Cgtp) | High Speed Ethernet Server, Ethernet Server | Not available | Not available | SOAP |
| Io.Simulate | CGTP (Cgtp) | Not available | Not available | Not available | Not available |
| Io.Unsimulate | CGTP (Cgtp) | Not available | Not available | Not available | Not available |
| Alarm.ReadActive | SNPX, FTP | High Speed Ethernet Server, Ethernet Server | Primary Interface (Primary), Dashboard Server | Robot Web Services | Not available |
| Alarm.ReadHistory | SNPX, FTP | Not available | Not available | Robot Web Services | Not available |
| Alarm.Reset | SNPX, CGTP (CgtpKcl), Telnet | High Speed Ethernet Server, Ethernet Server | Dashboard Server | Not available | Not available |
| Motion.ReadPose | SNPX, CGTP (Cgtp), RMI (manual), FTP | High Speed Ethernet Server, Ethernet Server | RTDE, Primary Interface (Primary) | Robot Web Services | SOAP |
| Motion.ReadJoints | SNPX, CGTP (Cgtp), RMI (manual), FTP | Not available | RTDE, Primary Interface (Primary) | Robot Web Services | SOAP |
| Motion.ForwardKinematics | CGTP (Cgtp) | Not available | Primary Interface (Primary) | Robot Web Services | SOAP |
| Motion.InverseKinematics | CGTP (Cgtp) | Not available | Primary Interface (Primary) | Robot Web Services | SOAP |
| Motion.ReadUserFrame | RMI (manual) | Not available | Not available | Not available | Not available |
| Motion.ReadTool | RMI (manual) | Not available | Not available | Not available | Not available |
| Motion.MoveJoint | RMI (manual) | Not available | Primary Interface (Script), Interpreter Mode (manual) | Robot Web Services | SOAP |
| Motion.MoveJointToPose | RMI (manual) | High Speed Ethernet Server, Ethernet Server | Primary Interface (Script), Interpreter Mode (manual) | Robot Web Services | SOAP |
| Motion.MoveLinear | RMI (manual) | High Speed Ethernet Server, Ethernet Server | Primary Interface (Script), Interpreter Mode (manual) | Robot Web Services | SOAP |
| Motion.MoveLinearToJoints | RMI (manual) | Not available | Primary Interface (Script), Interpreter Mode (manual) | Robot Web Services | SOAP |
| Motion.StopMotion | RMI (manual) | High Speed Ethernet Server, Ethernet Server | Primary Interface (Script), Dashboard Server | Robot Web Services | SOAP |
| Motion.WaitForMotionEnd | RMI (manual) | High Speed Ethernet Server, Ethernet Server | Dashboard Server, Primary Interface (Primary) | Robot Web Services | Not available |
| Motion.ForwardKinematicsInFrame | CGTP (Cgtp) | Not available | Not available | Not available | Not available |
| Motion.ReadKinematicModel | FTP | High Speed Ethernet Server | Not available | Not available | Not available |
| File.List | FTP, CGTP (Cgtp) | FTP, High Speed Ethernet Server, HTTP | SFTP | Robot Web Services | Files |
| File.Download | FTP | FTP, High Speed Ethernet Server, HTTP | SFTP | Robot Web Services | Files |
| File.ReadBytes | FTP | FTP, High Speed Ethernet Server, HTTP | SFTP | Robot Web Services | Files |
| File.ReadText | FTP, CGTP (Cgtp) | FTP, High Speed Ethernet Server, HTTP | SFTP | Robot Web Services | Files |
| File.Upload | FTP | FTP, High Speed Ethernet Server | SFTP | Robot Web Services | Files |
| File.WriteBytes | FTP | FTP, High Speed Ethernet Server | SFTP | Robot Web Services | Files |
| File.WriteText | FTP | FTP, High Speed Ethernet Server | SFTP | Robot Web Services | Files |
| File.Delete | FTP | FTP, High Speed Ethernet Server | SFTP | Robot Web Services | Files |
| File.Exists | FTP | FTP | SFTP | Robot Web Services | Files |
| File.Rename | FTP | Not available | SFTP | Robot Web Services | Files |
| File.CreateDirectory | FTP | Not available | SFTP | Robot Web Services | Files |
| File.DeleteDirectory | FTP | Not available | SFTP | Robot Web Services | Files |
| File.ReadBytesWithProgress | FTP | FTP, High Speed Ethernet Server, HTTP | SFTP | Robot Web Services | Files |
| File.WriteBytesWithProgress | FTP | FTP, High Speed Ethernet Server | SFTP | Robot Web Services | Files |
| Pendant.ShowMessage | Not available | High Speed Ethernet Server, Ethernet Server | Dashboard Server, REST API | Not available | Not available |

## Prerequisites

- The license of the brand of the controller, or the 30 day trial. See [Licensing](/robotics/documentation/license).
- To read the routes: a connected `RobotController`. See [Connect to your robot](/robotics/documentation/connect).
- To change the routes: the connection parameters of the brand, before `Connect`.

## Example

### Read the route of each method

`robot.Routing` gives the result of the choice made at `Connect`. `GetRoute` returns the route of one method, or the reason why it is not available. `GetReport` returns the protocols and the route of every method as text, for a log or for the support.

**C# : RoutingRoutes**
```csharp
using UnderAutomation.Robotics.Controllers;

public class RoutingRoutes
{
    static void Main()
    {
        RobotController robot = new RobotController();
        robot.Connect(RobotConnectionParameters.Create("fanuc", "192.168.0.1"));

        /**/
        // Route of one method: the protocol it uses, or why it is not available
        RouteInfo route = robot.Routing.GetRoute("Program.Start");
        Console.WriteLine(route.Available ? $"{route.Route} ({route.Protocol})" : route.Reason);

        // Route of every method, as text
        Console.WriteLine(robot.Routing.GetReport());
        /**/

        robot.Disconnect();
    }
}
```

**Python : RoutingRoutes**
```python
from underautomation.robotics.controllers.robot_controller import RobotController
from underautomation.robotics.controllers.robot_connection_parameters import RobotConnectionParameters

robot = RobotController()
robot.connect(RobotConnectionParameters.create("fanuc", "192.168.0.1", ""))

##
# Route of one method: the protocol it uses, or why it is not available
route = robot.routing.get_route("Program.Start")
print(f"{route.route} ({route.protocol})" if route.available else route.reason)

# Route of every method, as text
print(robot.routing.get_report())
##

robot.disconnect()
```

### Read the result of each protocol

`GetProtocols` returns the result of each protocol of the brand at `Connect`: open, no answer, credentials refused, disabled, not needed.

**C# : RoutingProtocols**
```csharp
using UnderAutomation.Robotics.Controllers;

public class RoutingProtocols
{
    static void Main()
    {
        RobotController robot = new RobotController();
        robot.Connect(RobotConnectionParameters.Create("fanuc", "192.168.0.1"));

        /**/
        // Result of the connection of each protocol of the brand
        foreach (ProtocolInfo protocol in robot.Routing.GetProtocols())
            Console.WriteLine($"{protocol.DisplayName}: {protocol.Status}");
        /**/

        robot.Disconnect();
    }
}
```

**Python : RoutingProtocols**
```python
from underautomation.robotics.controllers.robot_controller import RobotController
from underautomation.robotics.controllers.robot_connection_parameters import RobotConnectionParameters

robot = RobotController()
robot.connect(RobotConnectionParameters.create("fanuc", "192.168.0.1", ""))

##
# Result of the connection of each protocol of the brand
for protocol in robot.routing.get_protocols():
    print(f"{protocol.display_name}: {protocol.status.name}")
##

robot.disconnect()
```

### Ask before a call

`IsAvailable` of each service returns false when the method has no route on the brand, or when no route of the method can be used on this connection. A user interface can hide the action.

**C# : RoutingAvailability**
```csharp
using UnderAutomation.Robotics.Controllers;

public class RoutingAvailability
{
    static void Main()
    {
        RobotController robot = new RobotController();
        robot.Connect(RobotConnectionParameters.Create("staubli", "192.168.0.254"));

        /**/
        // False when the brand has no route for the method, or no protocol of the route answered
        if (robot.State.IsAvailable(StateFeature.Read))
        {
            Console.WriteLine(robot.State.Read().Mode);
        }

        try
        {
            robot.State.Read();
        }
        catch (FeatureNotSupportedException ex)
        {
            Console.WriteLine($"{ex.Feature} is not supported on {ex.BrandName}");
        }
        catch (RouteUnavailableException ex)
        {
            Console.WriteLine($"{ex.Feature}: {ex.Message}");
        }
        /**/

        robot.Disconnect();
    }
}
```

**Python : RoutingAvailability**
```python
from underautomation.robotics.controllers.robot_controller import RobotController
from underautomation.robotics.controllers.robot_connection_parameters import RobotConnectionParameters
from underautomation.robotics.controllers.state_feature import StateFeature
from UnderAutomation.Robotics.Controllers import FeatureNotSupportedException, RouteUnavailableException

robot = RobotController()
robot.connect(RobotConnectionParameters.create("staubli", "192.168.0.254", ""))

##
# False when the brand has no route for the method, or no protocol of the route answered
if robot.state.is_available(StateFeature.Read):
    print(robot.state.read().mode.name)

try:
    robot.state.read()
except FeatureNotSupportedException as ex:
    # The exceptions come from the .NET runtime, so their members keep their original names
    print(f"{ex.Feature} is not supported on {ex.BrandName}")
except RouteUnavailableException as ex:
    print(f"{ex.Feature}: {ex.Message}")
##

robot.disconnect()
```

**Matlab : RoutingAvailability**
```matlab
NET.addAssembly(fullfile(pwd, 'net48', 'UnderAutomation.Robotics.dll'));
import UnderAutomation.Robotics.Controllers.*

robot = RobotController();
robot.Connect(RobotConnectionParameters.Create('staubli', '192.168.0.254', ''));

%%
% False when the brand has no route for the method, or no protocol of the route answered
if robot.State.IsAvailable(StateFeature.Read)
    state = robot.State.Read();
    disp(char(state.Mode.ToString()));
end

try
    robot.State.Read();
catch e
    % ExceptionObject is the .NET exception, for example a FeatureNotSupportedException
    if isa(e, 'NET.NetException')
        disp(char(e.ExceptionObject.Message));
    else
        rethrow(e);
    end
end
%%

robot.Disconnect();
```

## Nothing to install

On the PC, there is no software of the robot maker to install: no driver, no USB key. The library is one managed DLL, or one Python package.

On the controller, the library uses the interfaces that the controller already has. For most methods, there is no program to load on the controller. There are two exceptions:

- ABB: the moves need one RAPID module, [UnderAutomationMotion.mod](https://github.com/underautomation/Robotics.NET/blob/main/Rapid/UnderAutomationMotion.mod), loaded once in the motion task of the robot. Without it, the route of the moves is still chosen and `IsAvailable` returns true, but a move throws `RouteUnavailableException` at the call.
- Universal Robots: the variable writes need the interpreter program running on the robot (Interpreter Mode).

Nothing to install does not mean nothing to set. A protocol can need an option of the controller, a function enabled in its network settings, a user and a password, or a mode. For example on Fanuc, SNPX needs the option R553 HMI Device, and RMI needs the option R912. The route explorer below and the page [Which protocol for which task](/robotics/documentation/which-protocol-for-which-task) give what each route needs.

## Reference

In Python, the names are in snake_case: `robot.routing.get_route(...)`, `get_routes()`, `get_protocols()`, `get_report()`. The properties of the results are in snake_case too: `route.available`, `route.reason`.

### Methods of ControllerRouting

`robot.Routing` is a `ControllerRouting`. It reads the routes chosen at `Connect`. To change them, use the routing settings of the connection parameters.

| Method | What it does | Parameters | Result |
| --- | --- | --- | --- |
| `GetRoute` | Returns the route of one method. | `string feature`: path of the method, for example "Program.Start" | `RouteInfo` |
| `GetRoutes` | Returns the route of every method, also the methods that are not available. | None | `RouteInfo[]` |
| `GetProtocols` | Returns the result of each protocol of the brand, in the order of the brand. Empty when not connected. | None | `ProtocolInfo[]` |
| `GetReport` | Returns the protocols and the route of every method as readable text, for logs and support. | None | `string` |

`GetRoute` throws `ArgumentException` when the path is not a method of the common API.

### RouteInfo

| Property | Type | Content |
| --- | --- | --- |
| `Feature` | `string` | Path of the method, for example "Program.Start". |
| `Route` | `string` | Name of the route used by the method. Empty when the method is not available. |
| `Protocol` | `string` | Name of the protocol of the route. Empty when the method is not available. |
| `Available` | `bool` | True when the method can be called. |
| `Reason` | `string` | Why this route was chosen, for example a setting of the method or the default order of the brand, or why the method is not available. The text is for display and logs: it can change in a later version, do not compare it in code. |
| `IsWrite` | `bool` | True when the method changes the controller or moves the robot. False when it only reads. |

`ProtocolInfo` and its `ProtocolStatus` values are described on the page [Errors](/robotics/documentation/errors).

## What to read next

- [Routing settings](/robotics/documentation/routing-settings): prefer, set or forbid a route, and enable a manual route.
- [Which protocol for which task](/robotics/documentation/which-protocol-for-which-task): the routes of each brand and of each method.
- [Errors](/robotics/documentation/errors): the exceptions of a method without a usable route.
- The pages of the services: [Info](/robotics/documentation/info), [State](/robotics/documentation/state), [Program](/robotics/documentation/program), [Debug](/robotics/documentation/debug), [Variable](/robotics/documentation/variable), [Io](/robotics/documentation/io), [Alarm](/robotics/documentation/alarm), [Motion](/robotics/documentation/motion), [File](/robotics/documentation/file), [Pendant](/robotics/documentation/pendant).