0% found this document useful (0 votes)
95 views6 pages

Importing COMTRADE Files Into MathCAD

1. COMTRADE files contain numerical data, configuration information, and metadata about how the file was created. They consist of three text files with extensions .DAT, .CFG, and .HDR. 2. To import COMTRADE files into MathCAD, the .CFG file is read into an array called "config" and the .DAT file into an array called "data". 3. For MathCAD 12 and earlier, the files are imported by selecting the floppy disk icon, choosing the file, and repeating for the other file. For MathCAD 13 and later, the "Properties" menu is used and the file type must be specified as text.

Uploaded by

Nia Taniyah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
95 views6 pages

Importing COMTRADE Files Into MathCAD

1. COMTRADE files contain numerical data, configuration information, and metadata about how the file was created. They consist of three text files with extensions .DAT, .CFG, and .HDR. 2. To import COMTRADE files into MathCAD, the .CFG file is read into an array called "config" and the .DAT file into an array called "data". 3. For MathCAD 12 and earlier, the files are imported by selecting the floppy disk icon, choosing the file, and repeating for the other file. For MathCAD 13 and later, the "Properties" menu is used and the file type must be specified as text.

Uploaded by

Nia Taniyah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

ECE 525 Session 19, Page 1/6

Power Systems Protection and Relaying Fall 2016

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 12 and Earlier


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 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!):

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:

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.

3. MathCAD Prime 2.0 or 3.0


3.1 Open the Mathcad Prime sheet with your MathCAD Prime program.
3.2 Update the path in the “config:=READFILE(“”,”delimited”) to indicate the location of the
COMTRADE configuration file for the case you are running. For example:

3.3 Repeat for the COMTRADE data file:

You will need to repeat these procedures for each COMTRADE file you read into the relay model.

You might also like