Importing COMTRADE Files Into MathCAD
Importing COMTRADE Files Into MathCAD
Each COMTRADE “file” consists of three text files (assuming that you created the COMTRADE files in one
of the standard text formats). So for example, if you created a COMTRADE file as: FLL75 you will find that
you have three files:
1. FLL75.DAT contains the numerical data
2. FLL75.CFG configuration information cross-referencing variables stored in DAT file
3. FLL.HDR informaton about how the file was created.
We are interested in reading both the *.CFG and *DAT files into MathCAD. The *.CFG file will be read into a
MathCAD array called “config” and the DAT file into an array called “data.”
1.3. Right click on the floppy disk, resulting in the following menu:
ECE 525 Session 19, Page 2/6
Power Systems Protection and Relaying Fall 2016
1.4. Select “Choose File”, which opens a dialog box:
1.5. Leave the file type as “Text Files (*.dat, *.csv, *.txt)” and browse to directory where you have the
COMTRADE files saved. Since only one of the files associated with a COMTRADE “file” has an
extension that MathCAD identifies as text you will see one listing for each COMTRADE file.
1.6. Select the COMTRADE file you want to open by left clicking on the file name. That name will appear
in the “File name:” field of the dialog window:
ECE 525 Session 19, Page 3/6
Power Systems Protection and Relaying Fall 2016
1.7. Since we are reading the file into the “config” array, we need to read the *.CFG file you have two
options (do not change the file type to one that supports a .cfg extension!):
b. Type a period after the FSLG75, which will result in a pop-up menu showing all file
extensions for FSLG75 (if you are short on memory or have pop-ups turned off this won’t
happen) as follows:
c. Select the FSLG75.cfg to load it into the variable and hit “Open” and the file associated with
the floppy icon will become:
1.8. Repeat steps 1-6 for the “data:=” floppy. You don’t need to do step 7, since the extension *.dat is a
default format for text files. You should load the *.DAT file to go with the *.CFG you opened above,
resulting in:
ECE 525 Session 19, Page 4/6
Power Systems Protection and Relaying Fall 2016
2. MathCAD 13-15
3.1 Open the Mathcad sheet with your MathCAD 13 program.
3.2 Select the floppy disk icon for the config data:
Note that the underlined part of the selection does not include
the word config. This will matter.
3.3 Right click on the floppy disk, resulting in the following menu (note that this menu differs from the
one above for earlier versions of MathCAD):
3.4 Select “Properties” as shown above, resulting in the dialog box below:
3.5 Leave the “File format:” as text. Select browse to move to the directory where your COMTRADE
files are saved.
ECE 525 Session 19, Page 5/6
Power Systems Protection and Relaying Fall 2016
3.6 Select the COMTRADE file you want to open by left clicking on the file name. That name will appear
in the “File name:” field of the dialog window:
3.7 Since we are reading the file into the “config” array, we need to read the *.CFG file you have two
options (do not change the file type to one that supports a .cfg extension!):
a. Type “FSLG75.cfg” in the “File name:” field
b. Type a period after the FSLG75, which will result in a pop-up menu showing all file
extensions for FSLG75 (if you are short on memory or have pop-ups turned off this won’t
happen) as follows:
c. Select the FSLG75.cfg to load it into the variable and hit “Open” and the file associated with
the floppy icon will become:
ECE 525 Session 19, Page 6/6
Power Systems Protection and Relaying Fall 2016
3.8 Repeat steps 1-6 for the “data:=” floppy. You don’t need to do step 7, since the extension *.dat is a
default format for text files. You should load the *.DAT file to go with the *.CFG you opened above,
resulting in:
You will need to repeat these procedures for each COMTRADE file you read into the relay model.
You will need to repeat these procedures for each COMTRADE file you read into the relay model.