UnderAutomation
Une question ?

[email protected]

Contactez-nous
UnderAutomation
⌘Q
Cette page est disponible uniquement en anglais.

Export the alarm history of a Yaskawa robot

Download ALMHIST.DAT, the alarm history of a Motoman controller, turn it into a CSV file with the code, job, line and date of each alarm, and find the alarms that come back.

  • What ALMHIST.DAT contains
  • Export to CSV
  • What to do with it
  • Live alarms or history
  • Without code
  • See also

Which alarm stops this robot every week, and in which job? A Yaskawa Motoman controller keeps its alarm history in the file ALMHIST.DAT. This page shows what the file contains, and how to download it from a PC and turn it into a CSV file in C# or Python.

What ALMHIST.DAT contains

The controller keeps the last 100 alarms of each category. Errors (the messages that do not stop the robot) are not stored. On the pendant, the history is in SYSTEM INFO > ALARM HISTORY, and EX. MEMORY > SAVE > SYSTEM DATA saves the file.

SectionCategory
///MAJORMajor alarms
///MINORMinor alarms
///IO_SYSUser alarms (system)
///IO_USRUser alarms (user)
///OFFLINEOff-line alarms

These are the section titles of a DX200 file. Each alarm is a record of a few lines (invented values):

4107,OUT OF RANGE(ABSO DATA),ROBOT1,[SLURBT],[000100],PLAY,
PICK,12,5,STOP
,0,0,********
,0,0,********
,0,0,********
2026/10/14 08:12:40
LineContent
FirstAlarm code, name, axis data, mode
SecondJob, line, step at the time of the alarm
LastDate and time

The layout of the record comes from a DX200, and it can differ with the controller and its software. The parser below keeps only the fields it needs and skips the lines it does not know.

Export to CSV

The program reads the file through the web server of the controller (YRC1000 and YRC1000micro, no account, any mode), saves a copy, writes one CSV line per alarm, and prints the five alarms that come back most often.

using System.Text.RegularExpressions;
using UnderAutomation.Yaskawa;
public class AlarmHistoryCsv
{
static void Main()
{
var parameters = new ConnectParameters("192.168.0.1");
parameters.Http.Enable = true;
var robot = new YaskawaRobot();
robot.Connect(parameters);
string text = robot.Http.GetFile("ALMHIST.DAT");
File.WriteAllText("ALMHIST.DAT", text); // the file that Yaskawa support asks for
// A record: "code,name,axis data,mode,..." (mode is the 6th field), "job,line,step,...", other lines, the date
var rows = new List<string[]>();
string category = "";
string[] alarm = null, job = null;
foreach (string raw in text.Split('\n'))
{
string line = raw.Trim();
if (line.StartsWith("///")) { category = line.Substring(3); alarm = null; }
else if (alarm == null)
{
string[] f = line.Split(',');
if (f.Length > 2 && int.TryParse(f[0], out _)) { alarm = f; job = null; }
}
else if (job == null) job = line.Split(',');
else if (Regex.IsMatch(line, @"^\d{4}/\d\d/\d\d \d\d:\d\d"))
{
rows.Add(new[] { category, alarm[0], alarm[1], alarm.ElementAtOrDefault(5), job[0], job.ElementAtOrDefault(1), job.ElementAtOrDefault(2), line });
alarm = null;
}
}
File.WriteAllLines("alarms.csv", rows.Select(r => string.Join(";", r)).Prepend("Category;Code;Name;Mode;Job;Line;Step;Date"));
// The alarms that come back most often, and the job where they occur
foreach (var g in rows.GroupBy(r => $"{r[1]} {r[2]} in {r[4]}").OrderByDescending(g => g.Count()).Take(5))
Console.WriteLine($"{g.Count()} x {g.Key}");
robot.Disconnect();
}
}

On a controller without the web server, read the file with the High Speed Ethernet Server: HighSpeedEServer.GetFile("ALMHIST.DAT").Content. With FTP, Ftp.GetFile("ALMHIST.DAT") needs the ftp account, because the file is in the system data. See FTP.

Example of output (invented values):

12 x 4107 OUT OF RANGE(ABSO DATA) in PICK
5 x 4315 COLLISION DETECT in WELD01

What to do with it

  • Find the recurring alarm. Count per code and per job: the job and the line point to the place in the program.
  • Compare robots. The same export on every robot of a line shows the cell that stops more than the others.
  • Open a ticket. Yaskawa support asks for ALMHIST.DAT. The program saves it next to the CSV: attach it as it is.

Live alarms or history

NeedUse
Know at once that the robot stopsGetAlarm: the 4 most recent alarms, read in a loop. See Read and reset alarms
Know why it stops every weekALMHIST.DAT: 100 alarms per category, with the job and the line

Live, the SDK reads the 4 most recent alarms: the longer history comes from the file.

Without code

TouchUp, the robot workbench for VS Code, saves ALMHIST.DAT with the other system data in a Yaskawa backup, and compares two backups. See Back up a controller.

See also

  • Alarms: the reference of the alarm methods
  • Yaskawa controller files: what a backup contains
  • Read the operating hours
  • HTTP: read files from the web server