Skip to main content
18-Opal
April 7, 2017
Solved

How to Read a Binary COMTRADE Data File

  • April 7, 2017
  • 2 replies
  • 41985 views

Does anyone know how I can read a binary comtrade data file.  In this case "File.dat"

What is comtrade? See https://en.wikipedia.org/wiki/Comtrade.

I am interested in displaying the File.dat The others are easy to open in mathcad.

Once I can view it then I can do further processing to it in mathcad

Thanks.

Best answer by LucMeekes

The data file information is specified in IEEE standard C37.111, which has become an IEC standard in 2001.

See here:https://webstore.iec.ch/preview/info_iec60255-24%7Bed2.0%7Db.pdf

Success!

Luc

2 replies

23-Emerald IV
April 7, 2017

The .hdr (header) file is an XML formatted file.

The .dat (data) file appears to be a binary data file.

The .cfg (configuration) file is a comma separated values (.csv) file.

While Mathcad can 'read' all these files (the first two with the READBIN function, the last one with READPRN), it cannot interpret them.

You'll have to know the format and meanings of fields, then you can write Mathcad programs to actually interpret the files.

Alternatively, if you have c-code that can interpret these files, you could wrap that into a User-DLL that adds the specific functions to Mathcad.

Success!

Luc

LucMeekes23-Emerald IVAnswer
23-Emerald IV
April 8, 2017

The data file information is specified in IEEE standard C37.111, which has become an IEC standard in 2001.

See here:https://webstore.iec.ch/preview/info_iec60255-24%7Bed2.0%7Db.pdf

Success!

Luc

23-Emerald IV
April 10, 2017

It's done.

Results:

Let me know if you like it.

Luc

18-Opal
April 11, 2017

Looks great. But where do you actually give the full path to the files. When I try it sees the "." cfg then does a subscript. Could you give a screen capture of where you actually point the mathcad to the actual files. Thanks for  your effort. You have put a lot of work into it. Genius!

18-Opal
April 11, 2017

I get this error:

File Error.png