Sign in

The COMTRADE .cfg file, line by line (with an annotated example)

A real COMTRADE configuration file taken apart one line at a time: station and revision, channel counts, every field of an analog and a status channel, scaling with a and b, primary and secondary ratios, sampling rates, time stamps, file type and time multiplier.

Updated · SagSwell

The .cfg is the half of a COMTRADE record that people can read. It is plain text, one field after another in a fixed order, and everything a reader knows about the samples in the .dat comes from it. This guide takes a complete .cfg from a fault record and explains every line. The record is FDR-2214, one of SagSwell’s free sample files: a single-line-to-ground fault on a 132 kV line, written to the 2013 revision of IEEE C37.111.

The whole file

ASHFORD 132kV,SEL-411L / REC-01,2013
8,6A,2D
1,VA,A,BUS1,kV,0.005,0,0,-32767,32767,1150,10,P
2,VB,B,BUS1,kV,0.005,0,0,-32767,32767,1150,10,P
3,VC,C,BUS1,kV,0.005,0,0,-32767,32767,1150,10,P
4,IA,A,LINE1,A,0.5,0,0,-32767,32767,600,1,P
5,IB,B,LINE1,A,0.5,0,0,-32767,32767,600,1,P
6,IC,C,LINE1,A,0.5,0,0,-32767,32767,600,1,P
1,52A TRIP,,,0
2,PROT PICKUP,,,0
50
1
4800.0,2400
25/09/2026,03:14:07.128000
25/09/2026,03:14:07.276000
ASCII
1

Line by line

LineTextMeaning
1ASHFORD 132kV,SEL-411L / REC-01,2013Station name, recording device and revision year. A 1991 file has no year here. Some meters write 2001, the year of the IEC 60255-24 edition that matches C37.111-1999.
28,6A,2DTotal channels, then the number of analog (A) and status (D) channels. 6 + 2 = 8.
3–81,VA,A,BUS1,kV,0.005,0,0,…One line per analog channel. The fields are explained in the next table.
9–101,52A TRIP,,,0One line per status channel: index, name, phase, circuit component, and the normal state (0 or 1). Phase and component are often left empty for contacts, as here.
1150Nominal line frequency in Hz.
121How many sampling rates the record uses. Most use one; some recorders switch to a lower rate after the fault. 0 means there is no fixed rate and the time stamps in the .dat are the time axis.
134800.0,2400One line per rate: samples per second, and the number of the last sample taken at that rate. 2400 samples at 4800 Hz is 0.5 s of record, 96 samples per cycle at 50 Hz.
1425/09/2026,03:14:07.128000Date and time of the first sample, dd/mm/yyyy (1999 and later; 1991 used mm/dd/yy).
1525/09/2026,03:14:07.276000Date and time of the trigger. Here 148 ms after the first sample, so the record holds 148 ms of pre-fault data.
16ASCIIData type of the .dat: ASCII, BINARY (2-byte integers), and from 2013 BINARY32 and FLOAT32.
171Time multiplier for the time-stamp column of the .dat (1999 and later). With 1, a time stamp counts microseconds.

The 2013 revision adds two lines after the time multiplier: the offset of the time stamps from UTC with the recorder’s local offset, and the time-quality code of the recorder’s clock with a leap-second indicator. The sample file stops at the time multiplier; SagSwell reads a .cfg with or without them.

An analog channel, field by field

1,VA,A,BUS1,kV,0.005,0,0,-32767,32767,1150,10,P
FieldValueMeaning
An1Channel index.
ch_idVAChannel name.
phAPhase. Readers that rely on it lose a phase when a recorder writes something else here, so the name is worth checking too.
ccbmBUS1Circuit component being monitored: the bus, line or transformer the channel is on.
uukVUnit. The prefix matters: a value of 76.2 in kV is 76,200 V.
a0.005Multiplier: the size of one raw count in the channel’s unit.
b0Offset added after the multiplier.
skew0Time skew of this channel, in microseconds, against the sampling instant.
min, max-32767, 32767The range of the raw values. For a 2-byte binary file, the integer range.
primary1150Primary side of the instrument-transformer ratio (1999 and later).
secondary10Secondary side of the ratio.
PSPWhether a × raw + b gives a primary (P) or secondary (S) value.

From a raw count to kilovolts

A raw value of 15,240 in the VA column of the .dat becomes 0.005 × 15240 + 0 = 76.2 kV. The flag is P, so 76.2 kV is the primary value: the phase-to-neutral voltage on the 132 kV bus. The secondary value the relay saw is 76.2 × 10 / 1150 = 0.663 kV, or 663 V.

Most records that show currents a thousand times too large, or voltages in the wrong unit, have a unit prefix or a P/S flag that does not match the scaling. The COMTRADE file checker flags a file whose channels declare a ratio but were never scaled.

Where to go from here

The rest of the format, the .dat, .hdr, .inf and single-file .cff, is in the COMTRADE file format explained. To see this record, open FDR-2214 in SagSwell, or convert it to CSV and look at the numbers yourself.

Questions people ask

What is a COMTRADE .cfg file?
The configuration file of a COMTRADE record: plain text that names the station and recorder, lists every channel with its unit, scaling and transformer ratio, and gives the sampling rates, the start and trigger times and the data format of the .dat. Without it, the numbers in the .dat cannot be turned into volts and amps.
How are COMTRADE sample values scaled?
Each analog value is a × raw + b, with a and b from the channel’s line in the .cfg. The result is in the channel’s unit (for example kV) and is a primary or secondary value according to the P/S flag at the end of the line.
What do the primary and secondary fields mean?
They are the instrument-transformer ratio for the channel, primary over secondary. The P/S flag says which side a × raw + b gives. To go from secondary to primary, multiply by primary/secondary; from primary to secondary, divide.
Why is the date in my .cfg read the wrong way round?
The standard writes dates as dd/mm/yyyy (1999 and 2013) but some recorders write mm/dd/yyyy. When both numbers are 12 or less nothing in the file says which is which, so a careful reader reports the date as ambiguous rather than guessing silently.

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

Free tools

More guides