Connect to your robot
Prepare the controller (remote mode, job selection, file overwrite), then connect the SDK over the High Speed Ethernet Server: ports, timeouts, errors and disconnection.
This page explains how to connect the SDK to a Yaskawa Motoman controller: the settings of the controller, the connection parameters, the errors and the disconnection. The SDK uses the High Speed Ethernet Server of the controller, over UDP. Nothing is installed on the controller.
Prerequisites
- The PC reaches the controller on the network. Its address is shown in the network settings of the controller, on the pendant.
- The High Speed Ethernet Server function is enabled on the controller. It answers on the UDP ports 10040 (data) and 10041 (files). A firewall between the PC and the controller must let these ports through.
- The controller is one of: YRC1000 (micro), MOTOMAN NEXT, DX100 / DX200, FS100, ERC / XRC / MRC.
The read methods work in any mode. The commands (servo, motion, job start, file write) need the settings below.
Prepare the controller
Each setting is made once, on the programming pendant, with the management mode set to Security mode.
Enable the remote commands
- Select
IN/OUT>PSEUDO INPUT SIGNAL. - Move the cursor to
#82015 CMD REMOTE SELand pressINTER LOCK+SELECT.

Put the key in the remote position
The commands need the key of the pendant in the remote position.

To use the key for the remote control, copy #80011 (key in the remote position) to #40042 (remote control enabled) with the ladder editor:
- Select
IN/OUT>LADDER EDITOR. - Check that no other rung writes
#40042, then add this rung:

GetStatusInformation().CommandRemote is true when the controller accepts the remote commands.
Allow the job selection
- Select
SETUP>FUNCTION ENABLE. - Set
JOB SELECT WHEN REMOTE AND PLAYtoPERMIT. On the Smart Pendant, set the parameterSC2 224to0.

Allow the file overwrite
To send a file that already exists on the controller:
- Select
PARAMETER>RS. - Set
RS029to1andRS214to1.
Quick connection
Pass the address of the controller. The other parameters keep their default values.
static void Main(){var robot = new YaskawaRobot();// IP address of the controller, default ports and timeoutsrobot.Connect("192.168.0.1");// Every function of the SDK is a method of robot.HighSpeedEServervar status = robot.HighSpeedEServer.GetStatusInformation();Console.WriteLine($"Servo on: {status.ServoOn}, play mode: {status.Play}");robot.Disconnect();}}
YaskawaRobot gives access to every function of the SDK, through its HighSpeedEServer property.
Connection parameters
ConnectParameters holds every option. Use it when the controller has other ports, or when the network needs longer timeouts.
static void Main(){var parameters = new ConnectParameters("192.168.0.1");// Ping the controller first (default: true)parameters.PingBeforeConnect = true;// UDP ports of the High Speed Ethernet Server (defaults: 10040 and 10041)parameters.HighSpeedEServer.DataPort = 10040;parameters.HighSpeedEServer.FilePort = 10041;// Time to wait for an answer, in millisecondsparameters.HighSpeedEServer.DataTimeoutMilliseconds = 1500;parameters.HighSpeedEServer.PowerOnTimeoutMilliseconds = 8000;parameters.HighSpeedEServer.FileTimeoutMilliseconds = 4000;var robot = new YaskawaRobot();robot.Connect(parameters);robot.Disconnect();}
| Parameter | Default | Meaning |
|---|---|---|
IP | none | IP address or host name of the controller |
PingBeforeConnect | true | Send a ping first. The connection fails if there is no answer in 200 ms |
HighSpeedEServer.Enable | true | Open the High Speed Ethernet Server client |
HighSpeedEServer.DataPort | 10040 | UDP port of the data commands |
HighSpeedEServer.FilePort | 10041 | UDP port of the file transfers |
HighSpeedEServer.DataTimeoutMilliseconds | 1500 | Time to wait for the answer of a data command |
HighSpeedEServer.PowerOnTimeoutMilliseconds | 8000 | Time to wait for the answer of ServoCommand(Servo, true) |
HighSpeedEServer.FileTimeoutMilliseconds | 4000 | Time to wait for the answer of a file transfer |
The ping also protects the controller: a request sent while the controller starts can raise an error on it. Set PingBeforeConnect to false only when a firewall blocks ICMP between the PC and the controller.
UDP: what "connected" means
UDP has no connection. Connect checks the license, sends the ping and opens the socket: it does not exchange a message with the controller. The first method call is the first exchange. If the controller does not answer, this call fails after DataTimeoutMilliseconds.
To check the link at startup, call a read method, for example GetStatusInformation(), right after Connect.
Connected is true while the socket is open.
Standalone client
HighSpeedEServerClient opens a High Speed Ethernet Server client without YaskawaRobot. The methods are then directly on the client: client.GetStatusInformation() instead of robot.HighSpeedEServer.GetStatusInformation().
static void Main(){// A High Speed Ethernet Server client without YaskawaRobotvar client = new HighSpeedEServerClient();client.Connect("192.168.0.1", new HighSpeedEServerConnectParameters());// The methods are directly on the clientRobotStatusData status = client.GetStatusInformation();Console.WriteLine($"Running: {status.Running}");client.Close();}}
Errors
{var robot = new YaskawaRobot();try{robot.Connect("192.168.0.1");robot.HighSpeedEServer.StartJob();}catch (InvalidLicenseException ex){// No valid license: the trial is over, or the key is wrongConsole.WriteLine(ex.LicenseInfo);}catch (ConnectException ex){// The UDP socket could not be openedConsole.WriteLine($"{ex.Address}: {ex.Message}");}catch (InvalidDataAnswerException ex){// The controller refused the command, for example "Servo OFF" or "Command remote not set"Console.WriteLine($"{ex.Message} ({ex.Status}, {ex.AddedStatus})");}catch (SocketException ex){// No answer before the timeoutConsole.WriteLine(ex.Message);}catch (Exception ex){// For example, no answer to the pingConsole.WriteLine(ex.Message);}}}
| Exception | When |
|---|---|
InvalidLicenseException | Connect is called without a valid license. See Licensing |
Exception | No answer to the ping, or a method is called before Connect |
ConnectException | The UDP socket could not be opened. Address gives the address and the port |
SocketException | No answer before the timeout, or the port is closed |
InvalidDataAnswerException | The controller refused the command. Message gives the reason, Status and AddedStatus the codes |
Frequent messages of InvalidDataAnswerException, and what to check:
| Message | Check |
|---|---|
Command remote not set | The remote mode, see Prepare the controller |
Incorrect mode | The mode of the controller: play mode to start a job |
Servo OFF | Switch the servo on first |
Error/alarm occurring | Reset the alarm, see Alarms |
Hold by programming pendant, External hold | Release the hold on the pendant or on the external signal |
Cannot over write the target file | RS029 and RS214, see Allow the file overwrite |
Disconnect
Disconnect closes the sockets. Call it when your application ends, or when it no longer needs the controller.
var robot = new YaskawaRobot();robot.Connect("192.168.0.1");// True while the UDP socket is openConsole.WriteLine(robot.Connected);// Close the sockets when the application no longer needs the controllerrobot.Disconnect();}}
Try it in the demo application
Everything on this page can be tried without writing code, in the Connection page of the demo application.

The demo application is open source. The C# source of this page is ConnectControl.cs.
Reference
Contains a set of connection parameters for robot communication.
| Member | Type | Description |
|---|---|---|
ConnectParameters() Constructor | Creates a new set of connect parameters | |
ConnectParameters(string) Constructor | Creates a new set of connect parameters and defines IP property | |
HighSpeedEServer Property | HighSpeedEServerConnectParametersInternal | High Speed Ethernet Server connect parameters |
IP Property | string | IP Adress or robot host name |
PingBeforeConnect Property | bool | Send a ping command before connecting |
Represents a set of High Speed Ethernet Server connection parameters
| Member | Type | Description |
|---|---|---|
HighSpeedEServerConnectParametersInternal() Constructor | ||
Enable Property | bool | Gets or sets a value indicating whether to enable the High Speed Ethernet Server connection (default: true). |
Base class defining connection parameters for the High Speed Ethernet Server communication. This class cannot be instantiated directly; use a derived class or use Connect with optional parameters. Allows customization of timeouts and ports for different network environments.
| Member | Type | Description |
|---|---|---|
HighSpeedEServerConnectParameters() Constructor | Initializes a new instance of the connection parameters class. | |
DataPort Property | int | Gets or sets the UDP port number for data communication. Must match the robot controller's High Speed Ethernet Server data port configuration. Default: 10040. |
DataTimeoutMilliseconds Property | int | Gets or sets the maximum time in milliseconds to wait for a response to data commands. Applies to most read/write operations like position reading, variable access, etc. Default: 1500ms. |
FilePort Property | int | Gets or sets the UDP port number for file transfer operations. Must match the robot controller's High Speed Ethernet Server file port configuration. Default: 10041. |
FileTimeoutMilliseconds Property | int | Gets or sets the maximum time in milliseconds to wait for file operation responses. File operations may be slower due to larger data transfers and disk I/O on the controller. Default: 4000ms. |
PowerOnTimeoutMilliseconds Property | int | Gets or sets the maximum time in milliseconds to wait for servo power on to complete. Servo power on may take longer due to brake release and motor initialization. Default: 8000ms. |
DEFAULT_DATA_PORT Field | int | Default UDP port for data communication (10040). |
DEFAULT_DATA_TIMEOUT_MILLISECONDS Field | int | Default timeout in milliseconds for data commands (1500ms). |
DEFAULT_FILE_PORT Field | int | Default UDP port for file transfer operations (10041). |
DEFAULT_FILE_TIMEOUT_MILLISECONDS Field | int | Default timeout in milliseconds for file operations (4000ms). |
DEFAULT_POWER_ON_TIMEOUT_MILLISECONDS Field | int | Default timeout in milliseconds for servo power on operations (8000ms). |
Exception thrown when connection to a Yaskawa robot fails
| Member | Type | Description |
|---|---|---|
Address Property read only | string | Address of the robot (IP:port or serial port name) |
Service Property read only | string | Name of the protocol that failed to connect |
Exception thrown when the robot controller returns an error response to a High Speed Ethernet Server command. This exception contains detailed status codes that help identify the specific error condition.
| Member | Type | Description |
|---|---|---|
AddedStatus Property read only | int | Gets the additional status code providing more detailed error information. The interpretation of this value depends on the primary Status code. |
Status Property read only | int | Gets the primary status code returned by the robot controller. A value of 0 indicates success; any other value indicates an error condition. |