UnderAutomation
Eine Frage?

[email protected]

Kontakt
UnderAutomation
⌘Q
Diese Seite ist nur auf Englisch verfügbar.

Detect what changed on a Yaskawa robot

Back up the jobs, TOOL.CND, UFRAME.CND and data files of every Yaskawa robot of a line each night, and see in a Git history which tool, frame or job changed.

  • Which files to compare
  • A nightly backup in Git
  • Read the result
  • Go further
  • Without code
  • See also

A robot of the line does not behave like yesterday. Which job, tool or user frame changed, when, and what was the old value? This page shows a small program that backs up the text files of every Yaskawa Motoman controller of a line each night, and keeps them in Git: the history then answers these questions line by line.

Which files to compare

FileWhat a change meansCompare
Jobs (*.JBI)A point touched up, an instruction addedYes, line by line
TOOL.CNDA TCP or a tool load changedYes, one line per value
UFRAME.CNDA user frame taught againYes
VAR.DATVariables changed by the jobs or by an operatorYes, but it changes in production
SC.PRM, ALL.PRMA parameter changed in management modeYes, may need the rcmaster account
CIOPRG.LSTThe ladder changedYes
ALMHIST.DATNew alarmsIt changes after every alarm
CMOS.BINAnythingNo: a binary image shows no difference you can read

All these files are text, except CMOS.BIN. See Yaskawa controller files for the content of each one.

A nightly backup in Git

The program connects to each robot with FTP, downloads its jobs, condition files and data files into one folder per robot, then makes one Git commit for the whole line. Create the repository once with git init, then start the program each night from the task scheduler of Windows, or from cron.

using System.Diagnostics;
using UnderAutomation.Yaskawa;
using UnderAutomation.Yaskawa.Common;
public class BackupFleetGit
{
static void Main()
{
string[] robots = { "192.168.0.1", "192.168.0.2", "192.168.0.3" };
string root = @"C:\RobotBackups"; // a Git repository: run "git init" there once
foreach (string ip in robots)
{
var parameters = new ConnectParameters(ip);
parameters.Ftp.Enable = true;
parameters.Ftp.FtpUser = "ftp";
var robot = new YaskawaRobot();
robot.Connect(parameters);
// Start from an empty folder: a job deleted on the robot is then deleted in Git too
string folder = Path.Combine(root, ip);
if (Directory.Exists(folder)) Directory.Delete(folder, true);
foreach (FileExtension type in new[] { FileExtension.JOB, FileExtension.CND, FileExtension.DAT })
robot.Ftp.DownloadFilesToLocal(robot.Ftp.GetFileList(type), Path.Combine(folder, type.ToString()));
robot.Disconnect();
}
// One commit per run: "git log -p" then shows what changed, robot by robot and line by line
Process.Start(new ProcessStartInfo("git", "add -A") { WorkingDirectory = root }).WaitForExit();
Process.Start(new ProcessStartInfo("git", $"commit -m \"Backup {DateTime.Now:yyyy-MM-dd}\"") { WorkingDirectory = root }).WaitForExit();
}
}

Add FileExtension.PRM and FileExtension.LST to the list for the parameters and the ladder, with an account that can read them (see FTP). DownloadFilesToLocal downloads several files in one call: it is the fastest way for a full backup.

Read the result

git log -p, or the history of any Git client, gives the changes of each night. A changed TCP is one line of TOOL.CND:

//TOOL 3
///NAME WELD
-0.000,0.000,210.500,0.0000,0.0000,0.0000
+0.000,0.000,212.000,0.0000,0.0000,0.0000

Here the Z of tool 3 went from 210.5 mm to 212.0 mm. In the same way, a touched up point is a changed line of the job, and a user frame taught again is a changed BUSER line of UFRAME.CND.

Go further

  • Alert. Run git diff --stat HEAD~1 after the commit and send the list of changed files by e-mail, or open a ticket in your maintenance system.
  • Restore. An old version of a job is in the history: send it back with LoadFile, see Transfer files and backups.
  • Twin cells. Compare the folders of two robots with the same tooling: a different TCP between them is visible at once.

Yaskawa has its own tools for scheduled backups. The SDK is the option when the result must go into your own system: Git, a MES, a ticket or an e-mail.

Without code

TouchUp, the robot workbench for VS Code, backs up a controller in one click, compares two backups or a robot with its last backup, and hides the noise of each brand so that only the real changes are shown. See Compare and Back up a controller.

See also

  • Yaskawa controller files: what a backup contains
  • TOOL.CND: read the tool data
  • UFRAME.CND: read the user frames
  • FTP file transfers