---
title: "UFRAME.CND: read the user frames of a Yaskawa robot"
description: "The user frame file of a Motoman controller line by line (RORG, RXX, RXY, BUSER), and a program that reads every user frame from a PC in C# or Python."
---

# UFRAME.CND: read the user frames of a Yaskawa robot

`UFRAME.CND` is the file where a Yaskawa Motoman controller keeps its user frames (user coordinates). This page explains the file line by line, and shows how to read every user frame from a PC in C# or Python.

## How a user frame is taught

A user frame is defined by three positions taught on the pendant, all with the same tool: the origin (`ORG`), a point on the X axis (`XX`) and a point in the XY plane (`XY`). The controller computes the frame from these three points.

## The file line by line

One block per user frame. The file holds only the frames that are defined: when no user frame exists, the pendant cannot save the file.

```
//UFRAME 2
///NAME TABLE
///TOOL 0
///GROUP 1,0,0,0,0,0,0,0,...
///BASICFRM 1,16,0
///BASEP 0.000,0.000,0.000,0.0000,0.0000,0.0000
///PULSE
////RORG C000=1000,-2000,3000,-400,500,-600,0,0,0
////RXX C001=1100,-2100,3100,-410,510,-610,0,0,0
////RXY C002=1200,-2200,3200,-420,520,-620,0,0,0
////BUSER -10.000,20.000,30.000,0.0000,0.0000,-90.0000
```

| Line | Meaning |
| --- | --- |
| `//UFRAME n` | Number of the user frame |
| `///NAME` | Name, can be empty |
| `///TOOL` | The tool used to teach the three points |
| `///GROUP` | One flag per robot: 1 for the robot of this frame |
| `///BASICFRM` | The reference of the frame. The second value is its type: 16 base frame, 19 user frame, 20 master tool frame. The third is the number of the referenced user frame |
| `///BASEP` | Position of the base axis when the frame was created, zeros without a base axis |
| `////RORG`, `////RXX`, `////RXY` | The three taught points, as axis values (S, L, U, R, B, T, then the 7th to 9th axes) |
| `////BUSER` | The frame: X, Y, Z in mm, Rx, Ry, Rz in degrees. It is the offset from the zero of the reference frame to the TCP at the origin point |

`BUSER` gives the frame directly, with no computation: the program below only reads this line.

## Read the user frames from a PC

The SDK downloads the file as text. The program keeps the number, the name and the tool of each frame, and prints its `BUSER` line.

**C# : UframeCndRead**
```csharp
using System.Globalization;
using UnderAutomation.Yaskawa;

public class UframeCndRead
{
    static void Main()
    {
        var robot = new YaskawaRobot();
        robot.Connect("192.168.0.1");

        /**/
        // Download the user frame file and keep a copy on the PC
        string text = robot.HighSpeedEServer.GetFile("UFRAME.CND").Content;
        File.WriteAllText("UFRAME.CND", text);

        // Each frame starts with "//UFRAME n" and ends with "////BUSER x,y,z,rx,ry,rz"
        string frame = "", name = "", tool = "";
        foreach (string raw in text.Split('\n'))
        {
            string line = raw.Trim();
            if (line.StartsWith("//UFRAME ")) frame = line.Substring(9);
            else if (line.StartsWith("///NAME")) name = line.Substring(7).Trim();
            else if (line.StartsWith("///TOOL ")) tool = line.Substring(8);
            else if (line.StartsWith("////BUSER "))
            {
                double[] v = line.Substring(10).Split(',').Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
                Console.WriteLine($"User frame {frame} {name} (tool {tool}): X={v[0]} Y={v[1]} Z={v[2]} Rx={v[3]} Ry={v[4]} Rz={v[5]}");
            }
        }
        /**/

        robot.Disconnect();
    }
}
```

**Python : UframeCndRead**
```python
from underautomation.yaskawa.yaskawa_robot import YaskawaRobot
from underautomation.yaskawa.connect_parameters import ConnectParameters

robot = YaskawaRobot()
robot.connect(ConnectParameters("192.168.0.1"))

##
# Download the user frame file and keep a copy on the PC
text = robot.high_speed_e_server.get_file("UFRAME.CND").content
with open("UFRAME.CND", "w", newline="") as f:
    f.write(text)

# Each frame starts with "//UFRAME n" and ends with "////BUSER x,y,z,rx,ry,rz"
frame = name = tool = ""
for line in (raw.strip() for raw in text.splitlines()):
    if line.startswith("//UFRAME "):
        frame = line[9:]
    elif line.startswith("///NAME"):
        name = line[7:].strip()
    elif line.startswith("///TOOL "):
        tool = line[8:]
    elif line.startswith("////BUSER "):
        v = [float(s) for s in line[10:].split(",")]
        print(f"User frame {frame} {name} (tool {tool}): X={v[0]} Y={v[1]} Z={v[2]} Rx={v[3]} Ry={v[4]} Rz={v[5]}")
##

robot.disconnect()
```

The text is the same with `Http.GetFile("UFRAME.CND")` on a YRC1000 or with `Ftp.GetFile("UFRAME.CND")`. The [Ethernet Server](/yaskawa/documentation/ethernet-server) client also has `GetUserFrame(n)` and `SetUserFrame(n, frame)` in its API, for one frame at a time.

## What to do with it

- **Keep a copy before a change.** After a crash or a change of fixture, the frame of last week is in the file of last week.
- **Compare cells.** Twin cells built on the same drawing have close frames. Read `BUSER` on each robot and look at the differences.
- **Check a fixture.** A vision system or a measure gives where the fixture is. Compare it with `BUSER` to know if the frame must be taught again.

## Cautions

- A job position recorded in a user frame is relative to this frame. Change the frame and the robot goes to another place: check the jobs that use it (`///USER n` in the job header) at low speed.
- Teach the three points with the same tool. The tool is written in `///TOOL`.
- A user frame belongs to the robot it was taught on. Do not copy `UFRAME.CND` to another robot without checking each frame.
- This page reads the file. The write of `UFRAME.CND` is not covered here: test it on your controller first, with a copy of the file.

## Without code

TouchUp, the robot workbench for VS Code, opens `UFRAME.CND` as a form: the name and the six values of `BUSER` of each frame, and the meaning of every field when you point at it. You can edit a frame and send the file back to the controller, and TouchUp refuses while a program runs. See [Tool and user frame files](/touchup/documentation/parameter-and-variable-files).

## See also

- [TOOL.CND: read the tool data](/yaskawa/documentation/yaskawa-tool-cnd-file)
- [Yaskawa controller files: what a backup contains](/yaskawa/documentation/yaskawa-controller-backup-files)
- [Detect what changed on a robot](/yaskawa/documentation/yaskawa-compare-backups-detect-changes)
- [Positions](/yaskawa/documentation/hses-positions): the user frame of the current position