Example Code

IEEE COMTRADE LIBRARY

Code and Documents

Attachment

Overview

This library uses the COMTRADE format to gather data vectors and write them to a COMTRADE file.

Description

The COMTRADE format is a standardized file format used in power system monitoring. The measurements are recorded in ASCII or BINARY format. COMTRADE files always come by pairs: The ".CFG" file describing the configuration: number of analog and digital channels, sampling rate, scale factors, etc. and the ".DAT" file containing the data the library gathers. The library file contains a VI which reads COMTRADE files,  a VI which writes vectors of data to COMTRADE files, a VI which creates only the ".CFG" file, and a VI which appends a buffer to an existing ".DAT" file. The format chosen for this example is to bundle a time vector with each measurement channel (easy to plot in XY graph). Analog and digital channel descriptions are represented by an array of clusters. For any comment, please feel free to contact me.  

Steps to Implement or Execute Code

  1. Download the COMTRADE.llb file
  2. Select which VI you would like to use
    • Comtrade Config Writer.vi
    • Comtrade Reader byte.vi
    • Comtrade Writer optimized buffered.vi
    • Comtrade Writer optimized.vi
  3. Configure the front panel controls for the example you are using
  4. Run the VI

Requirements to Run

Software

LabVIEW 2010

Hardware

N/A

Additional Images

LLB Manager With Comtrade Examples

LLB MAn.png

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
hafizi83
Member
Member
on

Hello..

Is the attachment contains many comtrade files presenting many types of fault and disturbance? i have downloaded the attachment but i cant open it? Could u help me. Tq sir.

Himanshu_Goyal
Active Participant
Active Participant
on

You done Great Job.......:-)

Thanks and Regards
Himanshu Goyal | LabVIEW Engineer- Power System Automation
Values that steer us ahead: Passion | Innovation | Ambition | Diligence | Teamwork
It Only gets BETTER!!!
AlexDarsigny
Member
Member
on

Hi,

I'm trying to use this library to write COMTRADE files. My objective is to read a csv file containing a time vector and several signals vectors and convert it into COMTRADE files. My main problem is that I can't find where I have to put my input data (from the csv) in order to obtain COMTRADE files.

Do you have an example vi that uses "Comtrade Writer optimized.vi".

Thank you!

Contributors