Comtrade Format Recording Data Display - Programmer Sought
Comtrade Format Recording Data Display - Programmer Sought
Comtrade Format Recording Data Display - Programmer Sought
search
ScopeView Download
renderings:
TOP
SFT2826 Download
renderings:
PQDiffractor Download
renderings:
TOP
If it can't be downloaded or can't be installed, it is recommended to replace the software.
There is always one for you.
- update 20181112 -
tool waveEV
The tool can be downloaded directly, but since there are 30 points downloaded on CSDN,
it is not convenient to directly link Need to leave a message *Leave the mailbox *
-update completed-
TOP
Finally, introduce the use of MATLAB to display comtrade
recordings using the GUI.
The rst method can be read using the read_comtrade
function.COMTRADE reader
I will not introduce this first. I may add it later. Readers can refer to the connection. Download the
relevant file test.
The second method uses the GUI to display the recording
The Graphical User Interface (GUI), also known as the Graphical User Interface, refers to a computer-
operated user interface that is graphically displayed. There are usually two ways to create a Matlab GUI
interface: one is to dynamically add controls directly using .m files; the other is to use GUIDE to quickly
visualize GUI interfaces.
Common format for transient data exchange (COMTRADE) is an IEEE protocol for data exchange between
digital fault recorders, digital protection, and microcomputer test equipment. A public data transmission
format standard proposed in 1991 and revised and improved in 1999. The standard provides an easy-to-
describe general format for data exchange that is followed by equipment manufactured by different
manufacturers. This paper uses the GUIDE method to create Matlab GUI to realize the Comtrade format
recording data display.
First, start matlab and enter guide in the command window.
TOP
Select the Blank GUI in the pop-up window.
Then in the pop-up window, the left side is the toolbar, you can drag and drop; the right side is the
display interface.
TOP
The left toolbar controls are in the order shown in the figure:
TOP
Double-click the control to display the properties of each control in the inspector, where the general
properties are (using the button control as an example):
TOP
Add static text, coordinates, and buttons to the presentation interface
Edit the static text to "Comtrade format recording data display"; edit coordinates to "fig"; edit button
to "select file".
TOP
To further edit the button's event response Callback, click the button in the red box in the figure:
TOP
1 function pushbutton1_Callback(hObject, eventdata, handles)
2 % hObject handle to pushbutton1 (see GCBO)
3 % eventdata reserved - to be defined in a future version of MATLAB
4 % handles structure with handles and user data (see GUIDATA)
5 [t,data]= ComtradeRead();
6 %% display
7 Axes(handles.fig); %Open the handle of the fig
8 subplot(311)
9 plot(t,data(:,1),'r',t,data(:,2),'g',t,data(:,3),'b')
10 subplot(312)
11 plot(t,data(:,4),'k')
12 subplot(313)
13 plot(t,data(:,5),'r',t,data(:,6),'g',t,data(:,7),'b')
Among them, [t, data] = ComtradeRead () source program is as follows, the relevant code has been
commented:
1 function [t,data] = ComtradeRead()
2 %% Import Data
3 [CFGFileName, PathName] = uigetfile('*.cfg', 'Select .CFG file'); %Open .CFG file
4 CFGPathFile = [PathName CFGFileName]; % reads the .CFG file path and name
5 DatFileName = [CFGFileName(:,1:length(CFGFileName)-4) '.dat']; %Get the .DAT file name
6 DATPathFile = [PathName DatFileName]; % Get the path to the .DAT file
7 %% read configuration file
8 CFGid = fopen(CFGPathFile);
9 CFG = textscan(CFGid,'%s','delimiter','\n');
10 fclose(CFGid);
11 CFG_len = length(CFG{1,1});
12 CFG_str = cell(size(CFG{1,1}));
13 for i = 1:CFG_len
14 temp_str = char(CFG{1,1}{i});
15 CFG_str{i}=textscan(temp_str,'%s','delimiter',',');
16 end
17 % number of channels
18 No_Ch = str2double(cell2mat(CFG_str{2,1}{1,1}(1)));
19 Ana_Ch = CFG_str{2,1}{1,1}{2,1};
20 Ana_Ch(length(Ana_Ch)) = [];
21 Ana_Ch = str2double(Ana_Ch);
22 Dig_Ch = CFG_str{2,1}{1,1}{3,1};
23 Dig_Ch(length(Dig_Ch)) = [];
24 Dig_Ch = str2double(Dig_Ch);
25 % Sampling frequency
26 samp_rate = textscan(cell2mat(CFG_str{5+No_Ch,1}{1,1}(1)),'%f');
27 samp_rate = samp_rate{1,1};
28 % Data length
TOP
29 dat_len = textscan(cell2mat(CFG_str{5+No_Ch,1}{1,1}(2)),'%f');
30 dat_len = dat_len{1,1};
31 % storage format
32 format=char(CFG_str{8+No_Ch,1}{1,1}(1));
33 %% read data file
34 DAT_id = fopen(DATPathFile);
35 algdat = zeros(dat_len,Ana_Ch+2);
36 num = zeros(dat_len,1);
37 time = zeros(dat_len,1);
38 if strcmpi(format, 'BINARY')
39 for i = 1:dat_len
40 num(i) = fread(DAT_id,1,'int32');
41 time(i) = fread(DAT_id,1,'int32');
42 row_array = fread(DAT_id,Ana_Ch+ceil(Dig_Ch/16),'int16');
43 for j=3:Ana_Ch+2
44 algdat(i,j) = row_array(j-2);
45 end
46 end
47 algdat(:,1) = num;
48 algdat(:,2) = time;
49 else
50 DAT = textscan(DAT_id, '%s', 'delimiter', '\n');
51 for i = 1:dat_len
52 DAT_str = textscan(char(DAT{1,:}(i)), '%n', 'delimiter', ',');
53 for j=1:Ana_Ch+2
54 algdat(i,j) = dat_string(j);
55 end
56 end
57 end
58 fclose(DAT_id);
59 t = algdat(:,2)./1000;
60 %% get the final data
61 data = zeros(dat_len, Ana_Ch);
62 for i = 1:Ana_Ch
63 j = i+2;
64 var_string = strcat('Ch',char((CFG_str{j,1}{1,1}{1,1})));
65 multiplier = str2double(CFG_str{j,1}{1,1}{6,1});
66 offset = str2double(CFG_str{j,1}{1,1}{7,1});
67 data(:,i) = algdat(:,i+2)*multiplier+offset;
68 end
69 end
TOP
Click the Start button to run the GUI.
TOP
Select the appropriate .cfg file and run the following results:
TOP
Read TXT / Other Format Data, (display data format or MA
T data format in OpenCV pointer) to image display
SRC is a transformed MAT type data can perform regular MAT opera ons Or choose
Image1 or auto p =img1.ptrcv::Vec3b(i j); cPointB = p[j][0]; cPointG = p[j][1]; cPointR =
p[j][2]; to perform pixel read...
More Recommendation
Related Posts
COMTRADE format recording data analysis and func on realiza on (1)
JSON data format display
Data format - hierarchy display
Format display of json data
Swing version of power system fault recording comtrade file offline analysis
so ware
Velodyne VLP-16 data display and recording
Comtrade electric wave recorder file format descrip on (two PDF files in Chinese
and English)
JS JSON format display data
opengl display format data UYVY422
Support markdown data display format
Recommended Posts
LeetCode_434 Number of words in the string
Use of angularJS and VUE.JS
ubuntu18.04 server configura on p service
One ques on of the day Day4--leetcode45--jumping game II
PyTorch deep learning: 34 minutes quick start-autoencoder
POJ2315_Football Game_Nim game variant
vue makes a dynamically ac ve bullet box that can slide to any posi on on the
current screen
The range of binary search numbers
Linux first lesson knowledge
leetcode 8 String to Integer (atoi)
Related Tags
COMTRADE
Wave recorder
data pack
data
json
Comtrade Files format
javascript
vue.js
vue
jquery
TOP