You are on page 1of 6

ECE 525 Session 28, Page 1/6

Power Systems Protection and Relaying Fall 2010



Importing COMTRADE files into MathCAD
This handout will provide a brief overview on important COMTRADE format datafiles into MathCAD. The
procedures for MathCAD 2001i (also applies for earlier versions at least back to MathCAD 2000) will be
presented along with the procedures for MathCAD 13. One of these two procedures will apply for MathCAD
versions in between.

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. MathCAD 2000
1.1. Open the Mathcad sheet with your MathCAD program.
1.2. Select the floppy disk icon for the config data:

note the underlined part of the selection
1.3. Right click on the floppy disk, resulting in the following menu:

ECE 525 Session 28, Page 2/6
Power Systems Protection and Relaying Fall 2010

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 28, Page 3/6
Power Systems Protection and Relaying Fall 2010

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!):
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 wont
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 dont 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 28, Page 4/6
Power Systems Protection and Relaying Fall 2010

MathCAD 13
2.1. Open the Mathcad sheet with your MathCAD 13 program.
2.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.
2.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):

2.4. Select Properties as shown above, resulting in the dialog box below:

2.5. Leave the File format: as text. Select browse to move to the directory where your COMTRADE
files are saved.
ECE 525 Session 28, Page 5/6
Power Systems Protection and Relaying Fall 2010

2.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:

2.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 wont
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 28, Page 6/6
Power Systems Protection and Relaying Fall 2010

2.8. Repeat steps 1-6 for the data:= floppy. You dont 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 might also like