Sign in

The COMTRADE file format explained (IEEE C37.111)

What is inside the .cfg, .dat, .hdr, .inf and .cff files of IEEE C37.111: channel definitions, scaling, sample rates, time stamps, and the differences between the 1991, 1999 and 2013 revisions.

Updated · SagSwell

COMTRADE (Common Format for Transient Data Exchange) is the file format that protection relays, digital fault recorders and power-quality meters use to exchange records of what they measured. It is defined by IEEE C37.111; the 2013 revision was published jointly as IEC 60255-24. Three revisions are in use: 1991, 1999 and 2013, and a reader has to handle all three because recorders in service write all three.

The files of a record

FileHoldsNeeded?
.cfgConfiguration, in plain text: station and device, every channel with its scaling, the sampling rates, the time stamps and the data type of the .datYes
.datThe samples: one row per sample with a sample number, a time stamp, every analog value and every status bitYes
.hdrFree text from the recorder, for people to readNo
.infExtra information in sections, including vendor-specific ones (1999 and later)No
.cffAll of the above in one file, in marked sections (2013)Instead of the separate files

Inside the .cfg

The .cfg is read line by line, in a fixed order:

  1. Station name, recording device and revision year (the year is missing in 1991 files).
  2. Channel counts: the total, then the number of analog (A) and status (D) channels, for example 12,8A,4D.
  3. One line per analog channel: index, name, phase, circuit component, unit, the multiplier a and offset b, time skew, minimum and maximum raw value, and (from 1999) the primary and secondary ratios with a flag saying whether the samples are in primary or secondary units.
  4. One line per status channel: index, name, phase, circuit component and the normal state.
  5. Line frequency, nominally 50 or 60 Hz.
  6. Sampling rates: how many rates the record uses, then each rate with the last sample number recorded at it.
  7. Two time stamps: the first sample, and the trigger point.
  8. File type of the .dat: ASCII, BINARY, and from 2013 BINARY32 and FLOAT32.
  9. Time multiplier for the time stamps in the .dat (1999 and later), and in 2013 the time-zone codes and time-quality fields.

A sample is turned into a physical value as value = a × raw + b. Getting the primary and secondary ratios wrong is the most common reason a record shows currents a thousand times too large or voltages in the wrong unit.

TILBURY DOCKS 400V MCC,PQM-11,2013
7,4A,3D
1,VA,A,,V,0.0122,0,0,-32767,32767,400,400,P
...
50
1
6400,7680
25/09/2026,03:21:44.000000
25/09/2026,03:21:44.100000
BINARY
1

A shortened .cfg of the kind SagSwell’s demo records use. Values are illustrative.

Inside the .dat

Each sample is one row. In an ASCII .dat it is a line of comma-separated numbers: sample number, time stamp, the analog values in channel order, then the status values as 0 or 1. In a binary .dat the same row is packed: a 4-byte sample number, a 4-byte time stamp, each analog value as a 2-byte integer (BINARY), a 4-byte integer (BINARY32) or a 4-byte float (FLOAT32), and the status channels packed sixteen to a 2-byte word. Binary values are little-endian.

The time stamp column counts in microseconds (times the time multiplier) from the first sample. When the .cfg declares a sampling rate, the rate sets the time axis; the time stamps become the time axis when the .cfg declares no fixed rate.

1991, 1999 and 2013: what changed

RevisionMain differences a reader meets
1991No revision year on the first line. Dates written mm/dd/yy. No primary/secondary ratios. ASCII or 2-byte binary only.
1999Revision year on line 1. Dates dd/mm/yyyy. Primary and secondary ratios with the P/S flag. Time multiplier. The optional .inf file.
2013 (IEC 60255-24)BINARY32 and FLOAT32 data types. Time-zone and time-quality fields. The single-file .cff format.

What goes wrong in real files

The standard is clear; recorders are not always. Records in the field turn up with mm/dd dates in a 1999 file, a sample count in the .cfg that the .dat does not reach, empty time stamps, channels whose declared minimum and maximum do not match the data, and phase labels in the channel name rather than the phase field. A good reader says what it had to assume instead of guessing silently. SagSwell’s file check lists what it found and what it assumed for each record you open.

Every field of a real .cfg is taken apart in the COMTRADE .cfg file, line by line. To see a record rather than read about one, open it in SagSwell, check it with the COMTRADE file checker, or convert it to CSV.

Questions people ask

What is a COMTRADE file?
A record of measured voltages, currents and status signals written by a protection relay, digital fault recorder or power-quality meter in the format of IEEE C37.111 (IEC 60255-24). A record is a .cfg that describes the channels and a .dat that holds the samples, or both in one .cff.
What is the difference between the .cfg, .dat and .cff files?
The .cfg is plain-text configuration: channels, scaling, sampling rates, time stamps and data type. The .dat holds the samples, as text or binary. The .cff, added in 2013, carries the .cfg, .dat and the optional .hdr and .inf in one file.
How do I tell which COMTRADE revision a file is?
Read the end of the first line of the .cfg: 1999 or 2013 for those revisions. No year there means 1991. Some meters write 2001, the year of the IEC 60255-24 edition that matches C37.111-1999.
Is COMTRADE the same as IEC 60255-24?
Yes for current files: the 2013 revision was published jointly as IEEE C37.111-2013 and IEC 60255-24:2013. The earlier IEC edition of 2001 is technically identical to C37.111-1999.
Can I open a COMTRADE file in Excel?
Not usefully as it is, because the .dat holds raw numbers that only mean something after the scaling in the .cfg is applied. Convert it with a COMTRADE to CSV converter first; the CSV opens in Excel with values in volts and amps.

References

  • IEEE Std C37.111-2013 / IEC 60255-24:2013, Measuring relays and protection equipment – Part 24: Common format for transient data exchange (COMTRADE) for power systems
  • IEEE Std C37.111-1999, IEEE Standard Common Format for Transient Data Exchange (COMTRADE) for Power Systems
  • IEEE Std C37.111-1991, the original COMTRADE standard

Free tools

More guides