UnderAutomation
質問ですか?

[email protected]

お問い合わせ
UnderAutomation
⌘Q
このページは英語でのみ提供されています。

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

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.

  • How a user frame is taught
  • The file line by line
  • Read the user frames from a PC
  • What to do with it
  • Cautions
  • Without code
  • See also

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
LineMeaning
//UFRAME nNumber of the user frame
///NAMEName, can be empty
///TOOLThe tool used to teach the three points
///GROUPOne flag per robot: 1 for the robot of this frame
///BASICFRMThe 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
///BASEPPosition of the base axis when the frame was created, zeros without a base axis
////RORG, ////RXX, ////RXYThe three taught points, as axis values (S, L, U, R, B, T, then the 7th to 9th axes)
////BUSERThe 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.

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();
}
}

The text is the same with Http.GetFile("UFRAME.CND") on a YRC1000 or with Ftp.GetFile("UFRAME.CND"). The 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.

See also

  • TOOL.CND: read the tool data
  • Yaskawa controller files: what a backup contains
  • Detect what changed on a robot
  • Positions: the user frame of the current position